Skip to content

Commit d3877c9

Browse files
committed
feat(ui/tables): improve filtering, column controls, and list performance
1 parent f2e6da9 commit d3877c9

35 files changed

Lines changed: 2290 additions & 260 deletions

client/public/locales/en/common.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@
2828
"hideArchived": "Hide Archived",
2929
"showArchived": "Show Archived",
3030
"notAccessTitle": "You don't have permission to access",
31-
"hideColumns": "Hide Columns",
32-
"clearFilters": "Clear Filters"
31+
"hideColumns": "Columns",
32+
"clearFilters": "Clear Filters",
33+
"selectAll": "Select All",
34+
"selectNone": "Select None"
3335
},
3436
"warnWhenUnsavedChanges": "Are you sure you want to leave? You have unsaved changes.",
3537
"notifications": {
@@ -258,6 +260,7 @@
258260
"diameter": "Diameter",
259261
"weight": "Weight",
260262
"spool_weight": "Spool Weight",
263+
"spool_count": "Spool Count",
261264
"article_number": "Article Number",
262265
"registered": "Registered",
263266
"comment": "Comment",
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
import { Typography } from "antd";
2+
import SpoolIcon from "./spoolIcon";
3+
4+
interface ColorHexPreviewProps {
5+
colorHex?: string | null;
6+
multiColorHexes?: string | null;
7+
multiColorDirection?: string | null;
8+
}
9+
10+
const SMALL_TEXT_STYLE = {
11+
fontSize: 12,
12+
color: "rgba(255,255,255,0.45)",
13+
lineHeight: 1.2,
14+
};
15+
16+
const normalizeHex = (value: string) => `#${value.replace("#", "").toUpperCase()}`;
17+
18+
export default function ColorHexPreview({ colorHex, multiColorHexes, multiColorDirection }: Readonly<ColorHexPreviewProps>) {
19+
const colors =
20+
multiColorHexes
21+
?.split(",")
22+
.map((hex) => hex.trim())
23+
.filter((hex) => hex.length > 0)
24+
.map(normalizeHex) ?? [];
25+
26+
if (colors.length <= 1) {
27+
const singleColor = colorHex ? normalizeHex(colorHex) : colors[0];
28+
if (!singleColor) return null;
29+
return (
30+
<div style={{ display: "flex", flexDirection: "column", gap: 4 }}>
31+
<SpoolIcon color={singleColor} size="large" no_margin />
32+
<Typography.Text style={SMALL_TEXT_STYLE}>{singleColor}</Typography.Text>
33+
</div>
34+
);
35+
}
36+
37+
const isLongitudinal = multiColorDirection === "longitudinal";
38+
if (isLongitudinal) {
39+
return (
40+
<div style={{ display: "flex", flexDirection: "column", gap: 4 }}>
41+
{colors.map((hex, index) => (
42+
<div key={`${hex}-${index}`} style={{ display: "flex", alignItems: "center", gap: 8 }}>
43+
<div
44+
style={{
45+
width: 56,
46+
height: 22,
47+
borderRadius: 5,
48+
border: "1px solid rgba(255,255,255,0.22)",
49+
background: hex,
50+
}}
51+
/>
52+
<Typography.Text style={SMALL_TEXT_STYLE}>{hex}</Typography.Text>
53+
</div>
54+
))}
55+
</div>
56+
);
57+
}
58+
59+
return (
60+
<div style={{ display: "flex", alignItems: "flex-start", gap: 0 }}>
61+
{colors.map((hex, index) => (
62+
<div
63+
key={`${hex}-${index}`}
64+
style={{
65+
display: "flex",
66+
flexDirection: "column",
67+
alignItems: "center",
68+
width: 64,
69+
gap: 4,
70+
}}
71+
>
72+
<SpoolIcon color={hex} size="large" no_margin />
73+
<Typography.Text style={{ ...SMALL_TEXT_STYLE, textAlign: "center" }}>{hex}</Typography.Text>
74+
</div>
75+
))}
76+
</div>
77+
);
78+
}

0 commit comments

Comments
 (0)