@ishibashi0112/spreadsheet-grid-solid 1.5.0 → 1.6.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 +99 -29
- package/README.md +4 -4
- package/dist/devWarnings.d.ts +1 -0
- package/dist/features/columnGroups.d.ts +2 -0
- package/dist/features/types.d.ts +15 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2269 -1843
- package/dist/model/gridTypes.d.ts +4 -0
- package/dist/primitives/columnReorder.d.ts +1 -0
- package/dist/primitives/filterManagement.d.ts +1 -0
- package/dist/source/chunks/{toolPanelViews-HIQGRX3N.jsx → toolPanelViews-BRH5PCOI.jsx} +84 -8
- package/dist/source/index.jsx +891 -386
- package/dist/style.css +1 -1
- package/dist/style.layer.css +1 -1
- package/dist/{toolPanelViews-BISN9iaG.js → toolPanelViews-DMEVr1KV.js} +197 -138
- package/dist/view/ColumnChooserPanel.d.ts +9 -1
- package/dist/view/ColumnFilterPopoverHost.d.ts +1 -0
- package/dist/view/ColumnMenuPopover.d.ts +6 -0
- package/dist/view/GridBodyLayer.d.ts +2 -0
- package/dist/view/GridColumnGroupHeader.d.ts +42 -0
- package/dist/view/GridHeaderRow.d.ts +4 -0
- package/package.json +3 -3
- package/skills/spreadsheet-grid-solid/SKILL.md +1 -0
|
@@ -4,46 +4,46 @@ import { For as o, Show as s, createEffect as c, createMemo as l, createSignal a
|
|
|
4
4
|
import { Portal as h, className as g, createComponent as _, delegateEvents as v, effect as y, insert as b, memo as x, readShallow as S, ref as C, setAttribute as w, setStyleProperty as T, spread as E, style as D, template as O } from "@solidjs/web";
|
|
5
5
|
import { formatLocaleText as k } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
6
6
|
import { isImeComposingKeyEvent as A } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/domGuards";
|
|
7
|
-
import { getActiveElement as j, getDeepActiveElement as
|
|
8
|
-
import { resolveFocusWrapTarget as
|
|
9
|
-
import { createPanelHeaderDragController as
|
|
7
|
+
import { getActiveElement as j, getDeepActiveElement as ee } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/shadowDom";
|
|
8
|
+
import { resolveFocusWrapTarget as M } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/focusCycle";
|
|
9
|
+
import { createPanelHeaderDragController as N } from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/panelHeaderDragController";
|
|
10
10
|
//#region src/view/ToolPanel.tsx
|
|
11
|
-
var
|
|
12
|
-
function
|
|
13
|
-
let v = e(), x = r().container(), E = d(), O =
|
|
11
|
+
var P = /* @__PURE__ */ O("<div role=dialog tabindex=-1><div class=\"ssg-toolpanel-header ssg-popover-header--draggable\"><div class=ssg-toolpanel-seg role=tablist><span class=ssg-toolpanel-seg-indicator aria-hidden=true></span></div><button type=button class=ssg-popover-close>×</button></div><div class=ssg-toolpanel-body role=tabpanel>"), F = /* @__PURE__ */ O("<button type=button role=tab class=ssg-toolpanel-seg-btn><!><!>"), I = /* @__PURE__ */ O("<span class=ssg-toolpanel-seg-badge>"), L = "ssg-toolpanel--flash";
|
|
12
|
+
function R(a) {
|
|
13
|
+
let v = e(), x = r().container(), E = d(), O = N(), [k, ee] = u(), R;
|
|
14
14
|
f(() => {
|
|
15
|
-
O.dispose(),
|
|
15
|
+
O.dispose(), R?.removeEventListener("keydown", U, !0), a.panelRef.current === R && (a.panelRef.current = null);
|
|
16
16
|
});
|
|
17
|
-
let
|
|
18
|
-
i(k, () => a.themeClassName,
|
|
19
|
-
let e =
|
|
17
|
+
let z = l(() => a.layout);
|
|
18
|
+
i(k, () => a.themeClassName, z), p(() => {
|
|
19
|
+
let e = R;
|
|
20
20
|
!e || e.contains(j(e)) || (e.querySelector("[role=\"tab\"][aria-selected=\"true\"]") ?? e).focus({ preventScroll: !0 });
|
|
21
21
|
});
|
|
22
|
-
let
|
|
22
|
+
let B = m(() => a.flashTick);
|
|
23
23
|
c(() => a.flashTick, (e) => {
|
|
24
|
-
let t =
|
|
25
|
-
if (!t || e === 0 || e ===
|
|
26
|
-
t.classList.remove(
|
|
27
|
-
let n = () => t.classList.remove(
|
|
24
|
+
let t = R;
|
|
25
|
+
if (!t || e === 0 || e === B) return;
|
|
26
|
+
t.classList.remove(L), t.offsetWidth, t.classList.add(L);
|
|
27
|
+
let n = () => t.classList.remove(L);
|
|
28
28
|
return t.addEventListener("animationend", n), () => t.removeEventListener("animationend", n);
|
|
29
29
|
}, { name: "toolPanelFlash" });
|
|
30
|
-
let
|
|
30
|
+
let V = l(() => Math.max(0, a.tabs.findIndex((e) => e.tab === a.activeTab))), H = l(() => ({
|
|
31
31
|
...a.popoverSlot?.style,
|
|
32
|
-
top: n(
|
|
33
|
-
left: n(
|
|
34
|
-
width: n(
|
|
35
|
-
"--ssg-toolpanel-max-height": n(
|
|
36
|
-
})),
|
|
32
|
+
top: n(z().top),
|
|
33
|
+
left: n(z().left),
|
|
34
|
+
width: n(z().width),
|
|
35
|
+
"--ssg-toolpanel-max-height": n(z().maxHeight)
|
|
36
|
+
})), U = (e) => {
|
|
37
37
|
if (t(e) !== "Tab" || e.altKey || e.ctrlKey || e.metaKey || A(e)) return;
|
|
38
|
-
let n =
|
|
38
|
+
let n = M(e.currentTarget, e.target instanceof Element ? e.target : null, e.shiftKey);
|
|
39
39
|
n !== null && (e.preventDefault(), n.focus());
|
|
40
40
|
};
|
|
41
41
|
return x ? _(h, {
|
|
42
42
|
mount: x,
|
|
43
43
|
get children() {
|
|
44
|
-
var e =
|
|
44
|
+
var e = P(), t = e.firstChild, n = t.firstChild, r = n.nextSibling, i = t.nextSibling;
|
|
45
45
|
return e._$$contextmenu = (e) => e.preventDefault(), e._$$keydown = (e) => e.stopPropagation(), e._$$pointerdown = (e) => e.stopPropagation(), C(() => (e) => {
|
|
46
|
-
|
|
46
|
+
R = e, a.panelRef.current = e, ee(e), e.addEventListener("keydown", U, !0);
|
|
47
47
|
}, e), t._$$pointerdown = (e) => O.startFromPointerDown(e, {
|
|
48
48
|
layout: a.layout,
|
|
49
49
|
onMove: a.onPanelMove
|
|
@@ -54,7 +54,7 @@ function z(a) {
|
|
|
54
54
|
keyed: (e) => e.tab,
|
|
55
55
|
children: (e) => {
|
|
56
56
|
let t = () => e().tab === a.activeTab;
|
|
57
|
-
var n =
|
|
57
|
+
var n = F(), r = n.firstChild, i = r.nextSibling;
|
|
58
58
|
return n._$$click = () => {
|
|
59
59
|
t() || a.onSelectTab(e().tab);
|
|
60
60
|
}, b(n, () => e().label, r), b(n, _(s, {
|
|
@@ -62,7 +62,7 @@ function z(a) {
|
|
|
62
62
|
return e().badge;
|
|
63
63
|
},
|
|
64
64
|
children: (e) => (() => {
|
|
65
|
-
var t =
|
|
65
|
+
var t = I();
|
|
66
66
|
return b(t, e), t;
|
|
67
67
|
})()
|
|
68
68
|
}), i), y(() => ({
|
|
@@ -82,9 +82,9 @@ function z(a) {
|
|
|
82
82
|
a.themeClassName,
|
|
83
83
|
a.popoverSlot?.className
|
|
84
84
|
]),
|
|
85
|
-
a: S(
|
|
85
|
+
a: S(H()),
|
|
86
86
|
o: String(a.tabs.length),
|
|
87
|
-
i: String(
|
|
87
|
+
i: String(V()),
|
|
88
88
|
n: v().close,
|
|
89
89
|
s: `${E}-tab-${a.activeTab}`
|
|
90
90
|
}), ({ e: t, t: a, a: o, o: s, i: c, n: l, s: u }, d) => {
|
|
@@ -101,19 +101,19 @@ v([
|
|
|
101
101
|
]);
|
|
102
102
|
//#endregion
|
|
103
103
|
//#region src/view/FilterManagementPanel.tsx
|
|
104
|
-
var
|
|
105
|
-
function
|
|
106
|
-
var e =
|
|
104
|
+
var z = /* @__PURE__ */ O("<svg><path d=\"M2 4 L14 4 L9.2 9.2 L9.2 13 L6.8 13 L6.8 9.2 Z\">"), B = /* @__PURE__ */ O("<svg><circle cx=11 cy=11 r=7></circle><path d=\"m20 20-3.5-3.5\">"), V = /* @__PURE__ */ O("<div class=ssg-filter-manage-list>"), H = /* @__PURE__ */ O("<div class=ssg-popover-footer><select class=ssg-filter-manage-add><option value></option></select><button type=button class=ssg-filter-manage-clear-all>"), U = /* @__PURE__ */ O("<div class=\"ssg-filter-manage-row ssg-filter-manage-row--global\"><span class=\"ssg-filter-manage-glyph ssg-filter-manage-glyph--global\"aria-hidden=true></span><span class=ssg-filter-manage-main><span class=ssg-filter-manage-name></span><span class=ssg-filter-manage-summary></span></span><span class=ssg-filter-manage-actions><button type=button class=\"ssg-filter-manage-icon-btn ssg-filter-manage-icon-btn--danger\">×"), W = /* @__PURE__ */ O("<div class=ssg-filter-manage-empty>"), G = /* @__PURE__ */ O("<div class=ssg-filter-manage-row><span class=ssg-filter-manage-glyph aria-hidden=true></span><span class=ssg-filter-manage-main><span class=ssg-filter-manage-name><!><!><!></span><span class=ssg-filter-manage-summary></span></span><span class=ssg-filter-manage-actions><button type=button class=ssg-filter-manage-icon-btn>✎</button><button type=button class=\"ssg-filter-manage-icon-btn ssg-filter-manage-icon-btn--danger\">×"), K = /* @__PURE__ */ O("<span class=ssg-filter-manage-hidden-note>"), q = /* @__PURE__ */ O("<option>"), J = { focusable: "false" };
|
|
105
|
+
function Y() {
|
|
106
|
+
var e = z();
|
|
107
107
|
return E(e, [{
|
|
108
108
|
width: "11",
|
|
109
109
|
height: "11",
|
|
110
110
|
viewBox: "0 0 16 16",
|
|
111
111
|
fill: "currentColor",
|
|
112
112
|
"aria-hidden": "true"
|
|
113
|
-
},
|
|
113
|
+
}, J], !0), e;
|
|
114
114
|
}
|
|
115
|
-
function
|
|
116
|
-
var e =
|
|
115
|
+
function X() {
|
|
116
|
+
var e = B();
|
|
117
117
|
return E(e, [{
|
|
118
118
|
width: "11",
|
|
119
119
|
height: "11",
|
|
@@ -122,14 +122,14 @@ function ee() {
|
|
|
122
122
|
stroke: "currentColor",
|
|
123
123
|
"stroke-width": "2.4",
|
|
124
124
|
"aria-hidden": "true"
|
|
125
|
-
},
|
|
125
|
+
}, J], !0), e;
|
|
126
126
|
}
|
|
127
|
-
function
|
|
127
|
+
function Z(t) {
|
|
128
128
|
let n = e(), r = () => t.canFilter && t.entries.length > 0, i = () => t.canFilter && t.addableColumns.length > 0;
|
|
129
129
|
return [
|
|
130
130
|
x(() => x(() => !!t.showGlobalFilterRow)() ? (() => {
|
|
131
|
-
var e =
|
|
132
|
-
return b(r, _(
|
|
131
|
+
var e = U(), r = e.firstChild, i = r.nextSibling, a = i.firstChild, o = a.nextSibling, s = i.nextSibling.firstChild;
|
|
132
|
+
return b(r, _(X, {})), b(a, () => n().globalFilterTitle), b(o, () => k(n().globalFilterRows, { text: t.globalFilterText })), s._$$click = () => t.onClearGlobalFilter(), y(() => ({
|
|
133
133
|
e: t.globalFilterText,
|
|
134
134
|
t: !t.canFilter,
|
|
135
135
|
a: n().clearGlobalFilterTitle,
|
|
@@ -139,7 +139,7 @@ function te(t) {
|
|
|
139
139
|
}), e;
|
|
140
140
|
})() : void 0),
|
|
141
141
|
(() => {
|
|
142
|
-
var e =
|
|
142
|
+
var e = V();
|
|
143
143
|
return b(e, (() => {
|
|
144
144
|
var e = x(() => t.entries.length > 0);
|
|
145
145
|
return () => e() ? _(o, {
|
|
@@ -148,17 +148,17 @@ function te(t) {
|
|
|
148
148
|
},
|
|
149
149
|
keyed: (e) => e.columnKey,
|
|
150
150
|
children: (e) => (() => {
|
|
151
|
-
var r =
|
|
152
|
-
return b(i, _(
|
|
151
|
+
var r = G(), i = r.firstChild, a = i.nextSibling, o = a.firstChild, s = o.firstChild, c = s.nextSibling, l = c.nextSibling, u = o.nextSibling, d = a.nextSibling.firstChild, f = d.nextSibling;
|
|
152
|
+
return b(i, _(Y, {})), b(o, () => e().title, s), b(o, (() => {
|
|
153
153
|
var t = x(() => !!e().isHidden);
|
|
154
154
|
return () => t() ? (() => {
|
|
155
|
-
var e =
|
|
155
|
+
var e = K();
|
|
156
156
|
return b(e, () => n().filterHiddenColumn), e;
|
|
157
157
|
})() : void 0;
|
|
158
158
|
})(), c), b(o, (() => {
|
|
159
159
|
var t = x(() => !!e().isGrouped);
|
|
160
160
|
return () => t() ? (() => {
|
|
161
|
-
var e =
|
|
161
|
+
var e = K();
|
|
162
162
|
return b(e, () => n().filterGroupedColumn), e;
|
|
163
163
|
})() : void 0;
|
|
164
164
|
})(), l), b(u, () => e().summaryText), d._$$click = () => t.onEditFilter(e().columnKey), f._$$click = () => t.onClearFilter(e().columnKey), y(() => ({
|
|
@@ -174,13 +174,13 @@ function te(t) {
|
|
|
174
174
|
}), r;
|
|
175
175
|
})()
|
|
176
176
|
}) : (() => {
|
|
177
|
-
var e =
|
|
177
|
+
var e = W();
|
|
178
178
|
return b(e, () => n().noColumnFilters), e;
|
|
179
179
|
})();
|
|
180
180
|
})()), e;
|
|
181
181
|
})(),
|
|
182
182
|
(() => {
|
|
183
|
-
var e =
|
|
183
|
+
var e = H(), a = e.firstChild, s = a.firstChild, c = a.nextSibling;
|
|
184
184
|
return a.addEventListener("change", (e) => {
|
|
185
185
|
let n = e.currentTarget, r = n.value;
|
|
186
186
|
n.value = "", r && t.onAddFilter(r);
|
|
@@ -193,7 +193,7 @@ function te(t) {
|
|
|
193
193
|
},
|
|
194
194
|
keyed: (e) => e.key,
|
|
195
195
|
children: (e) => (() => {
|
|
196
|
-
var t =
|
|
196
|
+
var t = q();
|
|
197
197
|
return b(t, () => e().title), y(() => e().key, (e) => {
|
|
198
198
|
t.value = e;
|
|
199
199
|
}), t;
|
|
@@ -211,7 +211,7 @@ function te(t) {
|
|
|
211
211
|
v(["click"]);
|
|
212
212
|
//#endregion
|
|
213
213
|
//#region src/view/DragHandleGlyph.tsx
|
|
214
|
-
var
|
|
214
|
+
var te = /* @__PURE__ */ O("<svg width=10 height=16 viewBox=\"0 0 10 16\"aria-hidden=true>"), Q = /* @__PURE__ */ O("<svg><circle r=1.2></svg>", 2), ne = [
|
|
215
215
|
3,
|
|
216
216
|
8,
|
|
217
217
|
13
|
|
@@ -219,12 +219,12 @@ var ne = /* @__PURE__ */ O("<svg width=10 height=16 viewBox=\"0 0 10 16\"aria-hi
|
|
|
219
219
|
cx: t,
|
|
220
220
|
cy: e
|
|
221
221
|
})));
|
|
222
|
-
function
|
|
223
|
-
var t =
|
|
222
|
+
function re(e) {
|
|
223
|
+
var t = te();
|
|
224
224
|
return b(t, _(o, {
|
|
225
|
-
each:
|
|
225
|
+
each: ne,
|
|
226
226
|
children: (e) => (() => {
|
|
227
|
-
var t =
|
|
227
|
+
var t = Q();
|
|
228
228
|
return y(() => ({
|
|
229
229
|
e: e.cx,
|
|
230
230
|
t: e.cy
|
|
@@ -238,16 +238,44 @@ function Z(e) {
|
|
|
238
238
|
}
|
|
239
239
|
//#endregion
|
|
240
240
|
//#region src/view/ColumnChooserPanel.tsx
|
|
241
|
-
var
|
|
241
|
+
var ie = /* @__PURE__ */ O("<span class=ssg-checkbox aria-hidden=true><!><!>"), ae = /* @__PURE__ */ O("<svg width=11 height=11 viewBox=\"0 0 12 12\"fill=none><path d=\"M2.5 6.2 4.7 8.4 9.5 3.6\"stroke-width=1.8 stroke-linecap=round stroke-linejoin=round>"), oe = /* @__PURE__ */ O("<span class=ssg-checkbox-dash>"), se = /* @__PURE__ */ O("<div data-chooser-row class=ssg-chooser-row><span role=button class=ssg-chooser-handle></span><button type=button class=ssg-chooser-toggle><span class=ssg-chooser-label>"), ce = /* @__PURE__ */ O("<div role=group class=ssg-chooser-group><div class=ssg-chooser-group-heading><span aria-hidden=true class=ssg-chooser-group-spacer></span><button type=button class=ssg-chooser-toggle><span class=\"ssg-chooser-label ssg-chooser-group-label\"></span></button></div><div class=ssg-chooser-group-items>"), le = /* @__PURE__ */ O("<div class=ssg-chooser-search-row><button type=button class=ssg-chooser-master-btn></button><div class=ssg-chooser-search-field><span aria-hidden=true class=ssg-chooser-search-icon>⌕</span><input type=text class=ssg-chooser-search-input>"), ue = /* @__PURE__ */ O("<div class=ssg-chooser-list>"), de = /* @__PURE__ */ O("<div class=ssg-chooser-footer><button type=button class=ssg-chooser-reset-btn>"), fe = /* @__PURE__ */ O("<div class=ssg-chooser-empty>"), pe = /* @__PURE__ */ O("<div><!><!><!>"), me = /* @__PURE__ */ O("<div class=ssg-chooser-section-heading>"), he = /* @__PURE__ */ O("<div class=ssg-chooser-drop-end>"), ge = /* @__PURE__ */ O("<div class=ssg-chooser-note>");
|
|
242
|
+
function _e(e) {
|
|
243
|
+
let t = [], n = [];
|
|
244
|
+
return e.forEach((e, r) => {
|
|
245
|
+
let i = e.groups ?? [], a = 0;
|
|
246
|
+
for (; a < n.length && a < i.length && n[a]?.key === i[a]?.key;) a += 1;
|
|
247
|
+
n.length = a;
|
|
248
|
+
for (let e = a; e < i.length; e += 1) {
|
|
249
|
+
let a = i[e];
|
|
250
|
+
if (a === void 0) break;
|
|
251
|
+
let o = {
|
|
252
|
+
kind: "group",
|
|
253
|
+
id: `${a.key}@${r}`,
|
|
254
|
+
key: a.key,
|
|
255
|
+
title: a.title,
|
|
256
|
+
children: [],
|
|
257
|
+
items: []
|
|
258
|
+
};
|
|
259
|
+
(n[e - 1]?.children ?? t).push(o), n.push(o);
|
|
260
|
+
}
|
|
261
|
+
(n[n.length - 1]?.children ?? t).push({
|
|
262
|
+
kind: "item",
|
|
263
|
+
item: e,
|
|
264
|
+
indexInPane: r
|
|
265
|
+
});
|
|
266
|
+
for (let t of n) t.items.push(e);
|
|
267
|
+
}), t;
|
|
268
|
+
}
|
|
269
|
+
var ve = 28, ye = 12, be = [
|
|
242
270
|
"left",
|
|
243
271
|
"center",
|
|
244
272
|
"right"
|
|
245
|
-
],
|
|
273
|
+
], xe = {
|
|
246
274
|
left: "columnsPinnedLeft",
|
|
247
275
|
center: "columnsUnpinned",
|
|
248
276
|
right: "columnsPinnedRight"
|
|
249
277
|
};
|
|
250
|
-
function
|
|
278
|
+
function Se(e, t, n) {
|
|
251
279
|
let r = e.find((e) => e.key === t);
|
|
252
280
|
if (!r) return null;
|
|
253
281
|
let i = {
|
|
@@ -268,18 +296,18 @@ function be(e, t, n) {
|
|
|
268
296
|
];
|
|
269
297
|
}
|
|
270
298
|
function $(e) {
|
|
271
|
-
var t =
|
|
299
|
+
var t = ie(), n = t.firstChild, r = n.nextSibling;
|
|
272
300
|
return b(t, (() => {
|
|
273
301
|
var t = x(() => e.state === "checked");
|
|
274
302
|
return () => t() ? (() => {
|
|
275
|
-
var t =
|
|
303
|
+
var t = ae(), n = t.firstChild;
|
|
276
304
|
return y(() => e.disabled ? "var(--ssg-panel-text-muted)" : "var(--ssg-panel-accent-contrast)", (e) => {
|
|
277
305
|
T(n, "stroke", e);
|
|
278
306
|
}), t;
|
|
279
307
|
})() : void 0;
|
|
280
308
|
})(), n), b(t, (() => {
|
|
281
309
|
var t = x(() => e.state === "indeterminate");
|
|
282
|
-
return () => t() ?
|
|
310
|
+
return () => t() ? oe() : void 0;
|
|
283
311
|
})(), r), y(() => ({
|
|
284
312
|
e: e.state === "checked" || e.state === "indeterminate",
|
|
285
313
|
t: !!e.disabled
|
|
@@ -287,83 +315,84 @@ function $(e) {
|
|
|
287
315
|
e !== r?.e && t.classList.toggle("ssg-checkbox--filled", e), n !== r?.t && t.classList.toggle("ssg-checkbox--disabled", n);
|
|
288
316
|
}), t;
|
|
289
317
|
}
|
|
290
|
-
function
|
|
291
|
-
let n = e(), [r, i] = u(""), s, c = a(r), d = typeof document < "u" &&
|
|
318
|
+
function Ce(t) {
|
|
319
|
+
let n = e(), [r, i] = u(""), s, c = a(r), d = typeof document < "u" && ee()?.closest(".ssg-toolpanel") != null, h = null;
|
|
292
320
|
p(() => {
|
|
293
321
|
if (!s || !d || typeof window.matchMedia == "function" && window.matchMedia("(pointer: coarse)").matches) return;
|
|
294
322
|
let e = s;
|
|
295
|
-
|
|
296
|
-
|
|
323
|
+
h = requestAnimationFrame(() => {
|
|
324
|
+
h = null, e.focus();
|
|
297
325
|
});
|
|
298
326
|
});
|
|
299
|
-
let
|
|
327
|
+
let g = l(() => t.items.filter((e) => e.grouped !== !0).length), v = l(() => t.items.filter((e) => e.visible && e.grouped !== !0).length), S = () => v() === g() && g() > 0, T = () => S() ? "checked" : "indeterminate", E = () => S() ? n().columnsHideAll : n().columnsShowAll, D = l(() => {
|
|
300
328
|
let e = r().trim().toLowerCase();
|
|
301
|
-
return e ? t.items.filter((t) => t.title.toLowerCase().includes(e)) : t.items;
|
|
302
|
-
}),
|
|
329
|
+
return e ? t.items.filter((t) => t.title.toLowerCase().includes(e) || (t.groups?.some((t) => t.title.toLowerCase().includes(e)) ?? !1)) : t.items;
|
|
330
|
+
}), O = l(() => {
|
|
303
331
|
let e = {
|
|
304
332
|
left: [],
|
|
305
333
|
center: [],
|
|
306
334
|
right: []
|
|
307
335
|
};
|
|
308
|
-
for (let t of
|
|
309
|
-
return
|
|
336
|
+
for (let t of D()) e[t.pane].push(t);
|
|
337
|
+
return be.map((t) => ({
|
|
310
338
|
pane: t,
|
|
311
|
-
items: e[t]
|
|
339
|
+
items: e[t],
|
|
340
|
+
nodes: _e(e[t])
|
|
312
341
|
})).filter((e) => e.items.length > 0);
|
|
313
|
-
}),
|
|
342
|
+
}), A = () => O().length >= 2, j = () => t.canToggle && r().trim() === "", M, [N, P] = u(null), F = !1, I = null, L = null, [R, z] = u(null), B = 0, V = null;
|
|
314
343
|
f(() => {
|
|
315
|
-
|
|
344
|
+
h !== null && cancelAnimationFrame(h), V !== null && (cancelAnimationFrame(V), V = null);
|
|
316
345
|
});
|
|
317
|
-
let
|
|
318
|
-
if (!
|
|
319
|
-
let e =
|
|
320
|
-
for (let
|
|
321
|
-
let r = e[
|
|
322
|
-
if (
|
|
323
|
-
|
|
346
|
+
let H = () => {
|
|
347
|
+
if (!M || !I) return;
|
|
348
|
+
let e = M.querySelectorAll(`[data-chooser-row][data-chooser-pane="${I}"]`), n = e.length;
|
|
349
|
+
for (let t = 0; t < e.length; t += 1) {
|
|
350
|
+
let r = e[t].getBoundingClientRect();
|
|
351
|
+
if (B < r.top + r.height / 2) {
|
|
352
|
+
n = t;
|
|
324
353
|
break;
|
|
325
354
|
}
|
|
326
355
|
}
|
|
327
|
-
|
|
328
|
-
},
|
|
329
|
-
if (!
|
|
330
|
-
|
|
356
|
+
z(t.clampDropIndex && L !== null ? t.clampDropIndex(L, I, n) : n);
|
|
357
|
+
}, U = () => {
|
|
358
|
+
if (!M || !F) {
|
|
359
|
+
V = null;
|
|
331
360
|
return;
|
|
332
361
|
}
|
|
333
|
-
let e =
|
|
362
|
+
let e = M.getBoundingClientRect(), t = B < e.top + ve ? -12 : B > e.bottom - ve ? ye : 0;
|
|
334
363
|
if (t !== 0) {
|
|
335
|
-
let e =
|
|
336
|
-
|
|
364
|
+
let e = M.scrollTop;
|
|
365
|
+
M.scrollTop += t, M.scrollTop !== e && H();
|
|
337
366
|
}
|
|
338
|
-
|
|
339
|
-
},
|
|
340
|
-
|
|
341
|
-
let n = N(), r =
|
|
342
|
-
if (F = !1, I = null, P(null),
|
|
343
|
-
let e =
|
|
367
|
+
V = requestAnimationFrame(U);
|
|
368
|
+
}, W = (e) => {
|
|
369
|
+
V !== null && (cancelAnimationFrame(V), V = null);
|
|
370
|
+
let n = N(), r = R();
|
|
371
|
+
if (F = !1, I = null, L = null, P(null), z(null), e && n !== null && r !== null) {
|
|
372
|
+
let e = Se(t.items, n, r);
|
|
344
373
|
e && t.onReorderColumns(e);
|
|
345
374
|
}
|
|
346
|
-
},
|
|
347
|
-
|
|
348
|
-
},
|
|
349
|
-
F && (
|
|
350
|
-
}, K = () => {
|
|
351
|
-
F && U(!0);
|
|
375
|
+
}, G = (e, t, n) => {
|
|
376
|
+
j() && (n.preventDefault(), n.stopPropagation(), n.currentTarget.setPointerCapture(n.pointerId), F = !0, I = t, L = e, B = n.clientY, P(e), H(), V === null && (V = requestAnimationFrame(U)));
|
|
377
|
+
}, K = (e) => {
|
|
378
|
+
F && (B = e.clientY, H());
|
|
352
379
|
}, q = () => {
|
|
353
|
-
F &&
|
|
380
|
+
F && W(!0);
|
|
354
381
|
}, J = () => {
|
|
355
|
-
|
|
356
|
-
}, Y =
|
|
382
|
+
F && W(!1);
|
|
383
|
+
}, Y = () => {
|
|
384
|
+
t.canToggle && (S() ? t.onHideAllColumns() : t.onShowAllColumns());
|
|
385
|
+
}, X = l(() => {
|
|
357
386
|
let e = N();
|
|
358
387
|
return e === null ? null : t.items.find((t) => t.key === e)?.pane ?? null;
|
|
359
|
-
}),
|
|
388
|
+
}), Z = (e, i) => {
|
|
360
389
|
let a = () => {
|
|
361
|
-
let n = e(), r = n.visible &&
|
|
390
|
+
let n = e(), r = n.visible && v() === 1;
|
|
362
391
|
return !t.canToggle || r || n.grouped === !0;
|
|
363
|
-
}, o = () => N() === e().key, s = () => N() !== null &&
|
|
364
|
-
var l =
|
|
365
|
-
return u.addEventListener("pointercancel",
|
|
366
|
-
return !
|
|
392
|
+
}, o = () => N() === e().key, s = () => N() !== null && X() === e().pane && R() === i(), c = () => e().visible && e().grouped !== !0;
|
|
393
|
+
var l = se(), u = l.firstChild, d = u.nextSibling, f = d.firstChild;
|
|
394
|
+
return u.addEventListener("pointercancel", J), u._$$pointerup = q, u._$$pointermove = K, u._$$pointerdown = (t) => G(e().key, e().pane, t), b(u, _(re, { get disabled() {
|
|
395
|
+
return !j();
|
|
367
396
|
} })), d._$$click = () => {
|
|
368
397
|
a() || t.onToggleColumnVisibility(e().key, !e().visible);
|
|
369
398
|
}, b(d, _($, {
|
|
@@ -381,8 +410,8 @@ function xe(t) {
|
|
|
381
410
|
t: !!s(),
|
|
382
411
|
a: !!o(),
|
|
383
412
|
o: n().columnsDragToReorder,
|
|
384
|
-
i: t.canToggle ? r().trim() === "" ? n().columnsDragWithinSection : n().columnsReorderWhileSearching : n().columnsReorderUnavailable,
|
|
385
|
-
n: !
|
|
413
|
+
i: t.canToggle ? r().trim() === "" ? (e().groups?.length ?? 0) > 0 ? n().columnsDragWithinGroup : n().columnsDragWithinSection : n().columnsReorderWhileSearching : n().columnsReorderUnavailable,
|
|
414
|
+
n: !j(),
|
|
386
415
|
s: !!o(),
|
|
387
416
|
h: a(),
|
|
388
417
|
r: c() ? "true" : "false",
|
|
@@ -391,13 +420,49 @@ function xe(t) {
|
|
|
391
420
|
}), ({ e, t, a: n, o: r, i, n: a, s: o, h: s, r: c, d: p, l: m }, h) => {
|
|
392
421
|
e !== h?.e && w(l, "data-chooser-pane", e), t !== h?.t && l.classList.toggle("ssg-chooser-row--drop-before", t), n !== h?.a && l.classList.toggle("ssg-chooser-row--dragging", n), r !== h?.o && w(u, "aria-label", r), i !== h?.i && w(u, "data-ssg-tooltip", i), a !== h?.n && u.classList.toggle("ssg-chooser-handle--disabled", a), o !== h?.s && u.classList.toggle("ssg-chooser-handle--dragging", o), s !== h?.h && w(d, "disabled", s), c !== h?.r && w(d, "aria-pressed", c), p !== h?.d && w(d, "data-ssg-tooltip", p), m !== h?.l && f.classList.toggle("ssg-chooser-label--muted", m);
|
|
393
422
|
}), l;
|
|
394
|
-
}
|
|
423
|
+
}, te = (e) => {
|
|
424
|
+
let r = l(() => {
|
|
425
|
+
let t = e().items.filter((e) => e.grouped !== !0), n = t.filter((e) => e.visible), r = t.length > 0 && n.length === t.length, i = r ? "checked" : n.length > 0 ? "indeterminate" : "unchecked", a;
|
|
426
|
+
return r ? (a = n.map((e) => e.key), v() - a.length <= 0 && (a = a.slice(1))) : a = t.filter((e) => !e.visible).map((e) => e.key), {
|
|
427
|
+
allShown: r,
|
|
428
|
+
state: i,
|
|
429
|
+
targetKeys: a
|
|
430
|
+
};
|
|
431
|
+
}), i = () => !t.canToggle || t.onToggleColumnsVisibility === void 0 || r().targetKeys.length === 0, a = () => k(n().columnsToggleGroup, { group: e().title });
|
|
432
|
+
var o = ce(), s = o.firstChild, c = s.firstChild.nextSibling, u = c.firstChild, d = s.nextSibling;
|
|
433
|
+
return c._$$click = () => {
|
|
434
|
+
if (i()) return;
|
|
435
|
+
let { targetKeys: e, allShown: n } = r();
|
|
436
|
+
t.onToggleColumnsVisibility?.(e, !n);
|
|
437
|
+
}, b(c, _($, {
|
|
438
|
+
get state() {
|
|
439
|
+
return r().state;
|
|
440
|
+
},
|
|
441
|
+
get disabled() {
|
|
442
|
+
return i();
|
|
443
|
+
}
|
|
444
|
+
}), u), b(u, () => e().title), b(d, () => Q(() => e().children)), y(() => ({
|
|
445
|
+
e: e().title,
|
|
446
|
+
t: e().key,
|
|
447
|
+
a: i(),
|
|
448
|
+
o: r().state === "checked" ? "true" : r().state === "indeterminate" ? "mixed" : "false",
|
|
449
|
+
i: a()
|
|
450
|
+
}), ({ e, t, a: n, o: r, i }, a) => {
|
|
451
|
+
e !== a?.e && w(o, "aria-label", e), t !== a?.t && w(o, "data-chooser-group", t), n !== a?.a && w(c, "disabled", n), r !== a?.o && w(c, "aria-pressed", r), i !== a?.i && w(c, "data-ssg-tooltip", i);
|
|
452
|
+
}), o;
|
|
453
|
+
}, Q = (e) => _(o, {
|
|
454
|
+
get each() {
|
|
455
|
+
return e();
|
|
456
|
+
},
|
|
457
|
+
keyed: (e) => e.kind === "item" ? `c:${e.item.key}` : `g:${e.id}`,
|
|
458
|
+
children: (e) => m(() => e().kind) === "item" ? Z(() => e().item, () => e().indexInPane) : te(() => e())
|
|
459
|
+
});
|
|
395
460
|
return [
|
|
396
461
|
(() => {
|
|
397
462
|
var e = le(), r = e.firstChild, a = r.nextSibling.firstChild.nextSibling;
|
|
398
|
-
return r._$$click =
|
|
463
|
+
return r._$$click = Y, b(r, _($, {
|
|
399
464
|
get state() {
|
|
400
|
-
return
|
|
465
|
+
return T();
|
|
401
466
|
},
|
|
402
467
|
get disabled() {
|
|
403
468
|
return !t.canToggle;
|
|
@@ -406,8 +471,8 @@ function xe(t) {
|
|
|
406
471
|
s = e, c(e);
|
|
407
472
|
}, a), y(() => ({
|
|
408
473
|
e: !t.canToggle,
|
|
409
|
-
t:
|
|
410
|
-
a:
|
|
474
|
+
t: E(),
|
|
475
|
+
a: E(),
|
|
411
476
|
o: n().columnsSearchPlaceholder,
|
|
412
477
|
i: n().columnsSearchPlaceholder
|
|
413
478
|
}), ({ e, t, a: n, o: i, i: o }, s) => {
|
|
@@ -417,30 +482,24 @@ function xe(t) {
|
|
|
417
482
|
(() => {
|
|
418
483
|
var e = ue();
|
|
419
484
|
return C(() => (e) => {
|
|
420
|
-
|
|
485
|
+
M = e;
|
|
421
486
|
}, e), b(e, (() => {
|
|
422
|
-
var e = x(() =>
|
|
487
|
+
var e = x(() => D().length > 0);
|
|
423
488
|
return () => e() ? _(o, {
|
|
424
489
|
get each() {
|
|
425
|
-
return
|
|
490
|
+
return O();
|
|
426
491
|
},
|
|
427
492
|
keyed: (e) => e.pane,
|
|
428
493
|
children: (e) => (() => {
|
|
429
494
|
var t = pe(), r = t.firstChild, i = r.nextSibling, a = i.nextSibling;
|
|
430
495
|
return b(t, (() => {
|
|
431
|
-
var t = x(() => !!
|
|
496
|
+
var t = x(() => !!A());
|
|
432
497
|
return () => t() ? (() => {
|
|
433
498
|
var t = me();
|
|
434
|
-
return b(t, () => n()[
|
|
499
|
+
return b(t, () => n()[xe[e().pane]]), t;
|
|
435
500
|
})() : void 0;
|
|
436
|
-
})(), r), b(t,
|
|
437
|
-
|
|
438
|
-
return e().items;
|
|
439
|
-
},
|
|
440
|
-
keyed: (e) => e.key,
|
|
441
|
-
children: (e, t) => X(e, t)
|
|
442
|
-
}), i), b(t, (() => {
|
|
443
|
-
var t = x(() => N() !== null && Y() === e().pane && L() === e().items.length);
|
|
501
|
+
})(), r), b(t, () => Q(() => e().nodes), i), b(t, (() => {
|
|
502
|
+
var t = x(() => N() !== null && X() === e().pane && R() === e().items.length);
|
|
444
503
|
return () => t() ? he() : void 0;
|
|
445
504
|
})(), a), y(() => e().pane, (e) => {
|
|
446
505
|
w(t, "data-chooser-section", e);
|
|
@@ -482,17 +541,17 @@ v([
|
|
|
482
541
|
]);
|
|
483
542
|
//#endregion
|
|
484
543
|
//#region src/view/SortManagementPanel.tsx
|
|
485
|
-
var
|
|
486
|
-
function
|
|
544
|
+
var we = /* @__PURE__ */ O("<select class=ssg-sort-select>"), Te = /* @__PURE__ */ O("<option>"), Ee = /* @__PURE__ */ O("<div class=ssg-sort-list><!><!>"), De = /* @__PURE__ */ O("<div class=ssg-popover-footer><button type=button class=\"ssg-sort-footer-btn ssg-sort-footer-btn--add\"></button><button type=button class=\"ssg-sort-footer-btn ssg-sort-footer-btn--clear\">"), Oe = /* @__PURE__ */ O("<div class=ssg-sort-empty>"), ke = /* @__PURE__ */ O("<div data-sort-level class=ssg-sort-level><span role=button class=ssg-sort-handle></span><span aria-hidden=true class=ssg-sort-badge></span><div class=ssg-sort-dir-group><button type=button class=ssg-sort-dir-btn>↑ </button><button type=button class=ssg-sort-dir-btn>↓ </button></div><button type=button class=ssg-sort-delete>×"), Ae = /* @__PURE__ */ O("<div class=ssg-sort-drop-end>"), je = /* @__PURE__ */ O("<div class=ssg-sort-note>");
|
|
545
|
+
function Me(e) {
|
|
487
546
|
let t = a(() => e.value);
|
|
488
|
-
var n =
|
|
547
|
+
var n = we();
|
|
489
548
|
return n.addEventListener("change", (t) => e.onChange(t.currentTarget.value)), C(() => t, n), b(n, _(o, {
|
|
490
549
|
get each() {
|
|
491
550
|
return e.options;
|
|
492
551
|
},
|
|
493
552
|
keyed: (e) => e.key,
|
|
494
553
|
children: (e) => (() => {
|
|
495
|
-
var t =
|
|
554
|
+
var t = Te();
|
|
496
555
|
return b(t, () => e().title), y(() => e().key, (e) => {
|
|
497
556
|
t.value = e;
|
|
498
557
|
}), t;
|
|
@@ -501,7 +560,7 @@ function Ae(e) {
|
|
|
501
560
|
w(n, "disabled", e);
|
|
502
561
|
}), n;
|
|
503
562
|
}
|
|
504
|
-
function
|
|
563
|
+
function Ne(t) {
|
|
505
564
|
let n = e(), r = l(() => new Set(t.entries.map((e) => e.columnKey))), i = l(() => t.columns.find((e) => !r().has(e.key)) ?? null), a = (e) => t.columns.find((t) => t.key === e)?.title || e, s = () => t.canSort && t.entries.length >= 2, c, [d, f] = u(null), p = !1, [m, h] = u(null), g = 0, v = () => {
|
|
506
565
|
if (!c) return;
|
|
507
566
|
let e = c.querySelectorAll("[data-sort-level]"), t = e.length;
|
|
@@ -527,7 +586,7 @@ function je(t) {
|
|
|
527
586
|
}, k = () => t.canSort && i() !== null;
|
|
528
587
|
return [
|
|
529
588
|
(() => {
|
|
530
|
-
var e =
|
|
589
|
+
var e = Ee(), i = e.firstChild, u = i.nextSibling;
|
|
531
590
|
return C(() => (e) => {
|
|
532
591
|
c = e;
|
|
533
592
|
}, e), b(e, (() => {
|
|
@@ -545,10 +604,10 @@ function je(t) {
|
|
|
545
604
|
title: a(n)
|
|
546
605
|
}, ...i];
|
|
547
606
|
}), c = () => d() === i(), u = () => d() !== null && m() === i();
|
|
548
|
-
var f =
|
|
549
|
-
return p.addEventListener("pointercancel", O), p._$$pointerup = D, p._$$pointermove = E, p._$$pointerdown = (e) => T(i(), e), b(p, _(
|
|
607
|
+
var f = ke(), p = f.firstChild, h = p.nextSibling, g = h.nextSibling, v = g.firstChild, x = v.nextSibling, S = g.nextSibling;
|
|
608
|
+
return p.addEventListener("pointercancel", O), p._$$pointerup = D, p._$$pointermove = E, p._$$pointerdown = (e) => T(i(), e), b(p, _(re, { get disabled() {
|
|
550
609
|
return !s();
|
|
551
|
-
} })), b(h, () => i() + 1), b(f, _(
|
|
610
|
+
} })), b(h, () => i() + 1), b(f, _(Me, {
|
|
552
611
|
get value() {
|
|
553
612
|
return e().columnKey;
|
|
554
613
|
},
|
|
@@ -582,16 +641,16 @@ function je(t) {
|
|
|
582
641
|
}), f;
|
|
583
642
|
}
|
|
584
643
|
}) : (() => {
|
|
585
|
-
var e =
|
|
644
|
+
var e = Oe();
|
|
586
645
|
return b(e, () => n().sortPanelEmpty), e;
|
|
587
646
|
})();
|
|
588
647
|
})(), i), b(e, (() => {
|
|
589
648
|
var e = x(() => d() !== null && m() === t.entries.length);
|
|
590
|
-
return () => e() ?
|
|
649
|
+
return () => e() ? Ae() : void 0;
|
|
591
650
|
})(), u), e;
|
|
592
651
|
})(),
|
|
593
652
|
(() => {
|
|
594
|
-
var e =
|
|
653
|
+
var e = De(), r = e.firstChild, a = r.nextSibling;
|
|
595
654
|
return r._$$click = () => {
|
|
596
655
|
let e = i();
|
|
597
656
|
k() && e && t.onAddLevel(e.key, "asc");
|
|
@@ -607,7 +666,7 @@ function je(t) {
|
|
|
607
666
|
}), e;
|
|
608
667
|
})(),
|
|
609
668
|
x(() => x(() => !t.canSort)() ? (() => {
|
|
610
|
-
var e =
|
|
669
|
+
var e = je();
|
|
611
670
|
return b(e, () => n().sortPanelReadOnly), e;
|
|
612
671
|
})() : void 0)
|
|
613
672
|
];
|
|
@@ -619,4 +678,4 @@ v([
|
|
|
619
678
|
"pointerup"
|
|
620
679
|
]);
|
|
621
680
|
//#endregion
|
|
622
|
-
export {
|
|
681
|
+
export { Ce as ColumnChooserPanel, Z as FilterManagementPanel, Ne as SortManagementPanel, R as ToolPanel };
|