@ishibashi0112/spreadsheet-grid 1.2.1 → 1.4.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.
Files changed (68) hide show
  1. package/API_REFERENCE.md +74 -28
  2. package/README.md +6 -6
  3. package/dist/CellEditorLayer.d.ts +2 -1
  4. package/dist/ColumnFilterPopover-BkvL8LdP.js +1062 -0
  5. package/dist/ColumnFilterPopover-cNVxOkoI.cjs +1 -0
  6. package/dist/editors/CustomCellEditor.d.ts +3 -2
  7. package/dist/editors/DateCellEditor.d.ts +2 -1
  8. package/dist/editors/NumberCellEditor.d.ts +2 -1
  9. package/dist/editors/SelectCellEditor.d.ts +5 -2
  10. package/dist/editors/TextCellEditor.d.ts +2 -1
  11. package/dist/hooks/useGridEditController.d.ts +1 -0
  12. package/dist/hooks/useGridTooltip.d.ts +3 -1
  13. package/dist/index.cjs +6 -6
  14. package/dist/index.js +2758 -2790
  15. package/dist/lite/ColumnFilterPopover-BXsxUZ-l.cjs +1 -0
  16. package/dist/lite/ColumnFilterPopover-DGBKLT_x.js +1063 -0
  17. package/dist/lite/contextMenu-C_EUynb4.cjs +1 -0
  18. package/dist/lite/contextMenu-Cb9KT0FS.js +109 -0
  19. package/dist/lite/createSpreadsheetGrid-CJinhQgY.js +4353 -0
  20. package/dist/lite/createSpreadsheetGrid-CQDpzjaZ.cjs +6 -0
  21. package/dist/lite/createSpreadsheetGrid.cjs +1 -1
  22. package/dist/lite/createSpreadsheetGrid.js +1 -1
  23. package/dist/lite/features/contextMenu.cjs +1 -1
  24. package/dist/lite/features/contextMenu.js +1 -1
  25. package/dist/lite/features/fillHandle.cjs +1 -1
  26. package/dist/lite/features/fillHandle.js +1 -1
  27. package/dist/lite/features/filtering.cjs +1 -1
  28. package/dist/lite/features/filtering.js +1 -1
  29. package/dist/lite/features/rowDrag.cjs +1 -1
  30. package/dist/lite/features/rowDrag.js +1 -1
  31. package/dist/lite/features/standard.cjs +1 -1
  32. package/dist/lite/features/standard.js +2 -2
  33. package/dist/lite/features/toolPanel.cjs +1 -1
  34. package/dist/lite/features/toolPanel.js +1 -1
  35. package/dist/lite/fillHandle-4pow6QTn.cjs +1 -0
  36. package/dist/lite/{fillHandle-CzA_uxgV.js → fillHandle-pS7c7vQ2.js} +30 -29
  37. package/dist/lite/{filtering-ReroATyh.js → filtering-BGPDN-wq.js} +2 -2
  38. package/dist/lite/{filtering-DDIQnB3a.cjs → filtering-BKaFSWIN.cjs} +1 -1
  39. package/dist/lite/{lazyPopups-C7Y7Kx8w.js → lazyPopups-CeNdPYJh.js} +1 -1
  40. package/dist/lite/{lazyPopups-B0DhlAYW.cjs → lazyPopups-Czv43vuQ.cjs} +1 -1
  41. package/dist/lite/rowDrag-Bb1xlVXa.cjs +1 -0
  42. package/dist/lite/rowDrag-Dvg4JlGR.js +115 -0
  43. package/dist/lite/{toolPanel-H94h6g2U.cjs → toolPanel-BVq7WR1O.cjs} +1 -1
  44. package/dist/lite/{toolPanel-DXG3w8Zp.js → toolPanel-CsBenuFQ.js} +1 -1
  45. package/dist/lite/toolPanelViews-8HccPGgN.cjs +1 -0
  46. package/dist/lite/{toolPanelViews-DwUa6rm1.js → toolPanelViews-uCxtFwWO.js} +139 -138
  47. package/dist/lite.cjs +1 -1
  48. package/dist/lite.js +7 -7
  49. package/dist/style.css +1 -1
  50. package/dist/style.layer.css +1 -1
  51. package/dist/toolPanelViews-BJi7W0Tz.cjs +1 -0
  52. package/dist/{toolPanelViews-DCpqVIEd.js → toolPanelViews-Dsp5WVVa.js} +139 -138
  53. package/dist/view/DetailToggleButton.d.ts +2 -1
  54. package/package.json +2 -2
  55. package/skills/spreadsheet-grid/SKILL.md +2 -2
  56. package/dist/ColumnFilterPopover-BEZ0T7Qo.cjs +0 -1
  57. package/dist/ColumnFilterPopover-CnocXZZn.js +0 -1056
  58. package/dist/lite/ColumnFilterPopover-BUCdIETo.cjs +0 -1
  59. package/dist/lite/ColumnFilterPopover-ulqfKfmD.js +0 -1056
  60. package/dist/lite/contextMenu-B6cpSlFr.js +0 -168
  61. package/dist/lite/contextMenu-VLz_wVlY.cjs +0 -1
  62. package/dist/lite/createSpreadsheetGrid-BxaYty_c.js +0 -4290
  63. package/dist/lite/createSpreadsheetGrid-CfUnI6Xl.cjs +0 -6
  64. package/dist/lite/fillHandle-CHJESnrk.cjs +0 -1
  65. package/dist/lite/rowDrag-D17wXvSj.cjs +0 -1
  66. package/dist/lite/rowDrag-WVJUKKL8.js +0 -157
  67. package/dist/lite/toolPanelViews-C4qswcP_.cjs +0 -1
  68. package/dist/toolPanelViews-CKKThiAQ.cjs +0 -1
@@ -0,0 +1,1062 @@
1
+ import { c as e, s as t, u as n } from "./useGridLocaleText-Drud4qg0.js";
2
+ import { t as r } from "./useVirtualizerCore-C1k6Aw8p.js";
3
+ import { t as i } from "./usePopupLocaleText-DJN10Asc.js";
4
+ import { useDeferredValue as a, useEffect as o, useMemo as s, useRef as c, useState as l, useSyncExternalStore as u } from "react";
5
+ import { cx as d } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/cx";
6
+ import { createPortal as f } from "react-dom";
7
+ import { isEscapePreventedInside as p } from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/escapeClaimController";
8
+ import { isImeComposingKeyEvent as m } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/domGuards";
9
+ import { formatLocaleText as h } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
10
+ import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
11
+ import { parseFilterDateText as y } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorValues";
12
+ import { toDateKey as b } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/filtering";
13
+ import { getEventTarget as x } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/shadowDom";
14
+ import { createDateRolloverStore as S } from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/dateRolloverStore";
15
+ import { normalizeDateFilterPresets as C } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/dateFilterPresets";
16
+ import { DEFAULT_FILTER_LOCALE_TEXT as w } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFilters";
17
+ import { keepFocusAfterPress as T } from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/popoverSupport";
18
+ import { resolveFocusWrapTarget as E } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/focusCycle";
19
+ import { filterSetOptionsBySearch as D, resolveSetFilterEnterAction as O } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/setFilterSearch";
20
+ import { isSetValueSelected as k } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/setFilterSelection";
21
+ import { DEFAULT_NUMBER_FILTER_DRAFT as A, NUMBER_FILTER_OPERATOR_OPTIONS as j, buildParsedNumberFilterFromDraft as M, filterOptionsByNumberCondition as N, numberFilterOperandCount as P } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/numberFilterCondition";
22
+ import { DEFAULT_TEXT_FILTER_DRAFT as F, TEXT_FILTER_OPERATOR_OPTIONS as I, buildParsedTextFilterFromDraft as L, filterOptionsByTextCondition as R, textFilterOperandCount as z } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/textFilterCondition";
23
+ import { DATE_FILTER_OPERATOR_OPTIONS as B, DEFAULT_DATE_FILTER_DRAFT as V, buildParsedDateFilterFromDraft as ee, dateFilterOperandCount as H, filterOptionsByDateCondition as te, normalizeFilterDateInputValue as U, resolveComboReferenceDate as ne } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/dateFilterCondition";
24
+ import { buildCalendarDayCells as W, buildYearGrid as G, formatFilterDateDisplay as re, yearGridStart as K } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/datePickerCalendar";
25
+ import { buildDateTreeRows as ie } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/dateFilterTree";
26
+ //#region src/view/FilterDateField.tsx
27
+ function ae({ value: e, onCommit: t, ariaLabel: n, inputRef: r, onRequestClose: a, align: s = "left" }) {
28
+ let u = i(), [f, p] = l(null), [S, C] = l(!1), [w, T] = l(!1), [E, D] = l("days"), [O, k] = l(() => (/* @__PURE__ */ new Date()).getFullYear()), [A, j] = l(() => (/* @__PURE__ */ new Date()).getMonth()), M = c(null), N = f ?? re(e), P = b(/* @__PURE__ */ new Date()) ?? "", F = () => {
29
+ if (f === null) return;
30
+ let e = f.trim();
31
+ if (e === "") {
32
+ t(""), p(null), C(!1);
33
+ return;
34
+ }
35
+ let n = y(e);
36
+ if (n === null) {
37
+ C(!0);
38
+ return;
39
+ }
40
+ t(n), p(null), C(!1);
41
+ }, I = () => {
42
+ let [t, n] = (e === "" ? P : e).split("-");
43
+ k(Number(t)), j(Number(n) - 1), D("days"), T(!0);
44
+ }, L = () => {
45
+ T(!1);
46
+ }, R = (e) => {
47
+ t(e), p(null), C(!1), L();
48
+ };
49
+ o(() => {
50
+ if (!w) return;
51
+ let e = (e) => {
52
+ let t = x(e, M.current ?? null);
53
+ t && M.current?.contains(t) || T(!1);
54
+ };
55
+ return document.addEventListener("pointerdown", e, !0), () => {
56
+ document.removeEventListener("pointerdown", e, !0);
57
+ };
58
+ }, [w]);
59
+ let z = (e) => {
60
+ if (e.stopPropagation(), e.key === "Enter") {
61
+ if (m(e.nativeEvent)) return;
62
+ e.preventDefault(), F(), L();
63
+ return;
64
+ }
65
+ if (e.key === "Escape") {
66
+ if (e.preventDefault(), w) {
67
+ L();
68
+ return;
69
+ }
70
+ a();
71
+ }
72
+ }, B = (e) => ({
73
+ onPointerDown: (t) => {
74
+ t.preventDefault(), t.stopPropagation(), e();
75
+ },
76
+ onKeyDown: (t) => {
77
+ if (t.stopPropagation(), t.key === "Enter" || t.key === " ") {
78
+ t.preventDefault(), e();
79
+ return;
80
+ }
81
+ if (t.key === "Escape") {
82
+ if (t.preventDefault(), w) {
83
+ L(), t.currentTarget.closest(".ssg-dp-root")?.querySelector(".ssg-dp-input")?.focus();
84
+ return;
85
+ }
86
+ a();
87
+ }
88
+ }
89
+ }), V = (e) => {
90
+ if (E === "days") {
91
+ let t = new Date(O, A + e, 1);
92
+ k(t.getFullYear()), j(t.getMonth());
93
+ return;
94
+ }
95
+ if (E === "months") {
96
+ k((t) => t + e);
97
+ return;
98
+ }
99
+ k((t) => t + e * 12);
100
+ }, ee = () => {
101
+ D((e) => e === "days" ? "months" : "years");
102
+ }, H = () => {
103
+ D((e) => e === "years" ? "months" : "days");
104
+ }, te = E === "days" ? h(u.calendarTitle, {
105
+ year: O,
106
+ month: A + 1
107
+ }) : E === "months" ? h(u.calendarYear, { year: O }) : `${K(O)} – ${K(O) + 11}`;
108
+ return /* @__PURE__ */ v("div", {
109
+ ref: M,
110
+ className: "ssg-dp-root",
111
+ children: [/* @__PURE__ */ v("div", {
112
+ className: d("ssg-dp-field", w && "ssg-dp-field--open", S && "ssg-dp-field--invalid"),
113
+ children: [/* @__PURE__ */ _("input", {
114
+ ref: r,
115
+ type: "text",
116
+ inputMode: "numeric",
117
+ value: N,
118
+ placeholder: "yyyy/mm/dd",
119
+ "aria-label": n,
120
+ "aria-invalid": S || void 0,
121
+ className: "ssg-dp-input",
122
+ onChange: (e) => {
123
+ p(e.target.value), C(!1);
124
+ },
125
+ onKeyDown: z,
126
+ onBlur: F
127
+ }), /* @__PURE__ */ _("button", {
128
+ type: "button",
129
+ className: "ssg-dp-cal-btn",
130
+ "aria-label": w ? u.calendarClose : u.calendarOpen,
131
+ ...B(() => {
132
+ w ? L() : I();
133
+ }),
134
+ children: /* @__PURE__ */ v("svg", {
135
+ width: "12",
136
+ height: "12",
137
+ viewBox: "0 0 16 16",
138
+ "aria-hidden": "true",
139
+ children: [
140
+ /* @__PURE__ */ _("rect", {
141
+ x: "1.5",
142
+ y: "2.5",
143
+ width: "13",
144
+ height: "12",
145
+ rx: "1.5",
146
+ fill: "none",
147
+ stroke: "currentColor"
148
+ }),
149
+ /* @__PURE__ */ _("line", {
150
+ x1: "1.5",
151
+ y1: "6",
152
+ x2: "14.5",
153
+ y2: "6",
154
+ stroke: "currentColor"
155
+ }),
156
+ /* @__PURE__ */ _("line", {
157
+ x1: "5",
158
+ y1: "1",
159
+ x2: "5",
160
+ y2: "4",
161
+ stroke: "currentColor"
162
+ }),
163
+ /* @__PURE__ */ _("line", {
164
+ x1: "11",
165
+ y1: "1",
166
+ x2: "11",
167
+ y2: "4",
168
+ stroke: "currentColor"
169
+ })
170
+ ]
171
+ })
172
+ })]
173
+ }), w && /* @__PURE__ */ v("div", {
174
+ className: d("ssg-dp-panel", s === "right" && "ssg-dp-panel--right"),
175
+ children: [
176
+ /* @__PURE__ */ v("div", {
177
+ className: "ssg-dp-nav",
178
+ children: [
179
+ /* @__PURE__ */ _("button", {
180
+ type: "button",
181
+ className: "ssg-dp-nav-btn",
182
+ "aria-label": u.calendarPrevious,
183
+ ...B(() => V(-1)),
184
+ children: "‹"
185
+ }),
186
+ /* @__PURE__ */ _("button", {
187
+ type: "button",
188
+ className: "ssg-dp-nav-title",
189
+ disabled: E === "years",
190
+ "aria-label": u.calendarChangeView,
191
+ ...B(ee),
192
+ children: te
193
+ }),
194
+ /* @__PURE__ */ _("button", {
195
+ type: "button",
196
+ className: "ssg-dp-nav-btn",
197
+ "aria-label": u.calendarNext,
198
+ ...B(() => V(1)),
199
+ children: "›"
200
+ })
201
+ ]
202
+ }),
203
+ E === "days" && /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("div", {
204
+ className: "ssg-dp-dow",
205
+ children: u.calendarWeekdays.map((e, t) => /* @__PURE__ */ _("span", {
206
+ className: d(t === 0 && "ssg-dp-dow--sun", t === 6 && "ssg-dp-dow--sat"),
207
+ children: e
208
+ }, t))
209
+ }), /* @__PURE__ */ _("div", {
210
+ className: "ssg-dp-days",
211
+ children: W(O, A).map((t) => /* @__PURE__ */ _("button", {
212
+ type: "button",
213
+ className: d("ssg-dp-day", !t.inCurrentMonth && "ssg-dp-day--out", t.key === P && "ssg-dp-day--today", t.key === e && "ssg-dp-day--selected"),
214
+ "aria-label": t.key,
215
+ ...B(() => R(t.key)),
216
+ children: t.day
217
+ }, t.key))
218
+ })] }),
219
+ E === "months" && /* @__PURE__ */ _("div", {
220
+ className: "ssg-dp-grid",
221
+ children: u.calendarMonths.map((e, t) => /* @__PURE__ */ _("button", {
222
+ type: "button",
223
+ className: d("ssg-dp-cell", t === A && "ssg-dp-cell--selected"),
224
+ ...B(() => {
225
+ j(t), D("days");
226
+ }),
227
+ children: e
228
+ }, t))
229
+ }),
230
+ E === "years" && /* @__PURE__ */ _("div", {
231
+ className: "ssg-dp-grid",
232
+ children: G(O).map((e) => /* @__PURE__ */ _("button", {
233
+ type: "button",
234
+ className: d("ssg-dp-cell", e === O && "ssg-dp-cell--selected"),
235
+ ...B(() => {
236
+ k(e), D("months");
237
+ }),
238
+ children: e
239
+ }, e))
240
+ }),
241
+ /* @__PURE__ */ v("div", {
242
+ className: "ssg-dp-foot",
243
+ children: [
244
+ E !== "days" && /* @__PURE__ */ _("button", {
245
+ type: "button",
246
+ className: "ssg-dp-foot-btn",
247
+ ...B(H),
248
+ children: u.calendarBack
249
+ }),
250
+ /* @__PURE__ */ _("button", {
251
+ type: "button",
252
+ className: "ssg-dp-foot-btn",
253
+ ...B(() => R(P)),
254
+ children: u.calendarToday
255
+ }),
256
+ /* @__PURE__ */ _("button", {
257
+ type: "button",
258
+ className: "ssg-dp-foot-btn ssg-dp-foot-btn--muted",
259
+ ...B(() => R("")),
260
+ children: u.clear
261
+ })
262
+ ]
263
+ })
264
+ ]
265
+ })]
266
+ });
267
+ }
268
+ //#endregion
269
+ //#region src/view/ColumnFilterPopover.tsx
270
+ var q = 24, oe = 40, J = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(pointer: coarse)").matches ? oe : q, Y = (e, t, n) => e === "" && t === w.blank ? n : t, se = (e, t) => t === w.blank ? e : e.map((e) => e.value === "" && e.label === w.blank ? {
271
+ ...e,
272
+ label: t
273
+ } : e);
274
+ function ce({ options: e, setSelection: t, searchInputRef: n, onValueToggle: o, onSelectAllChange: u, onReplaceSelection: d, onRequestClose: f, isServerSide: p, selectAllUsesExplicitScope: y = !1, truncated: b = !1 }) {
275
+ let x = i(), [S, C] = l(""), w = a(S), T = s(() => se(e, x.blank), [e, x.blank]), E = s(() => D(T, w), [T, w]), A = w.trim().length > 0, j = c(null), [M] = l(J), N = r({
276
+ count: E.length,
277
+ getScrollElement: () => j.current,
278
+ estimateSize: () => M,
279
+ overscan: 10
280
+ }), P = s(() => {
281
+ if (t === null) return E.length;
282
+ let e = 0;
283
+ for (let n of E) k(t, n.value) && (e += 1);
284
+ return e;
285
+ }, [t, E]), F = E.length > 0 && P === E.length, I = P > 0 && !F, L = s(() => new Set(e.map((e) => e.value)), [e]), R = s(() => {
286
+ if (t === null) return e.length;
287
+ let n = 0;
288
+ for (let e of t.values) L.has(e) && (n += 1);
289
+ return t.mode === "include" ? n : e.length - n;
290
+ }, [
291
+ t,
292
+ L,
293
+ e.length
294
+ ]);
295
+ return /* @__PURE__ */ v(g, { children: [
296
+ /* @__PURE__ */ _("input", {
297
+ ref: n,
298
+ type: "text",
299
+ value: S,
300
+ onChange: (e) => C(e.target.value),
301
+ onKeyDown: (e) => {
302
+ if (e.stopPropagation(), e.key === "Escape" && (e.preventDefault(), f()), e.key === "Enter") {
303
+ if (m(e.nativeEvent)) return;
304
+ e.preventDefault();
305
+ let t = O(T, S);
306
+ if (t.kind === "none") return;
307
+ t.kind === "replace" && d(t.values), f();
308
+ }
309
+ },
310
+ placeholder: x.filterSearchPlaceholder,
311
+ "aria-label": x.filterSearchPlaceholder,
312
+ className: "ssg-filter-input"
313
+ }),
314
+ /* @__PURE__ */ v("label", {
315
+ className: "ssg-filter-selectall",
316
+ children: [/* @__PURE__ */ _("input", {
317
+ type: "checkbox",
318
+ checked: F,
319
+ ref: (e) => {
320
+ e && (e.indeterminate = I);
321
+ },
322
+ onChange: () => {
323
+ u(A || y ? E.map((e) => e.value) : "all", !F);
324
+ }
325
+ }), /* @__PURE__ */ _("span", {
326
+ className: "ssg-filter-selectall-label",
327
+ children: A ? x.filterSelectAllResults : x.filterSelectAll
328
+ })]
329
+ }),
330
+ /* @__PURE__ */ _("div", {
331
+ ref: j,
332
+ className: "ssg-filter-list",
333
+ children: E.length === 0 ? /* @__PURE__ */ _("div", {
334
+ className: "ssg-filter-empty",
335
+ children: e.length === 0 ? p ? x.filterNoOptionsSource : x.noOptions : x.filterNoMatches
336
+ }) : /* @__PURE__ */ _("div", {
337
+ className: "ssg-filter-virt",
338
+ style: { height: N.getTotalSize() },
339
+ children: N.getVirtualItems().map((e) => {
340
+ let n = E[e.index];
341
+ if (!n) return null;
342
+ let r = k(t, n.value);
343
+ return /* @__PURE__ */ v("label", {
344
+ className: "ssg-filter-option",
345
+ style: {
346
+ transform: `translateY(${e.start}px)`,
347
+ height: e.size
348
+ },
349
+ children: [/* @__PURE__ */ _("input", {
350
+ type: "checkbox",
351
+ checked: r,
352
+ onChange: () => o(n.value)
353
+ }), /* @__PURE__ */ _("span", {
354
+ className: "ssg-filter-option-label",
355
+ children: Y(n.value, n.label, x.blank)
356
+ })]
357
+ }, n.value);
358
+ })
359
+ })
360
+ }),
361
+ /* @__PURE__ */ v("div", {
362
+ className: "ssg-filter-meta",
363
+ children: [
364
+ h(x.filterSelectedCount, {
365
+ selected: R,
366
+ total: e.length
367
+ }),
368
+ A ? h(x.filterShownCount, { count: E.length }) : "",
369
+ b && /* @__PURE__ */ _(he, {})
370
+ ]
371
+ })
372
+ ] });
373
+ }
374
+ var X = (e) => {
375
+ e.key !== "Escape" && e.stopPropagation();
376
+ }, Z = (e) => e.nativeEvent.isComposing === !0, le = (e, t, n) => {
377
+ if (Z(n)) {
378
+ e(t, { commit: !1 });
379
+ return;
380
+ }
381
+ e(t);
382
+ };
383
+ function ue({ draft: e, valueInputRef: t, onDraftChange: n, onKeyDown: r }) {
384
+ let a = i(), o = P(e.operator);
385
+ return /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("select", {
386
+ value: e.operator,
387
+ onChange: (t) => n({
388
+ ...e,
389
+ operator: t.target.value
390
+ }),
391
+ onKeyDown: r,
392
+ className: "ssg-filter-select",
393
+ "aria-label": a.filterOperator,
394
+ children: j.map((e) => /* @__PURE__ */ _("option", {
395
+ value: e.value,
396
+ children: a[e.labelKey]
397
+ }, e.value))
398
+ }), o > 0 ? /* @__PURE__ */ v("div", {
399
+ className: "ssg-filter-cond-values",
400
+ children: [/* @__PURE__ */ _("input", {
401
+ ref: t,
402
+ type: "text",
403
+ inputMode: "decimal",
404
+ value: e.value1,
405
+ onChange: (t) => le(n, {
406
+ ...e,
407
+ value1: t.target.value
408
+ }, t),
409
+ onCompositionEnd: (t) => n({
410
+ ...e,
411
+ value1: t.currentTarget.value
412
+ }),
413
+ onKeyDown: r,
414
+ placeholder: o === 2 ? a.filterMin : a.filterValuePlaceholder,
415
+ className: "ssg-filter-input",
416
+ "aria-label": o === 2 ? a.filterMin : a.filterValue
417
+ }), o === 2 && /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("span", {
418
+ className: "ssg-filter-cond-tilde",
419
+ children: a.filterRangeSeparator
420
+ }), /* @__PURE__ */ _("input", {
421
+ type: "text",
422
+ inputMode: "decimal",
423
+ value: e.value2,
424
+ onChange: (t) => le(n, {
425
+ ...e,
426
+ value2: t.target.value
427
+ }, t),
428
+ onCompositionEnd: (t) => n({
429
+ ...e,
430
+ value2: t.currentTarget.value
431
+ }),
432
+ onKeyDown: r,
433
+ placeholder: a.filterMax,
434
+ className: "ssg-filter-input",
435
+ "aria-label": a.filterMax
436
+ })] })]
437
+ }) : /* @__PURE__ */ _("div", {
438
+ className: "ssg-filter-meta",
439
+ children: a.filterNoValue
440
+ })] });
441
+ }
442
+ function de({ draft: e, valueInputRef: t, onDraftChange: n, onKeyDown: r }) {
443
+ let a = i(), o = z(e.operator);
444
+ return /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("select", {
445
+ value: e.operator,
446
+ onChange: (t) => n({
447
+ ...e,
448
+ operator: t.target.value
449
+ }),
450
+ onKeyDown: r,
451
+ className: "ssg-filter-select",
452
+ "aria-label": a.filterOperator,
453
+ children: I.map((e) => /* @__PURE__ */ _("option", {
454
+ value: e.value,
455
+ children: a[e.labelKey]
456
+ }, e.value))
457
+ }), o > 0 ? /* @__PURE__ */ _("div", {
458
+ className: "ssg-filter-cond-values",
459
+ children: /* @__PURE__ */ _("input", {
460
+ ref: t,
461
+ type: "text",
462
+ value: e.value,
463
+ onChange: (t) => le(n, {
464
+ ...e,
465
+ value: t.target.value
466
+ }, t),
467
+ onCompositionEnd: (t) => n({
468
+ ...e,
469
+ value: t.currentTarget.value
470
+ }),
471
+ onKeyDown: r,
472
+ placeholder: a.filterValuePlaceholder,
473
+ className: "ssg-filter-input",
474
+ "aria-label": a.filterValue
475
+ })
476
+ }) : /* @__PURE__ */ _("div", {
477
+ className: "ssg-filter-meta",
478
+ children: a.filterNoValue
479
+ })] });
480
+ }
481
+ function fe({ draft: e, valueInputRef: t, onDraftChange: n, onKeyDown: r, presets: a, renderDateInput: o, onRequestClose: s }) {
482
+ let c = i(), l = e.preset === null ? H(e.operator) : 0, u = (t, r) => {
483
+ n({
484
+ ...e,
485
+ [t]: U(r),
486
+ preset: null
487
+ });
488
+ };
489
+ return /* @__PURE__ */ v(g, { children: [
490
+ /* @__PURE__ */ _("select", {
491
+ value: e.operator,
492
+ onChange: (t) => n({
493
+ ...e,
494
+ operator: t.target.value,
495
+ preset: null
496
+ }),
497
+ onKeyDown: r,
498
+ className: "ssg-filter-select",
499
+ "aria-label": c.filterOperator,
500
+ children: B.map((e) => /* @__PURE__ */ _("option", {
501
+ value: e.value,
502
+ children: c[e.labelKey]
503
+ }, e.value))
504
+ }),
505
+ l > 0 ? /* @__PURE__ */ v("div", {
506
+ className: "ssg-filter-cond-values",
507
+ children: [o ? o({
508
+ value: e.value1,
509
+ onChange: (e) => u("value1", e),
510
+ ariaLabel: l === 2 ? c.filterStartDate : c.filterDate,
511
+ slot: l === 2 ? "from" : "single"
512
+ }) : /* @__PURE__ */ _(ae, {
513
+ value: e.value1,
514
+ onCommit: (t) => n({
515
+ ...e,
516
+ value1: t,
517
+ preset: null
518
+ }),
519
+ ariaLabel: l === 2 ? c.filterStartDate : c.filterDate,
520
+ inputRef: t,
521
+ onRequestClose: s
522
+ }), l === 2 && /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("span", {
523
+ className: "ssg-filter-cond-tilde",
524
+ children: c.filterRangeSeparator
525
+ }), o ? o({
526
+ value: e.value2,
527
+ onChange: (e) => u("value2", e),
528
+ ariaLabel: c.filterEndDate,
529
+ slot: "to"
530
+ }) : /* @__PURE__ */ _(ae, {
531
+ value: e.value2,
532
+ onCommit: (t) => n({
533
+ ...e,
534
+ value2: t,
535
+ preset: null
536
+ }),
537
+ ariaLabel: c.filterEndDate,
538
+ onRequestClose: s,
539
+ align: "right"
540
+ })] })]
541
+ }) : e.preset === null ? /* @__PURE__ */ _("div", {
542
+ className: "ssg-filter-meta",
543
+ children: c.filterNoValue
544
+ }) : null,
545
+ a.length > 0 && /* @__PURE__ */ _("div", {
546
+ className: "ssg-filter-presets",
547
+ children: a.map((t) => /* @__PURE__ */ _("button", {
548
+ type: "button",
549
+ onPointerDown: (r) => {
550
+ r.preventDefault(), r.stopPropagation(), n({
551
+ ...e,
552
+ preset: e.preset === t.id ? null : t.id
553
+ }), T(r.currentTarget);
554
+ },
555
+ onKeyDown: (r) => {
556
+ X(r), (r.key === "Enter" || r.key === " ") && (r.preventDefault(), n({
557
+ ...e,
558
+ preset: e.preset === t.id ? null : t.id
559
+ }));
560
+ },
561
+ className: d("ssg-filter-preset-chip", e.preset === t.id && "ssg-filter-preset-chip--active"),
562
+ children: t.label
563
+ }, t.id))
564
+ })
565
+ ] });
566
+ }
567
+ function pe({ options: e, setSelection: t, searchInputRef: n, onValueToggle: o, onSelectAllChange: u, onReplaceSelection: d, onRequestClose: f, isServerSide: p, truncated: y = !1 }) {
568
+ let b = i(), [x, S] = l(""), C = a(x), [w, T] = l(() => /* @__PURE__ */ new Set()), E = C.trim().length > 0, A = s(() => se(e, b.blank), [e, b.blank]), j = s(() => D(A, C), [A, C]), M = s(() => ie(e, w, b), [
569
+ e,
570
+ w,
571
+ b
572
+ ]), N = c(null), P = E ? j.length : M.length, [F] = l(J), I = r({
573
+ count: P,
574
+ getScrollElement: () => N.current,
575
+ estimateSize: () => F,
576
+ overscan: 10
577
+ }), L = s(() => (E ? j : e).map((e) => e.value), [
578
+ E,
579
+ j,
580
+ e
581
+ ]), R = s(() => {
582
+ let e = 0;
583
+ for (let n of L) k(t, n) && (e += 1);
584
+ return e;
585
+ }, [L, t]), z = L.length > 0 && R === L.length, B = R > 0 && !z, V = s(() => new Set(e.map((e) => e.value)), [e]), ee = s(() => {
586
+ if (t === null) return e.length;
587
+ let n = 0;
588
+ for (let e of t.values) V.has(e) && (n += 1);
589
+ return t.mode === "include" ? n : e.length - n;
590
+ }, [
591
+ t,
592
+ V,
593
+ e.length
594
+ ]), H = (e) => {
595
+ T((t) => {
596
+ let n = new Set(t);
597
+ return n.has(e) ? n.delete(e) : n.add(e), n;
598
+ });
599
+ }, te = (e) => {
600
+ let n = 0;
601
+ for (let r of e) k(t, r) && (n += 1);
602
+ return n;
603
+ }, U = (e) => {
604
+ if (e.type === "leaf") {
605
+ o(e.key);
606
+ return;
607
+ }
608
+ let t = e.leafKeys.length > 0 && te(e.leafKeys) === e.leafKeys.length;
609
+ u(e.leafKeys, !t);
610
+ }, ne = (e) => {
611
+ let t = te(e.leafKeys), n = e.leafKeys.length > 0 && t === e.leafKeys.length, r = t > 0 && !n;
612
+ return /* @__PURE__ */ v(g, { children: [
613
+ e.type === "group" ? /* @__PURE__ */ _("button", {
614
+ type: "button",
615
+ onPointerDown: (t) => {
616
+ t.preventDefault(), t.stopPropagation(), H(e.key);
617
+ },
618
+ onKeyDown: (t) => {
619
+ X(t), (t.key === "Enter" || t.key === " ") && (t.preventDefault(), H(e.key));
620
+ },
621
+ className: "ssg-filter-tree-toggle",
622
+ "aria-label": e.expanded ? b.treeCollapse : b.treeExpand,
623
+ children: e.expanded ? "▾" : "▸"
624
+ }) : /* @__PURE__ */ _("span", { className: "ssg-filter-tree-toggle ssg-filter-tree-toggle--placeholder" }),
625
+ /* @__PURE__ */ _("input", {
626
+ type: "checkbox",
627
+ checked: n,
628
+ ref: (e) => {
629
+ e && (e.indeterminate = r);
630
+ },
631
+ "aria-label": Y(e.key, e.label, b.blank),
632
+ onChange: () => U(e)
633
+ }),
634
+ /* @__PURE__ */ _("span", {
635
+ className: "ssg-filter-option-label",
636
+ children: Y(e.key, e.label, b.blank)
637
+ })
638
+ ] });
639
+ };
640
+ return /* @__PURE__ */ v(g, { children: [
641
+ /* @__PURE__ */ _("input", {
642
+ ref: n,
643
+ type: "text",
644
+ value: x,
645
+ onChange: (e) => S(e.target.value),
646
+ onKeyDown: (e) => {
647
+ if (e.stopPropagation(), e.key === "Escape" && (e.preventDefault(), f()), e.key === "Enter") {
648
+ if (m(e.nativeEvent)) return;
649
+ e.preventDefault();
650
+ let t = O(A, x);
651
+ if (t.kind === "none") return;
652
+ t.kind === "replace" && d(t.values), f();
653
+ }
654
+ },
655
+ placeholder: b.filterSearchPlaceholder,
656
+ "aria-label": b.filterSearchPlaceholder,
657
+ className: "ssg-filter-input"
658
+ }),
659
+ /* @__PURE__ */ v("label", {
660
+ className: "ssg-filter-selectall",
661
+ children: [/* @__PURE__ */ _("input", {
662
+ type: "checkbox",
663
+ checked: z,
664
+ ref: (e) => {
665
+ e && (e.indeterminate = B);
666
+ },
667
+ onChange: () => u(L, !z)
668
+ }), /* @__PURE__ */ _("span", {
669
+ className: "ssg-filter-selectall-label",
670
+ children: E ? b.filterSelectAllResults : b.filterSelectAll
671
+ })]
672
+ }),
673
+ /* @__PURE__ */ _("div", {
674
+ ref: N,
675
+ className: "ssg-filter-list",
676
+ children: P === 0 ? /* @__PURE__ */ _("div", {
677
+ className: "ssg-filter-empty",
678
+ children: e.length === 0 ? p ? b.filterNoOptionsSource : b.noOptions : b.filterNoMatches
679
+ }) : /* @__PURE__ */ _("div", {
680
+ className: "ssg-filter-virt",
681
+ style: { height: I.getTotalSize() },
682
+ children: I.getVirtualItems().map((e) => {
683
+ if (E) {
684
+ let n = j[e.index];
685
+ return n ? /* @__PURE__ */ v("label", {
686
+ className: "ssg-filter-option",
687
+ style: {
688
+ transform: `translateY(${e.start}px)`,
689
+ height: e.size
690
+ },
691
+ children: [/* @__PURE__ */ _("input", {
692
+ type: "checkbox",
693
+ checked: k(t, n.value),
694
+ onChange: () => o(n.value)
695
+ }), /* @__PURE__ */ _("span", {
696
+ className: "ssg-filter-option-label",
697
+ children: Y(n.value, n.label, b.blank)
698
+ })]
699
+ }, n.value) : null;
700
+ }
701
+ let n = M[e.index];
702
+ return n ? /* @__PURE__ */ _("div", {
703
+ className: "ssg-filter-option",
704
+ style: {
705
+ transform: `translateY(${e.start}px)`,
706
+ height: e.size,
707
+ paddingLeft: 8 + n.depth * 16
708
+ },
709
+ onClick: (e) => {
710
+ e.target.closest("button, input") || U(n);
711
+ },
712
+ children: ne(n)
713
+ }, n.key) : null;
714
+ })
715
+ })
716
+ }),
717
+ /* @__PURE__ */ v("div", {
718
+ className: "ssg-filter-meta",
719
+ children: [
720
+ h(b.filterSelectedCount, {
721
+ selected: ee,
722
+ total: e.length
723
+ }),
724
+ E ? h(b.filterShownCount, { count: j.length }) : "",
725
+ y && /* @__PURE__ */ _(he, {})
726
+ ]
727
+ })
728
+ ] });
729
+ }
730
+ function me({ status: e, errorMessage: t, onRetry: n }) {
731
+ let r = i();
732
+ return e === "loading" ? /* @__PURE__ */ _("div", {
733
+ className: "ssg-filter-collecting",
734
+ children: r.filterOptionsLoading
735
+ }) : /* @__PURE__ */ v("div", {
736
+ className: "ssg-filter-error",
737
+ role: "alert",
738
+ children: [
739
+ /* @__PURE__ */ _("div", { children: r.filterOptionsFailed }),
740
+ t ? /* @__PURE__ */ _("div", {
741
+ className: "ssg-filter-error-detail",
742
+ title: t,
743
+ children: t
744
+ }) : null,
745
+ n ? /* @__PURE__ */ _("button", {
746
+ type: "button",
747
+ onPointerDown: (e) => {
748
+ e.preventDefault(), e.stopPropagation(), n();
749
+ },
750
+ onKeyDown: (e) => {
751
+ X(e), (e.key === "Enter" || e.key === " ") && (e.preventDefault(), n());
752
+ },
753
+ className: "ssg-filter-btn-secondary",
754
+ children: r.retry
755
+ }) : null
756
+ ]
757
+ });
758
+ }
759
+ function he() {
760
+ return /* @__PURE__ */ _("span", {
761
+ className: "ssg-filter-truncated",
762
+ children: i().filterOptionsTruncated
763
+ });
764
+ }
765
+ function ge({ conditionEditor: e, conditionActive: t, onConditionClear: n, options: r, setSelection: a, onSelectionClear: o, summaryText: s, children: c, optionsMeta: l }) {
766
+ let u = i();
767
+ return /* @__PURE__ */ v(g, { children: [
768
+ /* @__PURE__ */ v("div", {
769
+ className: "ssg-filter-sec-head",
770
+ children: [/* @__PURE__ */ _("span", {
771
+ className: "ssg-filter-sec-label",
772
+ children: u.filterConditionSection
773
+ }), /* @__PURE__ */ _("button", {
774
+ type: "button",
775
+ onPointerDown: (e) => {
776
+ e.preventDefault(), e.stopPropagation(), n();
777
+ },
778
+ onKeyDown: (e) => {
779
+ X(e), (e.key === "Enter" || e.key === " ") && (e.preventDefault(), n());
780
+ },
781
+ className: "ssg-filter-sec-clear",
782
+ disabled: !t,
783
+ children: u.clear
784
+ })]
785
+ }),
786
+ e,
787
+ /* @__PURE__ */ _("div", { className: "ssg-filter-sep" }),
788
+ /* @__PURE__ */ v("div", {
789
+ className: "ssg-filter-sec-head",
790
+ children: [
791
+ /* @__PURE__ */ _("span", {
792
+ className: "ssg-filter-sec-label",
793
+ children: u.filterValuesSection
794
+ }),
795
+ /* @__PURE__ */ _("span", {
796
+ className: "ssg-filter-sec-meta",
797
+ children: l ?? h(t ? u.filterMatchCount : u.filterTotalCount, { count: r.length })
798
+ }),
799
+ /* @__PURE__ */ _("button", {
800
+ type: "button",
801
+ onPointerDown: (e) => {
802
+ e.preventDefault(), e.stopPropagation(), o();
803
+ },
804
+ onKeyDown: (e) => {
805
+ X(e), (e.key === "Enter" || e.key === " ") && (e.preventDefault(), o());
806
+ },
807
+ className: "ssg-filter-sec-clear",
808
+ disabled: a === null,
809
+ children: u.clear
810
+ })
811
+ ]
812
+ }),
813
+ c,
814
+ /* @__PURE__ */ v("div", {
815
+ className: "ssg-filter-summary",
816
+ children: ["🔽 ", s]
817
+ })
818
+ ] });
819
+ }
820
+ function Q({ isOpen: r, themeClassName: a, popoverSlot: o, title: s, filterType: y, draftValue: b, numberConditionDraft: x, onNumberConditionDraftChange: w, textConditionDraft: T, onTextConditionDraftChange: D, dateConditionDraft: O, onDateConditionDraftChange: k, datePresets: j, renderDateInput: P, onComboConditionClear: I, onComboSelectionClear: z, comboSummaryText: B, currentValueText: H, layout: U, selectOptions: W, optionsStatus: G, optionsProgress: re, optionsTruncated: K = !1, optionsErrorMessage: ie, onOptionsRetry: ae, setSelection: q, popoverRef: oe, textInputRef: J, selectRef: se, onRequestClose: Z, onDraftChange: le, onApply: Q, onClear: _e, onSetValueToggle: ve, onSetSelectAllChange: ye, onSetClear: be, onSetReplaceSelection: xe, isServerSide: Se = !1 }) {
821
+ let $ = i(), Ce = c(null), [we] = l(() => /* @__PURE__ */ new Date()), [Te] = l(S);
822
+ n(Te, { active: r && y === "dateSet" && (O?.preset ?? null) !== null });
823
+ let Ee = ne(we, u(Te.subscribe, Te.getSnapshot, Te.getSnapshot));
824
+ e(oe, r && U !== null, a, { layout: U });
825
+ let De = t(r && U !== null);
826
+ if (typeof document > "u" || !r || !U || !De) return null;
827
+ let Oe = {
828
+ top: U.top,
829
+ left: U.left,
830
+ width: U.width,
831
+ maxHeight: U.maxHeight
832
+ }, ke = (e) => {
833
+ e.stopPropagation(), e.key === "Escape" && !p(e.nativeEvent) && !m(e.nativeEvent) && (e.preventDefault(), Z());
834
+ }, Ae = (e) => {
835
+ if (e.key !== "Tab" || e.altKey || e.ctrlKey || e.metaKey || m(e.nativeEvent)) return;
836
+ let t = E(e.currentTarget, e.target instanceof Element ? e.target : null, e.shiftKey);
837
+ t !== null && (e.preventDefault(), t.focus());
838
+ }, je = (e) => {
839
+ e.stopPropagation();
840
+ }, Me = y === "set", Ne = y === "numberSet", Pe = y === "textSet", Fe = y === "dateSet", Ie = Ne || Pe || Fe, Le = Me || Ie, Re = G === "loading" || G === "error", ze = x ?? A, Be = T ?? F, Ve = O ?? V, He = j ?? C(void 0, $), Ue = Ne ? M(ze) : null, We = Pe ? L(Be) : null, Ge = Fe ? ee(Ve) : null, Ke = Ue !== null || We !== null || Ge !== null, qe = Ne ? N(W, Ue) : Pe ? R(W, We) : Fe ? te(W, Ge, Ee, He) : W, Je = (e) => {
841
+ if (e.stopPropagation(), !m(e.nativeEvent)) {
842
+ if (e.key === "Enter") {
843
+ e.preventDefault(), Q();
844
+ return;
845
+ }
846
+ e.key === "Escape" && (e.preventDefault(), Z());
847
+ }
848
+ }, Ye = Ne ? /* @__PURE__ */ _(ue, {
849
+ draft: ze,
850
+ valueInputRef: J,
851
+ onDraftChange: w,
852
+ onKeyDown: Je
853
+ }) : Pe ? /* @__PURE__ */ _(de, {
854
+ draft: Be,
855
+ valueInputRef: J,
856
+ onDraftChange: D,
857
+ onKeyDown: Je
858
+ }) : /* @__PURE__ */ _(fe, {
859
+ draft: Ve,
860
+ valueInputRef: J,
861
+ onDraftChange: k,
862
+ onKeyDown: Je,
863
+ presets: He,
864
+ renderDateInput: P,
865
+ onRequestClose: Z
866
+ });
867
+ return f(/* @__PURE__ */ v("div", {
868
+ ref: oe,
869
+ onPointerDown: je,
870
+ onKeyDown: ke,
871
+ onKeyDownCapture: Ae,
872
+ onPasteCapture: (e) => {
873
+ e.stopPropagation();
874
+ },
875
+ className: d("ssg-filter-popover", a, o?.className),
876
+ style: {
877
+ ...o?.style,
878
+ ...Oe
879
+ },
880
+ role: "dialog",
881
+ "aria-label": h($.filterTitle, { column: s }),
882
+ tabIndex: -1,
883
+ children: [
884
+ /* @__PURE__ */ _("div", {
885
+ className: "ssg-filter-title",
886
+ children: h($.filterTitle, { column: s })
887
+ }),
888
+ (Le || y === "select") && G === "collecting" ? Ie ? /* @__PURE__ */ _(ge, {
889
+ conditionEditor: Ye,
890
+ conditionActive: Ke,
891
+ onConditionClear: I,
892
+ options: qe,
893
+ setSelection: q,
894
+ onSelectionClear: z,
895
+ summaryText: B,
896
+ optionsMeta: $.filterOptionsLoadingShort,
897
+ children: /* @__PURE__ */ _("div", {
898
+ className: "ssg-filter-collecting",
899
+ children: h($.filterCollecting, { percent: Math.round(re * 100) })
900
+ })
901
+ }) : /* @__PURE__ */ _("div", {
902
+ className: "ssg-filter-collecting",
903
+ children: h($.filterCollecting, { percent: Math.round(re * 100) })
904
+ }) : (Le || y === "select") && Re ? Ie ? /* @__PURE__ */ _(ge, {
905
+ conditionEditor: Ye,
906
+ conditionActive: Ke,
907
+ onConditionClear: I,
908
+ options: qe,
909
+ setSelection: q,
910
+ onSelectionClear: z,
911
+ summaryText: B,
912
+ optionsMeta: G === "loading" ? $.filterOptionsLoadingShort : $.filterOptionsFailedShort,
913
+ children: /* @__PURE__ */ _(me, {
914
+ status: G === "loading" ? "loading" : "error",
915
+ errorMessage: ie,
916
+ onRetry: ae
917
+ })
918
+ }) : /* @__PURE__ */ _(me, {
919
+ status: G === "loading" ? "loading" : "error",
920
+ errorMessage: ie,
921
+ onRetry: ae
922
+ }) : Ie ? /* @__PURE__ */ _(ge, {
923
+ conditionEditor: Ye,
924
+ conditionActive: Ke,
925
+ onConditionClear: I,
926
+ options: qe,
927
+ setSelection: q,
928
+ onSelectionClear: z,
929
+ summaryText: B,
930
+ children: Fe ? /* @__PURE__ */ _(pe, {
931
+ options: qe,
932
+ setSelection: q,
933
+ searchInputRef: Ce,
934
+ onValueToggle: ve,
935
+ onSelectAllChange: ye,
936
+ onReplaceSelection: xe,
937
+ onRequestClose: Z,
938
+ isServerSide: Se,
939
+ truncated: K
940
+ }) : /* @__PURE__ */ _(ce, {
941
+ options: qe,
942
+ setSelection: q,
943
+ searchInputRef: Ce,
944
+ onValueToggle: ve,
945
+ onSelectAllChange: ye,
946
+ onReplaceSelection: xe,
947
+ onRequestClose: Z,
948
+ isServerSide: Se,
949
+ selectAllUsesExplicitScope: !0,
950
+ truncated: K
951
+ })
952
+ }) : Me ? /* @__PURE__ */ _(ce, {
953
+ options: W,
954
+ setSelection: q,
955
+ searchInputRef: J,
956
+ onValueToggle: ve,
957
+ onSelectAllChange: ye,
958
+ onReplaceSelection: xe,
959
+ onRequestClose: Z,
960
+ isServerSide: Se,
961
+ truncated: K
962
+ }) : y === "number" ? /* @__PURE__ */ _(g, { children: /* @__PURE__ */ _(ue, {
963
+ draft: ze,
964
+ valueInputRef: J,
965
+ onDraftChange: w,
966
+ onKeyDown: Je
967
+ }) }) : y === "select" ? /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ v("select", {
968
+ ref: se,
969
+ value: b,
970
+ onChange: (e) => le(e.target.value),
971
+ onKeyDown: (e) => {
972
+ if (e.stopPropagation(), e.key === "Enter") {
973
+ e.preventDefault(), Q();
974
+ return;
975
+ }
976
+ e.key === "Escape" && (e.preventDefault(), Z());
977
+ },
978
+ className: "ssg-filter-select",
979
+ children: [/* @__PURE__ */ _("option", {
980
+ value: "",
981
+ children: $.filterAll
982
+ }), W.map((e) => /* @__PURE__ */ _("option", {
983
+ value: e.value,
984
+ children: Y(e.value, e.label, $.blank)
985
+ }, `${s}-${e.value}`))]
986
+ }), /* @__PURE__ */ v("div", {
987
+ className: "ssg-filter-meta",
988
+ children: [h($.filterOptionCount, { count: W.length }), K && /* @__PURE__ */ _(he, {})]
989
+ })] }) : /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("input", {
990
+ ref: J,
991
+ type: "text",
992
+ value: b,
993
+ onChange: (e) => le(e.target.value),
994
+ onKeyDown: (e) => {
995
+ if (e.stopPropagation(), !m(e.nativeEvent)) {
996
+ if (e.key === "Enter") {
997
+ e.preventDefault(), Q();
998
+ return;
999
+ }
1000
+ e.key === "Escape" && (e.preventDefault(), Z());
1001
+ }
1002
+ },
1003
+ placeholder: $.filterTextPlaceholder,
1004
+ "aria-label": $.filterTextPlaceholder,
1005
+ className: "ssg-filter-input"
1006
+ }), /* @__PURE__ */ _("div", {
1007
+ className: "ssg-filter-meta ssg-filter-meta--ellipsis",
1008
+ children: $.filterTextHint
1009
+ })] }),
1010
+ !Le && /* @__PURE__ */ _("div", {
1011
+ className: "ssg-filter-meta ssg-filter-meta--ellipsis",
1012
+ children: h($.filterCurrentValue, { value: H })
1013
+ }),
1014
+ /* @__PURE__ */ _("div", {
1015
+ className: "ssg-filter-footer",
1016
+ children: Le ? /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("button", {
1017
+ type: "button",
1018
+ onPointerDown: (e) => {
1019
+ e.preventDefault(), e.stopPropagation(), be();
1020
+ },
1021
+ onKeyDown: (e) => {
1022
+ X(e), (e.key === "Enter" || e.key === " ") && (e.preventDefault(), be());
1023
+ },
1024
+ className: "ssg-filter-btn-secondary",
1025
+ children: $.clear
1026
+ }), /* @__PURE__ */ _("button", {
1027
+ type: "button",
1028
+ onPointerDown: (e) => {
1029
+ e.preventDefault(), e.stopPropagation(), Z();
1030
+ },
1031
+ onKeyDown: (e) => {
1032
+ X(e), (e.key === "Enter" || e.key === " ") && (e.preventDefault(), Z());
1033
+ },
1034
+ className: "ssg-filter-btn-primary",
1035
+ children: $.close
1036
+ })] }) : /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("button", {
1037
+ type: "button",
1038
+ onPointerDown: (e) => {
1039
+ e.preventDefault(), e.stopPropagation(), _e();
1040
+ },
1041
+ onKeyDown: (e) => {
1042
+ X(e), (e.key === "Enter" || e.key === " ") && (e.preventDefault(), _e());
1043
+ },
1044
+ className: "ssg-filter-btn-secondary",
1045
+ children: $.clear
1046
+ }), /* @__PURE__ */ _("button", {
1047
+ type: "button",
1048
+ onPointerDown: (e) => {
1049
+ e.preventDefault(), e.stopPropagation(), Q();
1050
+ },
1051
+ onKeyDown: (e) => {
1052
+ X(e), (e.key === "Enter" || e.key === " ") && (e.preventDefault(), Q());
1053
+ },
1054
+ className: "ssg-filter-btn-primary",
1055
+ children: $.apply
1056
+ })] })
1057
+ })
1058
+ ]
1059
+ }), De);
1060
+ }
1061
+ //#endregion
1062
+ export { Q as ColumnFilterPopover, Q as default };