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