@undevy-org/tablewright 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/components/data-table/AppliedStateChips.js +15 -6
- package/dist/es/components/data-table/ColumnFilterPopover.js +42 -29
- package/dist/es/components/data-table/CompoundFilterPopover.js +38 -22
- package/dist/es/components/data-table/FilterFormPanel.js +36 -18
- package/dist/es/components/data-table/FilterPopoverFooter.js +12 -4
- package/dist/es/hooks/table-orchestration/use-orchestration-actions.js +0 -2
- package/dist/es/hooks/table-orchestration-store.js +0 -7
- package/dist/es/hooks/useTableOrchestration.js +0 -4
- package/dist/tablewright.cjs +148 -97
- package/dist/types/components/data-table/AppliedStateChips.d.ts +13 -1
- package/dist/types/components/data-table/ColumnFilterPopover.d.ts +22 -1
- package/dist/types/components/data-table/CompoundFilterPopover.d.ts +19 -1
- package/dist/types/components/data-table/FilterFormPanel.d.ts +17 -1
- package/dist/types/components/data-table/FilterPopoverFooter.d.ts +8 -1
- package/dist/types/hooks/table-orchestration/use-orchestration-actions.d.ts +0 -1
- package/dist/types/hooks/table-orchestration-store.d.ts +0 -4
- package/dist/types/hooks/useTableOrchestration.d.ts +0 -4
- package/dist/types/index.d.ts +5 -1
- package/package.json +7 -2
package/dist/tablewright.cjs
CHANGED
|
@@ -1200,16 +1200,24 @@ const ViewChip = React__namespace.forwardRef(
|
|
|
1200
1200
|
}
|
|
1201
1201
|
);
|
|
1202
1202
|
ViewChip.displayName = "ViewChip";
|
|
1203
|
+
const DEFAULT_LABELS$5 = {
|
|
1204
|
+
apply: "Apply",
|
|
1205
|
+
clear: "Clear"
|
|
1206
|
+
};
|
|
1203
1207
|
function FilterPopoverFooter({
|
|
1204
1208
|
onApply,
|
|
1205
1209
|
onClear,
|
|
1206
|
-
|
|
1207
|
-
|
|
1210
|
+
labels: labelOverrides,
|
|
1211
|
+
applyLabel,
|
|
1212
|
+
clearLabel,
|
|
1208
1213
|
className
|
|
1209
1214
|
}) {
|
|
1215
|
+
const labels = { ...DEFAULT_LABELS$5, ...labelOverrides };
|
|
1216
|
+
const apply = applyLabel ?? labels.apply;
|
|
1217
|
+
const clear = clearLabel ?? labels.clear;
|
|
1210
1218
|
return /* @__PURE__ */ jsxRuntime.jsxs(ButtonFooter, { className: cn("px-3 py-2.5", className), children: [
|
|
1211
|
-
onClear && /* @__PURE__ */ jsxRuntime.jsx(Button, { type: "button", variant: "secondary", size: "sm", onClick: onClear, children:
|
|
1212
|
-
/* @__PURE__ */ jsxRuntime.jsx(Button, { type: "button", size: "sm", onClick: onApply, children:
|
|
1219
|
+
onClear && /* @__PURE__ */ jsxRuntime.jsx(Button, { type: "button", variant: "secondary", size: "sm", onClick: onClear, children: clear }),
|
|
1220
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button, { type: "button", size: "sm", onClick: onApply, children: apply })
|
|
1213
1221
|
] });
|
|
1214
1222
|
}
|
|
1215
1223
|
function Root({
|
|
@@ -2366,7 +2374,7 @@ function ExpiryTimestampCell({ value, timestampMs }) {
|
|
|
2366
2374
|
relativeLabel && /* @__PURE__ */ jsxRuntime.jsx("div", { className: `text-[11px] ${urgencyClass[urgency]}`, children: relativeLabel })
|
|
2367
2375
|
] });
|
|
2368
2376
|
}
|
|
2369
|
-
const DEFAULT_LABELS$
|
|
2377
|
+
const DEFAULT_LABELS$4 = {
|
|
2370
2378
|
sort: "Sort",
|
|
2371
2379
|
sortByColumn: (label) => `Sort by ${label}`,
|
|
2372
2380
|
ascending: "Ascending",
|
|
@@ -2428,7 +2436,7 @@ function ColumnHeaderMenu({
|
|
|
2428
2436
|
menuWidth = "w-[200px]"
|
|
2429
2437
|
}) {
|
|
2430
2438
|
const [open, setOpen] = React.useState(false);
|
|
2431
|
-
const labels = { ...DEFAULT_LABELS$
|
|
2439
|
+
const labels = { ...DEFAULT_LABELS$4, ...labelOverrides };
|
|
2432
2440
|
const isStacked = !!primaryLabel;
|
|
2433
2441
|
const isSingleSortable = !!label && !!onSort;
|
|
2434
2442
|
const isSortable = isStacked || isSingleSortable;
|
|
@@ -2732,7 +2740,7 @@ function isFilterValueEmpty(value) {
|
|
|
2732
2740
|
if (Array.isArray(value)) return value.length === 0;
|
|
2733
2741
|
return Object.values(value).every((x) => typeof x !== "number" && isFilterValueEmpty(x));
|
|
2734
2742
|
}
|
|
2735
|
-
const DEFAULT_LABELS$
|
|
2743
|
+
const DEFAULT_LABELS$3 = {
|
|
2736
2744
|
searchPlaceholder: "Search...",
|
|
2737
2745
|
addValuePlaceholder: "Add value...",
|
|
2738
2746
|
noData: "no data",
|
|
@@ -2744,6 +2752,9 @@ const DEFAULT_LABELS$2 = {
|
|
|
2744
2752
|
chipTo: "to",
|
|
2745
2753
|
chipMin: "min",
|
|
2746
2754
|
chipMax: "max",
|
|
2755
|
+
contains: "Contains",
|
|
2756
|
+
orBadge: "OR",
|
|
2757
|
+
numberInputPlaceholder: "0",
|
|
2747
2758
|
valuesCount: (n) => `${n} values`,
|
|
2748
2759
|
selectedCount: (n) => `${n} selected`
|
|
2749
2760
|
};
|
|
@@ -2774,8 +2785,11 @@ function ColumnFilterPopover({
|
|
|
2774
2785
|
chipClassName,
|
|
2775
2786
|
stats,
|
|
2776
2787
|
requestOpen,
|
|
2777
|
-
onRequestOpenHandled
|
|
2788
|
+
onRequestOpenHandled,
|
|
2789
|
+
labels: labelOverrides,
|
|
2790
|
+
footerLabels
|
|
2778
2791
|
}) {
|
|
2792
|
+
const labels = { ...DEFAULT_LABELS$3, ...labelOverrides };
|
|
2779
2793
|
const [isOpen, setIsOpen] = React.useState(false);
|
|
2780
2794
|
const onRequestOpenHandledRef = React.useRef(onRequestOpenHandled);
|
|
2781
2795
|
React.useEffect(() => {
|
|
@@ -2912,7 +2926,7 @@ function ColumnFilterPopover({
|
|
|
2912
2926
|
if (!textStats || textStats.type !== "text") {
|
|
2913
2927
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1 flex-wrap", children: [
|
|
2914
2928
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-[var(--text-tertiary)] whitespace-nowrap min-w-[54px]", children: label }),
|
|
2915
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "rounded bg-[var(--bg-secondary)] px-1.5 py-0.5 text-[11px] text-[var(--text-tertiary)] italic", children:
|
|
2929
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "rounded bg-[var(--bg-secondary)] px-1.5 py-0.5 text-[11px] text-[var(--text-tertiary)] italic", children: labels.noData })
|
|
2916
2930
|
] });
|
|
2917
2931
|
}
|
|
2918
2932
|
const { samples, totalUnique } = textStats;
|
|
@@ -2942,8 +2956,8 @@ function ColumnFilterPopover({
|
|
|
2942
2956
|
const filtText = filteredStats?.type === "text" ? filteredStats : null;
|
|
2943
2957
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-3 w-64 space-y-3", children: [
|
|
2944
2958
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-xs font-medium text-[var(--text-tertiary)] uppercase tracking-wider block", children: [
|
|
2945
|
-
|
|
2946
|
-
draftTags.length >= 2 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-1 text-[10px] font-semibold text-[var(--tag-blue-text)] bg-[var(--tag-blue-bg)] rounded px-1 py-0.5 uppercase", children:
|
|
2959
|
+
labels.contains,
|
|
2960
|
+
draftTags.length >= 2 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-1 text-[10px] font-semibold text-[var(--tag-blue-text)] bg-[var(--tag-blue-bg)] rounded px-1 py-0.5 uppercase", children: labels.orBadge })
|
|
2947
2961
|
] }),
|
|
2948
2962
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-1 rounded-md border border-[var(--border-subtle)] bg-[var(--bg-surface)] px-2 py-1.5 focus-within:border-[var(--border-focus)]", children: [
|
|
2949
2963
|
draftTags.map((tag) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -2970,7 +2984,7 @@ function ColumnFilterPopover({
|
|
|
2970
2984
|
{
|
|
2971
2985
|
autoFocus: true,
|
|
2972
2986
|
className: "flex-1 min-w-[60px] bg-transparent text-sm text-[var(--text-primary)] outline-none placeholder:text-[var(--text-tertiary)]",
|
|
2973
|
-
placeholder: draftTags.length === 0 ?
|
|
2987
|
+
placeholder: draftTags.length === 0 ? labels.searchPlaceholder : labels.addValuePlaceholder,
|
|
2974
2988
|
value: draftInput,
|
|
2975
2989
|
onChange: (e) => setDraftInput(e.target.value),
|
|
2976
2990
|
onKeyDown: handleTextKeyDown
|
|
@@ -2978,8 +2992,8 @@ function ColumnFilterPopover({
|
|
|
2978
2992
|
)
|
|
2979
2993
|
] }),
|
|
2980
2994
|
allText && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-t border-[var(--border-subtle)] pt-2 space-y-2", children: [
|
|
2981
|
-
renderTextRow(
|
|
2982
|
-
filteredStats !== null && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t border-[var(--border-subtle)] pt-1.5", children: renderTextRow(
|
|
2995
|
+
renderTextRow(labels.statsTextAllPrefix, allText),
|
|
2996
|
+
filteredStats !== null && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t border-[var(--border-subtle)] pt-1.5", children: renderTextRow(labels.statsTextFilteredPrefix, filtText) })
|
|
2983
2997
|
] })
|
|
2984
2998
|
] });
|
|
2985
2999
|
}
|
|
@@ -3018,7 +3032,7 @@ function ColumnFilterPopover({
|
|
|
3018
3032
|
if (!dateStats || dateStats.type !== "date") {
|
|
3019
3033
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1 flex-wrap", children: [
|
|
3020
3034
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-[var(--text-tertiary)] whitespace-nowrap min-w-[54px]", children: label }),
|
|
3021
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "rounded bg-[var(--bg-secondary)] px-1.5 py-0.5 text-[11px] text-[var(--text-tertiary)] italic", children:
|
|
3035
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "rounded bg-[var(--bg-secondary)] px-1.5 py-0.5 text-[11px] text-[var(--text-tertiary)] italic", children: labels.noData })
|
|
3022
3036
|
] });
|
|
3023
3037
|
}
|
|
3024
3038
|
const { min, max } = dateStats;
|
|
@@ -3046,7 +3060,7 @@ function ColumnFilterPopover({
|
|
|
3046
3060
|
className: chipCls(draftDate.from === min),
|
|
3047
3061
|
onClick: () => setDraftDate((prev) => ({ ...prev, from: min })),
|
|
3048
3062
|
children: [
|
|
3049
|
-
|
|
3063
|
+
labels.chipFrom,
|
|
3050
3064
|
" ",
|
|
3051
3065
|
formatChipDate(min)
|
|
3052
3066
|
]
|
|
@@ -3059,7 +3073,7 @@ function ColumnFilterPopover({
|
|
|
3059
3073
|
className: chipCls(draftDate.to === max),
|
|
3060
3074
|
onClick: () => setDraftDate((prev) => ({ ...prev, to: max })),
|
|
3061
3075
|
children: [
|
|
3062
|
-
|
|
3076
|
+
labels.chipTo,
|
|
3063
3077
|
" ",
|
|
3064
3078
|
formatChipDate(max)
|
|
3065
3079
|
]
|
|
@@ -3071,7 +3085,7 @@ function ColumnFilterPopover({
|
|
|
3071
3085
|
const filtDate = filteredStats?.type === "date" ? filteredStats : null;
|
|
3072
3086
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-3 w-64 space-y-4", children: [
|
|
3073
3087
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
3074
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-medium text-[var(--text-tertiary)] uppercase tracking-wider block", children:
|
|
3088
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-medium text-[var(--text-tertiary)] uppercase tracking-wider block", children: labels.chipFrom }),
|
|
3075
3089
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3076
3090
|
Input,
|
|
3077
3091
|
{
|
|
@@ -3082,7 +3096,7 @@ function ColumnFilterPopover({
|
|
|
3082
3096
|
)
|
|
3083
3097
|
] }),
|
|
3084
3098
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
3085
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-medium text-[var(--text-tertiary)] uppercase tracking-wider block", children:
|
|
3099
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-medium text-[var(--text-tertiary)] uppercase tracking-wider block", children: labels.chipTo }),
|
|
3086
3100
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3087
3101
|
Input,
|
|
3088
3102
|
{
|
|
@@ -3093,8 +3107,8 @@ function ColumnFilterPopover({
|
|
|
3093
3107
|
)
|
|
3094
3108
|
] }),
|
|
3095
3109
|
allDate && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-t border-[var(--border-subtle)] pt-2 space-y-2", children: [
|
|
3096
|
-
renderDateRow(
|
|
3097
|
-
filteredStats !== null && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t border-[var(--border-subtle)] pt-1.5", children: renderDateRow(
|
|
3110
|
+
renderDateRow(labels.statsAllPrefix, allDate),
|
|
3111
|
+
filteredStats !== null && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t border-[var(--border-subtle)] pt-1.5", children: renderDateRow(labels.statsFilteredPrefix, filtDate) })
|
|
3098
3112
|
] })
|
|
3099
3113
|
] });
|
|
3100
3114
|
}
|
|
@@ -3103,7 +3117,7 @@ function ColumnFilterPopover({
|
|
|
3103
3117
|
if (!numStats || numStats.type !== "number-range") {
|
|
3104
3118
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1 flex-wrap", children: [
|
|
3105
3119
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-[var(--text-tertiary)] whitespace-nowrap min-w-[54px]", children: label }),
|
|
3106
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "rounded bg-[var(--bg-secondary)] px-1.5 py-0.5 text-[11px] text-[var(--text-tertiary)] italic", children:
|
|
3120
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "rounded bg-[var(--bg-secondary)] px-1.5 py-0.5 text-[11px] text-[var(--text-tertiary)] italic", children: labels.noData })
|
|
3107
3121
|
] });
|
|
3108
3122
|
}
|
|
3109
3123
|
const { min, max } = numStats;
|
|
@@ -3134,7 +3148,7 @@ function ColumnFilterPopover({
|
|
|
3134
3148
|
className: chipCls(draftNumberFrom === String(min)),
|
|
3135
3149
|
onClick: () => setDraftNumberFrom(String(min)),
|
|
3136
3150
|
children: [
|
|
3137
|
-
|
|
3151
|
+
labels.chipMin,
|
|
3138
3152
|
" ",
|
|
3139
3153
|
min
|
|
3140
3154
|
]
|
|
@@ -3147,7 +3161,7 @@ function ColumnFilterPopover({
|
|
|
3147
3161
|
className: chipCls(draftNumberTo === String(max)),
|
|
3148
3162
|
onClick: () => setDraftNumberTo(String(max)),
|
|
3149
3163
|
children: [
|
|
3150
|
-
|
|
3164
|
+
labels.chipMax,
|
|
3151
3165
|
" ",
|
|
3152
3166
|
max
|
|
3153
3167
|
]
|
|
@@ -3159,13 +3173,13 @@ function ColumnFilterPopover({
|
|
|
3159
3173
|
const filtNum = filteredStats?.type === "number-range" ? filteredStats : null;
|
|
3160
3174
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-3 w-64 space-y-4", children: [
|
|
3161
3175
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
3162
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-medium text-[var(--text-tertiary)] uppercase tracking-wider block", children:
|
|
3176
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-medium text-[var(--text-tertiary)] uppercase tracking-wider block", children: labels.chipMin }),
|
|
3163
3177
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3164
3178
|
Input,
|
|
3165
3179
|
{
|
|
3166
3180
|
type: "number",
|
|
3167
3181
|
autoFocus: true,
|
|
3168
|
-
placeholder: allNum ? String(allNum.min) :
|
|
3182
|
+
placeholder: allNum ? String(allNum.min) : labels.numberInputPlaceholder,
|
|
3169
3183
|
value: draftNumberFrom,
|
|
3170
3184
|
onChange: (e) => setDraftNumberFrom(e.target.value),
|
|
3171
3185
|
onKeyDown: (e) => {
|
|
@@ -3178,12 +3192,12 @@ function ColumnFilterPopover({
|
|
|
3178
3192
|
)
|
|
3179
3193
|
] }),
|
|
3180
3194
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
3181
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-medium text-[var(--text-tertiary)] uppercase tracking-wider block", children:
|
|
3195
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-medium text-[var(--text-tertiary)] uppercase tracking-wider block", children: labels.chipMax }),
|
|
3182
3196
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3183
3197
|
Input,
|
|
3184
3198
|
{
|
|
3185
3199
|
type: "number",
|
|
3186
|
-
placeholder: allNum ? String(allNum.max) :
|
|
3200
|
+
placeholder: allNum ? String(allNum.max) : labels.numberInputPlaceholder,
|
|
3187
3201
|
value: draftNumberTo,
|
|
3188
3202
|
onChange: (e) => setDraftNumberTo(e.target.value),
|
|
3189
3203
|
onKeyDown: (e) => {
|
|
@@ -3196,8 +3210,8 @@ function ColumnFilterPopover({
|
|
|
3196
3210
|
)
|
|
3197
3211
|
] }),
|
|
3198
3212
|
allNum && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-t border-[var(--border-subtle)] pt-2 space-y-2", children: [
|
|
3199
|
-
renderNumRow(
|
|
3200
|
-
filteredStats !== null && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t border-[var(--border-subtle)] pt-1.5", children: renderNumRow(
|
|
3213
|
+
renderNumRow(labels.statsAllPrefix, allNum),
|
|
3214
|
+
filteredStats !== null && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t border-[var(--border-subtle)] pt-1.5", children: renderNumRow(labels.statsFilteredPrefix, filtNum) })
|
|
3201
3215
|
] })
|
|
3202
3216
|
] });
|
|
3203
3217
|
}
|
|
@@ -3214,21 +3228,21 @@ function ColumnFilterPopover({
|
|
|
3214
3228
|
}
|
|
3215
3229
|
if (value.length === 2) {
|
|
3216
3230
|
const joined = value.join(", ");
|
|
3217
|
-
return joined.length > 24 ?
|
|
3231
|
+
return joined.length > 24 ? labels.valuesCount(value.length) : joined;
|
|
3218
3232
|
}
|
|
3219
|
-
return
|
|
3233
|
+
return labels.valuesCount(value.length);
|
|
3220
3234
|
}
|
|
3221
3235
|
if (config.type === "enum" && Array.isArray(value)) {
|
|
3222
3236
|
if (value.length === 1) {
|
|
3223
3237
|
return config.options?.find((o) => o.value === value[0])?.label ?? value[0];
|
|
3224
3238
|
}
|
|
3225
|
-
return
|
|
3239
|
+
return labels.selectedCount(value.length);
|
|
3226
3240
|
}
|
|
3227
3241
|
if (config.type === "date") {
|
|
3228
3242
|
const { from, to } = getDateRange(value);
|
|
3229
3243
|
if (from && to) return `${from} — ${to}`;
|
|
3230
|
-
if (from) return `${
|
|
3231
|
-
if (to) return `${
|
|
3244
|
+
if (from) return `${labels.chipFrom} ${from}`;
|
|
3245
|
+
if (to) return `${labels.chipTo} ${to}`;
|
|
3232
3246
|
}
|
|
3233
3247
|
if (config.type === "number-range") {
|
|
3234
3248
|
const { from, to } = getNumberRange(value);
|
|
@@ -3257,20 +3271,33 @@ function ColumnFilterPopover({
|
|
|
3257
3271
|
className: "w-auto p-0 [box-shadow:var(--shadow-menu)] border-[var(--border-subtle)] flex flex-col max-h-[min(var(--radix-popover-content-available-height),520px)] overflow-hidden",
|
|
3258
3272
|
children: [
|
|
3259
3273
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 min-h-0 overflow-y-auto overscroll-contain", children: renderContent() }),
|
|
3260
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-shrink-0 bg-[var(--bg-surface)]", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3274
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-shrink-0 bg-[var(--bg-surface)]", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3275
|
+
FilterPopoverFooter,
|
|
3276
|
+
{
|
|
3277
|
+
onApply: handleApply,
|
|
3278
|
+
onClear: handleClear,
|
|
3279
|
+
labels: footerLabels
|
|
3280
|
+
}
|
|
3281
|
+
) })
|
|
3261
3282
|
]
|
|
3262
3283
|
}
|
|
3263
3284
|
)
|
|
3264
3285
|
] });
|
|
3265
3286
|
}
|
|
3266
|
-
const DEFAULT_LABELS$
|
|
3287
|
+
const DEFAULT_LABELS$2 = {
|
|
3267
3288
|
searchPlaceholder: "Search...",
|
|
3268
3289
|
addPlaceholder: "Add...",
|
|
3269
3290
|
contains: "Contains",
|
|
3291
|
+
orBadge: "OR",
|
|
3270
3292
|
chipMin: "min",
|
|
3271
3293
|
chipMax: "max",
|
|
3272
3294
|
statsAllPrefix: "All:",
|
|
3273
|
-
statsFilteredPrefix: "Filt:"
|
|
3295
|
+
statsFilteredPrefix: "Filt:",
|
|
3296
|
+
numberInputPlaceholder: "0",
|
|
3297
|
+
resetSectionTitle: (subLabel) => `Reset ${subLabel}`,
|
|
3298
|
+
filtersCount: (n) => `${n} filters`,
|
|
3299
|
+
subValuesCount: (n) => `${n} values`,
|
|
3300
|
+
subSelectedCount: (n) => `${n} selected`
|
|
3274
3301
|
};
|
|
3275
3302
|
function initDraft(sub, compound) {
|
|
3276
3303
|
const val = compound[sub.key];
|
|
@@ -3305,7 +3332,7 @@ function draftToValue(draft) {
|
|
|
3305
3332
|
const all = trimmed.length > 0 && !draft.tags.includes(trimmed) ? [...draft.tags, trimmed] : [...draft.tags];
|
|
3306
3333
|
return all.length > 0 ? all : void 0;
|
|
3307
3334
|
}
|
|
3308
|
-
function formatSubDisplay(sub, val) {
|
|
3335
|
+
function formatSubDisplay(sub, val, labels) {
|
|
3309
3336
|
if (isFilterValueEmpty(val)) return null;
|
|
3310
3337
|
if (sub.type === "number-range") {
|
|
3311
3338
|
const { from, to } = getNumberRange(val);
|
|
@@ -3319,14 +3346,14 @@ function formatSubDisplay(sub, val) {
|
|
|
3319
3346
|
const label = sub.options?.find((o) => o.value === val[0])?.label ?? val[0];
|
|
3320
3347
|
return `${sub.label}: ${label}`;
|
|
3321
3348
|
}
|
|
3322
|
-
return `${sub.label}: ${val.length}
|
|
3349
|
+
return `${sub.label}: ${labels.subSelectedCount(val.length)}`;
|
|
3323
3350
|
}
|
|
3324
3351
|
if (Array.isArray(val) && val.length > 0) {
|
|
3325
3352
|
if (val.length === 1) {
|
|
3326
3353
|
const display = val[0].length > 15 ? `${val[0].slice(0, 15)}…` : val[0];
|
|
3327
3354
|
return `${sub.label}: ${display}`;
|
|
3328
3355
|
}
|
|
3329
|
-
return `${sub.label}: ${val.length}
|
|
3356
|
+
return `${sub.label}: ${labels.subValuesCount(val.length)}`;
|
|
3330
3357
|
}
|
|
3331
3358
|
return null;
|
|
3332
3359
|
}
|
|
@@ -3339,8 +3366,11 @@ function CompoundFilterPopover({
|
|
|
3339
3366
|
chipClassName,
|
|
3340
3367
|
columnFilterStats,
|
|
3341
3368
|
requestOpen,
|
|
3342
|
-
onRequestOpenHandled
|
|
3369
|
+
onRequestOpenHandled,
|
|
3370
|
+
labels: labelOverrides,
|
|
3371
|
+
footerLabels
|
|
3343
3372
|
}) {
|
|
3373
|
+
const labels = { ...DEFAULT_LABELS$2, ...labelOverrides };
|
|
3344
3374
|
const subFilters = config.subFilters ?? [];
|
|
3345
3375
|
const compound = getCompoundValue(filter.value);
|
|
3346
3376
|
const [isOpen, setIsOpen] = React.useState(false);
|
|
@@ -3416,12 +3446,12 @@ function CompoundFilterPopover({
|
|
|
3416
3446
|
if (isFilterValueEmpty(compound)) return void 0;
|
|
3417
3447
|
const parts = [];
|
|
3418
3448
|
for (const sub of subFilters) {
|
|
3419
|
-
const display = formatSubDisplay(sub, compound[sub.key]);
|
|
3449
|
+
const display = formatSubDisplay(sub, compound[sub.key], labels);
|
|
3420
3450
|
if (display) parts.push(display);
|
|
3421
3451
|
}
|
|
3422
3452
|
if (parts.length === 0) return void 0;
|
|
3423
3453
|
const joined = parts.join(" & ");
|
|
3424
|
-
return joined.length > 30 ?
|
|
3454
|
+
return joined.length > 30 ? labels.filtersCount(parts.length) : joined;
|
|
3425
3455
|
};
|
|
3426
3456
|
const updateDraft = (key, updater) => {
|
|
3427
3457
|
setDrafts((prev) => ({ ...prev, [key]: updater(prev[key]) }));
|
|
@@ -3444,7 +3474,7 @@ function CompoundFilterPopover({
|
|
|
3444
3474
|
className: chipCls(draft.from === String(min)),
|
|
3445
3475
|
onClick: () => updateDraft(sub.key, (d) => ({ ...d, from: String(min) })),
|
|
3446
3476
|
children: [
|
|
3447
|
-
|
|
3477
|
+
labels.chipMin,
|
|
3448
3478
|
" ",
|
|
3449
3479
|
min.toLocaleString()
|
|
3450
3480
|
]
|
|
@@ -3457,7 +3487,7 @@ function CompoundFilterPopover({
|
|
|
3457
3487
|
className: chipCls(draft.to === String(max)),
|
|
3458
3488
|
onClick: () => updateDraft(sub.key, (d) => ({ ...d, to: String(max) })),
|
|
3459
3489
|
children: [
|
|
3460
|
-
|
|
3490
|
+
labels.chipMax,
|
|
3461
3491
|
" ",
|
|
3462
3492
|
max.toLocaleString()
|
|
3463
3493
|
]
|
|
@@ -3468,13 +3498,13 @@ function CompoundFilterPopover({
|
|
|
3468
3498
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3469
3499
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2", children: [
|
|
3470
3500
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 space-y-1", children: [
|
|
3471
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] font-semibold uppercase tracking-[0.1em] text-[var(--text-tertiary)] block", children:
|
|
3501
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] font-semibold uppercase tracking-[0.1em] text-[var(--text-tertiary)] block", children: labels.chipMin }),
|
|
3472
3502
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3473
3503
|
Input,
|
|
3474
3504
|
{
|
|
3475
3505
|
type: "number",
|
|
3476
3506
|
autoFocus: subFilters.indexOf(sub) === 0,
|
|
3477
|
-
placeholder: allNum ? String(allNum.min) :
|
|
3507
|
+
placeholder: allNum ? String(allNum.min) : labels.numberInputPlaceholder,
|
|
3478
3508
|
value: draft.from,
|
|
3479
3509
|
onChange: (e) => updateDraft(sub.key, (prev) => ({
|
|
3480
3510
|
...prev,
|
|
@@ -3490,12 +3520,12 @@ function CompoundFilterPopover({
|
|
|
3490
3520
|
)
|
|
3491
3521
|
] }),
|
|
3492
3522
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 space-y-1", children: [
|
|
3493
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] font-semibold uppercase tracking-[0.1em] text-[var(--text-tertiary)] block", children:
|
|
3523
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] font-semibold uppercase tracking-[0.1em] text-[var(--text-tertiary)] block", children: labels.chipMax }),
|
|
3494
3524
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3495
3525
|
Input,
|
|
3496
3526
|
{
|
|
3497
3527
|
type: "number",
|
|
3498
|
-
placeholder: allNum ? String(allNum.max) :
|
|
3528
|
+
placeholder: allNum ? String(allNum.max) : labels.numberInputPlaceholder,
|
|
3499
3529
|
value: draft.to,
|
|
3500
3530
|
onChange: (e) => updateDraft(sub.key, (prev) => ({
|
|
3501
3531
|
...prev,
|
|
@@ -3512,8 +3542,8 @@ function CompoundFilterPopover({
|
|
|
3512
3542
|
] })
|
|
3513
3543
|
] }),
|
|
3514
3544
|
allNum && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-t border-[var(--border-subtle)] mt-3 pt-2 space-y-2", children: [
|
|
3515
|
-
renderNumRow(
|
|
3516
|
-
filtNum && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t border-[var(--border-subtle)] pt-1.5", children: renderNumRow(
|
|
3545
|
+
renderNumRow(labels.statsAllPrefix, allNum),
|
|
3546
|
+
filtNum && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t border-[var(--border-subtle)] pt-1.5", children: renderNumRow(labels.statsFilteredPrefix, filtNum) })
|
|
3517
3547
|
] })
|
|
3518
3548
|
] });
|
|
3519
3549
|
};
|
|
@@ -3610,8 +3640,8 @@ function CompoundFilterPopover({
|
|
|
3610
3640
|
};
|
|
3611
3641
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3612
3642
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[10px] font-semibold uppercase tracking-[0.1em] text-[var(--text-tertiary)] block mb-2", children: [
|
|
3613
|
-
|
|
3614
|
-
draft.tags.length >= 2 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-1 text-[10px] font-semibold text-[var(--tag-blue-text)] bg-[var(--tag-blue-bg)] rounded px-1 py-0.5 uppercase", children:
|
|
3643
|
+
labels.contains,
|
|
3644
|
+
draft.tags.length >= 2 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-1 text-[10px] font-semibold text-[var(--tag-blue-text)] bg-[var(--tag-blue-bg)] rounded px-1 py-0.5 uppercase", children: labels.orBadge })
|
|
3615
3645
|
] }),
|
|
3616
3646
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-1 rounded-md border border-[var(--border-subtle)] bg-[var(--bg-surface)] px-2 py-1.5 focus-within:border-[var(--border-focus)]", children: [
|
|
3617
3647
|
draft.tags.map((tag) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -3641,7 +3671,7 @@ function CompoundFilterPopover({
|
|
|
3641
3671
|
{
|
|
3642
3672
|
autoFocus: subFilters.indexOf(sub) === 0,
|
|
3643
3673
|
className: "flex-1 min-w-[50px] bg-transparent text-sm text-[var(--text-primary)] outline-none placeholder:text-[var(--text-tertiary)]",
|
|
3644
|
-
placeholder: draft.tags.length === 0 ?
|
|
3674
|
+
placeholder: draft.tags.length === 0 ? labels.searchPlaceholder : labels.addPlaceholder,
|
|
3645
3675
|
value: draft.input,
|
|
3646
3676
|
onChange: (e) => updateDraft(sub.key, (prev) => ({ ...prev, input: e.target.value })),
|
|
3647
3677
|
onKeyDown: handleTextKeyDown
|
|
@@ -3649,8 +3679,8 @@ function CompoundFilterPopover({
|
|
|
3649
3679
|
)
|
|
3650
3680
|
] }),
|
|
3651
3681
|
allText && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-t border-[var(--border-subtle)] mt-3 pt-2 space-y-2", children: [
|
|
3652
|
-
renderTextRow(
|
|
3653
|
-
filtText && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t border-[var(--border-subtle)] pt-1.5", children: renderTextRow(
|
|
3682
|
+
renderTextRow(labels.statsAllPrefix, allText),
|
|
3683
|
+
filtText && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t border-[var(--border-subtle)] pt-1.5", children: renderTextRow(labels.statsFilteredPrefix, filtText) })
|
|
3654
3684
|
] })
|
|
3655
3685
|
] });
|
|
3656
3686
|
};
|
|
@@ -3732,7 +3762,7 @@ function CompoundFilterPopover({
|
|
|
3732
3762
|
type: "button",
|
|
3733
3763
|
className: "text-[11px] text-[var(--text-tertiary)] hover:text-[var(--text-secondary)] transition-colors",
|
|
3734
3764
|
onClick: () => handleResetSection(sub.key),
|
|
3735
|
-
title:
|
|
3765
|
+
title: labels.resetSectionTitle(sub.label),
|
|
3736
3766
|
children: "✕"
|
|
3737
3767
|
}
|
|
3738
3768
|
)
|
|
@@ -3744,13 +3774,20 @@ function CompoundFilterPopover({
|
|
|
3744
3774
|
},
|
|
3745
3775
|
sub.key
|
|
3746
3776
|
)) }),
|
|
3747
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-shrink-0 bg-[var(--bg-surface)]", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3777
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-shrink-0 bg-[var(--bg-surface)]", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3778
|
+
FilterPopoverFooter,
|
|
3779
|
+
{
|
|
3780
|
+
onApply: handleApply,
|
|
3781
|
+
onClear: handleClearAll,
|
|
3782
|
+
labels: footerLabels
|
|
3783
|
+
}
|
|
3784
|
+
) })
|
|
3748
3785
|
]
|
|
3749
3786
|
}
|
|
3750
3787
|
)
|
|
3751
3788
|
] });
|
|
3752
3789
|
}
|
|
3753
|
-
const DEFAULT_LABELS = {
|
|
3790
|
+
const DEFAULT_LABELS$1 = {
|
|
3754
3791
|
clearAll: "Clear all",
|
|
3755
3792
|
columns: "Columns",
|
|
3756
3793
|
hiddenCount: (n) => `${n} hidden`
|
|
@@ -3772,8 +3809,13 @@ function AppliedStateChips({
|
|
|
3772
3809
|
onClearAll,
|
|
3773
3810
|
columnFilterStats,
|
|
3774
3811
|
requestOpenFilterId,
|
|
3775
|
-
onRequestOpenHandled
|
|
3812
|
+
onRequestOpenHandled,
|
|
3813
|
+
labels: labelOverrides,
|
|
3814
|
+
columnFilterLabels,
|
|
3815
|
+
compoundFilterLabels,
|
|
3816
|
+
filterPopoverFooterLabels
|
|
3776
3817
|
}) {
|
|
3818
|
+
const labels = { ...DEFAULT_LABELS$1, ...labelOverrides };
|
|
3777
3819
|
const hasFilters = filters.length > 0;
|
|
3778
3820
|
const hasSort = currentSort !== null;
|
|
3779
3821
|
const hasHiddenColumns = hiddenColumnsCount > 0;
|
|
@@ -3784,13 +3826,13 @@ function AppliedStateChips({
|
|
|
3784
3826
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-2 pb-3", children: [
|
|
3785
3827
|
/* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "secondary", onClick: onClearAll, className: "shrink-0", children: [
|
|
3786
3828
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { size: 14 }),
|
|
3787
|
-
|
|
3829
|
+
labels.clearAll
|
|
3788
3830
|
] }),
|
|
3789
3831
|
hasHiddenColumns && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3790
3832
|
FilterChip,
|
|
3791
3833
|
{
|
|
3792
|
-
label:
|
|
3793
|
-
value:
|
|
3834
|
+
label: labels.columns,
|
|
3835
|
+
value: labels.hiddenCount(hiddenColumnsCount),
|
|
3794
3836
|
onRemove: onResetColumns,
|
|
3795
3837
|
onClick: onOpenColumnsMenu,
|
|
3796
3838
|
className: "cursor-pointer"
|
|
@@ -3813,7 +3855,9 @@ function AppliedStateChips({
|
|
|
3813
3855
|
chipClassName: isEmpty ? "border-dashed" : void 0,
|
|
3814
3856
|
columnFilterStats,
|
|
3815
3857
|
requestOpen: filter.columnId === requestOpenFilterId,
|
|
3816
|
-
onRequestOpenHandled
|
|
3858
|
+
onRequestOpenHandled,
|
|
3859
|
+
labels: compoundFilterLabels,
|
|
3860
|
+
footerLabels: filterPopoverFooterLabels
|
|
3817
3861
|
},
|
|
3818
3862
|
filter.columnId
|
|
3819
3863
|
);
|
|
@@ -3829,7 +3873,9 @@ function AppliedStateChips({
|
|
|
3829
3873
|
chipClassName: isEmpty ? "border-dashed" : void 0,
|
|
3830
3874
|
stats: columnFilterStats?.[filter.columnId],
|
|
3831
3875
|
requestOpen: filter.columnId === requestOpenFilterId,
|
|
3832
|
-
onRequestOpenHandled
|
|
3876
|
+
onRequestOpenHandled,
|
|
3877
|
+
labels: columnFilterLabels,
|
|
3878
|
+
footerLabels: filterPopoverFooterLabels
|
|
3833
3879
|
},
|
|
3834
3880
|
filter.columnId
|
|
3835
3881
|
);
|
|
@@ -3864,6 +3910,21 @@ function hasActiveManagedFilters(filters, managedFieldIds) {
|
|
|
3864
3910
|
const managed = new Set(managedFieldIds);
|
|
3865
3911
|
return filters.some((f) => managed.has(f.columnId) && !isFilterValueEmpty(f.value));
|
|
3866
3912
|
}
|
|
3913
|
+
const DEFAULT_LABELS = {
|
|
3914
|
+
closeFiltersAriaLabel: "Close filters",
|
|
3915
|
+
closeFiltersTitle: "Close filters",
|
|
3916
|
+
apply: "Apply",
|
|
3917
|
+
clear: "Clear",
|
|
3918
|
+
anyPlaceholder: "Any",
|
|
3919
|
+
rangeFromPlaceholder: "From",
|
|
3920
|
+
rangeToPlaceholder: "To",
|
|
3921
|
+
fieldRangeFromAriaLabel: (fieldLabel) => `${fieldLabel} — from`,
|
|
3922
|
+
fieldRangeToAriaLabel: (fieldLabel) => `${fieldLabel} — to`,
|
|
3923
|
+
compoundSubRangeFromAriaLabel: (subLabel) => `${subLabel} — from`,
|
|
3924
|
+
compoundSubRangeToAriaLabel: (subLabel) => `${subLabel} — to`,
|
|
3925
|
+
compoundSubRangeFromPlaceholder: (subLabel) => `${subLabel} from`,
|
|
3926
|
+
compoundSubRangeToPlaceholder: (subLabel) => `${subLabel} to`
|
|
3927
|
+
};
|
|
3867
3928
|
function deriveInitialState(fields, filters) {
|
|
3868
3929
|
const byId = new Map(filters.map((f) => [f.columnId, f.value]));
|
|
3869
3930
|
const next = {};
|
|
@@ -3880,8 +3941,10 @@ function FilterFormPanel({
|
|
|
3880
3941
|
className,
|
|
3881
3942
|
id,
|
|
3882
3943
|
onClose,
|
|
3883
|
-
hiddenSubFilterKeys
|
|
3944
|
+
hiddenSubFilterKeys,
|
|
3945
|
+
labels: labelOverrides
|
|
3884
3946
|
}) {
|
|
3947
|
+
const labels = { ...DEFAULT_LABELS, ...labelOverrides };
|
|
3885
3948
|
const hiddenSubSet = React.useMemo(() => new Set(hiddenSubFilterKeys ?? []), [hiddenSubFilterKeys]);
|
|
3886
3949
|
const renderableFields = React.useMemo(
|
|
3887
3950
|
() => fields.filter((id2) => {
|
|
@@ -3956,8 +4019,8 @@ function FilterFormPanel({
|
|
|
3956
4019
|
type: "button",
|
|
3957
4020
|
variant: "ghost",
|
|
3958
4021
|
size: "icon",
|
|
3959
|
-
"aria-label":
|
|
3960
|
-
title:
|
|
4022
|
+
"aria-label": labels.closeFiltersAriaLabel,
|
|
4023
|
+
title: labels.closeFiltersTitle,
|
|
3961
4024
|
onClick: onClose,
|
|
3962
4025
|
className: "h-7 w-7",
|
|
3963
4026
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" })
|
|
@@ -3974,7 +4037,8 @@ function FilterFormPanel({
|
|
|
3974
4037
|
value: state[fieldId],
|
|
3975
4038
|
onChange: (v) => setField(fieldId, v),
|
|
3976
4039
|
fieldId,
|
|
3977
|
-
hiddenSubSet
|
|
4040
|
+
hiddenSubSet,
|
|
4041
|
+
labels
|
|
3978
4042
|
},
|
|
3979
4043
|
fieldId
|
|
3980
4044
|
);
|
|
@@ -3988,16 +4052,16 @@ function FilterFormPanel({
|
|
|
3988
4052
|
size: "sm",
|
|
3989
4053
|
onClick: handleClear,
|
|
3990
4054
|
disabled: isClearDisabled,
|
|
3991
|
-
children:
|
|
4055
|
+
children: labels.clear
|
|
3992
4056
|
}
|
|
3993
4057
|
),
|
|
3994
|
-
/* @__PURE__ */ jsxRuntime.jsx(Button, { type: "submit", size: "sm", children:
|
|
4058
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button, { type: "submit", size: "sm", children: labels.apply })
|
|
3995
4059
|
] }) })
|
|
3996
4060
|
]
|
|
3997
4061
|
}
|
|
3998
4062
|
);
|
|
3999
4063
|
}
|
|
4000
|
-
function Field({ config, value, onChange, fieldId, hiddenSubSet }) {
|
|
4064
|
+
function Field({ config, value, onChange, fieldId, hiddenSubSet, labels }) {
|
|
4001
4065
|
if (config.type === "text") {
|
|
4002
4066
|
const text = Array.isArray(value) ? value[0] ?? "" : "";
|
|
4003
4067
|
return /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "flex min-w-0 flex-col gap-1.5", children: [
|
|
@@ -4026,7 +4090,7 @@ function Field({ config, value, onChange, fieldId, hiddenSubSet }) {
|
|
|
4026
4090
|
value: selected || null,
|
|
4027
4091
|
onChange: (v) => onChange(v ? [v] : void 0),
|
|
4028
4092
|
options: config.options ?? [],
|
|
4029
|
-
placeholder:
|
|
4093
|
+
placeholder: labels.anyPlaceholder,
|
|
4030
4094
|
triggerAriaLabel: config.label,
|
|
4031
4095
|
triggerClassName: "h-9 min-w-0"
|
|
4032
4096
|
}
|
|
@@ -4047,7 +4111,7 @@ function Field({ config, value, onChange, fieldId, hiddenSubSet }) {
|
|
|
4047
4111
|
Input,
|
|
4048
4112
|
{
|
|
4049
4113
|
type: "date",
|
|
4050
|
-
"aria-label":
|
|
4114
|
+
"aria-label": labels.fieldRangeFromAriaLabel(config.label),
|
|
4051
4115
|
value: range.from ?? "",
|
|
4052
4116
|
onChange: update("from"),
|
|
4053
4117
|
className: "h-9 min-w-0 flex-1"
|
|
@@ -4057,7 +4121,7 @@ function Field({ config, value, onChange, fieldId, hiddenSubSet }) {
|
|
|
4057
4121
|
Input,
|
|
4058
4122
|
{
|
|
4059
4123
|
type: "date",
|
|
4060
|
-
"aria-label":
|
|
4124
|
+
"aria-label": labels.fieldRangeToAriaLabel(config.label),
|
|
4061
4125
|
value: range.to ?? "",
|
|
4062
4126
|
onChange: update("to"),
|
|
4063
4127
|
className: "h-9 min-w-0 flex-1"
|
|
@@ -4081,10 +4145,10 @@ function Field({ config, value, onChange, fieldId, hiddenSubSet }) {
|
|
|
4081
4145
|
Input,
|
|
4082
4146
|
{
|
|
4083
4147
|
type: "number",
|
|
4084
|
-
"aria-label":
|
|
4148
|
+
"aria-label": labels.fieldRangeFromAriaLabel(config.label),
|
|
4085
4149
|
value: range.from ?? "",
|
|
4086
4150
|
onChange: update("from"),
|
|
4087
|
-
placeholder:
|
|
4151
|
+
placeholder: labels.rangeFromPlaceholder,
|
|
4088
4152
|
className: "h-9 min-w-0 flex-1"
|
|
4089
4153
|
}
|
|
4090
4154
|
),
|
|
@@ -4092,10 +4156,10 @@ function Field({ config, value, onChange, fieldId, hiddenSubSet }) {
|
|
|
4092
4156
|
Input,
|
|
4093
4157
|
{
|
|
4094
4158
|
type: "number",
|
|
4095
|
-
"aria-label":
|
|
4159
|
+
"aria-label": labels.fieldRangeToAriaLabel(config.label),
|
|
4096
4160
|
value: range.to ?? "",
|
|
4097
4161
|
onChange: update("to"),
|
|
4098
|
-
placeholder:
|
|
4162
|
+
placeholder: labels.rangeToPlaceholder,
|
|
4099
4163
|
className: "h-9 min-w-0 flex-1"
|
|
4100
4164
|
}
|
|
4101
4165
|
)
|
|
@@ -4175,10 +4239,10 @@ function Field({ config, value, onChange, fieldId, hiddenSubSet }) {
|
|
|
4175
4239
|
Input,
|
|
4176
4240
|
{
|
|
4177
4241
|
type: "number",
|
|
4178
|
-
"aria-label":
|
|
4242
|
+
"aria-label": labels.compoundSubRangeFromAriaLabel(sub.label),
|
|
4179
4243
|
value: range.from ?? "",
|
|
4180
4244
|
onChange: updateRange("from"),
|
|
4181
|
-
placeholder:
|
|
4245
|
+
placeholder: labels.compoundSubRangeFromPlaceholder(sub.label),
|
|
4182
4246
|
className: "h-9 min-w-0 flex-1"
|
|
4183
4247
|
}
|
|
4184
4248
|
),
|
|
@@ -4186,10 +4250,10 @@ function Field({ config, value, onChange, fieldId, hiddenSubSet }) {
|
|
|
4186
4250
|
Input,
|
|
4187
4251
|
{
|
|
4188
4252
|
type: "number",
|
|
4189
|
-
"aria-label":
|
|
4253
|
+
"aria-label": labels.compoundSubRangeToAriaLabel(sub.label),
|
|
4190
4254
|
value: range.to ?? "",
|
|
4191
4255
|
onChange: updateRange("to"),
|
|
4192
|
-
placeholder:
|
|
4256
|
+
placeholder: labels.compoundSubRangeToPlaceholder(sub.label),
|
|
4193
4257
|
className: "h-9 min-w-0 flex-1"
|
|
4194
4258
|
}
|
|
4195
4259
|
)
|
|
@@ -4303,7 +4367,6 @@ function createTableOrchestrationStore({
|
|
|
4303
4367
|
page: 1,
|
|
4304
4368
|
rowsPerPage: initialRowsPerPage,
|
|
4305
4369
|
density: "normal",
|
|
4306
|
-
isRefreshing: false,
|
|
4307
4370
|
selectedIds: /* @__PURE__ */ new Set(),
|
|
4308
4371
|
activeView: defaultViewKey,
|
|
4309
4372
|
columnsMenuOpen: false,
|
|
@@ -4384,12 +4447,6 @@ function createTableOrchestrationStore({
|
|
|
4384
4447
|
setPage: (p) => set({ page: p }),
|
|
4385
4448
|
setRowsPerPage: (n) => set({ rowsPerPage: n, page: 1 }),
|
|
4386
4449
|
setDensity: (v) => set({ density: v }),
|
|
4387
|
-
startRefresh: (durationMs = 700) => {
|
|
4388
|
-
set({ isRefreshing: true });
|
|
4389
|
-
if (typeof window !== "undefined") {
|
|
4390
|
-
window.setTimeout(() => set({ isRefreshing: false }), durationMs);
|
|
4391
|
-
}
|
|
4392
|
-
},
|
|
4393
4450
|
setSelectedIds: (next) => set((s) => ({
|
|
4394
4451
|
selectedIds: typeof next === "function" ? next(s.selectedIds) : next
|
|
4395
4452
|
})),
|
|
@@ -4704,7 +4761,6 @@ function useOrchestrationActions({
|
|
|
4704
4761
|
() => store.getState().clearAll(defaultViewKey),
|
|
4705
4762
|
[defaultViewKey, store]
|
|
4706
4763
|
);
|
|
4707
|
-
const handleRefresh = React.useCallback(() => store.getState().startRefresh(), [store]);
|
|
4708
4764
|
const handleToggleRowSelection = React.useCallback(
|
|
4709
4765
|
(id) => store.getState().toggleRowSelection(id),
|
|
4710
4766
|
[store]
|
|
@@ -4767,7 +4823,6 @@ function useOrchestrationActions({
|
|
|
4767
4823
|
handleRemoveSort,
|
|
4768
4824
|
handleRemoveCustomFilter,
|
|
4769
4825
|
handleClearAll,
|
|
4770
|
-
handleRefresh,
|
|
4771
4826
|
handleToggleRowSelection,
|
|
4772
4827
|
handleToggleHeaderCheck,
|
|
4773
4828
|
handleExpandRow,
|
|
@@ -4848,7 +4903,6 @@ function useTableOrchestration(config) {
|
|
|
4848
4903
|
const storedPage = zustand.useStore(store, (s) => s.page);
|
|
4849
4904
|
const rowsPerPage = zustand.useStore(store, (s) => s.rowsPerPage);
|
|
4850
4905
|
const density = zustand.useStore(store, (s) => s.density);
|
|
4851
|
-
const isRefreshing = zustand.useStore(store, (s) => s.isRefreshing);
|
|
4852
4906
|
const storedSelectedIds = zustand.useStore(store, (s) => s.selectedIds);
|
|
4853
4907
|
const activeView = zustand.useStore(store, (s) => s.activeView);
|
|
4854
4908
|
const columnsMenuOpen = zustand.useStore(store, (s) => s.columnsMenuOpen);
|
|
@@ -4955,7 +5009,6 @@ function useTableOrchestration(config) {
|
|
|
4955
5009
|
handleRemoveSort,
|
|
4956
5010
|
handleRemoveCustomFilter,
|
|
4957
5011
|
handleClearAll,
|
|
4958
|
-
handleRefresh,
|
|
4959
5012
|
handleToggleRowSelection,
|
|
4960
5013
|
handleToggleHeaderCheck,
|
|
4961
5014
|
handleExpandRow,
|
|
@@ -4996,7 +5049,6 @@ function useTableOrchestration(config) {
|
|
|
4996
5049
|
rowsPerPage,
|
|
4997
5050
|
density,
|
|
4998
5051
|
setDensity,
|
|
4999
|
-
isRefreshing,
|
|
5000
5052
|
selectedIds,
|
|
5001
5053
|
setSelectedIds,
|
|
5002
5054
|
activeView,
|
|
@@ -5043,7 +5095,6 @@ function useTableOrchestration(config) {
|
|
|
5043
5095
|
handleRemoveSort,
|
|
5044
5096
|
handleRemoveCustomFilter,
|
|
5045
5097
|
handleClearAll,
|
|
5046
|
-
handleRefresh,
|
|
5047
5098
|
handleToggleRowSelection,
|
|
5048
5099
|
handleToggleHeaderCheck,
|
|
5049
5100
|
handleExpandRow,
|