@medyat/vue-data-table 1.0.0 → 1.0.1
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/CHANGELOG.md +33 -0
- package/dist/ColumnsDialog-dngip-aF.js +251 -0
- package/dist/ColumnsDialog-dngip-aF.js.map +1 -0
- package/dist/{DateEditor-BTIZMwf1.js → DateEditor-C2zzyoPQ.js} +2 -2
- package/dist/{DateEditor-BTIZMwf1.js.map → DateEditor-C2zzyoPQ.js.map} +1 -1
- package/dist/FiltersSheet-C3zOlbkN.js +284 -0
- package/dist/{FiltersSheet-o2HaQuhq.js.map → FiltersSheet-C3zOlbkN.js.map} +1 -1
- package/dist/PhoneMoreSheet-66OdIZrl.js +266 -0
- package/dist/PhoneMoreSheet-66OdIZrl.js.map +1 -0
- package/dist/{TextEditor-DPqiiRau.js → TextEditor-CHLM6u-l.js} +24 -25
- package/dist/{TextEditor-DPqiiRau.js.map → TextEditor-CHLM6u-l.js.map} +1 -1
- package/dist/index.d.ts +11 -6
- package/dist/index.js +1423 -1568
- package/dist/index.js.map +1 -1
- package/dist/query-CGNWUi2E.js +2904 -0
- package/dist/query-CGNWUi2E.js.map +1 -0
- package/dist/sheet.d.ts +15 -14
- package/dist/sheet.js +1754 -1816
- package/dist/sheet.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +24 -17
- package/dist/FiltersSheet-o2HaQuhq.js +0 -285
- package/dist/PhoneMoreSheet-gfkH96RR.js +0 -227
- package/dist/PhoneMoreSheet-gfkH96RR.js.map +0 -1
- package/dist/plugin-DhgcjEdi.js +0 -813
- package/dist/plugin-DhgcjEdi.js.map +0 -1
- package/dist/query-DQWMlX0m.js +0 -2121
- package/dist/query-DQWMlX0m.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import { $ as e, A as t,
|
|
2
|
-
import { a as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { useVirtualizer as Pt } from "@tanstack/vue-virtual";
|
|
1
|
+
import { $ as e, A as t, C as n, D as r, E as i, F as a, G as o, H as s, K as c, L as l, M as u, N as d, O as f, P as p, Q as ee, T as m, U as h, V as g, W as _, X as te, Y as v, Z as ne, a as re, c as ie, et as ae, f as y, h as oe, i as se, it as ce, j as b, l as le, n as x, o as ue, q as de, r as fe, rt as pe, s as me, t as he, u as ge, v as S, w as _e } from "./query-CGNWUi2E.js";
|
|
2
|
+
import { a as C, i as w, n as T, r as E, t as ve } from "./TextEditor-CHLM6u-l.js";
|
|
3
|
+
import { t as D } from "./Layer-Di-tPd8b.js";
|
|
4
|
+
import { Fragment as O, computed as k, createBlock as A, createCommentVNode as j, createElementBlock as M, createElementVNode as N, createSlots as ye, createTextVNode as P, createVNode as F, defineAsyncComponent as be, defineComponent as I, getCurrentInstance as xe, mergeModels as Se, mergeProps as Ce, nextTick as we, normalizeClass as L, normalizeStyle as Te, onBeforeUnmount as Ee, onMounted as De, openBlock as R, reactive as Oe, ref as z, renderList as B, renderSlot as V, resolveDynamicComponent as ke, shallowRef as H, toDisplayString as U, toHandlers as Ae, toRaw as je, toValue as W, unref as G, useId as Me, useModel as Ne, vModelCheckbox as Pe, vModelText as Fe, vShow as Ie, watch as K, watchEffect as Le, withCtx as q, withDirectives as Re, withKeys as ze, withModifiers as Be } from "vue";
|
|
5
|
+
import { PhArrowClockwise as Ve, PhArrowUp as He, PhCaretDown as Ue, PhCaretLeft as We, PhCaretRight as Ge, PhCheck as Ke, PhCircleNotch as qe, PhDotsThree as Je, PhFunnel as Ye, PhMagnifyingGlass as Xe, PhPlus as Ze, PhPushPin as Qe, PhStack as $e, PhWarning as et, PhX as tt } from "@phosphor-icons/vue";
|
|
6
|
+
import { columnFilteringFeature as J, createFilteredRowModel as nt, createPaginatedRowModel as rt, createSortedRowModel as it, functionalUpdate as at, globalFilteringFeature as ot, rowExpandingFeature as st, rowPaginationFeature as ct, rowSelectionFeature as lt, rowSortingFeature as ut, tableFeatures as dt, useTable as ft } from "@tanstack/vue-table";
|
|
7
|
+
import { DialogClose as pt, DialogContent as mt, DialogDescription as ht, DialogOverlay as gt, DialogPortal as Y, DialogRoot as X, DialogTitle as _t, DropdownMenuCheckboxItem as vt, DropdownMenuContent as yt, DropdownMenuItem as Z, DropdownMenuLabel as bt, DropdownMenuPortal as Q, DropdownMenuRoot as xt, DropdownMenuSeparator as $, DropdownMenuSub as St, DropdownMenuSubContent as Ct, DropdownMenuSubTrigger as wt, DropdownMenuTrigger as Tt, ListboxContent as Et, ListboxFilter as Dt, ListboxGroup as Ot, ListboxGroupLabel as kt, ListboxItem as At, ListboxRoot as jt, PopoverContent as Mt, PopoverPortal as Nt, PopoverRoot as Pt, PopoverTrigger as Ft } from "reka-ui";
|
|
8
|
+
import { useVirtualizer as It } from "@tanstack/vue-virtual";
|
|
10
9
|
//#region src/core/filters/ColumnPicker.vue?vue&type=script&setup=true&lang.ts
|
|
11
|
-
var
|
|
10
|
+
var Lt = { class: "dt-input has-icon dt-picker-search" }, Rt = { class: "dt-input-icon" }, zt = { class: "dt-picker-name" }, Bt = { class: "dt-picker-hint" }, Vt = { class: "dt-picker-name" }, Ht = { class: "dt-picker-hint" }, Ut = { class: "dt-picker-name" }, Wt = { class: "dt-picker-hint" }, Gt = {
|
|
12
11
|
key: 3,
|
|
13
12
|
class: "dt-options-empty"
|
|
14
|
-
},
|
|
13
|
+
}, Kt = /* @__PURE__ */ I({
|
|
15
14
|
__name: "ColumnPicker",
|
|
16
|
-
props: /*@__PURE__*/
|
|
15
|
+
props: /*@__PURE__*/ Se({
|
|
17
16
|
columns: {},
|
|
18
17
|
chips: {}
|
|
19
18
|
}, {
|
|
@@ -23,119 +22,122 @@ var Ft = { class: "dt-input has-icon dt-picker-search" }, It = { class: "dt-inpu
|
|
|
23
22
|
},
|
|
24
23
|
openModifiers: {}
|
|
25
24
|
}),
|
|
26
|
-
emits: /*@__PURE__*/
|
|
27
|
-
setup(
|
|
28
|
-
let
|
|
29
|
-
|
|
30
|
-
e || (
|
|
25
|
+
emits: /*@__PURE__*/ Se(["pick"], ["update:open"]),
|
|
26
|
+
setup(t, { emit: n }) {
|
|
27
|
+
let r = t, i = n, a = Ne(t, "open"), { i18n: o } = _(), s = z("");
|
|
28
|
+
K(a, (e) => {
|
|
29
|
+
e || (s.value = "");
|
|
31
30
|
});
|
|
32
|
-
let
|
|
33
|
-
let e = /* @__PURE__ */ new Set([...
|
|
34
|
-
return
|
|
35
|
-
}),
|
|
36
|
-
typeof e == "string" && (
|
|
31
|
+
let c = k(() => r.columns.filter((e) => e.filterable ?? te[e.type].filterable)), l = (e) => !s.value || e.header.toLocaleLowerCase().includes(s.value.toLocaleLowerCase()), u = k(() => r.chips.map((e) => c.value.find((t) => t.id === e.column)).filter((e) => !!e && l(e))), d = k(() => new Set(r.chips.map((e) => e.column))), f = k(() => c.value.filter((e) => e.suggested && !d.value.has(e.id) && l(e)).slice(0, 4)), p = k(() => {
|
|
32
|
+
let e = /* @__PURE__ */ new Set([...d.value, ...f.value.map((e) => e.id)]);
|
|
33
|
+
return c.value.filter((t) => !e.has(t.id) && l(t));
|
|
34
|
+
}), ee = k(() => !u.value.length && !f.value.length && !p.value.length), m = !1, h = (e) => {
|
|
35
|
+
typeof e == "string" && (m = !0, a.value = !1, i("pick", e));
|
|
36
|
+
}, g = (e) => {
|
|
37
|
+
m && e.preventDefault(), m = !1;
|
|
37
38
|
};
|
|
38
|
-
return (
|
|
39
|
-
open:
|
|
40
|
-
"onUpdate:open":
|
|
39
|
+
return (t, n) => (R(), A(G(Pt), {
|
|
40
|
+
open: a.value,
|
|
41
|
+
"onUpdate:open": n[1] ||= (e) => a.value = e
|
|
41
42
|
}, {
|
|
42
|
-
default:
|
|
43
|
-
default:
|
|
43
|
+
default: q(() => [F(G(Ft), { "as-child": "" }, {
|
|
44
|
+
default: q(() => [V(t.$slots, "trigger")]),
|
|
44
45
|
_: 3
|
|
45
|
-
}),
|
|
46
|
-
default:
|
|
46
|
+
}), F(G(Nt), null, {
|
|
47
|
+
default: q(() => [F(G(Mt), {
|
|
47
48
|
class: "dt-pop dt-picker",
|
|
48
49
|
align: "start",
|
|
49
|
-
"side-offset": 4
|
|
50
|
+
"side-offset": 4,
|
|
51
|
+
onCloseAutoFocus: g
|
|
50
52
|
}, {
|
|
51
|
-
default:
|
|
53
|
+
default: q(() => [F(G(jt), {
|
|
52
54
|
"model-value": void 0,
|
|
53
55
|
"selection-behavior": "replace",
|
|
54
56
|
"highlight-on-hover": "",
|
|
55
|
-
"onUpdate:modelValue":
|
|
57
|
+
"onUpdate:modelValue": h
|
|
56
58
|
}, {
|
|
57
|
-
default:
|
|
59
|
+
default: q(() => [N("label", Lt, [N("span", Rt, [F(G(Xe), {
|
|
58
60
|
size: 14,
|
|
59
61
|
"aria-hidden": "true"
|
|
60
|
-
})]),
|
|
61
|
-
modelValue:
|
|
62
|
-
"onUpdate:modelValue":
|
|
62
|
+
})]), F(G(Dt), {
|
|
63
|
+
modelValue: s.value,
|
|
64
|
+
"onUpdate:modelValue": n[0] ||= (e) => s.value = e,
|
|
63
65
|
"auto-focus": "",
|
|
64
|
-
placeholder:
|
|
65
|
-
"aria-label":
|
|
66
|
+
placeholder: G(o).t("picker.search"),
|
|
67
|
+
"aria-label": G(o).t("picker.search")
|
|
66
68
|
}, null, 8, [
|
|
67
69
|
"modelValue",
|
|
68
70
|
"placeholder",
|
|
69
71
|
"aria-label"
|
|
70
|
-
])]),
|
|
72
|
+
])]), F(G(Et), {
|
|
71
73
|
class: "dt-picker-list",
|
|
72
|
-
"aria-label":
|
|
74
|
+
"aria-label": G(o).t("display.columns")
|
|
73
75
|
}, {
|
|
74
|
-
default:
|
|
75
|
-
|
|
76
|
-
default:
|
|
77
|
-
default:
|
|
76
|
+
default: q(() => [
|
|
77
|
+
u.value.length ? (R(), A(G(Ot), { key: 0 }, {
|
|
78
|
+
default: q(() => [F(G(kt), { class: "dt-pop-label" }, {
|
|
79
|
+
default: q(() => [P(U(G(o).t("picker.filtered")), 1)]),
|
|
78
80
|
_: 1
|
|
79
|
-
}), (
|
|
81
|
+
}), (R(!0), M(O, null, B(u.value, (e) => (R(), A(G(At), {
|
|
80
82
|
key: e.id,
|
|
81
83
|
value: e.id,
|
|
82
84
|
class: "dt-picker-item"
|
|
83
85
|
}, {
|
|
84
|
-
default:
|
|
85
|
-
(
|
|
86
|
+
default: q(() => [
|
|
87
|
+
(R(), A(ke(G(C)[e.type]), {
|
|
86
88
|
size: 14,
|
|
87
89
|
"aria-hidden": "true"
|
|
88
90
|
})),
|
|
89
|
-
|
|
90
|
-
|
|
91
|
+
N("span", zt, U(e.header), 1),
|
|
92
|
+
N("span", Bt, U(G(o).t("picker.filteredHint")), 1)
|
|
91
93
|
]),
|
|
92
94
|
_: 2
|
|
93
95
|
}, 1032, ["value"]))), 128))]),
|
|
94
96
|
_: 1
|
|
95
|
-
})) :
|
|
96
|
-
|
|
97
|
-
default:
|
|
98
|
-
default:
|
|
97
|
+
})) : j("", !0),
|
|
98
|
+
f.value.length ? (R(), A(G(Ot), { key: 1 }, {
|
|
99
|
+
default: q(() => [F(G(kt), { class: "dt-pop-label" }, {
|
|
100
|
+
default: q(() => [P(U(G(o).t("picker.suggested")), 1)]),
|
|
99
101
|
_: 1
|
|
100
|
-
}), (
|
|
101
|
-
key:
|
|
102
|
-
value:
|
|
102
|
+
}), (R(!0), M(O, null, B(f.value, (t) => (R(), A(G(At), {
|
|
103
|
+
key: t.id,
|
|
104
|
+
value: t.id,
|
|
103
105
|
class: "dt-picker-item"
|
|
104
106
|
}, {
|
|
105
|
-
default:
|
|
106
|
-
(
|
|
107
|
+
default: q(() => [
|
|
108
|
+
(R(), A(ke(G(C)[t.type]), {
|
|
107
109
|
size: 14,
|
|
108
110
|
"aria-hidden": "true"
|
|
109
111
|
})),
|
|
110
|
-
|
|
111
|
-
|
|
112
|
+
N("span", Vt, U(t.header), 1),
|
|
113
|
+
N("span", Ht, U(G(o).t(G(e)(t.type))), 1)
|
|
112
114
|
]),
|
|
113
115
|
_: 2
|
|
114
116
|
}, 1032, ["value"]))), 128))]),
|
|
115
117
|
_: 1
|
|
116
|
-
})) :
|
|
117
|
-
|
|
118
|
-
default:
|
|
119
|
-
default:
|
|
118
|
+
})) : j("", !0),
|
|
119
|
+
p.value.length ? (R(), A(G(Ot), { key: 2 }, {
|
|
120
|
+
default: q(() => [F(G(kt), { class: "dt-pop-label" }, {
|
|
121
|
+
default: q(() => [P(U(G(o).t("picker.allColumns")), 1)]),
|
|
120
122
|
_: 1
|
|
121
|
-
}), (
|
|
122
|
-
key:
|
|
123
|
-
value:
|
|
123
|
+
}), (R(!0), M(O, null, B(p.value, (t) => (R(), A(G(At), {
|
|
124
|
+
key: t.id,
|
|
125
|
+
value: t.id,
|
|
124
126
|
class: "dt-picker-item"
|
|
125
127
|
}, {
|
|
126
|
-
default:
|
|
127
|
-
(
|
|
128
|
+
default: q(() => [
|
|
129
|
+
(R(), A(ke(G(C)[t.type]), {
|
|
128
130
|
size: 14,
|
|
129
131
|
"aria-hidden": "true"
|
|
130
132
|
})),
|
|
131
|
-
|
|
132
|
-
|
|
133
|
+
N("span", Ut, U(t.header), 1),
|
|
134
|
+
N("span", Wt, U(G(o).t(G(e)(t.type))), 1)
|
|
133
135
|
]),
|
|
134
136
|
_: 2
|
|
135
137
|
}, 1032, ["value"]))), 128))]),
|
|
136
138
|
_: 1
|
|
137
|
-
})) :
|
|
138
|
-
|
|
139
|
+
})) : j("", !0),
|
|
140
|
+
ee.value ? (R(), M("div", Gt, U(G(o).t("picker.noMatch")), 1)) : j("", !0)
|
|
139
141
|
]),
|
|
140
142
|
_: 1
|
|
141
143
|
}, 8, ["aria-label"])]),
|
|
@@ -148,16 +150,13 @@ var Ft = { class: "dt-input has-icon dt-picker-search" }, It = { class: "dt-inpu
|
|
|
148
150
|
_: 3
|
|
149
151
|
}, 8, ["open"]));
|
|
150
152
|
}
|
|
151
|
-
}),
|
|
153
|
+
}), qt = ["data-col"], Jt = ["aria-label"], Yt = { class: "dt-chip-field" }, Xt = { class: "dt-chip-value" }, Zt = ["aria-label"], Qt = { class: "dt-chip-field" }, $t = { class: "dt-chip-op" }, en = ["data-dt-tip"], tn = {
|
|
152
154
|
key: 0,
|
|
153
155
|
class: "dt-chip-avatars"
|
|
154
|
-
},
|
|
156
|
+
}, nn = { class: "dt-chip-pop-head" }, rn = { class: "dt-chip-pop-field" }, an = {
|
|
155
157
|
type: "button",
|
|
156
158
|
class: "dt-op-btn"
|
|
157
|
-
},
|
|
158
|
-
key: 0,
|
|
159
|
-
class: "dt-chip-pop-body"
|
|
160
|
-
}, an = { class: "dt-pop-foot" }, on = ["disabled"], sn = ["aria-label"], cn = { class: "dt-chip-field" }, ln = { class: "dt-chip-op" }, un = { class: "dt-chip-value" }, dn = ["aria-label"], fn = /* @__PURE__ */ R({
|
|
159
|
+
}, on = { class: "dt-pop-foot" }, sn = ["disabled"], cn = ["aria-label"], ln = { class: "dt-chip-field" }, un = { class: "dt-chip-op" }, dn = { class: "dt-chip-value" }, fn = ["aria-label"], pn = /* @__PURE__ */ I({
|
|
161
160
|
__name: "FilterChip",
|
|
162
161
|
props: {
|
|
163
162
|
chip: {},
|
|
@@ -175,130 +174,134 @@ var Ft = { class: "dt-input has-icon dt-picker-search" }, It = { class: "dt-inpu
|
|
|
175
174
|
"update:editing",
|
|
176
175
|
"open"
|
|
177
176
|
],
|
|
178
|
-
setup(e, { emit:
|
|
179
|
-
let
|
|
180
|
-
column:
|
|
177
|
+
setup(e, { emit: t }) {
|
|
178
|
+
let n = be(() => import("./DateEditor-C2zzyoPQ.js")), i = e, a = t, { i18n: o } = _(), s = k(() => i.column.type), c = k(() => d(i.chip.op, s.value)), p = k(() => f(i.chip, s.value)), ee = k(() => s.value === "boolean"), h = k(() => Array.isArray(i.chip.value) ? i.chip.value.length : 1), g = k(() => b(o, i.chip.op, s.value, h.value)), te = k(() => u(i.column)), v = k(() => i.summary.people?.slice(0, 3) ?? []), ne = k(() => i.summary.full && i.summary.full !== i.summary.text ? i.summary.full : void 0), re = k(() => p.value ? o.t("filter.valueAria", {
|
|
179
|
+
column: i.column.header,
|
|
181
180
|
op: g.value,
|
|
182
|
-
value:
|
|
183
|
-
}) :
|
|
184
|
-
...
|
|
181
|
+
value: i.summary.text
|
|
182
|
+
}) : o.t("filter.chooseValueAria", { column: i.column.header })), ie = k(() => r(i.chip.op, s.value)), ae = k(() => ie.value === "options" && h.value && Array.isArray(i.chip.value) && i.chip.value.length ? o.t("option.selected", { count: i.chip.value.length }) : c.value === "range" ? o.t("number.boundsIncluded") : c.value === "dateRange" ? o.t("date.presetsRelative") : ""), y = (e) => a("update:chip", {
|
|
183
|
+
...i.chip,
|
|
185
184
|
...e
|
|
186
|
-
}),
|
|
185
|
+
}), oe = (e) => y({
|
|
187
186
|
value: e,
|
|
188
|
-
currency:
|
|
189
|
-
}),
|
|
190
|
-
...
|
|
187
|
+
currency: s.value === "currency" ? i.chip.currency ?? i.currencies[0] : i.chip.currency
|
|
188
|
+
}), se = (e) => a("update:chip", m(i.chip, e, s.value)), ce = () => a("update:chip", {
|
|
189
|
+
...i.chip,
|
|
191
190
|
op: "in",
|
|
192
191
|
value: ["@me"]
|
|
193
|
-
}),
|
|
192
|
+
}), le = () => i.chip.op === "is_empty" ? se("in") : se("is_empty"), x = () => y({ value: void 0 }), ue = () => a("update:editing", !1), de = (e) => {
|
|
194
193
|
let t = e.detail.originalEvent.target;
|
|
195
194
|
t instanceof Element && t.closest(".dt-filter-trigger, .dt-head-menu, .dt-head-filtered") && e.preventDefault();
|
|
196
|
-
},
|
|
197
|
-
|
|
198
|
-
|
|
195
|
+
}, fe = z(null), pe = (e) => {
|
|
196
|
+
let t = fe.value?.querySelector("input, textarea");
|
|
197
|
+
t && (e.preventDefault(), t.focus());
|
|
198
|
+
}, me = () => y({ value: i.chip.value !== !0 });
|
|
199
|
+
return (t, r) => (R(), M("span", {
|
|
200
|
+
class: L(["dt-chip", {
|
|
199
201
|
"is-editing": e.editing,
|
|
200
|
-
"is-incomplete": !
|
|
202
|
+
"is-incomplete": !p.value,
|
|
201
203
|
"is-phone": e.phone
|
|
202
204
|
}]),
|
|
203
205
|
"data-col": e.chip.column
|
|
204
|
-
}, [e.phone ? (
|
|
206
|
+
}, [e.phone ? (R(), M("button", {
|
|
205
207
|
key: 0,
|
|
206
208
|
type: "button",
|
|
207
209
|
class: "dt-chip-body",
|
|
208
|
-
"aria-label":
|
|
209
|
-
onClick:
|
|
210
|
+
"aria-label": G(o).t("mobile.chipAria", { summary: `${e.column.header} ${g.value} ${e.summary.text}`.trim() }),
|
|
211
|
+
onClick: r[0] ||= (e) => a("open")
|
|
210
212
|
}, [
|
|
211
|
-
(
|
|
213
|
+
(R(), A(ke(G(C)[s.value]), {
|
|
212
214
|
size: 14,
|
|
213
215
|
class: "dt-chip-icon",
|
|
214
216
|
"aria-hidden": "true"
|
|
215
217
|
})),
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
], 8,
|
|
218
|
+
N("span", Yt, U(e.column.header), 1),
|
|
219
|
+
N("span", Xt, U(e.summary.text), 1)
|
|
220
|
+
], 8, Jt)) : ee.value ? (R(), M("button", {
|
|
219
221
|
key: 2,
|
|
220
222
|
type: "button",
|
|
221
223
|
class: "dt-chip-body",
|
|
222
|
-
"aria-label":
|
|
223
|
-
onClick:
|
|
224
|
+
"aria-label": re.value,
|
|
225
|
+
onClick: me
|
|
224
226
|
}, [
|
|
225
|
-
(
|
|
227
|
+
(R(), A(ke(G(C)[s.value]), {
|
|
226
228
|
size: 14,
|
|
227
229
|
class: "dt-chip-icon",
|
|
228
230
|
"aria-hidden": "true"
|
|
229
231
|
})),
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
], 8,
|
|
232
|
+
N("span", ln, U(e.column.header), 1),
|
|
233
|
+
N("span", un, U(g.value), 1),
|
|
234
|
+
N("span", dn, U(e.summary.text), 1)
|
|
235
|
+
], 8, cn)) : (R(), A(G(Pt), {
|
|
234
236
|
key: 1,
|
|
235
237
|
open: e.editing,
|
|
236
|
-
"onUpdate:open":
|
|
238
|
+
"onUpdate:open": r[2] ||= (e) => a("update:editing", e)
|
|
237
239
|
}, {
|
|
238
|
-
default:
|
|
239
|
-
default:
|
|
240
|
+
default: q(() => [F(G(Ft), { "as-child": "" }, {
|
|
241
|
+
default: q(() => [N("button", {
|
|
240
242
|
type: "button",
|
|
241
243
|
class: "dt-chip-body",
|
|
242
|
-
"aria-label":
|
|
244
|
+
"aria-label": re.value
|
|
243
245
|
}, [
|
|
244
|
-
(
|
|
246
|
+
(R(), A(ke(G(C)[s.value]), {
|
|
245
247
|
size: 14,
|
|
246
248
|
class: "dt-chip-icon",
|
|
247
249
|
"aria-hidden": "true"
|
|
248
250
|
})),
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
251
|
+
N("span", Qt, U(e.column.header), 1),
|
|
252
|
+
N("span", $t, U(g.value), 1),
|
|
253
|
+
c.value === "none" ? j("", !0) : (R(), M("span", {
|
|
252
254
|
key: 0,
|
|
253
|
-
class:
|
|
254
|
-
"data-dt-tip":
|
|
255
|
-
}, [
|
|
255
|
+
class: L(["dt-chip-value", { "is-placeholder": !p.value }]),
|
|
256
|
+
"data-dt-tip": ne.value
|
|
257
|
+
}, [p.value && v.value.length ? (R(), M("span", tn, [(R(!0), M(O, null, B(v.value, (e) => (R(), A(ke(() => G(l)({
|
|
256
258
|
value: e.value,
|
|
257
259
|
label: e.label
|
|
258
|
-
})), { key: String(e.value) }))), 128))])) :
|
|
259
|
-
], 8,
|
|
260
|
+
})), { key: String(e.value) }))), 128))])) : j("", !0), P(" " + U(p.value ? e.summary.text : G(o).t("filter.selectValue")), 1)], 10, en))
|
|
261
|
+
], 8, Zt)]),
|
|
260
262
|
_: 1
|
|
261
|
-
}),
|
|
262
|
-
default:
|
|
263
|
-
class:
|
|
263
|
+
}), F(G(Nt), null, {
|
|
264
|
+
default: q(() => [F(G(Mt), {
|
|
265
|
+
class: L(["dt-pop dt-chip-pop", `is-${ie.value ?? "none"}`]),
|
|
264
266
|
align: "start",
|
|
265
267
|
"side-offset": 4,
|
|
266
|
-
onFocusOutside:
|
|
268
|
+
onFocusOutside: de,
|
|
269
|
+
onOpenAutoFocus: pe
|
|
267
270
|
}, {
|
|
268
|
-
default:
|
|
269
|
-
|
|
270
|
-
default:
|
|
271
|
-
default:
|
|
271
|
+
default: q(() => [
|
|
272
|
+
N("div", nn, [N("span", rn, U(e.column.header), 1), F(G(xt), null, {
|
|
273
|
+
default: q(() => [F(G(Tt), { "as-child": "" }, {
|
|
274
|
+
default: q(() => [N("button", an, [P(U(g.value) + " ", 1), F(G(Ue), {
|
|
272
275
|
size: 12,
|
|
273
276
|
"aria-hidden": "true"
|
|
274
277
|
})])]),
|
|
275
278
|
_: 1
|
|
276
|
-
}),
|
|
277
|
-
default:
|
|
279
|
+
}), F(G(Q), null, {
|
|
280
|
+
default: q(() => [F(G(yt), {
|
|
278
281
|
class: "dt-menu dt-op-menu",
|
|
279
282
|
align: "start",
|
|
280
283
|
"side-offset": 6
|
|
281
284
|
}, {
|
|
282
|
-
default:
|
|
285
|
+
default: q(() => [s.value === "user" ? (R(), A(G(Z), {
|
|
283
286
|
key: 0,
|
|
284
287
|
class: "dt-menu-item",
|
|
285
|
-
onSelect:
|
|
288
|
+
onSelect: ce
|
|
286
289
|
}, {
|
|
287
|
-
default:
|
|
290
|
+
default: q(() => [P(U(G(o).t("op.isMe")), 1)]),
|
|
288
291
|
_: 1
|
|
289
|
-
})) :
|
|
292
|
+
})) : j("", !0), (R(!0), M(O, null, B(te.value, (t) => (R(), M(O, { key: t }, [t === "is_empty" ? (R(), A(G($), {
|
|
290
293
|
key: 0,
|
|
291
294
|
class: "dt-menu-sep"
|
|
292
|
-
})) :
|
|
293
|
-
class:
|
|
294
|
-
onSelect: (e) =>
|
|
295
|
+
})) : j("", !0), F(G(Z), {
|
|
296
|
+
class: L(["dt-menu-item", { "is-selected": t === e.chip.op }]),
|
|
297
|
+
onSelect: (e) => se(t)
|
|
295
298
|
}, {
|
|
296
|
-
default:
|
|
299
|
+
default: q(() => [P(U(G(b)(G(o), t, s.value, h.value)) + " ", 1), t === e.chip.op ? (R(), A(G(Ke), {
|
|
297
300
|
key: 0,
|
|
298
301
|
size: 14,
|
|
299
302
|
class: "dt-pop-end",
|
|
300
303
|
"aria-hidden": "true"
|
|
301
|
-
})) :
|
|
304
|
+
})) : j("", !0)]),
|
|
302
305
|
_: 2
|
|
303
306
|
}, 1032, ["class", "onSelect"])], 64))), 128))]),
|
|
304
307
|
_: 1
|
|
@@ -307,85 +310,90 @@ var Ft = { class: "dt-input has-icon dt-picker-search" }, It = { class: "dt-inpu
|
|
|
307
310
|
})]),
|
|
308
311
|
_: 1
|
|
309
312
|
})]),
|
|
310
|
-
|
|
313
|
+
ie.value ? (R(), M("div", {
|
|
314
|
+
key: 0,
|
|
315
|
+
ref_key: "body",
|
|
316
|
+
ref: fe,
|
|
317
|
+
class: "dt-chip-pop-body"
|
|
318
|
+
}, [ie.value === "options" ? (R(), A(E, {
|
|
311
319
|
key: 0,
|
|
312
320
|
column: e.column,
|
|
313
321
|
op: e.chip.op,
|
|
314
322
|
"model-value": Array.isArray(e.chip.value) ? e.chip.value : [],
|
|
315
323
|
rows: e.rows,
|
|
316
324
|
labels: e.labels,
|
|
317
|
-
"onUpdate:modelValue":
|
|
318
|
-
onUnassigned:
|
|
325
|
+
"onUpdate:modelValue": oe,
|
|
326
|
+
onUnassigned: le
|
|
319
327
|
}, null, 8, [
|
|
320
328
|
"column",
|
|
321
329
|
"op",
|
|
322
330
|
"model-value",
|
|
323
331
|
"rows",
|
|
324
332
|
"labels"
|
|
325
|
-
])) :
|
|
333
|
+
])) : ie.value === "text" ? (R(), A(ve, {
|
|
326
334
|
key: 1,
|
|
327
335
|
column: e.column,
|
|
328
336
|
op: e.chip.op,
|
|
329
337
|
"model-value": e.chip.value,
|
|
330
|
-
"onUpdate:modelValue":
|
|
331
|
-
onDone:
|
|
338
|
+
"onUpdate:modelValue": oe,
|
|
339
|
+
onDone: ue
|
|
332
340
|
}, null, 8, [
|
|
333
341
|
"column",
|
|
334
342
|
"op",
|
|
335
343
|
"model-value"
|
|
336
|
-
])) :
|
|
344
|
+
])) : ie.value === "number" ? (R(), A(w, {
|
|
337
345
|
key: 2,
|
|
338
346
|
column: e.column,
|
|
339
347
|
op: e.chip.op,
|
|
340
348
|
"model-value": e.chip.value,
|
|
341
349
|
currency: e.chip.currency,
|
|
342
350
|
currencies: e.currencies,
|
|
343
|
-
"onUpdate:modelValue":
|
|
344
|
-
"onUpdate:currency":
|
|
345
|
-
onDone:
|
|
351
|
+
"onUpdate:modelValue": oe,
|
|
352
|
+
"onUpdate:currency": r[1] ||= (e) => y({ currency: e }),
|
|
353
|
+
onDone: ue
|
|
346
354
|
}, null, 8, [
|
|
347
355
|
"column",
|
|
348
356
|
"op",
|
|
349
357
|
"model-value",
|
|
350
358
|
"currency",
|
|
351
359
|
"currencies"
|
|
352
|
-
])) :
|
|
360
|
+
])) : ie.value === "star" ? (R(), A(T, {
|
|
353
361
|
key: 3,
|
|
354
362
|
column: e.column,
|
|
355
363
|
"model-value": e.chip.value,
|
|
356
|
-
"onUpdate:modelValue":
|
|
357
|
-
onDone:
|
|
358
|
-
}, null, 8, ["column", "model-value"])) : (
|
|
364
|
+
"onUpdate:modelValue": oe,
|
|
365
|
+
onDone: ue
|
|
366
|
+
}, null, 8, ["column", "model-value"])) : (R(), A(G(n), {
|
|
359
367
|
key: 4,
|
|
360
368
|
op: e.chip.op,
|
|
361
369
|
"model-value": e.chip.value,
|
|
362
|
-
"onUpdate:modelValue":
|
|
363
|
-
onDone:
|
|
364
|
-
}, null, 8, ["op", "model-value"]))])) :
|
|
365
|
-
|
|
370
|
+
"onUpdate:modelValue": oe,
|
|
371
|
+
onDone: ue
|
|
372
|
+
}, null, 8, ["op", "model-value"]))], 512)) : j("", !0),
|
|
373
|
+
N("div", on, [N("span", null, U(ae.value), 1), N("button", {
|
|
366
374
|
type: "button",
|
|
367
375
|
class: "dt-pop-action",
|
|
368
376
|
disabled: e.chip.value === void 0,
|
|
369
|
-
onClick:
|
|
370
|
-
}, G(
|
|
377
|
+
onClick: x
|
|
378
|
+
}, U(G(o).t("common.clear")), 9, sn)])
|
|
371
379
|
]),
|
|
372
380
|
_: 1
|
|
373
381
|
}, 8, ["class"])]),
|
|
374
382
|
_: 1
|
|
375
383
|
})]),
|
|
376
384
|
_: 1
|
|
377
|
-
}, 8, ["open"])), e.phone ?
|
|
385
|
+
}, 8, ["open"])), e.phone ? j("", !0) : (R(), M("button", {
|
|
378
386
|
key: 3,
|
|
379
387
|
type: "button",
|
|
380
388
|
class: "dt-chip-remove",
|
|
381
|
-
"aria-label":
|
|
382
|
-
onClick:
|
|
383
|
-
}, [
|
|
389
|
+
"aria-label": G(o).t("filter.removeAria", { column: e.column.header }),
|
|
390
|
+
onClick: r[3] ||= (e) => a("remove")
|
|
391
|
+
}, [F(G(tt), {
|
|
384
392
|
size: 12,
|
|
385
393
|
"aria-hidden": "true"
|
|
386
|
-
})], 8,
|
|
394
|
+
})], 8, fn))], 10, qt));
|
|
387
395
|
}
|
|
388
|
-
}),
|
|
396
|
+
}), mn = /* @__PURE__ */ I({
|
|
389
397
|
__name: "FilterBar",
|
|
390
398
|
props: {
|
|
391
399
|
chips: {},
|
|
@@ -405,13 +413,13 @@ var Ft = { class: "dt-input has-icon dt-picker-search" }, It = { class: "dt-inpu
|
|
|
405
413
|
"open"
|
|
406
414
|
],
|
|
407
415
|
setup(e, { emit: t }) {
|
|
408
|
-
let n = e, r = t, { i18n: i } =
|
|
416
|
+
let n = e, r = t, { i18n: i } = _(), a = (e) => n.defs.get(e), o = (e) => e ? [...s.value?.querySelectorAll(".dt-chip") ?? []].find((t) => t.dataset.col === e) : void 0, s = z(null), c = z(!1), l = () => {
|
|
409
417
|
let e = s.value;
|
|
410
418
|
e && (c.value = e.scrollLeft + e.clientWidth < e.scrollWidth - 1);
|
|
411
419
|
}, u;
|
|
412
|
-
|
|
420
|
+
De(() => {
|
|
413
421
|
l(), typeof ResizeObserver < "u" && s.value && (u = new ResizeObserver(l), u.observe(s.value));
|
|
414
|
-
}),
|
|
422
|
+
}), Ee(() => u?.disconnect()), K(() => [n.chips.length, n.editing], () => void we(() => {
|
|
415
423
|
l();
|
|
416
424
|
let e = n.editing ?? n.chips.at(-1)?.column;
|
|
417
425
|
o(e)?.scrollIntoView?.({
|
|
@@ -421,17 +429,17 @@ var Ft = { class: "dt-input has-icon dt-picker-search" }, It = { class: "dt-inpu
|
|
|
421
429
|
}));
|
|
422
430
|
let d = (e) => {
|
|
423
431
|
let t = n.chips.findIndex((t) => t.column === e), i = n.chips[t + 1]?.column;
|
|
424
|
-
r("remove", e),
|
|
432
|
+
r("remove", e), we(() => {
|
|
425
433
|
(o(i)?.querySelector(".dt-chip-body") ?? s.value?.parentElement?.querySelector(".dt-filter-add"))?.focus();
|
|
426
434
|
});
|
|
427
435
|
};
|
|
428
|
-
return (t, n) => (
|
|
429
|
-
|
|
436
|
+
return (t, n) => (R(), M("div", { class: L(["dt-filter-row", { "is-scrolled-end": c.value }]) }, [
|
|
437
|
+
N("div", {
|
|
430
438
|
ref_key: "row",
|
|
431
439
|
ref: s,
|
|
432
440
|
class: "dt-chips",
|
|
433
441
|
onScrollPassive: l
|
|
434
|
-
}, [(
|
|
442
|
+
}, [(R(!0), M(O, null, B(e.chips, (t) => (R(), A(pn, {
|
|
435
443
|
key: t.column,
|
|
436
444
|
chip: t,
|
|
437
445
|
column: a(t.column),
|
|
@@ -458,98 +466,16 @@ var Ft = { class: "dt-input has-icon dt-picker-search" }, It = { class: "dt-inpu
|
|
|
458
466
|
"onUpdate:editing",
|
|
459
467
|
"onRemove"
|
|
460
468
|
]))), 128))], 544),
|
|
461
|
-
e.phone ?
|
|
462
|
-
e.phone ?
|
|
469
|
+
e.phone ? j("", !0) : V(t.$slots, "add", {}, void 0, void 0, 0),
|
|
470
|
+
e.phone ? j("", !0) : (R(), M("button", {
|
|
463
471
|
key: 1,
|
|
464
472
|
type: "button",
|
|
465
473
|
class: "dt-btn dt-btn-ghost dt-filter-clear",
|
|
466
474
|
onClick: n[1] ||= (e) => r("clear-all")
|
|
467
|
-
}, G(
|
|
475
|
+
}, U(G(i).t("filter.clearAll")), 1))
|
|
468
476
|
], 2));
|
|
469
477
|
}
|
|
470
|
-
}),
|
|
471
|
-
function hn(e) {
|
|
472
|
-
let t = V(0), n = V(!1), i = (e) => [...e.querySelectorAll(mn)].filter((e) => e.offsetParent !== null || e.getClientRects().length > 0), a = (r) => {
|
|
473
|
-
let i = e.count();
|
|
474
|
-
if (i === 0) return;
|
|
475
|
-
let a = Math.max(0, Math.min(i - 1, r));
|
|
476
|
-
t.value = a, n.value = !0, e.scrollToIndex(a);
|
|
477
|
-
let o = (t) => {
|
|
478
|
-
let n = e.rowEl(a);
|
|
479
|
-
n ? n.focus({ preventScroll: !0 }) : t < 3 && requestAnimationFrame(() => o(t + 1));
|
|
480
|
-
};
|
|
481
|
-
o(0);
|
|
482
|
-
}, o = (t) => {
|
|
483
|
-
let o = t.target, s = o.closest("[role=\"row\"][data-index]");
|
|
484
|
-
if (!s) return;
|
|
485
|
-
let c = Number(s.dataset.index);
|
|
486
|
-
if (o !== s) {
|
|
487
|
-
if (t.key === "Escape") {
|
|
488
|
-
t.preventDefault(), n.value = !0, s.focus({ preventScroll: !0 });
|
|
489
|
-
return;
|
|
490
|
-
}
|
|
491
|
-
if ((t.key === "ArrowRight" || t.key === "ArrowLeft") && !r(o)) {
|
|
492
|
-
let e = i(s), r = e.indexOf(o.closest(mn) ?? o), a = t.key === "ArrowRight" ? e[r + 1] : r > 0 ? e[r - 1] : s;
|
|
493
|
-
a && (t.preventDefault(), n.value = !0, a.focus({ preventScroll: !0 }));
|
|
494
|
-
}
|
|
495
|
-
} else switch (t.key) {
|
|
496
|
-
case "ArrowDown":
|
|
497
|
-
t.preventDefault(), a(c + 1);
|
|
498
|
-
break;
|
|
499
|
-
case "ArrowUp":
|
|
500
|
-
t.preventDefault(), c === 0 && e.onTop ? e.onTop() : a(c - 1);
|
|
501
|
-
break;
|
|
502
|
-
case "Home":
|
|
503
|
-
t.preventDefault(), a(0);
|
|
504
|
-
break;
|
|
505
|
-
case "End":
|
|
506
|
-
t.preventDefault(), a(e.count() - 1);
|
|
507
|
-
break;
|
|
508
|
-
case "PageDown":
|
|
509
|
-
t.preventDefault(), a(c + e.pageSize());
|
|
510
|
-
break;
|
|
511
|
-
case "PageUp":
|
|
512
|
-
t.preventDefault(), a(c - e.pageSize());
|
|
513
|
-
break;
|
|
514
|
-
case "ArrowRight": {
|
|
515
|
-
if (e.onRight?.(c)) {
|
|
516
|
-
t.preventDefault();
|
|
517
|
-
break;
|
|
518
|
-
}
|
|
519
|
-
let r = i(s)[0];
|
|
520
|
-
r && (t.preventDefault(), n.value = !0, r.focus({ preventScroll: !0 }));
|
|
521
|
-
break;
|
|
522
|
-
}
|
|
523
|
-
case "ArrowLeft":
|
|
524
|
-
e.onLeft?.(c) && t.preventDefault();
|
|
525
|
-
break;
|
|
526
|
-
case "Enter": e.onEnter && (t.preventDefault(), e.onEnter(c));
|
|
527
|
-
}
|
|
528
|
-
}, s = (e) => {
|
|
529
|
-
let r = e.target.closest("[role=\"row\"][data-index]");
|
|
530
|
-
r && (n.value = !1, t.value = Number(r.dataset.index));
|
|
531
|
-
}, c = (e) => {
|
|
532
|
-
let t = e.target.closest("[role=\"row\"][data-index]");
|
|
533
|
-
t && e.target === t && !n.value && !l && (n.value = !0);
|
|
534
|
-
}, l = !1;
|
|
535
|
-
return {
|
|
536
|
-
focusedIndex: t,
|
|
537
|
-
keyboard: n,
|
|
538
|
-
focusRow: a,
|
|
539
|
-
onKeydown: o,
|
|
540
|
-
onMousedown: s,
|
|
541
|
-
onFocusin: c,
|
|
542
|
-
onPointerdown: () => {
|
|
543
|
-
l = !0, setTimeout(() => l = !1, 0);
|
|
544
|
-
},
|
|
545
|
-
clamp: () => {
|
|
546
|
-
t.value = Math.max(0, Math.min(e.count() - 1, t.value));
|
|
547
|
-
}
|
|
548
|
-
};
|
|
549
|
-
}
|
|
550
|
-
//#endregion
|
|
551
|
-
//#region src/core/grid/HeaderCell.vue?vue&type=script&setup=true&lang.ts
|
|
552
|
-
var gn = ["aria-sort", "data-col"], _n = [
|
|
478
|
+
}), hn = ["aria-sort", "data-col"], gn = ["aria-label"], _n = [
|
|
553
479
|
"aria-disabled",
|
|
554
480
|
"data-dt-tip",
|
|
555
481
|
"aria-describedby"
|
|
@@ -570,10 +496,10 @@ var gn = ["aria-sort", "data-col"], _n = [
|
|
|
570
496
|
}, Cn = {
|
|
571
497
|
key: 0,
|
|
572
498
|
class: "dt-head-sort-index"
|
|
573
|
-
}, wn = ["id"], Tn = ["aria-label"], En =
|
|
499
|
+
}, wn = ["id"], Tn = ["aria-label"], En = { class: "dt-kbd" }, Dn = { class: "dt-kbd" }, On = {
|
|
574
500
|
key: 0,
|
|
575
501
|
class: "dt-resize-badge"
|
|
576
|
-
},
|
|
502
|
+
}, kn = /* @__PURE__ */ I({
|
|
577
503
|
__name: "HeaderCell",
|
|
578
504
|
props: {
|
|
579
505
|
phone: { type: Boolean },
|
|
@@ -588,191 +514,165 @@ var gn = ["aria-sort", "data-col"], _n = [
|
|
|
588
514
|
"sort",
|
|
589
515
|
"filter",
|
|
590
516
|
"action",
|
|
591
|
-
"nav",
|
|
592
517
|
"resize-by",
|
|
593
518
|
"resize-start"
|
|
594
519
|
],
|
|
595
|
-
setup(
|
|
596
|
-
let
|
|
520
|
+
setup(t, { emit: n }) {
|
|
521
|
+
let r = t, i = n, { i18n: a } = _(), o = k(() => r.column.def), s = k(() => ee(o.value.type)), c = k(() => ne(o.value)), l = k(() => typeof o.value.unit == "string" ? o.value.unit : void 0), u = k(() => r.sortable ?? !1), d = k(() => o.value.filterable ?? te[o.value.type].filterable), f = Me(), p = k(() => o.value.description ? `${o.value.header}\n${o.value.description}` : o.value.header), m = z(!1), h = (e) => {
|
|
597
522
|
let t = e.currentTarget.parentElement;
|
|
598
|
-
|
|
599
|
-
},
|
|
523
|
+
i("resize-start", r.column, t.getBoundingClientRect().width), r.column.header.getResizeHandler()(e);
|
|
524
|
+
}, g = (e) => {
|
|
600
525
|
let t = e.key;
|
|
601
|
-
if (t === "Enter" || t === " ")
|
|
602
|
-
else if (t === "F10" && e.shiftKey || t === "ContextMenu") e.preventDefault(),
|
|
603
|
-
else if (t === "ArrowLeft" || t === "ArrowRight") {
|
|
526
|
+
if (t === "Enter" || t === " ") u.value && (e.preventDefault(), i("sort", r.column, e.shiftKey));
|
|
527
|
+
else if (t === "F10" && e.shiftKey || t === "ContextMenu") e.preventDefault(), m.value = !0;
|
|
528
|
+
else if ((t === "ArrowLeft" || t === "ArrowRight") && e.shiftKey) {
|
|
604
529
|
e.preventDefault();
|
|
605
|
-
let
|
|
606
|
-
e.altKey
|
|
607
|
-
}
|
|
608
|
-
}, v = (e) =>
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
"is-
|
|
616
|
-
"is-
|
|
617
|
-
"is-
|
|
530
|
+
let n = t === "ArrowLeft";
|
|
531
|
+
e.altKey ? i("action", r.column, n ? "move-left" : "move-right") : i("resize-by", r.column, n ? -16 : 16);
|
|
532
|
+
}
|
|
533
|
+
}, v = !1, re = (e) => {
|
|
534
|
+
v = e === "filter", i("action", r.column, e);
|
|
535
|
+
}, ie = (e) => {
|
|
536
|
+
v && e.preventDefault(), v = !1;
|
|
537
|
+
};
|
|
538
|
+
return (n, r) => (R(), M("div", {
|
|
539
|
+
class: L(["dt-head-cell", [`is-${c.value}`, {
|
|
540
|
+
"is-numeric": s.value,
|
|
541
|
+
"is-sorted": !!t.sort,
|
|
542
|
+
"is-pinned-start": t.column.pinned === "start",
|
|
543
|
+
"is-pinned-end": t.column.pinned === "end",
|
|
544
|
+
"is-pin-edge": t.column.pinEdge,
|
|
545
|
+
"is-resizing": t.resizing !== null && t.resizing !== void 0,
|
|
546
|
+
"is-menu-open": m.value
|
|
618
547
|
}]]),
|
|
619
|
-
style:
|
|
548
|
+
style: Te(t.column.pinned === "start" ? { left: `var(${t.column.offsetVar})` } : t.column.pinned === "end" ? { right: `var(${t.column.offsetVar})` } : void 0),
|
|
620
549
|
role: "columnheader",
|
|
621
|
-
"aria-sort":
|
|
622
|
-
"data-col":
|
|
623
|
-
onContextmenu:
|
|
550
|
+
"aria-sort": t.sort === "asc" ? "ascending" : t.sort === "desc" ? "descending" : void 0,
|
|
551
|
+
"data-col": t.column.id,
|
|
552
|
+
onContextmenu: r[10] ||= Be((e) => m.value = !0, ["prevent"])
|
|
624
553
|
}, [
|
|
625
|
-
|
|
554
|
+
t.filtered ? (R(), M("button", {
|
|
555
|
+
key: 0,
|
|
556
|
+
type: "button",
|
|
557
|
+
class: "dt-head-icon dt-head-filtered",
|
|
558
|
+
"aria-label": G(a).t("header.filterBy"),
|
|
559
|
+
onClick: r[0] ||= (e) => i("filter", t.column)
|
|
560
|
+
}, [F(G(Ye), {
|
|
561
|
+
size: 14,
|
|
562
|
+
weight: "fill",
|
|
563
|
+
"aria-hidden": "true"
|
|
564
|
+
})], 8, gn)) : j("", !0),
|
|
565
|
+
N("button", {
|
|
626
566
|
type: "button",
|
|
627
|
-
class:
|
|
628
|
-
|
|
629
|
-
"
|
|
630
|
-
"
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
onKeydown: te
|
|
567
|
+
class: L(["dt-head-label", { "is-static": !u.value }]),
|
|
568
|
+
"aria-disabled": u.value ? void 0 : "true",
|
|
569
|
+
"data-dt-tip": p.value,
|
|
570
|
+
"aria-describedby": o.value.description ? G(f) : void 0,
|
|
571
|
+
onClick: r[1] ||= (e) => u.value && i("sort", t.column, e.shiftKey),
|
|
572
|
+
onKeydown: g
|
|
634
573
|
}, [
|
|
635
|
-
|
|
574
|
+
t.sort && s.value ? (R(), M("span", vn, [t.sortIndex ? (R(), M("span", yn, U(t.sortIndex), 1)) : j("", !0), F(G(He), {
|
|
636
575
|
size: 12,
|
|
637
|
-
class:
|
|
638
|
-
}, null, 8, ["class"])])) :
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
576
|
+
class: L({ "is-desc": t.sort === "desc" })
|
|
577
|
+
}, null, 8, ["class"])])) : j("", !0),
|
|
578
|
+
N("span", bn, U(t.phone && o.value.headerShort || o.value.header), 1),
|
|
579
|
+
l.value ? (R(), M("span", xn, U(l.value), 1)) : j("", !0),
|
|
580
|
+
t.sort && !s.value ? (R(), M("span", Sn, [F(G(He), {
|
|
642
581
|
size: 12,
|
|
643
|
-
class:
|
|
644
|
-
}, null, 8, ["class"]),
|
|
645
|
-
|
|
582
|
+
class: L({ "is-desc": t.sort === "desc" })
|
|
583
|
+
}, null, 8, ["class"]), t.sortIndex ? (R(), M("span", Cn, U(t.sortIndex), 1)) : j("", !0)])) : j("", !0),
|
|
584
|
+
t.column.pinned ? (R(), A(G(Qe), {
|
|
646
585
|
key: 3,
|
|
647
586
|
size: 12,
|
|
648
587
|
class: "dt-head-pin",
|
|
649
588
|
"aria-hidden": "true"
|
|
650
|
-
})) :
|
|
589
|
+
})) : j("", !0)
|
|
651
590
|
], 42, _n),
|
|
652
|
-
o.value.description ? (
|
|
653
|
-
key: 0,
|
|
654
|
-
id: K(m),
|
|
655
|
-
class: "dt-sr-only"
|
|
656
|
-
}, G(o.value.description), 9, wn)) : N("", !0),
|
|
657
|
-
e.filtered ? (B(), P("button", {
|
|
591
|
+
o.value.description ? (R(), M("span", {
|
|
658
592
|
key: 1,
|
|
659
|
-
|
|
660
|
-
class: "dt-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
size: 14,
|
|
666
|
-
weight: "fill",
|
|
667
|
-
"aria-hidden": "true"
|
|
668
|
-
})], 8, Tn)) : N("", !0),
|
|
669
|
-
L(K(yt), {
|
|
670
|
-
open: g.value,
|
|
671
|
-
"onUpdate:open": n[13] ||= (e) => g.value = e
|
|
593
|
+
id: G(f),
|
|
594
|
+
class: "dt-sr-only"
|
|
595
|
+
}, U(o.value.description), 9, wn)) : j("", !0),
|
|
596
|
+
F(G(xt), {
|
|
597
|
+
open: m.value,
|
|
598
|
+
"onUpdate:open": r[9] ||= (e) => m.value = e
|
|
672
599
|
}, {
|
|
673
|
-
default:
|
|
674
|
-
default:
|
|
600
|
+
default: q(() => [F(G(Tt), { "as-child": "" }, {
|
|
601
|
+
default: q(() => [N("button", {
|
|
675
602
|
type: "button",
|
|
676
603
|
class: "dt-head-icon dt-head-menu",
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
}, [L(K(Ke), {
|
|
604
|
+
"aria-label": G(a).t("header.optionsAria", { column: o.value.header })
|
|
605
|
+
}, [F(G(Je), {
|
|
680
606
|
size: 16,
|
|
681
607
|
weight: "bold",
|
|
682
608
|
"aria-hidden": "true"
|
|
683
|
-
})], 8,
|
|
609
|
+
})], 8, Tn)]),
|
|
684
610
|
_: 1
|
|
685
|
-
}),
|
|
686
|
-
default:
|
|
611
|
+
}), F(G(Q), null, {
|
|
612
|
+
default: q(() => [F(G(yt), {
|
|
687
613
|
class: "dt-menu dt-col-menu",
|
|
688
614
|
align: "end",
|
|
689
|
-
"side-offset": 4
|
|
615
|
+
"side-offset": 4,
|
|
616
|
+
onCloseAutoFocus: ie
|
|
690
617
|
}, {
|
|
691
|
-
default:
|
|
692
|
-
|
|
693
|
-
default:
|
|
618
|
+
default: q(() => [
|
|
619
|
+
F(G(bt), { class: "dt-menu-label" }, {
|
|
620
|
+
default: q(() => [P(U(G(a).t(G(e)(o.value.type))), 1)]),
|
|
694
621
|
_: 1
|
|
695
622
|
}),
|
|
696
|
-
|
|
697
|
-
|
|
623
|
+
u.value ? (R(), M(O, { key: 0 }, [
|
|
624
|
+
F(G(Z), {
|
|
698
625
|
class: "dt-menu-item",
|
|
699
|
-
onSelect:
|
|
626
|
+
onSelect: r[2] ||= (e) => re("sort-asc")
|
|
700
627
|
}, {
|
|
701
|
-
default:
|
|
628
|
+
default: q(() => [P(U(G(a).t("header.sortAsc")), 1)]),
|
|
702
629
|
_: 1
|
|
703
630
|
}),
|
|
704
|
-
|
|
631
|
+
F(G(Z), {
|
|
705
632
|
class: "dt-menu-item",
|
|
706
|
-
onSelect:
|
|
633
|
+
onSelect: r[3] ||= (e) => re("sort-desc")
|
|
707
634
|
}, {
|
|
708
|
-
default:
|
|
635
|
+
default: q(() => [P(U(G(a).t("header.sortDesc")), 1)]),
|
|
709
636
|
_: 1
|
|
710
637
|
}),
|
|
711
|
-
|
|
638
|
+
F(G(Z), {
|
|
712
639
|
class: "dt-menu-item",
|
|
713
|
-
disabled: !
|
|
714
|
-
onSelect:
|
|
640
|
+
disabled: !t.sort,
|
|
641
|
+
onSelect: r[4] ||= (e) => re("sort-clear")
|
|
715
642
|
}, {
|
|
716
|
-
default:
|
|
643
|
+
default: q(() => [P(U(G(a).t("header.clearSort")), 1)]),
|
|
717
644
|
_: 1
|
|
718
645
|
}, 8, ["disabled"]),
|
|
719
|
-
|
|
720
|
-
], 64)) :
|
|
721
|
-
|
|
646
|
+
F(G($), { class: "dt-menu-sep" })
|
|
647
|
+
], 64)) : j("", !0),
|
|
648
|
+
d.value ? (R(), M(O, { key: 1 }, [F(G(Z), {
|
|
722
649
|
class: "dt-menu-item",
|
|
723
|
-
onSelect:
|
|
650
|
+
onSelect: r[5] ||= (e) => re("filter")
|
|
724
651
|
}, {
|
|
725
|
-
default:
|
|
652
|
+
default: q(() => [P(U(G(a).t("header.filterBy")), 1)]),
|
|
726
653
|
_: 1
|
|
727
|
-
}),
|
|
728
|
-
|
|
729
|
-
key: 2,
|
|
654
|
+
}), F(G($), { class: "dt-menu-sep" })], 64)) : j("", !0),
|
|
655
|
+
F(G(Z), {
|
|
730
656
|
class: "dt-menu-item",
|
|
731
|
-
onSelect:
|
|
657
|
+
onSelect: r[6] ||= (e) => re("move-left")
|
|
732
658
|
}, {
|
|
733
|
-
default:
|
|
734
|
-
_: 1
|
|
735
|
-
})) : (B(), P(A, { key: 3 }, [L(K(Z), {
|
|
736
|
-
class: "dt-menu-item",
|
|
737
|
-
onSelect: n[7] ||= (e) => v("pin-left")
|
|
738
|
-
}, {
|
|
739
|
-
default: J(() => [I(G(K(i).t("header.pinLeft")), 1)]),
|
|
740
|
-
_: 1
|
|
741
|
-
}), L(K(Z), {
|
|
742
|
-
class: "dt-menu-item",
|
|
743
|
-
onSelect: n[8] ||= (e) => v("pin-right")
|
|
744
|
-
}, {
|
|
745
|
-
default: J(() => [I(G(K(i).t("header.pinRight")), 1)]),
|
|
746
|
-
_: 1
|
|
747
|
-
})], 64)),
|
|
748
|
-
L(K(Z), {
|
|
749
|
-
class: "dt-menu-item",
|
|
750
|
-
onSelect: n[9] ||= (e) => v("fit")
|
|
751
|
-
}, {
|
|
752
|
-
default: J(() => [I(G(K(i).t("header.fit")), 1)]),
|
|
659
|
+
default: q(() => [P(U(G(a).t("header.moveLeft")) + " ", 1), N("kbd", En, U(G(oe).left), 1)]),
|
|
753
660
|
_: 1
|
|
754
661
|
}),
|
|
755
|
-
|
|
662
|
+
F(G(Z), {
|
|
756
663
|
class: "dt-menu-item",
|
|
757
|
-
onSelect:
|
|
664
|
+
onSelect: r[7] ||= (e) => re("move-right")
|
|
758
665
|
}, {
|
|
759
|
-
default:
|
|
666
|
+
default: q(() => [P(U(G(a).t("header.moveRight")) + " ", 1), N("kbd", Dn, U(G(oe).right), 1)]),
|
|
760
667
|
_: 1
|
|
761
668
|
}),
|
|
762
|
-
|
|
669
|
+
F(G($), { class: "dt-menu-sep" }),
|
|
670
|
+
F(G(Z), {
|
|
763
671
|
class: "dt-menu-item",
|
|
764
|
-
|
|
672
|
+
disabled: !!t.column.pinned || !t.column.header.column.getCanHide(),
|
|
673
|
+
onSelect: r[8] ||= (e) => re("hide")
|
|
765
674
|
}, {
|
|
766
|
-
default:
|
|
767
|
-
_: 1
|
|
768
|
-
}),
|
|
769
|
-
L(K($), { class: "dt-menu-sep" }),
|
|
770
|
-
L(K(Z), {
|
|
771
|
-
class: "dt-menu-item",
|
|
772
|
-
disabled: !!e.column.pinned || !e.column.header.column.getCanHide(),
|
|
773
|
-
onSelect: n[12] ||= (e) => v("hide")
|
|
774
|
-
}, {
|
|
775
|
-
default: J(() => [I(G(K(i).t("header.hide")), 1)]),
|
|
675
|
+
default: q(() => [P(U(G(a).t("header.hide")), 1)]),
|
|
776
676
|
_: 1
|
|
777
677
|
}, 8, ["disabled"])
|
|
778
678
|
]),
|
|
@@ -782,45 +682,44 @@ var gn = ["aria-sort", "data-col"], _n = [
|
|
|
782
682
|
})]),
|
|
783
683
|
_: 1
|
|
784
684
|
}, 8, ["open"]),
|
|
785
|
-
|
|
685
|
+
r[11] ||= N("span", {
|
|
786
686
|
class: "dt-head-sep",
|
|
787
687
|
"aria-hidden": "true"
|
|
788
688
|
}, null, -1),
|
|
789
|
-
|
|
689
|
+
N("span", {
|
|
790
690
|
class: "dt-resize",
|
|
791
691
|
"aria-hidden": "true",
|
|
792
|
-
onMousedown:
|
|
793
|
-
onTouchstartPassive:
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
], 46, gn));
|
|
692
|
+
onMousedown: h,
|
|
693
|
+
onTouchstartPassive: h
|
|
694
|
+
}, [t.resizing !== null && t.resizing !== void 0 ? (R(), M("span", On, U(Math.round(t.resizing)) + " px ", 1)) : j("", !0)], 32)
|
|
695
|
+
], 46, hn));
|
|
797
696
|
}
|
|
798
|
-
}),
|
|
697
|
+
}), An = [
|
|
799
698
|
"aria-label",
|
|
800
699
|
"aria-rowcount",
|
|
801
700
|
"aria-colcount",
|
|
802
701
|
"aria-busy",
|
|
803
702
|
"data-density"
|
|
804
|
-
],
|
|
703
|
+
], jn = {
|
|
805
704
|
class: "dt-head",
|
|
806
705
|
role: "row",
|
|
807
706
|
"aria-rowindex": "1"
|
|
808
|
-
},
|
|
707
|
+
}, Mn = [
|
|
809
708
|
"checked",
|
|
810
709
|
"indeterminate",
|
|
811
710
|
"aria-label"
|
|
812
|
-
],
|
|
711
|
+
], Nn = ["inert"], Pn = ["data-index"], Fn = ["id", "aria-rowindex"], In = ["aria-colspan"], Ln = {
|
|
813
712
|
key: 0,
|
|
814
713
|
class: "dt-refresh-bar",
|
|
815
714
|
"aria-hidden": "true"
|
|
816
|
-
},
|
|
715
|
+
}, Rn = {
|
|
817
716
|
key: 1,
|
|
818
717
|
class: "dt-notice",
|
|
819
718
|
role: "status"
|
|
820
|
-
},
|
|
719
|
+
}, zn = {
|
|
821
720
|
key: 2,
|
|
822
721
|
class: "dt-body-state"
|
|
823
|
-
},
|
|
722
|
+
}, Bn = 40, Vn = 48, Hn = /* @__PURE__ */ I({
|
|
824
723
|
__name: "GridRoot",
|
|
825
724
|
props: {
|
|
826
725
|
layout: {},
|
|
@@ -868,264 +767,192 @@ var gn = ["aria-sort", "data-col"], _n = [
|
|
|
868
767
|
"sort-set",
|
|
869
768
|
"header-filter"
|
|
870
769
|
],
|
|
871
|
-
setup(
|
|
872
|
-
let i =
|
|
770
|
+
setup(e, { expose: t, emit: r }) {
|
|
771
|
+
let i = e, a = r, o = _(), s = z(null), c = z(null), l = i.layout, u = typeof matchMedia == "function" && matchMedia("(pointer: coarse)").matches, d = k(() => u && i.density === "compact" ? "standard" : i.density), f = k(() => i.selectable ? i.phone ? Vn : Bn : 0), p = k(() => !!i.rowError && i.rows.some((e) => S(e).length > 0)), ee = k(() => {
|
|
873
772
|
let e = i.rowActions ?? [];
|
|
874
|
-
return e.some((e) => e.inline) ? i.rows.reduce((t, n) => Math.max(t,
|
|
875
|
-
}),
|
|
876
|
-
|
|
877
|
-
let e =
|
|
773
|
+
return e.some((e) => e.inline) ? i.rows.reduce((t, n) => Math.max(t, y(e, n).length), 0) : 0;
|
|
774
|
+
}), m = k(() => {
|
|
775
|
+
if (!i.rowMenu) return "";
|
|
776
|
+
let e = p.value ? " + var(--dt-icon) - 2px + var(--dt-space)" : "", t = ee.value;
|
|
777
|
+
return `calc(16px${e} + ${t + 1} * var(--dt-control-h-sm) + ${t} * var(--dt-space))`;
|
|
778
|
+
});
|
|
779
|
+
Le(() => {
|
|
780
|
+
let e = s.value;
|
|
878
781
|
if (!e) return;
|
|
879
782
|
let t = [
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
783
|
+
f.value ? `${f.value}px` : "",
|
|
784
|
+
l.colsVar.value,
|
|
785
|
+
m.value
|
|
883
786
|
];
|
|
884
|
-
e.style.setProperty("--cols", t.filter(Boolean).join(" "))
|
|
885
|
-
let n =
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
}
|
|
787
|
+
e.style.setProperty("--cols", t.filter(Boolean).join(" "));
|
|
788
|
+
let n = `${l.minWidth.value + f.value}px`;
|
|
789
|
+
e.style.setProperty("--dt-min-w", m.value ? `calc(${n} + ${m.value})` : n), e.style.setProperty("--dt-sel-w", `${f.value}px`), e.style.setProperty("--dt-menu-w", m.value || "0px");
|
|
790
|
+
let r = new Set(l.start.value.map((e) => e.offsetVar)), i = new Set(l.end.value.map((e) => e.offsetVar));
|
|
791
|
+
for (let [t, n] of Object.entries(l.offsetVars.value)) r.has(t) ? e.style.setProperty(t, `${parseFloat(n) + f.value}px`) : i.has(t) && m.value ? e.style.setProperty(t, `calc(${n} + ${m.value})`) : e.style.setProperty(t, n);
|
|
890
792
|
}, { flush: "sync" });
|
|
891
|
-
let
|
|
892
|
-
let e =
|
|
893
|
-
|
|
894
|
-
},
|
|
895
|
-
let e =
|
|
896
|
-
|
|
793
|
+
let h = z(40), g = z(36), v = z(0), ne = () => {
|
|
794
|
+
let e = c.value;
|
|
795
|
+
v.value = e ? Math.max(0, e.offsetHeight - e.clientHeight) : 0, s.value?.style.setProperty("--dt-bar-w", `${e ? Math.max(0, e.offsetWidth - e.clientWidth) : 0}px`), s.value?.style.setProperty("--dt-bar-h", `${v.value}px`);
|
|
796
|
+
}, re = () => {
|
|
797
|
+
let e = s.value ? parseFloat(getComputedStyle(s.value).getPropertyValue("--dt-row-h")) : NaN;
|
|
798
|
+
h.value = Number.isFinite(e) ? e : 40, g.value = s.value?.querySelector(".dt-head")?.offsetHeight ?? g.value, ne();
|
|
897
799
|
};
|
|
898
|
-
|
|
899
|
-
let
|
|
900
|
-
fmt:
|
|
901
|
-
i18n:
|
|
800
|
+
De(re), K([d, () => i.phone], () => requestAnimationFrame(re));
|
|
801
|
+
let ie = k(() => ({
|
|
802
|
+
fmt: ce(o.locale),
|
|
803
|
+
i18n: o.i18n,
|
|
902
804
|
today: /* @__PURE__ */ new Date(),
|
|
903
805
|
labels: oe,
|
|
904
|
-
density:
|
|
905
|
-
coarse:
|
|
906
|
-
})), oe = i.labels ?? new
|
|
907
|
-
let t = ce();
|
|
908
|
-
t[Math.max(0, Math.min(t.length - 1, e))]?.focus();
|
|
909
|
-
}, x = (e) => u.rowId(i.rows[e]), de = (e) => !!i.selection?.[x(e)], fe = (e) => !!i.expanded?.[u.rowId(e)], S = (e) => !!i.expandable && (i.canExpand?.(e) ?? !0), me = (e) => i.primaryLabel?.(e) ?? u.rowId(e), C = Ae(), w = (e) => `${C}-sub-${u.rowId(e)}`, T = (e) => `${C}-r-${u.rowId(e)}`, E = (e) => {
|
|
806
|
+
density: d.value,
|
|
807
|
+
coarse: u
|
|
808
|
+
})), oe = i.labels ?? new ae(), se = (e) => [...s.value?.querySelectorAll("[data-col]") ?? []].filter((t) => t.dataset.col === e), b = (e) => l.rowId(i.rows[e]), x = (e) => !!i.selection?.[b(e)], ue = (e) => !!i.expanded?.[l.rowId(e)], de = (e) => !!i.expandable && (i.canExpand?.(e) ?? !0), fe = (e) => i.primaryLabel?.(e) ?? l.rowId(e), pe = Me(), me = (e) => `${pe}-sub-${l.rowId(e)}`, he = (e) => `${pe}-r-${l.rowId(e)}`, S = (e) => {
|
|
910
809
|
let t = i.rowError?.(e);
|
|
911
810
|
return (Array.isArray(t) ? t : [t]).filter((e) => !!e);
|
|
912
|
-
},
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
pageSize: () => Math.max(1, Math.floor((l.value?.clientHeight ?? 0) / (_.value + 1)) - 1),
|
|
917
|
-
onEnter: (e) => D(e)?.querySelector(".dt-cell.is-primary a.dt-link")?.click(),
|
|
918
|
-
onRight: (e) => {
|
|
919
|
-
let t = i.rows[e];
|
|
920
|
-
return !t || !S(t) || fe(t) ? !1 : (o("toggle-expand", u.rowId(t), !0), !0);
|
|
921
|
-
},
|
|
922
|
-
onLeft: (e) => {
|
|
923
|
-
let t = i.rows[e];
|
|
924
|
-
return !t || !fe(t) ? !1 : (o("toggle-expand", u.rowId(t), !1), !0);
|
|
925
|
-
},
|
|
926
|
-
onTop: () => ue(0)
|
|
927
|
-
}), k = -1, he = (e, t) => {
|
|
811
|
+
}, _e = z(-1), C = (e) => {
|
|
812
|
+
let t = e.target.closest(".dt-row[data-index]");
|
|
813
|
+
_e.value = t ? Number(t.dataset.index) : -1;
|
|
814
|
+
}, w = -1, T = (e, t) => {
|
|
928
815
|
let [n, r] = e < t ? [e, t] : [t, e];
|
|
929
|
-
return i.rows.slice(n, r + 1).map((e) =>
|
|
930
|
-
},
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
if ((e.key === "a" || e.key === "A") && r && !e.shiftKey) {
|
|
940
|
-
e.preventDefault(), o("select-page", !0);
|
|
941
|
-
return;
|
|
942
|
-
}
|
|
943
|
-
if (e.shiftKey && (e.key === "ArrowDown" || e.key === "ArrowUp")) {
|
|
944
|
-
e.preventDefault(), k < 0 && (k = t);
|
|
945
|
-
let n = Math.max(0, Math.min(i.rows.length - 1, e.key === "ArrowDown" ? t + 1 : t - 1));
|
|
946
|
-
o("select-rows", he(k, n), !0), O.focusRow(n);
|
|
947
|
-
return;
|
|
948
|
-
}
|
|
949
|
-
(e.key.startsWith("Arrow") || e.key === "Home" || e.key === "End") && (k = -1);
|
|
950
|
-
}
|
|
951
|
-
if (i.rowMenu && (e.key === "F10" && e.shiftKey || e.key === "ContextMenu")) {
|
|
952
|
-
e.preventDefault(), ge.value = t;
|
|
953
|
-
return;
|
|
954
|
-
}
|
|
955
|
-
}
|
|
956
|
-
O.onKeydown(e);
|
|
957
|
-
}, _e = (e, t, n) => {
|
|
958
|
-
o("select-rows", n && k >= 0 ? he(k, e) : [x(e)], t), k = e;
|
|
959
|
-
}, R = j(() => i.selectable ? i.rows.reduce((e, t) => e + +!!i.selection?.[u.rowId(t)], 0) : 0), ve = j(() => i.rows.length > 0 && R.value === i.rows.length), ye = j(() => R.value > 0 && !ve.value), be = j(() => !!i.skeleton), Te = j(() => be.value ? 12 : i.rows.length), W = Pt(j(() => ({
|
|
960
|
-
count: Te.value,
|
|
961
|
-
getScrollElement: () => l.value,
|
|
962
|
-
estimateSize: () => _.value + 1,
|
|
963
|
-
scrollMargin: v.value,
|
|
964
|
-
scrollPaddingStart: v.value,
|
|
965
|
-
scrollPaddingEnd: ne.value,
|
|
816
|
+
return i.rows.slice(n, r + 1).map((e) => l.rowId(e));
|
|
817
|
+
}, E = z(-1), ve = (e, t, n) => {
|
|
818
|
+
a("select-rows", n && w >= 0 ? T(w, e) : [b(e)], t), w = e;
|
|
819
|
+
}, D = k(() => i.selectable ? i.rows.reduce((e, t) => e + +!!i.selection?.[l.rowId(t)], 0) : 0), ye = k(() => i.rows.length > 0 && D.value === i.rows.length), P = k(() => D.value > 0 && !ye.value), be = k(() => !!i.skeleton), I = k(() => be.value ? 12 : i.rows.length), xe = It(k(() => ({
|
|
820
|
+
count: I.value,
|
|
821
|
+
getScrollElement: () => c.value,
|
|
822
|
+
estimateSize: () => h.value + 1,
|
|
823
|
+
scrollMargin: g.value,
|
|
824
|
+
scrollPaddingStart: g.value,
|
|
825
|
+
scrollPaddingEnd: v.value,
|
|
966
826
|
overscan: 10,
|
|
967
|
-
getItemKey: (e) => be.value ? `sk-${e}` :
|
|
827
|
+
getItemKey: (e) => be.value ? `sk-${e}` : l.rowId(i.rows[e]),
|
|
968
828
|
rangeExtractor: (e) => {
|
|
969
|
-
let t = Math.max(0, e.startIndex - e.overscan), n = Math.min(e.count - 1, e.endIndex + e.overscan), r = [], i =
|
|
829
|
+
let t = Math.max(0, e.startIndex - e.overscan), n = Math.min(e.count - 1, e.endIndex + e.overscan), r = [], i = _e.value;
|
|
970
830
|
!be.value && i >= 0 && i < t && i < e.count && r.push(i);
|
|
971
831
|
for (let e = t; e <= n; e++) r.push(e);
|
|
972
832
|
return !be.value && i > n && i < e.count && r.push(i), r;
|
|
973
833
|
}
|
|
974
|
-
}))),
|
|
975
|
-
e && !be.value &&
|
|
834
|
+
}))), Se = k(() => xe.value.getVirtualItems()), Ce = k(() => xe.value.getTotalSize()), Oe = (e, t) => {
|
|
835
|
+
e && !be.value && ue(i.rows[t]) && xe.value.measureElement(e);
|
|
976
836
|
};
|
|
977
|
-
|
|
837
|
+
K(() => new Set(Object.keys(i.expanded ?? {}).filter((e) => i.expanded[e])), (e, t) => {
|
|
978
838
|
for (let n of t ?? []) {
|
|
979
839
|
if (e.has(n)) continue;
|
|
980
|
-
let t = i.rows.findIndex((e) =>
|
|
981
|
-
t >= 0 &&
|
|
840
|
+
let t = i.rows.findIndex((e) => l.rowId(e) === n);
|
|
841
|
+
t >= 0 && xe.value.resizeItem(t, h.value + 1);
|
|
982
842
|
}
|
|
983
843
|
});
|
|
984
|
-
let
|
|
985
|
-
let e =
|
|
986
|
-
if (!e || (
|
|
987
|
-
|
|
988
|
-
let t =
|
|
989
|
-
t && !be.value && (
|
|
844
|
+
let ke = H(!1), Ae = H(!1), W = H(null), Ne, Pe = 0, Fe = () => {
|
|
845
|
+
let e = c.value;
|
|
846
|
+
if (!e || (ne(), ke.value = e.scrollLeft > 0, Ae.value = e.scrollLeft + e.clientWidth < e.scrollWidth - 1, e.scrollTop === Pe)) return;
|
|
847
|
+
Pe = e.scrollTop;
|
|
848
|
+
let t = xe.value.range;
|
|
849
|
+
t && !be.value && (W.value = {
|
|
990
850
|
from: i.rowIndexOffset + t.startIndex + 1,
|
|
991
851
|
to: i.rowIndexOffset + t.endIndex + 1
|
|
992
|
-
}, clearTimeout(
|
|
993
|
-
},
|
|
994
|
-
from:
|
|
995
|
-
to:
|
|
852
|
+
}, clearTimeout(Ne), Ne = setTimeout(() => W.value = null, 900));
|
|
853
|
+
}, Ie = k(() => W.value ? o.i18n.t("page.scrollPos", {
|
|
854
|
+
from: W.value.from,
|
|
855
|
+
to: W.value.to
|
|
996
856
|
}) : "");
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
}),
|
|
1000
|
-
let
|
|
1001
|
-
|
|
857
|
+
De(() => {
|
|
858
|
+
Fe(), c.value && typeof ResizeObserver < "u" && new ResizeObserver(Fe).observe(c.value);
|
|
859
|
+
}), Ee(() => clearTimeout(Ne));
|
|
860
|
+
let q = null, Re = (e) => {
|
|
861
|
+
q = {
|
|
1002
862
|
x: e.clientX,
|
|
1003
863
|
y: e.clientY
|
|
1004
|
-
}
|
|
1005
|
-
},
|
|
1006
|
-
let t = e.target,
|
|
1007
|
-
if (!n) return;
|
|
1008
|
-
let r = i.rows[Number(n.dataset.index)];
|
|
864
|
+
};
|
|
865
|
+
}, ze = (e) => {
|
|
866
|
+
let t = e.target, r = t.closest(".dt-row[data-index]");
|
|
1009
867
|
if (!r) return;
|
|
1010
|
-
let
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
let n = le(e.id).flatMap((e) => [...e.querySelectorAll(".dt-cell-content, .dt-head-text")]);
|
|
1016
|
-
for (let e of n) e.style.width = "max-content", e.style.maxWidth = "none", e.style.flex = "none";
|
|
1017
|
-
let r = n.reduce((e, t) => Math.max(e, t.getBoundingClientRect().width), 0);
|
|
1018
|
-
for (let e of n) e.style.width = "", e.style.maxWidth = "", e.style.flex = "";
|
|
1019
|
-
let i = parseFloat(getComputedStyle(t).getPropertyValue("--dt-cell-x")) || 12;
|
|
1020
|
-
u.setWidth(e.id, Math.ceil(r) + i * 2 + 24);
|
|
1021
|
-
}, Ge = (e, t) => {
|
|
868
|
+
let o = i.rows[Number(r.dataset.index)];
|
|
869
|
+
if (!o) return;
|
|
870
|
+
let s = t.closest("a.dt-link");
|
|
871
|
+
s && s.closest(".dt-cell.is-primary") && r.contains(s) ? e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey && a("row-open", je(o), e) : n(e, r, q) && a("row-click", je(o), e);
|
|
872
|
+
}, Be = (e) => i.sort?.get(e), Ve = (e) => i.sortable && (e.def.sortable ?? te[e.def.type].sortable), He = (e, t) => {
|
|
1022
873
|
switch (t) {
|
|
1023
874
|
case "filter":
|
|
1024
|
-
|
|
875
|
+
a("header-filter", e.id);
|
|
1025
876
|
return;
|
|
1026
877
|
case "sort-asc":
|
|
1027
878
|
case "sort-desc":
|
|
1028
879
|
case "sort-clear":
|
|
1029
|
-
|
|
1030
|
-
return;
|
|
1031
|
-
case "pin-left":
|
|
1032
|
-
u.pin(e.id, "start");
|
|
1033
|
-
return;
|
|
1034
|
-
case "pin-right":
|
|
1035
|
-
u.pin(e.id, "end");
|
|
1036
|
-
return;
|
|
1037
|
-
case "unpin":
|
|
1038
|
-
u.pin(e.id, null);
|
|
1039
|
-
return;
|
|
1040
|
-
case "fit":
|
|
1041
|
-
We(e);
|
|
880
|
+
a("sort-set", e.id, t === "sort-clear" ? null : t === "sort-asc" ? "asc" : "desc");
|
|
1042
881
|
return;
|
|
1043
882
|
case "hide":
|
|
1044
|
-
|
|
883
|
+
l.setVisible(e.id, !1);
|
|
1045
884
|
return;
|
|
1046
885
|
case "move-left":
|
|
1047
886
|
case "move-right": {
|
|
1048
887
|
let n = document.activeElement?.closest(".dt-head-cell")?.dataset.col === e.id;
|
|
1049
|
-
|
|
888
|
+
l.move(e.id, t === "move-left" ? -1 : 1), n && we(() => se(e.id)[0]?.querySelector(".dt-head-label")?.focus());
|
|
1050
889
|
}
|
|
1051
890
|
}
|
|
1052
|
-
}
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
return;
|
|
1056
|
-
}
|
|
1057
|
-
let n = u.columns.value.findIndex((t) => t.id === e.id);
|
|
1058
|
-
ue(t === "left" ? n - 1 : n + 1);
|
|
1059
|
-
}, qe = i.rows.map((e) => u.rowId(e));
|
|
1060
|
-
return q(() => i.rows.map((e) => u.rowId(e)).join("\0"), () => {
|
|
1061
|
-
let e = i.rows.map((e) => u.rowId(e)), t = !!c.value && c.value.contains(document.activeElement), n = qe[O.focusedIndex.value], r = n === void 0 ? -1 : e.indexOf(n);
|
|
1062
|
-
r >= 0 ? O.focusedIndex.value = r : O.clamp(), qe = e, k = -1, t && e.length && xe(() => O.focusRow(O.focusedIndex.value));
|
|
1063
|
-
}), q(_, () => W.value.measure()), n({
|
|
1064
|
-
focusRow: O.focusRow,
|
|
1065
|
-
scrollToIndex: (e) => W.value.scrollToIndex(e),
|
|
891
|
+
};
|
|
892
|
+
return K(() => i.rows.map((e) => l.rowId(e)).join("\0"), () => w = -1), K(h, () => xe.value.measure()), t({
|
|
893
|
+
scrollToIndex: (e) => xe.value.scrollToIndex(e),
|
|
1066
894
|
scrollToTop: () => {
|
|
1067
|
-
|
|
895
|
+
c.value && (c.value.scrollTop = 0);
|
|
1068
896
|
},
|
|
1069
|
-
measure: () =>
|
|
1070
|
-
|
|
1071
|
-
}), (e, n) => (B(), P("div", {
|
|
897
|
+
measure: () => xe.value.measure()
|
|
898
|
+
}), (t, n) => (R(), M("div", {
|
|
1072
899
|
ref_key: "root",
|
|
1073
|
-
ref:
|
|
1074
|
-
class:
|
|
1075
|
-
"is-scrolled-start":
|
|
1076
|
-
"is-scrolled-end":
|
|
1077
|
-
"is-keyboard": K(O).keyboard.value,
|
|
900
|
+
ref: s,
|
|
901
|
+
class: L(["dt-grid", {
|
|
902
|
+
"is-scrolled-start": ke.value,
|
|
903
|
+
"is-scrolled-end": Ae.value,
|
|
1078
904
|
"is-skeleton": be.value,
|
|
1079
|
-
"is-dim":
|
|
1080
|
-
"has-vlines":
|
|
1081
|
-
"is-phone":
|
|
905
|
+
"is-dim": e.dim,
|
|
906
|
+
"has-vlines": e.verticalLines,
|
|
907
|
+
"is-phone": e.phone
|
|
1082
908
|
}]),
|
|
1083
|
-
role: "
|
|
1084
|
-
"aria-label":
|
|
1085
|
-
"aria-rowcount":
|
|
1086
|
-
"aria-colcount":
|
|
1087
|
-
"aria-busy":
|
|
1088
|
-
"data-density":
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
onFocusin: n[10] ||= (...e) => K(O).onFocusin && K(O).onFocusin(...e),
|
|
1093
|
-
onClick: Ve
|
|
909
|
+
role: "table",
|
|
910
|
+
"aria-label": e.label,
|
|
911
|
+
"aria-rowcount": e.rowCount,
|
|
912
|
+
"aria-colcount": G(l).columns.value.length + +!!e.selectable + +!!e.rowMenu,
|
|
913
|
+
"aria-busy": e.loading || e.dim ? "true" : void 0,
|
|
914
|
+
"data-density": d.value,
|
|
915
|
+
onMousedown: Re,
|
|
916
|
+
onFocusin: C,
|
|
917
|
+
onClick: ze
|
|
1094
918
|
}, [
|
|
1095
|
-
|
|
919
|
+
N("div", {
|
|
1096
920
|
ref_key: "scrollEl",
|
|
1097
|
-
ref:
|
|
921
|
+
ref: c,
|
|
1098
922
|
class: "dt-scroll",
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
923
|
+
style: Te({
|
|
924
|
+
scrollPaddingTop: `${g.value}px`,
|
|
925
|
+
scrollPaddingBottom: `${v.value}px`
|
|
926
|
+
}),
|
|
927
|
+
onScrollPassive: Fe
|
|
928
|
+
}, [N("div", jn, [
|
|
929
|
+
e.selectable ? (R(), M("div", {
|
|
1102
930
|
key: 0,
|
|
1103
|
-
class:
|
|
931
|
+
class: L(["dt-head-cell dt-head-select is-pinned-start", { "is-pin-edge": !G(l).start.value.length }]),
|
|
1104
932
|
style: { left: "0px" },
|
|
1105
933
|
role: "columnheader"
|
|
1106
|
-
}, [
|
|
934
|
+
}, [N("input", {
|
|
1107
935
|
type: "checkbox",
|
|
1108
936
|
class: "dt-checkbox",
|
|
1109
|
-
checked:
|
|
1110
|
-
indeterminate:
|
|
1111
|
-
"aria-label":
|
|
1112
|
-
onClick: n[0] ||= (e) =>
|
|
1113
|
-
}, null, 8,
|
|
1114
|
-
(
|
|
1115
|
-
key:
|
|
1116
|
-
column:
|
|
1117
|
-
sort:
|
|
1118
|
-
"sort-index":
|
|
1119
|
-
filtered:
|
|
1120
|
-
resizing:
|
|
1121
|
-
sortable:
|
|
1122
|
-
phone:
|
|
1123
|
-
onSort: n[1] ||= (e, t) =>
|
|
1124
|
-
onFilter: n[2] ||= (e) =>
|
|
1125
|
-
onAction:
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
onResizeStart: n[4] ||= (e, t) => K(u).setWidth(e.id, t)
|
|
937
|
+
checked: ye.value,
|
|
938
|
+
indeterminate: P.value,
|
|
939
|
+
"aria-label": G(o).i18n.t("row.selectPageAria"),
|
|
940
|
+
onClick: n[0] ||= (e) => a("select-page", !ye.value)
|
|
941
|
+
}, null, 8, Mn)], 2)) : j("", !0),
|
|
942
|
+
(R(!0), M(O, null, B([...G(l).start.value, ...G(l).center.value], (t) => (R(), A(kn, {
|
|
943
|
+
key: t.id,
|
|
944
|
+
column: t,
|
|
945
|
+
sort: Be(t.id)?.dir ?? null,
|
|
946
|
+
"sort-index": Be(t.id)?.index ?? null,
|
|
947
|
+
filtered: e.filteredColumns?.has(t.id) ?? !1,
|
|
948
|
+
resizing: G(l).resizing.value?.id === t.id ? G(l).resizing.value.size : null,
|
|
949
|
+
sortable: Ve(t),
|
|
950
|
+
phone: e.phone,
|
|
951
|
+
onSort: n[1] ||= (e, t) => a("sort", e.id, t),
|
|
952
|
+
onFilter: n[2] ||= (e) => a("header-filter", e.id),
|
|
953
|
+
onAction: He,
|
|
954
|
+
onResizeBy: n[3] ||= (e, t) => G(l).setWidth(e.id, G(l).widthOf(e.id) + t),
|
|
955
|
+
onResizeStart: n[4] ||= (e, t) => G(l).setWidth(e.id, t)
|
|
1129
956
|
}, null, 8, [
|
|
1130
957
|
"column",
|
|
1131
958
|
"sort",
|
|
@@ -1135,26 +962,25 @@ var gn = ["aria-sort", "data-col"], _n = [
|
|
|
1135
962
|
"sortable",
|
|
1136
963
|
"phone"
|
|
1137
964
|
]))), 128)),
|
|
1138
|
-
n[
|
|
965
|
+
n[9] ||= N("div", {
|
|
1139
966
|
class: "dt-head-cell dt-cell-fill",
|
|
1140
967
|
role: "presentation",
|
|
1141
968
|
"aria-hidden": "true"
|
|
1142
969
|
}, null, -1),
|
|
1143
|
-
(
|
|
1144
|
-
key:
|
|
1145
|
-
column:
|
|
1146
|
-
sort:
|
|
1147
|
-
"sort-index":
|
|
1148
|
-
filtered:
|
|
1149
|
-
resizing:
|
|
1150
|
-
sortable:
|
|
1151
|
-
phone:
|
|
1152
|
-
onSort: n[5] ||= (e, t) =>
|
|
1153
|
-
onFilter: n[6] ||= (e) =>
|
|
1154
|
-
onAction:
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
onResizeStart: n[8] ||= (e, t) => K(u).setWidth(e.id, t)
|
|
970
|
+
(R(!0), M(O, null, B(G(l).end.value, (t) => (R(), A(kn, {
|
|
971
|
+
key: t.id,
|
|
972
|
+
column: t,
|
|
973
|
+
sort: Be(t.id)?.dir ?? null,
|
|
974
|
+
"sort-index": Be(t.id)?.index ?? null,
|
|
975
|
+
filtered: e.filteredColumns?.has(t.id) ?? !1,
|
|
976
|
+
resizing: G(l).resizing.value?.id === t.id ? G(l).resizing.value.size : null,
|
|
977
|
+
sortable: Ve(t),
|
|
978
|
+
phone: e.phone,
|
|
979
|
+
onSort: n[5] ||= (e, t) => a("sort", e.id, t),
|
|
980
|
+
onFilter: n[6] ||= (e) => a("header-filter", e.id),
|
|
981
|
+
onAction: He,
|
|
982
|
+
onResizeBy: n[7] ||= (e, t) => G(l).setWidth(e.id, G(l).widthOf(e.id) + t),
|
|
983
|
+
onResizeStart: n[8] ||= (e, t) => G(l).setWidth(e.id, t)
|
|
1158
984
|
}, null, 8, [
|
|
1159
985
|
"column",
|
|
1160
986
|
"sort",
|
|
@@ -1164,85 +990,83 @@ var gn = ["aria-sort", "data-col"], _n = [
|
|
|
1164
990
|
"sortable",
|
|
1165
991
|
"phone"
|
|
1166
992
|
]))), 128)),
|
|
1167
|
-
|
|
993
|
+
e.rowMenu ? (R(), M("div", {
|
|
1168
994
|
key: 1,
|
|
1169
|
-
class:
|
|
995
|
+
class: L(["dt-head-cell dt-head-menu-col is-pinned-end", { "is-pin-edge": !G(l).end.value.length }]),
|
|
1170
996
|
style: { right: "0px" },
|
|
1171
997
|
role: "columnheader"
|
|
1172
|
-
}, null, 2)) :
|
|
1173
|
-
]),
|
|
998
|
+
}, null, 2)) : j("", !0)
|
|
999
|
+
]), N("div", {
|
|
1174
1000
|
class: "dt-body",
|
|
1175
1001
|
role: "presentation",
|
|
1176
|
-
inert:
|
|
1177
|
-
style:
|
|
1178
|
-
}, [(
|
|
1002
|
+
inert: e.dim || void 0,
|
|
1003
|
+
style: Te({ height: `${Ce.value}px` })
|
|
1004
|
+
}, [(R(!0), M(O, null, B(Se.value, (n) => (R(), M("div", {
|
|
1179
1005
|
key: String(n.key),
|
|
1180
1006
|
ref_for: !0,
|
|
1181
|
-
ref: (e) =>
|
|
1007
|
+
ref: (e) => Oe(e, n.index),
|
|
1182
1008
|
class: "dt-item",
|
|
1183
1009
|
"data-index": n.index,
|
|
1184
|
-
style:
|
|
1185
|
-
}, [be.value ? (
|
|
1010
|
+
style: Te({ transform: `translateY(${n.start - g.value}px)` })
|
|
1011
|
+
}, [be.value ? (R(), A(G(le), {
|
|
1186
1012
|
key: 0,
|
|
1187
1013
|
index: n.index,
|
|
1188
|
-
columns:
|
|
1189
|
-
}, null, 8, ["index", "columns"])) : (
|
|
1190
|
-
row:
|
|
1014
|
+
columns: G(l).columns.value
|
|
1015
|
+
}, null, 8, ["index", "columns"])) : (R(), M(O, { key: 1 }, [F(G(ge), {
|
|
1016
|
+
row: e.rows[n.index],
|
|
1191
1017
|
index: n.index,
|
|
1192
|
-
"row-index": 2 +
|
|
1193
|
-
columns:
|
|
1194
|
-
env:
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
"
|
|
1202
|
-
|
|
1203
|
-
"
|
|
1204
|
-
|
|
1205
|
-
"
|
|
1206
|
-
menu:
|
|
1207
|
-
"
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
"
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
onCopy: (e) => o("copy-id", Oe(t.rows[n.index]))
|
|
1219
|
-
}, null, 8, /* @__PURE__ */ "row.index.row-index.columns.env.focused.keyboard-focus.secondary-visible.label.selectable.selected.select-edge.expandable.can-expand.expanded.subrow-id.menu.menu-open.menu-edge.row-actions.error.uid.href.primary-header.onSelect.onExpand.onMenuOpen.onOpen.onCopy".split(".")), fe(t.rows[n.index]) ? (B(), P("div", {
|
|
1018
|
+
"row-index": 2 + e.rowIndexOffset + n.index,
|
|
1019
|
+
columns: G(l).columns.value,
|
|
1020
|
+
env: ie.value,
|
|
1021
|
+
"secondary-visible": d.value === "comfortable",
|
|
1022
|
+
label: fe(e.rows[n.index]),
|
|
1023
|
+
selectable: e.selectable,
|
|
1024
|
+
selected: x(n.index),
|
|
1025
|
+
"select-edge": !G(l).start.value.length,
|
|
1026
|
+
expandable: e.expandable,
|
|
1027
|
+
"can-expand": de(e.rows[n.index]),
|
|
1028
|
+
expanded: ue(e.rows[n.index]),
|
|
1029
|
+
"subrow-id": me(e.rows[n.index]),
|
|
1030
|
+
menu: e.rowMenu,
|
|
1031
|
+
"menu-open": E.value === n.index,
|
|
1032
|
+
"menu-edge": !G(l).end.value.length,
|
|
1033
|
+
"row-actions": e.rowActions,
|
|
1034
|
+
error: S(e.rows[n.index]),
|
|
1035
|
+
uid: he(e.rows[n.index]),
|
|
1036
|
+
href: e.primaryHref?.(e.rows[n.index]),
|
|
1037
|
+
"primary-header": e.primaryHeader,
|
|
1038
|
+
onSelect: (e, t) => ve(n.index, e, t),
|
|
1039
|
+
onExpand: (t) => a("toggle-expand", b(n.index), !ue(e.rows[n.index])),
|
|
1040
|
+
onMenuOpen: (e) => E.value = e ? n.index : -1,
|
|
1041
|
+
onOpen: (t) => a("row-open", je(e.rows[n.index]), t),
|
|
1042
|
+
onCopy: (t) => a("copy-id", je(e.rows[n.index]))
|
|
1043
|
+
}, null, 8, /* @__PURE__ */ "row.index.row-index.columns.env.secondary-visible.label.selectable.selected.select-edge.expandable.can-expand.expanded.subrow-id.menu.menu-open.menu-edge.row-actions.error.uid.href.primary-header.onSelect.onExpand.onMenuOpen.onOpen.onCopy".split(".")), ue(e.rows[n.index]) ? (R(), M("div", {
|
|
1220
1044
|
key: 0,
|
|
1221
|
-
id:
|
|
1045
|
+
id: me(e.rows[n.index]),
|
|
1222
1046
|
class: "dt-subrow",
|
|
1223
1047
|
role: "row",
|
|
1224
|
-
"aria-rowindex": 2 +
|
|
1225
|
-
}, [
|
|
1226
|
-
role: "
|
|
1227
|
-
"aria-colspan":
|
|
1228
|
-
}, [
|
|
1229
|
-
row:
|
|
1230
|
-
close: () =>
|
|
1231
|
-
})], 8,
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
class:
|
|
1048
|
+
"aria-rowindex": 2 + e.rowIndexOffset + n.index
|
|
1049
|
+
}, [N("div", {
|
|
1050
|
+
role: "cell",
|
|
1051
|
+
"aria-colspan": G(l).columns.value.length
|
|
1052
|
+
}, [V(t.$slots, "expanded", {
|
|
1053
|
+
row: je(e.rows[n.index]),
|
|
1054
|
+
close: () => a("toggle-expand", b(n.index), !1)
|
|
1055
|
+
})], 8, In)], 8, Fn)) : j("", !0)], 64))], 12, Pn))), 128))], 12, Nn)], 36),
|
|
1056
|
+
e.refreshing ? (R(), M("div", Ln)) : j("", !0),
|
|
1057
|
+
t.$slots.notice ? (R(), M("div", Rn, [V(t.$slots, "notice")])) : j("", !0),
|
|
1058
|
+
t.$slots.state && !be.value && e.rows.length === 0 ? (R(), M("div", zn, [V(t.$slots, "state")])) : j("", !0),
|
|
1059
|
+
N("div", {
|
|
1060
|
+
class: L(["dt-scroll-pill", { "is-visible": W.value }]),
|
|
1237
1061
|
"aria-hidden": "true"
|
|
1238
|
-
},
|
|
1239
|
-
], 42,
|
|
1062
|
+
}, U(Ie.value), 3)
|
|
1063
|
+
], 42, An));
|
|
1240
1064
|
}
|
|
1241
|
-
}),
|
|
1065
|
+
}), Un = ["aria-label", "data-dt-tip"], Wn = ["data-state"], Gn = /* @__PURE__ */ I({
|
|
1242
1066
|
__name: "MoreMenu",
|
|
1243
1067
|
props: {
|
|
1244
1068
|
refresh: { type: Boolean },
|
|
1245
|
-
export: { type: Boolean },
|
|
1069
|
+
export: { type: [String, Boolean] },
|
|
1246
1070
|
import: { type: Boolean },
|
|
1247
1071
|
print: { type: Boolean },
|
|
1248
1072
|
autoRefresh: { type: Boolean },
|
|
@@ -1256,47 +1080,47 @@ var gn = ["aria-sort", "data-col"], _n = [
|
|
|
1256
1080
|
"update:autoRefreshOn"
|
|
1257
1081
|
],
|
|
1258
1082
|
setup(e, { emit: t }) {
|
|
1259
|
-
let n = e, r = t, { i18n: i } =
|
|
1260
|
-
return (t, n) => (
|
|
1261
|
-
default:
|
|
1262
|
-
default:
|
|
1083
|
+
let n = e, r = t, { i18n: i } = _(), a = () => n.export || n.import || n.print;
|
|
1084
|
+
return (t, n) => (R(), A(G(xt), null, {
|
|
1085
|
+
default: q(() => [F(G(Tt), { "as-child": "" }, {
|
|
1086
|
+
default: q(() => [N("button", {
|
|
1263
1087
|
type: "button",
|
|
1264
1088
|
class: "dt-btn dt-btn-icon",
|
|
1265
|
-
"aria-label":
|
|
1266
|
-
"data-dt-tip":
|
|
1267
|
-
}, [
|
|
1089
|
+
"aria-label": G(i).t("toolbar.more"),
|
|
1090
|
+
"data-dt-tip": G(i).t("toolbar.more")
|
|
1091
|
+
}, [F(G(Je), {
|
|
1268
1092
|
size: 16,
|
|
1269
1093
|
weight: "bold",
|
|
1270
1094
|
"aria-hidden": "true"
|
|
1271
|
-
})], 8,
|
|
1095
|
+
})], 8, Un)]),
|
|
1272
1096
|
_: 1
|
|
1273
|
-
}),
|
|
1274
|
-
default:
|
|
1275
|
-
class: "dt-menu dt-more",
|
|
1097
|
+
}), F(G(Q), null, {
|
|
1098
|
+
default: q(() => [F(G(yt), {
|
|
1099
|
+
class: "dt-menu dt-more-menu",
|
|
1276
1100
|
align: "end",
|
|
1277
1101
|
"side-offset": 4
|
|
1278
1102
|
}, {
|
|
1279
|
-
default:
|
|
1280
|
-
t.$props.export ? (
|
|
1281
|
-
default:
|
|
1282
|
-
default:
|
|
1103
|
+
default: q(() => [
|
|
1104
|
+
t.$props.export ? (R(), A(G(St), { key: 0 }, {
|
|
1105
|
+
default: q(() => [F(G(wt), { class: "dt-menu-item" }, {
|
|
1106
|
+
default: q(() => [P(U(t.$props.export), 1)]),
|
|
1283
1107
|
_: 1
|
|
1284
|
-
}),
|
|
1285
|
-
default:
|
|
1108
|
+
}), F(G(Q), null, {
|
|
1109
|
+
default: q(() => [F(G(Ct), {
|
|
1286
1110
|
class: "dt-menu",
|
|
1287
1111
|
"side-offset": 4
|
|
1288
1112
|
}, {
|
|
1289
|
-
default:
|
|
1113
|
+
default: q(() => [F(G(Z), {
|
|
1290
1114
|
class: "dt-menu-item",
|
|
1291
1115
|
onSelect: n[0] ||= (e) => r("export", "csv")
|
|
1292
1116
|
}, {
|
|
1293
|
-
default:
|
|
1117
|
+
default: q(() => [P(U(G(i).t("toolbar.csv")), 1)]),
|
|
1294
1118
|
_: 1
|
|
1295
|
-
}),
|
|
1119
|
+
}), F(G(Z), {
|
|
1296
1120
|
class: "dt-menu-item",
|
|
1297
1121
|
onSelect: n[1] ||= (e) => r("export", "xlsx")
|
|
1298
1122
|
}, {
|
|
1299
|
-
default:
|
|
1123
|
+
default: q(() => [P(U(G(i).t("toolbar.xlsx")), 1)]),
|
|
1300
1124
|
_: 1
|
|
1301
1125
|
})]),
|
|
1302
1126
|
_: 1
|
|
@@ -1304,48 +1128,48 @@ var gn = ["aria-sort", "data-col"], _n = [
|
|
|
1304
1128
|
_: 1
|
|
1305
1129
|
})]),
|
|
1306
1130
|
_: 1
|
|
1307
|
-
})) :
|
|
1308
|
-
t.$props.import ? (
|
|
1131
|
+
})) : j("", !0),
|
|
1132
|
+
t.$props.import ? (R(), A(G(Z), {
|
|
1309
1133
|
key: 1,
|
|
1310
1134
|
class: "dt-menu-item",
|
|
1311
1135
|
onSelect: n[2] ||= (e) => r("import")
|
|
1312
1136
|
}, {
|
|
1313
|
-
default:
|
|
1137
|
+
default: q(() => [P(U(G(i).t("toolbar.import")), 1)]),
|
|
1314
1138
|
_: 1
|
|
1315
|
-
})) :
|
|
1316
|
-
e.print ? (
|
|
1139
|
+
})) : j("", !0),
|
|
1140
|
+
e.print ? (R(), A(G(Z), {
|
|
1317
1141
|
key: 2,
|
|
1318
1142
|
class: "dt-menu-item",
|
|
1319
1143
|
onSelect: n[3] ||= (e) => r("print")
|
|
1320
1144
|
}, {
|
|
1321
|
-
default:
|
|
1145
|
+
default: q(() => [P(U(G(i).t("toolbar.print")), 1)]),
|
|
1322
1146
|
_: 1
|
|
1323
|
-
})) :
|
|
1324
|
-
a() && (e.refresh || e.autoRefresh) ? (
|
|
1147
|
+
})) : j("", !0),
|
|
1148
|
+
a() && (e.refresh || e.autoRefresh) ? (R(), A(G($), {
|
|
1325
1149
|
key: 3,
|
|
1326
1150
|
class: "dt-menu-sep"
|
|
1327
|
-
})) :
|
|
1328
|
-
e.refresh ? (
|
|
1151
|
+
})) : j("", !0),
|
|
1152
|
+
e.refresh ? (R(), A(G(Z), {
|
|
1329
1153
|
key: 4,
|
|
1330
1154
|
class: "dt-menu-item",
|
|
1331
1155
|
onSelect: n[4] ||= (e) => r("refresh")
|
|
1332
1156
|
}, {
|
|
1333
|
-
default:
|
|
1157
|
+
default: q(() => [P(U(G(i).t("toolbar.refresh")) + " ", 1), n[6] ||= N("kbd", { class: "dt-kbd" }, "R", -1)]),
|
|
1334
1158
|
_: 1
|
|
1335
|
-
})) :
|
|
1336
|
-
e.autoRefresh ? (
|
|
1159
|
+
})) : j("", !0),
|
|
1160
|
+
e.autoRefresh ? (R(), A(G(vt), {
|
|
1337
1161
|
key: 5,
|
|
1338
1162
|
class: "dt-menu-item",
|
|
1339
1163
|
"model-value": e.autoRefreshOn,
|
|
1340
1164
|
"onUpdate:modelValue": n[5] ||= (e) => r("update:autoRefreshOn", e === !0)
|
|
1341
1165
|
}, {
|
|
1342
|
-
default:
|
|
1166
|
+
default: q(() => [P(U(G(i).t("toolbar.autoRefresh")) + " ", 1), N("span", {
|
|
1343
1167
|
class: "dt-switch dt-pop-end",
|
|
1344
1168
|
"data-state": e.autoRefreshOn ? "checked" : "unchecked",
|
|
1345
1169
|
"aria-hidden": "true"
|
|
1346
|
-
}, [...n[7] ||= [
|
|
1170
|
+
}, [...n[7] ||= [N("span", { class: "dt-switch-thumb" }, null, -1)]], 8, Wn)]),
|
|
1347
1171
|
_: 1
|
|
1348
|
-
}, 8, ["model-value"])) :
|
|
1172
|
+
}, 8, ["model-value"])) : j("", !0)
|
|
1349
1173
|
]),
|
|
1350
1174
|
_: 1
|
|
1351
1175
|
})]),
|
|
@@ -1354,7 +1178,7 @@ var gn = ["aria-sort", "data-col"], _n = [
|
|
|
1354
1178
|
_: 1
|
|
1355
1179
|
}));
|
|
1356
1180
|
}
|
|
1357
|
-
}),
|
|
1181
|
+
}), Kn = { class: "dt-toolbar-side is-start" }, qn = { class: "dt-btn-group" }, Jn = ["aria-label", "data-dt-tip"], Yn = { class: "dt-toolbar-side is-end" }, Xn = { class: "dt-btn-group" }, Zn = { class: "dt-toolbar-end" }, Qn = /* @__PURE__ */ I({
|
|
1358
1182
|
__name: "Toolbar",
|
|
1359
1183
|
props: {
|
|
1360
1184
|
size: {},
|
|
@@ -1366,41 +1190,40 @@ var gn = ["aria-sort", "data-col"], _n = [
|
|
|
1366
1190
|
},
|
|
1367
1191
|
emits: ["update:search"],
|
|
1368
1192
|
setup(e, { expose: t, emit: n }) {
|
|
1369
|
-
let r = e, i = n, { i18n: a } =
|
|
1193
|
+
let r = e, i = n, { i18n: a } = _(), o = z(!1), s = z(null), c = k(() => r.size === "phone"), l = k(() => c.value && (o.value || !!r.search)), u = () => {
|
|
1370
1194
|
o.value = !0, requestAnimationFrame(() => s.value?.focus());
|
|
1371
1195
|
}, d = () => {
|
|
1372
1196
|
o.value = !1, i("update:search", "");
|
|
1373
1197
|
};
|
|
1374
1198
|
return t({ focusSearch: () => {
|
|
1375
1199
|
r.size !== "full" && !o.value && !r.search ? u() : s.value?.focus();
|
|
1376
|
-
} }), (t, n) => (
|
|
1377
|
-
class:
|
|
1200
|
+
} }), (t, n) => (R(), M("div", {
|
|
1201
|
+
class: L(["dt-toolbar", [`is-${e.size}`, { "is-zoned": !l.value }]]),
|
|
1378
1202
|
role: "toolbar"
|
|
1379
|
-
}, [l.value ? (
|
|
1203
|
+
}, [l.value ? (R(), M(O, { key: 0 }, [F(se, {
|
|
1380
1204
|
ref_key: "searchBox",
|
|
1381
1205
|
ref: s,
|
|
1382
1206
|
"model-value": e.search ?? "",
|
|
1383
1207
|
placeholder: e.searchPlaceholder,
|
|
1384
1208
|
phone: "",
|
|
1385
1209
|
"onUpdate:modelValue": n[0] ||= (e) => i("update:search", e)
|
|
1386
|
-
}, null, 8, ["model-value", "placeholder"]),
|
|
1210
|
+
}, null, 8, ["model-value", "placeholder"]), N("button", {
|
|
1387
1211
|
type: "button",
|
|
1388
1212
|
class: "dt-btn dt-btn-ghost dt-search-cancel",
|
|
1389
1213
|
onClick: d
|
|
1390
|
-
}, G(
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
e.search === null ? N("", !0) : (B(), P(A, { key: 0 }, [e.size !== "full" && !o.value && !e.search ? (B(), P("button", {
|
|
1214
|
+
}, U(G(a).t("common.cancel")), 1)], 64)) : (R(), M(O, { key: 1 }, [
|
|
1215
|
+
N("div", Kn, [V(t.$slots, "view")]),
|
|
1216
|
+
N("div", qn, [e.search === null ? j("", !0) : (R(), M(O, { key: 0 }, [e.size !== "full" && !o.value && !e.search ? (R(), M("button", {
|
|
1394
1217
|
key: 0,
|
|
1395
1218
|
type: "button",
|
|
1396
1219
|
class: "dt-btn dt-btn-icon dt-search-open",
|
|
1397
1220
|
"aria-label": e.searchPlaceholder,
|
|
1398
1221
|
"data-dt-tip": e.searchPlaceholder,
|
|
1399
1222
|
onClick: u
|
|
1400
|
-
}, [
|
|
1223
|
+
}, [F(G(Xe), {
|
|
1401
1224
|
size: c.value ? 20 : 16,
|
|
1402
1225
|
"aria-hidden": "true"
|
|
1403
|
-
}, null, 8, ["size"])], 8,
|
|
1226
|
+
}, null, 8, ["size"])], 8, Jn)) : (R(), A(se, {
|
|
1404
1227
|
key: 1,
|
|
1405
1228
|
ref_key: "searchBox",
|
|
1406
1229
|
ref: s,
|
|
@@ -1408,137 +1231,135 @@ var gn = ["aria-sort", "data-col"], _n = [
|
|
|
1408
1231
|
placeholder: e.searchPlaceholder,
|
|
1409
1232
|
"onUpdate:modelValue": n[1] ||= (e) => i("update:search", e),
|
|
1410
1233
|
onFocusout: n[2] ||= (e) => o.value = !1
|
|
1411
|
-
}, null, 8, ["model-value", "placeholder"]))], 64)),
|
|
1412
|
-
e.hasFilter ? U(t.$slots, "filter", {
|
|
1234
|
+
}, null, 8, ["model-value", "placeholder"]))], 64)), e.hasFilter ? V(t.$slots, "filter", {
|
|
1413
1235
|
iconOnly: c.value,
|
|
1414
1236
|
phone: c.value
|
|
1415
|
-
}, void 0, void 0, 1) :
|
|
1416
|
-
|
|
1417
|
-
e.hasMore || e.hasDisplay && c.value ?
|
|
1418
|
-
t.$slots.end ? (B(), P(A, { key: 4 }, [n[3] ||= F("span", {
|
|
1237
|
+
}, void 0, void 0, 1) : j("", !0)]),
|
|
1238
|
+
n[4] ||= N("span", { class: "dt-toolbar-spacer" }, null, -1),
|
|
1239
|
+
N("div", Yn, [N("div", Xn, [e.hasDisplay && !c.value ? V(t.$slots, "display", { iconOnly: e.size !== "full" }, void 0, void 0, 0) : j("", !0), e.hasMore || e.hasDisplay && c.value ? V(t.$slots, "more", { phone: c.value }, void 0, void 0, 1) : j("", !0)]), t.$slots.end ? (R(), M(O, { key: 0 }, [n[3] ||= N("span", {
|
|
1419
1240
|
class: "dt-toolbar-sep",
|
|
1420
1241
|
"aria-hidden": "true"
|
|
1421
|
-
}, null, -1),
|
|
1242
|
+
}, null, -1), N("span", Zn, [V(t.$slots, "end", { compact: c.value })])], 64)) : j("", !0)])
|
|
1422
1243
|
], 64))], 2));
|
|
1423
1244
|
}
|
|
1424
1245
|
});
|
|
1425
1246
|
//#endregion
|
|
1426
1247
|
//#region src/core/views/model.ts
|
|
1427
|
-
function
|
|
1248
|
+
function $n(e, t) {
|
|
1428
1249
|
return (t ? e.find((e) => e.id === t) : void 0) ?? e.find((e) => e.kind === "system" && e.default) ?? e.find((e) => e.kind === "system") ?? null;
|
|
1429
1250
|
}
|
|
1430
|
-
var
|
|
1251
|
+
var er = (e) => {
|
|
1431
1252
|
let t = "value" in e ? e.value : void 0;
|
|
1432
1253
|
return {
|
|
1433
1254
|
...e,
|
|
1434
1255
|
value: Array.isArray(t) ? [...t].sort() : t
|
|
1435
1256
|
};
|
|
1436
|
-
},
|
|
1437
|
-
function
|
|
1438
|
-
if (
|
|
1257
|
+
}, tr = (e) => JSON.stringify(e.map(er).sort((e, t) => e.column.localeCompare(t.column))), nr = (e) => [...e].sort().join("\0");
|
|
1258
|
+
function rr(e, t) {
|
|
1259
|
+
if (tr(e.filters) !== tr(t.filters) || JSON.stringify(e.sort) !== JSON.stringify(t.sort)) return !1;
|
|
1439
1260
|
let n = e.columns, r = t.columns;
|
|
1440
|
-
if (n.order.join("\0") !== r.order.join("\0") ||
|
|
1261
|
+
if (n.order.join("\0") !== r.order.join("\0") || nr(n.visible) !== nr(r.visible) || n.pinned.left.join("\0") !== r.pinned.left.join("\0") || n.pinned.right.join("\0") !== r.pinned.right.join("\0")) return !1;
|
|
1441
1262
|
for (let e of /* @__PURE__ */ new Set([...Object.keys(n.widths), ...Object.keys(r.widths)])) {
|
|
1442
1263
|
let t = n.widths[e], i = r.widths[e];
|
|
1443
1264
|
if (t === void 0 || i === void 0 ? t !== i : Math.abs(t - i) > 2) return !1;
|
|
1444
1265
|
}
|
|
1445
1266
|
return !0;
|
|
1446
1267
|
}
|
|
1447
|
-
function
|
|
1268
|
+
function ir(e, t, n, r) {
|
|
1448
1269
|
let i = e.trim();
|
|
1449
1270
|
if (!i) return "required";
|
|
1450
1271
|
if (i.length > 60) return "tooLong";
|
|
1451
1272
|
let a = i.toLocaleLowerCase(n);
|
|
1452
1273
|
return t.some((e) => e.kind === "personal" && e.id !== r && e.name.toLocaleLowerCase(n) === a) ? "taken" : null;
|
|
1453
1274
|
}
|
|
1454
|
-
var
|
|
1275
|
+
var ar = (e, t) => [...e].sort((e, n) => t.compare(e.name, n.name));
|
|
1455
1276
|
//#endregion
|
|
1456
1277
|
//#region src/core/views/useViews.ts
|
|
1457
|
-
function
|
|
1458
|
-
let
|
|
1459
|
-
let
|
|
1278
|
+
function or(e) {
|
|
1279
|
+
let t = z([]), n = k(() => [...e.system(), ...t.value]), r = k(() => {
|
|
1280
|
+
let n = ce(e.locale()).collator();
|
|
1460
1281
|
return {
|
|
1461
|
-
system:
|
|
1462
|
-
personal:
|
|
1282
|
+
system: e.system(),
|
|
1283
|
+
personal: ar(t.value.filter((e) => e.kind === "personal"), n)
|
|
1463
1284
|
};
|
|
1464
|
-
}),
|
|
1465
|
-
let
|
|
1466
|
-
if (!
|
|
1467
|
-
let u =
|
|
1468
|
-
u && (
|
|
1469
|
-
let d =
|
|
1470
|
-
d &&
|
|
1471
|
-
},
|
|
1472
|
-
|
|
1473
|
-
let
|
|
1474
|
-
|
|
1285
|
+
}), i = z(null), a = k(() => n.value.find((e) => e.id === i.value) ?? null), o = H(null), s = Oe(/* @__PURE__ */ new Map()), c = k(() => !!a.value && !!o.value && !rr(e.current(), o.value)), l = !1, u = (t, r = !0) => {
|
|
1286
|
+
let l = n.value.find((e) => e.id === t);
|
|
1287
|
+
if (!l) return;
|
|
1288
|
+
let u = a.value;
|
|
1289
|
+
u && (r && c.value ? s.set(u.id, e.current()) : s.delete(u.id)), i.value = t, e.apply(l.state), o.value = e.current();
|
|
1290
|
+
let d = s.get(t);
|
|
1291
|
+
d && e.apply(d), e.onChange(l);
|
|
1292
|
+
}, d = $n(n.value, e.defaultViewId());
|
|
1293
|
+
d && u(d.id);
|
|
1294
|
+
let f = e.adapter ? e.adapter.list(e.tableId()).then((e) => {
|
|
1295
|
+
t.value = e;
|
|
1475
1296
|
}).catch(() => {}) : Promise.resolve();
|
|
1476
|
-
Promise.all([
|
|
1477
|
-
if (
|
|
1478
|
-
let
|
|
1479
|
-
|
|
1297
|
+
Promise.all([f, e.prefsReady]).then(() => {
|
|
1298
|
+
if (l || c.value) return;
|
|
1299
|
+
let t = $n(n.value, e.defaultViewId());
|
|
1300
|
+
t && t.id !== i.value && u(t.id);
|
|
1480
1301
|
});
|
|
1481
|
-
let
|
|
1302
|
+
let p = (e) => t.value = t.value.map((t) => t.id === e.id ? e : t), ee = (t) => !!t && !!e.adapter && t.kind !== "system";
|
|
1482
1303
|
return {
|
|
1483
|
-
all:
|
|
1484
|
-
sections:
|
|
1485
|
-
active:
|
|
1486
|
-
edited:
|
|
1487
|
-
hasViews:
|
|
1488
|
-
hasDraft: (e) =>
|
|
1489
|
-
writable:
|
|
1304
|
+
all: n,
|
|
1305
|
+
sections: r,
|
|
1306
|
+
active: a,
|
|
1307
|
+
edited: c,
|
|
1308
|
+
hasViews: k(() => n.value.length > 0),
|
|
1309
|
+
hasDraft: (e) => s.has(e),
|
|
1310
|
+
writable: ee,
|
|
1490
1311
|
select: (e) => {
|
|
1491
|
-
|
|
1312
|
+
l = !0, u(e);
|
|
1492
1313
|
},
|
|
1493
1314
|
saveChanges: async () => {
|
|
1494
|
-
let
|
|
1495
|
-
|
|
1315
|
+
let t = a.value;
|
|
1316
|
+
ee(t) && e.adapter && (p(await e.adapter.update(e.tableId(), t.id, { state: e.current() })), o.value = e.current(), s.delete(t.id));
|
|
1496
1317
|
},
|
|
1497
1318
|
discard: () => {
|
|
1498
|
-
let
|
|
1499
|
-
|
|
1319
|
+
let t = a.value;
|
|
1320
|
+
t && (e.apply(t.state), o.value = e.current(), s.delete(t.id));
|
|
1500
1321
|
},
|
|
1501
|
-
create: async (
|
|
1502
|
-
if (!
|
|
1503
|
-
let r = await
|
|
1504
|
-
name:
|
|
1505
|
-
state:
|
|
1322
|
+
create: async (n) => {
|
|
1323
|
+
if (!e.adapter) return;
|
|
1324
|
+
let r = await e.adapter.create(e.tableId(), {
|
|
1325
|
+
name: n.name,
|
|
1326
|
+
state: n.state
|
|
1506
1327
|
});
|
|
1507
|
-
|
|
1328
|
+
t.value = [...t.value, r], n.makeDefault && e.setDefaultViewId(r.id), l = !0, u(r.id, !n.fromCurrent);
|
|
1508
1329
|
},
|
|
1509
|
-
rename: async (
|
|
1510
|
-
|
|
1330
|
+
rename: async (t, n) => {
|
|
1331
|
+
e.adapter && p(await e.adapter.update(e.tableId(), t, { name: n }));
|
|
1511
1332
|
},
|
|
1512
|
-
remove: async (
|
|
1513
|
-
if (
|
|
1514
|
-
|
|
1515
|
-
let
|
|
1516
|
-
|
|
1333
|
+
remove: async (r) => {
|
|
1334
|
+
if (e.adapter && (await e.adapter.remove(e.tableId(), r), t.value = t.value.filter((e) => e.id !== r), s.delete(r), e.defaultViewId() === r && e.setDefaultViewId(null), i.value === r)) {
|
|
1335
|
+
i.value = null, o.value = null;
|
|
1336
|
+
let t = $n(n.value, e.defaultViewId());
|
|
1337
|
+
t ? u(t.id) : e.apply({});
|
|
1517
1338
|
}
|
|
1518
1339
|
}
|
|
1519
1340
|
};
|
|
1520
1341
|
}
|
|
1521
1342
|
//#endregion
|
|
1522
1343
|
//#region src/core/views/ViewDialog.vue?vue&type=script&setup=true&lang.ts
|
|
1523
|
-
var
|
|
1344
|
+
var sr = { class: "dt-field" }, cr = { class: "dt-field-label" }, lr = { class: "dt-input" }, ur = ["aria-invalid"], dr = {
|
|
1524
1345
|
key: 0,
|
|
1525
1346
|
class: "dt-field-error",
|
|
1526
1347
|
role: "alert"
|
|
1527
|
-
},
|
|
1348
|
+
}, fr = {
|
|
1528
1349
|
key: 1,
|
|
1529
1350
|
class: "dt-view-summary"
|
|
1530
|
-
},
|
|
1351
|
+
}, pr = {
|
|
1531
1352
|
key: 2,
|
|
1532
1353
|
class: "dt-check-row"
|
|
1533
|
-
},
|
|
1354
|
+
}, mr = { class: "dt-dialog-actions" }, hr = {
|
|
1534
1355
|
type: "button",
|
|
1535
1356
|
class: "dt-btn"
|
|
1536
|
-
},
|
|
1357
|
+
}, gr = {
|
|
1537
1358
|
type: "submit",
|
|
1538
1359
|
class: "dt-btn dt-btn-primary"
|
|
1539
|
-
},
|
|
1360
|
+
}, _r = /* @__PURE__ */ I({
|
|
1540
1361
|
__name: "ViewDialog",
|
|
1541
|
-
props: /*@__PURE__*/
|
|
1362
|
+
props: /*@__PURE__*/ Se({
|
|
1542
1363
|
mode: {},
|
|
1543
1364
|
name: {},
|
|
1544
1365
|
summary: {},
|
|
@@ -1550,10 +1371,10 @@ var cr = { class: "dt-field" }, lr = { class: "dt-field-label" }, ur = { class:
|
|
|
1550
1371
|
},
|
|
1551
1372
|
openModifiers: {}
|
|
1552
1373
|
}),
|
|
1553
|
-
emits: /*@__PURE__*/
|
|
1374
|
+
emits: /*@__PURE__*/ Se(["save"], ["update:open"]),
|
|
1554
1375
|
setup(e, { emit: t }) {
|
|
1555
|
-
let n = e, r = t, i =
|
|
1556
|
-
|
|
1376
|
+
let n = e, r = t, i = Ne(e, "open"), { i18n: a } = _(), o = z(n.name), s = z(!1), c = z(null), l = z(null);
|
|
1377
|
+
K(i, (e) => {
|
|
1557
1378
|
e && (o.value = n.name, s.value = !1, c.value = null);
|
|
1558
1379
|
});
|
|
1559
1380
|
let u = (e) => {
|
|
@@ -1564,55 +1385,55 @@ var cr = { class: "dt-field" }, lr = { class: "dt-field-label" }, ur = { class:
|
|
|
1564
1385
|
makeDefault: s.value
|
|
1565
1386
|
}), i.value = !1);
|
|
1566
1387
|
};
|
|
1567
|
-
return (t, n) => (
|
|
1388
|
+
return (t, n) => (R(), A(G(X), {
|
|
1568
1389
|
open: i.value,
|
|
1569
1390
|
"onUpdate:open": n[2] ||= (e) => i.value = e
|
|
1570
1391
|
}, {
|
|
1571
|
-
default:
|
|
1572
|
-
default:
|
|
1392
|
+
default: q(() => [F(G(Y), null, {
|
|
1393
|
+
default: q(() => [F(G(gt), { class: "dt-scrim" }), F(G(mt), {
|
|
1573
1394
|
class: "dt-dialog dt-view-dialog",
|
|
1574
1395
|
onOpenAutoFocus: u
|
|
1575
1396
|
}, {
|
|
1576
|
-
default:
|
|
1577
|
-
|
|
1578
|
-
default:
|
|
1397
|
+
default: q(() => [N("form", { onSubmit: Be(d, ["prevent"]) }, [
|
|
1398
|
+
F(G(_t), { class: "dt-dialog-title" }, {
|
|
1399
|
+
default: q(() => [P(U(G(a).t(e.mode === "rename" ? "views.rename" : "views.dialogTitle")), 1)]),
|
|
1579
1400
|
_: 1
|
|
1580
1401
|
}),
|
|
1581
|
-
e.mode === "create" ? (
|
|
1402
|
+
e.mode === "create" ? (R(), A(G(ht), {
|
|
1582
1403
|
key: 0,
|
|
1583
1404
|
class: "dt-dialog-body"
|
|
1584
1405
|
}, {
|
|
1585
|
-
default:
|
|
1406
|
+
default: q(() => [P(U(G(a).t("views.dialogBody")), 1)]),
|
|
1586
1407
|
_: 1
|
|
1587
|
-
})) :
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1408
|
+
})) : j("", !0),
|
|
1409
|
+
N("label", sr, [
|
|
1410
|
+
N("span", cr, U(G(a).t("views.name")), 1),
|
|
1411
|
+
N("span", lr, [Re(N("input", {
|
|
1591
1412
|
ref_key: "input",
|
|
1592
1413
|
ref: l,
|
|
1593
1414
|
"onUpdate:modelValue": n[0] ||= (e) => o.value = e,
|
|
1594
1415
|
type: "text",
|
|
1595
1416
|
"aria-invalid": c.value ? "true" : void 0
|
|
1596
|
-
}, null, 8,
|
|
1597
|
-
c.value ? (
|
|
1417
|
+
}, null, 8, ur), [[Fe, o.value]])]),
|
|
1418
|
+
c.value ? (R(), M("span", dr, U(G(a).t(`views.err.${c.value}`)), 1)) : j("", !0)
|
|
1598
1419
|
]),
|
|
1599
|
-
e.summary ? (
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
])) :
|
|
1607
|
-
e.mode === "create" ? (
|
|
1420
|
+
e.summary ? (R(), M("div", fr, [
|
|
1421
|
+
N("span", null, U(G(a).t("views.filters")), 1),
|
|
1422
|
+
N("span", null, U(e.summary.filters), 1),
|
|
1423
|
+
N("span", null, U(G(a).t("views.sort")), 1),
|
|
1424
|
+
N("span", null, U(e.summary.sort), 1),
|
|
1425
|
+
N("span", null, U(G(a).t("views.columns")), 1),
|
|
1426
|
+
N("span", null, U(e.summary.columns), 1)
|
|
1427
|
+
])) : j("", !0),
|
|
1428
|
+
e.mode === "create" ? (R(), M("label", pr, [Re(N("input", {
|
|
1608
1429
|
"onUpdate:modelValue": n[1] ||= (e) => s.value = e,
|
|
1609
1430
|
type: "checkbox",
|
|
1610
1431
|
class: "dt-checkbox"
|
|
1611
|
-
}, null, 512), [[
|
|
1612
|
-
|
|
1613
|
-
default:
|
|
1432
|
+
}, null, 512), [[Pe, s.value]]), P(" " + U(G(a).t("views.makeDefault")), 1)])) : j("", !0),
|
|
1433
|
+
N("div", mr, [F(G(pt), { "as-child": "" }, {
|
|
1434
|
+
default: q(() => [N("button", hr, U(G(a).t("common.cancel")), 1)]),
|
|
1614
1435
|
_: 1
|
|
1615
|
-
}),
|
|
1436
|
+
}), N("button", gr, U(G(a).t(e.mode === "rename" ? "common.save" : "views.save")), 1)])
|
|
1616
1437
|
], 32)]),
|
|
1617
1438
|
_: 1
|
|
1618
1439
|
})]),
|
|
@@ -1621,7 +1442,10 @@ var cr = { class: "dt-field" }, lr = { class: "dt-field-label" }, ur = { class:
|
|
|
1621
1442
|
_: 1
|
|
1622
1443
|
}, 8, ["open"]));
|
|
1623
1444
|
}
|
|
1624
|
-
}),
|
|
1445
|
+
}), vr = ["aria-label"], yr = {
|
|
1446
|
+
class: "dt-view-icon",
|
|
1447
|
+
"aria-hidden": "true"
|
|
1448
|
+
}, br = { class: "dt-view-name" }, xr = { class: "dt-view-edited" }, Sr = { class: "dt-pop-label" }, Cr = { class: "dt-view-action-main" }, wr = { class: "dt-kbd" }, Tr = { class: "dt-view-action-sub" }, Er = { class: "dt-view-action-main" }, Dr = { class: "dt-view-action-sub" }, Or = { class: "dt-view-action-main" }, kr = { class: "dt-kbd" }, Ar = { class: "dt-view-action-main" }, jr = { class: "dt-input has-icon dt-picker-search" }, Mr = { class: "dt-input-icon" }, Nr = { class: "dt-view-row-name" }, Pr = { class: "dt-view-edited" }, Fr = {
|
|
1625
1449
|
key: 2,
|
|
1626
1450
|
class: "dt-view-default"
|
|
1627
1451
|
}, Ir = ["aria-label"], Lr = {
|
|
@@ -1630,9 +1454,9 @@ var cr = { class: "dt-field" }, lr = { class: "dt-field-label" }, ur = { class:
|
|
|
1630
1454
|
}, Rr = {
|
|
1631
1455
|
key: 0,
|
|
1632
1456
|
class: "dt-options-empty"
|
|
1633
|
-
}, zr = /* @__PURE__ */
|
|
1457
|
+
}, zr = /* @__PURE__ */ I({
|
|
1634
1458
|
__name: "ViewMenu",
|
|
1635
|
-
props: /*@__PURE__*/
|
|
1459
|
+
props: /*@__PURE__*/ Se({
|
|
1636
1460
|
sections: {},
|
|
1637
1461
|
active: {},
|
|
1638
1462
|
edited: { type: Boolean },
|
|
@@ -1648,7 +1472,7 @@ var cr = { class: "dt-field" }, lr = { class: "dt-field-label" }, ur = { class:
|
|
|
1648
1472
|
},
|
|
1649
1473
|
openModifiers: {}
|
|
1650
1474
|
}),
|
|
1651
|
-
emits: /*@__PURE__*/
|
|
1475
|
+
emits: /*@__PURE__*/ Se([
|
|
1652
1476
|
"select",
|
|
1653
1477
|
"save-changes",
|
|
1654
1478
|
"save-as",
|
|
@@ -1660,14 +1484,14 @@ var cr = { class: "dt-field" }, lr = { class: "dt-field-label" }, ur = { class:
|
|
|
1660
1484
|
"delete"
|
|
1661
1485
|
], ["update:open"]),
|
|
1662
1486
|
setup(e, { emit: t }) {
|
|
1663
|
-
let n = e, r = t, i =
|
|
1664
|
-
|
|
1487
|
+
let n = e, r = t, i = Ne(e, "open"), { i18n: a } = _(), o = z("");
|
|
1488
|
+
K(i, (e) => {
|
|
1665
1489
|
e || (o.value = "");
|
|
1666
1490
|
});
|
|
1667
|
-
let s =
|
|
1491
|
+
let s = k(() => {
|
|
1668
1492
|
let e = n.active?.name ?? a.t("views.title");
|
|
1669
1493
|
return a.t(n.edited ? "sr.viewEdited" : "sr.view", { name: e });
|
|
1670
|
-
}), c = (e) => !o.value || e.name.toLocaleLowerCase().includes(o.value.toLocaleLowerCase()), l =
|
|
1494
|
+
}), c = (e) => !o.value || e.name.toLocaleLowerCase().includes(o.value.toLocaleLowerCase()), l = k(() => [[
|
|
1671
1495
|
"system",
|
|
1672
1496
|
"views.system",
|
|
1673
1497
|
"views.builtIn"
|
|
@@ -1685,152 +1509,153 @@ var cr = { class: "dt-field" }, lr = { class: "dt-field-label" }, ur = { class:
|
|
|
1685
1509
|
}, p = (e) => {
|
|
1686
1510
|
typeof e == "string" && (i.value = !1, r("select", e));
|
|
1687
1511
|
};
|
|
1688
|
-
return (t, n) => (
|
|
1512
|
+
return (t, n) => (R(), A(D, {
|
|
1689
1513
|
open: i.value,
|
|
1690
1514
|
"onUpdate:open": n[7] ||= (e) => i.value = e,
|
|
1691
1515
|
sheet: e.sheet,
|
|
1692
|
-
title:
|
|
1516
|
+
title: G(a).t("views.title"),
|
|
1693
1517
|
"hide-title": "",
|
|
1694
1518
|
"content-class": "dt-views",
|
|
1695
1519
|
align: "start"
|
|
1696
1520
|
}, {
|
|
1697
|
-
trigger:
|
|
1521
|
+
trigger: q(() => [N("button", {
|
|
1698
1522
|
type: "button",
|
|
1699
1523
|
class: "dt-btn dt-btn-ghost has-icon dt-view-trigger",
|
|
1700
1524
|
"aria-label": s.value
|
|
1701
1525
|
}, [
|
|
1702
|
-
|
|
1703
|
-
|
|
1526
|
+
N("span", yr, [F(G($e), { size: 16 })]),
|
|
1527
|
+
N("span", br, U(e.active?.name ?? G(a).t("views.title")), 1),
|
|
1528
|
+
e.edited ? (R(), M(O, { key: 0 }, [n[8] ||= N("span", {
|
|
1704
1529
|
class: "dt-view-dot",
|
|
1705
1530
|
"aria-hidden": "true"
|
|
1706
|
-
}, null, -1),
|
|
1707
|
-
|
|
1531
|
+
}, null, -1), N("span", xr, U(G(a).t("views.edited")), 1)], 64)) : j("", !0),
|
|
1532
|
+
F(G(Ue), {
|
|
1708
1533
|
size: 14,
|
|
1709
1534
|
"aria-hidden": "true"
|
|
1710
1535
|
})
|
|
1711
|
-
], 8,
|
|
1712
|
-
default:
|
|
1713
|
-
e.edited && e.active ? (
|
|
1714
|
-
|
|
1715
|
-
e.canWrite ? (
|
|
1536
|
+
], 8, vr)]),
|
|
1537
|
+
default: q(() => [
|
|
1538
|
+
e.edited && e.active ? (R(), M(O, { key: 0 }, [
|
|
1539
|
+
N("div", Sr, U(G(a).t("views.editedName", { name: e.active.name })), 1),
|
|
1540
|
+
e.canWrite ? (R(), M(O, { key: 0 }, [N("button", {
|
|
1716
1541
|
type: "button",
|
|
1717
1542
|
class: "dt-pop-item dt-view-action",
|
|
1718
1543
|
onClick: n[0] ||= (e) => f(() => r("save-changes"))
|
|
1719
|
-
}, [
|
|
1544
|
+
}, [N("span", Cr, [P(U(G(a).t("views.saveChanges")) + " ", 1), N("kbd", wr, U(G(S)), 1)]), N("span", Tr, U(G(a).t("views.updates", { name: e.active.name })), 1)]), N("button", {
|
|
1720
1545
|
type: "button",
|
|
1721
1546
|
class: "dt-pop-item dt-view-action",
|
|
1722
1547
|
onClick: n[1] ||= (e) => f(() => r("save-as"))
|
|
1723
|
-
}, [
|
|
1548
|
+
}, [N("span", Er, U(G(a).t("views.saveAsNew")), 1), N("span", Dr, U(G(a).t("views.keepsUnchanged", { name: e.active.name })), 1)])], 64)) : e.canSave ? (R(), M("button", {
|
|
1724
1549
|
key: 1,
|
|
1725
1550
|
type: "button",
|
|
1726
1551
|
class: "dt-pop-item dt-view-action is-single",
|
|
1727
1552
|
onClick: n[2] ||= (e) => f(() => r("save-as"))
|
|
1728
|
-
}, [
|
|
1729
|
-
|
|
1553
|
+
}, [N("span", Or, [P(U(G(a).t("views.saveAsMine")) + " ", 1), N("kbd", kr, U(G(S)), 1)])])) : j("", !0),
|
|
1554
|
+
N("button", {
|
|
1730
1555
|
type: "button",
|
|
1731
1556
|
class: "dt-pop-item dt-view-action is-single",
|
|
1732
1557
|
onClick: n[3] ||= (e) => f(() => r("discard"))
|
|
1733
|
-
}, [
|
|
1734
|
-
n[9] ||=
|
|
1735
|
-
], 64)) :
|
|
1736
|
-
|
|
1558
|
+
}, [N("span", Ar, U(G(a).t("views.discard")), 1)]),
|
|
1559
|
+
n[9] ||= N("div", { class: "dt-pop-sep" }, null, -1)
|
|
1560
|
+
], 64)) : j("", !0),
|
|
1561
|
+
F(G(jt), {
|
|
1737
1562
|
"model-value": e.active?.id,
|
|
1738
1563
|
"selection-behavior": "replace",
|
|
1739
1564
|
"highlight-on-hover": "",
|
|
1740
1565
|
"onUpdate:modelValue": p
|
|
1741
1566
|
}, {
|
|
1742
|
-
default:
|
|
1567
|
+
default: q(() => [N("label", jr, [N("span", Mr, [F(G(Xe), {
|
|
1743
1568
|
size: 14,
|
|
1744
1569
|
"aria-hidden": "true"
|
|
1745
|
-
})]),
|
|
1570
|
+
})]), F(G(Dt), {
|
|
1746
1571
|
modelValue: o.value,
|
|
1747
1572
|
"onUpdate:modelValue": n[4] ||= (e) => o.value = e,
|
|
1748
1573
|
"auto-focus": "",
|
|
1749
|
-
placeholder:
|
|
1750
|
-
"aria-label":
|
|
1574
|
+
placeholder: G(a).t("views.find"),
|
|
1575
|
+
"aria-label": G(a).t("views.find")
|
|
1751
1576
|
}, null, 8, [
|
|
1752
1577
|
"modelValue",
|
|
1753
1578
|
"placeholder",
|
|
1754
1579
|
"aria-label"
|
|
1755
|
-
])]),
|
|
1756
|
-
default:
|
|
1757
|
-
default:
|
|
1758
|
-
default:
|
|
1580
|
+
])]), F(G(Et), { class: "dt-views-list" }, {
|
|
1581
|
+
default: q(() => [(R(!0), M(O, null, B(l.value, (t) => (R(), A(G(Ot), { key: t.key }, {
|
|
1582
|
+
default: q(() => [F(G(kt), { class: "dt-pop-label" }, {
|
|
1583
|
+
default: q(() => [P(U(G(a).t(t.title)) + " ", 1), N("span", null, U(G(a).t(t.hint)), 1)]),
|
|
1759
1584
|
_: 2
|
|
1760
|
-
}, 1024), (
|
|
1585
|
+
}, 1024), (R(!0), M(O, null, B(t.views, (t) => (R(), M("div", {
|
|
1761
1586
|
key: t.id,
|
|
1762
|
-
class:
|
|
1763
|
-
}, [
|
|
1587
|
+
class: L(["dt-view-row", { "is-active": t.id === e.active?.id }])
|
|
1588
|
+
}, [F(G(At), {
|
|
1764
1589
|
value: t.id,
|
|
1765
1590
|
class: "dt-view-item"
|
|
1766
1591
|
}, {
|
|
1767
|
-
default:
|
|
1768
|
-
e.sheet && t.id === e.active?.id ? (
|
|
1592
|
+
default: q(() => [
|
|
1593
|
+
e.sheet && t.id === e.active?.id ? (R(), A(G(Ke), {
|
|
1769
1594
|
key: 0,
|
|
1770
1595
|
size: 18,
|
|
1771
1596
|
class: "dt-view-check",
|
|
1772
1597
|
"aria-hidden": "true"
|
|
1773
|
-
})) :
|
|
1774
|
-
|
|
1775
|
-
u(t) ? (
|
|
1598
|
+
})) : j("", !0),
|
|
1599
|
+
N("span", Nr, U(t.name), 1),
|
|
1600
|
+
u(t) ? (R(), M(O, { key: 1 }, [n[10] ||= N("span", {
|
|
1776
1601
|
class: "dt-view-dot",
|
|
1777
1602
|
"aria-hidden": "true"
|
|
1778
|
-
}, null, -1),
|
|
1779
|
-
t.id === e.defaultId ? (
|
|
1603
|
+
}, null, -1), N("span", Pr, U(G(a).t("views.edited")), 1)], 64)) : j("", !0),
|
|
1604
|
+
t.id === e.defaultId ? (R(), M("span", Fr, U(G(a).t("views.default")), 1)) : j("", !0)
|
|
1780
1605
|
]),
|
|
1781
1606
|
_: 2
|
|
1782
|
-
}, 1032, ["value"]),
|
|
1783
|
-
default:
|
|
1784
|
-
default:
|
|
1607
|
+
}, 1032, ["value"]), F(G(xt), null, {
|
|
1608
|
+
default: q(() => [F(G(Tt), { "as-child": "" }, {
|
|
1609
|
+
default: q(() => [N("button", {
|
|
1785
1610
|
type: "button",
|
|
1786
1611
|
class: "dt-icon-btn-sm dt-view-more",
|
|
1787
|
-
"aria-label":
|
|
1788
|
-
onKeydown: n[5] ||=
|
|
1789
|
-
}, [
|
|
1612
|
+
"aria-label": G(a).t("common.more"),
|
|
1613
|
+
onKeydown: n[5] ||= ze(Be(() => {}, ["stop"]), ["enter", "space"])
|
|
1614
|
+
}, [F(G(Je), {
|
|
1790
1615
|
size: 16,
|
|
1791
1616
|
weight: "bold",
|
|
1792
1617
|
"aria-hidden": "true"
|
|
1793
1618
|
})], 40, Ir)]),
|
|
1794
1619
|
_: 1
|
|
1795
|
-
}),
|
|
1796
|
-
default:
|
|
1620
|
+
}), F(G(Q), null, {
|
|
1621
|
+
default: q(() => [F(G(yt), {
|
|
1797
1622
|
class: "dt-menu dt-view-row-menu",
|
|
1798
1623
|
side: "right",
|
|
1799
1624
|
align: "start",
|
|
1800
1625
|
"side-offset": 8
|
|
1801
1626
|
}, {
|
|
1802
|
-
default:
|
|
1803
|
-
d(t) ? (
|
|
1627
|
+
default: q(() => [
|
|
1628
|
+
d(t) ? (R(), A(G(Z), {
|
|
1804
1629
|
key: 0,
|
|
1805
1630
|
class: "dt-menu-item",
|
|
1806
1631
|
onSelect: (e) => f(() => r("rename", t))
|
|
1807
1632
|
}, {
|
|
1808
|
-
default:
|
|
1633
|
+
default: q(() => [P(U(G(a).t("views.rename")), 1)]),
|
|
1809
1634
|
_: 1
|
|
1810
|
-
}, 8, ["onSelect"])) :
|
|
1811
|
-
e.canSave ? (
|
|
1635
|
+
}, 8, ["onSelect"])) : j("", !0),
|
|
1636
|
+
e.canSave ? (R(), A(G(Z), {
|
|
1812
1637
|
key: 1,
|
|
1813
1638
|
class: "dt-menu-item",
|
|
1814
1639
|
onSelect: (e) => f(() => r("duplicate", t))
|
|
1815
1640
|
}, {
|
|
1816
|
-
default:
|
|
1641
|
+
default: q(() => [P(U(G(a).t("views.duplicate")), 1)]),
|
|
1817
1642
|
_: 1
|
|
1818
|
-
}, 8, ["onSelect"])) :
|
|
1819
|
-
|
|
1643
|
+
}, 8, ["onSelect"])) : j("", !0),
|
|
1644
|
+
F(G(Z), {
|
|
1820
1645
|
class: "dt-menu-item",
|
|
1821
1646
|
onSelect: (e) => r("set-default", t.id)
|
|
1822
1647
|
}, {
|
|
1823
|
-
default:
|
|
1648
|
+
default: q(() => [P(U(G(a).t("views.setDefault")), 1)]),
|
|
1824
1649
|
_: 1
|
|
1825
1650
|
}, 8, ["onSelect"]),
|
|
1826
|
-
d(t) ? (
|
|
1651
|
+
d(t) ? (R(), M(O, { key: 2 }, [F(G($), { class: "dt-menu-sep" }), F(G(Z), {
|
|
1827
1652
|
class: "dt-menu-item is-destructive",
|
|
1828
1653
|
onSelect: (e) => f(() => r("delete", t))
|
|
1829
1654
|
}, {
|
|
1830
|
-
default:
|
|
1655
|
+
default: q(() => [P(U(G(a).t("views.delete")), 1)]),
|
|
1831
1656
|
_: 1
|
|
1832
|
-
}, 8, ["onSelect"])], 64)) :
|
|
1833
|
-
t.kind === "system" ? (
|
|
1657
|
+
}, 8, ["onSelect"])], 64)) : j("", !0),
|
|
1658
|
+
t.kind === "system" ? (R(), M("div", Lr, U(G(a).t("views.systemNote")), 1)) : j("", !0)
|
|
1834
1659
|
]),
|
|
1835
1660
|
_: 2
|
|
1836
1661
|
}, 1024)]),
|
|
@@ -1839,19 +1664,19 @@ var cr = { class: "dt-field" }, lr = { class: "dt-field-label" }, ur = { class:
|
|
|
1839
1664
|
_: 2
|
|
1840
1665
|
}, 1024)], 2))), 128))]),
|
|
1841
1666
|
_: 2
|
|
1842
|
-
}, 1024))), 128)), l.value.length ?
|
|
1667
|
+
}, 1024))), 128)), l.value.length ? j("", !0) : (R(), M("div", Rr, U(G(a).t("views.noMatch")), 1))]),
|
|
1843
1668
|
_: 1
|
|
1844
1669
|
})]),
|
|
1845
1670
|
_: 1
|
|
1846
1671
|
}, 8, ["model-value"]),
|
|
1847
|
-
e.canSave ? (
|
|
1672
|
+
e.canSave ? (R(), M(O, { key: 1 }, [n[11] ||= N("div", { class: "dt-pop-sep" }, null, -1), N("button", {
|
|
1848
1673
|
type: "button",
|
|
1849
1674
|
class: "dt-pop-item dt-view-new",
|
|
1850
1675
|
onClick: n[6] ||= (e) => f(() => r("new"))
|
|
1851
|
-
}, [
|
|
1676
|
+
}, [F(G(Ze), {
|
|
1852
1677
|
size: 14,
|
|
1853
1678
|
"aria-hidden": "true"
|
|
1854
|
-
}),
|
|
1679
|
+
}), P(" " + U(G(a).t("views.new")), 1)])], 64)) : j("", !0)
|
|
1855
1680
|
]),
|
|
1856
1681
|
_: 1
|
|
1857
1682
|
}, 8, [
|
|
@@ -1876,7 +1701,7 @@ var cr = { class: "dt-field" }, lr = { class: "dt-field-label" }, ur = { class:
|
|
|
1876
1701
|
}, Xr = ["aria-label"], Zr = { class: "dt-menu-text" }, Qr = {
|
|
1877
1702
|
key: 0,
|
|
1878
1703
|
class: "dt-menu-sub"
|
|
1879
|
-
}, $r = ["aria-label", "data-dt-tip"], ei = /* @__PURE__ */
|
|
1704
|
+
}, $r = ["aria-label", "data-dt-tip"], ei = /* @__PURE__ */ I({
|
|
1880
1705
|
__name: "BulkBar",
|
|
1881
1706
|
props: {
|
|
1882
1707
|
rows: {},
|
|
@@ -1886,106 +1711,106 @@ var cr = { class: "dt-field" }, lr = { class: "dt-field-label" }, ur = { class:
|
|
|
1886
1711
|
},
|
|
1887
1712
|
emits: ["clear"],
|
|
1888
1713
|
setup(e, { emit: t }) {
|
|
1889
|
-
let n = e, r = t, { i18n: i } =
|
|
1714
|
+
let n = e, r = t, { i18n: i } = _(), a = k(() => n.actions.filter((e) => !e.when || e.when(n.rows))), o = k(() => a.value.filter((e) => e.inBar).slice(0, n.phone ? 2 : 3)), s = k(() => {
|
|
1890
1715
|
let e = new Set(o.value), t = a.value.filter((t) => !e.has(t));
|
|
1891
1716
|
return [...t.filter((e) => !e.destructive), ...t.filter((e) => e.destructive)];
|
|
1892
|
-
}), c =
|
|
1717
|
+
}), c = k(() => s.value.findIndex((e) => e.destructive)), l = (e) => e.disabled?.(n.rows) ?? !1, u = (e) => {
|
|
1893
1718
|
let t = l(e);
|
|
1894
1719
|
return typeof t == "string" ? t : e.description;
|
|
1895
|
-
}, d =
|
|
1720
|
+
}, d = z(!1), f = (e) => {
|
|
1896
1721
|
l(e) || (d.value = !1, e.run(n.rows));
|
|
1897
|
-
}, p =
|
|
1898
|
-
return (t, n) => (
|
|
1899
|
-
class:
|
|
1722
|
+
}, p = k(() => n.variant === "toolbar" ? "dt-btn has-icon" : "dt-bulk-btn");
|
|
1723
|
+
return (t, n) => (R(), M("div", {
|
|
1724
|
+
class: L(["dt-bulk", [`is-${e.variant}`, { "is-phone": e.phone }]]),
|
|
1900
1725
|
role: "toolbar",
|
|
1901
|
-
"aria-label":
|
|
1726
|
+
"aria-label": G(i).t("bulk.aria")
|
|
1902
1727
|
}, [
|
|
1903
|
-
e.variant === "toolbar" ? (
|
|
1728
|
+
e.variant === "toolbar" ? (R(), M("button", {
|
|
1904
1729
|
key: 0,
|
|
1905
1730
|
type: "button",
|
|
1906
1731
|
class: "dt-btn dt-btn-icon",
|
|
1907
|
-
"aria-label":
|
|
1908
|
-
"data-dt-tip":
|
|
1732
|
+
"aria-label": G(i).t("selection.clear"),
|
|
1733
|
+
"data-dt-tip": G(i).t("selection.clear"),
|
|
1909
1734
|
onClick: n[0] ||= (e) => r("clear")
|
|
1910
|
-
}, [
|
|
1735
|
+
}, [F(G(tt), {
|
|
1911
1736
|
size: 16,
|
|
1912
1737
|
"aria-hidden": "true"
|
|
1913
|
-
})], 8, Vr)) :
|
|
1914
|
-
|
|
1915
|
-
n[4] ||=
|
|
1738
|
+
})], 8, Vr)) : j("", !0),
|
|
1739
|
+
N("span", Hr, U(G(i).t("selection.selected", { count: e.rows.length })), 1),
|
|
1740
|
+
n[4] ||= N("span", {
|
|
1916
1741
|
class: "dt-bulk-sep",
|
|
1917
1742
|
"aria-hidden": "true"
|
|
1918
1743
|
}, null, -1),
|
|
1919
|
-
|
|
1744
|
+
V(t.$slots, "default", {}, () => [(R(!0), M(O, null, B(o.value, (t) => (R(), M("button", {
|
|
1920
1745
|
key: t.id,
|
|
1921
1746
|
type: "button",
|
|
1922
|
-
class:
|
|
1747
|
+
class: L([p.value, { "is-destructive": t.destructive }]),
|
|
1923
1748
|
disabled: !!l(t),
|
|
1924
1749
|
"data-dt-tip": u(t),
|
|
1925
1750
|
onClick: (e) => f(t)
|
|
1926
|
-
}, [t.icon ? (
|
|
1751
|
+
}, [t.icon ? (R(), A(ke(t.icon), {
|
|
1927
1752
|
key: 0,
|
|
1928
1753
|
size: e.phone ? 18 : 16,
|
|
1929
1754
|
"aria-hidden": "true"
|
|
1930
|
-
}, null, 8, ["size"])) :
|
|
1755
|
+
}, null, 8, ["size"])) : j("", !0), N("span", null, U(t.label), 1)], 10, Ur))), 128)), s.value.length && e.phone ? (R(), A(D, {
|
|
1931
1756
|
key: 0,
|
|
1932
1757
|
open: d.value,
|
|
1933
1758
|
"onUpdate:open": n[1] ||= (e) => d.value = e,
|
|
1934
1759
|
sheet: "",
|
|
1935
1760
|
"hide-title": "",
|
|
1936
|
-
title:
|
|
1761
|
+
title: G(i).t("bulk.moreAria")
|
|
1937
1762
|
}, {
|
|
1938
|
-
trigger:
|
|
1763
|
+
trigger: q(() => [N("button", {
|
|
1939
1764
|
type: "button",
|
|
1940
1765
|
class: "dt-bulk-btn dt-bulk-more",
|
|
1941
|
-
"aria-label":
|
|
1942
|
-
}, [
|
|
1766
|
+
"aria-label": G(i).t("bulk.moreAria")
|
|
1767
|
+
}, [F(G(Je), {
|
|
1943
1768
|
size: 18,
|
|
1944
1769
|
weight: "bold",
|
|
1945
1770
|
"aria-hidden": "true"
|
|
1946
|
-
}),
|
|
1947
|
-
default:
|
|
1771
|
+
}), N("span", null, U(G(i).t("common.more")), 1)], 8, Wr)]),
|
|
1772
|
+
default: q(() => [N("div", Gr, U(G(i).t("selection.selected", { count: e.rows.length })), 1), (R(!0), M(O, null, B(s.value, (e, t) => (R(), M(O, { key: e.id }, [t === c.value ? (R(), M("div", Kr)) : j("", !0), N("button", {
|
|
1948
1773
|
type: "button",
|
|
1949
|
-
class:
|
|
1774
|
+
class: L(["dt-bsheet-row", { "is-destructive": e.destructive }]),
|
|
1950
1775
|
disabled: !!l(e),
|
|
1951
1776
|
onClick: (t) => f(e)
|
|
1952
|
-
}, [
|
|
1777
|
+
}, [N("span", Jr, [N("span", null, U(e.label), 1), u(e) ? (R(), M("span", Yr, U(u(e)), 1)) : j("", !0)])], 10, qr)], 64))), 128))]),
|
|
1953
1778
|
_: 1
|
|
1954
|
-
}, 8, ["open", "title"])) : s.value.length ? (
|
|
1955
|
-
default:
|
|
1956
|
-
default:
|
|
1779
|
+
}, 8, ["open", "title"])) : s.value.length ? (R(), A(G(xt), { key: 1 }, {
|
|
1780
|
+
default: q(() => [F(G(Tt), { "as-child": "" }, {
|
|
1781
|
+
default: q(() => [N("button", {
|
|
1957
1782
|
type: "button",
|
|
1958
|
-
class:
|
|
1783
|
+
class: L([
|
|
1959
1784
|
p.value,
|
|
1960
1785
|
"dt-bulk-more",
|
|
1961
1786
|
{ "dt-btn-icon": e.variant === "toolbar" }
|
|
1962
1787
|
]),
|
|
1963
|
-
"aria-label":
|
|
1964
|
-
}, [
|
|
1788
|
+
"aria-label": G(i).t("bulk.moreAria")
|
|
1789
|
+
}, [F(G(Je), {
|
|
1965
1790
|
size: 16,
|
|
1966
1791
|
weight: "bold",
|
|
1967
1792
|
"aria-hidden": "true"
|
|
1968
1793
|
})], 10, Xr)]),
|
|
1969
1794
|
_: 1
|
|
1970
|
-
}),
|
|
1971
|
-
default:
|
|
1795
|
+
}), F(G(Q), null, {
|
|
1796
|
+
default: q(() => [F(G(yt), {
|
|
1972
1797
|
class: "dt-menu dt-bulk-menu",
|
|
1973
1798
|
side: e.variant === "floating" ? "top" : "bottom",
|
|
1974
1799
|
align: "start",
|
|
1975
1800
|
"side-offset": e.variant === "floating" ? 12 : 4
|
|
1976
1801
|
}, {
|
|
1977
|
-
default:
|
|
1802
|
+
default: q(() => [(R(!0), M(O, null, B(s.value, (e, t) => (R(), M(O, { key: e.id }, [t === c.value ? (R(), A(G($), {
|
|
1978
1803
|
key: 0,
|
|
1979
1804
|
class: "dt-menu-sep"
|
|
1980
|
-
})) :
|
|
1981
|
-
class:
|
|
1805
|
+
})) : j("", !0), F(G(Z), {
|
|
1806
|
+
class: L(["dt-menu-item", {
|
|
1982
1807
|
"is-destructive": e.destructive,
|
|
1983
1808
|
"is-two-line": u(e)
|
|
1984
1809
|
}]),
|
|
1985
1810
|
disabled: !!l(e),
|
|
1986
1811
|
onSelect: (t) => f(e)
|
|
1987
1812
|
}, {
|
|
1988
|
-
default:
|
|
1813
|
+
default: q(() => [N("span", Zr, [N("span", null, U(e.label), 1), u(e) ? (R(), M("span", Qr, U(u(e)), 1)) : j("", !0)])]),
|
|
1989
1814
|
_: 2
|
|
1990
1815
|
}, 1032, [
|
|
1991
1816
|
"class",
|
|
@@ -1997,20 +1822,20 @@ var cr = { class: "dt-field" }, lr = { class: "dt-field-label" }, ur = { class:
|
|
|
1997
1822
|
_: 1
|
|
1998
1823
|
})]),
|
|
1999
1824
|
_: 1
|
|
2000
|
-
})) :
|
|
2001
|
-
e.variant === "floating" ? (
|
|
1825
|
+
})) : j("", !0)]),
|
|
1826
|
+
e.variant === "floating" ? (R(), M(O, { key: 1 }, [n[3] ||= N("span", {
|
|
2002
1827
|
class: "dt-bulk-sep",
|
|
2003
1828
|
"aria-hidden": "true"
|
|
2004
|
-
}, null, -1),
|
|
1829
|
+
}, null, -1), N("button", {
|
|
2005
1830
|
type: "button",
|
|
2006
1831
|
class: "dt-bulk-btn dt-bulk-icon",
|
|
2007
|
-
"aria-label":
|
|
2008
|
-
"data-dt-tip":
|
|
1832
|
+
"aria-label": G(i).t("selection.clear"),
|
|
1833
|
+
"data-dt-tip": G(i).t("selection.clear"),
|
|
2009
1834
|
onClick: n[2] ||= (e) => r("clear")
|
|
2010
|
-
}, [
|
|
1835
|
+
}, [F(G(tt), {
|
|
2011
1836
|
size: 16,
|
|
2012
1837
|
"aria-hidden": "true"
|
|
2013
|
-
})], 8, $r)], 64)) :
|
|
1838
|
+
})], 8, $r)], 64)) : j("", !0)
|
|
2014
1839
|
], 10, Br));
|
|
2015
1840
|
}
|
|
2016
1841
|
}), ti = ["aria-label"], ni = { class: "dt-footer-left" }, ri = {
|
|
@@ -2042,7 +1867,7 @@ var cr = { class: "dt-field" }, lr = { class: "dt-field-label" }, ur = { class:
|
|
|
2042
1867
|
key: 1,
|
|
2043
1868
|
class: "dt-footer-vsep",
|
|
2044
1869
|
"aria-hidden": "true"
|
|
2045
|
-
}, bi = ["aria-label", "disabled"], xi = ["aria-label", "disabled"], Si = /* @__PURE__ */
|
|
1870
|
+
}, bi = ["aria-label", "disabled"], xi = ["aria-label", "disabled"], Si = /* @__PURE__ */ I({
|
|
2046
1871
|
__name: "Footer",
|
|
2047
1872
|
props: {
|
|
2048
1873
|
rowCount: {},
|
|
@@ -2067,115 +1892,115 @@ var cr = { class: "dt-field" }, lr = { class: "dt-field-label" }, ur = { class:
|
|
|
2067
1892
|
"page-size",
|
|
2068
1893
|
"refresh"
|
|
2069
1894
|
],
|
|
2070
|
-
setup(
|
|
2071
|
-
let
|
|
1895
|
+
setup(e, { emit: t }) {
|
|
1896
|
+
let n = e, r = t, { i18n: i, locale: a } = _(), o = ce(a), s = k(() => (n.page.number - 1) * n.page.size + 1), c = k(() => s.value + n.rowCount - 1), l = k(() => !n.hasMore), u = k(() => n.page.number === 1 && l.value), d = (e) => e.toLocaleTimeString(a, {
|
|
2072
1897
|
hour: "2-digit",
|
|
2073
1898
|
minute: "2-digit"
|
|
2074
|
-
}),
|
|
2075
|
-
return (
|
|
1899
|
+
}), f = k(() => n.page.number > 1 && !n.busy), p = k(() => n.hasMore && !n.busy), ee = k(() => n.updatedAt ? Date.now() - n.updatedAt.getTime() < 6e4 ? i.t("toolbar.updatedJustNow") : i.t("toolbar.updatedAgo", { time: o.relative(n.updatedAt, /* @__PURE__ */ new Date(), "short") }) : "");
|
|
1900
|
+
return (t, n) => (R(), M("div", {
|
|
2076
1901
|
class: "dt-footer",
|
|
2077
1902
|
role: "navigation",
|
|
2078
|
-
"aria-label":
|
|
2079
|
-
}, [
|
|
2080
|
-
from:
|
|
2081
|
-
to:
|
|
2082
|
-
})), 1),
|
|
2083
|
-
|
|
2084
|
-
|
|
1903
|
+
"aria-label": G(i).t("page.nav")
|
|
1904
|
+
}, [N("div", ni, [e.firstLoad ? (R(), M("span", ri, U(G(i).t("common.loading")), 1)) : e.rowCount === 0 ? (R(), M("span", ii, U(G(i).t(e.empty ? "page.none" : "page.zero")), 1)) : (R(), M(O, { key: 2 }, [N("span", ai, U(G(i).t("page.rows", {
|
|
1905
|
+
from: G(o).int(s.value),
|
|
1906
|
+
to: G(o).int(c.value)
|
|
1907
|
+
})), 1), e.total !== void 0 && !u.value ? (R(), M(O, { key: 0 }, [N("span", oi, U(G(i).t("page.of", { total: G(o).int(e.total) })), 1), e.countedAt ? (R(), M("span", si, " · " + U(G(i).t("page.counted", { time: d(e.countedAt) })), 1)) : j("", !0)], 64)) : e.counting ? (R(), M("span", ci, [
|
|
1908
|
+
P(U(G(i).t("page.of", { total: "" })) + " ", 1),
|
|
1909
|
+
F(G(qe), {
|
|
2085
1910
|
size: 12,
|
|
2086
1911
|
class: "dt-spin",
|
|
2087
1912
|
"aria-hidden": "true"
|
|
2088
1913
|
}),
|
|
2089
|
-
|
|
2090
|
-
])) :
|
|
1914
|
+
P(" " + U(G(i).t("page.counting")), 1)
|
|
1915
|
+
])) : l.value && !u.value ? (R(), M("span", li, "· " + U(G(i).t("page.end")), 1)) : e.countable && !u.value ? (R(), M("button", {
|
|
2091
1916
|
key: 3,
|
|
2092
1917
|
type: "button",
|
|
2093
1918
|
class: "dt-btn dt-btn-ghost dt-btn-xs dt-footer-count",
|
|
2094
|
-
onClick: n[0] ||= (e) =>
|
|
2095
|
-
}, " · " + G(
|
|
2096
|
-
n[6] ||=
|
|
1919
|
+
onClick: n[0] ||= (e) => r("count")
|
|
1920
|
+
}, " · " + U(G(i).t("page.countTotal")), 1)) : j("", !0)], 64)), !e.phone && (e.updatedAt || e.freshness !== "normal") ? (R(), M(O, { key: 3 }, [
|
|
1921
|
+
n[6] ||= N("span", {
|
|
2097
1922
|
class: "dt-footer-vsep",
|
|
2098
1923
|
"aria-hidden": "true"
|
|
2099
1924
|
}, null, -1),
|
|
2100
|
-
|
|
1925
|
+
e.freshness === "live" ? (R(), M("span", ui, [n[5] ||= N("span", {
|
|
2101
1926
|
class: "dt-live-dot",
|
|
2102
1927
|
"aria-hidden": "true"
|
|
2103
|
-
}, null, -1),
|
|
1928
|
+
}, null, -1), P(" " + U(G(i).t("toolbar.live")), 1)])) : e.freshness === "refreshing" ? (R(), M("span", di, U(G(i).t("state.updating")), 1)) : e.updatedAt ? (R(), M("span", {
|
|
2104
1929
|
key: 2,
|
|
2105
|
-
class:
|
|
2106
|
-
},
|
|
2107
|
-
|
|
1930
|
+
class: L(["dt-footer-updated", { "is-stale": e.freshness === "stale" }])
|
|
1931
|
+
}, U(ee.value), 3)) : j("", !0),
|
|
1932
|
+
e.canRefresh ? (R(), M("button", {
|
|
2108
1933
|
key: 3,
|
|
2109
1934
|
type: "button",
|
|
2110
1935
|
class: "dt-icon-btn-sm",
|
|
2111
|
-
"aria-label":
|
|
2112
|
-
"data-dt-tip": `${
|
|
2113
|
-
onClick: n[1] ||= (e) =>
|
|
2114
|
-
}, [
|
|
1936
|
+
"aria-label": G(i).t("toolbar.refresh"),
|
|
1937
|
+
"data-dt-tip": `${G(i).t("toolbar.refresh")} · R`,
|
|
1938
|
+
onClick: n[1] ||= (e) => r("refresh")
|
|
1939
|
+
}, [F(G(Ve), {
|
|
2115
1940
|
size: 14,
|
|
2116
|
-
class:
|
|
1941
|
+
class: L({ "dt-spin": e.freshness === "refreshing" }),
|
|
2117
1942
|
"aria-hidden": "true"
|
|
2118
|
-
}, null, 8, ["class"])], 8, fi)) :
|
|
2119
|
-
], 64)) :
|
|
2120
|
-
|
|
2121
|
-
value:
|
|
2122
|
-
disabled:
|
|
2123
|
-
onChange: n[2] ||= (e) =>
|
|
2124
|
-
}, [(
|
|
1943
|
+
}, null, 8, ["class"])], 8, fi)) : j("", !0)
|
|
1944
|
+
], 64)) : j("", !0)]), N("div", pi, [
|
|
1945
|
+
e.phone ? j("", !0) : (R(), M("label", mi, [N("span", hi, U(G(i).t("page.perPage")), 1), N("span", gi, [N("select", {
|
|
1946
|
+
value: e.page.size,
|
|
1947
|
+
disabled: e.busy,
|
|
1948
|
+
onChange: n[2] ||= (e) => r("page-size", Number(e.target.value))
|
|
1949
|
+
}, [(R(!0), M(O, null, B(e.pageSizes, (e) => (R(), M("option", {
|
|
2125
1950
|
key: e,
|
|
2126
1951
|
value: e
|
|
2127
|
-
},
|
|
1952
|
+
}, U(e), 9, vi))), 128))], 40, _i), F(G(Ue), {
|
|
2128
1953
|
size: 12,
|
|
2129
1954
|
"aria-hidden": "true"
|
|
2130
1955
|
})])])),
|
|
2131
|
-
|
|
2132
|
-
|
|
1956
|
+
e.phone ? j("", !0) : (R(), M("span", yi)),
|
|
1957
|
+
N("button", {
|
|
2133
1958
|
type: "button",
|
|
2134
1959
|
class: "dt-btn dt-btn-sm has-icon dt-footer-prev",
|
|
2135
|
-
"aria-label":
|
|
2136
|
-
disabled: !
|
|
2137
|
-
onClick: n[3] ||= (
|
|
2138
|
-
}, [
|
|
2139
|
-
size:
|
|
1960
|
+
"aria-label": e.phone ? G(i).t("page.previous") : void 0,
|
|
1961
|
+
disabled: !f.value,
|
|
1962
|
+
onClick: n[3] ||= (t) => r("page", e.page.number - 1)
|
|
1963
|
+
}, [F(G(We), {
|
|
1964
|
+
size: e.phone ? 18 : 14,
|
|
2140
1965
|
"aria-hidden": "true"
|
|
2141
|
-
}, null, 8, ["size"]),
|
|
2142
|
-
|
|
1966
|
+
}, null, 8, ["size"]), N("span", null, U(G(i).t("page.previous")), 1)], 8, bi),
|
|
1967
|
+
N("button", {
|
|
2143
1968
|
type: "button",
|
|
2144
1969
|
class: "dt-btn dt-btn-sm dt-footer-next",
|
|
2145
|
-
"aria-label":
|
|
2146
|
-
disabled: !
|
|
2147
|
-
onClick: n[4] ||= (
|
|
2148
|
-
}, [
|
|
2149
|
-
size:
|
|
1970
|
+
"aria-label": e.phone ? G(i).t("page.next") : void 0,
|
|
1971
|
+
disabled: !p.value,
|
|
1972
|
+
onClick: n[4] ||= (t) => r("page", e.page.number + 1)
|
|
1973
|
+
}, [N("span", null, U(G(i).t("page.next")), 1), F(G(Ge), {
|
|
1974
|
+
size: e.phone ? 18 : 14,
|
|
2150
1975
|
"aria-hidden": "true"
|
|
2151
1976
|
}, null, 8, ["size"])], 8, xi)
|
|
2152
1977
|
])], 8, ti));
|
|
2153
1978
|
}
|
|
2154
|
-
}), Ci =
|
|
2155
|
-
rowSortingFeature:
|
|
2156
|
-
sortedRowModel:
|
|
2157
|
-
columnFilteringFeature:
|
|
2158
|
-
globalFilteringFeature:
|
|
2159
|
-
filteredRowModel:
|
|
2160
|
-
rowPaginationFeature:
|
|
2161
|
-
paginatedRowModel:
|
|
2162
|
-
rowSelectionFeature:
|
|
2163
|
-
rowExpandingFeature:
|
|
2164
|
-
}), wi = (e) => e == null || e === "", Ti = (e) => e.searchable ??
|
|
1979
|
+
}), Ci = dt({
|
|
1980
|
+
rowSortingFeature: ut,
|
|
1981
|
+
sortedRowModel: it(),
|
|
1982
|
+
columnFilteringFeature: J,
|
|
1983
|
+
globalFilteringFeature: ot,
|
|
1984
|
+
filteredRowModel: nt(),
|
|
1985
|
+
rowPaginationFeature: ct,
|
|
1986
|
+
paginatedRowModel: rt(),
|
|
1987
|
+
rowSelectionFeature: lt,
|
|
1988
|
+
rowExpandingFeature: st
|
|
1989
|
+
}), wi = (e) => e == null || e === "", Ti = (e) => e.searchable ?? te[e.type].searchable;
|
|
2165
1990
|
function Ei(e) {
|
|
2166
|
-
let
|
|
2167
|
-
let
|
|
1991
|
+
let n = k(() => W(e.columns)), r = k(() => W(e.locale)), i = k(() => W(e.mode) === "server"), a = k(() => n.value.map((e) => {
|
|
1992
|
+
let n = e.id, i = x(e, r.value);
|
|
2168
1993
|
return {
|
|
2169
|
-
id:
|
|
2170
|
-
accessorFn: e.accessor ?? ((e) =>
|
|
2171
|
-
enableSorting: e.sortable ??
|
|
1994
|
+
id: n,
|
|
1995
|
+
accessorFn: e.accessor ?? ((e) => v(e, n)),
|
|
1996
|
+
enableSorting: e.sortable ?? te[e.type].sortable,
|
|
2172
1997
|
enableGlobalFilter: Ti(e),
|
|
2173
|
-
enableColumnFilter: e.filterable ??
|
|
2174
|
-
filterFn: (e,
|
|
2175
|
-
sortFn: (e, t, n) =>
|
|
1998
|
+
enableColumnFilter: e.filterable ?? te[e.type].filterable,
|
|
1999
|
+
filterFn: (e, n, i) => t(i, e.getValue(n), { locale: r.value }),
|
|
2000
|
+
sortFn: (e, t, n) => i(e.getValue(n), t.getValue(n)),
|
|
2176
2001
|
sortUndefined: 1
|
|
2177
2002
|
};
|
|
2178
|
-
})), o =
|
|
2003
|
+
})), o = k(() => e.search.value.trim().toLocaleLowerCase(r.value)), s = k(() => ({
|
|
2179
2004
|
sorting: e.sort.value.map((e) => ({
|
|
2180
2005
|
id: e.column,
|
|
2181
2006
|
desc: e.dir === "desc"
|
|
@@ -2191,39 +2016,39 @@ function Ei(e) {
|
|
|
2191
2016
|
})),
|
|
2192
2017
|
rowSelection: e.rowSelection?.value ?? {},
|
|
2193
2018
|
expanded: e.expanded?.value ?? {}
|
|
2194
|
-
})), c =
|
|
2019
|
+
})), c = k(() => new Set(n.value.filter(Ti).map((e) => e.id))), l = ft({
|
|
2195
2020
|
features: Ci,
|
|
2196
|
-
columns:
|
|
2197
|
-
data:
|
|
2198
|
-
getRowId: (t) => String(
|
|
2021
|
+
columns: a,
|
|
2022
|
+
data: k(() => W(e.rows)),
|
|
2023
|
+
getRowId: (t) => String(v(t, W(e.rowKey))),
|
|
2199
2024
|
state: s,
|
|
2200
|
-
manualSorting:
|
|
2201
|
-
manualFiltering:
|
|
2202
|
-
manualPagination:
|
|
2025
|
+
manualSorting: i,
|
|
2026
|
+
manualFiltering: i,
|
|
2027
|
+
manualPagination: i,
|
|
2203
2028
|
autoResetPageIndex: !1,
|
|
2204
2029
|
enableSortingRemoval: !0,
|
|
2205
2030
|
maxMultiSortColCount: 3,
|
|
2206
|
-
enableRowSelection:
|
|
2207
|
-
enableExpanding:
|
|
2208
|
-
getRowCanExpand: (t) =>
|
|
2031
|
+
enableRowSelection: k(() => W(e.selectable) ?? !1),
|
|
2032
|
+
enableExpanding: k(() => !!e.expanded),
|
|
2033
|
+
getRowCanExpand: (t) => W(e.canExpand)?.(t.original) ?? !0,
|
|
2209
2034
|
getColumnCanGlobalFilter: (e) => c.value.has(e.id),
|
|
2210
|
-
globalFilterFn: (e, t,
|
|
2035
|
+
globalFilterFn: (e, t, n) => {
|
|
2211
2036
|
let i = e.getValue(t);
|
|
2212
|
-
return !wi(i) && String(i).toLocaleLowerCase(
|
|
2037
|
+
return !wi(i) && String(i).toLocaleLowerCase(r.value).includes(n);
|
|
2213
2038
|
},
|
|
2214
2039
|
onSortingChange: () => {},
|
|
2215
2040
|
onPaginationChange: () => {},
|
|
2216
2041
|
onGlobalFilterChange: () => {},
|
|
2217
2042
|
onColumnFiltersChange: () => {},
|
|
2218
2043
|
onRowSelectionChange: (t) => {
|
|
2219
|
-
e.rowSelection && (e.rowSelection.value =
|
|
2044
|
+
e.rowSelection && (e.rowSelection.value = at(t, e.rowSelection.value));
|
|
2220
2045
|
},
|
|
2221
2046
|
onExpandedChange: (t) => {
|
|
2222
2047
|
if (!e.expanded) return;
|
|
2223
|
-
let n =
|
|
2048
|
+
let n = at(t, e.expanded.value);
|
|
2224
2049
|
n !== !0 && (e.expanded.value = n);
|
|
2225
2050
|
}
|
|
2226
|
-
}),
|
|
2051
|
+
}), u = k(() => i.value ? W(e.rows) : l.getRowModel().rows.map((e) => e.original)), d = k(() => i.value ? void 0 : l.getPrePaginatedRowModel().rows.length), f = k(() => i.value ? W(e.hasMore) ?? !1 : e.page.value.number * e.page.value.size < (d.value ?? 0)), p = k(() => e.page.value.number > 1), ee = (t, n) => {
|
|
2227
2052
|
let r = e.sort.value, i = r.findIndex((e) => e.column === t), a = i >= 0 ? r[i] : null, o = a ? a.dir === "asc" ? {
|
|
2228
2053
|
column: t,
|
|
2229
2054
|
dir: "desc"
|
|
@@ -2237,23 +2062,23 @@ function Ei(e) {
|
|
|
2237
2062
|
}
|
|
2238
2063
|
let s = r.filter((e) => e.column !== t);
|
|
2239
2064
|
o ? i >= 0 ? e.sort.value = r.map((e) => e.column === t ? o : e) : e.sort.value = [...s, o].slice(-3) : e.sort.value = s;
|
|
2240
|
-
},
|
|
2065
|
+
}, m = (t, n) => {
|
|
2241
2066
|
e.sort.value = n ? [{
|
|
2242
2067
|
column: t,
|
|
2243
2068
|
dir: n
|
|
2244
2069
|
}] : e.sort.value.filter((e) => e.column !== t);
|
|
2245
|
-
},
|
|
2070
|
+
}, h = (t) => String(v(t, W(e.rowKey)));
|
|
2246
2071
|
return {
|
|
2247
|
-
rows:
|
|
2248
|
-
total:
|
|
2249
|
-
canNext:
|
|
2250
|
-
canPrev:
|
|
2251
|
-
toggleSort:
|
|
2252
|
-
setSort:
|
|
2253
|
-
rowId:
|
|
2254
|
-
selectedRows:
|
|
2072
|
+
rows: u,
|
|
2073
|
+
total: d,
|
|
2074
|
+
canNext: f,
|
|
2075
|
+
canPrev: p,
|
|
2076
|
+
toggleSort: ee,
|
|
2077
|
+
setSort: m,
|
|
2078
|
+
rowId: h,
|
|
2079
|
+
selectedRows: k(() => {
|
|
2255
2080
|
let t = e.rowSelection?.value ?? {};
|
|
2256
|
-
return
|
|
2081
|
+
return u.value.filter((e) => t[h(e)]);
|
|
2257
2082
|
}),
|
|
2258
2083
|
toggleAllPage: (e) => l.toggleAllPageRowsSelected(e)
|
|
2259
2084
|
};
|
|
@@ -2262,7 +2087,7 @@ function Ei(e) {
|
|
|
2262
2087
|
//#region src/list/useRequest.ts
|
|
2263
2088
|
var Di = 1e4, Oi = 400;
|
|
2264
2089
|
function ki(e) {
|
|
2265
|
-
let t =
|
|
2090
|
+
let t = z(!1), n = z(null), r = H(null), i = z(null), a = z(!1), o = null, s, c, l = /* @__PURE__ */ new Set(), u = () => {
|
|
2266
2091
|
t.value = !1, a.value = !1, clearTimeout(s);
|
|
2267
2092
|
}, d = (r) => {
|
|
2268
2093
|
o?.abort(), o = new AbortController();
|
|
@@ -2272,35 +2097,35 @@ function ki(e) {
|
|
|
2272
2097
|
reason: r,
|
|
2273
2098
|
signal: o.signal
|
|
2274
2099
|
});
|
|
2275
|
-
}, f = () => e.mode() === "server", p =
|
|
2100
|
+
}, f = () => e.mode() === "server", p = k(() => {
|
|
2276
2101
|
let t = e.query();
|
|
2277
2102
|
return JSON.stringify([
|
|
2278
2103
|
t.search,
|
|
2279
2104
|
t.filters,
|
|
2280
2105
|
t.sort
|
|
2281
2106
|
]);
|
|
2282
|
-
}),
|
|
2283
|
-
return
|
|
2107
|
+
}), ee = k(() => JSON.stringify(e.query().page)), m = k(() => e.query().fields.join("\0"));
|
|
2108
|
+
return K([p, ee], ([e], [t]) => {
|
|
2284
2109
|
f() && d(e === t ? "page" : "query");
|
|
2285
|
-
}),
|
|
2110
|
+
}), K(m, () => {
|
|
2286
2111
|
f() && e.requestOnColumnChange() && (e.query().fields.every((e) => l.has(e)) || (clearTimeout(c), c = setTimeout(() => d("columns"), Oi)));
|
|
2287
|
-
}),
|
|
2112
|
+
}), K(e.rows, (t) => {
|
|
2288
2113
|
r.value = {
|
|
2289
2114
|
rows: t,
|
|
2290
2115
|
hasMore: e.hasMore() ?? !1,
|
|
2291
2116
|
page: e.query().page
|
|
2292
2117
|
}, i.value = /* @__PURE__ */ new Date(), u();
|
|
2293
|
-
}),
|
|
2118
|
+
}), K(e.error, (e) => {
|
|
2294
2119
|
e && u();
|
|
2295
|
-
}),
|
|
2120
|
+
}), K(e.loading, (e, t) => {
|
|
2296
2121
|
t && !e && u();
|
|
2297
|
-
}),
|
|
2122
|
+
}), De(() => {
|
|
2298
2123
|
f() ? d("initial") : (r.value = {
|
|
2299
2124
|
rows: e.rows(),
|
|
2300
2125
|
hasMore: !1,
|
|
2301
2126
|
page: e.query().page
|
|
2302
2127
|
}, i.value = /* @__PURE__ */ new Date());
|
|
2303
|
-
}),
|
|
2128
|
+
}), Ee(() => {
|
|
2304
2129
|
o?.abort(), clearTimeout(s), clearTimeout(c);
|
|
2305
2130
|
}), {
|
|
2306
2131
|
pending: t,
|
|
@@ -2308,7 +2133,7 @@ function ki(e) {
|
|
|
2308
2133
|
snapshot: r,
|
|
2309
2134
|
updatedAt: i,
|
|
2310
2135
|
stillLoading: a,
|
|
2311
|
-
errorKind:
|
|
2136
|
+
errorKind: k(() => {
|
|
2312
2137
|
if (!e.error()) return null;
|
|
2313
2138
|
let t = n.value;
|
|
2314
2139
|
return (t === "refresh" || t === "columns" || t === null) && (r.value?.rows.length ?? 0) > 0 ? "stale" : "error";
|
|
@@ -2342,7 +2167,7 @@ var Ai = ["data-density"], ji = ["aria-label"], Mi = {
|
|
|
2342
2167
|
}, Ui = {
|
|
2343
2168
|
class: "dt-sr-only",
|
|
2344
2169
|
"aria-live": "assertive"
|
|
2345
|
-
}, Wi = /* @__PURE__ */
|
|
2170
|
+
}, Wi = /* @__PURE__ */ I({
|
|
2346
2171
|
__name: "DataTable",
|
|
2347
2172
|
props: {
|
|
2348
2173
|
tableId: {},
|
|
@@ -2399,7 +2224,11 @@ var Ai = ["data-density"], ji = ["aria-label"], Mi = {
|
|
|
2399
2224
|
type: [Boolean, Object],
|
|
2400
2225
|
default: !1
|
|
2401
2226
|
},
|
|
2402
|
-
rowError: {}
|
|
2227
|
+
rowError: {},
|
|
2228
|
+
exportable: {
|
|
2229
|
+
type: Boolean,
|
|
2230
|
+
default: !0
|
|
2231
|
+
}
|
|
2403
2232
|
},
|
|
2404
2233
|
emits: [
|
|
2405
2234
|
"request",
|
|
@@ -2412,53 +2241,59 @@ var Ai = ["data-density"], ji = ["aria-label"], Mi = {
|
|
|
2412
2241
|
"print",
|
|
2413
2242
|
"view-change"
|
|
2414
2243
|
],
|
|
2415
|
-
setup(
|
|
2416
|
-
let
|
|
2417
|
-
one:
|
|
2418
|
-
other:
|
|
2419
|
-
}),
|
|
2420
|
-
|
|
2421
|
-
let e = () =>
|
|
2422
|
-
e(), typeof ResizeObserver < "u" &&
|
|
2244
|
+
setup(e, { expose: t, emit: n }) {
|
|
2245
|
+
let r = be(() => import("./FiltersSheet-C3zOlbkN.js")), o = be(() => import("./PhoneMoreSheet-66OdIZrl.js")), s = e, l = n, u = _(), { i18n: d } = u, ee = xe()?.vnode.props ?? {}, m = (e) => e in ee, h = k(() => s.mode === "server"), g = k(() => s.entityName ?? {
|
|
2246
|
+
one: s.tableId,
|
|
2247
|
+
other: s.tableId
|
|
2248
|
+
}), ne = k(() => g.value.other), y = z(null), oe = z(1440), se = k(() => oe.value >= 1024 ? "full" : oe.value >= 640 ? "narrow" : "phone"), b = k(() => se.value === "phone"), le;
|
|
2249
|
+
De(() => {
|
|
2250
|
+
let e = () => oe.value = y.value?.clientWidth || 1440;
|
|
2251
|
+
e(), typeof ResizeObserver < "u" && y.value && (le = new ResizeObserver(e), le.observe(y.value));
|
|
2423
2252
|
});
|
|
2424
|
-
let
|
|
2253
|
+
let x = me(() => s.tableId, u.preferences, {
|
|
2425
2254
|
density: "standard",
|
|
2426
2255
|
verticalLines: !1,
|
|
2427
|
-
pageSize:
|
|
2256
|
+
pageSize: s.pageSize,
|
|
2428
2257
|
defaultViewId: null
|
|
2429
|
-
}),
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2258
|
+
}), he = k(() => s.density ?? x.prefs.density), ge = z(1);
|
|
2259
|
+
K([he, y], () => {
|
|
2260
|
+
let e = y.value ? parseFloat(getComputedStyle(y.value).getPropertyValue("--dt-fs")) : NaN;
|
|
2261
|
+
ge.value = Number.isFinite(e) ? e / 13 : 1;
|
|
2262
|
+
}, { flush: "post" });
|
|
2263
|
+
let S = c({
|
|
2264
|
+
columns: () => s.columns,
|
|
2265
|
+
rows: () => s.rows,
|
|
2266
|
+
rowKey: () => s.rowKey,
|
|
2267
|
+
phone: () => b.value,
|
|
2268
|
+
scale: ge
|
|
2269
|
+
}), C = z(""), w = z([]), T = z({
|
|
2435
2270
|
number: 1,
|
|
2436
|
-
size:
|
|
2437
|
-
}),
|
|
2438
|
-
...
|
|
2271
|
+
size: x.prefs.pageSize
|
|
2272
|
+
}), E = (e) => T.value = {
|
|
2273
|
+
...T.value,
|
|
2439
2274
|
number: e
|
|
2440
|
-
},
|
|
2441
|
-
e !==
|
|
2275
|
+
}, ve = (e) => {
|
|
2276
|
+
e !== C.value && (C.value = e, E(1));
|
|
2442
2277
|
};
|
|
2443
|
-
|
|
2278
|
+
K(() => x.prefs.pageSize, (e) => T.value = {
|
|
2444
2279
|
number: 1,
|
|
2445
2280
|
size: e
|
|
2446
2281
|
});
|
|
2447
|
-
let
|
|
2448
|
-
let t =
|
|
2449
|
-
return
|
|
2450
|
-
i18n:
|
|
2451
|
-
fmt:
|
|
2452
|
-
labelOf:
|
|
2282
|
+
let D = z([]), O = z(null), I = z(!1), Se = new ae(), Oe = ce(u.locale), B = k(() => new Map(s.columns.map((e) => [e.id, e]))), ke = (e) => B.value.get(e)?.type ?? "string", H = k(() => D.value.filter((e) => f(e, ke(e.column))).map(a)), je = k(() => new Set(H.value.map((e) => e.column))), W = k(() => s.toolbar === "auto" && s.columns.some((e) => e.filterable ?? te[e.type].filterable)), Me = (e) => (t) => e.type === "select" || e.type === "multiselect" || e.type === "user" && e.options ? pe(e.options, t) : (e.type === "user" || e.type === "ajax") && e.remote ? Se.label(e.id, e.remote, t) : String(t), Ne = (e) => {
|
|
2283
|
+
let t = B.value.get(e.column);
|
|
2284
|
+
return p(e, t, {
|
|
2285
|
+
i18n: d,
|
|
2286
|
+
fmt: Oe,
|
|
2287
|
+
labelOf: Me(t)
|
|
2453
2288
|
});
|
|
2454
|
-
},
|
|
2455
|
-
let t =
|
|
2289
|
+
}, Pe = (e) => e.type === "currency" ? typeof e.currency == "string" ? [e.currency] : [...new Set(s.rows.map((t) => e.currency(t)))] : [], Fe = (e) => {
|
|
2290
|
+
let t = B.value.get(e);
|
|
2456
2291
|
if (t) {
|
|
2457
|
-
if (
|
|
2292
|
+
if (b.value) He.value?.show(e);
|
|
2458
2293
|
else {
|
|
2459
|
-
if (!
|
|
2460
|
-
let n =
|
|
2461
|
-
if (
|
|
2294
|
+
if (!D.value.some((t) => t.column === e)) {
|
|
2295
|
+
let n = i(t);
|
|
2296
|
+
if (D.value = [...D.value, t.type === "boolean" ? {
|
|
2462
2297
|
column: e,
|
|
2463
2298
|
op: n,
|
|
2464
2299
|
value: !0
|
|
@@ -2467,38 +2302,38 @@ var Ai = ["data-density"], ji = ["aria-label"], Mi = {
|
|
|
2467
2302
|
op: n
|
|
2468
2303
|
}], t.type === "boolean") return;
|
|
2469
2304
|
}
|
|
2470
|
-
|
|
2305
|
+
O.value = e;
|
|
2471
2306
|
}
|
|
2472
2307
|
}
|
|
2473
|
-
},
|
|
2474
|
-
|
|
2475
|
-
},
|
|
2476
|
-
let
|
|
2477
|
-
if (
|
|
2478
|
-
let e =
|
|
2479
|
-
e && !
|
|
2308
|
+
}, Le = (e) => D.value = D.value.map((t) => t.column === e.column ? e : t), ze = (e) => {
|
|
2309
|
+
D.value = D.value.filter((t) => t.column !== e), O.value === e && (O.value = null);
|
|
2310
|
+
}, Be = (e) => {
|
|
2311
|
+
let t = O.value;
|
|
2312
|
+
if (O.value = e, t && t !== e) {
|
|
2313
|
+
let e = D.value.find((e) => e.column === t);
|
|
2314
|
+
e && !f(e, ke(t)) && ze(t);
|
|
2480
2315
|
}
|
|
2481
|
-
},
|
|
2482
|
-
|
|
2483
|
-
},
|
|
2484
|
-
|
|
2485
|
-
},
|
|
2486
|
-
let e = /* @__PURE__ */ new Set([
|
|
2487
|
-
for (let t of
|
|
2316
|
+
}, Ve = () => {
|
|
2317
|
+
D.value = [], O.value = null;
|
|
2318
|
+
}, He = z(null), Ue = (e, t) => {
|
|
2319
|
+
D.value = e, O.value = null, w.value = t, E(1);
|
|
2320
|
+
}, We = k(() => S.columns.value.map((e) => e.id)), Ge = k(() => {
|
|
2321
|
+
let e = /* @__PURE__ */ new Set([s.rowKey]);
|
|
2322
|
+
for (let t of S.columns.value) {
|
|
2488
2323
|
t.def.accessor || e.add(t.id);
|
|
2489
2324
|
for (let n of t.def.fields ?? []) e.add(n);
|
|
2490
2325
|
}
|
|
2491
|
-
for (let t of
|
|
2326
|
+
for (let t of s.fields ?? []) e.add(t);
|
|
2492
2327
|
return [...e];
|
|
2493
|
-
}),
|
|
2494
|
-
search:
|
|
2495
|
-
filters:
|
|
2496
|
-
sort:
|
|
2497
|
-
page:
|
|
2498
|
-
columns:
|
|
2499
|
-
fields:
|
|
2500
|
-
})),
|
|
2501
|
-
let { search: e, filters: t, sort: n, columns: r, fields: i } =
|
|
2328
|
+
}), Je = k(() => ({
|
|
2329
|
+
search: C.value,
|
|
2330
|
+
filters: H.value,
|
|
2331
|
+
sort: w.value,
|
|
2332
|
+
page: T.value,
|
|
2333
|
+
columns: We.value,
|
|
2334
|
+
fields: Ge.value
|
|
2335
|
+
})), Xe = () => {
|
|
2336
|
+
let { search: e, filters: t, sort: n, columns: r, fields: i } = Je.value;
|
|
2502
2337
|
return {
|
|
2503
2338
|
search: e,
|
|
2504
2339
|
filters: t,
|
|
@@ -2506,346 +2341,363 @@ var Ai = ["data-density"], ji = ["aria-label"], Mi = {
|
|
|
2506
2341
|
columns: r,
|
|
2507
2342
|
fields: i
|
|
2508
2343
|
};
|
|
2509
|
-
},
|
|
2510
|
-
filters:
|
|
2511
|
-
sort:
|
|
2512
|
-
columns:
|
|
2513
|
-
}),
|
|
2514
|
-
tableId: () =>
|
|
2515
|
-
system: () =>
|
|
2516
|
-
adapter:
|
|
2517
|
-
locale: () =>
|
|
2518
|
-
defaultViewId: () =>
|
|
2519
|
-
setDefaultViewId: (e) =>
|
|
2520
|
-
prefsReady:
|
|
2521
|
-
current:
|
|
2344
|
+
}, Qe = z(""), $e = z(""), tt = () => ({
|
|
2345
|
+
filters: H.value,
|
|
2346
|
+
sort: w.value,
|
|
2347
|
+
columns: S.state.value
|
|
2348
|
+
}), J = or({
|
|
2349
|
+
tableId: () => s.tableId,
|
|
2350
|
+
system: () => s.views,
|
|
2351
|
+
adapter: u.viewsAdapter,
|
|
2352
|
+
locale: () => u.locale,
|
|
2353
|
+
defaultViewId: () => x.prefs.defaultViewId,
|
|
2354
|
+
setDefaultViewId: (e) => x.set({ defaultViewId: e }),
|
|
2355
|
+
prefsReady: x.ready,
|
|
2356
|
+
current: tt,
|
|
2522
2357
|
apply: (e) => {
|
|
2523
|
-
|
|
2358
|
+
D.value = (e.filters ?? []).map((e) => ({ ...e })), O.value = null, w.value = e.sort ?? [], S.apply(e.columns), E(1);
|
|
2524
2359
|
},
|
|
2525
2360
|
onChange: (e) => {
|
|
2526
|
-
|
|
2361
|
+
l("view-change", {
|
|
2527
2362
|
id: e.id,
|
|
2528
2363
|
kind: e.kind
|
|
2529
|
-
}),
|
|
2364
|
+
}), Qe.value = d.t("sr.view", { name: e.name });
|
|
2530
2365
|
}
|
|
2531
|
-
}),
|
|
2366
|
+
}), nt = z(!1), rt = (e) => {
|
|
2532
2367
|
let t = e.sort[0], n = e.sort.length > 1 ? ` +${e.sort.length - 1}` : "", r = [...e.columns.pinned.left, ...e.columns.pinned.right].map(Z).join(", ");
|
|
2533
2368
|
return {
|
|
2534
|
-
filters: e.filters.map((e) => Z(e.column)).join(" · ") ||
|
|
2535
|
-
sort: t ? `${Z(t.column)} ${t.dir === "asc" ? "↑" : "↓"}${n}` :
|
|
2536
|
-
columns: [
|
|
2369
|
+
filters: e.filters.map((e) => Z(e.column)).join(" · ") || d.t("common.empty"),
|
|
2370
|
+
sort: t ? `${Z(t.column)} ${t.dir === "asc" ? "↑" : "↓"}${n}` : d.t("common.empty"),
|
|
2371
|
+
columns: [d.t("views.columnsSummary", {
|
|
2537
2372
|
shown: e.columns.visible.length,
|
|
2538
|
-
total:
|
|
2539
|
-
}), ...r ? [
|
|
2373
|
+
total: s.columns.length
|
|
2374
|
+
}), ...r ? [d.t("views.pinnedSummary", { name: r })] : []].join(" · ")
|
|
2540
2375
|
};
|
|
2541
|
-
},
|
|
2376
|
+
}, it = (e) => ({
|
|
2542
2377
|
filters: e.state.filters ?? [],
|
|
2543
2378
|
sort: e.state.sort ?? [],
|
|
2544
|
-
columns:
|
|
2545
|
-
}),
|
|
2546
|
-
get: () => !!
|
|
2379
|
+
columns: S.resolve(e.state.columns)
|
|
2380
|
+
}), at = z(null), ot = k({
|
|
2381
|
+
get: () => !!at.value,
|
|
2547
2382
|
set: (e) => {
|
|
2548
|
-
e || (
|
|
2383
|
+
e || (at.value = null);
|
|
2549
2384
|
}
|
|
2550
|
-
}),
|
|
2551
|
-
let t = e ?
|
|
2552
|
-
|
|
2385
|
+
}), st = z(null), ct = (e) => {
|
|
2386
|
+
let t = e ? it(e) : tt();
|
|
2387
|
+
at.value = {
|
|
2553
2388
|
mode: "create",
|
|
2554
|
-
name: e ?
|
|
2389
|
+
name: e ? d.t("views.copyName", { name: e.name }) : "",
|
|
2555
2390
|
state: t,
|
|
2556
|
-
summary:
|
|
2391
|
+
summary: rt(t),
|
|
2557
2392
|
view: e,
|
|
2558
2393
|
fromCurrent: !e
|
|
2559
2394
|
};
|
|
2560
|
-
},
|
|
2395
|
+
}, lt = (e) => at.value = {
|
|
2561
2396
|
mode: "rename",
|
|
2562
2397
|
name: e.name,
|
|
2563
|
-
state:
|
|
2398
|
+
state: tt(),
|
|
2564
2399
|
summary: null,
|
|
2565
2400
|
view: e,
|
|
2566
2401
|
fromCurrent: !1
|
|
2567
|
-
},
|
|
2568
|
-
let t =
|
|
2569
|
-
return
|
|
2570
|
-
},
|
|
2571
|
-
let t =
|
|
2572
|
-
t && (t.mode === "rename" && t.view ?
|
|
2402
|
+
}, ut = (e) => {
|
|
2403
|
+
let t = at.value;
|
|
2404
|
+
return ir(e, J.all.value, u.locale, t?.mode === "rename" ? t.view?.id : void 0);
|
|
2405
|
+
}, dt = (e) => {
|
|
2406
|
+
let t = at.value;
|
|
2407
|
+
t && (t.mode === "rename" && t.view ? J.rename(t.view.id, e.name) : J.create({
|
|
2573
2408
|
name: e.name,
|
|
2574
2409
|
state: t.state,
|
|
2575
2410
|
makeDefault: e.makeDefault,
|
|
2576
2411
|
fromCurrent: t.fromCurrent
|
|
2577
2412
|
}));
|
|
2578
|
-
},
|
|
2579
|
-
let e =
|
|
2580
|
-
e &&
|
|
2581
|
-
},
|
|
2582
|
-
columns: () =>
|
|
2583
|
-
rows: () =>
|
|
2584
|
-
rowKey: () =>
|
|
2585
|
-
mode: () =>
|
|
2586
|
-
locale:
|
|
2587
|
-
sort:
|
|
2588
|
-
filters:
|
|
2589
|
-
page:
|
|
2590
|
-
search:
|
|
2591
|
-
hasMore: () =>
|
|
2592
|
-
selectable: () =>
|
|
2593
|
-
rowSelection:
|
|
2594
|
-
expanded:
|
|
2595
|
-
canExpand: () =>
|
|
2413
|
+
}, ft = () => {
|
|
2414
|
+
let e = st.value;
|
|
2415
|
+
e && J.remove(e.id);
|
|
2416
|
+
}, pt = z({}), mt = z({}), ht = k(() => !!s.expand), gt = k(() => typeof s.expand == "object" ? s.expand.canExpand : void 0), Y = Ei({
|
|
2417
|
+
columns: () => s.columns,
|
|
2418
|
+
rows: () => s.rows,
|
|
2419
|
+
rowKey: () => s.rowKey,
|
|
2420
|
+
mode: () => s.mode,
|
|
2421
|
+
locale: u.locale,
|
|
2422
|
+
sort: w,
|
|
2423
|
+
filters: H,
|
|
2424
|
+
page: T,
|
|
2425
|
+
search: C,
|
|
2426
|
+
hasMore: () => s.hasMore,
|
|
2427
|
+
selectable: () => s.selectable,
|
|
2428
|
+
rowSelection: pt,
|
|
2429
|
+
expanded: mt,
|
|
2430
|
+
canExpand: () => gt.value
|
|
2596
2431
|
}), X = ki({
|
|
2597
|
-
mode: () =>
|
|
2598
|
-
hasListener:
|
|
2599
|
-
query: () =>
|
|
2600
|
-
rows: () =>
|
|
2601
|
-
hasMore: () =>
|
|
2602
|
-
loading: () =>
|
|
2603
|
-
error: () =>
|
|
2604
|
-
requestOnColumnChange: () =>
|
|
2605
|
-
emit: (e) =>
|
|
2606
|
-
}),
|
|
2607
|
-
|
|
2608
|
-
},
|
|
2609
|
-
|
|
2610
|
-
},
|
|
2432
|
+
mode: () => s.mode,
|
|
2433
|
+
hasListener: m("onRequest"),
|
|
2434
|
+
query: () => Je.value,
|
|
2435
|
+
rows: () => s.rows,
|
|
2436
|
+
hasMore: () => s.hasMore,
|
|
2437
|
+
loading: () => s.loading,
|
|
2438
|
+
error: () => s.error,
|
|
2439
|
+
requestOnColumnChange: () => s.requestOnColumnChange,
|
|
2440
|
+
emit: (e) => l("request", e)
|
|
2441
|
+
}), _t = (e, t) => {
|
|
2442
|
+
Y.toggleSort(e, t), E(1);
|
|
2443
|
+
}, vt = (e, t) => {
|
|
2444
|
+
Y.setSort(e, t), E(1);
|
|
2445
|
+
}, yt = k(() => new Map(w.value.map((e, t) => [e.column, {
|
|
2611
2446
|
dir: e.dir,
|
|
2612
|
-
index:
|
|
2613
|
-
}]))), Z = (e) =>
|
|
2614
|
-
|
|
2615
|
-
clearTimeout(
|
|
2447
|
+
index: w.value.length > 1 ? t + 1 : null
|
|
2448
|
+
}]))), Z = (e) => s.columns.find((t) => t.id === e)?.header ?? e, bt = X.reason, Q = X.pending, xt = k(() => X.errorKind.value === "error" ? [] : Y.rows.value), $ = k(() => xt.value.length > 0), St = k(() => Q.value && (bt.value === "query" || bt.value === "page")), Ct = k(() => St.value && $.value), wt = z(!1), Tt;
|
|
2449
|
+
K(Ct, (e) => {
|
|
2450
|
+
clearTimeout(Tt), wt.value = !1, e && (Tt = setTimeout(() => wt.value = !0, 400));
|
|
2616
2451
|
});
|
|
2617
|
-
let
|
|
2618
|
-
|
|
2619
|
-
clearTimeout(
|
|
2452
|
+
let Et = k(() => Q.value && !$.value || !!s.loading && !$.value && !s.error || wt.value), Dt = k(() => Q.value && (bt.value === "refresh" || bt.value === "columns") || !!s.loading && $.value && !St.value), Ot = z(!1), kt;
|
|
2453
|
+
K(Dt, (e) => {
|
|
2454
|
+
clearTimeout(kt), Ot.value = !1, e && (kt = setTimeout(() => Ot.value = !0, 150));
|
|
2620
2455
|
});
|
|
2621
|
-
let
|
|
2622
|
-
let e =
|
|
2456
|
+
let At = k(() => St.value || Et.value && !$.value), jt = k(() => Et.value || $.value || Q.value ? null : X.errorKind.value === "error" ? "error" : C.value || H.value.length ? "noResults" : T.value.number > 1 ? "noRowsOnPage" : "empty"), Mt = k(() => {
|
|
2457
|
+
let e = s.error;
|
|
2623
2458
|
return typeof e == "object" && e ? e : typeof e == "string" ? { message: e } : {};
|
|
2624
|
-
}),
|
|
2625
|
-
let e =
|
|
2626
|
-
entity:
|
|
2627
|
-
q:
|
|
2459
|
+
}), Nt = k(() => {
|
|
2460
|
+
let e = H.value.length, t = {
|
|
2461
|
+
entity: g.value,
|
|
2462
|
+
q: C.value,
|
|
2628
2463
|
count: e
|
|
2629
2464
|
};
|
|
2630
|
-
return
|
|
2631
|
-
}),
|
|
2465
|
+
return C.value && e ? d.t("state.noResultsBoth", t) : C.value ? d.t("state.noResultsSearch", t) : d.t("state.noResults", t);
|
|
2466
|
+
}), Pt = (e) => e.toLocaleTimeString(u.locale, {
|
|
2632
2467
|
hour: "2-digit",
|
|
2633
2468
|
minute: "2-digit"
|
|
2634
|
-
}),
|
|
2635
|
-
|
|
2636
|
-
query:
|
|
2637
|
-
signal:
|
|
2469
|
+
}), Ft = X.snapshot, It = k(() => X.errorKind.value === "error" ? 0 : h.value ? Ft.value?.rows.length ?? 0 : Y.rows.value.length), Lt = k(() => h.value ? Ft.value?.page ?? T.value : T.value), Rt = k(() => h.value ? Ft.value?.hasMore ?? !1 : Y.canNext.value), zt = k(() => h.value ? s.total : Y.total.value), Bt = null, Vt = z(!1), Ht = z(null), Ut = () => {
|
|
2470
|
+
Bt?.abort(), Bt = new AbortController(), Vt.value = !0, l("count", {
|
|
2471
|
+
query: Xe(),
|
|
2472
|
+
signal: Bt.signal
|
|
2638
2473
|
});
|
|
2639
2474
|
};
|
|
2640
|
-
|
|
2641
|
-
e !== void 0 && (
|
|
2642
|
-
count:
|
|
2643
|
-
entity:
|
|
2475
|
+
K(() => s.total, (e) => {
|
|
2476
|
+
e !== void 0 && (Vt.value = !1, Ht.value = h.value ? /* @__PURE__ */ new Date() : null, Qe.value = d.t("sr.total", {
|
|
2477
|
+
count: Oe.int(e),
|
|
2478
|
+
entity: g.value
|
|
2644
2479
|
}));
|
|
2645
|
-
}),
|
|
2480
|
+
}), K(() => JSON.stringify([
|
|
2481
|
+
C.value,
|
|
2646
2482
|
w.value,
|
|
2647
|
-
|
|
2648
|
-
W.value
|
|
2483
|
+
H.value
|
|
2649
2484
|
]), () => {
|
|
2650
|
-
|
|
2485
|
+
Bt?.abort(), Vt.value = !1, Ht.value = null;
|
|
2651
2486
|
});
|
|
2652
|
-
let
|
|
2653
|
-
|
|
2654
|
-
let
|
|
2655
|
-
|
|
2656
|
-
|
|
2487
|
+
let Wt = z(null);
|
|
2488
|
+
K(() => T.value.number, () => Wt.value?.scrollToTop());
|
|
2489
|
+
let Gt = (e) => x.set({ pageSize: e });
|
|
2490
|
+
K(() => JSON.stringify(H.value), (e, t) => {
|
|
2491
|
+
E(1), Wt.value?.scrollToTop();
|
|
2657
2492
|
let n = new Map(JSON.parse(t).map((e) => [e.column, JSON.stringify(e)])), r = new Map(JSON.parse(e).map((e) => [e.column, JSON.stringify(e)]));
|
|
2658
2493
|
for (let [e, t] of r) if (n.get(e) !== t) {
|
|
2659
|
-
let t =
|
|
2494
|
+
let t = D.value.find((t) => t.column === e);
|
|
2660
2495
|
if (t) {
|
|
2661
|
-
let n =
|
|
2662
|
-
|
|
2496
|
+
let n = Ne(t);
|
|
2497
|
+
Qe.value = d.t("sr.filterAdded", { summary: `${Z(e)} ${n.text}`.trim() });
|
|
2663
2498
|
}
|
|
2664
2499
|
}
|
|
2665
|
-
for (let e of n.keys()) r.has(e) || (
|
|
2500
|
+
for (let e of n.keys()) r.has(e) || (Qe.value = d.t("sr.filterRemoved", { column: Z(e) }));
|
|
2666
2501
|
});
|
|
2667
|
-
let
|
|
2668
|
-
|
|
2669
|
-
clearInterval(
|
|
2502
|
+
let qt = z(!1), Jt;
|
|
2503
|
+
K(qt, (e) => {
|
|
2504
|
+
clearInterval(Jt), e && s.autoRefresh && (Jt = setInterval(() => X.refresh(), s.autoRefresh * 1e3));
|
|
2670
2505
|
});
|
|
2671
|
-
let
|
|
2672
|
-
refresh:
|
|
2673
|
-
export:
|
|
2674
|
-
import:
|
|
2675
|
-
print:
|
|
2676
|
-
autoRefresh:
|
|
2677
|
-
})),
|
|
2678
|
-
density:
|
|
2679
|
-
verticalLines:
|
|
2680
|
-
columns:
|
|
2681
|
-
counts:
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
"
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
},
|
|
2691
|
-
"columns-reset": () => C.reset(Y.active.value?.state.columns),
|
|
2506
|
+
let Yt = k(() => qt.value ? "live" : Dt.value ? "refreshing" : X.errorKind.value === "stale" ? "stale" : "normal"), Xt = k(() => s.toolbar !== !1 && s.columns.some(Ti)), Zt = k(() => s.toolbar === "auto"), Qt = k(() => ({
|
|
2507
|
+
refresh: m("onRequest"),
|
|
2508
|
+
export: s.exportable ? sn.value : !1,
|
|
2509
|
+
import: m("onImport"),
|
|
2510
|
+
print: m("onPrint"),
|
|
2511
|
+
autoRefresh: s.autoRefresh !== void 0
|
|
2512
|
+
})), $t = k(() => s.toolbar === "auto" && Object.values(Qt.value).some(Boolean)), en = k(() => s.searchPlaceholder ?? d.t("toolbar.search", { entity: g.value })), tn = z(null), nn = k(() => ({
|
|
2513
|
+
density: he.value,
|
|
2514
|
+
verticalLines: x.prefs.verticalLines,
|
|
2515
|
+
columns: S.panel.value,
|
|
2516
|
+
counts: S.counts.value,
|
|
2517
|
+
persistent: x.persistent
|
|
2518
|
+
})), rn = {
|
|
2519
|
+
"update:density": (e) => x.set({ density: e }),
|
|
2520
|
+
"columns-save": (e) => S.arrange(e),
|
|
2521
|
+
reset: () => {
|
|
2522
|
+
x.reset(), S.reset(J.active.value?.state.columns);
|
|
2523
|
+
}
|
|
2524
|
+
}, an = {
|
|
2692
2525
|
"sort-dir": (e, t) => {
|
|
2693
|
-
|
|
2526
|
+
w.value = w.value.map((n) => n.column === e ? {
|
|
2694
2527
|
column: e,
|
|
2695
2528
|
dir: t
|
|
2696
|
-
} : n),
|
|
2529
|
+
} : n), E(1);
|
|
2697
2530
|
},
|
|
2698
|
-
"sort-remove": (e) =>
|
|
2531
|
+
"sort-remove": (e) => vt(e, null),
|
|
2699
2532
|
"sort-clear": () => {
|
|
2700
|
-
|
|
2701
|
-
}
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2533
|
+
w.value = [], E(1);
|
|
2534
|
+
}
|
|
2535
|
+
}, on = () => Y.selectedRows.value.length ? Y.selectedRows.value : xt.value, sn = k(() => {
|
|
2536
|
+
let e = Y.selectedRows.value.length;
|
|
2537
|
+
return e ? d.t("toolbar.exportSelected", { count: e }) : d.t("toolbar.export", { count: xt.value.length });
|
|
2538
|
+
}), cn = (e, t) => t.accessor ? t.accessor(e) : v(e, t.id), ln = (e) => {
|
|
2539
|
+
let t = on();
|
|
2540
|
+
if (m("onExport")) return l("export", {
|
|
2541
|
+
format: e,
|
|
2542
|
+
query: Xe(),
|
|
2543
|
+
selection: Y.selectedRows.value,
|
|
2544
|
+
rows: t,
|
|
2545
|
+
visibleColumns: We.value
|
|
2546
|
+
});
|
|
2547
|
+
de({
|
|
2548
|
+
format: e,
|
|
2549
|
+
columns: S.columns.value.map((e) => e.def),
|
|
2550
|
+
rows: t,
|
|
2551
|
+
read: cn,
|
|
2552
|
+
env: {
|
|
2553
|
+
fmt: Oe,
|
|
2554
|
+
i18n: d,
|
|
2555
|
+
today: /* @__PURE__ */ new Date(),
|
|
2556
|
+
labels: Se
|
|
2557
|
+
},
|
|
2558
|
+
name: g.value.other
|
|
2559
|
+
});
|
|
2560
|
+
}, un = k(() => s.columns.find((e) => e.primary)), dn = (e) => un.value?.href?.(e), fn = (e) => {
|
|
2561
|
+
let t = un.value, n = t ? t.accessor ? t.accessor(e) : v(e, t.id) : v(e, s.rowKey);
|
|
2710
2562
|
return n == null ? "" : String(n);
|
|
2711
|
-
},
|
|
2712
|
-
let n = { ...
|
|
2563
|
+
}, pn = k(() => !!s.rowActions?.length || !!un.value), hn = Y.selectedRows, gn = () => pt.value = {}, _n = (e, t) => {
|
|
2564
|
+
let n = { ...pt.value };
|
|
2713
2565
|
for (let r of e) t ? n[r] = !0 : delete n[r];
|
|
2714
|
-
|
|
2566
|
+
pt.value = n;
|
|
2715
2567
|
};
|
|
2716
|
-
|
|
2568
|
+
K(() => JSON.stringify([
|
|
2569
|
+
C.value,
|
|
2570
|
+
H.value,
|
|
2717
2571
|
w.value,
|
|
2718
|
-
|
|
2719
|
-
T.value,
|
|
2720
|
-
E.value
|
|
2572
|
+
T.value
|
|
2721
2573
|
]), () => {
|
|
2722
|
-
|
|
2723
|
-
}),
|
|
2724
|
-
let t = new Set(e.map(
|
|
2725
|
-
Object.keys(
|
|
2726
|
-
}),
|
|
2727
|
-
|
|
2574
|
+
pt.value = {}, mt.value = {}, Wt.value?.measure();
|
|
2575
|
+
}), K(() => s.rows, (e) => {
|
|
2576
|
+
let t = new Set(e.map(Y.rowId)), n = (e) => Object.fromEntries(Object.entries(e).filter(([e]) => t.has(e)));
|
|
2577
|
+
Object.keys(pt.value).some((e) => !t.has(e)) && (pt.value = n(pt.value)), Object.keys(mt.value).some((e) => !t.has(e)) && (mt.value = n(mt.value));
|
|
2578
|
+
}), K(hn, (e) => {
|
|
2579
|
+
l("selection-change", e), e.length && (Qe.value = d.t("selection.selected", { count: e.length }));
|
|
2728
2580
|
});
|
|
2729
|
-
let
|
|
2730
|
-
let n = { ...
|
|
2731
|
-
t ? n[e] = !0 : delete n[e],
|
|
2732
|
-
let t =
|
|
2733
|
-
t && (
|
|
2734
|
-
label:
|
|
2581
|
+
let vn = (e, t) => {
|
|
2582
|
+
let n = { ...mt.value };
|
|
2583
|
+
t ? n[e] = !0 : delete n[e], mt.value = n, t && we(() => {
|
|
2584
|
+
let t = s.rows.find((t) => Y.rowId(t) === e), n = [...(Wt.value?.$el)?.querySelectorAll(".dt-subrow") ?? []].find((t) => t.id.endsWith(`-sub-${e}`));
|
|
2585
|
+
t && (Qe.value = d.t("sr.expanded", {
|
|
2586
|
+
label: fn(t),
|
|
2735
2587
|
count: n ? n.querySelectorAll("[role=\"row\"], tr").length : 0
|
|
2736
2588
|
}));
|
|
2737
2589
|
});
|
|
2738
|
-
},
|
|
2739
|
-
if (
|
|
2590
|
+
}, yn = (e, t) => {
|
|
2591
|
+
if (l("row-click", {
|
|
2740
2592
|
row: e,
|
|
2741
2593
|
event: t
|
|
2742
|
-
}),
|
|
2743
|
-
else if (
|
|
2744
|
-
let t =
|
|
2745
|
-
|
|
2594
|
+
}), s.rowClick === "open") t.target?.closest(".dt-row")?.querySelector(".dt-cell.is-primary a.dt-link")?.click();
|
|
2595
|
+
else if (s.rowClick === "expand" && ht.value && (gt.value?.(e) ?? !0)) {
|
|
2596
|
+
let t = Y.rowId(e);
|
|
2597
|
+
vn(t, !mt.value[t]);
|
|
2746
2598
|
}
|
|
2747
|
-
},
|
|
2599
|
+
}, bn = (e, t) => l("row-open", {
|
|
2748
2600
|
row: e,
|
|
2749
|
-
href:
|
|
2601
|
+
href: dn(e) ?? "",
|
|
2750
2602
|
event: t
|
|
2751
|
-
}),
|
|
2752
|
-
navigator.clipboard?.writeText(
|
|
2753
|
-
},
|
|
2754
|
-
query:
|
|
2755
|
-
visibleColumns:
|
|
2756
|
-
}),
|
|
2603
|
+
}), xn = z(null), Sn, Cn = (e) => {
|
|
2604
|
+
navigator.clipboard?.writeText(fn(e)), xn.value = d.t("cell.copied"), clearTimeout(Sn), Sn = setTimeout(() => xn.value = null, 2e3);
|
|
2605
|
+
}, wn = () => l("print", {
|
|
2606
|
+
query: Xe(),
|
|
2607
|
+
visibleColumns: We.value
|
|
2608
|
+
}), Tn = () => void navigator.clipboard?.writeText(Mt.value.id ?? ""), En = (e) => {
|
|
2757
2609
|
if (e.defaultPrevented) return;
|
|
2758
|
-
let t = e.target instanceof Element ? e.target : null;
|
|
2610
|
+
let t = e.target instanceof Element ? e.target : null, n = !!t && _e(t) && !(t instanceof HTMLInputElement && t.type === "checkbox");
|
|
2759
2611
|
if (e.key === "Escape") {
|
|
2760
|
-
let
|
|
2761
|
-
!e.defaultPrevented && !
|
|
2612
|
+
let r = !!t?.closest("[role=\"menu\"], [role=\"dialog\"], [role=\"alertdialog\"], [role=\"listbox\"], .dt-pop");
|
|
2613
|
+
!e.defaultPrevented && !r && hn.value.length && !n && gn();
|
|
2762
2614
|
} else if (e.altKey && !e.ctrlKey && !e.metaKey && (e.key === "ArrowLeft" || e.key === "ArrowRight")) {
|
|
2763
|
-
if (
|
|
2764
|
-
let t = e.key === "ArrowLeft" ?
|
|
2765
|
-
t >= 1 && (e.key === "ArrowLeft" ||
|
|
2615
|
+
if (At.value) return;
|
|
2616
|
+
let t = e.key === "ArrowLeft" ? T.value.number - 1 : T.value.number + 1;
|
|
2617
|
+
t >= 1 && (e.key === "ArrowLeft" || Rt.value) && (e.preventDefault(), E(t));
|
|
2766
2618
|
} else if ((e.metaKey || e.ctrlKey) && !e.altKey && !e.shiftKey && (e.key === "s" || e.key === "S")) {
|
|
2767
|
-
if (!
|
|
2768
|
-
e.preventDefault(),
|
|
2769
|
-
} else !
|
|
2619
|
+
if (!s.shortcuts || !J.edited.value || !u.viewsAdapter || at.value) return;
|
|
2620
|
+
e.preventDefault(), J.writable(J.active.value) ? J.saveChanges() : ct();
|
|
2621
|
+
} else !s.shortcuts || e.ctrlKey || e.metaKey || e.altKey || n || (e.key === "/" && Xt.value ? (e.preventDefault(), tn.value?.focusSearch()) : (e.key === "f" || e.key === "F") && W.value ? (e.preventDefault(), b.value ? He.value?.show() : I.value = !0) : (e.key === "r" || e.key === "R") && m("onRequest") ? (e.preventDefault(), X.refresh()) : (e.key === "v" || e.key === "V") && J.hasViews.value && s.toolbar === "auto" && (e.preventDefault(), nt.value = !0));
|
|
2770
2622
|
};
|
|
2771
|
-
|
|
2772
|
-
window.removeEventListener("keydown",
|
|
2773
|
-
}),
|
|
2774
|
-
Q.value || (
|
|
2775
|
-
}),
|
|
2623
|
+
De(() => window.addEventListener("keydown", En)), Ee(() => {
|
|
2624
|
+
window.removeEventListener("keydown", En), le?.disconnect(), clearTimeout(Tt), clearTimeout(kt), clearInterval(Jt), clearTimeout(Sn), Bt?.abort();
|
|
2625
|
+
}), K(() => xt.value.length, (e) => {
|
|
2626
|
+
Q.value || (Qe.value = d.t("sr.loaded", { count: e }));
|
|
2627
|
+
}), K(X.updatedAt, () => Qe.value = d.t("sr.loaded", { count: xt.value.length })), K(w, (e) => {
|
|
2776
2628
|
let t = e[0];
|
|
2777
|
-
t && (
|
|
2629
|
+
t && (Qe.value = d.t("sr.sorted", {
|
|
2778
2630
|
column: Z(t.column),
|
|
2779
|
-
dir:
|
|
2631
|
+
dir: d.t(t.dir === "asc" ? "sr.asc" : "sr.desc")
|
|
2780
2632
|
}));
|
|
2781
|
-
}),
|
|
2782
|
-
e === "error" && (
|
|
2633
|
+
}), K(X.errorKind, (e) => {
|
|
2634
|
+
e === "error" && ($e.value = `${d.t("state.errorTitle", { entity: g.value })} ${d.t("state.tryAgain")}`);
|
|
2783
2635
|
});
|
|
2784
|
-
let
|
|
2785
|
-
return
|
|
2636
|
+
let Dn = ie(y);
|
|
2637
|
+
return t({
|
|
2786
2638
|
refresh: X.refresh,
|
|
2787
|
-
clearSelection:
|
|
2788
|
-
}), (
|
|
2639
|
+
clearSelection: gn
|
|
2640
|
+
}), (t, n) => (R(), M("div", {
|
|
2789
2641
|
ref_key: "rootEl",
|
|
2790
|
-
ref:
|
|
2791
|
-
class:
|
|
2792
|
-
"data-density":
|
|
2642
|
+
ref: y,
|
|
2643
|
+
class: L(["dt dt-list", { "is-phone": b.value }]),
|
|
2644
|
+
"data-density": he.value
|
|
2793
2645
|
}, [
|
|
2794
|
-
|
|
2646
|
+
e.selectionBar === "toolbar" && G(hn).length && e.toolbar !== !1 ? (R(), A(ei, {
|
|
2795
2647
|
key: 0,
|
|
2796
2648
|
variant: "toolbar",
|
|
2797
|
-
rows:
|
|
2798
|
-
actions:
|
|
2799
|
-
onClear:
|
|
2649
|
+
rows: G(hn),
|
|
2650
|
+
actions: e.bulkActions ?? [],
|
|
2651
|
+
onClear: gn
|
|
2800
2652
|
}, {
|
|
2801
|
-
default:
|
|
2802
|
-
rows:
|
|
2803
|
-
clear:
|
|
2804
|
-
}, void 0, void 0, 0) :
|
|
2653
|
+
default: q(() => [t.$slots["selection-actions"] ? V(t.$slots, "selection-actions", {
|
|
2654
|
+
rows: G(hn),
|
|
2655
|
+
clear: gn
|
|
2656
|
+
}, void 0, void 0, 0) : j("", !0)]),
|
|
2805
2657
|
_: 3
|
|
2806
|
-
}, 8, ["rows", "actions"])) :
|
|
2658
|
+
}, 8, ["rows", "actions"])) : e.toolbar === !1 ? j("", !0) : (R(), A(Qn, {
|
|
2807
2659
|
key: 1,
|
|
2808
2660
|
ref_key: "toolbarRef",
|
|
2809
|
-
ref:
|
|
2810
|
-
size:
|
|
2811
|
-
search:
|
|
2812
|
-
"search-placeholder":
|
|
2813
|
-
"has-filter":
|
|
2814
|
-
"has-display":
|
|
2815
|
-
"has-more":
|
|
2816
|
-
"onUpdate:search":
|
|
2817
|
-
},
|
|
2818
|
-
filter:
|
|
2661
|
+
ref: tn,
|
|
2662
|
+
size: se.value,
|
|
2663
|
+
search: Xt.value ? C.value : null,
|
|
2664
|
+
"search-placeholder": en.value,
|
|
2665
|
+
"has-filter": W.value,
|
|
2666
|
+
"has-display": Zt.value,
|
|
2667
|
+
"has-more": $t.value,
|
|
2668
|
+
"onUpdate:search": ve
|
|
2669
|
+
}, ye({
|
|
2670
|
+
filter: q(({ iconOnly: t, phone: r }) => [r ? (R(), M("button", {
|
|
2819
2671
|
key: 0,
|
|
2820
2672
|
type: "button",
|
|
2821
|
-
class:
|
|
2822
|
-
"aria-label":
|
|
2823
|
-
onClick:
|
|
2824
|
-
}, [
|
|
2673
|
+
class: L(["dt-btn dt-btn-icon dt-filter-trigger", { "is-active": H.value.length }]),
|
|
2674
|
+
"aria-label": G(d).t("toolbar.filter"),
|
|
2675
|
+
onClick: n[7] ||= (e) => He.value?.show()
|
|
2676
|
+
}, [F(G(Ye), {
|
|
2825
2677
|
size: 20,
|
|
2826
2678
|
"aria-hidden": "true"
|
|
2827
|
-
}),
|
|
2679
|
+
}), H.value.length ? (R(), M("span", Mi, U(H.value.length), 1)) : j("", !0)], 10, ji)) : (R(), A(Kt, {
|
|
2828
2680
|
key: 1,
|
|
2829
|
-
open:
|
|
2830
|
-
"onUpdate:open":
|
|
2831
|
-
columns:
|
|
2832
|
-
chips:
|
|
2833
|
-
onPick:
|
|
2681
|
+
open: I.value,
|
|
2682
|
+
"onUpdate:open": n[8] ||= (e) => I.value = e,
|
|
2683
|
+
columns: e.columns,
|
|
2684
|
+
chips: D.value,
|
|
2685
|
+
onPick: Fe
|
|
2834
2686
|
}, {
|
|
2835
|
-
trigger:
|
|
2687
|
+
trigger: q(() => [N("button", {
|
|
2836
2688
|
type: "button",
|
|
2837
|
-
class:
|
|
2838
|
-
"is-active":
|
|
2839
|
-
"dt-btn-icon":
|
|
2689
|
+
class: L(["dt-btn has-icon dt-filter-trigger", {
|
|
2690
|
+
"is-active": H.value.length,
|
|
2691
|
+
"dt-btn-icon": t && !H.value.length
|
|
2840
2692
|
}]),
|
|
2841
|
-
"aria-label":
|
|
2693
|
+
"aria-label": t ? G(d).t("toolbar.filter") : void 0
|
|
2842
2694
|
}, [
|
|
2843
|
-
|
|
2695
|
+
F(G(Ye), {
|
|
2844
2696
|
size: 16,
|
|
2845
2697
|
"aria-hidden": "true"
|
|
2846
2698
|
}),
|
|
2847
|
-
|
|
2848
|
-
|
|
2699
|
+
t ? j("", !0) : (R(), M("span", Pi, U(G(d).t("toolbar.filter")), 1)),
|
|
2700
|
+
H.value.length ? (R(), M("span", Fi, U(H.value.length), 1)) : j("", !0)
|
|
2849
2701
|
], 10, Ni)]),
|
|
2850
2702
|
_: 2
|
|
2851
2703
|
}, 1032, [
|
|
@@ -2853,20 +2705,23 @@ var Ai = ["data-density"], ji = ["aria-label"], Mi = {
|
|
|
2853
2705
|
"columns",
|
|
2854
2706
|
"chips"
|
|
2855
2707
|
]))]),
|
|
2856
|
-
display:
|
|
2857
|
-
more:
|
|
2858
|
-
density:
|
|
2859
|
-
columns:
|
|
2860
|
-
counts:
|
|
2861
|
-
sort:
|
|
2862
|
-
persistent:
|
|
2863
|
-
"auto-refresh-on":
|
|
2864
|
-
},
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2708
|
+
display: q(({ iconOnly: e }) => [F(re, Ce(nn.value, { "icon-only": e }, Ae(rn), { "onUpdate:verticalLines": n[9] ||= (e) => G(x).set({ verticalLines: e }) }), null, 16, ["icon-only"])]),
|
|
2709
|
+
more: q(({ phone: e }) => [e ? (R(), A(G(o), Ce({ key: 0 }, Qt.value, {
|
|
2710
|
+
density: he.value,
|
|
2711
|
+
columns: G(S).panel.value,
|
|
2712
|
+
counts: G(S).counts.value,
|
|
2713
|
+
sort: w.value,
|
|
2714
|
+
persistent: G(x).persistent,
|
|
2715
|
+
"auto-refresh-on": qt.value
|
|
2716
|
+
}, Ae({
|
|
2717
|
+
...rn,
|
|
2718
|
+
...an
|
|
2719
|
+
}), {
|
|
2720
|
+
"onUpdate:autoRefreshOn": n[10] ||= (e) => qt.value = e,
|
|
2721
|
+
onRefresh: n[11] ||= (e) => G(X).refresh(),
|
|
2722
|
+
onExport: ln,
|
|
2723
|
+
onImport: n[12] ||= (e) => l("import"),
|
|
2724
|
+
onPrint: wn
|
|
2870
2725
|
}), null, 16, [
|
|
2871
2726
|
"density",
|
|
2872
2727
|
"columns",
|
|
@@ -2874,37 +2729,37 @@ var Ai = ["data-density"], ji = ["aria-label"], Mi = {
|
|
|
2874
2729
|
"sort",
|
|
2875
2730
|
"persistent",
|
|
2876
2731
|
"auto-refresh-on"
|
|
2877
|
-
])) : (
|
|
2878
|
-
"auto-refresh-on":
|
|
2879
|
-
"onUpdate:autoRefreshOn":
|
|
2880
|
-
onRefresh:
|
|
2881
|
-
onExport:
|
|
2882
|
-
onImport:
|
|
2883
|
-
onPrint:
|
|
2732
|
+
])) : (R(), A(Gn, Ce({ key: 1 }, Qt.value, {
|
|
2733
|
+
"auto-refresh-on": qt.value,
|
|
2734
|
+
"onUpdate:autoRefreshOn": n[13] ||= (e) => qt.value = e,
|
|
2735
|
+
onRefresh: n[14] ||= (e) => G(X).refresh(),
|
|
2736
|
+
onExport: ln,
|
|
2737
|
+
onImport: n[15] ||= (e) => l("import"),
|
|
2738
|
+
onPrint: wn
|
|
2884
2739
|
}), null, 16, ["auto-refresh-on"]))]),
|
|
2885
2740
|
_: 2
|
|
2886
|
-
}, [
|
|
2741
|
+
}, [G(J).hasViews.value && e.toolbar === "auto" ? {
|
|
2887
2742
|
name: "view",
|
|
2888
|
-
fn:
|
|
2889
|
-
open:
|
|
2890
|
-
"onUpdate:open":
|
|
2891
|
-
sections:
|
|
2892
|
-
active:
|
|
2893
|
-
edited:
|
|
2894
|
-
"has-draft":
|
|
2895
|
-
"default-id":
|
|
2896
|
-
"can-save": !!
|
|
2897
|
-
"can-write":
|
|
2898
|
-
sheet:
|
|
2899
|
-
onSelect:
|
|
2900
|
-
onSaveChanges:
|
|
2901
|
-
onSaveAs:
|
|
2902
|
-
onDiscard:
|
|
2903
|
-
onNew:
|
|
2904
|
-
onRename:
|
|
2905
|
-
onDuplicate:
|
|
2906
|
-
onSetDefault:
|
|
2907
|
-
onDelete:
|
|
2743
|
+
fn: q(() => [F(zr, {
|
|
2744
|
+
open: nt.value,
|
|
2745
|
+
"onUpdate:open": n[0] ||= (e) => nt.value = e,
|
|
2746
|
+
sections: G(J).sections.value,
|
|
2747
|
+
active: G(J).active.value,
|
|
2748
|
+
edited: G(J).edited.value,
|
|
2749
|
+
"has-draft": G(J).hasDraft,
|
|
2750
|
+
"default-id": G(x).prefs.defaultViewId,
|
|
2751
|
+
"can-save": !!G(u).viewsAdapter,
|
|
2752
|
+
"can-write": G(J).writable(G(J).active.value),
|
|
2753
|
+
sheet: b.value,
|
|
2754
|
+
onSelect: G(J).select,
|
|
2755
|
+
onSaveChanges: n[1] ||= (e) => G(J).saveChanges(),
|
|
2756
|
+
onSaveAs: n[2] ||= (e) => ct(),
|
|
2757
|
+
onDiscard: n[3] ||= (e) => G(J).discard(),
|
|
2758
|
+
onNew: n[4] ||= (e) => ct(),
|
|
2759
|
+
onRename: lt,
|
|
2760
|
+
onDuplicate: ct,
|
|
2761
|
+
onSetDefault: n[5] ||= (e) => G(x).set({ defaultViewId: e }),
|
|
2762
|
+
onDelete: n[6] ||= (e) => st.value = e
|
|
2908
2763
|
}, null, 8, [
|
|
2909
2764
|
"open",
|
|
2910
2765
|
"sections",
|
|
@@ -2918,9 +2773,9 @@ var Ai = ["data-density"], ji = ["aria-label"], Mi = {
|
|
|
2918
2773
|
"onSelect"
|
|
2919
2774
|
])]),
|
|
2920
2775
|
key: "0"
|
|
2921
|
-
} : void 0,
|
|
2776
|
+
} : void 0, t.$slots["toolbar-end"] ? {
|
|
2922
2777
|
name: "end",
|
|
2923
|
-
fn:
|
|
2778
|
+
fn: q(({ compact: e }) => [V(t.$slots, "toolbar-end", { compact: e })]),
|
|
2924
2779
|
key: "1"
|
|
2925
2780
|
} : void 0]), 1032, [
|
|
2926
2781
|
"size",
|
|
@@ -2930,31 +2785,31 @@ var Ai = ["data-density"], ji = ["aria-label"], Mi = {
|
|
|
2930
2785
|
"has-display",
|
|
2931
2786
|
"has-more"
|
|
2932
2787
|
])),
|
|
2933
|
-
|
|
2788
|
+
D.value.length ? (R(), A(mn, {
|
|
2934
2789
|
key: 2,
|
|
2935
|
-
chips:
|
|
2936
|
-
defs:
|
|
2937
|
-
editing:
|
|
2938
|
-
rows:
|
|
2939
|
-
labels:
|
|
2940
|
-
"summary-of":
|
|
2941
|
-
"currencies-of":
|
|
2942
|
-
phone:
|
|
2943
|
-
onOpen:
|
|
2944
|
-
"onUpdate:chip":
|
|
2945
|
-
onRemove:
|
|
2946
|
-
"onUpdate:editing":
|
|
2947
|
-
onClearAll:
|
|
2790
|
+
chips: D.value,
|
|
2791
|
+
defs: B.value,
|
|
2792
|
+
editing: O.value,
|
|
2793
|
+
rows: e.rows,
|
|
2794
|
+
labels: G(Se),
|
|
2795
|
+
"summary-of": Ne,
|
|
2796
|
+
"currencies-of": Pe,
|
|
2797
|
+
phone: b.value,
|
|
2798
|
+
onOpen: n[16] ||= (e) => He.value?.show(e),
|
|
2799
|
+
"onUpdate:chip": Le,
|
|
2800
|
+
onRemove: ze,
|
|
2801
|
+
"onUpdate:editing": Be,
|
|
2802
|
+
onClearAll: Ve
|
|
2948
2803
|
}, {
|
|
2949
|
-
add:
|
|
2950
|
-
columns:
|
|
2951
|
-
chips:
|
|
2952
|
-
onPick:
|
|
2804
|
+
add: q(() => [F(Kt, {
|
|
2805
|
+
columns: e.columns,
|
|
2806
|
+
chips: D.value,
|
|
2807
|
+
onPick: Fe
|
|
2953
2808
|
}, {
|
|
2954
|
-
trigger:
|
|
2809
|
+
trigger: q(() => [N("button", Ii, [F(G(Ze), {
|
|
2955
2810
|
size: 14,
|
|
2956
2811
|
"aria-hidden": "true"
|
|
2957
|
-
}),
|
|
2812
|
+
}), P(" " + U(G(d).t("filter.addFilter")), 1)])]),
|
|
2958
2813
|
_: 1
|
|
2959
2814
|
}, 8, ["columns", "chips"])]),
|
|
2960
2815
|
_: 1
|
|
@@ -2965,155 +2820,155 @@ var Ai = ["data-density"], ji = ["aria-label"], Mi = {
|
|
|
2965
2820
|
"rows",
|
|
2966
2821
|
"labels",
|
|
2967
2822
|
"phone"
|
|
2968
|
-
])) :
|
|
2969
|
-
|
|
2823
|
+
])) : j("", !0),
|
|
2824
|
+
b.value && W.value ? (R(), A(G(r), {
|
|
2970
2825
|
key: 3,
|
|
2971
2826
|
ref_key: "filtersSheet",
|
|
2972
|
-
ref:
|
|
2973
|
-
columns:
|
|
2974
|
-
chips:
|
|
2975
|
-
sort:
|
|
2976
|
-
rows:
|
|
2977
|
-
labels:
|
|
2978
|
-
"summary-of":
|
|
2979
|
-
"currencies-of":
|
|
2980
|
-
onApply:
|
|
2827
|
+
ref: He,
|
|
2828
|
+
columns: e.columns,
|
|
2829
|
+
chips: D.value,
|
|
2830
|
+
sort: w.value,
|
|
2831
|
+
rows: e.rows,
|
|
2832
|
+
labels: G(Se),
|
|
2833
|
+
"summary-of": Ne,
|
|
2834
|
+
"currencies-of": Pe,
|
|
2835
|
+
onApply: Ue
|
|
2981
2836
|
}, null, 8, [
|
|
2982
2837
|
"columns",
|
|
2983
2838
|
"chips",
|
|
2984
2839
|
"sort",
|
|
2985
2840
|
"rows",
|
|
2986
2841
|
"labels"
|
|
2987
|
-
])) :
|
|
2988
|
-
|
|
2989
|
-
|
|
2842
|
+
])) : j("", !0),
|
|
2843
|
+
G(X).errorKind.value === "stale" && G(X).updatedAt.value ? (R(), M("div", Li, [
|
|
2844
|
+
F(G(et), {
|
|
2990
2845
|
size: 16,
|
|
2991
2846
|
"aria-hidden": "true"
|
|
2992
2847
|
}),
|
|
2993
|
-
|
|
2994
|
-
|
|
2848
|
+
N("span", null, U(G(d).t("state.stale", { time: Pt(G(X).updatedAt.value) })), 1),
|
|
2849
|
+
N("button", {
|
|
2995
2850
|
type: "button",
|
|
2996
2851
|
class: "dt-strip-action",
|
|
2997
|
-
disabled:
|
|
2998
|
-
onClick:
|
|
2999
|
-
}, G(
|
|
3000
|
-
])) :
|
|
3001
|
-
|
|
2852
|
+
disabled: G(Q),
|
|
2853
|
+
onClick: n[17] ||= (e) => G(X).retry()
|
|
2854
|
+
}, U(G(d).t("common.retry")), 9, Ri)
|
|
2855
|
+
])) : j("", !0),
|
|
2856
|
+
F(Hn, {
|
|
3002
2857
|
ref_key: "grid",
|
|
3003
|
-
ref:
|
|
3004
|
-
layout:
|
|
3005
|
-
rows:
|
|
3006
|
-
density:
|
|
3007
|
-
label:
|
|
3008
|
-
loading:
|
|
3009
|
-
skeleton:
|
|
3010
|
-
dim:
|
|
3011
|
-
refreshing:
|
|
3012
|
-
"vertical-lines":
|
|
3013
|
-
"row-count":
|
|
3014
|
-
"row-index-offset": (
|
|
3015
|
-
sort:
|
|
3016
|
-
"filtered-columns":
|
|
3017
|
-
labels:
|
|
2858
|
+
ref: Wt,
|
|
2859
|
+
layout: G(S),
|
|
2860
|
+
rows: xt.value,
|
|
2861
|
+
density: he.value,
|
|
2862
|
+
label: ne.value,
|
|
2863
|
+
loading: G(Q) || !!e.loading,
|
|
2864
|
+
skeleton: Et.value,
|
|
2865
|
+
dim: Ct.value,
|
|
2866
|
+
refreshing: Ot.value,
|
|
2867
|
+
"vertical-lines": G(x).prefs.verticalLines,
|
|
2868
|
+
"row-count": zt.value ?? -1,
|
|
2869
|
+
"row-index-offset": (Lt.value.number - 1) * Lt.value.size,
|
|
2870
|
+
sort: yt.value,
|
|
2871
|
+
"filtered-columns": je.value,
|
|
2872
|
+
labels: G(Se),
|
|
3018
2873
|
sortable: "",
|
|
3019
|
-
selectable:
|
|
3020
|
-
selection:
|
|
3021
|
-
expandable:
|
|
3022
|
-
expanded:
|
|
3023
|
-
"can-expand":
|
|
3024
|
-
"row-menu":
|
|
3025
|
-
"row-actions":
|
|
3026
|
-
"row-error":
|
|
3027
|
-
"primary-href":
|
|
3028
|
-
"primary-label":
|
|
3029
|
-
"primary-header":
|
|
3030
|
-
phone:
|
|
3031
|
-
onHeaderFilter:
|
|
3032
|
-
onRowClick:
|
|
3033
|
-
onRowOpen:
|
|
3034
|
-
onSelectRows:
|
|
3035
|
-
onSelectPage:
|
|
3036
|
-
onToggleExpand:
|
|
3037
|
-
onCopyId:
|
|
3038
|
-
onSort:
|
|
3039
|
-
onSortSet:
|
|
3040
|
-
},
|
|
3041
|
-
|
|
2874
|
+
selectable: e.selectable,
|
|
2875
|
+
selection: pt.value,
|
|
2876
|
+
expandable: ht.value,
|
|
2877
|
+
expanded: mt.value,
|
|
2878
|
+
"can-expand": gt.value,
|
|
2879
|
+
"row-menu": pn.value,
|
|
2880
|
+
"row-actions": e.rowActions,
|
|
2881
|
+
"row-error": e.rowError,
|
|
2882
|
+
"primary-href": dn,
|
|
2883
|
+
"primary-label": fn,
|
|
2884
|
+
"primary-header": un.value?.header,
|
|
2885
|
+
phone: b.value,
|
|
2886
|
+
onHeaderFilter: Fe,
|
|
2887
|
+
onRowClick: n[22] ||= (e, t) => yn(e, t),
|
|
2888
|
+
onRowOpen: n[23] ||= (e, t) => bn(e, t),
|
|
2889
|
+
onSelectRows: _n,
|
|
2890
|
+
onSelectPage: G(Y).toggleAllPage,
|
|
2891
|
+
onToggleExpand: vn,
|
|
2892
|
+
onCopyId: n[24] ||= (e) => Cn(e),
|
|
2893
|
+
onSort: _t,
|
|
2894
|
+
onSortSet: vt
|
|
2895
|
+
}, ye({ _: 2 }, [
|
|
2896
|
+
G(X).stillLoading.value ? {
|
|
3042
2897
|
name: "notice",
|
|
3043
|
-
fn:
|
|
2898
|
+
fn: q(() => [F(G(qe), {
|
|
3044
2899
|
size: 14,
|
|
3045
2900
|
class: "dt-spin",
|
|
3046
2901
|
"aria-hidden": "true"
|
|
3047
|
-
}),
|
|
2902
|
+
}), P(" " + U(G(d).t("state.stillLoading")), 1)]),
|
|
3048
2903
|
key: "0"
|
|
3049
2904
|
} : void 0,
|
|
3050
|
-
|
|
2905
|
+
jt.value ? {
|
|
3051
2906
|
name: "state",
|
|
3052
|
-
fn:
|
|
2907
|
+
fn: q(() => [jt.value === "error" ? (R(), A(ue, {
|
|
3053
2908
|
key: 0,
|
|
3054
2909
|
kind: "error",
|
|
3055
|
-
title:
|
|
3056
|
-
lines: [
|
|
3057
|
-
},
|
|
3058
|
-
default:
|
|
2910
|
+
title: G(d).t("state.errorTitle", { entity: g.value }),
|
|
2911
|
+
lines: [Mt.value.message, G(d).t("state.errorKept")].filter((e) => !!e)
|
|
2912
|
+
}, ye({
|
|
2913
|
+
default: q(() => [m("onRequest") ? (R(), M("button", {
|
|
3059
2914
|
key: 0,
|
|
3060
2915
|
type: "button",
|
|
3061
2916
|
class: "dt-btn",
|
|
3062
|
-
disabled:
|
|
3063
|
-
onClick:
|
|
3064
|
-
}, G(
|
|
2917
|
+
disabled: G(Q),
|
|
2918
|
+
onClick: n[18] ||= (e) => G(X).retry()
|
|
2919
|
+
}, U(G(d).t("state.tryAgain")), 9, zi)) : j("", !0)]),
|
|
3065
2920
|
_: 2
|
|
3066
|
-
}, [
|
|
2921
|
+
}, [Mt.value.id ? {
|
|
3067
2922
|
name: "after",
|
|
3068
|
-
fn:
|
|
2923
|
+
fn: q(() => [N("div", Bi, [N("button", {
|
|
3069
2924
|
type: "button",
|
|
3070
2925
|
class: "dt-btn dt-btn-ghost dt-btn-xs",
|
|
3071
|
-
onClick:
|
|
3072
|
-
}, G(
|
|
2926
|
+
onClick: Tn
|
|
2927
|
+
}, U(G(d).t("state.copyErrorId")), 1), N("code", Vi, U(Mt.value.id), 1)])]),
|
|
3073
2928
|
key: "0"
|
|
3074
|
-
} : void 0]), 1032, ["title", "lines"])) :
|
|
2929
|
+
} : void 0]), 1032, ["title", "lines"])) : jt.value === "noResults" ? (R(), A(ue, {
|
|
3075
2930
|
key: 1,
|
|
3076
|
-
kind:
|
|
3077
|
-
title:
|
|
2931
|
+
kind: C.value ? "noResultsSearch" : "noResults",
|
|
2932
|
+
title: Nt.value
|
|
3078
2933
|
}, {
|
|
3079
|
-
default:
|
|
2934
|
+
default: q(() => [H.value.length === 1 ? (R(), M("button", {
|
|
3080
2935
|
key: 0,
|
|
3081
2936
|
type: "button",
|
|
3082
2937
|
class: "dt-btn",
|
|
3083
|
-
onClick:
|
|
3084
|
-
}, G(
|
|
2938
|
+
onClick: n[19] ||= (e) => ze(H.value[0].column)
|
|
2939
|
+
}, U(G(d).t("state.removeFilter", { column: Z(H.value[0].column) })), 1)) : H.value.length ? (R(), M("button", {
|
|
3085
2940
|
key: 1,
|
|
3086
2941
|
type: "button",
|
|
3087
2942
|
class: "dt-btn",
|
|
3088
|
-
onClick:
|
|
3089
|
-
}, G(
|
|
2943
|
+
onClick: Ve
|
|
2944
|
+
}, U(G(d).t("state.clearAllFilters")), 1)) : j("", !0), C.value ? (R(), M("button", {
|
|
3090
2945
|
key: 2,
|
|
3091
2946
|
type: "button",
|
|
3092
2947
|
class: "dt-btn",
|
|
3093
|
-
onClick:
|
|
3094
|
-
}, G(
|
|
2948
|
+
onClick: n[20] ||= (e) => ve("")
|
|
2949
|
+
}, U(G(d).t("state.clearSearch")), 1)) : j("", !0)]),
|
|
3095
2950
|
_: 1
|
|
3096
|
-
}, 8, ["kind", "title"])) :
|
|
2951
|
+
}, 8, ["kind", "title"])) : jt.value === "noRowsOnPage" ? (R(), A(ue, {
|
|
3097
2952
|
key: 2,
|
|
3098
2953
|
kind: "noRowsOnPage",
|
|
3099
|
-
title:
|
|
2954
|
+
title: G(d).t("page.noneOnPage")
|
|
3100
2955
|
}, {
|
|
3101
|
-
default:
|
|
2956
|
+
default: q(() => [N("button", {
|
|
3102
2957
|
type: "button",
|
|
3103
2958
|
class: "dt-btn",
|
|
3104
|
-
onClick:
|
|
3105
|
-
}, G(
|
|
2959
|
+
onClick: n[21] ||= (e) => E(T.value.number - 1)
|
|
2960
|
+
}, U(G(d).t("page.previousPage")), 1)]),
|
|
3106
2961
|
_: 1
|
|
3107
|
-
}, 8, ["title"])) :
|
|
2962
|
+
}, 8, ["title"])) : V(t.$slots, "empty", {}, () => [F(ue, {
|
|
3108
2963
|
kind: "empty",
|
|
3109
|
-
title:
|
|
2964
|
+
title: G(d).t("state.emptyTitle", { entity: g.value })
|
|
3110
2965
|
}, null, 8, ["title"])], void 0, 3)]),
|
|
3111
2966
|
key: "1"
|
|
3112
2967
|
} : void 0,
|
|
3113
|
-
|
|
2968
|
+
t.$slots.expanded ? {
|
|
3114
2969
|
name: "expanded",
|
|
3115
|
-
fn:
|
|
3116
|
-
row:
|
|
2970
|
+
fn: q(({ row: e, close: n }) => [V(t.$slots, "expanded", {
|
|
2971
|
+
row: e,
|
|
3117
2972
|
close: n
|
|
3118
2973
|
})]),
|
|
3119
2974
|
key: "2"
|
|
@@ -3145,52 +3000,52 @@ var Ai = ["data-density"], ji = ["aria-label"], Mi = {
|
|
|
3145
3000
|
"phone",
|
|
3146
3001
|
"onSelectPage"
|
|
3147
3002
|
]),
|
|
3148
|
-
|
|
3003
|
+
e.selectionBar === "floating" && G(hn).length ? (R(), A(ei, {
|
|
3149
3004
|
key: 5,
|
|
3150
3005
|
variant: "floating",
|
|
3151
|
-
phone:
|
|
3152
|
-
rows:
|
|
3153
|
-
actions:
|
|
3154
|
-
onClear:
|
|
3006
|
+
phone: b.value,
|
|
3007
|
+
rows: G(hn),
|
|
3008
|
+
actions: e.bulkActions ?? [],
|
|
3009
|
+
onClear: gn
|
|
3155
3010
|
}, {
|
|
3156
|
-
default:
|
|
3157
|
-
rows:
|
|
3158
|
-
clear:
|
|
3159
|
-
}, void 0, void 0, 0) :
|
|
3011
|
+
default: q(() => [t.$slots["selection-actions"] ? V(t.$slots, "selection-actions", {
|
|
3012
|
+
rows: G(hn),
|
|
3013
|
+
clear: gn
|
|
3014
|
+
}, void 0, void 0, 0) : j("", !0)]),
|
|
3160
3015
|
_: 3
|
|
3161
3016
|
}, 8, [
|
|
3162
3017
|
"phone",
|
|
3163
3018
|
"rows",
|
|
3164
3019
|
"actions"
|
|
3165
|
-
])) :
|
|
3166
|
-
|
|
3020
|
+
])) : j("", !0),
|
|
3021
|
+
xn.value ? (R(), M("div", {
|
|
3167
3022
|
key: 6,
|
|
3168
|
-
class:
|
|
3023
|
+
class: L(["dt-toast", { "is-raised": e.selectionBar === "floating" && G(hn).length }]),
|
|
3169
3024
|
role: "status"
|
|
3170
|
-
}, [
|
|
3025
|
+
}, [F(G(Ke), {
|
|
3171
3026
|
size: 16,
|
|
3172
3027
|
"aria-hidden": "true"
|
|
3173
|
-
}),
|
|
3174
|
-
|
|
3175
|
-
"row-count":
|
|
3176
|
-
page:
|
|
3177
|
-
"has-more":
|
|
3178
|
-
total:
|
|
3179
|
-
countable:
|
|
3180
|
-
counting:
|
|
3181
|
-
"counted-at":
|
|
3182
|
-
busy:
|
|
3183
|
-
"first-load":
|
|
3184
|
-
empty:
|
|
3185
|
-
"page-sizes":
|
|
3186
|
-
"updated-at":
|
|
3187
|
-
freshness:
|
|
3188
|
-
"can-refresh":
|
|
3189
|
-
phone:
|
|
3190
|
-
onCount:
|
|
3191
|
-
onPage:
|
|
3192
|
-
onPageSize:
|
|
3193
|
-
onRefresh:
|
|
3028
|
+
}), P(" " + U(xn.value), 1)], 2)) : j("", !0),
|
|
3029
|
+
F(Si, {
|
|
3030
|
+
"row-count": It.value,
|
|
3031
|
+
page: Lt.value,
|
|
3032
|
+
"has-more": Rt.value,
|
|
3033
|
+
total: zt.value,
|
|
3034
|
+
countable: h.value && e.countable && m("onCount"),
|
|
3035
|
+
counting: Vt.value,
|
|
3036
|
+
"counted-at": Ht.value,
|
|
3037
|
+
busy: At.value,
|
|
3038
|
+
"first-load": Et.value && !$.value,
|
|
3039
|
+
empty: jt.value === "empty",
|
|
3040
|
+
"page-sizes": e.pageSizes,
|
|
3041
|
+
"updated-at": m("onRequest") ? G(X).updatedAt.value : null,
|
|
3042
|
+
freshness: Yt.value,
|
|
3043
|
+
"can-refresh": m("onRequest"),
|
|
3044
|
+
phone: b.value,
|
|
3045
|
+
onCount: Ut,
|
|
3046
|
+
onPage: E,
|
|
3047
|
+
onPageSize: Gt,
|
|
3048
|
+
onRefresh: n[25] ||= (e) => G(X).refresh()
|
|
3194
3049
|
}, null, 8, [
|
|
3195
3050
|
"row-count",
|
|
3196
3051
|
"page",
|
|
@@ -3208,36 +3063,36 @@ var Ai = ["data-density"], ji = ["aria-label"], Mi = {
|
|
|
3208
3063
|
"can-refresh",
|
|
3209
3064
|
"phone"
|
|
3210
3065
|
]),
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
class:
|
|
3066
|
+
N("span", Hi, U(Qe.value), 1),
|
|
3067
|
+
N("span", Ui, U($e.value), 1),
|
|
3068
|
+
Re(N("div", {
|
|
3069
|
+
class: L(["dt-tip", { "is-multi": G(Dn).text.value.includes("\n") }]),
|
|
3215
3070
|
role: "tooltip",
|
|
3216
|
-
style:
|
|
3217
|
-
}, G(
|
|
3218
|
-
|
|
3071
|
+
style: Te(G(Dn).style.value)
|
|
3072
|
+
}, U(G(Dn).text.value), 7), [[Ie, G(Dn).open.value]]),
|
|
3073
|
+
at.value ? (R(), A(_r, {
|
|
3219
3074
|
key: 7,
|
|
3220
|
-
open:
|
|
3221
|
-
"onUpdate:open":
|
|
3222
|
-
mode:
|
|
3223
|
-
name:
|
|
3224
|
-
summary:
|
|
3225
|
-
validate:
|
|
3226
|
-
onSave:
|
|
3075
|
+
open: ot.value,
|
|
3076
|
+
"onUpdate:open": n[26] ||= (e) => ot.value = e,
|
|
3077
|
+
mode: at.value.mode,
|
|
3078
|
+
name: at.value.name,
|
|
3079
|
+
summary: at.value.summary,
|
|
3080
|
+
validate: ut,
|
|
3081
|
+
onSave: dt
|
|
3227
3082
|
}, null, 8, [
|
|
3228
3083
|
"open",
|
|
3229
3084
|
"mode",
|
|
3230
3085
|
"name",
|
|
3231
3086
|
"summary"
|
|
3232
|
-
])) :
|
|
3233
|
-
|
|
3234
|
-
open: !!
|
|
3235
|
-
title:
|
|
3236
|
-
body:
|
|
3237
|
-
"confirm-label":
|
|
3087
|
+
])) : j("", !0),
|
|
3088
|
+
F(fe, {
|
|
3089
|
+
open: !!st.value,
|
|
3090
|
+
title: G(d).t("views.delete.title", { name: st.value?.name ?? "" }),
|
|
3091
|
+
body: G(d).t("views.delete.body"),
|
|
3092
|
+
"confirm-label": G(d).t("views.delete"),
|
|
3238
3093
|
danger: "",
|
|
3239
|
-
"onUpdate:open":
|
|
3240
|
-
onConfirm:
|
|
3094
|
+
"onUpdate:open": n[27] ||= (e) => !e && (st.value = null),
|
|
3095
|
+
onConfirm: ft
|
|
3241
3096
|
}, null, 8, [
|
|
3242
3097
|
"open",
|
|
3243
3098
|
"title",
|
|
@@ -3326,6 +3181,6 @@ function Zi(e) {
|
|
|
3326
3181
|
};
|
|
3327
3182
|
}
|
|
3328
3183
|
//#endregion
|
|
3329
|
-
export {
|
|
3184
|
+
export { g as DATA_TABLE_KEY, Wi as DataTable, he as ME, s as createContext, h as createDataTable, o as createI18n, Zi as createLocalStoragePreferences, Xi as createLocalStorageViews, _ as useDataTableContext };
|
|
3330
3185
|
|
|
3331
3186
|
//# sourceMappingURL=index.js.map
|