@vielzeug/refine 1.7.0 → 1.8.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/dist/async.cjs +11 -11
- package/dist/async.cjs.map +1 -1
- package/dist/async.js +1 -2
- package/dist/async.js.map +1 -1
- package/dist/calendar.cjs +26 -26
- package/dist/calendar.cjs.map +1 -1
- package/dist/calendar.js +4 -5
- package/dist/calendar.js.map +1 -1
- package/dist/checkbox-group.cjs +9 -9
- package/dist/checkbox-group.cjs.map +1 -1
- package/dist/checkbox-group.js +1 -2
- package/dist/checkbox-group.js.map +1 -1
- package/dist/code-window.cjs +4 -4
- package/dist/code-window.cjs.map +1 -1
- package/dist/code-window.js +1 -2
- package/dist/code-window.js.map +1 -1
- package/dist/command-palette.cjs +6 -6
- package/dist/command-palette.cjs.map +1 -1
- package/dist/command-palette.js +46 -47
- package/dist/command-palette.js.map +1 -1
- package/dist/content/code-window/code-window.d.ts.map +1 -1
- package/dist/content/icon/icon.d.ts.map +1 -1
- package/dist/custom-elements.json +3716 -3716
- package/dist/datagrid.cjs +2 -2
- package/dist/datagrid.js +206 -206
- package/dist/datagrid.js.map +1 -1
- package/dist/disclosure/tab-panel/tab-panel.d.ts.map +1 -1
- package/dist/feedback/async/async.d.ts.map +1 -1
- package/dist/feedback/progress/progress.d.ts.map +1 -1
- package/dist/file-input.cjs +49 -49
- package/dist/file-input.cjs.map +1 -1
- package/dist/file-input.js +1 -2
- package/dist/file-input.js.map +1 -1
- package/dist/icon.cjs +1 -1
- package/dist/icon.cjs.map +1 -1
- package/dist/icon.js +1 -2
- package/dist/icon.js.map +1 -1
- package/dist/input.cjs +2 -2
- package/dist/input.js +6 -6
- package/dist/inputs/calendar/calendar.d.ts.map +1 -1
- package/dist/message-composer.cjs +2 -2
- package/dist/message-composer.js +6 -6
- package/dist/progress.cjs +13 -13
- package/dist/progress.cjs.map +1 -1
- package/dist/progress.js +3 -4
- package/dist/progress.js.map +1 -1
- package/dist/radio-group.cjs +11 -11
- package/dist/radio-group.cjs.map +1 -1
- package/dist/radio-group.js +1 -2
- package/dist/radio-group.js.map +1 -1
- package/dist/refine.cjs +197 -197
- package/dist/refine.cjs.map +1 -1
- package/dist/refine.iife.js +258 -258
- package/dist/refine.iife.js.map +1 -1
- package/dist/refine.js +225 -225
- package/dist/refine.js.map +1 -1
- package/dist/tab-panel.cjs +7 -7
- package/dist/tab-panel.cjs.map +1 -1
- package/dist/tab-panel.js +3 -4
- package/dist/tab-panel.js.map +1 -1
- package/dist/testing/index.d.ts +15 -60
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing.cjs +1 -1
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.js +7 -24
- package/dist/testing.js.map +1 -1
- package/dist/textarea.cjs +2 -2
- package/dist/textarea.js +6 -6
- package/package.json +6 -5
- package/dist/keymap/dist/_dev.cjs +0 -2
- package/dist/keymap/dist/_dev.cjs.map +0 -1
- package/dist/keymap/dist/_dev.js +0 -4
- package/dist/keymap/dist/_dev.js.map +0 -1
- package/dist/keymap/dist/format.cjs +0 -1
- package/dist/keymap/dist/format.js +0 -1
- package/dist/keymap/dist/index.cjs +0 -1
- package/dist/keymap/dist/index.js +0 -4
- package/dist/keymap/dist/keymap.cjs +0 -2
- package/dist/keymap/dist/keymap.cjs.map +0 -1
- package/dist/keymap/dist/keymap.js +0 -221
- package/dist/keymap/dist/keymap.js.map +0 -1
- package/dist/keymap/dist/layer.cjs +0 -1
- package/dist/keymap/dist/layer.js +0 -1
package/dist/datagrid.js
CHANGED
|
@@ -4,56 +4,56 @@ import { disablableBundle as n, loadableBundle as r } from "./shared/prop-bundle
|
|
|
4
4
|
import { lifecycleSignal as i } from "./headless/ore.js";
|
|
5
5
|
import { createDataGridControl as a } from "./headless/datagrid.js";
|
|
6
6
|
import { COLUMN_OBSERVED_ATTRS as o, COLUMN_TAG as s, parseColumnChildren as c } from "./inputs/datagrid/datagrid-column.js";
|
|
7
|
-
import { createDataGridControls as
|
|
8
|
-
import { createGridNav as
|
|
9
|
-
import
|
|
10
|
-
import { define as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
7
|
+
import { createDataGridControls as ee } from "./inputs/datagrid/datagrid-controls.js";
|
|
8
|
+
import { createGridNav as l } from "./inputs/datagrid/datagrid-nav.js";
|
|
9
|
+
import u from "./inputs/datagrid/datagrid.css.js";
|
|
10
|
+
import { define as d, getHost as f, html as p, onCleanup as m, onMounted as h, prop as g, useEmit as te, useSlots as ne } from "@vielzeug/ore";
|
|
11
|
+
import { computed as _, signal as v, watch as y } from "@vielzeug/ripple";
|
|
12
|
+
import { debounce as b } from "@vielzeug/arsenal";
|
|
13
|
+
import { raw as re } from "@vielzeug/ore/directives";
|
|
14
14
|
//#region src/inputs/datagrid/datagrid.ts
|
|
15
|
-
function
|
|
15
|
+
function x(e, t) {
|
|
16
16
|
return e.key !== t || e.direction === "none" ? "chevrons-up-down" : e.direction === "asc" ? "chevron-up" : "chevron-down";
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function S(e, t) {
|
|
19
19
|
return e.key !== t || e.direction === "none" ? "none" : e.direction === "asc" ? "ascending" : "descending";
|
|
20
20
|
}
|
|
21
|
-
var
|
|
22
|
-
|
|
21
|
+
var C = "ore-datagrid";
|
|
22
|
+
d(C, {
|
|
23
23
|
props: {
|
|
24
|
-
activeView:
|
|
25
|
-
density:
|
|
24
|
+
activeView: g.string(),
|
|
25
|
+
density: g.string(),
|
|
26
26
|
...n,
|
|
27
27
|
...r,
|
|
28
|
-
columns:
|
|
29
|
-
emptyText:
|
|
30
|
-
expandable:
|
|
31
|
-
filterOptions:
|
|
32
|
-
fullwidth:
|
|
33
|
-
getRowKey:
|
|
34
|
-
label:
|
|
35
|
-
pageSize:
|
|
36
|
-
pageSizeOptions:
|
|
37
|
-
rows:
|
|
38
|
-
searchLabel:
|
|
39
|
-
searchPlaceholder:
|
|
40
|
-
selectedKeys:
|
|
41
|
-
selectionMode:
|
|
42
|
-
sortMode:
|
|
43
|
-
source:
|
|
44
|
-
striped:
|
|
45
|
-
views:
|
|
28
|
+
columns: g.data(),
|
|
29
|
+
emptyText: g.string("No data"),
|
|
30
|
+
expandable: g.bool(!1),
|
|
31
|
+
filterOptions: g.data(),
|
|
32
|
+
fullwidth: g.bool(!1),
|
|
33
|
+
getRowKey: g.data(),
|
|
34
|
+
label: g.string(),
|
|
35
|
+
pageSize: g.number(10),
|
|
36
|
+
pageSizeOptions: g.data(),
|
|
37
|
+
rows: g.data(),
|
|
38
|
+
searchLabel: g.data(),
|
|
39
|
+
searchPlaceholder: g.string("Search…"),
|
|
40
|
+
selectedKeys: g.data(),
|
|
41
|
+
selectionMode: g.string("none"),
|
|
42
|
+
sortMode: g.string("client"),
|
|
43
|
+
source: g.data(),
|
|
44
|
+
striped: g.bool(!1),
|
|
45
|
+
views: g.data()
|
|
46
46
|
},
|
|
47
47
|
setup(e) {
|
|
48
|
-
let n =
|
|
49
|
-
|
|
50
|
-
e != null && (
|
|
48
|
+
let n = f(), r = te(), s = ne(), u = _(() => e.disabled.value === !0), d = _(() => e.selectionMode.value ?? "none"), g = v(/* @__PURE__ */ new Set()), C = _(() => e.expandable.value === !0 && D.value.some((e) => typeof e.renderExpanded == "function")), w = _(() => +(d.value === "multi")), T = v(e.pageSize.value ?? 10);
|
|
49
|
+
y(e.pageSize, (e) => {
|
|
50
|
+
e != null && (T.value = e);
|
|
51
51
|
});
|
|
52
|
-
let
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
let E = v([]);
|
|
53
|
+
h(() => {
|
|
54
|
+
E.value = c(n);
|
|
55
55
|
let e = new MutationObserver(() => {
|
|
56
|
-
|
|
56
|
+
E.value = c(n);
|
|
57
57
|
});
|
|
58
58
|
return e.observe(n, {
|
|
59
59
|
attributeFilter: o,
|
|
@@ -62,111 +62,111 @@ f(w, {
|
|
|
62
62
|
subtree: !0
|
|
63
63
|
}), () => e.disconnect();
|
|
64
64
|
});
|
|
65
|
-
let
|
|
65
|
+
let D = _(() => {
|
|
66
66
|
let t = e.columns.value;
|
|
67
|
-
return t === void 0 ?
|
|
68
|
-
}),
|
|
67
|
+
return t === void 0 ? E.value : t;
|
|
68
|
+
}), O = (n) => {
|
|
69
69
|
let r = e.getRowKey.value;
|
|
70
70
|
if (r) return r(n);
|
|
71
71
|
let i = n.id;
|
|
72
72
|
return i == null ? (t("ore-datagrid: row missing `id` — keys will collide. Provide `getRowKey` or add a unique `id` field."), `__missing_${Math.random().toString(36).slice(2)}`) : String(i);
|
|
73
|
-
},
|
|
74
|
-
columns:
|
|
73
|
+
}, k = ee({
|
|
74
|
+
columns: D,
|
|
75
75
|
filterOptions: e.filterOptions,
|
|
76
|
-
rows:
|
|
77
|
-
}),
|
|
76
|
+
rows: _(() => e.rows.value ?? [])
|
|
77
|
+
}), A = b((t) => {
|
|
78
78
|
let n = t, r = e.source.value;
|
|
79
|
-
r?.search ? r.search(n) :
|
|
80
|
-
}, 250),
|
|
79
|
+
r?.search ? r.search(n) : k.setSearchQuery(n);
|
|
80
|
+
}, 250), j = _(() => e.source.value != null), M = v([]), N = v({
|
|
81
81
|
error: null,
|
|
82
82
|
isLoading: !1,
|
|
83
83
|
pageCount: 1,
|
|
84
84
|
pageNumber: 1,
|
|
85
|
-
pageSize:
|
|
85
|
+
pageSize: T.value,
|
|
86
86
|
totalItems: 0
|
|
87
|
-
}),
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}),
|
|
91
|
-
if (
|
|
92
|
-
|
|
87
|
+
}), P = null;
|
|
88
|
+
m(() => {
|
|
89
|
+
P?.(), P = null;
|
|
90
|
+
}), y(e.source, (e) => {
|
|
91
|
+
if (P?.(), P = null, !e) {
|
|
92
|
+
M.value = [], N.value = {
|
|
93
93
|
error: null,
|
|
94
94
|
isLoading: !1,
|
|
95
95
|
pageCount: 1,
|
|
96
96
|
pageNumber: 1,
|
|
97
|
-
pageSize:
|
|
97
|
+
pageSize: T.value,
|
|
98
98
|
totalItems: 0
|
|
99
99
|
};
|
|
100
100
|
return;
|
|
101
101
|
}
|
|
102
102
|
let t = () => {
|
|
103
|
-
|
|
103
|
+
M.value = e.current, N.value = e.meta;
|
|
104
104
|
};
|
|
105
|
-
t(),
|
|
105
|
+
t(), P = e.subscribe(t);
|
|
106
106
|
}, { immediate: !0 });
|
|
107
|
-
let
|
|
108
|
-
columns: () =>
|
|
109
|
-
getRowKey:
|
|
110
|
-
items:
|
|
107
|
+
let F = a({
|
|
108
|
+
columns: () => D.value,
|
|
109
|
+
getRowKey: O,
|
|
110
|
+
items: _(() => j.value ? M.value : k.filteredRows.value),
|
|
111
111
|
onSelectionChange: (e) => {
|
|
112
112
|
r("selection-change", {
|
|
113
113
|
keys: [...e],
|
|
114
|
-
rows:
|
|
114
|
+
rows: F.selectedRows.value
|
|
115
115
|
});
|
|
116
116
|
},
|
|
117
117
|
onSortChange: (e) => {
|
|
118
118
|
r("sort-change", e);
|
|
119
119
|
},
|
|
120
|
-
pageSize: () =>
|
|
121
|
-
selectionMode: () =>
|
|
122
|
-
signal: i(
|
|
120
|
+
pageSize: () => j.value ? 0 : T.value,
|
|
121
|
+
selectionMode: () => d.value,
|
|
122
|
+
signal: i(m)
|
|
123
123
|
});
|
|
124
|
-
|
|
125
|
-
Array.isArray(e) &&
|
|
124
|
+
y(e.selectedKeys, (e) => {
|
|
125
|
+
Array.isArray(e) && F.setSelection(new Set(e));
|
|
126
126
|
}, { immediate: !0 });
|
|
127
|
-
let
|
|
127
|
+
let I = v({}), L = (e, t) => (n) => {
|
|
128
128
|
n.preventDefault();
|
|
129
129
|
let r = n.clientX, i = t.getBoundingClientRect().width, a = new AbortController(), { signal: o } = a;
|
|
130
130
|
window.addEventListener("pointermove", (t) => {
|
|
131
|
-
|
|
132
|
-
...
|
|
131
|
+
I.value = {
|
|
132
|
+
...I.value,
|
|
133
133
|
[e]: Math.max(40, i + t.clientX - r)
|
|
134
134
|
};
|
|
135
135
|
}, { signal: o }), window.addEventListener("pointerup", () => a.abort(), { signal: o });
|
|
136
|
-
},
|
|
136
|
+
}, R = _(() => D.value.filter((e) => !k.hiddenColumns.value.has(e.key))), z = (e, t) => {
|
|
137
137
|
if (e.cell) return e.cell(t);
|
|
138
138
|
let n = t[e.key];
|
|
139
139
|
return n == null ? "" : String(n);
|
|
140
140
|
};
|
|
141
|
-
|
|
141
|
+
y(k.filteredRows, () => F.goToPage(0), { immediate: !1 });
|
|
142
142
|
function B(t) {
|
|
143
143
|
let n = e.source.value;
|
|
144
144
|
if (n) {
|
|
145
145
|
t === "prev" ? n.prev?.() : n.next?.();
|
|
146
146
|
return;
|
|
147
147
|
}
|
|
148
|
-
t === "prev" ?
|
|
149
|
-
pageIndex:
|
|
150
|
-
pageSize:
|
|
148
|
+
t === "prev" ? F.prevPage() : F.nextPage(), r("page-change", {
|
|
149
|
+
pageIndex: F.pageIndex.value,
|
|
150
|
+
pageSize: T.value
|
|
151
151
|
});
|
|
152
152
|
}
|
|
153
|
-
let V =
|
|
154
|
-
let e =
|
|
155
|
-
return !e.length ||
|
|
156
|
-
}), H =
|
|
157
|
-
if (
|
|
158
|
-
let { pageNumber: e, pageSize: t, totalItems: n } =
|
|
153
|
+
let V = _(() => {
|
|
154
|
+
let e = F.currentPageItems.value;
|
|
155
|
+
return !e.length || F.isAllSelected() ? !1 : e.some((e) => F.selectedKeys.value.has(O(e)));
|
|
156
|
+
}), H = _(() => R.value.length + +(d.value === "multi") + +!!C.value), U = _(() => j.value ? N.value.pageCount > 1 : T.value > 0), W = _(() => {
|
|
157
|
+
if (j.value) {
|
|
158
|
+
let { pageNumber: e, pageSize: t, totalItems: n } = N.value, r = Math.max(1, t);
|
|
159
159
|
if (!U.value) return `${n} row${n === 1 ? "" : "s"}`;
|
|
160
160
|
if (n === 0) return "0 to 0 of 0";
|
|
161
161
|
let i = (e - 1) * r + 1;
|
|
162
162
|
return `${i} to ${Math.min(i + r - 1, n)} of ${n}`;
|
|
163
163
|
}
|
|
164
|
-
let e =
|
|
164
|
+
let e = F.totalItems.value;
|
|
165
165
|
if (!U.value) return `${e} row${e === 1 ? "" : "s"}`;
|
|
166
166
|
if (e === 0) return "0 to 0 of 0";
|
|
167
|
-
let t =
|
|
168
|
-
return `${t} to ${Math.min(t +
|
|
169
|
-
}), G =
|
|
167
|
+
let t = F.pageIndex.value * T.value + 1;
|
|
168
|
+
return `${t} to ${Math.min(t + T.value - 1, e)} of ${e}`;
|
|
169
|
+
}), G = _(() => e.loading.value === !0 || j.value && N.value.isLoading), K = _(() => j.value ? N.value.pageNumber > 1 : F.hasPrevPage.value), q = _(() => j.value ? N.value.pageNumber < N.value.pageCount : F.hasNextPage.value), J = _(() => j.value ? N.value.totalItems === 0 ? "0 / 0" : `${N.value.pageNumber} / ${N.value.pageCount}` : `${F.pageIndex.value + 1} / ${F.pageCount.value}`), Y = [
|
|
170
170
|
"compact",
|
|
171
171
|
"cozy",
|
|
172
172
|
"comfortable"
|
|
@@ -178,35 +178,35 @@ f(w, {
|
|
|
178
178
|
comfortable: "Density: Comfortable",
|
|
179
179
|
compact: "Density: Compact",
|
|
180
180
|
cozy: "Density: Cozy"
|
|
181
|
-
}, X =
|
|
182
|
-
|
|
181
|
+
}, X = v(e.density.value ?? "cozy");
|
|
182
|
+
y(e.density, (e) => {
|
|
183
183
|
e && (X.value = e);
|
|
184
184
|
});
|
|
185
185
|
let oe = () => {
|
|
186
186
|
let e = Y.indexOf(X.value), t = Y[(e + 1) % Y.length];
|
|
187
187
|
X.value = t, n.setAttribute("density", t), r("density-change", { density: t });
|
|
188
|
-
}, Z =
|
|
189
|
-
let t = new Set(
|
|
190
|
-
n ? t.add(e) : t.delete(e),
|
|
188
|
+
}, Z = v(!1), Q = (e) => {
|
|
189
|
+
let t = new Set(g.value), n = !t.has(e);
|
|
190
|
+
n ? t.add(e) : t.delete(e), g.value = t, r("row-expand", {
|
|
191
191
|
expanded: n,
|
|
192
192
|
key: e
|
|
193
193
|
});
|
|
194
194
|
}, $ = {
|
|
195
|
-
activeCell:
|
|
195
|
+
activeCell: v({
|
|
196
196
|
col: 0,
|
|
197
197
|
row: 0
|
|
198
198
|
}),
|
|
199
199
|
focusCell: () => {}
|
|
200
200
|
};
|
|
201
|
-
|
|
201
|
+
h(() => {
|
|
202
202
|
let e = n.shadowRoot, t = e.querySelector(".dg-table");
|
|
203
203
|
if (!t) return;
|
|
204
|
-
let { cleanup: r, handle: i } =
|
|
204
|
+
let { cleanup: r, handle: i } = l(t, e);
|
|
205
205
|
return $ = i, r;
|
|
206
206
|
}), n.focusCell = (e) => $.focusCell(e);
|
|
207
207
|
let se = () => {
|
|
208
208
|
let t = e.views.value ?? [], n = e.activeView.value;
|
|
209
|
-
return
|
|
209
|
+
return p`<div
|
|
210
210
|
class="dg-tabs"
|
|
211
211
|
role="tablist"
|
|
212
212
|
aria-label="Views"
|
|
@@ -225,7 +225,7 @@ f(w, {
|
|
|
225
225
|
n.focus(), n.click();
|
|
226
226
|
}
|
|
227
227
|
}}">
|
|
228
|
-
${t.map((e) =>
|
|
228
|
+
${t.map((e) => p`<ore-button
|
|
229
229
|
class="${() => `dg-tab${n === e.id ? " dg-tab--active" : ""}`}"
|
|
230
230
|
role="tab"
|
|
231
231
|
variant="ghost"
|
|
@@ -243,7 +243,7 @@ f(w, {
|
|
|
243
243
|
${e.label}
|
|
244
244
|
</ore-button>`)}
|
|
245
245
|
</div>`;
|
|
246
|
-
}, ce = () =>
|
|
246
|
+
}, ce = () => p`<ore-popover class="dg-action-popover" placement="bottom-end" label="Sort" style="--popover-min-width:18rem">
|
|
247
247
|
<ore-button variant="ghost" size="sm" icon-only label="Sort">
|
|
248
248
|
<ore-icon name="arrow-up-down" size="15" stroke-width="1.75" aria-hidden="true"></ore-icon>
|
|
249
249
|
</ore-button>
|
|
@@ -256,8 +256,8 @@ f(w, {
|
|
|
256
256
|
size="sm"
|
|
257
257
|
icon-only
|
|
258
258
|
label="Clear sort"
|
|
259
|
-
:disabled="${() =>
|
|
260
|
-
@click="${() =>
|
|
259
|
+
:disabled="${() => F.sortState.value.direction === "none" || void 0}"
|
|
260
|
+
@click="${() => F.sortTo("", "none")}">
|
|
261
261
|
<ore-icon name="trash-2" size="14" stroke-width="1.75" aria-hidden="true"></ore-icon>
|
|
262
262
|
</ore-button>
|
|
263
263
|
</div>
|
|
@@ -269,14 +269,14 @@ f(w, {
|
|
|
269
269
|
rounded="lg"
|
|
270
270
|
placeholder="Property"
|
|
271
271
|
fullwidth
|
|
272
|
-
:value="${() =>
|
|
273
|
-
:options="${() =>
|
|
272
|
+
:value="${() => F.sortState.value.key}"
|
|
273
|
+
:options="${() => D.value.map((e) => ({
|
|
274
274
|
label: e.label,
|
|
275
275
|
value: e.key
|
|
276
276
|
}))}"
|
|
277
277
|
@change="${(e) => {
|
|
278
|
-
let t = e.detail.values[0] ?? "", n =
|
|
279
|
-
|
|
278
|
+
let t = e.detail.values[0] ?? "", n = F.sortState.value.direction === "none" ? "asc" : F.sortState.value.direction;
|
|
279
|
+
F.sortTo(t, n);
|
|
280
280
|
}}"></ore-select>
|
|
281
281
|
<ore-select
|
|
282
282
|
class="dg-pop-dir-select"
|
|
@@ -284,8 +284,8 @@ f(w, {
|
|
|
284
284
|
size="sm"
|
|
285
285
|
rounded="lg"
|
|
286
286
|
fullwidth
|
|
287
|
-
:disabled="${() => !
|
|
288
|
-
:value="${() =>
|
|
287
|
+
:disabled="${() => !F.sortState.value.key || void 0}"
|
|
288
|
+
:value="${() => F.sortState.value.direction === "none" ? "asc" : F.sortState.value.direction}"
|
|
289
289
|
:options="${() => [{
|
|
290
290
|
label: "A → Z",
|
|
291
291
|
value: "asc"
|
|
@@ -294,22 +294,22 @@ f(w, {
|
|
|
294
294
|
value: "desc"
|
|
295
295
|
}]}"
|
|
296
296
|
@change="${(e) => {
|
|
297
|
-
|
|
297
|
+
F.sortState.value.key && F.sortTo(F.sortState.value.key, e.detail.values[0] ?? "asc");
|
|
298
298
|
}}"></ore-select>
|
|
299
299
|
</div>
|
|
300
300
|
</div>
|
|
301
|
-
</ore-popover>`, le = () =>
|
|
301
|
+
</ore-popover>`, le = () => p`<ore-popover
|
|
302
302
|
class="dg-action-popover"
|
|
303
303
|
placement="bottom-end"
|
|
304
304
|
label="Filter"
|
|
305
305
|
style="--popover-min-width:16rem;--popover-max-height:min(90vh,48rem)">
|
|
306
|
-
${() =>
|
|
306
|
+
${() => k.filterDefs.value.length ? p`<ore-badge
|
|
307
307
|
anchor="top-end"
|
|
308
308
|
color="primary"
|
|
309
309
|
size="xs"
|
|
310
|
-
:count="${() => Z.value ?
|
|
310
|
+
:count="${() => Z.value ? k.filterDefs.value.length : void 0}"
|
|
311
311
|
:dot="${() => !Z.value || void 0}"
|
|
312
|
-
:label="${() => `${
|
|
312
|
+
:label="${() => `${k.filterDefs.value.length} active filter${k.filterDefs.value.length > 1 ? "s" : ""}`}"
|
|
313
313
|
aria-hidden="true"
|
|
314
314
|
@mouseenter="${() => Z.value = !0}"
|
|
315
315
|
@mouseleave="${() => Z.value = !1}"
|
|
@@ -318,21 +318,21 @@ f(w, {
|
|
|
318
318
|
<ore-button slot="target" variant="ghost" size="sm" icon-only label="Filter">
|
|
319
319
|
<ore-icon name="filter" size="15" stroke-width="1.75" aria-hidden="true"></ore-icon>
|
|
320
320
|
</ore-button>
|
|
321
|
-
</ore-badge>` :
|
|
321
|
+
</ore-badge>` : p`<ore-button class="dg-icon-btn" variant="ghost" size="sm" icon-only label="Filter">
|
|
322
322
|
<ore-icon name="filter" size="15" stroke-width="1.75" aria-hidden="true"></ore-icon>
|
|
323
323
|
</ore-button>`}
|
|
324
324
|
<div slot="content" class="dg-pop-filter">
|
|
325
325
|
<div class="dg-pop-header">
|
|
326
326
|
<span class="dg-pop-title">Filter by</span>
|
|
327
|
-
${() =>
|
|
327
|
+
${() => k.filterDefs.value.length ? p`<ore-button
|
|
328
328
|
class="dg-icon-btn"
|
|
329
329
|
variant="ghost"
|
|
330
330
|
size="sm"
|
|
331
331
|
icon-only
|
|
332
332
|
label="Clear all filters"
|
|
333
|
-
@click="${() =>
|
|
333
|
+
@click="${() => k.clearAllFilters()}">
|
|
334
334
|
<ore-icon name="trash-2" size="14" stroke-width="1.75" aria-hidden="true"></ore-icon>
|
|
335
|
-
</ore-button>` :
|
|
335
|
+
</ore-button>` : p``}
|
|
336
336
|
</div>
|
|
337
337
|
|
|
338
338
|
<!-- Always-visible field picker: select columns to add filter rules -->
|
|
@@ -342,20 +342,20 @@ f(w, {
|
|
|
342
342
|
multiple
|
|
343
343
|
fullwidth
|
|
344
344
|
autoclose
|
|
345
|
-
:options="${() =>
|
|
345
|
+
:options="${() => D.value.map((e) => ({
|
|
346
346
|
label: e.label,
|
|
347
347
|
value: e.key
|
|
348
348
|
}))}"
|
|
349
|
-
:value="${() =>
|
|
349
|
+
:value="${() => k.filterDefs.value.map((e) => e.key)}"
|
|
350
350
|
@change="${(e) => {
|
|
351
|
-
|
|
351
|
+
k.setActiveFilterKeys(e.detail.values);
|
|
352
352
|
}}">
|
|
353
353
|
</ore-combobox>
|
|
354
354
|
</div>
|
|
355
355
|
|
|
356
356
|
<!-- Active filter rules (appear below the field picker as rules are added) -->
|
|
357
|
-
<div class="dg-pop-filter-rules" ?hidden="${() => !
|
|
358
|
-
${() =>
|
|
357
|
+
<div class="dg-pop-filter-rules" ?hidden="${() => !k.filterDefs.value.length}">
|
|
358
|
+
${() => k.filterDefs.value.map((e) => p`
|
|
359
359
|
<div class="dg-pop-filter-rule">
|
|
360
360
|
<div class="dg-pop-filter-rule-header">
|
|
361
361
|
<span class="dg-pop-filter-field">${e.label}</span>
|
|
@@ -364,10 +364,10 @@ f(w, {
|
|
|
364
364
|
variant="ghost"
|
|
365
365
|
size="sm"
|
|
366
366
|
fullwidth
|
|
367
|
-
:value="${() =>
|
|
367
|
+
:value="${() => k.filterValues.value.get(e.key)?.operator ?? "contains"}"
|
|
368
368
|
:options="${() => e.operators ?? []}"
|
|
369
369
|
@change="${(t) => {
|
|
370
|
-
|
|
370
|
+
k.setFilterOperator(e.key, t.detail.values[0]);
|
|
371
371
|
}}"></ore-select>
|
|
372
372
|
<ore-button
|
|
373
373
|
class="dg-icon-btn"
|
|
@@ -375,7 +375,7 @@ f(w, {
|
|
|
375
375
|
size="sm"
|
|
376
376
|
icon-only
|
|
377
377
|
label="Remove filter"
|
|
378
|
-
@click="${() =>
|
|
378
|
+
@click="${() => k.removeFilter(e.key)}">
|
|
379
379
|
<ore-icon name="trash-2" size="13" stroke-width="1.75" aria-hidden="true"></ore-icon>
|
|
380
380
|
</ore-button>
|
|
381
381
|
</div>
|
|
@@ -383,19 +383,19 @@ f(w, {
|
|
|
383
383
|
class="dg-filter"
|
|
384
384
|
:placeholder="${() => e.label}"
|
|
385
385
|
:options="${() => e.options}"
|
|
386
|
-
:value="${() => [...
|
|
387
|
-
:disabled="${() =>
|
|
386
|
+
:value="${() => [...k.filterValues.value.get(e.key)?.values ?? []]}"
|
|
387
|
+
:disabled="${() => u.value || void 0}"
|
|
388
388
|
multiple
|
|
389
389
|
fullwidth
|
|
390
390
|
autoclose
|
|
391
391
|
@change="${(t) => {
|
|
392
|
-
|
|
392
|
+
k.setFilter(e.key, t.detail.values);
|
|
393
393
|
}}"></ore-combobox>
|
|
394
394
|
</div>
|
|
395
395
|
`)}
|
|
396
396
|
</div>
|
|
397
397
|
</div>
|
|
398
|
-
</ore-popover>`, ue = () =>
|
|
398
|
+
</ore-popover>`, ue = () => p`<ore-popover
|
|
399
399
|
class="dg-action-popover"
|
|
400
400
|
placement="bottom-end"
|
|
401
401
|
label="Column options"
|
|
@@ -404,16 +404,16 @@ f(w, {
|
|
|
404
404
|
<ore-icon name="columns-2" size="15" stroke-width="1.75" aria-hidden="true"></ore-icon>
|
|
405
405
|
</ore-button>
|
|
406
406
|
<div slot="content" class="dg-pop-col-list" role="menu" aria-label="Column visibility">
|
|
407
|
-
${() =>
|
|
407
|
+
${() => D.value.map((e) => p`<ore-button
|
|
408
408
|
class="dg-pop-col-item"
|
|
409
409
|
role="menuitemcheckbox"
|
|
410
410
|
variant="ghost"
|
|
411
411
|
size="sm"
|
|
412
|
-
:aria-checked="${() => String(!
|
|
413
|
-
@click="${() =>
|
|
412
|
+
:aria-checked="${() => String(!k.hiddenColumns.value.has(e.key))}"
|
|
413
|
+
@click="${() => k.toggleColumnVisibility(e.key)}">
|
|
414
414
|
<ore-icon
|
|
415
415
|
slot="prefix"
|
|
416
|
-
:name="${() =>
|
|
416
|
+
:name="${() => k.hiddenColumns.value.has(e.key) ? "eye-off" : "eye"}"
|
|
417
417
|
size="13"
|
|
418
418
|
stroke-width="2"
|
|
419
419
|
aria-hidden="true"></ore-icon>
|
|
@@ -421,7 +421,7 @@ f(w, {
|
|
|
421
421
|
</ore-button>`)}
|
|
422
422
|
</div>
|
|
423
423
|
</ore-popover>`;
|
|
424
|
-
return
|
|
424
|
+
return p`
|
|
425
425
|
<!-- ── Controls Bar ────────────────────────────────────────────────── -->
|
|
426
426
|
<div class="dg-controls" part="controls">
|
|
427
427
|
<!-- Left: view tabs -->
|
|
@@ -451,43 +451,43 @@ f(w, {
|
|
|
451
451
|
<slot name="actions"></slot>
|
|
452
452
|
|
|
453
453
|
<!-- Search toggle: rightmost, expands in-place -->
|
|
454
|
-
<div class="${() => `dg-search${
|
|
455
|
-
${() =>
|
|
454
|
+
<div class="${() => `dg-search${k.searchActive.value ? " dg-search--open" : ""}`}">
|
|
455
|
+
${() => k.searchActive.value ? p`<ore-input
|
|
456
456
|
class="dg-search-input"
|
|
457
457
|
type="search"
|
|
458
458
|
variant="flat"
|
|
459
459
|
size="sm"
|
|
460
460
|
rounded="full"
|
|
461
461
|
:placeholder="${() => e.searchPlaceholder.value ?? "Search…"}"
|
|
462
|
-
:disabled="${() =>
|
|
462
|
+
:disabled="${() => u.value || void 0}"
|
|
463
463
|
ref="${(e) => {
|
|
464
464
|
e && requestAnimationFrame(() => e.focus());
|
|
465
465
|
}}"
|
|
466
466
|
@input="${(e) => {
|
|
467
|
-
|
|
467
|
+
A(e.detail.value);
|
|
468
468
|
}}"
|
|
469
469
|
@keydown="${(t) => {
|
|
470
470
|
if (t.key === "Escape") {
|
|
471
471
|
let t = e.source.value;
|
|
472
|
-
t?.search && t.search(""),
|
|
472
|
+
t?.search && t.search(""), k.toggleSearch();
|
|
473
473
|
}
|
|
474
474
|
}}">
|
|
475
475
|
<ore-icon slot="prefix" name="search" size="13" stroke-width="1.75" aria-hidden="true"></ore-icon>
|
|
476
|
-
</ore-input>` :
|
|
476
|
+
</ore-input>` : p``}
|
|
477
477
|
<ore-button
|
|
478
478
|
variant="ghost"
|
|
479
479
|
size="sm"
|
|
480
480
|
icon-only
|
|
481
481
|
:label="${() => {
|
|
482
482
|
let [t, n] = e.searchLabel.value ?? ["Search", "Close search"];
|
|
483
|
-
return
|
|
483
|
+
return k.searchActive.value ? n : t;
|
|
484
484
|
}}"
|
|
485
485
|
@click="${() => {
|
|
486
486
|
let t = e.source.value;
|
|
487
|
-
t?.search &&
|
|
487
|
+
t?.search && k.searchActive.value && t.search(""), k.toggleSearch();
|
|
488
488
|
}}">
|
|
489
489
|
<ore-icon
|
|
490
|
-
:name="${() =>
|
|
490
|
+
:name="${() => k.searchActive.value ? "x" : "search"}"
|
|
491
491
|
size="15"
|
|
492
492
|
stroke-width="1.75"
|
|
493
493
|
aria-hidden="true"></ore-icon>
|
|
@@ -506,113 +506,113 @@ f(w, {
|
|
|
506
506
|
role="grid"
|
|
507
507
|
:aria-label="${() => e.label.value ?? void 0}"
|
|
508
508
|
:aria-busy="${() => G.value ? "true" : null}"
|
|
509
|
-
:aria-disabled="${() =>
|
|
509
|
+
:aria-disabled="${() => u.value ? "true" : null}">
|
|
510
510
|
<!-- Head -->
|
|
511
511
|
<thead class="dg-head" part="thead">
|
|
512
512
|
<tr role="row">
|
|
513
|
-
${() =>
|
|
513
|
+
${() => d.value === "multi" ? p`<th
|
|
514
514
|
class="dg-th dg-th-check"
|
|
515
515
|
role="columnheader"
|
|
516
516
|
scope="col"
|
|
517
|
-
:tabindex="${() => $.activeCell.value.row === 0 && $.activeCell.value.col === 0 &&
|
|
517
|
+
:tabindex="${() => $.activeCell.value.row === 0 && $.activeCell.value.col === 0 && w.value >= 1 ? "0" : "-1"}">
|
|
518
518
|
<ore-checkbox
|
|
519
519
|
class="dg-check"
|
|
520
|
-
:checked="${() =>
|
|
520
|
+
:checked="${() => F.isAllSelected()}"
|
|
521
521
|
:indeterminate="${V}"
|
|
522
|
-
?disabled="${
|
|
522
|
+
?disabled="${u}"
|
|
523
523
|
aria-label="Select all rows on this page"
|
|
524
524
|
@change="${() => {
|
|
525
|
-
|
|
525
|
+
u.value || F.selectAll();
|
|
526
526
|
}}"></ore-checkbox>
|
|
527
|
-
</th>` :
|
|
528
|
-
${() =>
|
|
529
|
-
class="${`dg-th${t ===
|
|
527
|
+
</th>` : p``}
|
|
528
|
+
${() => R.value.map((e, t) => p`<th
|
|
529
|
+
class="${`dg-th${t === R.value.length - 1 && C.value ? " dg-th-last" : ""}`}"
|
|
530
530
|
role="columnheader"
|
|
531
531
|
scope="col"
|
|
532
532
|
:tabindex="${() => {
|
|
533
533
|
let e = $.activeCell.value;
|
|
534
|
-
return e.row === 0 && e.col === t +
|
|
534
|
+
return e.row === 0 && e.col === t + w.value ? "0" : "-1";
|
|
535
535
|
}}"
|
|
536
536
|
data-align="${e.align ?? "left"}"
|
|
537
|
-
:aria-sort="${() => e.sortable ?
|
|
537
|
+
:aria-sort="${() => e.sortable ? S(F.sortState.value, e.key) : void 0}"
|
|
538
538
|
:aria-label="${e.sortable ? void 0 : e.headerLabel ?? e.label}"
|
|
539
539
|
:style="${() => {
|
|
540
|
-
let t =
|
|
540
|
+
let t = I.value[e.key];
|
|
541
541
|
return t ? `width:${t}px` : e.width ? `width:${e.width}` : "";
|
|
542
542
|
}}">
|
|
543
543
|
<div class="dg-th-inner">
|
|
544
|
-
${() => e.sortable ?
|
|
544
|
+
${() => e.sortable ? p`<ore-button
|
|
545
545
|
class="dg-sort-btn"
|
|
546
546
|
variant="text"
|
|
547
547
|
size="sm"
|
|
548
548
|
fullwidth
|
|
549
549
|
:label="${e.headerLabel ?? e.label}"
|
|
550
|
-
:disabled="${() =>
|
|
550
|
+
:disabled="${() => u.value || void 0}"
|
|
551
551
|
@click="${() => {
|
|
552
|
-
|
|
552
|
+
u.value || F.sortBy(e.key);
|
|
553
553
|
}}">
|
|
554
554
|
${e.label}
|
|
555
555
|
<ore-icon
|
|
556
556
|
slot="suffix"
|
|
557
557
|
class="dg-sort-icon"
|
|
558
|
-
:name="${() =>
|
|
558
|
+
:name="${() => x(F.sortState.value, e.key)}"
|
|
559
559
|
size="14"
|
|
560
560
|
stroke-width="2"></ore-icon>
|
|
561
561
|
</ore-button>` : e.label}
|
|
562
|
-
${e.resizable ?
|
|
562
|
+
${e.resizable ? p`<span
|
|
563
563
|
class="dg-col-resize"
|
|
564
564
|
aria-hidden="true"
|
|
565
565
|
ref="${(t) => {
|
|
566
566
|
if (!t) return;
|
|
567
567
|
let n = t.closest("th");
|
|
568
|
-
n && t.addEventListener("pointerdown",
|
|
569
|
-
}}"></span>` :
|
|
568
|
+
n && t.addEventListener("pointerdown", L(e.key, n));
|
|
569
|
+
}}"></span>` : p``}
|
|
570
570
|
</div>
|
|
571
571
|
</th>`)}
|
|
572
|
-
${() =>
|
|
572
|
+
${() => C.value ? p`<th
|
|
573
573
|
class="dg-th dg-th-expand"
|
|
574
574
|
role="columnheader"
|
|
575
575
|
scope="col"
|
|
576
576
|
aria-label="Row details"
|
|
577
|
-
tabindex="-1"></th>` :
|
|
577
|
+
tabindex="-1"></th>` : p``}
|
|
578
578
|
</tr>
|
|
579
579
|
</thead>
|
|
580
580
|
|
|
581
581
|
<!-- Body -->
|
|
582
582
|
<tbody class="dg-body" part="tbody">
|
|
583
|
-
${() =>
|
|
583
|
+
${() => F.currentPageItems.value.length === 0 ? p`<tr role="row">
|
|
584
584
|
<td class="dg-empty" role="gridcell" :colspan="${() => String(H.value)}">
|
|
585
585
|
<div class="dg-empty-content">
|
|
586
586
|
${() => e.emptyText.value ?? "No data"}
|
|
587
|
-
${() =>
|
|
587
|
+
${() => k.searchQuery.value || k.filterValues.value.size ? p`<div class="dg-empty-actions">
|
|
588
588
|
<ore-button
|
|
589
589
|
variant="text"
|
|
590
590
|
size="sm"
|
|
591
591
|
@click="${() => {
|
|
592
|
-
|
|
592
|
+
k.resetSearch(), k.resetFilters();
|
|
593
593
|
}}">
|
|
594
594
|
Clear all filters & search
|
|
595
595
|
</ore-button>
|
|
596
|
-
</div>` :
|
|
596
|
+
</div>` : p``}
|
|
597
597
|
</div>
|
|
598
598
|
</td>
|
|
599
|
-
</tr>` :
|
|
600
|
-
let n =
|
|
601
|
-
return
|
|
599
|
+
</tr>` : F.currentPageItems.value.map((e, t) => {
|
|
600
|
+
let n = O(e), r = d.value !== "none" && !u.value, i = t + 1;
|
|
601
|
+
return p`<tr
|
|
602
602
|
class="dg-tr"
|
|
603
603
|
part="row"
|
|
604
604
|
role="row"
|
|
605
|
-
:aria-selected="${() =>
|
|
606
|
-
:aria-expanded="${() =>
|
|
605
|
+
:aria-selected="${() => d.value === "none" ? null : String(F.selectedKeys.value.has(n))}"
|
|
606
|
+
:aria-expanded="${() => C.value ? String(g.value.has(n)) : null}"
|
|
607
607
|
?data-selectable="${r}"
|
|
608
|
-
?data-disabled="${
|
|
608
|
+
?data-disabled="${u}"
|
|
609
609
|
@click="${() => {
|
|
610
|
-
r &&
|
|
610
|
+
r && d.value === "single" && F.toggleRow(n);
|
|
611
611
|
}}"
|
|
612
612
|
@keydown="${(e) => {
|
|
613
|
-
(e.key === "Enter" || e.key === " ") && r &&
|
|
613
|
+
(e.key === "Enter" || e.key === " ") && r && d.value === "single" && (e.preventDefault(), F.toggleRow(n));
|
|
614
614
|
}}">
|
|
615
|
-
${() =>
|
|
615
|
+
${() => d.value === "multi" ? p`<td
|
|
616
616
|
class="dg-td dg-td-check"
|
|
617
617
|
role="gridcell"
|
|
618
618
|
:tabindex="${() => {
|
|
@@ -620,35 +620,35 @@ f(w, {
|
|
|
620
620
|
return e.row === i && e.col === 0 ? "0" : "-1";
|
|
621
621
|
}}"
|
|
622
622
|
@keydown="${(e) => {
|
|
623
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(),
|
|
623
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), u.value || F.toggleRow(n));
|
|
624
624
|
}}">
|
|
625
625
|
<ore-checkbox
|
|
626
626
|
class="dg-check"
|
|
627
|
-
:checked="${() =>
|
|
628
|
-
?disabled="${
|
|
627
|
+
:checked="${() => F.selectedKeys.value.has(n)}"
|
|
628
|
+
?disabled="${u}"
|
|
629
629
|
aria-label="Select row"
|
|
630
630
|
tabindex="-1"
|
|
631
631
|
@click="${(e) => e.stopPropagation()}"
|
|
632
632
|
@change="${() => {
|
|
633
|
-
|
|
633
|
+
u.value || F.toggleRow(n);
|
|
634
634
|
}}"></ore-checkbox>
|
|
635
|
-
</td>` :
|
|
636
|
-
${
|
|
637
|
-
let r =
|
|
638
|
-
return
|
|
639
|
-
class="${`dg-td${n ===
|
|
635
|
+
</td>` : p``}
|
|
636
|
+
${R.value.map((t, n) => {
|
|
637
|
+
let r = z(t, e);
|
|
638
|
+
return p`<td
|
|
639
|
+
class="${`dg-td${n === R.value.length - 1 && C.value ? " dg-td-last" : ""}`}"
|
|
640
640
|
part="cell"
|
|
641
641
|
role="gridcell"
|
|
642
642
|
data-align="${t.align ?? "left"}"
|
|
643
643
|
:tabindex="${() => {
|
|
644
644
|
let e = $.activeCell.value;
|
|
645
|
-
return e.row === i && e.col === n +
|
|
645
|
+
return e.row === i && e.col === n + w.value ? "0" : "-1";
|
|
646
646
|
}}"
|
|
647
647
|
:title="${r}">
|
|
648
648
|
${r}
|
|
649
649
|
</td>`;
|
|
650
650
|
})}
|
|
651
|
-
${() =>
|
|
651
|
+
${() => C.value ? p`<td
|
|
652
652
|
class="dg-td dg-td-expand"
|
|
653
653
|
role="gridcell"
|
|
654
654
|
:tabindex="${() => {
|
|
@@ -656,7 +656,7 @@ f(w, {
|
|
|
656
656
|
return e.row === i && e.col === H.value - 1 ? "0" : "-1";
|
|
657
657
|
}}"
|
|
658
658
|
@keydown="${(e) => {
|
|
659
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(),
|
|
659
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), u.value || Q(n));
|
|
660
660
|
}}">
|
|
661
661
|
<ore-button
|
|
662
662
|
class="dg-expand-btn"
|
|
@@ -664,60 +664,60 @@ f(w, {
|
|
|
664
664
|
size="sm"
|
|
665
665
|
icon-only
|
|
666
666
|
tabindex="-1"
|
|
667
|
-
:label="${() =>
|
|
668
|
-
:aria-expanded="${() => String(
|
|
669
|
-
:disabled="${() =>
|
|
667
|
+
:label="${() => g.value.has(n) ? "Collapse row" : "Expand row"}"
|
|
668
|
+
:aria-expanded="${() => String(g.value.has(n))}"
|
|
669
|
+
:disabled="${() => u.value || void 0}"
|
|
670
670
|
@click="${(e) => {
|
|
671
|
-
e.stopPropagation(),
|
|
671
|
+
e.stopPropagation(), u.value || Q(n);
|
|
672
672
|
}}">
|
|
673
673
|
<ore-icon
|
|
674
|
-
:name="${() =>
|
|
674
|
+
:name="${() => g.value.has(n) ? "chevron-up" : "chevron-down"}"
|
|
675
675
|
size="14"
|
|
676
676
|
stroke-width="2"
|
|
677
677
|
aria-hidden="true"></ore-icon>
|
|
678
678
|
</ore-button>
|
|
679
|
-
</td>` :
|
|
679
|
+
</td>` : p``}
|
|
680
680
|
</tr>
|
|
681
|
-
${() =>
|
|
681
|
+
${() => C.value && g.value.has(n) ? p`<tr class="dg-tr-expanded" role="row">
|
|
682
682
|
<td
|
|
683
683
|
class="dg-td-expanded"
|
|
684
684
|
role="gridcell"
|
|
685
685
|
:colspan="${() => String(H.value)}">
|
|
686
|
-
${
|
|
686
|
+
${re(() => D.value.find((e) => typeof e.renderExpanded == "function")?.renderExpanded?.(e) ?? "")}
|
|
687
687
|
</td>
|
|
688
|
-
</tr>` :
|
|
688
|
+
</tr>` : p``} `;
|
|
689
689
|
})}
|
|
690
690
|
</tbody>
|
|
691
691
|
</table>
|
|
692
692
|
</div>
|
|
693
693
|
|
|
694
694
|
<!-- Footer / Pagination -->
|
|
695
|
-
${() => U.value ?
|
|
696
|
-
${() => (e.pageSizeOptions.value ?? []).length ?
|
|
695
|
+
${() => U.value ? p`<div class="dg-footer" part="footer" role="navigation" aria-label="Pagination">
|
|
696
|
+
${() => (e.pageSizeOptions.value ?? []).length ? p`` : p`<span class="dg-footer-info" dir="ltr" aria-live="polite" aria-atomic="true"
|
|
697
697
|
>${W}</span
|
|
698
698
|
>`}
|
|
699
699
|
<div class="dg-footer-end">
|
|
700
700
|
${() => {
|
|
701
701
|
let t = e.pageSizeOptions.value ?? [];
|
|
702
|
-
return t.length ?
|
|
702
|
+
return t.length ? p`<div class="dg-page-size-wrap">
|
|
703
703
|
<ore-select
|
|
704
704
|
class="dg-page-size-select"
|
|
705
705
|
fullwidth
|
|
706
706
|
aria-label="Rows per page"
|
|
707
|
-
:value="${() => String(
|
|
707
|
+
:value="${() => String(T.value)}"
|
|
708
708
|
:options="${() => t.map((e) => ({
|
|
709
709
|
label: String(e),
|
|
710
710
|
value: String(e)
|
|
711
711
|
}))}"
|
|
712
|
-
:disabled="${() =>
|
|
712
|
+
:disabled="${() => u.value || void 0}"
|
|
713
713
|
@change="${(e) => {
|
|
714
714
|
let t = parseInt(e.detail.values[0], 10);
|
|
715
|
-
isNaN(t) || (
|
|
715
|
+
isNaN(t) || (T.value = t, F.goToPage(0), r("page-change", {
|
|
716
716
|
pageIndex: 0,
|
|
717
717
|
pageSize: t
|
|
718
718
|
}));
|
|
719
719
|
}}"></ore-select>
|
|
720
|
-
</div>` :
|
|
720
|
+
</div>` : p``;
|
|
721
721
|
}}
|
|
722
722
|
<div class="dg-pagination" role="group" aria-label="Page navigation">
|
|
723
723
|
<ore-button
|
|
@@ -726,7 +726,7 @@ f(w, {
|
|
|
726
726
|
size="sm"
|
|
727
727
|
icon-only
|
|
728
728
|
label="Previous page"
|
|
729
|
-
:disabled="${() => !K.value ||
|
|
729
|
+
:disabled="${() => !K.value || u.value}"
|
|
730
730
|
@click="${() => B("prev")}">
|
|
731
731
|
<ore-icon name="chevron-left" size="14" stroke-width="2" aria-hidden="true"></ore-icon>
|
|
732
732
|
</ore-button>
|
|
@@ -745,19 +745,19 @@ f(w, {
|
|
|
745
745
|
size="sm"
|
|
746
746
|
icon-only
|
|
747
747
|
label="Next page"
|
|
748
|
-
:disabled="${() => !q.value ||
|
|
748
|
+
:disabled="${() => !q.value || u.value}"
|
|
749
749
|
@click="${() => B("next")}">
|
|
750
750
|
<ore-icon name="chevron-right" size="14" stroke-width="2" aria-hidden="true"></ore-icon>
|
|
751
751
|
</ore-button>
|
|
752
752
|
</div>
|
|
753
753
|
</div>
|
|
754
|
-
</div>` :
|
|
754
|
+
</div>` : p``}
|
|
755
755
|
`;
|
|
756
756
|
},
|
|
757
757
|
shadow: { delegatesFocus: !0 },
|
|
758
|
-
styles: [e("datagrid"),
|
|
758
|
+
styles: [e("datagrid"), u]
|
|
759
759
|
});
|
|
760
760
|
//#endregion
|
|
761
|
-
export { s as COLUMN_TAG,
|
|
761
|
+
export { s as COLUMN_TAG, C as DATAGRID_TAG, S as ariaSortValue, x as sortIconName };
|
|
762
762
|
|
|
763
763
|
//# sourceMappingURL=datagrid.js.map
|