@ishibashi0112/spreadsheet-grid-solid 0.1.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 (37) hide show
  1. package/API_REFERENCE.md +2865 -0
  2. package/README.md +43 -25
  3. package/dist/ColumnFilterPopover-mENgY4gl.js +1426 -0
  4. package/dist/ai/GridAskBar.d.ts +20 -0
  5. package/dist/ai/createGridAsk.d.ts +94 -0
  6. package/dist/ai.d.ts +7 -0
  7. package/dist/ai.js +412 -0
  8. package/dist/columnVirtualizer-DdL7-ijS.js +193 -0
  9. package/dist/createSpreadsheetGrid.d.ts +14 -0
  10. package/dist/devWarnings.d.ts +0 -1
  11. package/dist/editors/CellEditorLayer.d.ts +1 -0
  12. package/dist/editors/DateCellEditor.d.ts +1 -0
  13. package/dist/editors/NumberCellEditor.d.ts +1 -0
  14. package/dist/editors/SelectCellEditor.d.ts +3 -1
  15. package/dist/editors/TextCellEditor.d.ts +1 -0
  16. package/dist/features/contextMenu.d.ts +0 -14
  17. package/dist/features/types.d.ts +1 -1
  18. package/dist/index.js +3069 -3123
  19. package/dist/locales/en.d.ts +1 -1
  20. package/dist/locales/en.js +2 -2
  21. package/dist/primitives/effectApply.d.ts +1 -0
  22. package/dist/primitives/serverSnapshot.d.ts +5 -0
  23. package/dist/primitives/storeRows.d.ts +2 -0
  24. package/dist/source/ai.jsx +619 -0
  25. package/dist/source/chunks/{ColumnFilterPopover-BMKPRELT.jsx → ColumnFilterPopover-D7INPNVB.jsx} +29 -10
  26. package/dist/source/chunks/chunk-ZZTXTW4Z.jsx +301 -0
  27. package/dist/source/chunks/{toolPanelViews-W6KROURU.jsx → toolPanelViews-HIQGRX3N.jsx} +4 -2
  28. package/dist/source/index.jsx +857 -853
  29. package/dist/style.css +1 -1
  30. package/dist/style.layer.css +1 -1
  31. package/dist/{toolPanelViews-BE4gv_L0.js → toolPanelViews-BISN9iaG.js} +120 -119
  32. package/dist/view/DetailToggleButton.d.ts +1 -0
  33. package/package.json +12 -5
  34. package/skills/spreadsheet-grid-solid/SKILL.md +108 -0
  35. package/dist/ColumnFilterPopover-BmxumbB7.js +0 -1418
  36. package/dist/columnVirtualizer-CGHyzbwH.js +0 -95
  37. package/dist/source/chunks/chunk-5KX4SR2S.jsx +0 -143
@@ -0,0 +1,1426 @@
1
+ import { f as e, i as t, o as n, r, t as i } from "./portalTokens-Gz03P3fZ.js";
2
+ import { n as a, r as o, t as s } from "./columnVirtualizer-DdL7-ijS.js";
3
+ import { n as c, r as l, t as u } from "./inputValue-C6BHBMBx.js";
4
+ import { For as d, Match as f, Show as p, Switch as m, createEffect as h, createMemo as g, createSignal as _, onCleanup as v, untrack as y } from "solid-js";
5
+ import { Portal as b, addEvent as x, className as S, createComponent as C, delegateEvents as w, effect as T, heldRead as E, insert as D, memo as O, readShallow as k, ref as A, setAttribute as j, setStyleProperty as M, spread as N, style as ee, template as P } from "@solidjs/web";
6
+ import { formatLocaleText as F } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
7
+ import { isImeComposingKeyEvent as I } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/domGuards";
8
+ import { isEscapePreventedInside as L } from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/escapeClaimController";
9
+ import { toDateKey as R } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/filtering";
10
+ import { parseFilterDateText as z } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorValues";
11
+ import { getEventTarget as B } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/shadowDom";
12
+ import { createDateRolloverStore as V } from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/dateRolloverStore";
13
+ import { normalizeDateFilterPresets as H } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/dateFilterPresets";
14
+ import { DEFAULT_FILTER_LOCALE_TEXT as U } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFilters";
15
+ import { keepFocusAfterPress as W } from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/popoverSupport";
16
+ import { resolveFocusWrapTarget as G } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/focusCycle";
17
+ import { filterSetOptionsBySearch as K, resolveSetFilterEnterAction as te } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/setFilterSearch";
18
+ import { isSetValueSelected as q } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/setFilterSelection";
19
+ import { DEFAULT_NUMBER_FILTER_DRAFT as J, NUMBER_FILTER_OPERATOR_OPTIONS as Y, buildParsedNumberFilterFromDraft as X, filterOptionsByNumberCondition as ne, numberFilterOperandCount as re } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/numberFilterCondition";
20
+ import { DEFAULT_TEXT_FILTER_DRAFT as ie, TEXT_FILTER_OPERATOR_OPTIONS as ae, buildParsedTextFilterFromDraft as oe, filterOptionsByTextCondition as se, textFilterOperandCount as ce } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/textFilterCondition";
21
+ import { DATE_FILTER_OPERATOR_OPTIONS as le, DEFAULT_DATE_FILTER_DRAFT as ue, buildParsedDateFilterFromDraft as de, dateFilterOperandCount as fe, filterOptionsByDateCondition as pe, normalizeFilterDateInputValue as me, resolveComboReferenceDate as he } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/dateFilterCondition";
22
+ import { buildDateTreeRows as ge } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/dateFilterTree";
23
+ import { buildCalendarDayCells as _e, buildYearGrid as ve, formatFilterDateDisplay as ye, yearGridStart as be } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/datePickerCalendar";
24
+ //#region src/view/FilterDateField.tsx
25
+ var xe = /* @__PURE__ */ P("<div class=ssg-dp-root><div class=ssg-dp-field><input type=text inputmode=numeric placeholder=yyyy/mm/dd class=ssg-dp-input><button><svg width=12 height=12 viewBox=\"0 0 16 16\"aria-hidden=true><rect x=1.5 y=2.5 width=13 height=12 rx=1.5 fill=none stroke=currentColor></rect><line x1=1.5 y1=6 x2=14.5 y2=6 stroke=currentColor></line><line x1=5 y1=1 x2=5 y2=4 stroke=currentColor></line><line x1=11 y1=1 x2=11 y2=4 stroke=currentColor>"), Se = /* @__PURE__ */ P("<div class=ssg-dp-panel><div class=ssg-dp-nav><button>‹</button><button></button><button>›</button></div><!><!><div class=ssg-dp-foot><button></button><button>"), Ce = /* @__PURE__ */ P("<div class=ssg-dp-dow>"), we = /* @__PURE__ */ P("<div class=ssg-dp-days>"), Te = /* @__PURE__ */ P("<span>"), Z = /* @__PURE__ */ P("<button>"), Ee = /* @__PURE__ */ P("<div class=ssg-dp-grid>");
26
+ function De(t) {
27
+ let n = e(), [r, i] = _(null), [a, o] = _(!1), [s, c] = _(!1), [u, f] = _("days"), [p, m] = _((/* @__PURE__ */ new Date()).getFullYear()), [b, x] = _((/* @__PURE__ */ new Date()).getMonth()), S, w = !1;
28
+ v(() => {
29
+ w = !0, t.inputRef && t.inputRef.current === E && (t.inputRef.current = null);
30
+ });
31
+ let E, k = g(() => r() ?? ye(t.value)), M = () => R(/* @__PURE__ */ new Date()) ?? "", ee = l(k), P = () => {
32
+ let e = y(r);
33
+ if (e === null) return;
34
+ let n = e.trim();
35
+ if (n === "") {
36
+ t.onCommit(""), i(null), o(!1);
37
+ return;
38
+ }
39
+ let a = z(n);
40
+ if (a === null) {
41
+ o(!0);
42
+ return;
43
+ }
44
+ t.onCommit(a), i(null), o(!1);
45
+ }, L = () => {
46
+ let [e, n] = (t.value === "" ? M() : t.value).split("-");
47
+ m(Number(e)), x(Number(n) - 1), f("days"), c(!0);
48
+ }, V = () => {
49
+ c(!1);
50
+ }, H = (e) => {
51
+ t.onCommit(e), i(null), o(!1), V();
52
+ };
53
+ h(s, (e) => {
54
+ if (!e) return;
55
+ let t = (e) => {
56
+ let t = B(e, S ?? null);
57
+ t && S?.contains(t) || c(!1);
58
+ };
59
+ return document.addEventListener("pointerdown", t, !0), () => {
60
+ document.removeEventListener("pointerdown", t, !0);
61
+ };
62
+ }, { name: "dateFieldOutsidePress" });
63
+ let U = (e) => {
64
+ if (e.stopPropagation(), e.key === "Enter") {
65
+ if (I(e)) return;
66
+ e.preventDefault(), P(), V();
67
+ return;
68
+ }
69
+ if (e.key === "Escape") {
70
+ if (e.preventDefault(), y(s)) {
71
+ V();
72
+ return;
73
+ }
74
+ t.onRequestClose();
75
+ }
76
+ }, W = (e) => ({
77
+ onPointerDown: (t) => {
78
+ t.preventDefault(), t.stopPropagation(), e();
79
+ },
80
+ onKeyDown: (n) => {
81
+ if (n.stopPropagation(), n.key === "Enter" || n.key === " ") {
82
+ n.preventDefault(), e();
83
+ return;
84
+ }
85
+ if (n.key === "Escape") {
86
+ if (n.preventDefault(), y(s)) {
87
+ V(), n.currentTarget.closest(".ssg-dp-root")?.querySelector(".ssg-dp-input")?.focus();
88
+ return;
89
+ }
90
+ t.onRequestClose();
91
+ }
92
+ }
93
+ }), G = (e) => {
94
+ let t = y(u);
95
+ if (t === "days") {
96
+ let t = new Date(y(p), y(b) + e, 1);
97
+ m(t.getFullYear()), x(t.getMonth());
98
+ return;
99
+ }
100
+ if (t === "months") {
101
+ m((t) => t + e);
102
+ return;
103
+ }
104
+ m((t) => t + e * 12);
105
+ }, K = () => {
106
+ f((e) => e === "days" ? "months" : "years");
107
+ }, te = () => {
108
+ f((e) => e === "years" ? "months" : "days");
109
+ }, q = () => {
110
+ let e = u();
111
+ return e === "days" ? F(n().calendarTitle, {
112
+ year: p(),
113
+ month: b() + 1
114
+ }) : e === "months" ? F(n().calendarYear, { year: p() }) : `${be(p())} – ${be(p()) + 11}`;
115
+ };
116
+ var J = xe(), Y = J.firstChild, X = Y.firstChild, ne = X.nextSibling;
117
+ return A(() => (e) => S = e, J), X.addEventListener("blur", () => {
118
+ w || P();
119
+ }), X._$$keydown = U, X._$$input = (e) => {
120
+ i(e.currentTarget.value), o(!1);
121
+ }, A(() => (e) => {
122
+ E = e, t.inputRef && (t.inputRef.current = e), ee(e);
123
+ }, X), N(ne, [{
124
+ type: "button",
125
+ class: "ssg-dp-cal-btn",
126
+ get "aria-label"() {
127
+ return s() ? n().calendarClose : n().calendarOpen;
128
+ }
129
+ }, () => W(() => {
130
+ y(s) ? V() : L();
131
+ })], !0), D(J, (() => {
132
+ var e = O(() => !!s());
133
+ return () => e() ? (() => {
134
+ var e = Se(), r = e.firstChild, i = r.firstChild, a = i.nextSibling, o = a.nextSibling, s = r.nextSibling, c = s.nextSibling, l = c.nextSibling, h = l.firstChild, g = h.nextSibling;
135
+ return N(i, [{
136
+ type: "button",
137
+ class: "ssg-dp-nav-btn",
138
+ get "aria-label"() {
139
+ return n().calendarPrevious;
140
+ }
141
+ }, () => W(() => G(-1))], !0), N(a, [{
142
+ type: "button",
143
+ class: "ssg-dp-nav-title",
144
+ get disabled() {
145
+ return u() === "years";
146
+ },
147
+ get "aria-label"() {
148
+ return n().calendarChangeView;
149
+ }
150
+ }, () => W(K)], !0), D(a, q), N(o, [{
151
+ type: "button",
152
+ class: "ssg-dp-nav-btn",
153
+ get "aria-label"() {
154
+ return n().calendarNext;
155
+ }
156
+ }, () => W(() => G(1))], !0), D(e, (() => {
157
+ var e = O(() => u() === "days");
158
+ return () => e() ? [(() => {
159
+ var e = Ce();
160
+ return D(e, C(d, {
161
+ get each() {
162
+ return n().calendarWeekdays;
163
+ },
164
+ children: (e, t) => (() => {
165
+ var n = Te();
166
+ return D(n, e), T(() => ({
167
+ e: t() === 0,
168
+ t: t() === 6
169
+ }), ({ e, t }, r) => {
170
+ e !== r?.e && n.classList.toggle("ssg-dp-dow--sun", e), t !== r?.t && n.classList.toggle("ssg-dp-dow--sat", t);
171
+ }), n;
172
+ })()
173
+ })), e;
174
+ })(), (() => {
175
+ var e = we();
176
+ return D(e, C(d, {
177
+ get each() {
178
+ return _e(p(), b());
179
+ },
180
+ children: (e) => (() => {
181
+ var n = Z();
182
+ return N(n, [{
183
+ type: "button",
184
+ get class() {
185
+ return ["ssg-dp-day", {
186
+ "ssg-dp-day--out": !e.inCurrentMonth,
187
+ "ssg-dp-day--today": e.key === M(),
188
+ "ssg-dp-day--selected": e.key === t.value
189
+ }];
190
+ },
191
+ get "aria-label"() {
192
+ return e.key;
193
+ }
194
+ }, () => W(() => H(e.key))], !0), D(n, () => e.day), n;
195
+ })()
196
+ })), e;
197
+ })()] : void 0;
198
+ })(), s), D(e, (() => {
199
+ var e = O(() => u() === "months");
200
+ return () => e() ? (() => {
201
+ var e = Ee();
202
+ return D(e, C(d, {
203
+ get each() {
204
+ return n().calendarMonths;
205
+ },
206
+ children: (e, t) => (() => {
207
+ var n = Z();
208
+ return N(n, [{
209
+ type: "button",
210
+ get class() {
211
+ return ["ssg-dp-cell", { "ssg-dp-cell--selected": t() === b() }];
212
+ }
213
+ }, () => W(() => {
214
+ x(y(t)), f("days");
215
+ })], !0), D(n, e), n;
216
+ })()
217
+ })), e;
218
+ })() : void 0;
219
+ })(), c), D(e, (() => {
220
+ var e = O(() => u() === "years");
221
+ return () => e() ? (() => {
222
+ var e = Ee();
223
+ return D(e, C(d, {
224
+ get each() {
225
+ return ve(p());
226
+ },
227
+ children: (e) => (() => {
228
+ var t = Z();
229
+ return N(t, [{
230
+ type: "button",
231
+ get class() {
232
+ return ["ssg-dp-cell", { "ssg-dp-cell--selected": e === p() }];
233
+ }
234
+ }, () => W(() => {
235
+ m(e), f("months");
236
+ })], !0), D(t, e), t;
237
+ })()
238
+ })), e;
239
+ })() : void 0;
240
+ })(), l), D(l, (() => {
241
+ var e = O(() => u() !== "days");
242
+ return () => e() ? (() => {
243
+ var e = Z();
244
+ return N(e, [{
245
+ type: "button",
246
+ class: "ssg-dp-foot-btn"
247
+ }, () => W(te)], !0), D(e, () => n().calendarBack), e;
248
+ })() : void 0;
249
+ })(), h), N(h, [{
250
+ type: "button",
251
+ class: "ssg-dp-foot-btn"
252
+ }, () => W(() => H(M()))], !0), D(h, () => n().calendarToday), N(g, [{
253
+ type: "button",
254
+ class: "ssg-dp-foot-btn ssg-dp-foot-btn--muted"
255
+ }, () => W(() => H(""))], !0), D(g, () => n().clear), T(() => t.align === "right", (t) => {
256
+ e.classList.toggle("ssg-dp-panel--right", t);
257
+ }), e;
258
+ })() : void 0;
259
+ })(), null), T(() => ({
260
+ e: !!s(),
261
+ t: !!a(),
262
+ a: t.ariaLabel,
263
+ o: a() ? "true" : void 0
264
+ }), ({ e, t, a: n, o: r }, i) => {
265
+ e !== i?.e && Y.classList.toggle("ssg-dp-field--open", e), t !== i?.t && Y.classList.toggle("ssg-dp-field--invalid", t), n !== i?.a && j(X, "aria-label", n), r !== i?.o && j(X, "aria-invalid", r);
266
+ }), J;
267
+ }
268
+ w(["input", "keydown"]);
269
+ //#endregion
270
+ //#region src/view/ColumnFilterPopover.tsx
271
+ var Oe = /* @__PURE__ */ P("<span class=ssg-filter-truncated>"), ke = /* @__PURE__ */ P("<input type=text value class=ssg-filter-input>"), Ae = /* @__PURE__ */ P("<label class=ssg-filter-selectall><input type=checkbox><span class=ssg-filter-selectall-label>"), je = /* @__PURE__ */ P("<div class=ssg-filter-list>"), Me = /* @__PURE__ */ P("<div class=ssg-filter-meta><!><!><!>"), Ne = /* @__PURE__ */ P("<div class=ssg-filter-virt>"), Pe = /* @__PURE__ */ P("<div class=ssg-filter-empty>"), Fe = /* @__PURE__ */ P("<label class=ssg-filter-option><input type=checkbox><span class=ssg-filter-option-label>"), Ie = /* @__PURE__ */ P("<select class=ssg-filter-select>"), Le = /* @__PURE__ */ P("<option>"), Re = /* @__PURE__ */ P("<div class=ssg-filter-cond-values><!><!>"), ze = /* @__PURE__ */ P("<div class=ssg-filter-meta>"), Be = /* @__PURE__ */ P("<span class=ssg-filter-cond-tilde>"), Ve = /* @__PURE__ */ P("<input type=text class=ssg-filter-input>"), He = /* @__PURE__ */ P("<div class=ssg-filter-cond-values>"), Ue = /* @__PURE__ */ P("<div class=ssg-filter-presets>"), Q = /* @__PURE__ */ P("<button>"), We = /* @__PURE__ */ P("<input type=checkbox>"), Ge = /* @__PURE__ */ P("<span class=ssg-filter-option-label>"), Ke = /* @__PURE__ */ P("<span class=\"ssg-filter-tree-toggle ssg-filter-tree-toggle--placeholder\">"), qe = /* @__PURE__ */ P("<div class=ssg-filter-virt><!><!>"), Je = /* @__PURE__ */ P("<div class=ssg-filter-option>"), Ye = /* @__PURE__ */ P("<div class=ssg-filter-error role=alert><div></div><!><!>"), Xe = /* @__PURE__ */ P("<div class=ssg-filter-collecting>"), Ze = /* @__PURE__ */ P("<div class=ssg-filter-error-detail>"), Qe = /* @__PURE__ */ P("<select class=ssg-filter-select><option value>"), $e = /* @__PURE__ */ P("<div class=ssg-filter-meta><!><!>"), et = /* @__PURE__ */ P("<div class=\"ssg-filter-meta ssg-filter-meta--ellipsis\">"), tt = /* @__PURE__ */ P("<div class=ssg-filter-sec-head><span class=ssg-filter-sec-label></span><button>"), nt = /* @__PURE__ */ P("<div class=ssg-filter-sep>"), rt = /* @__PURE__ */ P("<div class=ssg-filter-sec-head><span class=ssg-filter-sec-label></span><span class=ssg-filter-sec-meta></span><button>"), it = /* @__PURE__ */ P("<div class=ssg-filter-summary>🔽 "), at = /* @__PURE__ */ P("<div role=dialog tabindex=-1><div class=ssg-filter-title></div><!><div class=ssg-filter-footer>"), ot = (e) => {
272
+ let t;
273
+ return v(() => {
274
+ let n = y(e);
275
+ n && t !== void 0 && n.current === t && (n.current = null);
276
+ }), (n) => {
277
+ t = n;
278
+ let r = y(e);
279
+ r && (r.current = n);
280
+ };
281
+ }, st = 24, ct = 40, lt = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(pointer: coarse)").matches ? ct : st, ut = (e, t, n) => e === "" && t === U.blank ? n : t, dt = (e, t) => t === U.blank ? e : e.map((e) => e.value === "" && e.label === U.blank ? {
282
+ ...e,
283
+ label: t
284
+ } : e), ft = (e) => {
285
+ e.key !== "Escape" && e.stopPropagation();
286
+ }, $ = (e) => ({
287
+ onPointerDown: (t) => {
288
+ t.preventDefault(), t.stopPropagation(), e(t.currentTarget);
289
+ },
290
+ onKeyDown: (t) => {
291
+ ft(t), (t.key === "Enter" || t.key === " ") && (t.preventDefault(), e(t.currentTarget));
292
+ }
293
+ }), pt = (e, t, n) => {
294
+ if (n.isComposing === !0) {
295
+ e(t, { commit: !1 });
296
+ return;
297
+ }
298
+ e(t);
299
+ }, mt = (e, t, n) => {
300
+ if (e === null) return n;
301
+ let r = 0;
302
+ for (let n of e.values) t.has(n) && (r += 1);
303
+ return e.mode === "include" ? r : n - r;
304
+ };
305
+ function ht() {
306
+ let t = e();
307
+ var n = Oe();
308
+ return D(n, () => t().filterOptionsTruncated), n;
309
+ }
310
+ var gt = (e, t, n) => t === 0 ? n ? e.filterNoOptionsSource : e.noOptions : e.filterNoMatches;
311
+ function _t(t) {
312
+ let r = e(), [i, a] = _(""), o = g(() => dt(t.options, r().blank)), l = g(() => K(o(), i())), f = g(() => i().trim().length > 0), p, m = lt(), h = s(() => ({
313
+ count: l().length,
314
+ getScrollElement: () => p ?? null,
315
+ estimateSize: () => m,
316
+ overscan: 10
317
+ })), v = g(() => {
318
+ let e = l();
319
+ return h.items().flatMap((t) => {
320
+ let n = e[t.index];
321
+ return n ? [{
322
+ option: n,
323
+ start: t.start,
324
+ size: t.size
325
+ }] : [];
326
+ });
327
+ }), b = g(() => (h.items(), h.instance.getTotalSize())), S = g(() => {
328
+ let e = t.setSelection, n = l();
329
+ if (e === null) return n.length;
330
+ let r = 0;
331
+ for (let t of n) q(e, t.value) && (r += 1);
332
+ return r;
333
+ }), w = g(() => l().length > 0 && S() === l().length), k = g(() => S() > 0 && !w()), N = g(() => new Set(t.options.map((e) => e.value))), ee = g(() => mt(t.setSelection, N(), t.options.length)), P = () => {
334
+ t.onSelectAllChange(y(f) || t.selectAllUsesExplicitScope ? y(l).map((e) => e.value) : "all", !y(w));
335
+ }, L = c(k), R = ot(() => t.searchInputRef);
336
+ return [
337
+ (() => {
338
+ var e = ke();
339
+ return e._$$keydown = (e) => {
340
+ if (e.stopPropagation(), e.key === "Escape" && (e.preventDefault(), t.onRequestClose()), e.key === "Enter") {
341
+ if (I(e)) return;
342
+ e.preventDefault();
343
+ let n = te(y(o), e.currentTarget.value);
344
+ if (n.kind === "none") return;
345
+ n.kind === "replace" && t.onReplaceSelection(n.values), t.onRequestClose();
346
+ }
347
+ }, e._$$input = (e) => a(e.currentTarget.value), A(() => R, e), T(() => ({
348
+ e: r().filterSearchPlaceholder,
349
+ t: r().filterSearchPlaceholder
350
+ }), ({ e: t, t: n }, r) => {
351
+ t !== r?.e && j(e, "placeholder", t), n !== r?.t && j(e, "aria-label", n);
352
+ }), e;
353
+ })(),
354
+ (() => {
355
+ var e = Ae(), t = e.firstChild, n = t.nextSibling;
356
+ return x(t, "change", u(k, P)), A(() => L, t), D(n, (() => {
357
+ var e = O(() => !!f());
358
+ return () => e() ? r().filterSelectAllResults : r().filterSelectAll;
359
+ })()), T(() => w(), (e) => {
360
+ t.checked = e;
361
+ }), e;
362
+ })(),
363
+ (() => {
364
+ var e = je();
365
+ return A(() => (e) => p = e, e), D(e, (() => {
366
+ var e = O(() => l().length > 0);
367
+ return () => e() ? (() => {
368
+ var e = Ne();
369
+ return D(e, C(d, {
370
+ get each() {
371
+ return v();
372
+ },
373
+ keyed: (e) => e.option.value,
374
+ children: (e) => (() => {
375
+ var i = Fe(), a = i.firstChild, o = a.nextSibling;
376
+ return x(a, "change", u(() => !1, () => t.onValueToggle(y(e).option.value))), D(o, () => ut(e().option.value, e().option.label, r().blank)), T(() => ({
377
+ e: `translateY(${e().start}px)`,
378
+ t: n(e().size),
379
+ a: q(t.setSelection, e().option.value),
380
+ o: E()
381
+ }), ({ e, t, a: n, o: r }, o) => {
382
+ e !== o?.e && M(i, "transform", e), t !== o?.t && M(i, "height", t), (n !== o?.a || !r) && (a.checked = n);
383
+ }), i;
384
+ })()
385
+ })), T(() => n(b()), (t) => {
386
+ M(e, "height", t);
387
+ }), e;
388
+ })() : (() => {
389
+ var e = Pe();
390
+ return D(e, () => gt(r(), t.options.length, t.isServerSide)), e;
391
+ })();
392
+ })()), e;
393
+ })(),
394
+ (() => {
395
+ var e = Me(), n = e.firstChild, i = n.nextSibling, a = i.nextSibling;
396
+ return D(e, () => F(r().filterSelectedCount, {
397
+ selected: ee(),
398
+ total: t.options.length
399
+ }), n), D(e, (() => {
400
+ var e = O(() => !!f());
401
+ return () => e() ? F(r().filterShownCount, { count: l().length }) : "";
402
+ })(), i), D(e, (() => {
403
+ var e = O(() => !!t.truncated);
404
+ return () => e() ? C(ht, {}) : void 0;
405
+ })(), a), e;
406
+ })()
407
+ ];
408
+ }
409
+ function vt(t) {
410
+ let n = e(), r = g(() => re(t.draft.operator)), i = l(() => t.draft.operator);
411
+ return [(() => {
412
+ var e = Ie();
413
+ return x(e, "keydown", t.onKeyDown, !0), e.addEventListener("change", (e) => t.onDraftChange({
414
+ ...t.draft,
415
+ operator: e.currentTarget.value
416
+ })), A(() => i, e), D(e, C(d, {
417
+ each: Y,
418
+ children: (e) => (() => {
419
+ var t = Le();
420
+ return D(t, () => n()[e.labelKey]), T(() => e.value, (e) => {
421
+ t.value = e;
422
+ }), t;
423
+ })()
424
+ })), T(() => n().filterOperator, (t) => {
425
+ j(e, "aria-label", t);
426
+ }), e;
427
+ })(), O(() => O(() => r() > 0)() ? (() => {
428
+ var e = Re(), i = e.firstChild, a = i.nextSibling;
429
+ return D(e, C(yt, {
430
+ value: () => t.draft.value1,
431
+ get inputRef() {
432
+ return t.valueInputRef;
433
+ },
434
+ inputMode: "decimal",
435
+ onChange: (e, n) => pt(t.onDraftChange, {
436
+ ...t.draft,
437
+ value1: e
438
+ }, n),
439
+ onCommit: (e) => t.onDraftChange({
440
+ ...t.draft,
441
+ value1: e
442
+ }),
443
+ get onKeyDown() {
444
+ return t.onKeyDown;
445
+ },
446
+ get placeholder() {
447
+ return O(() => r() === 2)() ? n().filterMin : n().filterValuePlaceholder;
448
+ },
449
+ get ariaLabel() {
450
+ return O(() => r() === 2)() ? n().filterMin : n().filterValue;
451
+ }
452
+ }), i), D(e, (() => {
453
+ var e = O(() => r() === 2);
454
+ return () => e() ? [(() => {
455
+ var e = Be();
456
+ return D(e, () => n().filterRangeSeparator), e;
457
+ })(), C(yt, {
458
+ value: () => t.draft.value2,
459
+ inputMode: "decimal",
460
+ onChange: (e, n) => pt(t.onDraftChange, {
461
+ ...t.draft,
462
+ value2: e
463
+ }, n),
464
+ onCommit: (e) => t.onDraftChange({
465
+ ...t.draft,
466
+ value2: e
467
+ }),
468
+ get onKeyDown() {
469
+ return t.onKeyDown;
470
+ },
471
+ get placeholder() {
472
+ return n().filterMax;
473
+ },
474
+ get ariaLabel() {
475
+ return n().filterMax;
476
+ }
477
+ })] : void 0;
478
+ })(), a), e;
479
+ })() : (() => {
480
+ var e = ze();
481
+ return D(e, () => n().filterNoValue), e;
482
+ })())];
483
+ }
484
+ function yt(e) {
485
+ let t = l(() => e.value()), n = ot(() => e.inputRef);
486
+ var r = Ve();
487
+ return x(r, "keydown", e.onKeyDown, !0), r.addEventListener("compositionend", (t) => e.onCommit(t.currentTarget.value)), r._$$input = (t) => e.onChange(t.currentTarget.value, t), A(() => (e) => {
488
+ n(e), t(e);
489
+ }, r), T(() => ({
490
+ e: e.inputMode,
491
+ t: e.placeholder,
492
+ a: e.ariaLabel
493
+ }), ({ e, t, a: n }, i) => {
494
+ e !== i?.e && j(r, "inputmode", e), t !== i?.t && j(r, "placeholder", t), n !== i?.a && j(r, "aria-label", n);
495
+ }), r;
496
+ }
497
+ function bt(t) {
498
+ let n = e(), r = g(() => ce(t.draft.operator)), i = l(() => t.draft.operator);
499
+ return [(() => {
500
+ var e = Ie();
501
+ return x(e, "keydown", t.onKeyDown, !0), e.addEventListener("change", (e) => t.onDraftChange({
502
+ ...t.draft,
503
+ operator: e.currentTarget.value
504
+ })), A(() => i, e), D(e, C(d, {
505
+ each: ae,
506
+ children: (e) => (() => {
507
+ var t = Le();
508
+ return D(t, () => n()[e.labelKey]), T(() => e.value, (e) => {
509
+ t.value = e;
510
+ }), t;
511
+ })()
512
+ })), T(() => n().filterOperator, (t) => {
513
+ j(e, "aria-label", t);
514
+ }), e;
515
+ })(), O(() => O(() => r() > 0)() ? (() => {
516
+ var e = He();
517
+ return D(e, C(yt, {
518
+ value: () => t.draft.value,
519
+ get inputRef() {
520
+ return t.valueInputRef;
521
+ },
522
+ onChange: (e, n) => pt(t.onDraftChange, {
523
+ ...t.draft,
524
+ value: e
525
+ }, n),
526
+ onCommit: (e) => t.onDraftChange({
527
+ ...t.draft,
528
+ value: e
529
+ }),
530
+ get onKeyDown() {
531
+ return t.onKeyDown;
532
+ },
533
+ get placeholder() {
534
+ return n().filterValuePlaceholder;
535
+ },
536
+ get ariaLabel() {
537
+ return n().filterValue;
538
+ }
539
+ })), e;
540
+ })() : (() => {
541
+ var e = ze();
542
+ return D(e, () => n().filterNoValue), e;
543
+ })())];
544
+ }
545
+ function xt(t) {
546
+ let n = e(), r = g(() => t.draft.preset === null ? fe(t.draft.operator) : 0), i = l(() => t.draft.operator), a = (e, n) => {
547
+ t.onDraftChange({
548
+ ...t.draft,
549
+ [e]: me(n),
550
+ preset: null
551
+ });
552
+ }, o = (e) => {
553
+ let r = t.renderDateInput;
554
+ if (!r) return null;
555
+ let i = e === "to" ? "value2" : "value1";
556
+ return y(() => r({
557
+ get value() {
558
+ return t.draft[i];
559
+ },
560
+ onChange: (e) => a(i, e),
561
+ get ariaLabel() {
562
+ return e === "from" ? n().filterStartDate : e === "to" ? n().filterEndDate : n().filterDate;
563
+ },
564
+ slot: e
565
+ }));
566
+ }, s = g(() => r() === 2 ? "from" : "single"), c = (e) => {
567
+ t.onDraftChange({
568
+ ...t.draft,
569
+ preset: t.draft.preset === e ? null : e
570
+ });
571
+ };
572
+ return [
573
+ (() => {
574
+ var e = Ie();
575
+ return x(e, "keydown", t.onKeyDown, !0), e.addEventListener("change", (e) => t.onDraftChange({
576
+ ...t.draft,
577
+ operator: e.currentTarget.value,
578
+ preset: null
579
+ })), A(() => i, e), D(e, C(d, {
580
+ each: le,
581
+ children: (e) => (() => {
582
+ var t = Le();
583
+ return D(t, () => n()[e.labelKey]), T(() => e.value, (e) => {
584
+ t.value = e;
585
+ }), t;
586
+ })()
587
+ })), T(() => n().filterOperator, (t) => {
588
+ j(e, "aria-label", t);
589
+ }), e;
590
+ })(),
591
+ O(() => O(() => r() > 0)() ? (() => {
592
+ var e = Re(), i = e.firstChild, a = i.nextSibling;
593
+ return D(e, C(p, {
594
+ get when() {
595
+ return t.renderDateInput;
596
+ },
597
+ get fallback() {
598
+ return C(De, {
599
+ get value() {
600
+ return t.draft.value1;
601
+ },
602
+ onCommit: (e) => t.onDraftChange({
603
+ ...t.draft,
604
+ value1: e,
605
+ preset: null
606
+ }),
607
+ get ariaLabel() {
608
+ return O(() => r() === 2)() ? n().filterStartDate : n().filterDate;
609
+ },
610
+ get inputRef() {
611
+ return t.valueInputRef;
612
+ },
613
+ get onRequestClose() {
614
+ return t.onRequestClose;
615
+ }
616
+ });
617
+ },
618
+ get children() {
619
+ return (() => {
620
+ let e = s();
621
+ return y(() => o(e));
622
+ })();
623
+ }
624
+ }), i), D(e, (() => {
625
+ var e = O(() => r() === 2);
626
+ return () => e() ? [(() => {
627
+ var e = Be();
628
+ return D(e, () => n().filterRangeSeparator), e;
629
+ })(), C(p, {
630
+ get when() {
631
+ return t.renderDateInput;
632
+ },
633
+ get fallback() {
634
+ return C(De, {
635
+ get value() {
636
+ return t.draft.value2;
637
+ },
638
+ onCommit: (e) => t.onDraftChange({
639
+ ...t.draft,
640
+ value2: e,
641
+ preset: null
642
+ }),
643
+ get ariaLabel() {
644
+ return n().filterEndDate;
645
+ },
646
+ get onRequestClose() {
647
+ return t.onRequestClose;
648
+ },
649
+ align: "right"
650
+ });
651
+ },
652
+ get children() {
653
+ return y(() => o("to"));
654
+ }
655
+ })] : void 0;
656
+ })(), a), e;
657
+ })() : C(p, {
658
+ get when() {
659
+ return t.draft.preset === null;
660
+ },
661
+ get children() {
662
+ var e = ze();
663
+ return D(e, () => n().filterNoValue), e;
664
+ }
665
+ })),
666
+ O(() => O(() => t.presets.length > 0)() ? (() => {
667
+ var e = Ue();
668
+ return D(e, C(d, {
669
+ get each() {
670
+ return t.presets;
671
+ },
672
+ keyed: (e) => e.id,
673
+ children: (e) => (() => {
674
+ var n = Q();
675
+ return N(n, [
676
+ { type: "button" },
677
+ () => $((t) => {
678
+ c(e().id), W(t);
679
+ }),
680
+ { get class() {
681
+ return ["ssg-filter-preset-chip", { "ssg-filter-preset-chip--active": t.draft.preset === e().id }];
682
+ } }
683
+ ], !0), D(n, () => e().label), n;
684
+ })()
685
+ })), e;
686
+ })() : void 0)
687
+ ];
688
+ }
689
+ function St(t) {
690
+ let r = e(), [i, a] = _(""), [o, l] = _(/* @__PURE__ */ new Set()), f = g(() => i().trim().length > 0), p = g(() => dt(t.options, r().blank)), m = g(() => K(p(), i())), h = g(() => ge(t.options, o(), r())), v, b = g(() => f() ? m().length : h().length), S = lt(), w = s(() => ({
691
+ count: b(),
692
+ getScrollElement: () => v ?? null,
693
+ estimateSize: () => S,
694
+ overscan: 10
695
+ })), k = g(() => (w.items(), w.instance.getTotalSize())), ee = g(() => {
696
+ if (!f()) return [];
697
+ let e = m();
698
+ return w.items().flatMap((t) => {
699
+ let n = e[t.index];
700
+ return n ? [{
701
+ option: n,
702
+ start: t.start,
703
+ size: t.size
704
+ }] : [];
705
+ });
706
+ }), P = g(() => {
707
+ if (f()) return [];
708
+ let e = h();
709
+ return w.items().flatMap((t) => {
710
+ let n = e[t.index];
711
+ return n ? [{
712
+ row: n,
713
+ start: t.start,
714
+ size: t.size
715
+ }] : [];
716
+ });
717
+ }), L = g(() => (f() ? m() : t.options).map((e) => e.value)), R = g(() => {
718
+ let e = 0;
719
+ for (let n of L()) q(t.setSelection, n) && (e += 1);
720
+ return e;
721
+ }), z = g(() => L().length > 0 && R() === L().length), B = g(() => R() > 0 && !z()), V = g(() => new Set(t.options.map((e) => e.value))), H = g(() => mt(t.setSelection, V(), t.options.length)), U = (e) => {
722
+ l((t) => {
723
+ let n = new Set(t);
724
+ return n.has(e) ? n.delete(e) : n.add(e), n;
725
+ });
726
+ }, W = (e, t) => {
727
+ let n = 0;
728
+ for (let r of e) q(t, r) && (n += 1);
729
+ return n;
730
+ }, G = (e) => {
731
+ if (e.type === "leaf") {
732
+ t.onValueToggle(e.key);
733
+ return;
734
+ }
735
+ let n = y(() => t.setSelection), r = e.leafKeys.length > 0 && W(e.leafKeys, n) === e.leafKeys.length;
736
+ t.onSelectAllChange(e.leafKeys, !r);
737
+ }, J = c(B), Y = ot(() => t.searchInputRef), X = (e) => {
738
+ let n = g(() => W(e.row().leafKeys, t.setSelection)), i = g(() => e.row().leafKeys.length > 0 && n() === e.row().leafKeys.length), a = g(() => n() > 0 && !i()), o = c(a), s = () => ut(e.row().key, e.row().label, r().blank);
739
+ return [
740
+ O(() => O(() => e.row().type === "group")() ? (() => {
741
+ var t = Q();
742
+ return N(t, [
743
+ { type: "button" },
744
+ () => $(() => U(y(e.row).key)),
745
+ {
746
+ class: "ssg-filter-tree-toggle",
747
+ get "aria-label"() {
748
+ return e.row().expanded ? r().treeCollapse : r().treeExpand;
749
+ }
750
+ }
751
+ ], !0), D(t, () => e.row().expanded ? "▾" : "▸"), t;
752
+ })() : Ke()),
753
+ (() => {
754
+ var t = We();
755
+ return x(t, "change", u(a, () => G(y(e.row)))), A(() => o, t), T(() => ({
756
+ e: i(),
757
+ t: s(),
758
+ a: E()
759
+ }), ({ e, t: n, a: r }, i) => {
760
+ (e !== i?.e || !r) && (t.checked = e), n !== i?.t && j(t, "aria-label", n);
761
+ }), t;
762
+ })(),
763
+ (() => {
764
+ var e = Ge();
765
+ return D(e, s), e;
766
+ })()
767
+ ];
768
+ };
769
+ return [
770
+ (() => {
771
+ var e = ke();
772
+ return e._$$keydown = (e) => {
773
+ if (e.stopPropagation(), e.key === "Escape" && (e.preventDefault(), t.onRequestClose()), e.key === "Enter") {
774
+ if (I(e)) return;
775
+ e.preventDefault();
776
+ let n = te(y(p), e.currentTarget.value);
777
+ if (n.kind === "none") return;
778
+ n.kind === "replace" && t.onReplaceSelection(n.values), t.onRequestClose();
779
+ }
780
+ }, e._$$input = (e) => a(e.currentTarget.value), A(() => Y, e), T(() => ({
781
+ e: r().filterSearchPlaceholder,
782
+ t: r().filterSearchPlaceholder
783
+ }), ({ e: t, t: n }, r) => {
784
+ t !== r?.e && j(e, "placeholder", t), n !== r?.t && j(e, "aria-label", n);
785
+ }), e;
786
+ })(),
787
+ (() => {
788
+ var e = Ae(), n = e.firstChild, i = n.nextSibling;
789
+ return x(n, "change", u(B, () => t.onSelectAllChange(y(L), !y(z)))), A(() => J, n), D(i, (() => {
790
+ var e = O(() => !!f());
791
+ return () => e() ? r().filterSelectAllResults : r().filterSelectAll;
792
+ })()), T(() => z(), (e) => {
793
+ n.checked = e;
794
+ }), e;
795
+ })(),
796
+ (() => {
797
+ var e = je();
798
+ return A(() => (e) => v = e, e), D(e, (() => {
799
+ var e = O(() => b() > 0);
800
+ return () => e() ? (() => {
801
+ var e = qe(), i = e.firstChild, a = i.nextSibling;
802
+ return D(e, C(d, {
803
+ get each() {
804
+ return ee();
805
+ },
806
+ keyed: (e) => e.option.value,
807
+ children: (e) => (() => {
808
+ var i = Fe(), a = i.firstChild, o = a.nextSibling;
809
+ return x(a, "change", u(() => !1, () => t.onValueToggle(y(e).option.value))), D(o, () => ut(e().option.value, e().option.label, r().blank)), T(() => ({
810
+ e: `translateY(${e().start}px)`,
811
+ t: n(e().size),
812
+ a: q(t.setSelection, e().option.value),
813
+ o: E()
814
+ }), ({ e, t, a: n, o: r }, o) => {
815
+ e !== o?.e && M(i, "transform", e), t !== o?.t && M(i, "height", t), (n !== o?.a || !r) && (a.checked = n);
816
+ }), i;
817
+ })()
818
+ }), i), D(e, C(d, {
819
+ get each() {
820
+ return P();
821
+ },
822
+ keyed: (e) => e.row.key,
823
+ children: (e) => (() => {
824
+ var t = Je();
825
+ return t._$$click = (t) => {
826
+ t.target.closest("button, input") || G(y(e).row);
827
+ }, D(t, C(X, { row: () => e().row })), T(() => ({
828
+ e: `translateY(${e().start}px)`,
829
+ t: n(e().size),
830
+ a: n(8 + e().row.depth * 16)
831
+ }), ({ e, t: n, a: r }, i) => {
832
+ e !== i?.e && M(t, "transform", e), n !== i?.t && M(t, "height", n), r !== i?.a && M(t, "padding-left", r);
833
+ }), t;
834
+ })()
835
+ }), a), T(() => n(k()), (t) => {
836
+ M(e, "height", t);
837
+ }), e;
838
+ })() : (() => {
839
+ var e = Pe();
840
+ return D(e, () => gt(r(), t.options.length, t.isServerSide)), e;
841
+ })();
842
+ })()), e;
843
+ })(),
844
+ (() => {
845
+ var e = Me(), n = e.firstChild, i = n.nextSibling, a = i.nextSibling;
846
+ return D(e, () => F(r().filterSelectedCount, {
847
+ selected: H(),
848
+ total: t.options.length
849
+ }), n), D(e, (() => {
850
+ var e = O(() => !!f());
851
+ return () => e() ? F(r().filterShownCount, { count: m().length }) : "";
852
+ })(), i), D(e, (() => {
853
+ var e = O(() => !!t.truncated);
854
+ return () => e() ? C(ht, {}) : void 0;
855
+ })(), a), e;
856
+ })()
857
+ ];
858
+ }
859
+ function Ct(t) {
860
+ let n = e();
861
+ return O(() => O(() => t.status === "error")() ? (() => {
862
+ var e = Ye(), r = e.firstChild, i = r.nextSibling, a = i.nextSibling;
863
+ return D(r, () => n().filterOptionsFailed), D(e, C(p, {
864
+ get when() {
865
+ return t.errorMessage;
866
+ },
867
+ children: (e) => (() => {
868
+ var t = Ze();
869
+ return D(t, e), T(() => e(), (e) => {
870
+ j(t, "title", e);
871
+ }), t;
872
+ })()
873
+ }), i), D(e, C(p, {
874
+ get when() {
875
+ return t.onRetry;
876
+ },
877
+ children: (e) => (() => {
878
+ var t = Q();
879
+ return N(t, [
880
+ { type: "button" },
881
+ () => $(() => e()()),
882
+ { class: "ssg-filter-btn-secondary" }
883
+ ], !0), D(t, () => n().retry), t;
884
+ })()
885
+ }), a), e;
886
+ })() : (() => {
887
+ var e = Xe();
888
+ return D(e, () => n().filterOptionsLoading), e;
889
+ })());
890
+ }
891
+ function wt(t) {
892
+ let n = e(), r = l(() => t.draftValue), i = ot(() => t.selectRef);
893
+ return [(() => {
894
+ var e = Qe(), a = e.firstChild;
895
+ return e._$$keydown = (e) => {
896
+ if (e.stopPropagation(), e.key === "Enter") {
897
+ e.preventDefault(), t.onApply();
898
+ return;
899
+ }
900
+ e.key === "Escape" && (e.preventDefault(), t.onRequestClose());
901
+ }, e.addEventListener("change", (e) => t.onDraftChange(e.currentTarget.value)), A(() => (e) => {
902
+ i(e), r(e);
903
+ }, e), D(a, () => n().filterAll), D(e, C(d, {
904
+ get each() {
905
+ return t.options;
906
+ },
907
+ children: (e) => (() => {
908
+ var t = Le();
909
+ return D(t, () => ut(e.value, e.label, n().blank)), T(() => e.value, (e) => {
910
+ t.value = e;
911
+ }), t;
912
+ })()
913
+ }), null), e;
914
+ })(), (() => {
915
+ var e = $e(), r = e.firstChild, i = r.nextSibling;
916
+ return D(e, () => F(n().filterOptionCount, { count: t.options.length }), r), D(e, (() => {
917
+ var e = O(() => !!t.truncated);
918
+ return () => e() ? C(ht, {}) : void 0;
919
+ })(), i), e;
920
+ })()];
921
+ }
922
+ function Tt(t) {
923
+ let n = e(), r = l(() => t.draftValue), i = ot(() => t.textInputRef);
924
+ return [(() => {
925
+ var e = Ve();
926
+ return e._$$keydown = (e) => {
927
+ if (e.stopPropagation(), !I(e)) {
928
+ if (e.key === "Enter") {
929
+ e.preventDefault(), t.onApply();
930
+ return;
931
+ }
932
+ e.key === "Escape" && (e.preventDefault(), t.onRequestClose());
933
+ }
934
+ }, e._$$input = (e) => t.onDraftChange(e.currentTarget.value), A(() => (e) => {
935
+ i(e), r(e);
936
+ }, e), T(() => ({
937
+ e: n().filterTextPlaceholder,
938
+ t: n().filterTextPlaceholder
939
+ }), ({ e: t, t: n }, r) => {
940
+ t !== r?.e && j(e, "placeholder", t), n !== r?.t && j(e, "aria-label", n);
941
+ }), e;
942
+ })(), (() => {
943
+ var e = et();
944
+ return D(e, () => n().filterTextHint), e;
945
+ })()];
946
+ }
947
+ function Et(t) {
948
+ let n = e();
949
+ return [
950
+ (() => {
951
+ var e = tt(), r = e.firstChild, i = r.nextSibling;
952
+ return D(r, () => n().filterConditionSection), N(i, [
953
+ { type: "button" },
954
+ () => $(() => t.onConditionClear()),
955
+ {
956
+ class: "ssg-filter-sec-clear",
957
+ get disabled() {
958
+ return !t.conditionActive;
959
+ }
960
+ }
961
+ ], !0), D(i, () => n().clear), e;
962
+ })(),
963
+ O(() => t.conditionEditor),
964
+ nt(),
965
+ (() => {
966
+ var e = rt(), r = e.firstChild, i = r.nextSibling, a = i.nextSibling;
967
+ return D(r, () => n().filterValuesSection), D(i, () => t.optionsMeta ?? F(t.conditionActive ? n().filterMatchCount : n().filterTotalCount, { count: t.options.length })), N(a, [
968
+ { type: "button" },
969
+ () => $(() => t.onSelectionClear()),
970
+ {
971
+ class: "ssg-filter-sec-clear",
972
+ get disabled() {
973
+ return t.setSelection === null;
974
+ }
975
+ }
976
+ ], !0), D(a, () => n().clear), e;
977
+ })(),
978
+ O(() => t.children),
979
+ (() => {
980
+ var e = it();
981
+ return D(e, () => t.summaryText, null), e;
982
+ })()
983
+ ];
984
+ }
985
+ function Dt(s) {
986
+ let c = e(), l = r().container(), u = { current: null }, d = /* @__PURE__ */ new Date(), p = V();
987
+ a(p, () => ({ active: s.filterType === "dateSet" && (s.dateConditionDraft?.preset ?? null) !== null }), "render", "filterDateRollover");
988
+ let h = o(p, "filterDateRolloverStore"), y = () => he(d, h()), [x, w] = _(), E;
989
+ v(() => {
990
+ E?.removeEventListener("keydown", Ce, !0), s.panelRef.current === E && (s.panelRef.current = null);
991
+ });
992
+ let M = g(() => s.layout);
993
+ i(x, () => s.themeClassName, M);
994
+ let P = g(() => s.filterType), R = g(() => P() === "set"), z = g(() => P() === "numberSet"), B = g(() => P() === "textSet"), U = g(() => P() === "dateSet"), W = g(() => z() || B() || U()), K = g(() => R() || W()), te = g(() => K() || P() === "select"), q = g(() => {
995
+ if (!te()) return "ready";
996
+ let e = s.optionsStatus;
997
+ return e === "collecting" ? "collecting" : e === "loading" || e === "error" ? "pending" : "ready";
998
+ }), Y = g(() => s.optionsStatus === "loading" ? "loading" : "error"), re = g(() => s.numberConditionDraft ?? J), ae = g(() => s.textConditionDraft ?? ie), ce = g(() => s.dateConditionDraft ?? ue), le = g(() => s.datePresets ?? H(void 0, c())), fe = g(() => z() ? X(re()) : null), me = g(() => B() ? oe(ae()) : null), ge = g(() => U() ? de(ce()) : null), _e = g(() => fe() !== null || me() !== null || ge() !== null), ve = g(() => z() ? ne(s.selectOptions, fe()) : B() ? se(s.selectOptions, me()) : U() ? pe(s.selectOptions, ge(), y(), le()) : s.selectOptions), ye = g(() => {
999
+ let e = q();
1000
+ if (e === "collecting") return c().filterOptionsLoadingShort;
1001
+ if (e === "pending") return Y() === "loading" ? c().filterOptionsLoadingShort : c().filterOptionsFailedShort;
1002
+ }), be = () => F(c().filterCollecting, { percent: Math.round(s.optionsProgress * 100) }), xe = (e) => {
1003
+ if (e.stopPropagation(), !I(e)) {
1004
+ if (e.key === "Enter") {
1005
+ e.preventDefault(), s.onApply();
1006
+ return;
1007
+ }
1008
+ e.key === "Escape" && (e.preventDefault(), s.onRequestClose());
1009
+ }
1010
+ }, Se = (e) => {
1011
+ e.stopPropagation(), e.key === "Escape" && !L(e) && !I(e) && (e.preventDefault(), s.onRequestClose());
1012
+ }, Ce = (e) => {
1013
+ if (t(e) !== "Tab" || e.altKey || e.ctrlKey || e.metaKey || I(e)) return;
1014
+ let n = e.currentTarget, r = G(n, e.target instanceof Element ? e.target : null, e.shiftKey);
1015
+ r !== null && (e.preventDefault(), r.focus());
1016
+ }, we = () => C(m, { get children() {
1017
+ return [
1018
+ C(f, {
1019
+ get when() {
1020
+ return z();
1021
+ },
1022
+ get children() {
1023
+ return C(vt, {
1024
+ get draft() {
1025
+ return re();
1026
+ },
1027
+ get valueInputRef() {
1028
+ return s.textInputRef;
1029
+ },
1030
+ get onDraftChange() {
1031
+ return s.onNumberConditionDraftChange;
1032
+ },
1033
+ onKeyDown: xe
1034
+ });
1035
+ }
1036
+ }),
1037
+ C(f, {
1038
+ get when() {
1039
+ return B();
1040
+ },
1041
+ get children() {
1042
+ return C(bt, {
1043
+ get draft() {
1044
+ return ae();
1045
+ },
1046
+ get valueInputRef() {
1047
+ return s.textInputRef;
1048
+ },
1049
+ get onDraftChange() {
1050
+ return s.onTextConditionDraftChange;
1051
+ },
1052
+ onKeyDown: xe
1053
+ });
1054
+ }
1055
+ }),
1056
+ C(f, {
1057
+ get when() {
1058
+ return U();
1059
+ },
1060
+ get children() {
1061
+ return C(xt, {
1062
+ get draft() {
1063
+ return ce();
1064
+ },
1065
+ get valueInputRef() {
1066
+ return s.textInputRef;
1067
+ },
1068
+ get onDraftChange() {
1069
+ return s.onDateConditionDraftChange;
1070
+ },
1071
+ onKeyDown: xe,
1072
+ get presets() {
1073
+ return le();
1074
+ },
1075
+ get renderDateInput() {
1076
+ return s.renderDateInput;
1077
+ },
1078
+ get onRequestClose() {
1079
+ return s.onRequestClose;
1080
+ }
1081
+ });
1082
+ }
1083
+ })
1084
+ ];
1085
+ } }), Te = () => C(m, { get children() {
1086
+ return [
1087
+ C(f, {
1088
+ get when() {
1089
+ return W();
1090
+ },
1091
+ get children() {
1092
+ return C(Et, {
1093
+ get conditionEditor() {
1094
+ return we();
1095
+ },
1096
+ get conditionActive() {
1097
+ return _e();
1098
+ },
1099
+ get onConditionClear() {
1100
+ return s.onComboConditionClear;
1101
+ },
1102
+ get options() {
1103
+ return ve();
1104
+ },
1105
+ get setSelection() {
1106
+ return s.setSelection;
1107
+ },
1108
+ get onSelectionClear() {
1109
+ return s.onComboSelectionClear;
1110
+ },
1111
+ get summaryText() {
1112
+ return s.comboSummaryText;
1113
+ },
1114
+ get optionsMeta() {
1115
+ return ye();
1116
+ },
1117
+ get children() {
1118
+ return C(m, { get children() {
1119
+ return [
1120
+ C(f, {
1121
+ get when() {
1122
+ return q() === "collecting";
1123
+ },
1124
+ get children() {
1125
+ var e = Xe();
1126
+ return D(e, be), e;
1127
+ }
1128
+ }),
1129
+ C(f, {
1130
+ get when() {
1131
+ return q() === "pending";
1132
+ },
1133
+ get children() {
1134
+ return C(Ct, {
1135
+ get status() {
1136
+ return Y();
1137
+ },
1138
+ get errorMessage() {
1139
+ return s.optionsErrorMessage;
1140
+ },
1141
+ get onRetry() {
1142
+ return s.onOptionsRetry;
1143
+ }
1144
+ });
1145
+ }
1146
+ }),
1147
+ C(f, {
1148
+ get when() {
1149
+ return U();
1150
+ },
1151
+ get children() {
1152
+ return C(St, {
1153
+ get options() {
1154
+ return ve();
1155
+ },
1156
+ get setSelection() {
1157
+ return s.setSelection;
1158
+ },
1159
+ searchInputRef: u,
1160
+ get onValueToggle() {
1161
+ return s.onSetValueToggle;
1162
+ },
1163
+ get onSelectAllChange() {
1164
+ return s.onSetSelectAllChange;
1165
+ },
1166
+ get onReplaceSelection() {
1167
+ return s.onSetReplaceSelection;
1168
+ },
1169
+ get onRequestClose() {
1170
+ return s.onRequestClose;
1171
+ },
1172
+ get isServerSide() {
1173
+ return s.isServerSide ?? !1;
1174
+ },
1175
+ get truncated() {
1176
+ return s.optionsTruncated;
1177
+ }
1178
+ });
1179
+ }
1180
+ }),
1181
+ C(f, {
1182
+ when: !0,
1183
+ get children() {
1184
+ return C(_t, {
1185
+ get options() {
1186
+ return ve();
1187
+ },
1188
+ get setSelection() {
1189
+ return s.setSelection;
1190
+ },
1191
+ searchInputRef: u,
1192
+ get onValueToggle() {
1193
+ return s.onSetValueToggle;
1194
+ },
1195
+ get onSelectAllChange() {
1196
+ return s.onSetSelectAllChange;
1197
+ },
1198
+ get onReplaceSelection() {
1199
+ return s.onSetReplaceSelection;
1200
+ },
1201
+ get onRequestClose() {
1202
+ return s.onRequestClose;
1203
+ },
1204
+ get isServerSide() {
1205
+ return s.isServerSide ?? !1;
1206
+ },
1207
+ selectAllUsesExplicitScope: !0,
1208
+ get truncated() {
1209
+ return s.optionsTruncated;
1210
+ }
1211
+ });
1212
+ }
1213
+ })
1214
+ ];
1215
+ } });
1216
+ }
1217
+ });
1218
+ }
1219
+ }),
1220
+ C(f, {
1221
+ get when() {
1222
+ return q() === "collecting";
1223
+ },
1224
+ get children() {
1225
+ var e = Xe();
1226
+ return D(e, be), e;
1227
+ }
1228
+ }),
1229
+ C(f, {
1230
+ get when() {
1231
+ return q() === "pending";
1232
+ },
1233
+ get children() {
1234
+ return C(Ct, {
1235
+ get status() {
1236
+ return Y();
1237
+ },
1238
+ get errorMessage() {
1239
+ return s.optionsErrorMessage;
1240
+ },
1241
+ get onRetry() {
1242
+ return s.onOptionsRetry;
1243
+ }
1244
+ });
1245
+ }
1246
+ }),
1247
+ C(f, {
1248
+ get when() {
1249
+ return R();
1250
+ },
1251
+ get children() {
1252
+ return C(_t, {
1253
+ get options() {
1254
+ return s.selectOptions;
1255
+ },
1256
+ get setSelection() {
1257
+ return s.setSelection;
1258
+ },
1259
+ get searchInputRef() {
1260
+ return s.textInputRef;
1261
+ },
1262
+ get onValueToggle() {
1263
+ return s.onSetValueToggle;
1264
+ },
1265
+ get onSelectAllChange() {
1266
+ return s.onSetSelectAllChange;
1267
+ },
1268
+ get onReplaceSelection() {
1269
+ return s.onSetReplaceSelection;
1270
+ },
1271
+ get onRequestClose() {
1272
+ return s.onRequestClose;
1273
+ },
1274
+ get isServerSide() {
1275
+ return s.isServerSide ?? !1;
1276
+ },
1277
+ get truncated() {
1278
+ return s.optionsTruncated;
1279
+ }
1280
+ });
1281
+ }
1282
+ }),
1283
+ C(f, {
1284
+ get when() {
1285
+ return P() === "number";
1286
+ },
1287
+ get children() {
1288
+ return C(vt, {
1289
+ get draft() {
1290
+ return re();
1291
+ },
1292
+ get valueInputRef() {
1293
+ return s.textInputRef;
1294
+ },
1295
+ get onDraftChange() {
1296
+ return s.onNumberConditionDraftChange;
1297
+ },
1298
+ onKeyDown: xe
1299
+ });
1300
+ }
1301
+ }),
1302
+ C(f, {
1303
+ get when() {
1304
+ return P() === "select";
1305
+ },
1306
+ get children() {
1307
+ return C(wt, {
1308
+ get draftValue() {
1309
+ return s.draftValue;
1310
+ },
1311
+ get options() {
1312
+ return s.selectOptions;
1313
+ },
1314
+ get selectRef() {
1315
+ return s.selectRef;
1316
+ },
1317
+ get truncated() {
1318
+ return s.optionsTruncated;
1319
+ },
1320
+ get onDraftChange() {
1321
+ return s.onDraftChange;
1322
+ },
1323
+ get onApply() {
1324
+ return s.onApply;
1325
+ },
1326
+ get onRequestClose() {
1327
+ return s.onRequestClose;
1328
+ }
1329
+ });
1330
+ }
1331
+ }),
1332
+ C(f, {
1333
+ when: !0,
1334
+ get children() {
1335
+ return C(Tt, {
1336
+ get draftValue() {
1337
+ return s.draftValue;
1338
+ },
1339
+ get textInputRef() {
1340
+ return s.textInputRef;
1341
+ },
1342
+ get onDraftChange() {
1343
+ return s.onDraftChange;
1344
+ },
1345
+ get onApply() {
1346
+ return s.onApply;
1347
+ },
1348
+ get onRequestClose() {
1349
+ return s.onRequestClose;
1350
+ }
1351
+ });
1352
+ }
1353
+ })
1354
+ ];
1355
+ } }), Z = () => F(c().filterTitle, { column: s.title }), Ee = () => ({
1356
+ ...s.popoverSlot?.style,
1357
+ top: n(M().top),
1358
+ left: n(M().left),
1359
+ width: n(M().width),
1360
+ "max-height": n(M().maxHeight)
1361
+ });
1362
+ return l ? C(b, {
1363
+ mount: l,
1364
+ get children() {
1365
+ var e = at(), t = e.firstChild, n = t.nextSibling, r = n.nextSibling;
1366
+ return e._$$keydown = Se, e._$$pointerdown = (e) => e.stopPropagation(), A(() => (e) => {
1367
+ E = e, w(e), s.setPanel(e), e.addEventListener("keydown", Ce, !0);
1368
+ }, e), D(t, Z), D(e, Te, n), D(e, (() => {
1369
+ var e = O(() => !K());
1370
+ return () => e() ? (() => {
1371
+ var e = et();
1372
+ return D(e, () => F(c().filterCurrentValue, { value: s.currentValueText })), e;
1373
+ })() : void 0;
1374
+ })(), r), D(r, (() => {
1375
+ var e = O(() => !!K());
1376
+ return () => e() ? [(() => {
1377
+ var e = Q();
1378
+ return N(e, [
1379
+ { type: "button" },
1380
+ () => $(() => s.onSetClear()),
1381
+ { class: "ssg-filter-btn-secondary" }
1382
+ ], !0), D(e, () => c().clear), e;
1383
+ })(), (() => {
1384
+ var e = Q();
1385
+ return N(e, [
1386
+ { type: "button" },
1387
+ () => $(() => s.onRequestClose()),
1388
+ { class: "ssg-filter-btn-primary" }
1389
+ ], !0), D(e, () => c().close), e;
1390
+ })()] : [(() => {
1391
+ var e = Q();
1392
+ return N(e, [
1393
+ { type: "button" },
1394
+ () => $(() => s.onClear()),
1395
+ { class: "ssg-filter-btn-secondary" }
1396
+ ], !0), D(e, () => c().clear), e;
1397
+ })(), (() => {
1398
+ var e = Q();
1399
+ return N(e, [
1400
+ { type: "button" },
1401
+ () => $(() => s.onApply()),
1402
+ { class: "ssg-filter-btn-primary" }
1403
+ ], !0), D(e, () => c().apply), e;
1404
+ })()];
1405
+ })()), T(() => ({
1406
+ e: k([
1407
+ "ssg-filter-popover",
1408
+ s.themeClassName,
1409
+ s.popoverSlot?.className
1410
+ ]),
1411
+ t: k(Ee()),
1412
+ a: Z()
1413
+ }), ({ e: t, t: n, a: r }, i) => {
1414
+ S(e, t, i?.e), ee(e, n, i?.t), r !== i?.a && j(e, "aria-label", r);
1415
+ }), e;
1416
+ }
1417
+ }) : void 0;
1418
+ }
1419
+ w([
1420
+ "input",
1421
+ "keydown",
1422
+ "click",
1423
+ "pointerdown"
1424
+ ]);
1425
+ //#endregion
1426
+ export { Dt as ColumnFilterPopover };