vs-datatable 1.2.0 → 1.2.2
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/components/VsDataTable.vue.d.ts +8 -4
- package/dist/components/VsDataTableBody.vue.d.ts +4 -1
- package/dist/components/VsDataTableFooter.vue.d.ts +48 -0
- package/dist/components/VsDataTableHeader.vue.d.ts +37 -8
- package/dist/components/ui/HeaderCell.vue.d.ts +70 -0
- package/dist/composables/useDataTable.d.ts +15 -4
- package/dist/composables/useStickyColumns.d.ts +7 -0
- package/dist/composables/useStickyFooter.d.ts +11 -0
- package/dist/composables/useStickyHeader.d.ts +13 -0
- package/dist/composables/useStickyResizeSync.d.ts +5 -0
- package/dist/index.css +1 -1
- package/dist/types/datatable.d.ts +13 -1
- package/dist/utils/datatable.d.ts +6 -1
- package/dist/vs-datatable.es.js +2030 -1392
- package/dist/vs-datatable.umd.js +2 -2
- package/package.json +2 -3
- package/plugins/export/VsDataTableExportDropdown.vue +9 -8
- package/plugins/export/useDataTableExport.ts +2 -51
- package/src/styles/base.scss +237 -115
- package/plugins/export/shims-jspdf-autotable.d.ts +0 -1
- package/plugins/export/shims-jspdf.d.ts +0 -1
package/dist/vs-datatable.es.js
CHANGED
|
@@ -1,56 +1,63 @@
|
|
|
1
|
-
import { defineComponent as _, computed as
|
|
2
|
-
import './index.css';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
return t.some(
|
|
10
|
-
(o) => X(o, -1, n) === X(e, -1, n)
|
|
1
|
+
import { defineComponent as _, computed as F, createElementBlock as k, openBlock as y, createElementVNode as w, createCommentVNode as D, Fragment as K, renderList as Q, normalizeClass as G, toDisplayString as H, unref as $, mergeProps as Ae, renderSlot as z, ref as q, watch as Y, createVNode as ne, withModifiers as me, withCtx as X, withDirectives as te, vModelText as ve, nextTick as oe, onMounted as Re, onUnmounted as mt, createBlock as fe, Teleport as Dt, Transition as It, vModelSelect as Xe, normalizeStyle as pt, createSlots as Te, createTextVNode as Ye, onBeforeUnmount as He, isRef as Fe, shallowRef as gt, useAttrs as qt, onBeforeMount as Mt, normalizeProps as nt, guardReactiveProps as ot } from "vue";
|
|
2
|
+
import './index.css';const Bt = (e, n) => n ? n.split(".").reduce((t, o) => t && t[o], e) : "";
|
|
3
|
+
function re(e, n, t = "id") {
|
|
4
|
+
return typeof t == "function" ? t(e, n) : e[t] || n;
|
|
5
|
+
}
|
|
6
|
+
function yt(e, n, t = "id") {
|
|
7
|
+
return n.some(
|
|
8
|
+
(o) => re(o, -1, t) === re(e, -1, t)
|
|
11
9
|
);
|
|
12
10
|
}
|
|
13
|
-
function
|
|
14
|
-
|
|
11
|
+
function Ht(e, n, t) {
|
|
12
|
+
const o = (l) => l.reduce((a, r) => r.children && r.children.length > 0 ? a + o(r.children) : a + 1, 0);
|
|
13
|
+
return o(e) + (n ? 1 : 0) + (t ? 1 : 0);
|
|
15
14
|
}
|
|
16
|
-
function
|
|
17
|
-
if (!
|
|
18
|
-
const
|
|
15
|
+
function Wt(e, n) {
|
|
16
|
+
if (!n.length) return e;
|
|
17
|
+
const t = (o, s) => s.split(".").reduce((l, a) => l?.[a], o) ?? "";
|
|
19
18
|
return [...e].sort((o, s) => {
|
|
20
|
-
for (const { field: l, order: a } of
|
|
21
|
-
const r =
|
|
22
|
-
if (r !==
|
|
23
|
-
return a === "asc" ? r >
|
|
19
|
+
for (const { field: l, order: a } of n) {
|
|
20
|
+
const r = t(o, l), i = t(s, l);
|
|
21
|
+
if (r !== i)
|
|
22
|
+
return a === "asc" ? r > i ? 1 : -1 : r < i ? 1 : -1;
|
|
24
23
|
}
|
|
25
24
|
return 0;
|
|
26
25
|
});
|
|
27
26
|
}
|
|
28
|
-
function
|
|
29
|
-
if (!
|
|
30
|
-
const o = (
|
|
27
|
+
function Nt(e, n, t) {
|
|
28
|
+
if (!t) return e;
|
|
29
|
+
const o = (n - 1) * t, s = o + t;
|
|
31
30
|
return e.slice(o, s);
|
|
32
31
|
}
|
|
33
|
-
function
|
|
34
|
-
const o = (e - 1) *
|
|
32
|
+
function Kt(e, n, t) {
|
|
33
|
+
const o = (e - 1) * n + 1, s = Math.min(e * n, t);
|
|
35
34
|
return { start: o, end: s };
|
|
36
35
|
}
|
|
37
|
-
function
|
|
38
|
-
return Math.ceil(e /
|
|
36
|
+
function wt(e, n) {
|
|
37
|
+
return Math.ceil(e / n);
|
|
39
38
|
}
|
|
40
|
-
function
|
|
41
|
-
if (!
|
|
42
|
-
const o =
|
|
39
|
+
function st(e, n, t) {
|
|
40
|
+
if (!n || n.trim() === "") return e;
|
|
41
|
+
const o = n.toLowerCase();
|
|
43
42
|
return e.filter((s) => Object.values(s).some(
|
|
44
43
|
(l) => String(l ?? "").toLowerCase().includes(o)
|
|
45
44
|
));
|
|
46
45
|
}
|
|
47
|
-
|
|
46
|
+
function zt(e = []) {
|
|
47
|
+
const n = [], t = (o) => {
|
|
48
|
+
o.forEach((s) => {
|
|
49
|
+
Array.isArray(s.children) && s.children.length ? t(s.children) : n.push(s);
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
return t(e), n;
|
|
53
|
+
}
|
|
54
|
+
const jt = ["id"], Ut = ["disabled"], Zt = {
|
|
48
55
|
key: 1,
|
|
49
56
|
class: "vs-pagination-ellipsis"
|
|
50
|
-
},
|
|
57
|
+
}, Xt = ["id", "onClick"], Qt = {
|
|
51
58
|
key: 2,
|
|
52
59
|
class: "vs-pagination-ellipsis"
|
|
53
|
-
},
|
|
60
|
+
}, Yt = ["disabled"], Gt = /* @__PURE__ */ _({
|
|
54
61
|
__name: "VsPagination",
|
|
55
62
|
props: {
|
|
56
63
|
modelValue: {},
|
|
@@ -61,169 +68,169 @@ const Dt = ["id"], Lt = ["disabled"], Ft = {
|
|
|
61
68
|
paginationClass: {}
|
|
62
69
|
},
|
|
63
70
|
emits: ["update:modelValue", "pageChanged"],
|
|
64
|
-
setup(e, { emit:
|
|
65
|
-
const
|
|
66
|
-
get: () =>
|
|
67
|
-
set: (
|
|
68
|
-
o("update:modelValue",
|
|
71
|
+
setup(e, { emit: n }) {
|
|
72
|
+
const t = e, o = n, s = t.maxVisible ?? 3, l = F({
|
|
73
|
+
get: () => t.modelValue,
|
|
74
|
+
set: (f) => {
|
|
75
|
+
o("update:modelValue", f), o("pageChanged", f);
|
|
69
76
|
}
|
|
70
|
-
}), a =
|
|
71
|
-
const
|
|
72
|
-
for (let
|
|
73
|
-
|
|
74
|
-
return
|
|
75
|
-
}),
|
|
76
|
-
|
|
77
|
-
},
|
|
77
|
+
}), a = F(() => l.value <= Math.floor(s / 2) ? 1 : l.value >= i.value - Math.floor(s / 2) ? Math.max(i.value - s + 1, 1) : l.value - Math.floor(s / 2)), r = F(() => Math.min(a.value + s - 1, i.value)), i = F(() => wt(t.totalRecords, t.rowsPerPage)), c = F(() => {
|
|
78
|
+
const f = [];
|
|
79
|
+
for (let u = a.value; u <= r.value; u++)
|
|
80
|
+
f.push(u);
|
|
81
|
+
return f;
|
|
82
|
+
}), d = (f) => {
|
|
83
|
+
f >= 1 && f <= i.value && (l.value = f);
|
|
84
|
+
}, v = () => {
|
|
78
85
|
l.value > 1 && l.value--;
|
|
79
|
-
},
|
|
80
|
-
l.value <
|
|
86
|
+
}, m = () => {
|
|
87
|
+
l.value < i.value && l.value++;
|
|
81
88
|
};
|
|
82
|
-
return (
|
|
89
|
+
return (f, u) => (y(), k("div", {
|
|
83
90
|
class: "vs-pagination",
|
|
84
91
|
id: e.tablename + "-pagination"
|
|
85
92
|
}, [
|
|
86
|
-
|
|
87
|
-
onClick:
|
|
93
|
+
w("button", {
|
|
94
|
+
onClick: v,
|
|
88
95
|
type: "button",
|
|
89
96
|
class: "vs-pagination-button vs-pagination-nav",
|
|
90
97
|
disabled: l.value === 1
|
|
91
|
-
}, " ‹‹ ", 8,
|
|
92
|
-
a.value > 1 ? (
|
|
98
|
+
}, " ‹‹ ", 8, Ut),
|
|
99
|
+
a.value > 1 ? (y(), k("button", {
|
|
93
100
|
key: 0,
|
|
94
101
|
type: "button",
|
|
95
102
|
class: "vs-pagination-button",
|
|
96
|
-
onClick:
|
|
97
|
-
}, " 1 ")) :
|
|
98
|
-
a.value > 2 ? (
|
|
99
|
-
(
|
|
100
|
-
key:
|
|
103
|
+
onClick: u[0] || (u[0] = (h) => d(1))
|
|
104
|
+
}, " 1 ")) : D("", !0),
|
|
105
|
+
a.value > 2 ? (y(), k("span", Zt, "...")) : D("", !0),
|
|
106
|
+
(y(!0), k(K, null, Q(c.value, (h) => (y(), k("button", {
|
|
107
|
+
key: h,
|
|
101
108
|
type: "button",
|
|
102
|
-
class:
|
|
109
|
+
class: G([
|
|
103
110
|
"vs-pagination-button",
|
|
104
|
-
{ "vs-active": l.value ===
|
|
111
|
+
{ "vs-active": l.value === h }
|
|
105
112
|
]),
|
|
106
|
-
id: e.tablename + "-page-" +
|
|
107
|
-
onClick: (
|
|
108
|
-
},
|
|
109
|
-
r.value <
|
|
110
|
-
r.value <
|
|
113
|
+
id: e.tablename + "-page-" + h,
|
|
114
|
+
onClick: (g) => d(h)
|
|
115
|
+
}, H(h), 11, Xt))), 128)),
|
|
116
|
+
r.value < i.value - 1 ? (y(), k("span", Qt, "...")) : D("", !0),
|
|
117
|
+
r.value < i.value ? (y(), k("button", {
|
|
111
118
|
key: 3,
|
|
112
119
|
type: "button",
|
|
113
120
|
class: "vs-pagination-button",
|
|
114
|
-
onClick:
|
|
115
|
-
},
|
|
116
|
-
|
|
117
|
-
onClick:
|
|
121
|
+
onClick: u[1] || (u[1] = (h) => d(i.value))
|
|
122
|
+
}, H(i.value), 1)) : D("", !0),
|
|
123
|
+
w("button", {
|
|
124
|
+
onClick: m,
|
|
118
125
|
type: "button",
|
|
119
126
|
class: "vs-pagination-button vs-pagination-nav",
|
|
120
|
-
disabled: l.value ===
|
|
121
|
-
}, " ›› ", 8,
|
|
122
|
-
], 8,
|
|
127
|
+
disabled: l.value === i.value
|
|
128
|
+
}, " ›› ", 8, Yt)
|
|
129
|
+
], 8, jt));
|
|
123
130
|
}
|
|
124
|
-
}),
|
|
125
|
-
const
|
|
126
|
-
for (const [o, s] of
|
|
127
|
-
|
|
128
|
-
return
|
|
129
|
-
},
|
|
131
|
+
}), ae = (e, n) => {
|
|
132
|
+
const t = e.__vccOpts || e;
|
|
133
|
+
for (const [o, s] of n)
|
|
134
|
+
t[o] = s;
|
|
135
|
+
return t;
|
|
136
|
+
}, Jt = /* @__PURE__ */ ae(Gt, [["__scopeId", "data-v-b327b254"]]), _t = { class: "vs-rows-per-page" }, en = ["value"], tn = ["value"], nn = /* @__PURE__ */ _({
|
|
130
137
|
__name: "VsRowsPerPage",
|
|
131
138
|
props: {
|
|
132
139
|
modelValue: {},
|
|
133
140
|
options: {}
|
|
134
141
|
},
|
|
135
142
|
emits: ["update:modelValue", "rowsPerPageChanged"],
|
|
136
|
-
setup(e, { emit:
|
|
137
|
-
const
|
|
143
|
+
setup(e, { emit: n }) {
|
|
144
|
+
const t = e, o = n, s = t.options ?? [10, 25, 50, 100], l = (a) => {
|
|
138
145
|
const r = Number(a.target.value);
|
|
139
146
|
o("update:modelValue", r), o("rowsPerPageChanged", r);
|
|
140
147
|
};
|
|
141
|
-
return (a, r) => (
|
|
142
|
-
r[0] || (r[0] =
|
|
143
|
-
|
|
148
|
+
return (a, r) => (y(), k("div", _t, [
|
|
149
|
+
r[0] || (r[0] = w("span", { class: "vs-rows-label" }, "Items Per Page", -1)),
|
|
150
|
+
w("select", {
|
|
144
151
|
class: "vs-items-dropdown",
|
|
145
152
|
value: e.modelValue,
|
|
146
153
|
onChange: l
|
|
147
154
|
}, [
|
|
148
|
-
(
|
|
149
|
-
key:
|
|
150
|
-
value:
|
|
151
|
-
},
|
|
152
|
-
], 40,
|
|
155
|
+
(y(!0), k(K, null, Q($(s), (i) => (y(), k("option", {
|
|
156
|
+
key: i,
|
|
157
|
+
value: i
|
|
158
|
+
}, H(i), 9, tn))), 128))
|
|
159
|
+
], 40, en)
|
|
153
160
|
]));
|
|
154
161
|
}
|
|
155
|
-
}),
|
|
162
|
+
}), on = /* @__PURE__ */ ae(nn, [["__scopeId", "data-v-0c2bdd9c"]]), De = Math.min, we = Math.max, Ie = Math.round, Le = Math.floor, ie = (e) => ({
|
|
156
163
|
x: e,
|
|
157
164
|
y: e
|
|
158
|
-
}),
|
|
165
|
+
}), sn = {
|
|
159
166
|
left: "right",
|
|
160
167
|
right: "left",
|
|
161
168
|
bottom: "top",
|
|
162
169
|
top: "bottom"
|
|
163
|
-
},
|
|
170
|
+
}, ln = {
|
|
164
171
|
start: "end",
|
|
165
172
|
end: "start"
|
|
166
173
|
};
|
|
167
|
-
function
|
|
168
|
-
return
|
|
174
|
+
function lt(e, n, t) {
|
|
175
|
+
return we(e, De(n, t));
|
|
169
176
|
}
|
|
170
|
-
function
|
|
171
|
-
return typeof e == "function" ? e(
|
|
177
|
+
function We(e, n) {
|
|
178
|
+
return typeof e == "function" ? e(n) : e;
|
|
172
179
|
}
|
|
173
|
-
function
|
|
180
|
+
function be(e) {
|
|
174
181
|
return e.split("-")[0];
|
|
175
182
|
}
|
|
176
|
-
function
|
|
183
|
+
function Ne(e) {
|
|
177
184
|
return e.split("-")[1];
|
|
178
185
|
}
|
|
179
|
-
function
|
|
186
|
+
function bt(e) {
|
|
180
187
|
return e === "x" ? "y" : "x";
|
|
181
188
|
}
|
|
182
|
-
function
|
|
189
|
+
function xt(e) {
|
|
183
190
|
return e === "y" ? "height" : "width";
|
|
184
191
|
}
|
|
185
|
-
const
|
|
186
|
-
function
|
|
187
|
-
return
|
|
192
|
+
const an = /* @__PURE__ */ new Set(["top", "bottom"]);
|
|
193
|
+
function he(e) {
|
|
194
|
+
return an.has(be(e)) ? "y" : "x";
|
|
188
195
|
}
|
|
189
|
-
function
|
|
190
|
-
return
|
|
196
|
+
function kt(e) {
|
|
197
|
+
return bt(he(e));
|
|
191
198
|
}
|
|
192
|
-
function
|
|
193
|
-
|
|
194
|
-
const o =
|
|
195
|
-
let a = s === "x" ? o === (
|
|
196
|
-
return
|
|
199
|
+
function rn(e, n, t) {
|
|
200
|
+
t === void 0 && (t = !1);
|
|
201
|
+
const o = Ne(e), s = kt(e), l = xt(s);
|
|
202
|
+
let a = s === "x" ? o === (t ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
|
|
203
|
+
return n.reference[l] > n.floating[l] && (a = qe(a)), [a, qe(a)];
|
|
197
204
|
}
|
|
198
|
-
function
|
|
199
|
-
const
|
|
200
|
-
return [
|
|
205
|
+
function cn(e) {
|
|
206
|
+
const n = qe(e);
|
|
207
|
+
return [Ge(e), n, Ge(n)];
|
|
201
208
|
}
|
|
202
|
-
function
|
|
203
|
-
return e.replace(/start|end/g, (
|
|
209
|
+
function Ge(e) {
|
|
210
|
+
return e.replace(/start|end/g, (n) => ln[n]);
|
|
204
211
|
}
|
|
205
|
-
const
|
|
206
|
-
function
|
|
212
|
+
const at = ["left", "right"], rt = ["right", "left"], un = ["top", "bottom"], dn = ["bottom", "top"];
|
|
213
|
+
function fn(e, n, t) {
|
|
207
214
|
switch (e) {
|
|
208
215
|
case "top":
|
|
209
216
|
case "bottom":
|
|
210
|
-
return
|
|
217
|
+
return t ? n ? rt : at : n ? at : rt;
|
|
211
218
|
case "left":
|
|
212
219
|
case "right":
|
|
213
|
-
return
|
|
220
|
+
return n ? un : dn;
|
|
214
221
|
default:
|
|
215
222
|
return [];
|
|
216
223
|
}
|
|
217
224
|
}
|
|
218
|
-
function
|
|
219
|
-
const s =
|
|
220
|
-
let l =
|
|
221
|
-
return s && (l = l.map((a) => a + "-" + s),
|
|
225
|
+
function vn(e, n, t, o) {
|
|
226
|
+
const s = Ne(e);
|
|
227
|
+
let l = fn(be(e), t === "start", o);
|
|
228
|
+
return s && (l = l.map((a) => a + "-" + s), n && (l = l.concat(l.map(Ge)))), l;
|
|
222
229
|
}
|
|
223
|
-
function
|
|
224
|
-
return e.replace(/left|right|bottom|top/g, (
|
|
230
|
+
function qe(e) {
|
|
231
|
+
return e.replace(/left|right|bottom|top/g, (n) => sn[n]);
|
|
225
232
|
}
|
|
226
|
-
function
|
|
233
|
+
function hn(e) {
|
|
227
234
|
return {
|
|
228
235
|
top: 0,
|
|
229
236
|
right: 0,
|
|
@@ -232,452 +239,452 @@ function tn(e) {
|
|
|
232
239
|
...e
|
|
233
240
|
};
|
|
234
241
|
}
|
|
235
|
-
function
|
|
236
|
-
return typeof e != "number" ?
|
|
242
|
+
function mn(e) {
|
|
243
|
+
return typeof e != "number" ? hn(e) : {
|
|
237
244
|
top: e,
|
|
238
245
|
right: e,
|
|
239
246
|
bottom: e,
|
|
240
247
|
left: e
|
|
241
248
|
};
|
|
242
249
|
}
|
|
243
|
-
function
|
|
250
|
+
function Me(e) {
|
|
244
251
|
const {
|
|
245
|
-
x:
|
|
246
|
-
y:
|
|
252
|
+
x: n,
|
|
253
|
+
y: t,
|
|
247
254
|
width: o,
|
|
248
255
|
height: s
|
|
249
256
|
} = e;
|
|
250
257
|
return {
|
|
251
258
|
width: o,
|
|
252
259
|
height: s,
|
|
253
|
-
top:
|
|
254
|
-
left:
|
|
255
|
-
right:
|
|
256
|
-
bottom:
|
|
257
|
-
x:
|
|
258
|
-
y:
|
|
260
|
+
top: t,
|
|
261
|
+
left: n,
|
|
262
|
+
right: n + o,
|
|
263
|
+
bottom: t + s,
|
|
264
|
+
x: n,
|
|
265
|
+
y: t
|
|
259
266
|
};
|
|
260
267
|
}
|
|
261
|
-
function
|
|
268
|
+
function it(e, n, t) {
|
|
262
269
|
let {
|
|
263
270
|
reference: o,
|
|
264
271
|
floating: s
|
|
265
272
|
} = e;
|
|
266
|
-
const l =
|
|
267
|
-
let
|
|
268
|
-
switch (
|
|
273
|
+
const l = he(n), a = kt(n), r = xt(a), i = be(n), c = l === "y", d = o.x + o.width / 2 - s.width / 2, v = o.y + o.height / 2 - s.height / 2, m = o[r] / 2 - s[r] / 2;
|
|
274
|
+
let f;
|
|
275
|
+
switch (i) {
|
|
269
276
|
case "top":
|
|
270
|
-
|
|
271
|
-
x:
|
|
277
|
+
f = {
|
|
278
|
+
x: d,
|
|
272
279
|
y: o.y - s.height
|
|
273
280
|
};
|
|
274
281
|
break;
|
|
275
282
|
case "bottom":
|
|
276
|
-
|
|
277
|
-
x:
|
|
283
|
+
f = {
|
|
284
|
+
x: d,
|
|
278
285
|
y: o.y + o.height
|
|
279
286
|
};
|
|
280
287
|
break;
|
|
281
288
|
case "right":
|
|
282
|
-
|
|
289
|
+
f = {
|
|
283
290
|
x: o.x + o.width,
|
|
284
|
-
y:
|
|
291
|
+
y: v
|
|
285
292
|
};
|
|
286
293
|
break;
|
|
287
294
|
case "left":
|
|
288
|
-
|
|
295
|
+
f = {
|
|
289
296
|
x: o.x - s.width,
|
|
290
|
-
y:
|
|
297
|
+
y: v
|
|
291
298
|
};
|
|
292
299
|
break;
|
|
293
300
|
default:
|
|
294
|
-
|
|
301
|
+
f = {
|
|
295
302
|
x: o.x,
|
|
296
303
|
y: o.y
|
|
297
304
|
};
|
|
298
305
|
}
|
|
299
|
-
switch (
|
|
306
|
+
switch (Ne(n)) {
|
|
300
307
|
case "start":
|
|
301
|
-
|
|
308
|
+
f[a] -= m * (t && c ? -1 : 1);
|
|
302
309
|
break;
|
|
303
310
|
case "end":
|
|
304
|
-
|
|
311
|
+
f[a] += m * (t && c ? -1 : 1);
|
|
305
312
|
break;
|
|
306
313
|
}
|
|
307
|
-
return
|
|
314
|
+
return f;
|
|
308
315
|
}
|
|
309
|
-
const
|
|
316
|
+
const pn = async (e, n, t) => {
|
|
310
317
|
const {
|
|
311
318
|
placement: o = "bottom",
|
|
312
319
|
strategy: s = "absolute",
|
|
313
320
|
middleware: l = [],
|
|
314
321
|
platform: a
|
|
315
|
-
} =
|
|
322
|
+
} = t, r = l.filter(Boolean), i = await (a.isRTL == null ? void 0 : a.isRTL(n));
|
|
316
323
|
let c = await a.getElementRects({
|
|
317
324
|
reference: e,
|
|
318
|
-
floating:
|
|
325
|
+
floating: n,
|
|
319
326
|
strategy: s
|
|
320
327
|
}), {
|
|
321
|
-
x:
|
|
322
|
-
y:
|
|
323
|
-
} =
|
|
324
|
-
for (let
|
|
328
|
+
x: d,
|
|
329
|
+
y: v
|
|
330
|
+
} = it(c, o, i), m = o, f = {}, u = 0;
|
|
331
|
+
for (let h = 0; h < r.length; h++) {
|
|
325
332
|
const {
|
|
326
|
-
name:
|
|
333
|
+
name: g,
|
|
327
334
|
fn: C
|
|
328
|
-
} = r[
|
|
329
|
-
x:
|
|
330
|
-
y:
|
|
331
|
-
data:
|
|
332
|
-
reset:
|
|
335
|
+
} = r[h], {
|
|
336
|
+
x: S,
|
|
337
|
+
y: E,
|
|
338
|
+
data: L,
|
|
339
|
+
reset: P
|
|
333
340
|
} = await C({
|
|
334
|
-
x:
|
|
335
|
-
y:
|
|
341
|
+
x: d,
|
|
342
|
+
y: v,
|
|
336
343
|
initialPlacement: o,
|
|
337
|
-
placement:
|
|
344
|
+
placement: m,
|
|
338
345
|
strategy: s,
|
|
339
|
-
middlewareData:
|
|
346
|
+
middlewareData: f,
|
|
340
347
|
rects: c,
|
|
341
348
|
platform: a,
|
|
342
349
|
elements: {
|
|
343
350
|
reference: e,
|
|
344
|
-
floating:
|
|
351
|
+
floating: n
|
|
345
352
|
}
|
|
346
353
|
});
|
|
347
|
-
|
|
348
|
-
...
|
|
349
|
-
[
|
|
350
|
-
...
|
|
351
|
-
...
|
|
354
|
+
d = S ?? d, v = E ?? v, f = {
|
|
355
|
+
...f,
|
|
356
|
+
[g]: {
|
|
357
|
+
...f[g],
|
|
358
|
+
...L
|
|
352
359
|
}
|
|
353
|
-
},
|
|
360
|
+
}, P && u <= 50 && (u++, typeof P == "object" && (P.placement && (m = P.placement), P.rects && (c = P.rects === !0 ? await a.getElementRects({
|
|
354
361
|
reference: e,
|
|
355
|
-
floating:
|
|
362
|
+
floating: n,
|
|
356
363
|
strategy: s
|
|
357
|
-
}) :
|
|
358
|
-
x:
|
|
359
|
-
y:
|
|
360
|
-
} =
|
|
364
|
+
}) : P.rects), {
|
|
365
|
+
x: d,
|
|
366
|
+
y: v
|
|
367
|
+
} = it(c, m, i)), h = -1);
|
|
361
368
|
}
|
|
362
369
|
return {
|
|
363
|
-
x:
|
|
364
|
-
y:
|
|
365
|
-
placement:
|
|
370
|
+
x: d,
|
|
371
|
+
y: v,
|
|
372
|
+
placement: m,
|
|
366
373
|
strategy: s,
|
|
367
|
-
middlewareData:
|
|
374
|
+
middlewareData: f
|
|
368
375
|
};
|
|
369
376
|
};
|
|
370
|
-
async function
|
|
371
|
-
var
|
|
372
|
-
|
|
377
|
+
async function Ct(e, n) {
|
|
378
|
+
var t;
|
|
379
|
+
n === void 0 && (n = {});
|
|
373
380
|
const {
|
|
374
381
|
x: o,
|
|
375
382
|
y: s,
|
|
376
383
|
platform: l,
|
|
377
384
|
rects: a,
|
|
378
385
|
elements: r,
|
|
379
|
-
strategy:
|
|
386
|
+
strategy: i
|
|
380
387
|
} = e, {
|
|
381
388
|
boundary: c = "clippingAncestors",
|
|
382
|
-
rootBoundary:
|
|
383
|
-
elementContext:
|
|
384
|
-
altBoundary:
|
|
385
|
-
padding:
|
|
386
|
-
} =
|
|
387
|
-
element: (
|
|
389
|
+
rootBoundary: d = "viewport",
|
|
390
|
+
elementContext: v = "floating",
|
|
391
|
+
altBoundary: m = !1,
|
|
392
|
+
padding: f = 0
|
|
393
|
+
} = We(n, e), u = mn(f), g = r[m ? v === "floating" ? "reference" : "floating" : v], C = Me(await l.getClippingRect({
|
|
394
|
+
element: (t = await (l.isElement == null ? void 0 : l.isElement(g))) == null || t ? g : g.contextElement || await (l.getDocumentElement == null ? void 0 : l.getDocumentElement(r.floating)),
|
|
388
395
|
boundary: c,
|
|
389
|
-
rootBoundary:
|
|
390
|
-
strategy:
|
|
391
|
-
})),
|
|
396
|
+
rootBoundary: d,
|
|
397
|
+
strategy: i
|
|
398
|
+
})), S = v === "floating" ? {
|
|
392
399
|
x: o,
|
|
393
400
|
y: s,
|
|
394
401
|
width: a.floating.width,
|
|
395
402
|
height: a.floating.height
|
|
396
|
-
} : a.reference,
|
|
403
|
+
} : a.reference, E = await (l.getOffsetParent == null ? void 0 : l.getOffsetParent(r.floating)), L = await (l.isElement == null ? void 0 : l.isElement(E)) ? await (l.getScale == null ? void 0 : l.getScale(E)) || {
|
|
397
404
|
x: 1,
|
|
398
405
|
y: 1
|
|
399
406
|
} : {
|
|
400
407
|
x: 1,
|
|
401
408
|
y: 1
|
|
402
|
-
},
|
|
409
|
+
}, P = Me(l.convertOffsetParentRelativeRectToViewportRelativeRect ? await l.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
403
410
|
elements: r,
|
|
404
|
-
rect:
|
|
405
|
-
offsetParent:
|
|
406
|
-
strategy:
|
|
407
|
-
}) :
|
|
411
|
+
rect: S,
|
|
412
|
+
offsetParent: E,
|
|
413
|
+
strategy: i
|
|
414
|
+
}) : S);
|
|
408
415
|
return {
|
|
409
|
-
top: (C.top -
|
|
410
|
-
bottom: (
|
|
411
|
-
left: (C.left -
|
|
412
|
-
right: (
|
|
416
|
+
top: (C.top - P.top + u.top) / L.y,
|
|
417
|
+
bottom: (P.bottom - C.bottom + u.bottom) / L.y,
|
|
418
|
+
left: (C.left - P.left + u.left) / L.x,
|
|
419
|
+
right: (P.right - C.right + u.right) / L.x
|
|
413
420
|
};
|
|
414
421
|
}
|
|
415
|
-
const
|
|
422
|
+
const gn = function(e) {
|
|
416
423
|
return e === void 0 && (e = {}), {
|
|
417
424
|
name: "flip",
|
|
418
425
|
options: e,
|
|
419
|
-
async fn(
|
|
420
|
-
var
|
|
426
|
+
async fn(n) {
|
|
427
|
+
var t, o;
|
|
421
428
|
const {
|
|
422
429
|
placement: s,
|
|
423
430
|
middlewareData: l,
|
|
424
431
|
rects: a,
|
|
425
432
|
initialPlacement: r,
|
|
426
|
-
platform:
|
|
433
|
+
platform: i,
|
|
427
434
|
elements: c
|
|
428
|
-
} =
|
|
429
|
-
mainAxis:
|
|
430
|
-
crossAxis:
|
|
431
|
-
fallbackPlacements:
|
|
432
|
-
fallbackStrategy:
|
|
433
|
-
fallbackAxisSideDirection:
|
|
434
|
-
flipAlignment:
|
|
435
|
-
...
|
|
436
|
-
} =
|
|
437
|
-
if ((
|
|
435
|
+
} = n, {
|
|
436
|
+
mainAxis: d = !0,
|
|
437
|
+
crossAxis: v = !0,
|
|
438
|
+
fallbackPlacements: m,
|
|
439
|
+
fallbackStrategy: f = "bestFit",
|
|
440
|
+
fallbackAxisSideDirection: u = "none",
|
|
441
|
+
flipAlignment: h = !0,
|
|
442
|
+
...g
|
|
443
|
+
} = We(e, n);
|
|
444
|
+
if ((t = l.arrow) != null && t.alignmentOffset)
|
|
438
445
|
return {};
|
|
439
|
-
const C =
|
|
440
|
-
!
|
|
441
|
-
const
|
|
442
|
-
let
|
|
443
|
-
if (
|
|
444
|
-
const
|
|
445
|
-
|
|
446
|
+
const C = be(s), S = he(r), E = be(r) === r, L = await (i.isRTL == null ? void 0 : i.isRTL(c.floating)), P = m || (E || !h ? [qe(r)] : cn(r)), B = u !== "none";
|
|
447
|
+
!m && B && P.push(...vn(r, h, u, L));
|
|
448
|
+
const b = [r, ...P], p = await Ct(n, g), x = [];
|
|
449
|
+
let R = ((o = l.flip) == null ? void 0 : o.overflows) || [];
|
|
450
|
+
if (d && x.push(p[C]), v) {
|
|
451
|
+
const O = rn(s, a, L);
|
|
452
|
+
x.push(p[O[0]], p[O[1]]);
|
|
446
453
|
}
|
|
447
|
-
if (
|
|
454
|
+
if (R = [...R, {
|
|
448
455
|
placement: s,
|
|
449
|
-
overflows:
|
|
450
|
-
}], !
|
|
451
|
-
var
|
|
452
|
-
const
|
|
453
|
-
if (
|
|
456
|
+
overflows: x
|
|
457
|
+
}], !x.every((O) => O <= 0)) {
|
|
458
|
+
var T, M;
|
|
459
|
+
const O = (((T = l.flip) == null ? void 0 : T.index) || 0) + 1, N = b[O];
|
|
460
|
+
if (N && (!(v === "alignment" ? S !== he(N) : !1) || // We leave the current main axis only if every placement on that axis
|
|
454
461
|
// overflows the main axis.
|
|
455
|
-
|
|
462
|
+
R.every((V) => he(V.placement) === S ? V.overflows[0] > 0 : !0)))
|
|
456
463
|
return {
|
|
457
464
|
data: {
|
|
458
|
-
index:
|
|
459
|
-
overflows:
|
|
465
|
+
index: O,
|
|
466
|
+
overflows: R
|
|
460
467
|
},
|
|
461
468
|
reset: {
|
|
462
|
-
placement:
|
|
469
|
+
placement: N
|
|
463
470
|
}
|
|
464
471
|
};
|
|
465
|
-
let
|
|
466
|
-
if (!
|
|
467
|
-
switch (
|
|
472
|
+
let I = (M = R.filter((W) => W.overflows[0] <= 0).sort((W, V) => W.overflows[1] - V.overflows[1])[0]) == null ? void 0 : M.placement;
|
|
473
|
+
if (!I)
|
|
474
|
+
switch (f) {
|
|
468
475
|
case "bestFit": {
|
|
469
|
-
var
|
|
470
|
-
const
|
|
471
|
-
if (
|
|
472
|
-
const
|
|
473
|
-
return
|
|
476
|
+
var A;
|
|
477
|
+
const W = (A = R.filter((V) => {
|
|
478
|
+
if (B) {
|
|
479
|
+
const U = he(V.placement);
|
|
480
|
+
return U === S || // Create a bias to the `y` side axis due to horizontal
|
|
474
481
|
// reading directions favoring greater width.
|
|
475
|
-
|
|
482
|
+
U === "y";
|
|
476
483
|
}
|
|
477
484
|
return !0;
|
|
478
|
-
}).map((V) => [V.placement, V.overflows.filter((
|
|
479
|
-
|
|
485
|
+
}).map((V) => [V.placement, V.overflows.filter((U) => U > 0).reduce((U, ge) => U + ge, 0)]).sort((V, U) => V[1] - U[1])[0]) == null ? void 0 : A[0];
|
|
486
|
+
W && (I = W);
|
|
480
487
|
break;
|
|
481
488
|
}
|
|
482
489
|
case "initialPlacement":
|
|
483
|
-
|
|
490
|
+
I = r;
|
|
484
491
|
break;
|
|
485
492
|
}
|
|
486
|
-
if (s !==
|
|
493
|
+
if (s !== I)
|
|
487
494
|
return {
|
|
488
495
|
reset: {
|
|
489
|
-
placement:
|
|
496
|
+
placement: I
|
|
490
497
|
}
|
|
491
498
|
};
|
|
492
499
|
}
|
|
493
500
|
return {};
|
|
494
501
|
}
|
|
495
502
|
};
|
|
496
|
-
},
|
|
497
|
-
async function
|
|
503
|
+
}, yn = /* @__PURE__ */ new Set(["left", "top"]);
|
|
504
|
+
async function wn(e, n) {
|
|
498
505
|
const {
|
|
499
|
-
placement:
|
|
506
|
+
placement: t,
|
|
500
507
|
platform: o,
|
|
501
508
|
elements: s
|
|
502
|
-
} = e, l = await (o.isRTL == null ? void 0 : o.isRTL(s.floating)), a =
|
|
509
|
+
} = e, l = await (o.isRTL == null ? void 0 : o.isRTL(s.floating)), a = be(t), r = Ne(t), i = he(t) === "y", c = yn.has(a) ? -1 : 1, d = l && i ? -1 : 1, v = We(n, e);
|
|
503
510
|
let {
|
|
504
|
-
mainAxis:
|
|
505
|
-
crossAxis:
|
|
506
|
-
alignmentAxis:
|
|
507
|
-
} = typeof
|
|
508
|
-
mainAxis:
|
|
511
|
+
mainAxis: m,
|
|
512
|
+
crossAxis: f,
|
|
513
|
+
alignmentAxis: u
|
|
514
|
+
} = typeof v == "number" ? {
|
|
515
|
+
mainAxis: v,
|
|
509
516
|
crossAxis: 0,
|
|
510
517
|
alignmentAxis: null
|
|
511
518
|
} : {
|
|
512
|
-
mainAxis:
|
|
513
|
-
crossAxis:
|
|
514
|
-
alignmentAxis:
|
|
519
|
+
mainAxis: v.mainAxis || 0,
|
|
520
|
+
crossAxis: v.crossAxis || 0,
|
|
521
|
+
alignmentAxis: v.alignmentAxis
|
|
515
522
|
};
|
|
516
|
-
return r && typeof
|
|
517
|
-
x:
|
|
518
|
-
y:
|
|
523
|
+
return r && typeof u == "number" && (f = r === "end" ? u * -1 : u), i ? {
|
|
524
|
+
x: f * d,
|
|
525
|
+
y: m * c
|
|
519
526
|
} : {
|
|
520
|
-
x:
|
|
521
|
-
y:
|
|
527
|
+
x: m * c,
|
|
528
|
+
y: f * d
|
|
522
529
|
};
|
|
523
530
|
}
|
|
524
|
-
const
|
|
531
|
+
const bn = function(e) {
|
|
525
532
|
return e === void 0 && (e = 0), {
|
|
526
533
|
name: "offset",
|
|
527
534
|
options: e,
|
|
528
|
-
async fn(
|
|
529
|
-
var
|
|
535
|
+
async fn(n) {
|
|
536
|
+
var t, o;
|
|
530
537
|
const {
|
|
531
538
|
x: s,
|
|
532
539
|
y: l,
|
|
533
540
|
placement: a,
|
|
534
541
|
middlewareData: r
|
|
535
|
-
} =
|
|
536
|
-
return a === ((
|
|
537
|
-
x: s +
|
|
538
|
-
y: l +
|
|
542
|
+
} = n, i = await wn(n, e);
|
|
543
|
+
return a === ((t = r.offset) == null ? void 0 : t.placement) && (o = r.arrow) != null && o.alignmentOffset ? {} : {
|
|
544
|
+
x: s + i.x,
|
|
545
|
+
y: l + i.y,
|
|
539
546
|
data: {
|
|
540
|
-
...
|
|
547
|
+
...i,
|
|
541
548
|
placement: a
|
|
542
549
|
}
|
|
543
550
|
};
|
|
544
551
|
}
|
|
545
552
|
};
|
|
546
|
-
},
|
|
553
|
+
}, xn = function(e) {
|
|
547
554
|
return e === void 0 && (e = {}), {
|
|
548
555
|
name: "shift",
|
|
549
556
|
options: e,
|
|
550
|
-
async fn(
|
|
557
|
+
async fn(n) {
|
|
551
558
|
const {
|
|
552
|
-
x:
|
|
559
|
+
x: t,
|
|
553
560
|
y: o,
|
|
554
561
|
placement: s
|
|
555
|
-
} =
|
|
562
|
+
} = n, {
|
|
556
563
|
mainAxis: l = !0,
|
|
557
564
|
crossAxis: a = !1,
|
|
558
565
|
limiter: r = {
|
|
559
|
-
fn: (
|
|
566
|
+
fn: (g) => {
|
|
560
567
|
let {
|
|
561
568
|
x: C,
|
|
562
|
-
y:
|
|
563
|
-
} =
|
|
569
|
+
y: S
|
|
570
|
+
} = g;
|
|
564
571
|
return {
|
|
565
572
|
x: C,
|
|
566
|
-
y:
|
|
573
|
+
y: S
|
|
567
574
|
};
|
|
568
575
|
}
|
|
569
576
|
},
|
|
570
|
-
...
|
|
571
|
-
} =
|
|
572
|
-
x:
|
|
577
|
+
...i
|
|
578
|
+
} = We(e, n), c = {
|
|
579
|
+
x: t,
|
|
573
580
|
y: o
|
|
574
|
-
},
|
|
575
|
-
let
|
|
581
|
+
}, d = await Ct(n, i), v = he(be(s)), m = bt(v);
|
|
582
|
+
let f = c[m], u = c[v];
|
|
576
583
|
if (l) {
|
|
577
|
-
const
|
|
578
|
-
|
|
584
|
+
const g = m === "y" ? "top" : "left", C = m === "y" ? "bottom" : "right", S = f + d[g], E = f - d[C];
|
|
585
|
+
f = lt(S, f, E);
|
|
579
586
|
}
|
|
580
587
|
if (a) {
|
|
581
|
-
const
|
|
582
|
-
|
|
588
|
+
const g = v === "y" ? "top" : "left", C = v === "y" ? "bottom" : "right", S = u + d[g], E = u - d[C];
|
|
589
|
+
u = lt(S, u, E);
|
|
583
590
|
}
|
|
584
|
-
const
|
|
585
|
-
...
|
|
586
|
-
[
|
|
587
|
-
[
|
|
591
|
+
const h = r.fn({
|
|
592
|
+
...n,
|
|
593
|
+
[m]: f,
|
|
594
|
+
[v]: u
|
|
588
595
|
});
|
|
589
596
|
return {
|
|
590
|
-
...
|
|
597
|
+
...h,
|
|
591
598
|
data: {
|
|
592
|
-
x:
|
|
593
|
-
y:
|
|
599
|
+
x: h.x - t,
|
|
600
|
+
y: h.y - o,
|
|
594
601
|
enabled: {
|
|
595
|
-
[
|
|
596
|
-
[
|
|
602
|
+
[m]: l,
|
|
603
|
+
[v]: a
|
|
597
604
|
}
|
|
598
605
|
}
|
|
599
606
|
};
|
|
600
607
|
}
|
|
601
608
|
};
|
|
602
609
|
};
|
|
603
|
-
function
|
|
610
|
+
function Ke() {
|
|
604
611
|
return typeof window < "u";
|
|
605
612
|
}
|
|
606
|
-
function
|
|
607
|
-
return
|
|
613
|
+
function Ee(e) {
|
|
614
|
+
return St(e) ? (e.nodeName || "").toLowerCase() : "#document";
|
|
608
615
|
}
|
|
609
|
-
function
|
|
610
|
-
var
|
|
611
|
-
return (e == null || (
|
|
616
|
+
function J(e) {
|
|
617
|
+
var n;
|
|
618
|
+
return (e == null || (n = e.ownerDocument) == null ? void 0 : n.defaultView) || window;
|
|
612
619
|
}
|
|
613
|
-
function
|
|
614
|
-
var
|
|
615
|
-
return (
|
|
620
|
+
function ue(e) {
|
|
621
|
+
var n;
|
|
622
|
+
return (n = (St(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : n.documentElement;
|
|
616
623
|
}
|
|
617
|
-
function
|
|
618
|
-
return
|
|
624
|
+
function St(e) {
|
|
625
|
+
return Ke() ? e instanceof Node || e instanceof J(e).Node : !1;
|
|
619
626
|
}
|
|
620
|
-
function
|
|
621
|
-
return
|
|
627
|
+
function se(e) {
|
|
628
|
+
return Ke() ? e instanceof Element || e instanceof J(e).Element : !1;
|
|
622
629
|
}
|
|
623
|
-
function
|
|
624
|
-
return
|
|
630
|
+
function ce(e) {
|
|
631
|
+
return Ke() ? e instanceof HTMLElement || e instanceof J(e).HTMLElement : !1;
|
|
625
632
|
}
|
|
626
|
-
function
|
|
627
|
-
return !
|
|
633
|
+
function ct(e) {
|
|
634
|
+
return !Ke() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof J(e).ShadowRoot;
|
|
628
635
|
}
|
|
629
|
-
const
|
|
630
|
-
function
|
|
636
|
+
const kn = /* @__PURE__ */ new Set(["inline", "contents"]);
|
|
637
|
+
function Ve(e) {
|
|
631
638
|
const {
|
|
632
|
-
overflow:
|
|
633
|
-
overflowX:
|
|
639
|
+
overflow: n,
|
|
640
|
+
overflowX: t,
|
|
634
641
|
overflowY: o,
|
|
635
642
|
display: s
|
|
636
|
-
} =
|
|
637
|
-
return /auto|scroll|overlay|hidden|clip/.test(
|
|
643
|
+
} = le(e);
|
|
644
|
+
return /auto|scroll|overlay|hidden|clip/.test(n + o + t) && !kn.has(s);
|
|
638
645
|
}
|
|
639
|
-
const
|
|
640
|
-
function
|
|
641
|
-
return
|
|
646
|
+
const Cn = /* @__PURE__ */ new Set(["table", "td", "th"]);
|
|
647
|
+
function Sn(e) {
|
|
648
|
+
return Cn.has(Ee(e));
|
|
642
649
|
}
|
|
643
|
-
const
|
|
644
|
-
function
|
|
645
|
-
return
|
|
650
|
+
const Rn = [":popover-open", ":modal"];
|
|
651
|
+
function ze(e) {
|
|
652
|
+
return Rn.some((n) => {
|
|
646
653
|
try {
|
|
647
|
-
return e.matches(
|
|
654
|
+
return e.matches(n);
|
|
648
655
|
} catch {
|
|
649
656
|
return !1;
|
|
650
657
|
}
|
|
651
658
|
});
|
|
652
659
|
}
|
|
653
|
-
const
|
|
654
|
-
function
|
|
655
|
-
const
|
|
656
|
-
return
|
|
657
|
-
}
|
|
658
|
-
function
|
|
659
|
-
let
|
|
660
|
-
for (;
|
|
661
|
-
if (
|
|
662
|
-
return
|
|
663
|
-
if (
|
|
660
|
+
const En = ["transform", "translate", "scale", "rotate", "perspective"], $n = ["transform", "translate", "scale", "rotate", "perspective", "filter"], An = ["paint", "layout", "strict", "content"];
|
|
661
|
+
function _e(e) {
|
|
662
|
+
const n = et(), t = se(e) ? le(e) : e;
|
|
663
|
+
return En.some((o) => t[o] ? t[o] !== "none" : !1) || (t.containerType ? t.containerType !== "normal" : !1) || !n && (t.backdropFilter ? t.backdropFilter !== "none" : !1) || !n && (t.filter ? t.filter !== "none" : !1) || $n.some((o) => (t.willChange || "").includes(o)) || An.some((o) => (t.contain || "").includes(o));
|
|
664
|
+
}
|
|
665
|
+
function Fn(e) {
|
|
666
|
+
let n = pe(e);
|
|
667
|
+
for (; ce(n) && !Se(n); ) {
|
|
668
|
+
if (_e(n))
|
|
669
|
+
return n;
|
|
670
|
+
if (ze(n))
|
|
664
671
|
return null;
|
|
665
|
-
|
|
672
|
+
n = pe(n);
|
|
666
673
|
}
|
|
667
674
|
return null;
|
|
668
675
|
}
|
|
669
|
-
function
|
|
676
|
+
function et() {
|
|
670
677
|
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
671
678
|
}
|
|
672
|
-
const
|
|
673
|
-
function
|
|
674
|
-
return
|
|
679
|
+
const Tn = /* @__PURE__ */ new Set(["html", "body", "#document"]);
|
|
680
|
+
function Se(e) {
|
|
681
|
+
return Tn.has(Ee(e));
|
|
675
682
|
}
|
|
676
|
-
function
|
|
677
|
-
return
|
|
683
|
+
function le(e) {
|
|
684
|
+
return J(e).getComputedStyle(e);
|
|
678
685
|
}
|
|
679
|
-
function
|
|
680
|
-
return
|
|
686
|
+
function je(e) {
|
|
687
|
+
return se(e) ? {
|
|
681
688
|
scrollLeft: e.scrollLeft,
|
|
682
689
|
scrollTop: e.scrollTop
|
|
683
690
|
} : {
|
|
@@ -685,300 +692,300 @@ function Fe(e) {
|
|
|
685
692
|
scrollTop: e.scrollY
|
|
686
693
|
};
|
|
687
694
|
}
|
|
688
|
-
function
|
|
689
|
-
if (
|
|
695
|
+
function pe(e) {
|
|
696
|
+
if (Ee(e) === "html")
|
|
690
697
|
return e;
|
|
691
|
-
const
|
|
698
|
+
const n = (
|
|
692
699
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
693
700
|
e.assignedSlot || // DOM Element detected.
|
|
694
701
|
e.parentNode || // ShadowRoot detected.
|
|
695
|
-
|
|
696
|
-
|
|
702
|
+
ct(e) && e.host || // Fallback.
|
|
703
|
+
ue(e)
|
|
697
704
|
);
|
|
698
|
-
return
|
|
705
|
+
return ct(n) ? n.host : n;
|
|
699
706
|
}
|
|
700
|
-
function
|
|
701
|
-
const
|
|
702
|
-
return
|
|
707
|
+
function Rt(e) {
|
|
708
|
+
const n = pe(e);
|
|
709
|
+
return Se(n) ? e.ownerDocument ? e.ownerDocument.body : e.body : ce(n) && Ve(n) ? n : Rt(n);
|
|
703
710
|
}
|
|
704
|
-
function
|
|
711
|
+
function Oe(e, n, t) {
|
|
705
712
|
var o;
|
|
706
|
-
|
|
707
|
-
const s =
|
|
713
|
+
n === void 0 && (n = []), t === void 0 && (t = !0);
|
|
714
|
+
const s = Rt(e), l = s === ((o = e.ownerDocument) == null ? void 0 : o.body), a = J(s);
|
|
708
715
|
if (l) {
|
|
709
|
-
const r =
|
|
710
|
-
return
|
|
716
|
+
const r = Je(a);
|
|
717
|
+
return n.concat(a, a.visualViewport || [], Ve(s) ? s : [], r && t ? Oe(r) : []);
|
|
711
718
|
}
|
|
712
|
-
return
|
|
719
|
+
return n.concat(s, Oe(s, [], t));
|
|
713
720
|
}
|
|
714
|
-
function
|
|
721
|
+
function Je(e) {
|
|
715
722
|
return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
|
|
716
723
|
}
|
|
717
|
-
function
|
|
718
|
-
const
|
|
719
|
-
let
|
|
720
|
-
const s =
|
|
721
|
-
return r && (
|
|
722
|
-
width:
|
|
724
|
+
function Et(e) {
|
|
725
|
+
const n = le(e);
|
|
726
|
+
let t = parseFloat(n.width) || 0, o = parseFloat(n.height) || 0;
|
|
727
|
+
const s = ce(e), l = s ? e.offsetWidth : t, a = s ? e.offsetHeight : o, r = Ie(t) !== l || Ie(o) !== a;
|
|
728
|
+
return r && (t = l, o = a), {
|
|
729
|
+
width: t,
|
|
723
730
|
height: o,
|
|
724
731
|
$: r
|
|
725
732
|
};
|
|
726
733
|
}
|
|
727
|
-
function
|
|
728
|
-
return
|
|
734
|
+
function tt(e) {
|
|
735
|
+
return se(e) ? e : e.contextElement;
|
|
729
736
|
}
|
|
730
|
-
function
|
|
731
|
-
const
|
|
732
|
-
if (!
|
|
733
|
-
return
|
|
734
|
-
const
|
|
737
|
+
function ke(e) {
|
|
738
|
+
const n = tt(e);
|
|
739
|
+
if (!ce(n))
|
|
740
|
+
return ie(1);
|
|
741
|
+
const t = n.getBoundingClientRect(), {
|
|
735
742
|
width: o,
|
|
736
743
|
height: s,
|
|
737
744
|
$: l
|
|
738
|
-
} =
|
|
739
|
-
let a = (l ?
|
|
745
|
+
} = Et(n);
|
|
746
|
+
let a = (l ? Ie(t.width) : t.width) / o, r = (l ? Ie(t.height) : t.height) / s;
|
|
740
747
|
return (!a || !Number.isFinite(a)) && (a = 1), (!r || !Number.isFinite(r)) && (r = 1), {
|
|
741
748
|
x: a,
|
|
742
749
|
y: r
|
|
743
750
|
};
|
|
744
751
|
}
|
|
745
|
-
const
|
|
746
|
-
function
|
|
747
|
-
const
|
|
748
|
-
return !
|
|
749
|
-
x:
|
|
750
|
-
y:
|
|
752
|
+
const On = /* @__PURE__ */ ie(0);
|
|
753
|
+
function $t(e) {
|
|
754
|
+
const n = J(e);
|
|
755
|
+
return !et() || !n.visualViewport ? On : {
|
|
756
|
+
x: n.visualViewport.offsetLeft,
|
|
757
|
+
y: n.visualViewport.offsetTop
|
|
751
758
|
};
|
|
752
759
|
}
|
|
753
|
-
function
|
|
754
|
-
return
|
|
760
|
+
function Vn(e, n, t) {
|
|
761
|
+
return n === void 0 && (n = !1), !t || n && t !== J(e) ? !1 : n;
|
|
755
762
|
}
|
|
756
|
-
function
|
|
757
|
-
|
|
758
|
-
const s = e.getBoundingClientRect(), l =
|
|
759
|
-
let a =
|
|
760
|
-
|
|
761
|
-
const r =
|
|
762
|
-
let
|
|
763
|
+
function xe(e, n, t, o) {
|
|
764
|
+
n === void 0 && (n = !1), t === void 0 && (t = !1);
|
|
765
|
+
const s = e.getBoundingClientRect(), l = tt(e);
|
|
766
|
+
let a = ie(1);
|
|
767
|
+
n && (o ? se(o) && (a = ke(o)) : a = ke(e));
|
|
768
|
+
const r = Vn(l, t, o) ? $t(l) : ie(0);
|
|
769
|
+
let i = (s.left + r.x) / a.x, c = (s.top + r.y) / a.y, d = s.width / a.x, v = s.height / a.y;
|
|
763
770
|
if (l) {
|
|
764
|
-
const
|
|
765
|
-
let
|
|
766
|
-
for (;
|
|
767
|
-
const
|
|
768
|
-
|
|
771
|
+
const m = J(l), f = o && se(o) ? J(o) : o;
|
|
772
|
+
let u = m, h = Je(u);
|
|
773
|
+
for (; h && o && f !== u; ) {
|
|
774
|
+
const g = ke(h), C = h.getBoundingClientRect(), S = le(h), E = C.left + (h.clientLeft + parseFloat(S.paddingLeft)) * g.x, L = C.top + (h.clientTop + parseFloat(S.paddingTop)) * g.y;
|
|
775
|
+
i *= g.x, c *= g.y, d *= g.x, v *= g.y, i += E, c += L, u = J(h), h = Je(u);
|
|
769
776
|
}
|
|
770
777
|
}
|
|
771
|
-
return
|
|
772
|
-
width:
|
|
773
|
-
height:
|
|
774
|
-
x:
|
|
778
|
+
return Me({
|
|
779
|
+
width: d,
|
|
780
|
+
height: v,
|
|
781
|
+
x: i,
|
|
775
782
|
y: c
|
|
776
783
|
});
|
|
777
784
|
}
|
|
778
|
-
function
|
|
779
|
-
const
|
|
780
|
-
return
|
|
785
|
+
function Ue(e, n) {
|
|
786
|
+
const t = je(e).scrollLeft;
|
|
787
|
+
return n ? n.left + t : xe(ue(e)).left + t;
|
|
781
788
|
}
|
|
782
|
-
function
|
|
783
|
-
const
|
|
789
|
+
function At(e, n) {
|
|
790
|
+
const t = e.getBoundingClientRect(), o = t.left + n.scrollLeft - Ue(e, t), s = t.top + n.scrollTop;
|
|
784
791
|
return {
|
|
785
792
|
x: o,
|
|
786
793
|
y: s
|
|
787
794
|
};
|
|
788
795
|
}
|
|
789
|
-
function
|
|
796
|
+
function Ln(e) {
|
|
790
797
|
let {
|
|
791
|
-
elements:
|
|
792
|
-
rect:
|
|
798
|
+
elements: n,
|
|
799
|
+
rect: t,
|
|
793
800
|
offsetParent: o,
|
|
794
801
|
strategy: s
|
|
795
802
|
} = e;
|
|
796
|
-
const l = s === "fixed", a =
|
|
803
|
+
const l = s === "fixed", a = ue(o), r = n ? ze(n.floating) : !1;
|
|
797
804
|
if (o === a || r && l)
|
|
798
|
-
return
|
|
799
|
-
let
|
|
805
|
+
return t;
|
|
806
|
+
let i = {
|
|
800
807
|
scrollLeft: 0,
|
|
801
808
|
scrollTop: 0
|
|
802
|
-
}, c =
|
|
803
|
-
const
|
|
804
|
-
if ((
|
|
805
|
-
const
|
|
806
|
-
c =
|
|
809
|
+
}, c = ie(1);
|
|
810
|
+
const d = ie(0), v = ce(o);
|
|
811
|
+
if ((v || !v && !l) && ((Ee(o) !== "body" || Ve(a)) && (i = je(o)), ce(o))) {
|
|
812
|
+
const f = xe(o);
|
|
813
|
+
c = ke(o), d.x = f.x + o.clientLeft, d.y = f.y + o.clientTop;
|
|
807
814
|
}
|
|
808
|
-
const
|
|
815
|
+
const m = a && !v && !l ? At(a, i) : ie(0);
|
|
809
816
|
return {
|
|
810
|
-
width:
|
|
811
|
-
height:
|
|
812
|
-
x:
|
|
813
|
-
y:
|
|
817
|
+
width: t.width * c.x,
|
|
818
|
+
height: t.height * c.y,
|
|
819
|
+
x: t.x * c.x - i.scrollLeft * c.x + d.x + m.x,
|
|
820
|
+
y: t.y * c.y - i.scrollTop * c.y + d.y + m.y
|
|
814
821
|
};
|
|
815
822
|
}
|
|
816
|
-
function
|
|
823
|
+
function Pn(e) {
|
|
817
824
|
return Array.from(e.getClientRects());
|
|
818
825
|
}
|
|
819
|
-
function
|
|
820
|
-
const
|
|
821
|
-
let a = -
|
|
822
|
-
const r = -
|
|
823
|
-
return
|
|
826
|
+
function Dn(e) {
|
|
827
|
+
const n = ue(e), t = je(e), o = e.ownerDocument.body, s = we(n.scrollWidth, n.clientWidth, o.scrollWidth, o.clientWidth), l = we(n.scrollHeight, n.clientHeight, o.scrollHeight, o.clientHeight);
|
|
828
|
+
let a = -t.scrollLeft + Ue(e);
|
|
829
|
+
const r = -t.scrollTop;
|
|
830
|
+
return le(o).direction === "rtl" && (a += we(n.clientWidth, o.clientWidth) - s), {
|
|
824
831
|
width: s,
|
|
825
832
|
height: l,
|
|
826
833
|
x: a,
|
|
827
834
|
y: r
|
|
828
835
|
};
|
|
829
836
|
}
|
|
830
|
-
const
|
|
831
|
-
function
|
|
832
|
-
const
|
|
833
|
-
let l = o.clientWidth, a = o.clientHeight, r = 0,
|
|
837
|
+
const ut = 25;
|
|
838
|
+
function In(e, n) {
|
|
839
|
+
const t = J(e), o = ue(e), s = t.visualViewport;
|
|
840
|
+
let l = o.clientWidth, a = o.clientHeight, r = 0, i = 0;
|
|
834
841
|
if (s) {
|
|
835
842
|
l = s.width, a = s.height;
|
|
836
|
-
const
|
|
837
|
-
(!
|
|
843
|
+
const d = et();
|
|
844
|
+
(!d || d && n === "fixed") && (r = s.offsetLeft, i = s.offsetTop);
|
|
838
845
|
}
|
|
839
|
-
const c =
|
|
846
|
+
const c = Ue(o);
|
|
840
847
|
if (c <= 0) {
|
|
841
|
-
const
|
|
842
|
-
|
|
843
|
-
} else c <=
|
|
848
|
+
const d = o.ownerDocument, v = d.body, m = getComputedStyle(v), f = d.compatMode === "CSS1Compat" && parseFloat(m.marginLeft) + parseFloat(m.marginRight) || 0, u = Math.abs(o.clientWidth - v.clientWidth - f);
|
|
849
|
+
u <= ut && (l -= u);
|
|
850
|
+
} else c <= ut && (l += c);
|
|
844
851
|
return {
|
|
845
852
|
width: l,
|
|
846
853
|
height: a,
|
|
847
854
|
x: r,
|
|
848
|
-
y:
|
|
855
|
+
y: i
|
|
849
856
|
};
|
|
850
857
|
}
|
|
851
|
-
const
|
|
852
|
-
function
|
|
853
|
-
const
|
|
858
|
+
const qn = /* @__PURE__ */ new Set(["absolute", "fixed"]);
|
|
859
|
+
function Mn(e, n) {
|
|
860
|
+
const t = xe(e, !0, n === "fixed"), o = t.top + e.clientTop, s = t.left + e.clientLeft, l = ce(e) ? ke(e) : ie(1), a = e.clientWidth * l.x, r = e.clientHeight * l.y, i = s * l.x, c = o * l.y;
|
|
854
861
|
return {
|
|
855
862
|
width: a,
|
|
856
863
|
height: r,
|
|
857
|
-
x:
|
|
864
|
+
x: i,
|
|
858
865
|
y: c
|
|
859
866
|
};
|
|
860
867
|
}
|
|
861
|
-
function
|
|
868
|
+
function dt(e, n, t) {
|
|
862
869
|
let o;
|
|
863
|
-
if (
|
|
864
|
-
o =
|
|
865
|
-
else if (
|
|
866
|
-
o =
|
|
867
|
-
else if (
|
|
868
|
-
o =
|
|
870
|
+
if (n === "viewport")
|
|
871
|
+
o = In(e, t);
|
|
872
|
+
else if (n === "document")
|
|
873
|
+
o = Dn(ue(e));
|
|
874
|
+
else if (se(n))
|
|
875
|
+
o = Mn(n, t);
|
|
869
876
|
else {
|
|
870
|
-
const s =
|
|
877
|
+
const s = $t(e);
|
|
871
878
|
o = {
|
|
872
|
-
x:
|
|
873
|
-
y:
|
|
874
|
-
width:
|
|
875
|
-
height:
|
|
879
|
+
x: n.x - s.x,
|
|
880
|
+
y: n.y - s.y,
|
|
881
|
+
width: n.width,
|
|
882
|
+
height: n.height
|
|
876
883
|
};
|
|
877
884
|
}
|
|
878
|
-
return
|
|
885
|
+
return Me(o);
|
|
879
886
|
}
|
|
880
|
-
function
|
|
881
|
-
const
|
|
882
|
-
return
|
|
887
|
+
function Ft(e, n) {
|
|
888
|
+
const t = pe(e);
|
|
889
|
+
return t === n || !se(t) || Se(t) ? !1 : le(t).position === "fixed" || Ft(t, n);
|
|
883
890
|
}
|
|
884
|
-
function
|
|
885
|
-
const
|
|
886
|
-
if (
|
|
887
|
-
return
|
|
888
|
-
let o =
|
|
889
|
-
const l =
|
|
890
|
-
let a = l ?
|
|
891
|
-
for (;
|
|
892
|
-
const r =
|
|
893
|
-
!
|
|
891
|
+
function Bn(e, n) {
|
|
892
|
+
const t = n.get(e);
|
|
893
|
+
if (t)
|
|
894
|
+
return t;
|
|
895
|
+
let o = Oe(e, [], !1).filter((r) => se(r) && Ee(r) !== "body"), s = null;
|
|
896
|
+
const l = le(e).position === "fixed";
|
|
897
|
+
let a = l ? pe(e) : e;
|
|
898
|
+
for (; se(a) && !Se(a); ) {
|
|
899
|
+
const r = le(a), i = _e(a);
|
|
900
|
+
!i && r.position === "fixed" && (s = null), (l ? !i && !s : !i && r.position === "static" && !!s && qn.has(s.position) || Ve(a) && !i && Ft(e, a)) ? o = o.filter((d) => d !== a) : s = r, a = pe(a);
|
|
894
901
|
}
|
|
895
|
-
return
|
|
902
|
+
return n.set(e, o), o;
|
|
896
903
|
}
|
|
897
|
-
function
|
|
904
|
+
function Hn(e) {
|
|
898
905
|
let {
|
|
899
|
-
element:
|
|
900
|
-
boundary:
|
|
906
|
+
element: n,
|
|
907
|
+
boundary: t,
|
|
901
908
|
rootBoundary: o,
|
|
902
909
|
strategy: s
|
|
903
910
|
} = e;
|
|
904
|
-
const a = [...
|
|
905
|
-
const
|
|
906
|
-
return c.top =
|
|
907
|
-
},
|
|
911
|
+
const a = [...t === "clippingAncestors" ? ze(n) ? [] : Bn(n, this._c) : [].concat(t), o], r = a[0], i = a.reduce((c, d) => {
|
|
912
|
+
const v = dt(n, d, s);
|
|
913
|
+
return c.top = we(v.top, c.top), c.right = De(v.right, c.right), c.bottom = De(v.bottom, c.bottom), c.left = we(v.left, c.left), c;
|
|
914
|
+
}, dt(n, r, s));
|
|
908
915
|
return {
|
|
909
|
-
width:
|
|
910
|
-
height:
|
|
911
|
-
x:
|
|
912
|
-
y:
|
|
916
|
+
width: i.right - i.left,
|
|
917
|
+
height: i.bottom - i.top,
|
|
918
|
+
x: i.left,
|
|
919
|
+
y: i.top
|
|
913
920
|
};
|
|
914
921
|
}
|
|
915
|
-
function
|
|
922
|
+
function Wn(e) {
|
|
916
923
|
const {
|
|
917
|
-
width:
|
|
918
|
-
height:
|
|
919
|
-
} =
|
|
924
|
+
width: n,
|
|
925
|
+
height: t
|
|
926
|
+
} = Et(e);
|
|
920
927
|
return {
|
|
921
|
-
width:
|
|
922
|
-
height:
|
|
928
|
+
width: n,
|
|
929
|
+
height: t
|
|
923
930
|
};
|
|
924
931
|
}
|
|
925
|
-
function
|
|
926
|
-
const o =
|
|
932
|
+
function Nn(e, n, t) {
|
|
933
|
+
const o = ce(n), s = ue(n), l = t === "fixed", a = xe(e, !0, l, n);
|
|
927
934
|
let r = {
|
|
928
935
|
scrollLeft: 0,
|
|
929
936
|
scrollTop: 0
|
|
930
937
|
};
|
|
931
|
-
const
|
|
938
|
+
const i = ie(0);
|
|
932
939
|
function c() {
|
|
933
|
-
|
|
940
|
+
i.x = Ue(s);
|
|
934
941
|
}
|
|
935
942
|
if (o || !o && !l)
|
|
936
|
-
if ((
|
|
937
|
-
const
|
|
938
|
-
|
|
943
|
+
if ((Ee(n) !== "body" || Ve(s)) && (r = je(n)), o) {
|
|
944
|
+
const f = xe(n, !0, l, n);
|
|
945
|
+
i.x = f.x + n.clientLeft, i.y = f.y + n.clientTop;
|
|
939
946
|
} else s && c();
|
|
940
947
|
l && !o && s && c();
|
|
941
|
-
const
|
|
948
|
+
const d = s && !o && !l ? At(s, r) : ie(0), v = a.left + r.scrollLeft - i.x - d.x, m = a.top + r.scrollTop - i.y - d.y;
|
|
942
949
|
return {
|
|
943
|
-
x:
|
|
944
|
-
y:
|
|
950
|
+
x: v,
|
|
951
|
+
y: m,
|
|
945
952
|
width: a.width,
|
|
946
953
|
height: a.height
|
|
947
954
|
};
|
|
948
955
|
}
|
|
949
|
-
function
|
|
950
|
-
return
|
|
956
|
+
function Qe(e) {
|
|
957
|
+
return le(e).position === "static";
|
|
951
958
|
}
|
|
952
|
-
function
|
|
953
|
-
if (!
|
|
959
|
+
function ft(e, n) {
|
|
960
|
+
if (!ce(e) || le(e).position === "fixed")
|
|
954
961
|
return null;
|
|
955
|
-
if (
|
|
956
|
-
return
|
|
957
|
-
let
|
|
958
|
-
return
|
|
959
|
-
}
|
|
960
|
-
function
|
|
961
|
-
const
|
|
962
|
-
if (
|
|
963
|
-
return
|
|
964
|
-
if (!
|
|
965
|
-
let s =
|
|
966
|
-
for (; s && !
|
|
967
|
-
if (
|
|
962
|
+
if (n)
|
|
963
|
+
return n(e);
|
|
964
|
+
let t = e.offsetParent;
|
|
965
|
+
return ue(e) === t && (t = t.ownerDocument.body), t;
|
|
966
|
+
}
|
|
967
|
+
function Tt(e, n) {
|
|
968
|
+
const t = J(e);
|
|
969
|
+
if (ze(e))
|
|
970
|
+
return t;
|
|
971
|
+
if (!ce(e)) {
|
|
972
|
+
let s = pe(e);
|
|
973
|
+
for (; s && !Se(s); ) {
|
|
974
|
+
if (se(s) && !Qe(s))
|
|
968
975
|
return s;
|
|
969
|
-
s =
|
|
976
|
+
s = pe(s);
|
|
970
977
|
}
|
|
971
|
-
return
|
|
978
|
+
return t;
|
|
972
979
|
}
|
|
973
|
-
let o =
|
|
974
|
-
for (; o &&
|
|
975
|
-
o =
|
|
976
|
-
return o &&
|
|
980
|
+
let o = ft(e, n);
|
|
981
|
+
for (; o && Sn(o) && Qe(o); )
|
|
982
|
+
o = ft(o, n);
|
|
983
|
+
return o && Se(o) && Qe(o) && !_e(o) ? t : o || Fn(e) || t;
|
|
977
984
|
}
|
|
978
|
-
const
|
|
979
|
-
const
|
|
985
|
+
const Kn = async function(e) {
|
|
986
|
+
const n = this.getOffsetParent || Tt, t = this.getDimensions, o = await t(e.floating);
|
|
980
987
|
return {
|
|
981
|
-
reference:
|
|
988
|
+
reference: Nn(e.reference, await n(e.floating), e.strategy),
|
|
982
989
|
floating: {
|
|
983
990
|
x: 0,
|
|
984
991
|
y: 0,
|
|
@@ -987,123 +994,123 @@ const En = async function(e) {
|
|
|
987
994
|
}
|
|
988
995
|
};
|
|
989
996
|
};
|
|
990
|
-
function
|
|
991
|
-
return
|
|
992
|
-
}
|
|
993
|
-
const
|
|
994
|
-
convertOffsetParentRelativeRectToViewportRelativeRect:
|
|
995
|
-
getDocumentElement:
|
|
996
|
-
getClippingRect:
|
|
997
|
-
getOffsetParent:
|
|
998
|
-
getElementRects:
|
|
999
|
-
getClientRects:
|
|
1000
|
-
getDimensions:
|
|
1001
|
-
getScale:
|
|
1002
|
-
isElement:
|
|
1003
|
-
isRTL:
|
|
997
|
+
function zn(e) {
|
|
998
|
+
return le(e).direction === "rtl";
|
|
999
|
+
}
|
|
1000
|
+
const jn = {
|
|
1001
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: Ln,
|
|
1002
|
+
getDocumentElement: ue,
|
|
1003
|
+
getClippingRect: Hn,
|
|
1004
|
+
getOffsetParent: Tt,
|
|
1005
|
+
getElementRects: Kn,
|
|
1006
|
+
getClientRects: Pn,
|
|
1007
|
+
getDimensions: Wn,
|
|
1008
|
+
getScale: ke,
|
|
1009
|
+
isElement: se,
|
|
1010
|
+
isRTL: zn
|
|
1004
1011
|
};
|
|
1005
|
-
function
|
|
1006
|
-
return e.x ===
|
|
1012
|
+
function Ot(e, n) {
|
|
1013
|
+
return e.x === n.x && e.y === n.y && e.width === n.width && e.height === n.height;
|
|
1007
1014
|
}
|
|
1008
|
-
function
|
|
1009
|
-
let
|
|
1010
|
-
const s =
|
|
1015
|
+
function Un(e, n) {
|
|
1016
|
+
let t = null, o;
|
|
1017
|
+
const s = ue(e);
|
|
1011
1018
|
function l() {
|
|
1012
1019
|
var r;
|
|
1013
|
-
clearTimeout(o), (r =
|
|
1020
|
+
clearTimeout(o), (r = t) == null || r.disconnect(), t = null;
|
|
1014
1021
|
}
|
|
1015
|
-
function a(r,
|
|
1016
|
-
r === void 0 && (r = !1),
|
|
1022
|
+
function a(r, i) {
|
|
1023
|
+
r === void 0 && (r = !1), i === void 0 && (i = 1), l();
|
|
1017
1024
|
const c = e.getBoundingClientRect(), {
|
|
1018
|
-
left:
|
|
1019
|
-
top:
|
|
1020
|
-
width:
|
|
1021
|
-
height:
|
|
1025
|
+
left: d,
|
|
1026
|
+
top: v,
|
|
1027
|
+
width: m,
|
|
1028
|
+
height: f
|
|
1022
1029
|
} = c;
|
|
1023
|
-
if (r ||
|
|
1030
|
+
if (r || n(), !m || !f)
|
|
1024
1031
|
return;
|
|
1025
|
-
const
|
|
1026
|
-
rootMargin: -
|
|
1027
|
-
threshold:
|
|
1032
|
+
const u = Le(v), h = Le(s.clientWidth - (d + m)), g = Le(s.clientHeight - (v + f)), C = Le(d), E = {
|
|
1033
|
+
rootMargin: -u + "px " + -h + "px " + -g + "px " + -C + "px",
|
|
1034
|
+
threshold: we(0, De(1, i)) || 1
|
|
1028
1035
|
};
|
|
1029
|
-
let
|
|
1030
|
-
function
|
|
1031
|
-
const
|
|
1032
|
-
if (
|
|
1033
|
-
if (!
|
|
1036
|
+
let L = !0;
|
|
1037
|
+
function P(B) {
|
|
1038
|
+
const b = B[0].intersectionRatio;
|
|
1039
|
+
if (b !== i) {
|
|
1040
|
+
if (!L)
|
|
1034
1041
|
return a();
|
|
1035
|
-
|
|
1042
|
+
b ? a(!1, b) : o = setTimeout(() => {
|
|
1036
1043
|
a(!1, 1e-7);
|
|
1037
1044
|
}, 1e3);
|
|
1038
1045
|
}
|
|
1039
|
-
|
|
1046
|
+
b === 1 && !Ot(c, e.getBoundingClientRect()) && a(), L = !1;
|
|
1040
1047
|
}
|
|
1041
1048
|
try {
|
|
1042
|
-
|
|
1043
|
-
...
|
|
1049
|
+
t = new IntersectionObserver(P, {
|
|
1050
|
+
...E,
|
|
1044
1051
|
// Handle <iframe>s
|
|
1045
1052
|
root: s.ownerDocument
|
|
1046
1053
|
});
|
|
1047
1054
|
} catch {
|
|
1048
|
-
|
|
1055
|
+
t = new IntersectionObserver(P, E);
|
|
1049
1056
|
}
|
|
1050
|
-
|
|
1057
|
+
t.observe(e);
|
|
1051
1058
|
}
|
|
1052
1059
|
return a(!0), l;
|
|
1053
1060
|
}
|
|
1054
|
-
function
|
|
1061
|
+
function Zn(e, n, t, o) {
|
|
1055
1062
|
o === void 0 && (o = {});
|
|
1056
1063
|
const {
|
|
1057
1064
|
ancestorScroll: s = !0,
|
|
1058
1065
|
ancestorResize: l = !0,
|
|
1059
1066
|
elementResize: a = typeof ResizeObserver == "function",
|
|
1060
1067
|
layoutShift: r = typeof IntersectionObserver == "function",
|
|
1061
|
-
animationFrame:
|
|
1062
|
-
} = o, c =
|
|
1063
|
-
|
|
1064
|
-
s && C.addEventListener("scroll",
|
|
1068
|
+
animationFrame: i = !1
|
|
1069
|
+
} = o, c = tt(e), d = s || l ? [...c ? Oe(c) : [], ...Oe(n)] : [];
|
|
1070
|
+
d.forEach((C) => {
|
|
1071
|
+
s && C.addEventListener("scroll", t, {
|
|
1065
1072
|
passive: !0
|
|
1066
|
-
}), l && C.addEventListener("resize",
|
|
1073
|
+
}), l && C.addEventListener("resize", t);
|
|
1067
1074
|
});
|
|
1068
|
-
const
|
|
1069
|
-
let
|
|
1070
|
-
a && (
|
|
1071
|
-
let [
|
|
1072
|
-
|
|
1073
|
-
var
|
|
1074
|
-
(
|
|
1075
|
-
})),
|
|
1076
|
-
}), c && !
|
|
1077
|
-
let
|
|
1078
|
-
|
|
1079
|
-
function
|
|
1080
|
-
const C =
|
|
1081
|
-
|
|
1075
|
+
const v = c && r ? Un(c, t) : null;
|
|
1076
|
+
let m = -1, f = null;
|
|
1077
|
+
a && (f = new ResizeObserver((C) => {
|
|
1078
|
+
let [S] = C;
|
|
1079
|
+
S && S.target === c && f && (f.unobserve(n), cancelAnimationFrame(m), m = requestAnimationFrame(() => {
|
|
1080
|
+
var E;
|
|
1081
|
+
(E = f) == null || E.observe(n);
|
|
1082
|
+
})), t();
|
|
1083
|
+
}), c && !i && f.observe(c), f.observe(n));
|
|
1084
|
+
let u, h = i ? xe(e) : null;
|
|
1085
|
+
i && g();
|
|
1086
|
+
function g() {
|
|
1087
|
+
const C = xe(e);
|
|
1088
|
+
h && !Ot(h, C) && t(), h = C, u = requestAnimationFrame(g);
|
|
1082
1089
|
}
|
|
1083
|
-
return
|
|
1090
|
+
return t(), () => {
|
|
1084
1091
|
var C;
|
|
1085
|
-
|
|
1086
|
-
s &&
|
|
1087
|
-
}),
|
|
1092
|
+
d.forEach((S) => {
|
|
1093
|
+
s && S.removeEventListener("scroll", t), l && S.removeEventListener("resize", t);
|
|
1094
|
+
}), v?.(), (C = f) == null || C.disconnect(), f = null, i && cancelAnimationFrame(u);
|
|
1088
1095
|
};
|
|
1089
1096
|
}
|
|
1090
|
-
const
|
|
1097
|
+
const Xn = bn, Qn = xn, Yn = gn, Gn = (e, n, t) => {
|
|
1091
1098
|
const o = /* @__PURE__ */ new Map(), s = {
|
|
1092
|
-
platform:
|
|
1093
|
-
...
|
|
1099
|
+
platform: jn,
|
|
1100
|
+
...t
|
|
1094
1101
|
}, l = {
|
|
1095
1102
|
...s.platform,
|
|
1096
1103
|
_c: o
|
|
1097
1104
|
};
|
|
1098
|
-
return
|
|
1105
|
+
return pn(e, n, {
|
|
1099
1106
|
...s,
|
|
1100
1107
|
platform: l
|
|
1101
1108
|
});
|
|
1102
|
-
},
|
|
1103
|
-
text: (e,
|
|
1104
|
-
const o = String(e[
|
|
1105
|
-
if (!s && !["empty", "notEmpty"].includes(
|
|
1106
|
-
switch (
|
|
1109
|
+
}, Be = {
|
|
1110
|
+
text: (e, n, t) => {
|
|
1111
|
+
const o = String(e[n] ?? "").toLowerCase(), s = (t.value ?? "").toLowerCase().trim();
|
|
1112
|
+
if (!s && !["empty", "notEmpty"].includes(t.operator ?? "")) return !0;
|
|
1113
|
+
switch (t.operator) {
|
|
1107
1114
|
case "contains":
|
|
1108
1115
|
return o.includes(s);
|
|
1109
1116
|
case "doesNotContains":
|
|
@@ -1124,34 +1131,34 @@ const Bn = rn, Mn = un, qn = sn, Nn = (e, t, n) => {
|
|
|
1124
1131
|
return !0;
|
|
1125
1132
|
}
|
|
1126
1133
|
},
|
|
1127
|
-
"multi-select": (e,
|
|
1128
|
-
"number-range": (e,
|
|
1129
|
-
const o = Number(e[
|
|
1134
|
+
"multi-select": (e, n, t) => t.value?.length ? t.value.includes(String(e[n])) : !0,
|
|
1135
|
+
"number-range": (e, n, t) => {
|
|
1136
|
+
const o = Number(e[n]);
|
|
1130
1137
|
if (isNaN(o)) return !1;
|
|
1131
|
-
switch (
|
|
1138
|
+
switch (t.operator) {
|
|
1132
1139
|
case "between":
|
|
1133
|
-
return !(
|
|
1140
|
+
return !(t.min != null && o < t.min || t.max != null && o > t.max);
|
|
1134
1141
|
case "equals":
|
|
1135
|
-
return o === Number(
|
|
1142
|
+
return o === Number(t.value);
|
|
1136
1143
|
case "notEqual":
|
|
1137
|
-
return o !== Number(
|
|
1144
|
+
return o !== Number(t.value);
|
|
1138
1145
|
case "greaterThan":
|
|
1139
|
-
return o > Number(
|
|
1146
|
+
return o > Number(t.value);
|
|
1140
1147
|
case "lessThan":
|
|
1141
|
-
return o < Number(
|
|
1148
|
+
return o < Number(t.value);
|
|
1142
1149
|
case "empty":
|
|
1143
|
-
return e[
|
|
1150
|
+
return e[n] == null || e[n] === "";
|
|
1144
1151
|
case "notEmpty":
|
|
1145
|
-
return e[
|
|
1152
|
+
return e[n] != null && e[n] !== "";
|
|
1146
1153
|
default:
|
|
1147
1154
|
return !0;
|
|
1148
1155
|
}
|
|
1149
1156
|
},
|
|
1150
|
-
"date-range": (e,
|
|
1151
|
-
const o = new Date(String(e[
|
|
1157
|
+
"date-range": (e, n, t) => {
|
|
1158
|
+
const o = new Date(String(e[n]));
|
|
1152
1159
|
if (isNaN(o.getTime())) return !1;
|
|
1153
|
-
const s =
|
|
1154
|
-
switch (
|
|
1160
|
+
const s = t.value ?? null, l = t.start ? new Date(t.start) : null, a = t.end ? new Date(t.end) : null;
|
|
1161
|
+
switch (t.operator ?? "between") {
|
|
1155
1162
|
case "between":
|
|
1156
1163
|
return !(l && o < l || a && o > a);
|
|
1157
1164
|
case "equals":
|
|
@@ -1163,56 +1170,56 @@ const Bn = rn, Mn = un, qn = sn, Nn = (e, t, n) => {
|
|
|
1163
1170
|
case "after":
|
|
1164
1171
|
return s ? o > new Date(s) : !0;
|
|
1165
1172
|
case "empty":
|
|
1166
|
-
return e[
|
|
1173
|
+
return e[n] == null || e[n] === "";
|
|
1167
1174
|
case "notEmpty":
|
|
1168
|
-
return e[
|
|
1175
|
+
return e[n] != null && e[n] !== "";
|
|
1169
1176
|
default:
|
|
1170
1177
|
return !0;
|
|
1171
1178
|
}
|
|
1172
1179
|
},
|
|
1173
1180
|
// Default handler for custom filters
|
|
1174
|
-
custom: (e,
|
|
1175
|
-
const o = e[
|
|
1176
|
-
if (typeof
|
|
1177
|
-
return
|
|
1178
|
-
if (
|
|
1179
|
-
const s =
|
|
1181
|
+
custom: (e, n, t) => {
|
|
1182
|
+
const o = e[n];
|
|
1183
|
+
if (typeof t.filterFn == "function")
|
|
1184
|
+
return t.filterFn(o, t.value, e);
|
|
1185
|
+
if (t.filterKey && Object.prototype.hasOwnProperty.call(Be, t.filterKey)) {
|
|
1186
|
+
const s = Be[t.filterKey];
|
|
1180
1187
|
if (typeof s == "function")
|
|
1181
|
-
return s(e,
|
|
1188
|
+
return s(e, n, t);
|
|
1182
1189
|
}
|
|
1183
1190
|
return !0;
|
|
1184
1191
|
}
|
|
1185
1192
|
};
|
|
1186
|
-
function
|
|
1187
|
-
const
|
|
1188
|
-
operator:
|
|
1189
|
-
value:
|
|
1193
|
+
function Ce(e, n) {
|
|
1194
|
+
const t = {
|
|
1195
|
+
operator: n?.operator,
|
|
1196
|
+
value: n?.value ?? null
|
|
1190
1197
|
};
|
|
1191
1198
|
switch (e) {
|
|
1192
1199
|
case "text": {
|
|
1193
1200
|
const s = { type: e, value: "", operator: "contains" };
|
|
1194
|
-
return
|
|
1201
|
+
return n?.type === "text" ? { ...s, ...n } : s;
|
|
1195
1202
|
}
|
|
1196
1203
|
case "multi-select": {
|
|
1197
1204
|
const s = { type: e, value: [], operator: "in" };
|
|
1198
|
-
return
|
|
1205
|
+
return n?.type === "multi-select" ? { ...s, ...n } : s;
|
|
1199
1206
|
}
|
|
1200
1207
|
case "number-range": {
|
|
1201
1208
|
const s = { type: e, operator: "between", value: null, min: null, max: null };
|
|
1202
|
-
return
|
|
1209
|
+
return n?.type === "number-range" ? { ...s, ...n } : s;
|
|
1203
1210
|
}
|
|
1204
1211
|
case "date-range": {
|
|
1205
1212
|
const s = { type: e, operator: "between", value: null, start: null, end: null };
|
|
1206
|
-
return
|
|
1213
|
+
return n?.type === "date-range" ? { ...s, ...n } : s;
|
|
1207
1214
|
}
|
|
1208
1215
|
case "custom":
|
|
1209
|
-
const o = { type: e, value: null, operator:
|
|
1210
|
-
return
|
|
1216
|
+
const o = { type: e, value: null, operator: t.operator ?? "equals", custom: "", filterFn: void 0 };
|
|
1217
|
+
return n?.type === "custom" ? { ...o, ...n } : o;
|
|
1211
1218
|
default:
|
|
1212
1219
|
throw new Error(`Unsupported filter type: ${e}`);
|
|
1213
1220
|
}
|
|
1214
1221
|
}
|
|
1215
|
-
function
|
|
1222
|
+
function vt(e) {
|
|
1216
1223
|
switch (e.type) {
|
|
1217
1224
|
case "text":
|
|
1218
1225
|
return e.operator ? ["empty", "notEmpty"].includes(e.operator || "") ? !0 : !!e.value?.trim() : !1;
|
|
@@ -1228,7 +1235,7 @@ function ot(e) {
|
|
|
1228
1235
|
return !1;
|
|
1229
1236
|
}
|
|
1230
1237
|
}
|
|
1231
|
-
const
|
|
1238
|
+
const Jn = _({
|
|
1232
1239
|
name: "VsDFlex",
|
|
1233
1240
|
inheritAttrs: !1,
|
|
1234
1241
|
props: {
|
|
@@ -1239,36 +1246,36 @@ const In = _({
|
|
|
1239
1246
|
gap: [String, Number],
|
|
1240
1247
|
responsive: Object
|
|
1241
1248
|
},
|
|
1242
|
-
setup(e, { attrs:
|
|
1243
|
-
const
|
|
1244
|
-
return { flexClasses:
|
|
1249
|
+
setup(e, { attrs: n }) {
|
|
1250
|
+
const t = (s, l) => `${s}-${l}`;
|
|
1251
|
+
return { flexClasses: F(() => {
|
|
1245
1252
|
const s = ["vs-d-flex"];
|
|
1246
|
-
return e.direction && s.push(
|
|
1253
|
+
return e.direction && s.push(t("vs-row", e.direction)), e.justify && s.push(t("vs-justify", e.justify)), e.align && s.push(t("vs-align", e.align)), e.wrap !== void 0 && s.push(e.wrap ? "vs-wrap" : "vs-nowrap"), e.gap && s.push(t("vs-gap", e.gap)), Object.entries(e.responsive || {}).forEach(([l, a]) => {
|
|
1247
1254
|
const r = l + ":";
|
|
1248
|
-
a.direction && s.push(r +
|
|
1255
|
+
a.direction && s.push(r + t("vs-row", a.direction)), a.justify && s.push(r + t("vs-justify", a.justify)), a.align && s.push(r + t("vs-align", a.align)), a.wrap !== void 0 && s.push(r + (a.wrap ? "vs-wrap" : "vs-nowrap")), a.gap && s.push(r + t("vs-gap", a.gap));
|
|
1249
1256
|
}), s;
|
|
1250
|
-
}), attrs:
|
|
1257
|
+
}), attrs: n };
|
|
1251
1258
|
}
|
|
1252
1259
|
});
|
|
1253
|
-
function
|
|
1254
|
-
return
|
|
1255
|
-
|
|
1260
|
+
function _n(e, n, t, o, s, l) {
|
|
1261
|
+
return y(), k("div", Ae({ class: e.flexClasses }, e.attrs), [
|
|
1262
|
+
z(e.$slots, "default")
|
|
1256
1263
|
], 16);
|
|
1257
1264
|
}
|
|
1258
|
-
const
|
|
1265
|
+
const ye = /* @__PURE__ */ ae(Jn, [["render", _n]]), eo = { class: "vs-multiselect" }, to = { class: "vs-multiselect-actions" }, no = {
|
|
1259
1266
|
key: 0,
|
|
1260
1267
|
class: "vs-py-4 vs-text-center vs-text-primary"
|
|
1261
|
-
},
|
|
1268
|
+
}, oo = {
|
|
1262
1269
|
key: 1,
|
|
1263
1270
|
class: "vs-multiselect-options"
|
|
1264
|
-
},
|
|
1271
|
+
}, so = ["onClick"], lo = { class: "option-label" }, ao = {
|
|
1265
1272
|
key: 0,
|
|
1266
1273
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1267
1274
|
class: "check-icon",
|
|
1268
1275
|
fill: "none",
|
|
1269
1276
|
viewBox: "0 0 24 24",
|
|
1270
1277
|
stroke: "currentColor"
|
|
1271
|
-
},
|
|
1278
|
+
}, ro = /* @__PURE__ */ _({
|
|
1272
1279
|
__name: "VsMultiSelect",
|
|
1273
1280
|
props: {
|
|
1274
1281
|
columnData: {},
|
|
@@ -1276,81 +1283,81 @@ const re = /* @__PURE__ */ ne(In, [["render", Hn]]), Kn = { class: "vs-multisele
|
|
|
1276
1283
|
isLoading: { type: Boolean }
|
|
1277
1284
|
},
|
|
1278
1285
|
emits: ["update:modelValue"],
|
|
1279
|
-
setup(e, { emit:
|
|
1280
|
-
const
|
|
1281
|
-
const
|
|
1282
|
-
return Array.from(
|
|
1283
|
-
}), r =
|
|
1284
|
-
const
|
|
1285
|
-
return a.value.filter((
|
|
1286
|
-
}),
|
|
1287
|
-
const
|
|
1288
|
-
|
|
1289
|
-
},
|
|
1286
|
+
setup(e, { emit: n }) {
|
|
1287
|
+
const t = e, o = n, s = q(""), l = q([...t.modelValue ?? []]), a = F(() => {
|
|
1288
|
+
const f = new Set(t.columnData.filter(Boolean));
|
|
1289
|
+
return Array.from(f);
|
|
1290
|
+
}), r = F(() => {
|
|
1291
|
+
const f = s.value.toLowerCase();
|
|
1292
|
+
return a.value.filter((u) => u.toString().toLowerCase().includes(f));
|
|
1293
|
+
}), i = F(() => l.value.length), c = F(() => a.value.length - l.value.length), d = (f) => {
|
|
1294
|
+
const u = l.value.indexOf(f);
|
|
1295
|
+
u > -1 ? l.value.splice(u, 1) : l.value.push(f), o("update:modelValue", [...l.value]);
|
|
1296
|
+
}, v = () => {
|
|
1290
1297
|
l.value = [...a.value], o("update:modelValue", [...l.value]);
|
|
1291
|
-
},
|
|
1298
|
+
}, m = () => {
|
|
1292
1299
|
l.value = [], o("update:modelValue", []);
|
|
1293
1300
|
};
|
|
1294
|
-
return
|
|
1295
|
-
() =>
|
|
1296
|
-
(
|
|
1297
|
-
l.value = [...
|
|
1301
|
+
return Y(
|
|
1302
|
+
() => t.modelValue,
|
|
1303
|
+
(f) => {
|
|
1304
|
+
l.value = [...f || []];
|
|
1298
1305
|
}
|
|
1299
|
-
), (
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
onClick:
|
|
1303
|
-
}, "Select All (" +
|
|
1304
|
-
|
|
1305
|
-
onClick:
|
|
1306
|
-
}, "Deselect All (" +
|
|
1306
|
+
), (f, u) => (y(), k("div", eo, [
|
|
1307
|
+
w("div", to, [
|
|
1308
|
+
w("button", {
|
|
1309
|
+
onClick: me(v, ["stop"])
|
|
1310
|
+
}, "Select All (" + H(c.value) + ")", 1),
|
|
1311
|
+
w("button", {
|
|
1312
|
+
onClick: me(m, ["stop"])
|
|
1313
|
+
}, "Deselect All (" + H(i.value) + ")", 1)
|
|
1307
1314
|
]),
|
|
1308
|
-
|
|
1309
|
-
default:
|
|
1310
|
-
|
|
1315
|
+
ne(ye, { direction: "row" }, {
|
|
1316
|
+
default: X(() => [
|
|
1317
|
+
te(w("input", {
|
|
1311
1318
|
type: "text",
|
|
1312
|
-
"onUpdate:modelValue":
|
|
1319
|
+
"onUpdate:modelValue": u[0] || (u[0] = (h) => s.value = h),
|
|
1313
1320
|
placeholder: "Search...",
|
|
1314
1321
|
class: "vs-multiselect-search vs-w-full"
|
|
1315
1322
|
}, null, 512), [
|
|
1316
|
-
[
|
|
1323
|
+
[ve, s.value]
|
|
1317
1324
|
])
|
|
1318
1325
|
]),
|
|
1319
1326
|
_: 1
|
|
1320
1327
|
}),
|
|
1321
|
-
e.isLoading ? (
|
|
1322
|
-
(
|
|
1323
|
-
key:
|
|
1324
|
-
onClick:
|
|
1325
|
-
class:
|
|
1328
|
+
e.isLoading ? (y(), k("div", no, "Loading options...")) : (y(), k("ul", oo, [
|
|
1329
|
+
(y(!0), k(K, null, Q(r.value, (h) => (y(), k("li", {
|
|
1330
|
+
key: h,
|
|
1331
|
+
onClick: me((g) => d(h), ["stop"]),
|
|
1332
|
+
class: G({ selected: l.value.includes(h) })
|
|
1326
1333
|
}, [
|
|
1327
|
-
|
|
1328
|
-
l.value.includes(
|
|
1329
|
-
|
|
1334
|
+
w("span", lo, H(h), 1),
|
|
1335
|
+
l.value.includes(h) ? (y(), k("svg", ao, [...u[1] || (u[1] = [
|
|
1336
|
+
w("path", {
|
|
1330
1337
|
"stroke-linecap": "round",
|
|
1331
1338
|
"stroke-linejoin": "round",
|
|
1332
1339
|
"stroke-width": "2",
|
|
1333
1340
|
d: "M5 13l4 4L19 7"
|
|
1334
1341
|
}, null, -1)
|
|
1335
|
-
])])) :
|
|
1336
|
-
], 10,
|
|
1342
|
+
])])) : D("", !0)
|
|
1343
|
+
], 10, so))), 128))
|
|
1337
1344
|
]))
|
|
1338
1345
|
]));
|
|
1339
1346
|
}
|
|
1340
|
-
}),
|
|
1341
|
-
function
|
|
1342
|
-
const
|
|
1347
|
+
}), Pe = /* @__PURE__ */ new Map();
|
|
1348
|
+
function io(e) {
|
|
1349
|
+
const n = q(e.columnData || []), t = q(!1), o = () => t.value = !0, s = () => t.value = !1;
|
|
1343
1350
|
async function l(r = !1) {
|
|
1344
1351
|
if (!e.asyncOptions) return;
|
|
1345
|
-
const
|
|
1346
|
-
if (!r &&
|
|
1347
|
-
|
|
1352
|
+
const i = e.cacheKey ?? "default";
|
|
1353
|
+
if (!r && Pe.has(i)) {
|
|
1354
|
+
n.value = Pe.get(i);
|
|
1348
1355
|
return;
|
|
1349
1356
|
}
|
|
1350
1357
|
try {
|
|
1351
1358
|
o();
|
|
1352
|
-
const c = await e.asyncOptions(),
|
|
1353
|
-
|
|
1359
|
+
const c = await e.asyncOptions(), d = Array.isArray(c) ? c : [];
|
|
1360
|
+
n.value = d, Pe.set(i, d);
|
|
1354
1361
|
} catch (c) {
|
|
1355
1362
|
console.error("Failed to load async filter options:", c);
|
|
1356
1363
|
} finally {
|
|
@@ -1359,43 +1366,43 @@ function Yn(e) {
|
|
|
1359
1366
|
}
|
|
1360
1367
|
function a() {
|
|
1361
1368
|
const r = e.cacheKey ?? "default";
|
|
1362
|
-
|
|
1369
|
+
Pe.delete(r);
|
|
1363
1370
|
}
|
|
1364
1371
|
return {
|
|
1365
|
-
columnOrAsyncOptions:
|
|
1366
|
-
isLoading:
|
|
1372
|
+
columnOrAsyncOptions: n,
|
|
1373
|
+
isLoading: t,
|
|
1367
1374
|
clearCache: a,
|
|
1368
1375
|
loadAsyncOptions: l
|
|
1369
1376
|
};
|
|
1370
1377
|
}
|
|
1371
|
-
const
|
|
1378
|
+
const co = {
|
|
1372
1379
|
key: 0,
|
|
1373
1380
|
class: "vs-filter-text"
|
|
1374
|
-
},
|
|
1381
|
+
}, uo = {
|
|
1375
1382
|
key: 0,
|
|
1376
1383
|
class: "vs-pb-sm"
|
|
1377
|
-
},
|
|
1384
|
+
}, fo = ["value"], vo = {
|
|
1378
1385
|
key: 1,
|
|
1379
1386
|
class: "vs-filter-multi"
|
|
1380
|
-
},
|
|
1387
|
+
}, ho = {
|
|
1381
1388
|
key: 2,
|
|
1382
1389
|
class: "vs-filter-range"
|
|
1383
|
-
},
|
|
1390
|
+
}, mo = {
|
|
1384
1391
|
key: 0,
|
|
1385
1392
|
class: "vs-pb-sm"
|
|
1386
|
-
},
|
|
1393
|
+
}, po = ["value"], go = { key: 1 }, yo = { class: "vs-operator-fixed" }, wo = { key: 4 }, bo = {
|
|
1387
1394
|
key: 3,
|
|
1388
1395
|
class: "vs-filter-date"
|
|
1389
|
-
},
|
|
1396
|
+
}, xo = {
|
|
1390
1397
|
key: 0,
|
|
1391
1398
|
class: "vs-pb-sm"
|
|
1392
|
-
},
|
|
1399
|
+
}, ko = ["value"], Co = { key: 1 }, So = { class: "vs-operator-fixed" }, Ro = {
|
|
1393
1400
|
key: 4,
|
|
1394
1401
|
class: "vs-muted vs-text-center vs-pt-sm"
|
|
1395
|
-
},
|
|
1402
|
+
}, Eo = {
|
|
1396
1403
|
key: 4,
|
|
1397
1404
|
class: "vs-filter-actions"
|
|
1398
|
-
},
|
|
1405
|
+
}, $o = /* @__PURE__ */ _({
|
|
1399
1406
|
__name: "VsDataTableFilterDropdown",
|
|
1400
1407
|
props: {
|
|
1401
1408
|
modelValue: {},
|
|
@@ -1407,11 +1414,11 @@ const Gn = {
|
|
|
1407
1414
|
asyncOptions: {}
|
|
1408
1415
|
},
|
|
1409
1416
|
emits: ["update:modelValue", "apply", "clear", "open", "close"],
|
|
1410
|
-
setup(e, { emit:
|
|
1411
|
-
const
|
|
1412
|
-
asyncOptions:
|
|
1413
|
-
columnData:
|
|
1414
|
-
cacheKey:
|
|
1417
|
+
setup(e, { emit: n }) {
|
|
1418
|
+
const t = e, o = n, { columnOrAsyncOptions: s, isLoading: l, loadAsyncOptions: a } = io({
|
|
1419
|
+
asyncOptions: t.asyncOptions,
|
|
1420
|
+
columnData: t.columnData,
|
|
1421
|
+
cacheKey: t.field
|
|
1415
1422
|
}), r = {
|
|
1416
1423
|
text: [
|
|
1417
1424
|
"contains",
|
|
@@ -1428,8 +1435,8 @@ const Gn = {
|
|
|
1428
1435
|
"date-range": ["between", "equals", "notEqual", "before", "after", "empty", "notEmpty"],
|
|
1429
1436
|
custom: []
|
|
1430
1437
|
};
|
|
1431
|
-
function
|
|
1432
|
-
switch (
|
|
1438
|
+
function i(b) {
|
|
1439
|
+
switch (b) {
|
|
1433
1440
|
case "notEqual":
|
|
1434
1441
|
return "Not Equal";
|
|
1435
1442
|
case "greaterThan":
|
|
@@ -1447,330 +1454,463 @@ const Gn = {
|
|
|
1447
1454
|
case "notEmpty":
|
|
1448
1455
|
return "Not Empty";
|
|
1449
1456
|
default:
|
|
1450
|
-
return
|
|
1457
|
+
return b.charAt(0).toUpperCase() + b.slice(1);
|
|
1451
1458
|
}
|
|
1452
1459
|
}
|
|
1453
|
-
const c =
|
|
1454
|
-
|
|
1455
|
-
() =>
|
|
1456
|
-
async (
|
|
1457
|
-
|
|
1460
|
+
const c = F(() => t.type === "custom" ? [] : t.operators?.length ? t.operators : r[t.type]), d = q(null), v = q(null), m = q(), f = q(!1);
|
|
1461
|
+
Y(
|
|
1462
|
+
() => t.visible,
|
|
1463
|
+
async (b) => {
|
|
1464
|
+
f.value = !!b, f.value ? (await oe(), E(), t.asyncOptions && a()) : L();
|
|
1458
1465
|
},
|
|
1459
1466
|
{ immediate: !0 }
|
|
1460
1467
|
);
|
|
1461
|
-
const
|
|
1462
|
-
|
|
1463
|
-
() =>
|
|
1464
|
-
(
|
|
1465
|
-
|
|
1468
|
+
const u = q(Ce(t.type, t.modelValue));
|
|
1469
|
+
Y(
|
|
1470
|
+
() => t.modelValue,
|
|
1471
|
+
(b) => {
|
|
1472
|
+
u.value = Ce(t.type, b);
|
|
1466
1473
|
},
|
|
1467
1474
|
{ immediate: !0 }
|
|
1468
1475
|
);
|
|
1469
|
-
function
|
|
1476
|
+
function h() {
|
|
1470
1477
|
o("open");
|
|
1471
1478
|
}
|
|
1472
|
-
function
|
|
1473
|
-
o("update:modelValue", { ...
|
|
1479
|
+
function g() {
|
|
1480
|
+
o("update:modelValue", { ...u.value }), o("apply", { ...u.value });
|
|
1474
1481
|
}
|
|
1475
1482
|
function C() {
|
|
1476
|
-
|
|
1483
|
+
u.value = Ce(t.type), o("update:modelValue", { ...u.value }), o("clear"), S();
|
|
1477
1484
|
}
|
|
1478
|
-
function
|
|
1485
|
+
function S() {
|
|
1479
1486
|
o("close");
|
|
1480
1487
|
}
|
|
1481
|
-
function
|
|
1482
|
-
!
|
|
1483
|
-
|
|
1488
|
+
function E() {
|
|
1489
|
+
!d.value || !v.value || (m.value = Zn(d.value, v.value, () => {
|
|
1490
|
+
Gn(d.value, v.value, {
|
|
1484
1491
|
placement: "bottom-start",
|
|
1485
|
-
middleware: [
|
|
1486
|
-
}).then(({ x:
|
|
1487
|
-
Object.assign(
|
|
1488
|
-
left: `${
|
|
1489
|
-
top: `${
|
|
1492
|
+
middleware: [Xn(6), Yn(), Qn({ padding: 8 })]
|
|
1493
|
+
}).then(({ x: b, y: p }) => {
|
|
1494
|
+
Object.assign(v.value.style, {
|
|
1495
|
+
left: `${b}px`,
|
|
1496
|
+
top: `${p}px`,
|
|
1490
1497
|
position: "absolute",
|
|
1491
1498
|
zIndex: 2e3
|
|
1492
1499
|
});
|
|
1493
1500
|
});
|
|
1494
1501
|
}));
|
|
1495
1502
|
}
|
|
1496
|
-
function
|
|
1497
|
-
|
|
1503
|
+
function L() {
|
|
1504
|
+
m.value?.(), m.value = void 0;
|
|
1498
1505
|
}
|
|
1499
|
-
function
|
|
1500
|
-
const
|
|
1501
|
-
|
|
1506
|
+
function P(b) {
|
|
1507
|
+
const p = b.target;
|
|
1508
|
+
f.value && d.value && v.value && !d.value.contains(p) && !v.value.contains(p) && S();
|
|
1502
1509
|
}
|
|
1503
|
-
function
|
|
1504
|
-
|
|
1510
|
+
function B(b) {
|
|
1511
|
+
b.key === "Escape" && f.value && S();
|
|
1505
1512
|
}
|
|
1506
|
-
return
|
|
1507
|
-
document.addEventListener("click",
|
|
1508
|
-
}),
|
|
1509
|
-
document.removeEventListener("click",
|
|
1510
|
-
}), (
|
|
1511
|
-
|
|
1513
|
+
return Re(() => {
|
|
1514
|
+
document.addEventListener("click", P), document.addEventListener("keydown", B);
|
|
1515
|
+
}), mt(() => {
|
|
1516
|
+
document.removeEventListener("click", P), document.removeEventListener("keydown", B), L();
|
|
1517
|
+
}), (b, p) => (y(), k(K, null, [
|
|
1518
|
+
w("span", {
|
|
1512
1519
|
ref_key: "referenceRef",
|
|
1513
|
-
ref:
|
|
1514
|
-
class:
|
|
1515
|
-
"is-active":
|
|
1516
|
-
"in-active":
|
|
1520
|
+
ref: d,
|
|
1521
|
+
class: G(["vs-column-filter", {
|
|
1522
|
+
"is-active": $(vt)(u.value),
|
|
1523
|
+
"in-active": !$(vt)(u.value)
|
|
1517
1524
|
}]),
|
|
1518
|
-
onClick:
|
|
1519
|
-
}, [...
|
|
1520
|
-
|
|
1525
|
+
onClick: me(h, ["stop"])
|
|
1526
|
+
}, [...p[13] || (p[13] = [
|
|
1527
|
+
w("svg", {
|
|
1521
1528
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1522
1529
|
height: "24px",
|
|
1523
1530
|
viewBox: "0 -960 960 960",
|
|
1524
1531
|
width: "24px",
|
|
1525
1532
|
fill: "currentColor"
|
|
1526
1533
|
}, [
|
|
1527
|
-
|
|
1534
|
+
w("path", { d: "M400-240v-80h160v80H400ZM240-440v-80h480v80H240ZM120-640v-80h720v80H120Z" })
|
|
1528
1535
|
], -1)
|
|
1529
1536
|
])], 2),
|
|
1530
|
-
(
|
|
1531
|
-
|
|
1532
|
-
default:
|
|
1533
|
-
|
|
1537
|
+
(y(), fe(Dt, { to: "body" }, [
|
|
1538
|
+
ne(It, { name: "fade" }, {
|
|
1539
|
+
default: X(() => [
|
|
1540
|
+
f.value ? (y(), k("div", {
|
|
1534
1541
|
key: 0,
|
|
1535
1542
|
ref_key: "floatingRef",
|
|
1536
|
-
ref:
|
|
1543
|
+
ref: v,
|
|
1537
1544
|
class: "vs-filter-dropdown",
|
|
1538
1545
|
style: { position: "absolute", "z-index": "1000" },
|
|
1539
|
-
onClick:
|
|
1546
|
+
onClick: p[12] || (p[12] = me(() => {
|
|
1540
1547
|
}, ["stop"]))
|
|
1541
1548
|
}, [
|
|
1542
|
-
|
|
1543
|
-
c.value.length > 1 ? (
|
|
1544
|
-
|
|
1545
|
-
"onUpdate:modelValue":
|
|
1549
|
+
u.value.type === "text" ? (y(), k("div", co, [
|
|
1550
|
+
c.value.length > 1 ? (y(), k("div", uo, [
|
|
1551
|
+
te(w("select", {
|
|
1552
|
+
"onUpdate:modelValue": p[0] || (p[0] = (x) => u.value.operator = x),
|
|
1546
1553
|
class: "vs-operator-select vs-mx-auto vs-w-full"
|
|
1547
1554
|
}, [
|
|
1548
|
-
(
|
|
1549
|
-
key:
|
|
1550
|
-
value:
|
|
1551
|
-
},
|
|
1555
|
+
(y(!0), k(K, null, Q(c.value, (x) => (y(), k("option", {
|
|
1556
|
+
key: x,
|
|
1557
|
+
value: x
|
|
1558
|
+
}, H(i(x)), 9, fo))), 128))
|
|
1552
1559
|
], 512), [
|
|
1553
|
-
[
|
|
1560
|
+
[Xe, u.value.operator]
|
|
1554
1561
|
])
|
|
1555
|
-
])) :
|
|
1556
|
-
|
|
1562
|
+
])) : D("", !0),
|
|
1563
|
+
ne(ye, {
|
|
1557
1564
|
direction: "row",
|
|
1558
1565
|
class: "mb-6"
|
|
1559
1566
|
}, {
|
|
1560
|
-
default:
|
|
1561
|
-
|
|
1567
|
+
default: X(() => [
|
|
1568
|
+
te(w("input", {
|
|
1562
1569
|
type: "text",
|
|
1563
|
-
"onUpdate:modelValue":
|
|
1570
|
+
"onUpdate:modelValue": p[1] || (p[1] = (x) => u.value.value = x),
|
|
1564
1571
|
placeholder: "Search...",
|
|
1565
1572
|
class: "vs-input vs-mx-auto vs-w-full"
|
|
1566
1573
|
}, null, 512), [
|
|
1567
|
-
[
|
|
1574
|
+
[ve, u.value.value]
|
|
1568
1575
|
])
|
|
1569
1576
|
]),
|
|
1570
1577
|
_: 1
|
|
1571
1578
|
})
|
|
1572
|
-
])) :
|
|
1573
|
-
|
|
1579
|
+
])) : u.value.type === "multi-select" ? (y(), k("div", vo, [
|
|
1580
|
+
ne(ye, {
|
|
1574
1581
|
direction: "row",
|
|
1575
1582
|
class: "mb-6 vs-align-center vs-justify-end"
|
|
1576
1583
|
}, {
|
|
1577
|
-
default:
|
|
1578
|
-
e.asyncOptions ? (
|
|
1584
|
+
default: X(() => [
|
|
1585
|
+
e.asyncOptions ? (y(), k("span", {
|
|
1579
1586
|
key: 0,
|
|
1580
|
-
onClick:
|
|
1587
|
+
onClick: p[2] || (p[2] = (x) => $(a)(!0)),
|
|
1581
1588
|
class: "vs-cursor-pointer"
|
|
1582
|
-
}, [...
|
|
1583
|
-
|
|
1589
|
+
}, [...p[14] || (p[14] = [
|
|
1590
|
+
w("svg", {
|
|
1584
1591
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1585
1592
|
height: "24px",
|
|
1586
1593
|
viewBox: "0 -960 960 960",
|
|
1587
1594
|
width: "24px",
|
|
1588
1595
|
fill: "var(--vs-inactive)"
|
|
1589
1596
|
}, [
|
|
1590
|
-
|
|
1597
|
+
w("path", { d: "M480-160q-134 0-227-93t-93-227q0-134 93-227t227-93q69 0 132 28.5T720-690v-110h80v280H520v-80h168q-32-56-87.5-88T480-720q-100 0-170 70t-70 170q0 100 70 170t170 70q77 0 139-44t87-116h84q-28 106-114 173t-196 67Z" })
|
|
1591
1598
|
], -1)
|
|
1592
|
-
])])) :
|
|
1599
|
+
])])) : D("", !0)
|
|
1593
1600
|
]),
|
|
1594
1601
|
_: 1
|
|
1595
1602
|
}),
|
|
1596
|
-
|
|
1597
|
-
isLoading:
|
|
1598
|
-
columnData:
|
|
1599
|
-
modelValue:
|
|
1600
|
-
"onUpdate:modelValue":
|
|
1603
|
+
ne(ro, {
|
|
1604
|
+
isLoading: $(l),
|
|
1605
|
+
columnData: $(s),
|
|
1606
|
+
modelValue: u.value.value,
|
|
1607
|
+
"onUpdate:modelValue": p[3] || (p[3] = (x) => u.value.value = x),
|
|
1601
1608
|
placeholder: "Select values..."
|
|
1602
1609
|
}, null, 8, ["isLoading", "columnData", "modelValue"])
|
|
1603
|
-
])) :
|
|
1604
|
-
c.value.length > 1 ? (
|
|
1605
|
-
|
|
1606
|
-
"onUpdate:modelValue":
|
|
1610
|
+
])) : u.value.type === "number-range" ? (y(), k("div", ho, [
|
|
1611
|
+
c.value.length > 1 ? (y(), k("div", mo, [
|
|
1612
|
+
te(w("select", {
|
|
1613
|
+
"onUpdate:modelValue": p[4] || (p[4] = (x) => u.value.operator = x),
|
|
1607
1614
|
class: "vs-operator-select vs-w-full"
|
|
1608
1615
|
}, [
|
|
1609
|
-
(
|
|
1610
|
-
key:
|
|
1611
|
-
value:
|
|
1612
|
-
},
|
|
1616
|
+
(y(!0), k(K, null, Q(c.value, (x) => (y(), k("option", {
|
|
1617
|
+
key: x,
|
|
1618
|
+
value: x
|
|
1619
|
+
}, H(i(x)), 9, po))), 128))
|
|
1613
1620
|
], 512), [
|
|
1614
|
-
[
|
|
1621
|
+
[Xe, u.value.operator]
|
|
1615
1622
|
])
|
|
1616
|
-
])) : (
|
|
1617
|
-
|
|
1623
|
+
])) : (y(), k("div", go, [
|
|
1624
|
+
w("span", yo, H(u.value.operator), 1)
|
|
1618
1625
|
])),
|
|
1619
|
-
|
|
1626
|
+
u.value.operator === "between" ? (y(), fe(ye, {
|
|
1620
1627
|
key: 2,
|
|
1621
1628
|
justify: "between",
|
|
1622
1629
|
align: "center",
|
|
1623
1630
|
gap: "4",
|
|
1624
1631
|
class: "mb-6"
|
|
1625
1632
|
}, {
|
|
1626
|
-
default:
|
|
1627
|
-
|
|
1633
|
+
default: X(() => [
|
|
1634
|
+
te(w("input", {
|
|
1628
1635
|
type: "number",
|
|
1629
|
-
"onUpdate:modelValue":
|
|
1636
|
+
"onUpdate:modelValue": p[5] || (p[5] = (x) => u.value.min = x),
|
|
1630
1637
|
placeholder: "Min",
|
|
1631
1638
|
class: "vs-input vs-w-full"
|
|
1632
1639
|
}, null, 512), [
|
|
1633
1640
|
[
|
|
1634
|
-
|
|
1635
|
-
|
|
1641
|
+
ve,
|
|
1642
|
+
u.value.min,
|
|
1636
1643
|
void 0,
|
|
1637
1644
|
{ number: !0 }
|
|
1638
1645
|
]
|
|
1639
1646
|
]),
|
|
1640
|
-
|
|
1641
|
-
|
|
1647
|
+
p[15] || (p[15] = w("span", null, "-", -1)),
|
|
1648
|
+
te(w("input", {
|
|
1642
1649
|
type: "number",
|
|
1643
|
-
"onUpdate:modelValue":
|
|
1650
|
+
"onUpdate:modelValue": p[6] || (p[6] = (x) => u.value.max = x),
|
|
1644
1651
|
placeholder: "Max",
|
|
1645
1652
|
class: "vs-input vs-w-full"
|
|
1646
1653
|
}, null, 512), [
|
|
1647
1654
|
[
|
|
1648
|
-
|
|
1649
|
-
|
|
1655
|
+
ve,
|
|
1656
|
+
u.value.max,
|
|
1650
1657
|
void 0,
|
|
1651
1658
|
{ number: !0 }
|
|
1652
1659
|
]
|
|
1653
1660
|
])
|
|
1654
1661
|
]),
|
|
1655
1662
|
_: 1
|
|
1656
|
-
})) : ["equals", "notEqual", "greaterThan", "lessThan"].includes(
|
|
1663
|
+
})) : ["equals", "notEqual", "greaterThan", "lessThan"].includes(u.value.operator || "") ? (y(), fe(ye, {
|
|
1657
1664
|
key: 3,
|
|
1658
1665
|
direction: "row"
|
|
1659
1666
|
}, {
|
|
1660
|
-
default:
|
|
1661
|
-
|
|
1667
|
+
default: X(() => [
|
|
1668
|
+
te(w("input", {
|
|
1662
1669
|
type: "number",
|
|
1663
|
-
"onUpdate:modelValue":
|
|
1670
|
+
"onUpdate:modelValue": p[7] || (p[7] = (x) => u.value.value = x),
|
|
1664
1671
|
placeholder: "Enter number",
|
|
1665
1672
|
class: "vs-input vs-w-full"
|
|
1666
1673
|
}, null, 512), [
|
|
1667
1674
|
[
|
|
1668
|
-
|
|
1669
|
-
|
|
1675
|
+
ve,
|
|
1676
|
+
u.value.value,
|
|
1670
1677
|
void 0,
|
|
1671
1678
|
{ number: !0 }
|
|
1672
1679
|
]
|
|
1673
1680
|
])
|
|
1674
1681
|
]),
|
|
1675
1682
|
_: 1
|
|
1676
|
-
})) : ["empty", "notEmpty"].includes(
|
|
1677
|
-
|
|
1678
|
-
])])) :
|
|
1679
|
-
])) :
|
|
1680
|
-
c.value.length > 1 ? (
|
|
1681
|
-
|
|
1682
|
-
"onUpdate:modelValue":
|
|
1683
|
+
})) : ["empty", "notEmpty"].includes(u.value.operator || "") ? (y(), k("div", wo, [...p[16] || (p[16] = [
|
|
1684
|
+
w("div", { class: "vs-muted vs-text-center vs-pt-sm" }, "No input required", -1)
|
|
1685
|
+
])])) : D("", !0)
|
|
1686
|
+
])) : u.value.type === "date-range" ? (y(), k("div", bo, [
|
|
1687
|
+
c.value.length > 1 ? (y(), k("div", xo, [
|
|
1688
|
+
te(w("select", {
|
|
1689
|
+
"onUpdate:modelValue": p[8] || (p[8] = (x) => u.value.operator = x),
|
|
1683
1690
|
class: "vs-operator-select vs-w-full"
|
|
1684
1691
|
}, [
|
|
1685
|
-
(
|
|
1686
|
-
key:
|
|
1687
|
-
value:
|
|
1688
|
-
},
|
|
1692
|
+
(y(!0), k(K, null, Q(c.value, (x) => (y(), k("option", {
|
|
1693
|
+
key: x,
|
|
1694
|
+
value: x
|
|
1695
|
+
}, H(i(x)), 9, ko))), 128))
|
|
1689
1696
|
], 512), [
|
|
1690
|
-
[
|
|
1697
|
+
[Xe, u.value.operator]
|
|
1691
1698
|
])
|
|
1692
|
-
])) : (
|
|
1693
|
-
|
|
1699
|
+
])) : (y(), k("div", Co, [
|
|
1700
|
+
w("span", So, H(u.value.operator), 1)
|
|
1694
1701
|
])),
|
|
1695
|
-
|
|
1702
|
+
u.value.operator === "between" ? (y(), fe(ye, {
|
|
1696
1703
|
key: 2,
|
|
1697
1704
|
justify: "between",
|
|
1698
1705
|
align: "center",
|
|
1699
1706
|
gap: "4",
|
|
1700
1707
|
class: "mb-6"
|
|
1701
1708
|
}, {
|
|
1702
|
-
default:
|
|
1703
|
-
|
|
1709
|
+
default: X(() => [
|
|
1710
|
+
te(w("input", {
|
|
1704
1711
|
type: "date",
|
|
1705
|
-
"onUpdate:modelValue":
|
|
1712
|
+
"onUpdate:modelValue": p[9] || (p[9] = (x) => u.value.start = x),
|
|
1706
1713
|
class: "vs-input vs-w-full"
|
|
1707
1714
|
}, null, 512), [
|
|
1708
|
-
[
|
|
1715
|
+
[ve, u.value.start]
|
|
1709
1716
|
]),
|
|
1710
|
-
|
|
1711
|
-
|
|
1717
|
+
p[17] || (p[17] = w("span", null, "-", -1)),
|
|
1718
|
+
te(w("input", {
|
|
1712
1719
|
type: "date",
|
|
1713
|
-
"onUpdate:modelValue":
|
|
1720
|
+
"onUpdate:modelValue": p[10] || (p[10] = (x) => u.value.end = x),
|
|
1714
1721
|
class: "vs-input vs-w-full"
|
|
1715
1722
|
}, null, 512), [
|
|
1716
|
-
[
|
|
1723
|
+
[ve, u.value.end]
|
|
1717
1724
|
])
|
|
1718
1725
|
]),
|
|
1719
1726
|
_: 1
|
|
1720
|
-
})) : ["equals", "notEqual", "before", "after"].includes(
|
|
1727
|
+
})) : ["equals", "notEqual", "before", "after"].includes(u.value.operator || "") ? (y(), fe(ye, {
|
|
1721
1728
|
key: 3,
|
|
1722
1729
|
direction: "row",
|
|
1723
1730
|
class: "vs-filter-single-date"
|
|
1724
1731
|
}, {
|
|
1725
|
-
default:
|
|
1726
|
-
|
|
1732
|
+
default: X(() => [
|
|
1733
|
+
te(w("input", {
|
|
1727
1734
|
type: "date",
|
|
1728
|
-
"onUpdate:modelValue":
|
|
1735
|
+
"onUpdate:modelValue": p[11] || (p[11] = (x) => u.value.value = x),
|
|
1729
1736
|
class: "vs-input vs-w-full"
|
|
1730
1737
|
}, null, 512), [
|
|
1731
|
-
[
|
|
1738
|
+
[ve, u.value.value]
|
|
1732
1739
|
])
|
|
1733
1740
|
]),
|
|
1734
1741
|
_: 1
|
|
1735
|
-
})) : ["empty", "notEmpty"].includes(
|
|
1736
|
-
])) :
|
|
1737
|
-
|
|
1738
|
-
|
|
1742
|
+
})) : ["empty", "notEmpty"].includes(u.value.operator || "") ? (y(), k("div", Ro, " No date input required ")) : D("", !0)
|
|
1743
|
+
])) : D("", !0),
|
|
1744
|
+
u.value.type !== "custom" ? (y(), k("div", Eo, [
|
|
1745
|
+
w("button", {
|
|
1739
1746
|
class: "vs-btn vs-btn-primary",
|
|
1740
|
-
onClick:
|
|
1747
|
+
onClick: g
|
|
1741
1748
|
}, "Apply"),
|
|
1742
|
-
|
|
1749
|
+
w("button", {
|
|
1743
1750
|
class: "vs-btn vs-btn-secondary",
|
|
1744
1751
|
onClick: C
|
|
1745
1752
|
}, "Clear")
|
|
1746
|
-
])) :
|
|
1747
|
-
|
|
1748
|
-
filter:
|
|
1749
|
-
apply:
|
|
1753
|
+
])) : D("", !0),
|
|
1754
|
+
z(b.$slots, "custom", {
|
|
1755
|
+
filter: u.value,
|
|
1756
|
+
apply: g,
|
|
1750
1757
|
clear: C
|
|
1751
1758
|
}, void 0, !0)
|
|
1752
|
-
], 512)) :
|
|
1759
|
+
], 512)) : D("", !0)
|
|
1753
1760
|
]),
|
|
1754
1761
|
_: 3
|
|
1755
1762
|
})
|
|
1756
1763
|
]))
|
|
1757
1764
|
], 64));
|
|
1758
1765
|
}
|
|
1759
|
-
}),
|
|
1766
|
+
}), Ao = /* @__PURE__ */ ae($o, [["__scopeId", "data-v-f4972f8b"]]), Fo = ["data-field", "rowspan"], To = { class: "vs-header-content" }, Oo = { class: "vs-header-label" }, Vo = {
|
|
1767
|
+
key: 0,
|
|
1768
|
+
class: "vs-sort-icons"
|
|
1769
|
+
}, Lo = {
|
|
1770
|
+
key: 1,
|
|
1771
|
+
class: "vs-sort-priority"
|
|
1772
|
+
}, Po = /* @__PURE__ */ _({
|
|
1773
|
+
__name: "HeaderCell",
|
|
1774
|
+
props: {
|
|
1775
|
+
column: {},
|
|
1776
|
+
rows: {},
|
|
1777
|
+
rowspan: {},
|
|
1778
|
+
sortHelpers: {},
|
|
1779
|
+
filters: {},
|
|
1780
|
+
openFilter: {},
|
|
1781
|
+
headerClass: {},
|
|
1782
|
+
tablename: {}
|
|
1783
|
+
},
|
|
1784
|
+
emits: ["applyFilter", "clearFilter", "openFilter", "closeFilter", "update:filters"],
|
|
1785
|
+
setup(e, { emit: n }) {
|
|
1786
|
+
const t = e, o = n, s = F({
|
|
1787
|
+
get: () => t.filters,
|
|
1788
|
+
set: (v) => o("update:filters", v)
|
|
1789
|
+
});
|
|
1790
|
+
function l(v) {
|
|
1791
|
+
t.column.sortable && t.column.field && t.sortHelpers.handleSort(t.column.field, v);
|
|
1792
|
+
}
|
|
1793
|
+
function a() {
|
|
1794
|
+
return t.column.field ? t.rows.map((v) => v[t.column.field]) : [];
|
|
1795
|
+
}
|
|
1796
|
+
function r(v) {
|
|
1797
|
+
t.column.field && o("applyFilter", t.column.field, v);
|
|
1798
|
+
}
|
|
1799
|
+
function i() {
|
|
1800
|
+
t.column.field && o("clearFilter", t.column.field);
|
|
1801
|
+
}
|
|
1802
|
+
function c() {
|
|
1803
|
+
t.column.field && o("closeFilter", t.column.field);
|
|
1804
|
+
}
|
|
1805
|
+
function d() {
|
|
1806
|
+
t.column.field && o("openFilter", t.column.field);
|
|
1807
|
+
}
|
|
1808
|
+
return (v, m) => e.column && e.column.field ? (y(), k("th", {
|
|
1809
|
+
key: 0,
|
|
1810
|
+
onClick: l,
|
|
1811
|
+
style: pt([
|
|
1812
|
+
{
|
|
1813
|
+
width: e.column.width + "%",
|
|
1814
|
+
textAlign: "center"
|
|
1815
|
+
}
|
|
1816
|
+
]),
|
|
1817
|
+
"data-field": e.column.field || e.column.label,
|
|
1818
|
+
rowspan: e.rowspan,
|
|
1819
|
+
class: G(["vs-group-header", [
|
|
1820
|
+
e.headerClass,
|
|
1821
|
+
e.column.colHeaderClass,
|
|
1822
|
+
e.column.sortable ? "vs-sortable" : ""
|
|
1823
|
+
]])
|
|
1824
|
+
}, [
|
|
1825
|
+
z(v.$slots, `header-${e.column.field}`, { column: e.column }, () => [
|
|
1826
|
+
w("div", To, [
|
|
1827
|
+
w("span", Oo, H(e.column.label), 1),
|
|
1828
|
+
e.column.sortable ? (y(), k("div", Vo, [
|
|
1829
|
+
w("span", {
|
|
1830
|
+
class: G(["vs-sort-icon vs-sort-asc", {
|
|
1831
|
+
"vs-active": e.sortHelpers.isColumnSorted(e.column.field) && e.sortHelpers.getSortOrder(e.column.field) === "asc"
|
|
1832
|
+
}])
|
|
1833
|
+
}, [...m[2] || (m[2] = [
|
|
1834
|
+
w("svg", {
|
|
1835
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1836
|
+
height: "24px",
|
|
1837
|
+
viewBox: "0 -960 960 960",
|
|
1838
|
+
width: "24px",
|
|
1839
|
+
fill: "var(--vs-gray-800)"
|
|
1840
|
+
}, [
|
|
1841
|
+
w("path", { d: "m280-400 200-200 200 200H280Z" })
|
|
1842
|
+
], -1)
|
|
1843
|
+
])], 2),
|
|
1844
|
+
w("span", {
|
|
1845
|
+
class: G(["vs-sort-icon vs-sort-desc", {
|
|
1846
|
+
"vs-active": e.sortHelpers.isColumnSorted(e.column.field) && e.sortHelpers.getSortOrder(e.column.field) === "desc"
|
|
1847
|
+
}])
|
|
1848
|
+
}, [...m[3] || (m[3] = [
|
|
1849
|
+
w("svg", {
|
|
1850
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1851
|
+
height: "24px",
|
|
1852
|
+
viewBox: "0 -960 960 960",
|
|
1853
|
+
width: "24px"
|
|
1854
|
+
}, [
|
|
1855
|
+
w("path", { d: "M480-360 280-560h400L480-360Z" })
|
|
1856
|
+
], -1)
|
|
1857
|
+
])], 2)
|
|
1858
|
+
])) : D("", !0),
|
|
1859
|
+
e.sortHelpers.getSortPriority(e.column.field) !== null ? (y(), k("span", Lo, H(e.sortHelpers.getSortPriority(e.column.field)), 1)) : D("", !0),
|
|
1860
|
+
e.column.filter ? (y(), fe(Ao, {
|
|
1861
|
+
key: 2,
|
|
1862
|
+
type: e.column.filter.type,
|
|
1863
|
+
"async-options": e.column.filter.asyncOptions,
|
|
1864
|
+
field: e.column.field,
|
|
1865
|
+
operators: e.column.filter.operators,
|
|
1866
|
+
modelValue: s.value[e.column.field],
|
|
1867
|
+
"onUpdate:modelValue": m[0] || (m[0] = (f) => s.value[e.column.field] = f),
|
|
1868
|
+
visible: e.openFilter === e.column.field,
|
|
1869
|
+
"column-data": a(),
|
|
1870
|
+
onApply: m[1] || (m[1] = (f) => r(f)),
|
|
1871
|
+
onClear: i,
|
|
1872
|
+
onClose: c,
|
|
1873
|
+
onOpen: d
|
|
1874
|
+
}, Te({ _: 2 }, [
|
|
1875
|
+
e.column.filter.custom ? {
|
|
1876
|
+
name: "custom",
|
|
1877
|
+
fn: X(({ filter: f, apply: u, clear: h }) => [
|
|
1878
|
+
z(v.$slots, e.column.filter.custom, {
|
|
1879
|
+
filter: f,
|
|
1880
|
+
apply: u,
|
|
1881
|
+
clear: h
|
|
1882
|
+
}, void 0, !0)
|
|
1883
|
+
]),
|
|
1884
|
+
key: "0"
|
|
1885
|
+
} : void 0
|
|
1886
|
+
]), 1032, ["type", "async-options", "field", "operators", "modelValue", "visible", "column-data"])) : D("", !0)
|
|
1887
|
+
])
|
|
1888
|
+
], !0)
|
|
1889
|
+
], 14, Fo)) : D("", !0);
|
|
1890
|
+
}
|
|
1891
|
+
}), ht = /* @__PURE__ */ ae(Po, [["__scopeId", "data-v-69e5e343"]]), Do = { key: 0 }, Io = {
|
|
1760
1892
|
key: 0,
|
|
1761
1893
|
class: "vs-expand-column",
|
|
1762
|
-
|
|
1763
|
-
|
|
1894
|
+
rowspan: "2",
|
|
1895
|
+
style: { width: "5%" },
|
|
1896
|
+
"data-field": "_expand"
|
|
1897
|
+
}, qo = {
|
|
1764
1898
|
key: 1,
|
|
1765
1899
|
class: "vs-checkbox-column",
|
|
1766
|
-
|
|
1767
|
-
|
|
1900
|
+
rowspan: "2",
|
|
1901
|
+
style: { width: "5%" },
|
|
1902
|
+
"data-field": "_checkbox"
|
|
1903
|
+
}, Mo = { class: "vs-checkbox" }, Bo = ["id", "checked", "indeterminate"], Ho = ["for"], Wo = ["colspan", "data-field"], No = {
|
|
1768
1904
|
key: 0,
|
|
1769
|
-
class: "vs-
|
|
1770
|
-
|
|
1905
|
+
class: "vs-expand-column",
|
|
1906
|
+
style: { width: "5%" },
|
|
1907
|
+
"data-field": "_expand"
|
|
1908
|
+
}, Ko = {
|
|
1771
1909
|
key: 1,
|
|
1772
|
-
class: "vs-
|
|
1773
|
-
|
|
1910
|
+
class: "vs-checkbox-column",
|
|
1911
|
+
style: { width: "5%" },
|
|
1912
|
+
"data-field": "_checkbox"
|
|
1913
|
+
}, zo = { class: "vs-checkbox" }, jo = ["id", "checked", "indeterminate"], Uo = ["for"], Zo = /* @__PURE__ */ _({
|
|
1774
1914
|
__name: "VsDataTableHeader",
|
|
1775
1915
|
props: {
|
|
1776
1916
|
columns: {},
|
|
@@ -1786,123 +1926,140 @@ const Gn = {
|
|
|
1786
1926
|
headerClass: {}
|
|
1787
1927
|
},
|
|
1788
1928
|
emits: ["toggleAll", "applyFilter", "clearFilter", "update:filters"],
|
|
1789
|
-
setup(e, { emit:
|
|
1790
|
-
const
|
|
1791
|
-
function s(
|
|
1792
|
-
o("toggleAll",
|
|
1929
|
+
setup(e, { emit: n }) {
|
|
1930
|
+
const t = e, o = n;
|
|
1931
|
+
function s(f) {
|
|
1932
|
+
o("toggleAll", f);
|
|
1933
|
+
}
|
|
1934
|
+
const l = F({
|
|
1935
|
+
get: () => t.filters,
|
|
1936
|
+
set: (f) => o("update:filters", f)
|
|
1937
|
+
}), a = q(null);
|
|
1938
|
+
function r(f) {
|
|
1939
|
+
a.value = f;
|
|
1793
1940
|
}
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
set: (c) => o("update:filters", c)
|
|
1797
|
-
}), a = L(null);
|
|
1798
|
-
function r(c) {
|
|
1799
|
-
a.value = c;
|
|
1941
|
+
function i(f) {
|
|
1942
|
+
a.value === f && (a.value = null);
|
|
1800
1943
|
}
|
|
1801
|
-
|
|
1802
|
-
|
|
1944
|
+
const c = q(null), d = F(() => t.columns.some((f) => f.children && f.children.length)), v = F(() => {
|
|
1945
|
+
const f = [];
|
|
1946
|
+
return t.columns.forEach((u) => {
|
|
1947
|
+
u.children && u.children.length ? f.push(...u.children) : f.push(u);
|
|
1948
|
+
}), f;
|
|
1949
|
+
});
|
|
1950
|
+
function m(f) {
|
|
1951
|
+
return d.value ? t.columns.some(
|
|
1952
|
+
(u) => u.children && u.children.some((h) => h.field === f.field)
|
|
1953
|
+
) : !0;
|
|
1803
1954
|
}
|
|
1804
|
-
return (
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1955
|
+
return (f, u) => (y(), k("thead", {
|
|
1956
|
+
ref_key: "headerRef",
|
|
1957
|
+
ref: c
|
|
1958
|
+
}, [
|
|
1959
|
+
d.value ? (y(), k("tr", Do, [
|
|
1960
|
+
e.expandable ? (y(), k("th", Io)) : D("", !0),
|
|
1961
|
+
e.isItemSelectedControlled ? (y(), k("th", qo, [
|
|
1962
|
+
w("div", Mo, [
|
|
1963
|
+
w("input", {
|
|
1810
1964
|
type: "checkbox",
|
|
1811
1965
|
id: e.tablename + "-main-checkbox",
|
|
1812
1966
|
checked: e.isAllChecked,
|
|
1813
1967
|
indeterminate: e.isSomeChecked,
|
|
1814
1968
|
onChange: s
|
|
1815
|
-
}, null, 40,
|
|
1816
|
-
|
|
1969
|
+
}, null, 40, Bo),
|
|
1970
|
+
w("label", {
|
|
1817
1971
|
for: e.tablename + "-main-checkbox"
|
|
1818
|
-
}, null, 8,
|
|
1972
|
+
}, null, 8, Ho)
|
|
1819
1973
|
])
|
|
1820
|
-
])) :
|
|
1821
|
-
(
|
|
1822
|
-
key:
|
|
1823
|
-
onClick: (p) => i.sortable ? e.sortHelpers.handleSort(i.field, p) : null,
|
|
1824
|
-
style: St({ width: i.width + "%" }),
|
|
1825
|
-
class: W([i.sortable ? "vs-sortable" : "", e.headerClass])
|
|
1974
|
+
])) : D("", !0),
|
|
1975
|
+
(y(!0), k(K, null, Q(t.columns, (h) => (y(), k(K, {
|
|
1976
|
+
key: h.field || h.label
|
|
1826
1977
|
}, [
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1978
|
+
!h.children || !h.children.length ? (y(), fe(ht, Ae({
|
|
1979
|
+
key: 0,
|
|
1980
|
+
column: h,
|
|
1981
|
+
rows: e.rows,
|
|
1982
|
+
rowspan: 2,
|
|
1983
|
+
"sort-helpers": e.sortHelpers,
|
|
1984
|
+
filters: l.value,
|
|
1985
|
+
"open-filter": a.value,
|
|
1986
|
+
"header-class": e.headerClass,
|
|
1987
|
+
tablename: e.tablename
|
|
1988
|
+
}, { ref_for: !0 }, f.$attrs, {
|
|
1989
|
+
onApplyFilter: u[0] || (u[0] = (g, C) => o("applyFilter", g, C)),
|
|
1990
|
+
onClearFilter: u[1] || (u[1] = (g) => o("clearFilter", g)),
|
|
1991
|
+
onOpenFilter: r,
|
|
1992
|
+
onCloseFilter: i,
|
|
1993
|
+
"onUpdate:filters": u[2] || (u[2] = (g) => o("update:filters", g))
|
|
1994
|
+
}), Te({ _: 2 }, [
|
|
1995
|
+
Q(f.$slots, (g, C) => ({
|
|
1996
|
+
name: C,
|
|
1997
|
+
fn: X((S) => [
|
|
1998
|
+
z(f.$slots, C, Ae({ ref_for: !0 }, S), void 0, !0)
|
|
1999
|
+
])
|
|
2000
|
+
}))
|
|
2001
|
+
]), 1040, ["column", "rows", "sort-helpers", "filters", "open-filter", "header-class", "tablename"])) : (y(), k("th", {
|
|
2002
|
+
key: 1,
|
|
2003
|
+
colspan: h.children.length,
|
|
2004
|
+
"data-field": `group-${h.label}`,
|
|
2005
|
+
class: "vs-group-header",
|
|
2006
|
+
style: { textAlign: "center" }
|
|
2007
|
+
}, H(h.label), 9, Wo))
|
|
2008
|
+
], 64))), 128))
|
|
2009
|
+
])) : D("", !0),
|
|
2010
|
+
w("tr", null, [
|
|
2011
|
+
e.expandable && !d.value ? (y(), k("th", No)) : D("", !0),
|
|
2012
|
+
e.isItemSelectedControlled && !d.value ? (y(), k("th", Ko, [
|
|
2013
|
+
w("div", zo, [
|
|
2014
|
+
w("input", {
|
|
2015
|
+
type: "checkbox",
|
|
2016
|
+
id: e.tablename + "-main-checkbox",
|
|
2017
|
+
checked: e.isAllChecked,
|
|
2018
|
+
indeterminate: e.isSomeChecked,
|
|
2019
|
+
onChange: s
|
|
2020
|
+
}, null, 40, jo),
|
|
2021
|
+
w("label", {
|
|
2022
|
+
for: e.tablename + "-main-checkbox"
|
|
2023
|
+
}, null, 8, Uo)
|
|
2024
|
+
])
|
|
2025
|
+
])) : D("", !0),
|
|
2026
|
+
(y(!0), k(K, null, Q(v.value, (h) => (y(), k(K, {
|
|
2027
|
+
key: h.field
|
|
2028
|
+
}, [
|
|
2029
|
+
h.field && m(h) ? (y(), fe(ht, Ae({
|
|
2030
|
+
key: 0,
|
|
2031
|
+
column: h,
|
|
2032
|
+
rows: e.rows,
|
|
2033
|
+
"sort-helpers": e.sortHelpers,
|
|
2034
|
+
filters: l.value,
|
|
2035
|
+
"open-filter": a.value,
|
|
2036
|
+
"header-class": e.headerClass,
|
|
2037
|
+
tablename: e.tablename
|
|
2038
|
+
}, { ref_for: !0 }, f.$attrs, {
|
|
2039
|
+
onApplyFilter: u[3] || (u[3] = (g, C) => o("applyFilter", g, C)),
|
|
2040
|
+
onClearFilter: u[4] || (u[4] = (g) => o("clearFilter", g)),
|
|
2041
|
+
onOpenFilter: r,
|
|
2042
|
+
onCloseFilter: i,
|
|
2043
|
+
"onUpdate:filters": u[5] || (u[5] = (g) => o("update:filters", g))
|
|
2044
|
+
}), Te({ _: 2 }, [
|
|
2045
|
+
Q(f.$slots, (g, C) => ({
|
|
2046
|
+
name: C,
|
|
2047
|
+
fn: X((S) => [
|
|
2048
|
+
z(f.$slots, C, Ae({ ref_for: !0 }, S), void 0, !0)
|
|
2049
|
+
])
|
|
2050
|
+
}))
|
|
2051
|
+
]), 1040, ["column", "rows", "sort-helpers", "filters", "open-filter", "header-class", "tablename"])) : D("", !0)
|
|
2052
|
+
], 64))), 128))
|
|
1896
2053
|
])
|
|
1897
|
-
]));
|
|
2054
|
+
], 512));
|
|
1898
2055
|
}
|
|
1899
|
-
}),
|
|
2056
|
+
}), Xo = /* @__PURE__ */ ae(Zo, [["__scopeId", "data-v-f82c670c"]]), Qo = { key: 0 }, Yo = ["colspan"], Go = { key: 1 }, Jo = ["colspan"], _o = { class: "vs-no-data-message" }, es = { class: "vs-no-data-description" }, ts = ["onClick"], ns = ["aria-expanded", "aria-controls", "onClick"], os = { key: 0 }, ss = { key: 1 }, ls = { class: "vs-checkbox" }, as = ["id", "value", "checked", "onChange"], rs = ["for"], is = ["data-field"], cs = {
|
|
1900
2057
|
key: 0,
|
|
1901
2058
|
class: "vs-row-expanded"
|
|
1902
|
-
},
|
|
2059
|
+
}, us = ["colspan"], ds = {
|
|
1903
2060
|
key: 1,
|
|
1904
2061
|
class: "vs-expanded-content"
|
|
1905
|
-
},
|
|
2062
|
+
}, fs = /* @__PURE__ */ _({
|
|
1906
2063
|
__name: "VsDataTableBody",
|
|
1907
2064
|
props: {
|
|
1908
2065
|
loading: { type: Boolean },
|
|
@@ -1929,181 +2086,191 @@ const Gn = {
|
|
|
1929
2086
|
isRowSelected: { type: Function }
|
|
1930
2087
|
},
|
|
1931
2088
|
emits: ["row-click"],
|
|
1932
|
-
setup(e, { emit:
|
|
1933
|
-
const
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
2089
|
+
setup(e, { emit: n }) {
|
|
2090
|
+
const t = e, o = F(() => t.rowKey ?? "id"), s = q(null), l = F(() => t.columns.flatMap(
|
|
2091
|
+
(a) => "children" in a ? a.children : [a]
|
|
2092
|
+
));
|
|
2093
|
+
return (a, r) => (y(), k("tbody", {
|
|
2094
|
+
ref_key: "bodyRef",
|
|
2095
|
+
ref: s
|
|
2096
|
+
}, [
|
|
2097
|
+
e.loading ? (y(), k("tr", Qo, [
|
|
2098
|
+
w("td", {
|
|
1937
2099
|
colspan: e.totalColumns,
|
|
1938
2100
|
class: "vs-loading"
|
|
1939
2101
|
}, [
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
], 8,
|
|
1943
|
-
])) : e.paginatedRows.length ? (
|
|
1944
|
-
key: e.getRowKey(
|
|
2102
|
+
r[2] || (r[2] = w("div", { class: "vs-spinner" }, null, -1)),
|
|
2103
|
+
w("span", null, H(e.loadingText), 1)
|
|
2104
|
+
], 8, Yo)
|
|
2105
|
+
])) : e.paginatedRows.length ? (y(!0), k(K, { key: 2 }, Q(e.paginatedRows, (i, c) => (y(), k(K, {
|
|
2106
|
+
key: e.getRowKey(i, c)
|
|
1945
2107
|
}, [
|
|
1946
|
-
|
|
1947
|
-
class:
|
|
2108
|
+
w("tr", {
|
|
2109
|
+
class: G([
|
|
1948
2110
|
e.rowClass,
|
|
1949
2111
|
{ "vs-row-clickable": e.hasRowClick },
|
|
1950
|
-
{ "vs-row-selected": e.isRowSelected(
|
|
2112
|
+
{ "vs-row-selected": e.isRowSelected(i, e.selectedItems, o.value) }
|
|
1951
2113
|
]),
|
|
1952
|
-
onClick: (
|
|
2114
|
+
onClick: (d) => a.$emit("row-click", i, c)
|
|
1953
2115
|
}, [
|
|
1954
|
-
e.expandable ? (
|
|
2116
|
+
e.expandable ? (y(), k("td", {
|
|
1955
2117
|
key: 0,
|
|
1956
2118
|
class: "vs-expand-column",
|
|
1957
|
-
|
|
2119
|
+
"data-field": "_expand",
|
|
2120
|
+
onClick: r[0] || (r[0] = me(() => {
|
|
1958
2121
|
}, ["stop"]))
|
|
1959
2122
|
}, [
|
|
1960
|
-
|
|
2123
|
+
w("button", {
|
|
1961
2124
|
class: "vs-expand-btn",
|
|
1962
2125
|
type: "button",
|
|
1963
|
-
"aria-expanded": e.isRowExpanded(
|
|
1964
|
-
"aria-controls": `row-details-${e.getRowKey(
|
|
1965
|
-
onClick:
|
|
2126
|
+
"aria-expanded": e.isRowExpanded(i, c),
|
|
2127
|
+
"aria-controls": `row-details-${e.getRowKey(i, c)}`,
|
|
2128
|
+
onClick: me((d) => e.toggleRowExpansion(i, c), ["stop"])
|
|
1966
2129
|
}, [
|
|
1967
|
-
e.isRowExpanded(
|
|
1968
|
-
|
|
2130
|
+
e.isRowExpanded(i, c) ? (y(), k("span", os, [...r[4] || (r[4] = [
|
|
2131
|
+
w("svg", {
|
|
1969
2132
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1970
2133
|
height: "24px",
|
|
1971
2134
|
viewBox: "0 -960 960 960",
|
|
1972
2135
|
width: "24px",
|
|
1973
2136
|
fill: "var(--vs-gray-800)"
|
|
1974
2137
|
}, [
|
|
1975
|
-
|
|
2138
|
+
w("path", { d: "M480-345 240-585l56-56 184 183 184-183 56 56-240 240Z" })
|
|
1976
2139
|
], -1)
|
|
1977
|
-
])])) : (
|
|
1978
|
-
|
|
2140
|
+
])])) : (y(), k("span", ss, [...r[5] || (r[5] = [
|
|
2141
|
+
w("svg", {
|
|
1979
2142
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1980
2143
|
height: "24px",
|
|
1981
2144
|
viewBox: "0 -960 960 960",
|
|
1982
2145
|
width: "24px",
|
|
1983
2146
|
fill: "var(--vs-gray-800)"
|
|
1984
2147
|
}, [
|
|
1985
|
-
|
|
2148
|
+
w("path", { d: "M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z" })
|
|
1986
2149
|
], -1)
|
|
1987
2150
|
])]))
|
|
1988
|
-
], 8,
|
|
1989
|
-
])) :
|
|
1990
|
-
e.isItemSelectedControlled ? (
|
|
2151
|
+
], 8, ns)
|
|
2152
|
+
])) : D("", !0),
|
|
2153
|
+
e.isItemSelectedControlled ? (y(), k("td", {
|
|
1991
2154
|
key: 1,
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
2155
|
+
class: "vs-checkbox-column",
|
|
2156
|
+
"data-field": "_checkbox",
|
|
2157
|
+
onClick: r[1] || (r[1] = me(() => {
|
|
2158
|
+
}, ["stop"]))
|
|
1995
2159
|
}, [
|
|
1996
|
-
|
|
1997
|
-
|
|
2160
|
+
w("div", ls, [
|
|
2161
|
+
w("input", {
|
|
1998
2162
|
type: "checkbox",
|
|
1999
|
-
id: e.tablename + "-checkbox-" + e.getRowKey(
|
|
2000
|
-
value:
|
|
2001
|
-
checked: e.selectedItems.some((
|
|
2002
|
-
onChange: (
|
|
2003
|
-
}, null, 40,
|
|
2004
|
-
|
|
2005
|
-
for: e.tablename + "-checkbox-" + e.getRowKey(
|
|
2006
|
-
}, null, 8,
|
|
2163
|
+
id: e.tablename + "-checkbox-" + e.getRowKey(i, c),
|
|
2164
|
+
value: i,
|
|
2165
|
+
checked: e.selectedItems.some((d, v) => e.getRowKey(d, v) === e.getRowKey(i, c)),
|
|
2166
|
+
onChange: (d) => e.toggleRow(i, c)
|
|
2167
|
+
}, null, 40, as),
|
|
2168
|
+
w("label", {
|
|
2169
|
+
for: e.tablename + "-checkbox-" + e.getRowKey(i, c)
|
|
2170
|
+
}, null, 8, rs)
|
|
2007
2171
|
])
|
|
2008
|
-
])) :
|
|
2009
|
-
(
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2172
|
+
])) : D("", !0),
|
|
2173
|
+
(y(!0), k(K, null, Q(l.value, (d) => (y(), k(K, null, [
|
|
2174
|
+
d && d.field ? (y(), k("td", {
|
|
2175
|
+
key: d.field,
|
|
2176
|
+
class: G(e.cellClass),
|
|
2177
|
+
"data-field": d.field
|
|
2178
|
+
}, [
|
|
2179
|
+
z(a.$slots, `cell-${d.field}`, {
|
|
2180
|
+
item: i,
|
|
2181
|
+
value: e.getValue(i, d.field),
|
|
2182
|
+
column: d,
|
|
2183
|
+
index: c
|
|
2184
|
+
}, () => [
|
|
2185
|
+
Ye(H(e.getValue(i, d.field)), 1)
|
|
2186
|
+
], !0)
|
|
2187
|
+
], 10, is)) : D("", !0)
|
|
2188
|
+
], 64))), 256))
|
|
2189
|
+
], 10, ts),
|
|
2190
|
+
e.expandable ? (y(), k(K, { key: 0 }, [
|
|
2191
|
+
e.isRowExpanded(i, c) ? (y(), k("tr", cs, [
|
|
2192
|
+
w("td", {
|
|
2026
2193
|
colspan: e.totalColumns,
|
|
2027
2194
|
class: "vs-expanded-cell"
|
|
2028
2195
|
}, [
|
|
2029
|
-
e.isRowLoading(
|
|
2196
|
+
e.isRowLoading(i, c) ? z(a.$slots, "row-expanded-loader", {
|
|
2030
2197
|
key: 0,
|
|
2031
|
-
item:
|
|
2032
|
-
index:
|
|
2198
|
+
item: i,
|
|
2199
|
+
index: c
|
|
2033
2200
|
}, () => [
|
|
2034
|
-
|
|
2035
|
-
|
|
2201
|
+
r[6] || (r[6] = w("div", { class: "vs-loader-bar" }, [
|
|
2202
|
+
w("div", { class: "vs-loader-bar-inner" })
|
|
2036
2203
|
], -1))
|
|
2037
|
-
], !0) : (
|
|
2038
|
-
|
|
2039
|
-
item:
|
|
2040
|
-
index:
|
|
2204
|
+
], !0) : (y(), k("div", ds, [
|
|
2205
|
+
z(a.$slots, "row-expanded", {
|
|
2206
|
+
item: i,
|
|
2207
|
+
index: c
|
|
2041
2208
|
}, () => [
|
|
2042
|
-
|
|
2043
|
-
|
|
2209
|
+
r[7] || (r[7] = Ye(" Expanded details for row ", -1)),
|
|
2210
|
+
w("b", null, H(e.getRowKey(i, c)), 1)
|
|
2044
2211
|
], !0)
|
|
2045
2212
|
]))
|
|
2046
|
-
], 8,
|
|
2047
|
-
])) :
|
|
2048
|
-
], 64)) :
|
|
2049
|
-
], 64))), 128)) : (
|
|
2050
|
-
|
|
2213
|
+
], 8, us)
|
|
2214
|
+
])) : D("", !0)
|
|
2215
|
+
], 64)) : D("", !0)
|
|
2216
|
+
], 64))), 128)) : (y(), k("tr", Go, [
|
|
2217
|
+
w("td", {
|
|
2051
2218
|
colspan: e.totalColumns,
|
|
2052
2219
|
class: "vs-no-data"
|
|
2053
2220
|
}, [
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2221
|
+
z(a.$slots, "no-data", {}, () => [
|
|
2222
|
+
r[3] || (r[3] = w("div", { class: "vs-no-data-icon" }, [
|
|
2223
|
+
w("svg", {
|
|
2057
2224
|
viewBox: "0 0 24 24",
|
|
2058
2225
|
fill: "currentColor"
|
|
2059
2226
|
}, [
|
|
2060
|
-
|
|
2227
|
+
w("path", { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-5 14H7v-2h7v2zm3-4H7v-2h10v2zm0-4H7V7h10v2z" })
|
|
2061
2228
|
])
|
|
2062
2229
|
], -1)),
|
|
2063
|
-
|
|
2064
|
-
|
|
2230
|
+
w("div", _o, H(e.noDataText), 1),
|
|
2231
|
+
w("div", es, H(e.noDataDescription), 1)
|
|
2065
2232
|
], !0)
|
|
2066
|
-
], 8,
|
|
2233
|
+
], 8, Jo)
|
|
2067
2234
|
]))
|
|
2068
|
-
]));
|
|
2235
|
+
], 512));
|
|
2069
2236
|
}
|
|
2070
|
-
}),
|
|
2237
|
+
}), vs = /* @__PURE__ */ ae(fs, [["__scopeId", "data-v-d11afcd0"]]), hs = { class: "vs-search" }, ms = ["placeholder", "value"], ps = /* @__PURE__ */ _({
|
|
2071
2238
|
__name: "VsSearch",
|
|
2072
2239
|
props: {
|
|
2073
2240
|
modelValue: {},
|
|
2074
2241
|
placeholder: {}
|
|
2075
2242
|
},
|
|
2076
2243
|
emits: ["update:modelValue", "inputTyped"],
|
|
2077
|
-
setup(e, { emit:
|
|
2078
|
-
const
|
|
2244
|
+
setup(e, { emit: n }) {
|
|
2245
|
+
const t = n, o = (s) => {
|
|
2079
2246
|
const l = s.target;
|
|
2080
|
-
|
|
2247
|
+
t("update:modelValue", l.value), t("inputTyped", l.value);
|
|
2081
2248
|
};
|
|
2082
|
-
return (s, l) => (
|
|
2083
|
-
l[0] || (l[0] =
|
|
2084
|
-
|
|
2249
|
+
return (s, l) => (y(), k("div", hs, [
|
|
2250
|
+
l[0] || (l[0] = w("div", { class: "vs-search-icon" }, [
|
|
2251
|
+
w("svg", {
|
|
2085
2252
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2086
2253
|
height: "22px",
|
|
2087
2254
|
viewBox: "0 -960 960 960",
|
|
2088
2255
|
width: "22px",
|
|
2089
2256
|
fill: "#e3e3e3"
|
|
2090
2257
|
}, [
|
|
2091
|
-
|
|
2258
|
+
w("path", { d: "M784-120 532-372q-30 24-69 38t-83 14q-109 0-184.5-75.5T120-580q0-109 75.5-184.5T380-840q109 0 184.5 75.5T640-580q0 44-14 83t-38 69l252 252-56 56ZM380-400q75 0 127.5-52.5T560-580q0-75-52.5-127.5T380-760q-75 0-127.5 52.5T200-580q0 75 52.5 127.5T380-400Z" })
|
|
2092
2259
|
])
|
|
2093
2260
|
], -1)),
|
|
2094
|
-
|
|
2261
|
+
w("input", {
|
|
2095
2262
|
type: "text",
|
|
2096
2263
|
class: "vs-search-input",
|
|
2097
2264
|
placeholder: e.placeholder,
|
|
2098
2265
|
value: e.modelValue,
|
|
2099
2266
|
onInput: o
|
|
2100
|
-
}, null, 40,
|
|
2267
|
+
}, null, 40, ms)
|
|
2101
2268
|
]));
|
|
2102
2269
|
}
|
|
2103
|
-
}),
|
|
2270
|
+
}), gs = /* @__PURE__ */ ae(ps, [["__scopeId", "data-v-60b73b45"]]), ys = { class: "vs-datatable-toolbar vs-layout-row" }, ws = { class: "vs-layout-start" }, bs = {
|
|
2104
2271
|
key: 0,
|
|
2105
2272
|
class: "vs-search-container"
|
|
2106
|
-
},
|
|
2273
|
+
}, xs = { class: "vs-layout-end" }, ks = /* @__PURE__ */ _({
|
|
2107
2274
|
__name: "VsDataTableToolbar",
|
|
2108
2275
|
props: {
|
|
2109
2276
|
showSearch: { type: Boolean },
|
|
@@ -2112,146 +2279,217 @@ const Gn = {
|
|
|
2112
2279
|
searchClass: {}
|
|
2113
2280
|
},
|
|
2114
2281
|
emits: ["update:searchQuery", "search"],
|
|
2115
|
-
setup(e, { emit:
|
|
2116
|
-
const
|
|
2117
|
-
|
|
2282
|
+
setup(e, { emit: n }) {
|
|
2283
|
+
const t = n, o = (s) => {
|
|
2284
|
+
t("update:searchQuery", s), t("search", s);
|
|
2118
2285
|
};
|
|
2119
|
-
return (s, l) => (
|
|
2120
|
-
|
|
2121
|
-
e.showSearch ? (
|
|
2122
|
-
|
|
2286
|
+
return (s, l) => (y(), k("div", ys, [
|
|
2287
|
+
w("div", ws, [
|
|
2288
|
+
e.showSearch ? (y(), k("div", bs, [
|
|
2289
|
+
ne(gs, {
|
|
2123
2290
|
"model-value": e.searchQuery,
|
|
2124
2291
|
"onUpdate:modelValue": o,
|
|
2125
2292
|
placeholder: e.searchPlaceholder,
|
|
2126
|
-
class:
|
|
2293
|
+
class: G(e.searchClass)
|
|
2127
2294
|
}, null, 8, ["model-value", "placeholder", "class"])
|
|
2128
|
-
])) :
|
|
2129
|
-
|
|
2295
|
+
])) : D("", !0),
|
|
2296
|
+
z(s.$slots, "left", {}, void 0, !0)
|
|
2130
2297
|
]),
|
|
2131
|
-
|
|
2132
|
-
|
|
2298
|
+
w("div", xs, [
|
|
2299
|
+
z(s.$slots, "right", {}, void 0, !0)
|
|
2133
2300
|
])
|
|
2134
2301
|
]));
|
|
2135
2302
|
}
|
|
2136
|
-
}),
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2303
|
+
}), Cs = /* @__PURE__ */ ae(ks, [["__scopeId", "data-v-8a8215b9"]]), Ss = { key: 0 }, Rs = { class: "vs-footer-row" }, Es = {
|
|
2304
|
+
key: 0,
|
|
2305
|
+
class: "vs-footer-cell vs-expand-column"
|
|
2306
|
+
}, $s = {
|
|
2307
|
+
key: 1,
|
|
2308
|
+
class: "vs-footer-cell vs-checkbox-column"
|
|
2309
|
+
}, As = ["data-field"], Fs = /* @__PURE__ */ _({
|
|
2310
|
+
__name: "VsDataTableFooter",
|
|
2311
|
+
props: {
|
|
2312
|
+
columns: {},
|
|
2313
|
+
rows: {},
|
|
2314
|
+
expandable: { type: Boolean },
|
|
2315
|
+
isItemSelectedControlled: { type: Boolean }
|
|
2316
|
+
},
|
|
2317
|
+
setup(e) {
|
|
2318
|
+
const n = e, t = F(() => {
|
|
2319
|
+
const s = [];
|
|
2320
|
+
function l(a) {
|
|
2321
|
+
for (const r of a)
|
|
2322
|
+
r.hidden || (r.children && r.children.length ? l(r.children) : s.push(r));
|
|
2323
|
+
}
|
|
2324
|
+
return l(n.columns), s.map((a) => {
|
|
2325
|
+
const r = a.footerValue !== void 0;
|
|
2326
|
+
let i = null;
|
|
2327
|
+
if (typeof a.footerValue == "function")
|
|
2328
|
+
try {
|
|
2329
|
+
i = a.footerValue(n.rows);
|
|
2330
|
+
} catch (c) {
|
|
2331
|
+
console.warn(`Error computing footerValue for column "${a.field}"`, c);
|
|
2332
|
+
}
|
|
2333
|
+
else a.footerValue !== void 0 && (i = a.footerValue);
|
|
2334
|
+
return {
|
|
2335
|
+
...a,
|
|
2336
|
+
hasFooter: r,
|
|
2337
|
+
footerValue: i,
|
|
2338
|
+
formattedValue: o(a, i)
|
|
2339
|
+
};
|
|
2340
|
+
});
|
|
2341
|
+
});
|
|
2342
|
+
function o(s, l) {
|
|
2343
|
+
if (l == null) return "";
|
|
2344
|
+
if (s.footerFormatter)
|
|
2345
|
+
try {
|
|
2346
|
+
return s.footerFormatter(l, s);
|
|
2347
|
+
} catch (a) {
|
|
2348
|
+
return console.warn(`Error in footerFormatter for column "${s.field}"`, a), String(l);
|
|
2349
|
+
}
|
|
2350
|
+
return typeof l == "number" ? s.field === "price" ? `$${l.toFixed(2)}` : s.field === "tax" ? l.toFixed(2) : l.toLocaleString() : String(l);
|
|
2351
|
+
}
|
|
2352
|
+
return (s, l) => t.value.length ? (y(), k("tfoot", Ss, [
|
|
2353
|
+
w("tr", Rs, [
|
|
2354
|
+
e.expandable ? (y(), k("td", Es)) : D("", !0),
|
|
2355
|
+
e.isItemSelectedControlled ? (y(), k("td", $s)) : D("", !0),
|
|
2356
|
+
(y(!0), k(K, null, Q(t.value, (a, r) => (y(), k("td", {
|
|
2357
|
+
key: r,
|
|
2358
|
+
"data-field": a.field,
|
|
2359
|
+
class: G(["vs-footer-cell", a.footerClass || ""]),
|
|
2360
|
+
style: pt(a.footerStyle || {})
|
|
2361
|
+
}, [
|
|
2362
|
+
a.hasFooter ? z(s.$slots, `footer-${a.field}`, {
|
|
2363
|
+
key: 0,
|
|
2364
|
+
column: a,
|
|
2365
|
+
value: a.footerValue,
|
|
2366
|
+
rows: e.rows
|
|
2367
|
+
}, () => [
|
|
2368
|
+
Ye(H(a.formattedValue), 1)
|
|
2369
|
+
], !0) : D("", !0)
|
|
2370
|
+
], 14, As))), 128))
|
|
2371
|
+
])
|
|
2372
|
+
])) : D("", !0);
|
|
2373
|
+
}
|
|
2374
|
+
}), Ts = /* @__PURE__ */ ae(Fs, [["__scopeId", "data-v-f3b614d3"]]);
|
|
2375
|
+
function Os(e, n, t) {
|
|
2376
|
+
const o = q(1), s = q(e.sort ? [...e.sort] : []);
|
|
2377
|
+
Y(
|
|
2140
2378
|
() => e.sort,
|
|
2141
|
-
(
|
|
2142
|
-
|
|
2379
|
+
(v) => {
|
|
2380
|
+
v && (s.value = [...v]);
|
|
2143
2381
|
},
|
|
2144
2382
|
{ deep: !0 }
|
|
2145
2383
|
);
|
|
2146
|
-
const l =
|
|
2384
|
+
const l = F(
|
|
2147
2385
|
() => e.serverOptions?.sort ?? s.value ?? []
|
|
2148
2386
|
);
|
|
2149
2387
|
return {
|
|
2150
2388
|
activeSort: l,
|
|
2151
2389
|
sortHelpers: {
|
|
2152
|
-
isColumnSorted: (
|
|
2153
|
-
getSortPriority: (
|
|
2154
|
-
const
|
|
2155
|
-
return
|
|
2390
|
+
isColumnSorted: (v) => l.value.some((m) => m.field === v),
|
|
2391
|
+
getSortPriority: (v) => {
|
|
2392
|
+
const m = l.value.find((f) => f.field === v);
|
|
2393
|
+
return m ? m.priority ?? null : null;
|
|
2156
2394
|
},
|
|
2157
|
-
getSortOrder: (
|
|
2158
|
-
handleSort: (
|
|
2159
|
-
let
|
|
2160
|
-
const
|
|
2161
|
-
|
|
2395
|
+
getSortOrder: (v) => l.value.find((m) => m.field === v)?.order ?? null,
|
|
2396
|
+
handleSort: (v, m) => {
|
|
2397
|
+
let f = [...s.value];
|
|
2398
|
+
const u = f.findIndex((h) => h.field === v);
|
|
2399
|
+
m.shiftKey ? u === -1 ? f.push({ field: v, order: "asc" }) : f[u]?.order === "asc" ? f[u].order = "desc" : f.splice(u, 1) : u === -1 ? f = [{ field: v, order: "asc" }] : f[u]?.order === "asc" ? f = [{ field: v, order: "desc" }] : f = [], f = f.map((h, g) => ({ ...h, priority: g + 1 })), s.value = [...f], e.serverOptions ? n("update:serverOptions", { ...e.serverOptions, sort: f }) : n("update:sort", f), t.value = o.value, n("sortChanged", { sort: f });
|
|
2162
2400
|
}
|
|
2163
2401
|
}
|
|
2164
2402
|
};
|
|
2165
2403
|
}
|
|
2166
|
-
function
|
|
2167
|
-
const l =
|
|
2404
|
+
function Vs(e, n, t, o, s) {
|
|
2405
|
+
const l = F({
|
|
2168
2406
|
get: () => e.serverItemsLength !== void 0 ? e.serverItemsLength : s.value.length,
|
|
2169
|
-
set: (
|
|
2170
|
-
e.serverItemsLength !== void 0 &&
|
|
2407
|
+
set: (d) => {
|
|
2408
|
+
e.serverItemsLength !== void 0 && n("update:serverItemsLength", d);
|
|
2171
2409
|
}
|
|
2172
|
-
}), a =
|
|
2173
|
-
get: () => e.serverOptions?.page ??
|
|
2174
|
-
set: (
|
|
2175
|
-
e.serverOptions ?
|
|
2410
|
+
}), a = F({
|
|
2411
|
+
get: () => e.serverOptions?.page ?? t.value,
|
|
2412
|
+
set: (d) => {
|
|
2413
|
+
e.serverOptions ? n("update:serverOptions", { ...e.serverOptions, page: d }) : t.value = d;
|
|
2176
2414
|
}
|
|
2177
|
-
}), r =
|
|
2178
|
-
const
|
|
2179
|
-
return
|
|
2180
|
-
}),
|
|
2181
|
-
e.serverOptions &&
|
|
2415
|
+
}), r = F(() => {
|
|
2416
|
+
const d = o.value;
|
|
2417
|
+
return Kt(t.value, d, l.value);
|
|
2418
|
+
}), i = (d) => {
|
|
2419
|
+
e.serverOptions && n("update:serverOptions", { ...e.serverOptions, page: d }), n("pageUpdated", d);
|
|
2182
2420
|
};
|
|
2183
2421
|
return {
|
|
2184
2422
|
currentPage: a,
|
|
2185
2423
|
totalRecords: l,
|
|
2186
2424
|
recordRange: r,
|
|
2187
|
-
handlePageChange:
|
|
2425
|
+
handlePageChange: i,
|
|
2188
2426
|
paginationHelpers: {
|
|
2189
|
-
page:
|
|
2427
|
+
page: t,
|
|
2190
2428
|
totalRecords: l,
|
|
2191
2429
|
recordRange: r,
|
|
2192
|
-
handlePageChange:
|
|
2430
|
+
handlePageChange: i
|
|
2193
2431
|
}
|
|
2194
2432
|
};
|
|
2195
2433
|
}
|
|
2196
|
-
function
|
|
2197
|
-
const s =
|
|
2434
|
+
function Ls(e, n, t, o) {
|
|
2435
|
+
const s = F({
|
|
2198
2436
|
get: () => o.value,
|
|
2199
2437
|
set: (a) => o.value = a
|
|
2200
2438
|
});
|
|
2201
|
-
return
|
|
2202
|
-
const r = e.serverItemsLength ?? e.rows.length,
|
|
2203
|
-
|
|
2439
|
+
return Y(o, (a) => {
|
|
2440
|
+
const r = e.serverItemsLength ?? e.rows.length, i = wt(r, a);
|
|
2441
|
+
t.value > i ? t.value = i || 1 : t.value < 1 && (t.value = 1);
|
|
2204
2442
|
}), {
|
|
2205
2443
|
vsRowsPerPage: s,
|
|
2206
2444
|
handleRowsPerPage: (a) => {
|
|
2207
|
-
o.value = a,
|
|
2445
|
+
o.value = a, n("rowsPerPageChanged", a);
|
|
2208
2446
|
}
|
|
2209
2447
|
};
|
|
2210
2448
|
}
|
|
2211
|
-
function
|
|
2212
|
-
const
|
|
2213
|
-
|
|
2449
|
+
function Ps(e, n) {
|
|
2450
|
+
const t = (a) => {
|
|
2451
|
+
n.value = a, e("inputTyped", a);
|
|
2214
2452
|
};
|
|
2215
2453
|
return {
|
|
2216
|
-
searchQuery:
|
|
2217
|
-
onInputTyped:
|
|
2454
|
+
searchQuery: n,
|
|
2455
|
+
onInputTyped: t,
|
|
2218
2456
|
clearSearch: () => {
|
|
2219
|
-
|
|
2457
|
+
n.value = "", e("inputTyped", "");
|
|
2220
2458
|
},
|
|
2221
2459
|
setSearchQuery: (a) => {
|
|
2222
|
-
|
|
2460
|
+
n.value = a, e("inputTyped", a);
|
|
2223
2461
|
},
|
|
2224
2462
|
searchHelpers: {
|
|
2225
|
-
searchQuery:
|
|
2226
|
-
onInputTyped:
|
|
2463
|
+
searchQuery: n,
|
|
2464
|
+
onInputTyped: t
|
|
2227
2465
|
}
|
|
2228
2466
|
};
|
|
2229
2467
|
}
|
|
2230
|
-
function
|
|
2231
|
-
const
|
|
2232
|
-
get: () => e.expanded ??
|
|
2233
|
-
set: (
|
|
2234
|
-
e.expanded !== void 0 ?
|
|
2468
|
+
function Ds(e, n) {
|
|
2469
|
+
const t = q([]), o = q(/* @__PURE__ */ new Map()), s = F({
|
|
2470
|
+
get: () => e.expanded ?? t.value,
|
|
2471
|
+
set: (d) => {
|
|
2472
|
+
e.expanded !== void 0 ? n("update:expanded", d) : t.value = d;
|
|
2235
2473
|
}
|
|
2236
2474
|
});
|
|
2237
|
-
function l(
|
|
2238
|
-
return typeof e.rowKey == "function" ? e.rowKey(
|
|
2475
|
+
function l(d, v) {
|
|
2476
|
+
return typeof e.rowKey == "function" ? e.rowKey(d, v) : typeof e.rowKey == "string" && d[e.rowKey] !== void 0 ? d[e.rowKey] : v;
|
|
2239
2477
|
}
|
|
2240
|
-
function a(
|
|
2241
|
-
const
|
|
2242
|
-
return s.value.includes(
|
|
2478
|
+
function a(d, v) {
|
|
2479
|
+
const m = l(d, v);
|
|
2480
|
+
return s.value.includes(m);
|
|
2243
2481
|
}
|
|
2244
|
-
function r(
|
|
2245
|
-
const
|
|
2246
|
-
let
|
|
2247
|
-
|
|
2482
|
+
function r(d, v) {
|
|
2483
|
+
const m = l(d, v), f = s.value.includes(m);
|
|
2484
|
+
let u;
|
|
2485
|
+
f ? (u = s.value.filter((h) => h !== m), n("collapseRow", { row: d, index: v, rowId: m })) : (u = e.accordion ? [m] : [...s.value, m], n("expandRow", { row: d, index: v, rowId: m })), s.value = u;
|
|
2248
2486
|
}
|
|
2249
|
-
function
|
|
2250
|
-
const
|
|
2251
|
-
return o.value.get(
|
|
2487
|
+
function i(d, v) {
|
|
2488
|
+
const m = l(d, v);
|
|
2489
|
+
return o.value.get(m) === !0;
|
|
2252
2490
|
}
|
|
2253
|
-
function c(
|
|
2254
|
-
o.value.set(
|
|
2491
|
+
function c(d, v) {
|
|
2492
|
+
o.value.set(d, v);
|
|
2255
2493
|
}
|
|
2256
2494
|
return {
|
|
2257
2495
|
expandedRows: s,
|
|
@@ -2259,68 +2497,69 @@ function rs(e, t) {
|
|
|
2259
2497
|
toggleRowExpansion: r,
|
|
2260
2498
|
getRowId: l,
|
|
2261
2499
|
setRowLoading: c,
|
|
2262
|
-
isRowLoading:
|
|
2500
|
+
isRowLoading: i
|
|
2263
2501
|
};
|
|
2264
2502
|
}
|
|
2265
|
-
function
|
|
2266
|
-
const o =
|
|
2267
|
-
|
|
2503
|
+
function Is(e, n, t) {
|
|
2504
|
+
const o = q({}), s = F(() => (console.log("InitFilter Filtered:", e.value), t?.serverMode ? e.value : e.value.filter((r) => n.every((i) => {
|
|
2505
|
+
if (!i.field) return !0;
|
|
2506
|
+
const c = o.value[i.field];
|
|
2268
2507
|
if (!c || !c.type) return !0;
|
|
2269
|
-
const
|
|
2270
|
-
if (
|
|
2271
|
-
return
|
|
2272
|
-
if (c.type === "custom" &&
|
|
2273
|
-
const
|
|
2274
|
-
return typeof
|
|
2508
|
+
const d = r[i.field];
|
|
2509
|
+
if (i.filter?.filterFn)
|
|
2510
|
+
return i.filter.filterFn(d, c.value, r);
|
|
2511
|
+
if (c.type === "custom" && i.filter?.filterKey) {
|
|
2512
|
+
const m = Be[i.filter.filterKey];
|
|
2513
|
+
return typeof m == "function" ? m(r, i.field, c) : !0;
|
|
2275
2514
|
}
|
|
2276
|
-
const
|
|
2277
|
-
return typeof
|
|
2278
|
-
})));
|
|
2279
|
-
|
|
2515
|
+
const v = Be[c.type];
|
|
2516
|
+
return typeof v == "function" ? v(r, i.field, c) : !0;
|
|
2517
|
+
}))));
|
|
2518
|
+
Y(
|
|
2280
2519
|
o,
|
|
2281
2520
|
(r) => {
|
|
2282
|
-
if (
|
|
2283
|
-
const
|
|
2284
|
-
(c, [
|
|
2285
|
-
if (!
|
|
2286
|
-
const
|
|
2287
|
-
type:
|
|
2288
|
-
operator:
|
|
2521
|
+
if (t?.serverMode && t.onServerFilter) {
|
|
2522
|
+
const i = Object.entries(r).reduce(
|
|
2523
|
+
(c, [d, v]) => {
|
|
2524
|
+
if (!v?.type) return c;
|
|
2525
|
+
const m = {
|
|
2526
|
+
type: v.type,
|
|
2527
|
+
operator: v.operator
|
|
2289
2528
|
};
|
|
2290
|
-
switch (
|
|
2529
|
+
switch (v.type) {
|
|
2291
2530
|
case "text":
|
|
2292
|
-
c[
|
|
2293
|
-
...
|
|
2294
|
-
value:
|
|
2531
|
+
c[d] = {
|
|
2532
|
+
...m,
|
|
2533
|
+
value: v.value ?? null
|
|
2295
2534
|
};
|
|
2296
2535
|
break;
|
|
2297
2536
|
case "multi-select":
|
|
2298
|
-
c[
|
|
2299
|
-
...
|
|
2300
|
-
value:
|
|
2537
|
+
c[d] = {
|
|
2538
|
+
...m,
|
|
2539
|
+
value: v.value ?? []
|
|
2301
2540
|
};
|
|
2302
2541
|
break;
|
|
2303
2542
|
case "number-range":
|
|
2304
|
-
c[
|
|
2305
|
-
...
|
|
2306
|
-
value:
|
|
2307
|
-
min:
|
|
2308
|
-
max:
|
|
2543
|
+
c[d] = {
|
|
2544
|
+
...m,
|
|
2545
|
+
value: v.value ?? null,
|
|
2546
|
+
min: v.min ?? null,
|
|
2547
|
+
max: v.max ?? null
|
|
2309
2548
|
};
|
|
2310
2549
|
break;
|
|
2311
2550
|
case "date-range":
|
|
2312
|
-
c[
|
|
2313
|
-
...
|
|
2314
|
-
value:
|
|
2315
|
-
start:
|
|
2316
|
-
end:
|
|
2551
|
+
c[d] = {
|
|
2552
|
+
...m,
|
|
2553
|
+
value: v.value ?? null,
|
|
2554
|
+
start: v.start ?? null,
|
|
2555
|
+
end: v.end ?? null
|
|
2317
2556
|
};
|
|
2318
2557
|
break;
|
|
2319
2558
|
case "custom":
|
|
2320
|
-
c[
|
|
2321
|
-
...
|
|
2322
|
-
value:
|
|
2323
|
-
filterKey:
|
|
2559
|
+
c[d] = {
|
|
2560
|
+
...m,
|
|
2561
|
+
value: v.value,
|
|
2562
|
+
filterKey: v.filterKey
|
|
2324
2563
|
};
|
|
2325
2564
|
break;
|
|
2326
2565
|
}
|
|
@@ -2328,16 +2567,16 @@ function is(e, t, n) {
|
|
|
2328
2567
|
},
|
|
2329
2568
|
{}
|
|
2330
2569
|
);
|
|
2331
|
-
|
|
2570
|
+
t.onServerFilter(i);
|
|
2332
2571
|
}
|
|
2333
2572
|
},
|
|
2334
2573
|
{ deep: !0 }
|
|
2335
2574
|
);
|
|
2336
|
-
function l(r,
|
|
2337
|
-
|
|
2575
|
+
function l(r, i, c) {
|
|
2576
|
+
i ? o.value[r] = Ce(i.type, i) : c && (o.value[r] = Ce(c));
|
|
2338
2577
|
}
|
|
2339
|
-
function a(r,
|
|
2340
|
-
|
|
2578
|
+
function a(r, i) {
|
|
2579
|
+
i ? o.value[r] = Ce(i) : delete o.value[r];
|
|
2341
2580
|
}
|
|
2342
2581
|
return {
|
|
2343
2582
|
filters: o,
|
|
@@ -2346,97 +2585,264 @@ function is(e, t, n) {
|
|
|
2346
2585
|
clearFilter: a
|
|
2347
2586
|
};
|
|
2348
2587
|
}
|
|
2349
|
-
function
|
|
2350
|
-
const
|
|
2351
|
-
|
|
2352
|
-
|
|
2588
|
+
function qs(e, n = {}) {
|
|
2589
|
+
const { enabled: t = !1, maxHeight: o = "calc(100vh - 250px)" } = n;
|
|
2590
|
+
let s = null, l = null;
|
|
2591
|
+
const a = () => {
|
|
2592
|
+
const c = e.value;
|
|
2593
|
+
if (!t || !c) return;
|
|
2594
|
+
const d = c.querySelector("thead"), v = c.querySelector("tbody");
|
|
2595
|
+
!d || !v || (c.parentElement?.classList.contains("vs-table-wrapper") ? s = c.parentElement : (s = document.createElement("div"), s.classList.add("vs-table-wrapper"), c.parentNode?.insertBefore(s, c), s.appendChild(c)), Object.assign(s.style, {
|
|
2596
|
+
overflowY: "auto",
|
|
2597
|
+
overflowX: "auto",
|
|
2598
|
+
position: "relative",
|
|
2599
|
+
maxHeight: typeof o == "number" ? `${o}px` : o
|
|
2600
|
+
}), Object.assign(d.style, {
|
|
2601
|
+
position: "sticky",
|
|
2602
|
+
top: "0",
|
|
2603
|
+
zIndex: "5",
|
|
2604
|
+
background: "var(--vs-table-header-bg, #fff)"
|
|
2605
|
+
}), l || (l = new ResizeObserver(() => {
|
|
2606
|
+
r();
|
|
2607
|
+
}), l.observe(c)), r());
|
|
2608
|
+
}, r = () => {
|
|
2609
|
+
const c = e.value;
|
|
2610
|
+
if (!c) return;
|
|
2611
|
+
const d = c.querySelector("thead"), v = c.querySelector("tbody");
|
|
2612
|
+
if (!d || !v) return;
|
|
2613
|
+
const m = Array.from(d.querySelectorAll("tr")), f = v.querySelector("tr");
|
|
2614
|
+
if (!f) return;
|
|
2615
|
+
const u = Array.from(f.querySelectorAll("td"));
|
|
2616
|
+
if (!u.length) return;
|
|
2617
|
+
const h = [];
|
|
2618
|
+
m.forEach((g) => {
|
|
2619
|
+
Array.from(g.querySelectorAll("th")).forEach((S) => {
|
|
2620
|
+
parseInt(S.getAttribute("colspan") || "1", 10) === 1 && h.push(S);
|
|
2621
|
+
});
|
|
2622
|
+
}), h.forEach((g, C) => {
|
|
2623
|
+
const S = u[C];
|
|
2624
|
+
S && (g.style.width = `${S.offsetWidth}px`);
|
|
2625
|
+
}), m.forEach((g) => {
|
|
2626
|
+
Array.from(g.querySelectorAll("th")).forEach((S) => {
|
|
2627
|
+
const E = parseInt(S.getAttribute("colspan") || "1", 10);
|
|
2628
|
+
if (E > 1) {
|
|
2629
|
+
let L = 0;
|
|
2630
|
+
const P = Array.from(g.children).indexOf(S);
|
|
2631
|
+
for (let B = 0; B < E; B++) {
|
|
2632
|
+
const b = u[P + B];
|
|
2633
|
+
b && (L += b.offsetWidth);
|
|
2634
|
+
}
|
|
2635
|
+
L > 0 && (S.style.width = `${L}px`);
|
|
2636
|
+
}
|
|
2637
|
+
});
|
|
2638
|
+
});
|
|
2639
|
+
}, i = () => {
|
|
2640
|
+
l && (l.disconnect(), l = null);
|
|
2641
|
+
};
|
|
2642
|
+
return Re(async () => {
|
|
2643
|
+
t && (await oe(), a());
|
|
2644
|
+
}), He(() => {
|
|
2645
|
+
i();
|
|
2646
|
+
}), Y(
|
|
2647
|
+
() => t,
|
|
2648
|
+
async (c) => {
|
|
2649
|
+
await oe(), c ? a() : i();
|
|
2650
|
+
}
|
|
2651
|
+
), {
|
|
2652
|
+
refresh: a,
|
|
2653
|
+
cleanup: i
|
|
2654
|
+
};
|
|
2655
|
+
}
|
|
2656
|
+
function Ms(e, n = {}) {
|
|
2657
|
+
const {
|
|
2658
|
+
enabled: t = !1,
|
|
2659
|
+
maxHeight: o = "calc(100vh - 250px)",
|
|
2660
|
+
debounceMs: s = 100
|
|
2661
|
+
} = n;
|
|
2662
|
+
let l = null, a = null, r = null, i = !1, c = !1, d = null;
|
|
2663
|
+
const m = ((h, g = 100) => {
|
|
2664
|
+
let C = null;
|
|
2665
|
+
return (...S) => {
|
|
2666
|
+
C && clearTimeout(C), C = window.setTimeout(() => h(...S), g);
|
|
2667
|
+
};
|
|
2668
|
+
})(() => {
|
|
2669
|
+
i || (i = !0, cancelAnimationFrame(r), r = requestAnimationFrame(() => {
|
|
2670
|
+
const h = e.value;
|
|
2671
|
+
if (!h) return;
|
|
2672
|
+
const g = h.querySelector("tfoot"), C = h.querySelector("tbody");
|
|
2673
|
+
if (!g || !C) return;
|
|
2674
|
+
const S = g.querySelector("tr"), E = C.querySelector("tr");
|
|
2675
|
+
if (!S || !E) {
|
|
2676
|
+
i = !1;
|
|
2677
|
+
return;
|
|
2678
|
+
}
|
|
2679
|
+
const L = Array.from(S.querySelectorAll("td, th")), P = Array.from(E.querySelectorAll("td"));
|
|
2680
|
+
if (!L.length || !P.length) {
|
|
2681
|
+
i = !1;
|
|
2682
|
+
return;
|
|
2683
|
+
}
|
|
2684
|
+
let B = 0;
|
|
2685
|
+
L.forEach((b) => {
|
|
2686
|
+
const p = parseInt(b.getAttribute("colspan") || "1", 10);
|
|
2687
|
+
if (p === 1) {
|
|
2688
|
+
const x = P[B];
|
|
2689
|
+
if (x) {
|
|
2690
|
+
const R = x.offsetWidth;
|
|
2691
|
+
b.offsetWidth !== R && (b.style.width = `${R}px`, b.style.minWidth = `${R}px`);
|
|
2692
|
+
}
|
|
2693
|
+
B += 1;
|
|
2694
|
+
} else {
|
|
2695
|
+
let x = 0;
|
|
2696
|
+
for (let R = 0; R < p; R++) {
|
|
2697
|
+
const T = P[B + R];
|
|
2698
|
+
T && (x += T.offsetWidth);
|
|
2699
|
+
}
|
|
2700
|
+
x > 0 && b.offsetWidth !== x && (b.style.width = `${x}px`, b.style.minWidth = `${x}px`), B += p;
|
|
2701
|
+
}
|
|
2702
|
+
}), i = !1;
|
|
2703
|
+
}));
|
|
2704
|
+
}, s), f = () => {
|
|
2705
|
+
const h = e.value;
|
|
2706
|
+
if (!t || !h) return;
|
|
2707
|
+
const g = h.querySelector("tfoot"), C = h.querySelector("tbody"), S = h.querySelector("thead");
|
|
2708
|
+
!g || !C || (h.parentElement?.classList.contains("vs-table-wrapper") ? l = h.parentElement : (l = document.createElement("div"), l.classList.add("vs-table-wrapper"), h.parentNode?.insertBefore(l, h), l.appendChild(h)), Object.assign(l.style, {
|
|
2709
|
+
overflowY: "auto",
|
|
2710
|
+
overflowX: "auto",
|
|
2711
|
+
position: "relative",
|
|
2712
|
+
maxHeight: typeof o == "number" ? `${o}px` : o
|
|
2713
|
+
}), Object.assign(g.style, {
|
|
2714
|
+
position: "sticky",
|
|
2715
|
+
bottom: "0",
|
|
2716
|
+
zIndex: "5",
|
|
2717
|
+
background: "var(--vs-table-footer-bg, var(--vs-table-header-bg, #fff))"
|
|
2718
|
+
}), !c && S && (d = () => {
|
|
2719
|
+
const E = l.scrollLeft;
|
|
2720
|
+
S.scrollLeft = E, g.scrollLeft = E;
|
|
2721
|
+
}, l.addEventListener("scroll", d), c = !0), a || (a = new ResizeObserver(() => {
|
|
2722
|
+
m();
|
|
2723
|
+
}), a.observe(h)), m());
|
|
2724
|
+
}, u = () => {
|
|
2725
|
+
cancelAnimationFrame(r), a && (a.disconnect(), a = null), l && d && c && (l.removeEventListener("scroll", d), c = !1);
|
|
2726
|
+
const h = e.value;
|
|
2727
|
+
if (h) {
|
|
2728
|
+
const g = h.querySelector("tfoot");
|
|
2729
|
+
g && (g.style.position = "", g.style.bottom = "", g.style.zIndex = "", g.style.background = "");
|
|
2730
|
+
}
|
|
2731
|
+
};
|
|
2732
|
+
return Re(async () => {
|
|
2733
|
+
t && (await oe(), f());
|
|
2734
|
+
}), He(u), Y(
|
|
2735
|
+
() => t,
|
|
2736
|
+
async (h) => {
|
|
2737
|
+
await oe(), h ? f() : u();
|
|
2738
|
+
}
|
|
2739
|
+
), {
|
|
2740
|
+
refresh: m,
|
|
2741
|
+
cleanup: u
|
|
2742
|
+
};
|
|
2743
|
+
}
|
|
2744
|
+
function Bs(e, n, t = {}) {
|
|
2745
|
+
const o = Fe(e.rows) ? e.rows : gt(e.rows), s = q(1), l = q(e.serverOptions?.rowsPerPage ?? e.rowsPerPage), a = q(""), r = q(), i = q(null), c = q(), { isRowExpanded: d, toggleRowExpansion: v, getRowId: m, setRowLoading: f, isRowLoading: u } = Ds(e, n), { filters: h, filteredData: g, setFilter: C, clearFilter: S } = Is(
|
|
2746
|
+
F(() => $(o)),
|
|
2747
|
+
zt($(e.columns)),
|
|
2353
2748
|
{
|
|
2354
2749
|
serverMode: !!e.serverOptions,
|
|
2355
|
-
onServerFilter(
|
|
2356
|
-
|
|
2750
|
+
onServerFilter(V) {
|
|
2751
|
+
n("filterChange", V);
|
|
2357
2752
|
}
|
|
2358
2753
|
}
|
|
2359
|
-
), { activeSort:
|
|
2754
|
+
), { activeSort: E, sortHelpers: L } = Os(e, n, s), { onInputTyped: P } = Ps(n, a), { totalRecords: B, recordRange: b, handlePageChange: p } = Vs(
|
|
2360
2755
|
e,
|
|
2361
|
-
|
|
2362
|
-
o,
|
|
2756
|
+
n,
|
|
2363
2757
|
s,
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2758
|
+
l,
|
|
2759
|
+
F(() => I.value)
|
|
2760
|
+
), { handleRowsPerPage: x } = Ls(e, n, s, l), { header: R = !0, footer: T = !0, maxHeight: M = "calc(100vh - 100px)" } = t, A = qs(c, { enabled: R, maxHeight: M }), O = Ms(c, { enabled: T, maxHeight: M }), N = F(() => {
|
|
2761
|
+
let V = g.value;
|
|
2762
|
+
return a.value && (V = st(V, a.value)), V;
|
|
2763
|
+
}), I = F(() => {
|
|
2764
|
+
let V = N.value;
|
|
2765
|
+
return e.serverOptions || (a.value && (V = st(V, a.value)), E.value.length && (V = Wt(V, E.value))), V = V.map((U, ge) => ({
|
|
2766
|
+
...U,
|
|
2767
|
+
isExpanded: d(U, ge)
|
|
2373
2768
|
// pass index here
|
|
2374
|
-
})),
|
|
2769
|
+
})), V;
|
|
2375
2770
|
});
|
|
2376
|
-
|
|
2377
|
-
const
|
|
2378
|
-
() =>
|
|
2771
|
+
Y([h, a], () => s.value = 1, { deep: !0 });
|
|
2772
|
+
const W = F(
|
|
2773
|
+
() => Nt(I.value, s.value, l.value)
|
|
2379
2774
|
);
|
|
2380
|
-
return
|
|
2381
|
-
Array.isArray(
|
|
2775
|
+
return Y(o, (V) => {
|
|
2776
|
+
Array.isArray(V) && V.length > 1e3 && console.log(`[useDataTable] Large dataset updated (${V.length} rows)`);
|
|
2382
2777
|
}), {
|
|
2383
2778
|
// Pagination
|
|
2384
|
-
page:
|
|
2385
|
-
totalRecords:
|
|
2386
|
-
recordRange:
|
|
2387
|
-
handlePageChange:
|
|
2388
|
-
rowsPerPage:
|
|
2389
|
-
handleRowsPerPage:
|
|
2779
|
+
page: s,
|
|
2780
|
+
totalRecords: B,
|
|
2781
|
+
recordRange: b,
|
|
2782
|
+
handlePageChange: p,
|
|
2783
|
+
rowsPerPage: l,
|
|
2784
|
+
handleRowsPerPage: x,
|
|
2390
2785
|
// Sorting
|
|
2391
|
-
processedRows:
|
|
2392
|
-
paginatedRows:
|
|
2393
|
-
sortHelpers:
|
|
2786
|
+
processedRows: I,
|
|
2787
|
+
paginatedRows: W,
|
|
2788
|
+
sortHelpers: L,
|
|
2394
2789
|
// Search
|
|
2395
|
-
searchQuery:
|
|
2396
|
-
onInputTyped:
|
|
2790
|
+
searchQuery: a,
|
|
2791
|
+
onInputTyped: P,
|
|
2397
2792
|
// Expandable
|
|
2398
|
-
isRowExpanded:
|
|
2399
|
-
toggleRowExpansion:
|
|
2400
|
-
getRowId:
|
|
2401
|
-
setRowLoading:
|
|
2402
|
-
isRowLoading:
|
|
2793
|
+
isRowExpanded: d,
|
|
2794
|
+
toggleRowExpansion: v,
|
|
2795
|
+
getRowId: m,
|
|
2796
|
+
setRowLoading: f,
|
|
2797
|
+
isRowLoading: u,
|
|
2403
2798
|
// Column filters
|
|
2404
|
-
filters:
|
|
2405
|
-
filteredData:
|
|
2406
|
-
setFilter:
|
|
2407
|
-
clearFilter:
|
|
2799
|
+
filters: h,
|
|
2800
|
+
filteredData: g,
|
|
2801
|
+
setFilter: C,
|
|
2802
|
+
clearFilter: S,
|
|
2803
|
+
// Table Ref
|
|
2804
|
+
tableContainer: r,
|
|
2805
|
+
tableResponsiveRef: i,
|
|
2806
|
+
tableRef: c,
|
|
2807
|
+
// Sticky Header and Footer
|
|
2808
|
+
refresh() {
|
|
2809
|
+
A.refresh?.(), O.refresh?.();
|
|
2810
|
+
},
|
|
2811
|
+
cleanup() {
|
|
2812
|
+
A.cleanup?.(), O.cleanup?.();
|
|
2813
|
+
}
|
|
2408
2814
|
};
|
|
2409
2815
|
}
|
|
2410
|
-
function
|
|
2411
|
-
const
|
|
2412
|
-
|
|
2816
|
+
function Hs(e, n) {
|
|
2817
|
+
const t = q(e.itemSelected || []);
|
|
2818
|
+
Y(
|
|
2413
2819
|
() => e.itemSelected,
|
|
2414
|
-
(
|
|
2415
|
-
|
|
2820
|
+
(h) => {
|
|
2821
|
+
h ? t.value = [...h] : t.value = [];
|
|
2416
2822
|
},
|
|
2417
2823
|
{ immediate: !0, deep: !0 }
|
|
2418
2824
|
);
|
|
2419
|
-
const o =
|
|
2420
|
-
get: () =>
|
|
2421
|
-
set: (
|
|
2422
|
-
|
|
2825
|
+
const o = F({
|
|
2826
|
+
get: () => t.value,
|
|
2827
|
+
set: (h) => {
|
|
2828
|
+
t.value = h, n("update:itemSelected", h);
|
|
2423
2829
|
}
|
|
2424
|
-
}), s =
|
|
2830
|
+
}), s = F(() => e.itemSelected !== null), l = F(
|
|
2425
2831
|
() => e.rows.length > 0 && o.value.length === e.rows.length
|
|
2426
|
-
), a =
|
|
2427
|
-
(
|
|
2428
|
-
(C,
|
|
2832
|
+
), a = F(() => !e.rows.length || !o.value.length ? !1 : !l.value && e.rows.some(
|
|
2833
|
+
(h, g) => o.value.some(
|
|
2834
|
+
(C, S) => re(C, S, e.rowKey) === re(h, g, e.rowKey)
|
|
2429
2835
|
)
|
|
2430
|
-
)), r = (
|
|
2431
|
-
const C =
|
|
2836
|
+
)), r = (h, g) => {
|
|
2837
|
+
const C = re(h, g, e.rowKey);
|
|
2432
2838
|
o.value.some(
|
|
2433
|
-
(
|
|
2839
|
+
(E, L) => re(E, L, e.rowKey) === C
|
|
2434
2840
|
) ? (o.value = o.value.filter(
|
|
2435
|
-
(
|
|
2436
|
-
),
|
|
2437
|
-
},
|
|
2438
|
-
const
|
|
2439
|
-
o.value =
|
|
2841
|
+
(E, L) => re(E, L, e.rowKey) !== C
|
|
2842
|
+
), n("rowDeselected", h, g)) : (o.value = [...o.value, h], n("rowSelected", h, g));
|
|
2843
|
+
}, i = (h) => {
|
|
2844
|
+
const g = h.target;
|
|
2845
|
+
o.value = g.checked ? [...e.rows] : [], n("allRowsSelected", o.value);
|
|
2440
2846
|
};
|
|
2441
2847
|
return {
|
|
2442
2848
|
selectedItems: o,
|
|
@@ -2444,21 +2850,21 @@ function cs(e, t) {
|
|
|
2444
2850
|
isAllChecked: l,
|
|
2445
2851
|
isSomeChecked: a,
|
|
2446
2852
|
toggleRow: r,
|
|
2447
|
-
toggleAll:
|
|
2448
|
-
selectRow: (
|
|
2449
|
-
|
|
2853
|
+
toggleAll: i,
|
|
2854
|
+
selectRow: (h, g) => {
|
|
2855
|
+
yt(h, o.value, e.rowKey) || (o.value = [...o.value, h], n("rowSelected", h, g));
|
|
2450
2856
|
},
|
|
2451
|
-
deselectRow: (
|
|
2452
|
-
const C =
|
|
2857
|
+
deselectRow: (h, g) => {
|
|
2858
|
+
const C = re(h, g, e.rowKey);
|
|
2453
2859
|
o.value = o.value.filter(
|
|
2454
|
-
(
|
|
2455
|
-
),
|
|
2860
|
+
(S, E) => re(S, E, e.rowKey) !== C
|
|
2861
|
+
), n("rowDeselected", h, g);
|
|
2456
2862
|
},
|
|
2457
2863
|
selectAll: () => {
|
|
2458
|
-
o.value = [...e.rows],
|
|
2864
|
+
o.value = [...e.rows], n("allRowsSelected", o.value);
|
|
2459
2865
|
},
|
|
2460
2866
|
deselectAll: () => {
|
|
2461
|
-
o.value = [],
|
|
2867
|
+
o.value = [], n("allRowsSelected", []);
|
|
2462
2868
|
},
|
|
2463
2869
|
clearSelection: () => {
|
|
2464
2870
|
o.value = [];
|
|
@@ -2469,17 +2875,191 @@ function cs(e, t) {
|
|
|
2469
2875
|
isAllChecked: l,
|
|
2470
2876
|
isSomeChecked: a,
|
|
2471
2877
|
toggleRow: r,
|
|
2472
|
-
toggleAll:
|
|
2878
|
+
toggleAll: i
|
|
2879
|
+
}
|
|
2880
|
+
};
|
|
2881
|
+
}
|
|
2882
|
+
function Ws(e, n, t = q(!1)) {
|
|
2883
|
+
const o = q(!1), s = q(!1);
|
|
2884
|
+
let l = !1;
|
|
2885
|
+
const a = () => {
|
|
2886
|
+
if (l) return;
|
|
2887
|
+
const b = e.value?.parentElement, p = e.value;
|
|
2888
|
+
if (!b || !p) return;
|
|
2889
|
+
const x = b.scrollLeft, R = b.scrollWidth - b.clientWidth;
|
|
2890
|
+
o.value = x > 0, s.value = x < R - 1;
|
|
2891
|
+
const T = Array.from(
|
|
2892
|
+
p.querySelectorAll(".vs-sticky-left")
|
|
2893
|
+
), M = Array.from(
|
|
2894
|
+
p.querySelectorAll(".vs-sticky-right")
|
|
2895
|
+
);
|
|
2896
|
+
if (x > 0 ? T.forEach((A) => {
|
|
2897
|
+
const O = A.closest("thead") !== null;
|
|
2898
|
+
A.style.zIndex = O ? "5" : "4";
|
|
2899
|
+
}) : T.forEach((A) => {
|
|
2900
|
+
const O = A.closest("thead") !== null;
|
|
2901
|
+
A.style.zIndex = O ? "4" : "3";
|
|
2902
|
+
}), M.length) {
|
|
2903
|
+
const A = M[0], O = A ? p.offsetWidth - A.offsetLeft : p.offsetWidth;
|
|
2904
|
+
b.scrollWidth - (x + b.clientWidth) <= O + 5 ? M.forEach((I) => {
|
|
2905
|
+
const W = I.closest("thead") !== null;
|
|
2906
|
+
I.style.zIndex = W ? "5" : "4";
|
|
2907
|
+
}) : M.forEach((I) => {
|
|
2908
|
+
const W = I.closest("thead") !== null;
|
|
2909
|
+
I.style.zIndex = W ? "4" : "3";
|
|
2910
|
+
});
|
|
2911
|
+
}
|
|
2912
|
+
}, r = () => {
|
|
2913
|
+
const b = e.value;
|
|
2914
|
+
return b ? Array.from(b.querySelectorAll("tr")) : [];
|
|
2915
|
+
}, i = (b) => b.filter((p) => p.closest("tbody")), c = (b) => {
|
|
2916
|
+
const p = b[0];
|
|
2917
|
+
return p ? Array.from(p.children) : [];
|
|
2918
|
+
}, d = (b) => {
|
|
2919
|
+
const p = /* @__PURE__ */ new Map();
|
|
2920
|
+
return b.forEach((x, R) => {
|
|
2921
|
+
const T = x.getAttribute("data-field");
|
|
2922
|
+
T && p.set(T, R);
|
|
2923
|
+
}), p;
|
|
2924
|
+
}, v = (b) => {
|
|
2925
|
+
for (const p of b)
|
|
2926
|
+
if (p.children?.length) {
|
|
2927
|
+
if (p.children.some((x) => x.sticky === "left" || x.sticky === "right"))
|
|
2928
|
+
return !0;
|
|
2929
|
+
} else if (p.sticky === "left" || p.sticky === "right")
|
|
2930
|
+
return !0;
|
|
2931
|
+
return !1;
|
|
2932
|
+
}, m = (b, p, x) => {
|
|
2933
|
+
const R = [], T = [];
|
|
2934
|
+
return v(x) && b.forEach((A, O) => {
|
|
2935
|
+
(A.classList.contains("vs-expand-column") || A.classList.contains("vs-checkbox-column")) && R.push(O);
|
|
2936
|
+
}), x.forEach((A) => {
|
|
2937
|
+
if (A.children?.length)
|
|
2938
|
+
A.children.forEach((O) => {
|
|
2939
|
+
const N = p.get(O.field);
|
|
2940
|
+
if (N === void 0) return;
|
|
2941
|
+
const I = A.sticky || O.sticky;
|
|
2942
|
+
I === "left" && R.push(N), I === "right" && T.push(N);
|
|
2943
|
+
});
|
|
2944
|
+
else {
|
|
2945
|
+
const O = p.get(A.field);
|
|
2946
|
+
if (O === void 0) return;
|
|
2947
|
+
const N = A.sticky;
|
|
2948
|
+
N === "left" && R.push(O), N === "right" && T.push(O);
|
|
2949
|
+
}
|
|
2950
|
+
}), {
|
|
2951
|
+
left: [...new Set(R)].sort((A, O) => A - O),
|
|
2952
|
+
right: [...new Set(T)].sort((A, O) => O - A)
|
|
2953
|
+
};
|
|
2954
|
+
}, f = (b, p, x) => {
|
|
2955
|
+
const R = /* @__PURE__ */ new Map();
|
|
2956
|
+
let T = 0;
|
|
2957
|
+
return p.forEach((M) => {
|
|
2958
|
+
R.set(M, T);
|
|
2959
|
+
const A = b[M];
|
|
2960
|
+
A && (T += A.offsetWidth);
|
|
2961
|
+
}), R;
|
|
2962
|
+
}, u = (b) => {
|
|
2963
|
+
const p = /* @__PURE__ */ new Map(), x = /* @__PURE__ */ new Map();
|
|
2964
|
+
return b.forEach((R) => {
|
|
2965
|
+
R.children?.length && (p.set(R.label, R.children[0]?.field), x.set(R.label, R.children[R.children.length - 1]?.field));
|
|
2966
|
+
}), { firstChild: p, lastChild: x };
|
|
2967
|
+
}, h = (b, p, x, R) => {
|
|
2968
|
+
if (b) {
|
|
2969
|
+
if (b.startsWith("group-")) {
|
|
2970
|
+
const T = b.replace(/^group-/, "");
|
|
2971
|
+
if (R === "left") {
|
|
2972
|
+
const M = x.firstChild.get(T);
|
|
2973
|
+
return M ? p.get(M) : void 0;
|
|
2974
|
+
} else {
|
|
2975
|
+
const M = x.lastChild.get(T);
|
|
2976
|
+
return M ? p.get(M) : void 0;
|
|
2977
|
+
}
|
|
2978
|
+
}
|
|
2979
|
+
return p.get(b);
|
|
2980
|
+
}
|
|
2981
|
+
}, g = (b) => {
|
|
2982
|
+
b.forEach((p) => {
|
|
2983
|
+
Array.from(p.children).forEach((R) => {
|
|
2984
|
+
R.style.position = "", R.style.left = "", R.style.right = "", R.style.zIndex = "", R.style.background = "", R.style.minWidth = "", R.style.width = "", R.classList.remove("vs-sticky-left", "vs-sticky-right");
|
|
2985
|
+
});
|
|
2986
|
+
});
|
|
2987
|
+
}, C = (b, p, x, R, T, M) => {
|
|
2988
|
+
if (!l) {
|
|
2989
|
+
l = !0;
|
|
2990
|
+
try {
|
|
2991
|
+
b.forEach((A) => {
|
|
2992
|
+
const O = Array.from(A.children), N = A.closest("thead") !== null;
|
|
2993
|
+
O.forEach((I) => {
|
|
2994
|
+
const W = I.getAttribute("data-field");
|
|
2995
|
+
if (!W) return;
|
|
2996
|
+
const V = h(W, T, M, R);
|
|
2997
|
+
if (V === void 0 || !p.includes(V)) return;
|
|
2998
|
+
const U = x.get(V) || 0, ge = N ? "4" : "3";
|
|
2999
|
+
I.style.position = "sticky", I.style[R] = `${U}px`, I.style.zIndex = ge, I.classList.add(`vs-sticky-${R}`), I.style.background = "var(--vs-table-bg, #fff)";
|
|
3000
|
+
});
|
|
3001
|
+
});
|
|
3002
|
+
} finally {
|
|
3003
|
+
l = !1;
|
|
3004
|
+
}
|
|
3005
|
+
}
|
|
3006
|
+
}, S = async () => {
|
|
3007
|
+
if (l) return;
|
|
3008
|
+
const b = r();
|
|
3009
|
+
if (!b.length) return;
|
|
3010
|
+
const p = i(b);
|
|
3011
|
+
if (!p.length) return;
|
|
3012
|
+
const x = c(p), R = d(x), T = m(x, R, n.value);
|
|
3013
|
+
if (g(b), T.left.length > 0 || T.right.length > 0) {
|
|
3014
|
+
const M = f(x, T.left), A = f(x, T.right), O = u(n.value);
|
|
3015
|
+
C(b, T.left, M, "left", R, O), C(b, T.right, A, "right", R, O);
|
|
2473
3016
|
}
|
|
3017
|
+
a();
|
|
3018
|
+
}, E = async () => {
|
|
3019
|
+
l || (await oe(), setTimeout(() => {
|
|
3020
|
+
try {
|
|
3021
|
+
S();
|
|
3022
|
+
} catch (b) {
|
|
3023
|
+
console.warn("[useStickyColumns] refreshSticky failed:", b);
|
|
3024
|
+
}
|
|
3025
|
+
}, 150));
|
|
3026
|
+
}, L = () => {
|
|
3027
|
+
e.value?.parentElement?.addEventListener("scroll", a), a();
|
|
3028
|
+
}, P = () => {
|
|
3029
|
+
e.value?.parentElement?.removeEventListener("scroll", a);
|
|
2474
3030
|
};
|
|
3031
|
+
Re(async () => {
|
|
3032
|
+
await oe(), setTimeout(() => {
|
|
3033
|
+
E();
|
|
3034
|
+
}, 300), L();
|
|
3035
|
+
}), He(P);
|
|
3036
|
+
let B = null;
|
|
3037
|
+
return Y([n, t], () => {
|
|
3038
|
+
B && clearTimeout(B), B = setTimeout(() => {
|
|
3039
|
+
E();
|
|
3040
|
+
}, 100);
|
|
3041
|
+
}, { deep: !0 }), { hasLeftShadow: o, hasRightShadow: s, refreshSticky: E };
|
|
3042
|
+
}
|
|
3043
|
+
function Ns(e, n) {
|
|
3044
|
+
let t = null, o = null;
|
|
3045
|
+
const s = () => {
|
|
3046
|
+
const a = e.value;
|
|
3047
|
+
a && (l(), t = new ResizeObserver(() => {
|
|
3048
|
+
o && cancelAnimationFrame(o), o = requestAnimationFrame(() => {
|
|
3049
|
+
n();
|
|
3050
|
+
});
|
|
3051
|
+
}), t.observe(a));
|
|
3052
|
+
}, l = () => {
|
|
3053
|
+
t && (t.disconnect(), t = null), o && (cancelAnimationFrame(o), o = null);
|
|
3054
|
+
};
|
|
3055
|
+
return Re(async () => {
|
|
3056
|
+
await oe(), s();
|
|
3057
|
+
}), He(l), { refreshSticky: n, cleanup: l };
|
|
2475
3058
|
}
|
|
2476
|
-
const
|
|
2477
|
-
ref: "tableResponsiveRef",
|
|
2478
|
-
class: "vs-table-wrapper"
|
|
2479
|
-
}, vs = {
|
|
3059
|
+
const Ks = { class: "vs-datatable" }, zs = {
|
|
2480
3060
|
key: 0,
|
|
2481
|
-
class: "vs-table-
|
|
2482
|
-
},
|
|
3061
|
+
class: "vs-table-pagination"
|
|
3062
|
+
}, js = { class: "vs-pagination-left" }, Us = { class: "vs-table-info" }, Zs = /* @__PURE__ */ _({
|
|
2483
3063
|
__name: "VsDataTable",
|
|
2484
3064
|
props: {
|
|
2485
3065
|
rows: { default: () => [] },
|
|
@@ -2511,175 +3091,233 @@ const ds = { class: "vs-datatable" }, fs = {
|
|
|
2511
3091
|
rowKey: { type: [String, Function], default: "id" },
|
|
2512
3092
|
expanded: {},
|
|
2513
3093
|
expandable: { type: Boolean },
|
|
2514
|
-
accordion: { type: Boolean }
|
|
3094
|
+
accordion: { type: Boolean },
|
|
3095
|
+
stickyHeader: { type: Boolean, default: !1 },
|
|
3096
|
+
stickyFooter: { type: Boolean, default: !1 },
|
|
3097
|
+
showPagination: { type: Boolean, default: !0 }
|
|
2515
3098
|
},
|
|
2516
3099
|
emits: ["update:serverItemsLength", "update:serverOptions", "pageUpdated", "inputTyped", "update:sort", "sortChanged", "update:itemSelected", "rowSelected", "rowDeselected", "allRowsSelected", "rowClick", "tableBeforeMount", "tableMounted", "tableUnmounted", "dataLoaded", "dataError", "update:expanded", "expandRow", "collapseRow", "filterChange"],
|
|
2517
|
-
setup(e, { expose:
|
|
2518
|
-
const o = e, s =
|
|
2519
|
-
|
|
3100
|
+
setup(e, { expose: n, emit: t }) {
|
|
3101
|
+
const o = e, s = gt(o.rows);
|
|
3102
|
+
Y(
|
|
2520
3103
|
() => o.rows,
|
|
2521
|
-
(
|
|
2522
|
-
s.value =
|
|
3104
|
+
(ee) => {
|
|
3105
|
+
s.value = ee;
|
|
2523
3106
|
},
|
|
2524
3107
|
{ deep: !1 }
|
|
2525
3108
|
);
|
|
2526
|
-
const l =
|
|
2527
|
-
page:
|
|
2528
|
-
rowsPerPage:
|
|
2529
|
-
totalRecords:
|
|
2530
|
-
recordRange:
|
|
2531
|
-
handlePageChange:
|
|
2532
|
-
handleRowsPerPage:
|
|
2533
|
-
paginatedRows:
|
|
2534
|
-
sortHelpers:
|
|
2535
|
-
searchQuery:
|
|
2536
|
-
onInputTyped:
|
|
2537
|
-
isRowExpanded:
|
|
2538
|
-
toggleRowExpansion:
|
|
2539
|
-
setRowLoading:
|
|
2540
|
-
isRowLoading:
|
|
2541
|
-
filters:
|
|
2542
|
-
setFilter:
|
|
2543
|
-
clearFilter:
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
3109
|
+
const l = t, a = qt(), r = F(() => !!a.onRowClick), i = q(), c = q(), {
|
|
3110
|
+
page: d,
|
|
3111
|
+
rowsPerPage: v,
|
|
3112
|
+
totalRecords: m,
|
|
3113
|
+
recordRange: f,
|
|
3114
|
+
handlePageChange: u,
|
|
3115
|
+
handleRowsPerPage: h,
|
|
3116
|
+
paginatedRows: g,
|
|
3117
|
+
sortHelpers: C,
|
|
3118
|
+
searchQuery: S,
|
|
3119
|
+
onInputTyped: E,
|
|
3120
|
+
isRowExpanded: L,
|
|
3121
|
+
toggleRowExpansion: P,
|
|
3122
|
+
setRowLoading: B,
|
|
3123
|
+
isRowLoading: b,
|
|
3124
|
+
filters: p,
|
|
3125
|
+
setFilter: x,
|
|
3126
|
+
clearFilter: R,
|
|
3127
|
+
tableRef: T,
|
|
3128
|
+
tableContainer: M,
|
|
3129
|
+
tableResponsiveRef: A,
|
|
3130
|
+
refresh: O
|
|
3131
|
+
} = Bs(
|
|
3132
|
+
{ ...o, rows: s.value },
|
|
3133
|
+
l,
|
|
3134
|
+
{ header: o.stickyHeader, footer: o.stickyFooter }
|
|
3135
|
+
), {
|
|
3136
|
+
selectedItems: N,
|
|
3137
|
+
isItemSelectedControlled: I,
|
|
3138
|
+
isAllChecked: W,
|
|
3139
|
+
isSomeChecked: V,
|
|
3140
|
+
toggleAll: U,
|
|
3141
|
+
toggleRow: ge
|
|
3142
|
+
} = Hs(o, l), Vt = F(
|
|
3143
|
+
() => Ht(o.columns, I.value, o.expandable)
|
|
3144
|
+
), { hasLeftShadow: Lt, hasRightShadow: Pt, refreshSticky: $e } = Ws(
|
|
3145
|
+
T,
|
|
3146
|
+
F(() => o.columns)
|
|
2553
3147
|
);
|
|
2554
|
-
return
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
3148
|
+
return Ns(T, $e), Y(
|
|
3149
|
+
() => g.value,
|
|
3150
|
+
() => {
|
|
3151
|
+
oe(() => {
|
|
3152
|
+
$e();
|
|
3153
|
+
});
|
|
3154
|
+
},
|
|
3155
|
+
{ deep: !0 }
|
|
3156
|
+
), Y(
|
|
3157
|
+
() => o.columns,
|
|
3158
|
+
() => {
|
|
3159
|
+
oe(() => {
|
|
3160
|
+
$e();
|
|
3161
|
+
});
|
|
3162
|
+
},
|
|
3163
|
+
{ deep: !0 }
|
|
3164
|
+
), n({
|
|
3165
|
+
toggleRowExpansion: P,
|
|
3166
|
+
setRowLoading: B,
|
|
3167
|
+
refreshSticky: $e
|
|
3168
|
+
}), Re(async () => {
|
|
3169
|
+
setTimeout(() => {
|
|
3170
|
+
$e();
|
|
3171
|
+
}, 100), await oe(), O(), l("tableMounted");
|
|
2559
3172
|
try {
|
|
2560
3173
|
l("dataLoaded", o.rows);
|
|
2561
|
-
} catch (
|
|
2562
|
-
l("dataError",
|
|
3174
|
+
} catch (ee) {
|
|
3175
|
+
l("dataError", ee);
|
|
2563
3176
|
}
|
|
2564
|
-
}),
|
|
3177
|
+
}), mt(() => {
|
|
2565
3178
|
l("tableUnmounted");
|
|
2566
|
-
}),
|
|
3179
|
+
}), Mt(() => {
|
|
2567
3180
|
l("tableBeforeMount");
|
|
2568
|
-
}), (
|
|
2569
|
-
|
|
3181
|
+
}), (ee, j) => (y(), k("div", Ks, [
|
|
3182
|
+
ne(Cs, {
|
|
2570
3183
|
"show-search": e.showSearch,
|
|
2571
|
-
"search-query":
|
|
2572
|
-
"onUpdate:searchQuery":
|
|
2573
|
-
onSearch:
|
|
3184
|
+
"search-query": $(S),
|
|
3185
|
+
"onUpdate:searchQuery": j[0] || (j[0] = (Z) => Fe(S) ? S.value = Z : null),
|
|
3186
|
+
onSearch: $(E),
|
|
2574
3187
|
"search-placeholder": e.searchPlaceholder,
|
|
2575
3188
|
"search-class": e.searchClass
|
|
2576
3189
|
}, {
|
|
2577
|
-
left:
|
|
2578
|
-
|
|
3190
|
+
left: X(() => [
|
|
3191
|
+
z(ee.$slots, "filterAreaLeft", {}, void 0, !0)
|
|
2579
3192
|
]),
|
|
2580
|
-
right:
|
|
2581
|
-
|
|
3193
|
+
right: X(() => [
|
|
3194
|
+
z(ee.$slots, "filterAreaRight", {}, void 0, !0)
|
|
2582
3195
|
]),
|
|
2583
3196
|
_: 3
|
|
2584
3197
|
}, 8, ["show-search", "search-query", "onSearch", "search-placeholder", "search-class"]),
|
|
2585
|
-
|
|
2586
|
-
|
|
3198
|
+
w("div", {
|
|
3199
|
+
ref_key: "tableContainer",
|
|
3200
|
+
ref: M,
|
|
3201
|
+
class: G(["vs-table-container vs-position-relative vs-overflow-auto", [
|
|
3202
|
+
e.containerClass,
|
|
3203
|
+
{
|
|
3204
|
+
"has-left-shadow": $(Lt),
|
|
3205
|
+
"has-right-shadow": $(Pt)
|
|
3206
|
+
}
|
|
3207
|
+
]])
|
|
2587
3208
|
}, [
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
3209
|
+
w("div", {
|
|
3210
|
+
ref_key: "tableResponsiveRef",
|
|
3211
|
+
ref: A,
|
|
3212
|
+
class: G(["vs-table-wrapper", { "vs-sticky-header-wrapper": e.stickyHeader }])
|
|
3213
|
+
}, [
|
|
3214
|
+
w("table", {
|
|
3215
|
+
ref_key: "tableRef",
|
|
3216
|
+
ref: T,
|
|
3217
|
+
class: G(["vs-table", e.tableClass])
|
|
2591
3218
|
}, [
|
|
2592
|
-
|
|
3219
|
+
ne(Xo, {
|
|
3220
|
+
ref_key: "headerRef",
|
|
3221
|
+
ref: i,
|
|
2593
3222
|
columns: e.columns,
|
|
2594
3223
|
expandable: e.expandable,
|
|
2595
|
-
"is-item-selected-controlled":
|
|
2596
|
-
"is-all-checked":
|
|
2597
|
-
"is-some-checked":
|
|
3224
|
+
"is-item-selected-controlled": $(I),
|
|
3225
|
+
"is-all-checked": $(W),
|
|
3226
|
+
"is-some-checked": $(V),
|
|
2598
3227
|
tablename: e.tablename,
|
|
2599
|
-
"sort-helpers":
|
|
2600
|
-
filters:
|
|
2601
|
-
"onUpdate:filters":
|
|
3228
|
+
"sort-helpers": $(C),
|
|
3229
|
+
filters: $(p),
|
|
3230
|
+
"onUpdate:filters": j[1] || (j[1] = (Z) => Fe(p) ? p.value = Z : null),
|
|
2602
3231
|
rows: e.rows,
|
|
2603
3232
|
"header-class": e.headerClass,
|
|
2604
|
-
onToggleAll:
|
|
2605
|
-
onApplyFilter:
|
|
2606
|
-
|
|
3233
|
+
onToggleAll: $(U),
|
|
3234
|
+
onApplyFilter: j[2] || (j[2] = (Z, de) => {
|
|
3235
|
+
$(x)(Z, de), d.value = 1;
|
|
2607
3236
|
}),
|
|
2608
|
-
onClearFilter:
|
|
2609
|
-
R
|
|
3237
|
+
onClearFilter: j[3] || (j[3] = (Z) => {
|
|
3238
|
+
$(R)(Z), d.value = 1;
|
|
2610
3239
|
})
|
|
2611
|
-
},
|
|
2612
|
-
|
|
2613
|
-
name:
|
|
2614
|
-
fn:
|
|
2615
|
-
|
|
3240
|
+
}, Te({ _: 2 }, [
|
|
3241
|
+
Q(ee.$slots, (Z, de) => ({
|
|
3242
|
+
name: de,
|
|
3243
|
+
fn: X((Ze) => [
|
|
3244
|
+
z(ee.$slots, de, nt(ot(Ze)), void 0, !0)
|
|
2616
3245
|
])
|
|
2617
3246
|
}))
|
|
2618
3247
|
]), 1032, ["columns", "expandable", "is-item-selected-controlled", "is-all-checked", "is-some-checked", "tablename", "sort-helpers", "filters", "rows", "header-class", "onToggleAll"]),
|
|
2619
|
-
|
|
3248
|
+
ne(vs, {
|
|
3249
|
+
ref_key: "bodyRef",
|
|
3250
|
+
ref: c,
|
|
2620
3251
|
loading: e.loading,
|
|
2621
3252
|
"loading-text": e.loadingText,
|
|
2622
3253
|
"no-data-text": e.noDataText,
|
|
2623
3254
|
"no-data-description": e.noDataDescription,
|
|
2624
|
-
"paginated-rows":
|
|
2625
|
-
"total-columns":
|
|
3255
|
+
"paginated-rows": $(g),
|
|
3256
|
+
"total-columns": Vt.value,
|
|
2626
3257
|
expandable: e.expandable,
|
|
2627
|
-
"is-item-selected-controlled":
|
|
2628
|
-
"selected-items":
|
|
3258
|
+
"is-item-selected-controlled": $(I),
|
|
3259
|
+
"selected-items": $(N),
|
|
2629
3260
|
tablename: e.tablename,
|
|
2630
3261
|
columns: e.columns,
|
|
2631
3262
|
"row-key": e.rowKey,
|
|
2632
3263
|
"row-class": e.rowClass,
|
|
2633
3264
|
"cell-class": e.cellClass,
|
|
2634
3265
|
"has-row-click": r.value,
|
|
2635
|
-
"get-row-key":
|
|
2636
|
-
"get-value":
|
|
2637
|
-
"is-row-expanded":
|
|
2638
|
-
"is-row-loading":
|
|
2639
|
-
"toggle-row-expansion":
|
|
2640
|
-
"toggle-row":
|
|
2641
|
-
"is-row-selected":
|
|
2642
|
-
onRowClick:
|
|
2643
|
-
},
|
|
2644
|
-
|
|
2645
|
-
name:
|
|
2646
|
-
fn:
|
|
2647
|
-
|
|
3266
|
+
"get-row-key": $(re),
|
|
3267
|
+
"get-value": $(Bt),
|
|
3268
|
+
"is-row-expanded": $(L),
|
|
3269
|
+
"is-row-loading": $(b),
|
|
3270
|
+
"toggle-row-expansion": $(P),
|
|
3271
|
+
"toggle-row": $(ge),
|
|
3272
|
+
"is-row-selected": $(yt),
|
|
3273
|
+
onRowClick: j[4] || (j[4] = (Z, de) => ee.$emit("rowClick", Z, de))
|
|
3274
|
+
}, Te({ _: 2 }, [
|
|
3275
|
+
Q(ee.$slots, (Z, de) => ({
|
|
3276
|
+
name: de,
|
|
3277
|
+
fn: X((Ze) => [
|
|
3278
|
+
z(ee.$slots, de, nt(ot(Ze)), void 0, !0)
|
|
2648
3279
|
])
|
|
2649
3280
|
}))
|
|
2650
|
-
]), 1032, ["loading", "loading-text", "no-data-text", "no-data-description", "paginated-rows", "total-columns", "expandable", "is-item-selected-controlled", "selected-items", "tablename", "columns", "row-key", "row-class", "cell-class", "has-row-click", "get-row-key", "get-value", "is-row-expanded", "is-row-loading", "toggle-row-expansion", "toggle-row", "is-row-selected"])
|
|
3281
|
+
]), 1032, ["loading", "loading-text", "no-data-text", "no-data-description", "paginated-rows", "total-columns", "expandable", "is-item-selected-controlled", "selected-items", "tablename", "columns", "row-key", "row-class", "cell-class", "has-row-click", "get-row-key", "get-value", "is-row-expanded", "is-row-loading", "toggle-row-expansion", "toggle-row", "is-row-selected"]),
|
|
3282
|
+
e.showFooter ? (y(), fe(Ts, {
|
|
3283
|
+
key: 0,
|
|
3284
|
+
columns: e.columns,
|
|
3285
|
+
rows: $(g),
|
|
3286
|
+
expandable: e.expandable,
|
|
3287
|
+
"is-item-selected-controlled": $(I)
|
|
3288
|
+
}, null, 8, ["columns", "rows", "expandable", "is-item-selected-controlled"])) : D("", !0)
|
|
2651
3289
|
], 2)
|
|
2652
|
-
],
|
|
3290
|
+
], 2)
|
|
2653
3291
|
], 2),
|
|
2654
|
-
e.
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
modelValue:
|
|
2658
|
-
"onUpdate:modelValue":
|
|
2659
|
-
onRowsPerPageChanged:
|
|
3292
|
+
e.showPagination ? (y(), k("div", zs, [
|
|
3293
|
+
w("div", js, [
|
|
3294
|
+
ne(on, {
|
|
3295
|
+
modelValue: $(v),
|
|
3296
|
+
"onUpdate:modelValue": j[5] || (j[5] = (Z) => Fe(v) ? v.value = Z : null),
|
|
3297
|
+
onRowsPerPageChanged: $(h)
|
|
2660
3298
|
}, null, 8, ["modelValue", "onRowsPerPageChanged"]),
|
|
2661
|
-
|
|
2662
|
-
|
|
3299
|
+
j[7] || (j[7] = w("div", { class: "vs-divider" }, null, -1)),
|
|
3300
|
+
w("div", Us, H($(f).start < 1 ? 0 : $(f).start) + " - " + H($(f).end) + " of " + H($(m)) + " " + H(e.entriesText), 1)
|
|
2663
3301
|
]),
|
|
2664
|
-
|
|
2665
|
-
modelValue:
|
|
2666
|
-
"onUpdate:modelValue":
|
|
2667
|
-
totalRecords:
|
|
2668
|
-
rowsPerPage:
|
|
3302
|
+
ne(Jt, {
|
|
3303
|
+
modelValue: $(d),
|
|
3304
|
+
"onUpdate:modelValue": j[6] || (j[6] = (Z) => Fe(d) ? d.value = Z : null),
|
|
3305
|
+
totalRecords: $(m),
|
|
3306
|
+
rowsPerPage: $(v),
|
|
2669
3307
|
maxVisible: e.maxVisiblePages,
|
|
2670
3308
|
tablename: e.tablename,
|
|
2671
|
-
class:
|
|
2672
|
-
onPageChanged:
|
|
3309
|
+
class: G(e.paginationClass),
|
|
3310
|
+
onPageChanged: $(u)
|
|
2673
3311
|
}, null, 8, ["modelValue", "totalRecords", "rowsPerPage", "maxVisible", "tablename", "class", "onPageChanged"])
|
|
2674
|
-
])) :
|
|
3312
|
+
])) : D("", !0)
|
|
2675
3313
|
]));
|
|
2676
3314
|
}
|
|
2677
|
-
}),
|
|
3315
|
+
}), Xs = /* @__PURE__ */ ae(Zs, [["__scopeId", "data-v-6e690e26"]]), Ys = {
|
|
2678
3316
|
install(e) {
|
|
2679
|
-
e.component("VsDataTable",
|
|
3317
|
+
e.component("VsDataTable", Xs);
|
|
2680
3318
|
}
|
|
2681
3319
|
};
|
|
2682
3320
|
export {
|
|
2683
|
-
|
|
2684
|
-
|
|
3321
|
+
Xs as VsDataTable,
|
|
3322
|
+
Ys as default
|
|
2685
3323
|
};
|