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