@razaman2/reactive-view 0.2.0 → 0.2.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/dist/{Editor-BX8prqWt.mjs → Editor-DMCekNFl.mjs} +67 -67
- package/dist/{Editor-DKILsiST.js → Editor-JraAPAuW.js} +1 -1
- package/dist/{Label-ClklvtMk.js → Label-CkJjlfli.js} +1 -1
- package/dist/{Label-B63BpiJm.mjs → Label-DD9yGa7V.mjs} +8 -8
- package/dist/{Select-CqG647qR.js → Select-D8LFsK4R.js} +1 -1
- package/dist/{Select-CSA5Sk_b.mjs → Select-x96YoTl5.mjs} +56 -56
- package/dist/components.js +1 -1
- package/dist/components.mjs +257 -257
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +2 -2
- package/dist/src-BJaQUsvj.js +1 -0
- package/dist/{src-DgPt5VTg.mjs → src-DwXft6y4.mjs} +69 -64
- package/package.json +1 -1
- package/dist/src-CB2Ym95H.js +0 -1
package/dist/components.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { _ as e,
|
|
2
|
-
import { t as f } from "./Select-
|
|
3
|
-
import { t as p } from "./Label-
|
|
4
|
-
import { r as m, t as h } from "./Editor-
|
|
1
|
+
import { _ as e, b as t, c as n, f as r, g as i, i as a, l as o, m as s, n as c, r as l, t as u, v as d } from "./src-DwXft6y4.mjs";
|
|
2
|
+
import { t as f } from "./Select-x96YoTl5.mjs";
|
|
3
|
+
import { t as p } from "./Label-DD9yGa7V.mjs";
|
|
4
|
+
import { r as m, t as h } from "./Editor-DMCekNFl.mjs";
|
|
5
5
|
import g from "@razaman2/object-manager";
|
|
6
6
|
import _ from "@razaman2/data-manager";
|
|
7
7
|
import { Fragment as v, computed as y, createElementBlock as b, createElementVNode as x, createTextVNode as S, createVNode as C, h as w, markRaw as T, mergeProps as E, onBeforeMount as D, onBeforeUnmount as O, onMounted as k, openBlock as A, provide as j, reactive as M, ref as N, unref as P, watch as F, watchEffect as I } from "vue";
|
|
@@ -13,17 +13,17 @@ import W from "inputmask";
|
|
|
13
13
|
import { format as te, formatISO as ne, parse as G, parseISO as K } from "date-fns";
|
|
14
14
|
//#endregion
|
|
15
15
|
//#region src/components/Button.vue
|
|
16
|
-
var q =
|
|
16
|
+
var q = n({
|
|
17
17
|
modelName: "Button",
|
|
18
18
|
props: {
|
|
19
|
-
class:
|
|
20
|
-
buttonClass:
|
|
21
|
-
split:
|
|
22
|
-
options:
|
|
19
|
+
class: c(),
|
|
20
|
+
buttonClass: c(),
|
|
21
|
+
split: c({ type: Boolean }),
|
|
22
|
+
options: c({
|
|
23
23
|
type: Array,
|
|
24
24
|
default: []
|
|
25
25
|
}),
|
|
26
|
-
unstyled:
|
|
26
|
+
unstyled: c({ type: Boolean })
|
|
27
27
|
},
|
|
28
28
|
setup(e, t, n) {
|
|
29
29
|
return { template: () => {
|
|
@@ -54,24 +54,24 @@ function Y(e, t) {
|
|
|
54
54
|
var X = T({
|
|
55
55
|
name: "mdi-close",
|
|
56
56
|
render: Y
|
|
57
|
-
}), Z =
|
|
57
|
+
}), Z = n({
|
|
58
58
|
modelName: "CustomButton",
|
|
59
59
|
props: {
|
|
60
|
-
label:
|
|
61
|
-
tag:
|
|
60
|
+
label: c({ type: [Number, String] }),
|
|
61
|
+
tag: c({
|
|
62
62
|
type: String,
|
|
63
63
|
default: "button"
|
|
64
64
|
}),
|
|
65
|
-
loading:
|
|
65
|
+
loading: c({
|
|
66
66
|
type: [Boolean, Function],
|
|
67
67
|
default: !1
|
|
68
68
|
}),
|
|
69
|
-
padding:
|
|
69
|
+
padding: c({
|
|
70
70
|
type: Boolean,
|
|
71
71
|
default: !0
|
|
72
72
|
}),
|
|
73
|
-
buttonClass:
|
|
74
|
-
loadingClass:
|
|
73
|
+
buttonClass: c(),
|
|
74
|
+
loadingClass: c()
|
|
75
75
|
},
|
|
76
76
|
setup(e, t, n) {
|
|
77
77
|
let r = typeof n.loading == "function" ? n.loading : () => n.loading, i = N(!1);
|
|
@@ -93,10 +93,10 @@ var X = T({
|
|
|
93
93
|
}
|
|
94
94
|
};
|
|
95
95
|
}
|
|
96
|
-
}), re =
|
|
96
|
+
}), re = n({
|
|
97
97
|
modelName: "CustomModal",
|
|
98
98
|
props: {
|
|
99
|
-
title:
|
|
99
|
+
title: c({
|
|
100
100
|
type: [
|
|
101
101
|
Boolean,
|
|
102
102
|
Number,
|
|
@@ -104,63 +104,63 @@ var X = T({
|
|
|
104
104
|
],
|
|
105
105
|
default: "Modal Title"
|
|
106
106
|
}),
|
|
107
|
-
persistent:
|
|
108
|
-
header:
|
|
107
|
+
persistent: c({ type: Boolean }),
|
|
108
|
+
header: c({
|
|
109
109
|
type: Boolean,
|
|
110
110
|
default: !0
|
|
111
111
|
}),
|
|
112
|
-
actions:
|
|
112
|
+
actions: c({
|
|
113
113
|
type: Boolean,
|
|
114
114
|
default: !0
|
|
115
115
|
}),
|
|
116
|
-
ok:
|
|
116
|
+
ok: c({
|
|
117
117
|
type: Boolean,
|
|
118
118
|
default: !0
|
|
119
119
|
}),
|
|
120
|
-
cancel:
|
|
121
|
-
close:
|
|
120
|
+
cancel: c({ type: Boolean }),
|
|
121
|
+
close: c({
|
|
122
122
|
type: Boolean,
|
|
123
123
|
default: !0
|
|
124
124
|
}),
|
|
125
|
-
show:
|
|
125
|
+
show: c({
|
|
126
126
|
type: Boolean,
|
|
127
127
|
default: !0
|
|
128
128
|
}),
|
|
129
|
-
whenOk:
|
|
129
|
+
whenOk: c({
|
|
130
130
|
type: Function,
|
|
131
131
|
default: () => {}
|
|
132
132
|
}),
|
|
133
|
-
whenCancel:
|
|
133
|
+
whenCancel: c({
|
|
134
134
|
type: Function,
|
|
135
135
|
default: () => {}
|
|
136
136
|
}),
|
|
137
|
-
whenClose:
|
|
137
|
+
whenClose: c({
|
|
138
138
|
type: Function,
|
|
139
139
|
default: () => {}
|
|
140
140
|
}),
|
|
141
|
-
whenEscape:
|
|
141
|
+
whenEscape: c({
|
|
142
142
|
type: Function,
|
|
143
143
|
default: () => {}
|
|
144
144
|
}),
|
|
145
|
-
whenDismiss:
|
|
145
|
+
whenDismiss: c({
|
|
146
146
|
type: Function,
|
|
147
147
|
default: () => {}
|
|
148
148
|
}),
|
|
149
|
-
whenRouteChange:
|
|
149
|
+
whenRouteChange: c({
|
|
150
150
|
type: Function,
|
|
151
151
|
default: () => {}
|
|
152
152
|
}),
|
|
153
|
-
class:
|
|
154
|
-
headerClass:
|
|
155
|
-
titleClass:
|
|
156
|
-
actionsClass:
|
|
157
|
-
backdropClass:
|
|
158
|
-
timeout:
|
|
153
|
+
class: c(),
|
|
154
|
+
headerClass: c(),
|
|
155
|
+
titleClass: c(),
|
|
156
|
+
actionsClass: c(),
|
|
157
|
+
backdropClass: c(),
|
|
158
|
+
timeout: c({
|
|
159
159
|
default: !1,
|
|
160
160
|
validator: (e) => typeof e == "number" || e === !1
|
|
161
161
|
}),
|
|
162
|
-
modal:
|
|
163
|
-
id:
|
|
162
|
+
modal: c({ type: Boolean }),
|
|
163
|
+
id: c({ type: [Number, String] })
|
|
164
164
|
},
|
|
165
165
|
setup: (e, t, n) => {
|
|
166
166
|
j("dialog", e);
|
|
@@ -269,61 +269,61 @@ var X = T({
|
|
|
269
269
|
modalRef: r
|
|
270
270
|
};
|
|
271
271
|
}
|
|
272
|
-
}), ie =
|
|
272
|
+
}), ie = n({
|
|
273
273
|
cancel: !0,
|
|
274
274
|
titleClass: "text-left",
|
|
275
275
|
modelName: "ConfirmationModal",
|
|
276
276
|
title: (e, t) => a(t).confirmationTitle?.(),
|
|
277
277
|
slots: (e, t) => () => C(v, null, [C(B, null, null), C("div", { class: "pt-4 px-4 pb-8" }, [a(t).confirmationDescription()])]),
|
|
278
|
-
setup(e,
|
|
279
|
-
let
|
|
278
|
+
setup(e, t) {
|
|
279
|
+
let n = M({ status: !1 });
|
|
280
280
|
return {
|
|
281
281
|
confirmationTitle: () => "Confirm",
|
|
282
282
|
confirmationDescription: () => "Are you sure you sure?",
|
|
283
283
|
okButton: () => {
|
|
284
|
-
let e = a(
|
|
285
|
-
if (e) return C(q, E({ unstyled: !0 },
|
|
286
|
-
loading:
|
|
284
|
+
let e = a(t).okButton();
|
|
285
|
+
if (e) return C(q, E({ unstyled: !0 }, r(e.props, "class"), {
|
|
286
|
+
loading: n.status,
|
|
287
287
|
class: "h-8 normal-case! bg-white! text-(--colors-primary-500)! border-gray-200! rounded-lg! hover:bg-gray-50!",
|
|
288
288
|
label: "Continue"
|
|
289
289
|
}), e.children);
|
|
290
290
|
},
|
|
291
291
|
cancelButton: () => {
|
|
292
|
-
let e = a(
|
|
293
|
-
if (e) return C(q, E(
|
|
292
|
+
let e = a(t).cancelButton();
|
|
293
|
+
if (e) return C(q, E(r(e.props, "class"), {
|
|
294
294
|
unstyled: !0,
|
|
295
295
|
class: "h-8 -order-1 normal-case! bg-white! border-gray-200! text-gray-700! rounded-lg! hover:bg-gray-50! hover:text-gray-900!",
|
|
296
296
|
label: "Cancel"
|
|
297
297
|
}), e.children);
|
|
298
298
|
},
|
|
299
|
-
closeButton: () => t
|
|
299
|
+
closeButton: () => o(t).closeButton({
|
|
300
300
|
unstyled: !0,
|
|
301
301
|
buttonClass: "border border-gray-200 bg-white text-gray-400 hover:text-red-500 transition-all duration-500 rounded-md! -{btn}"
|
|
302
302
|
}, () => C(q, null, { icon: () => C(X, { class: "size-5" }, null) })),
|
|
303
303
|
triggerOk: () => s({
|
|
304
|
-
loading:
|
|
305
|
-
try: () => a(
|
|
304
|
+
loading: n,
|
|
305
|
+
try: () => a(t).triggerOk()
|
|
306
306
|
})
|
|
307
307
|
};
|
|
308
308
|
}
|
|
309
309
|
}, re), ae = {
|
|
310
310
|
props: {
|
|
311
|
-
setup:
|
|
312
|
-
title:
|
|
313
|
-
description:
|
|
314
|
-
close:
|
|
311
|
+
setup: t,
|
|
312
|
+
title: c({ type: String }),
|
|
313
|
+
description: c({ type: String }),
|
|
314
|
+
close: c({
|
|
315
315
|
type: Boolean,
|
|
316
316
|
default: !0
|
|
317
317
|
}),
|
|
318
|
-
timeout:
|
|
318
|
+
timeout: c({
|
|
319
319
|
default: 3e3,
|
|
320
320
|
validator: (e) => typeof e == "number" || e === !1
|
|
321
321
|
})
|
|
322
322
|
},
|
|
323
|
-
setup(
|
|
324
|
-
return (
|
|
323
|
+
setup(t, n) {
|
|
324
|
+
return (t) => C(e, {
|
|
325
325
|
modelName: "CustomAlert",
|
|
326
|
-
setup: (
|
|
326
|
+
setup: (e) => {
|
|
327
327
|
let r = {
|
|
328
328
|
default: C("path", {
|
|
329
329
|
"stroke-linecap": "round",
|
|
@@ -355,17 +355,17 @@ var X = T({
|
|
|
355
355
|
"stroke-width": "2",
|
|
356
356
|
d: "M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"
|
|
357
357
|
}, null)
|
|
358
|
-
}, i = () => /alert-(info|success|warning|error)/.exec(
|
|
359
|
-
return P(
|
|
360
|
-
setTimeout(() => a(
|
|
358
|
+
}, i = () => /alert-(info|success|warning|error)/.exec(t.$attrs.class)?.shift();
|
|
359
|
+
return P(t.timeout) && k(() => {
|
|
360
|
+
setTimeout(() => a(e).hide("timeout"), P(t.timeout));
|
|
361
361
|
}), {
|
|
362
362
|
template: () => C("div", {
|
|
363
363
|
role: "alert",
|
|
364
364
|
class: "alert"
|
|
365
365
|
}, [
|
|
366
|
-
a(
|
|
367
|
-
C("div", null, [a(
|
|
368
|
-
a(
|
|
366
|
+
a(e).alertIcon(),
|
|
367
|
+
C("div", null, [a(e).alertTitle(), t.$slots.default ? t.$slots.default({ component: e }) : a(e).alertDescription()]),
|
|
368
|
+
a(e).alertClose()
|
|
369
369
|
]),
|
|
370
370
|
alertIcon: () => C("svg", {
|
|
371
371
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -376,21 +376,21 @@ var X = T({
|
|
|
376
376
|
fill: "none",
|
|
377
377
|
viewBox: "0 0 24 24"
|
|
378
378
|
}, [r[i()] || r.default]),
|
|
379
|
-
alertTitle: () => C("h3", { class: "font-bold" }, [P(
|
|
380
|
-
alertDescription: () => C("div", { class: "text-xs" }, [P(
|
|
379
|
+
alertTitle: () => C("h3", { class: "font-bold" }, [P(t.title)]),
|
|
380
|
+
alertDescription: () => C("div", { class: "text-xs" }, [P(t.description)]),
|
|
381
381
|
alertClose: () => {
|
|
382
|
-
if (P(
|
|
382
|
+
if (P(t.close)) return C(X, {
|
|
383
383
|
id: "alert-close",
|
|
384
384
|
class: "text-xl cursor-pointer rounded-full hover:scale-80 hover:ring transition duration-500",
|
|
385
|
-
onClick: () => a(
|
|
385
|
+
onClick: () => a(e).hide("close")
|
|
386
386
|
}, null);
|
|
387
387
|
},
|
|
388
|
-
hide: (
|
|
389
|
-
|
|
388
|
+
hide: (e) => {
|
|
389
|
+
t.$el.remove(), n.emit("close", e);
|
|
390
390
|
}
|
|
391
391
|
};
|
|
392
392
|
}
|
|
393
|
-
},
|
|
393
|
+
}, t.$slots);
|
|
394
394
|
}
|
|
395
395
|
}, oe = {
|
|
396
396
|
viewBox: "0 0 24 24",
|
|
@@ -520,11 +520,11 @@ var Me = T({
|
|
|
520
520
|
render: je
|
|
521
521
|
}), Ne = {
|
|
522
522
|
props: {
|
|
523
|
-
setup:
|
|
523
|
+
setup: t,
|
|
524
524
|
ReactiveView: !0
|
|
525
525
|
},
|
|
526
526
|
setup() {
|
|
527
|
-
return (
|
|
527
|
+
return (t) => C(e, {
|
|
528
528
|
modelName: "ListPagination",
|
|
529
529
|
getDefaultData: (e) => ({
|
|
530
530
|
page: 1,
|
|
@@ -634,58 +634,58 @@ var Me = T({
|
|
|
634
634
|
a(e).next(),
|
|
635
635
|
a(e).end()
|
|
636
636
|
]),
|
|
637
|
-
pagination: (t) => a(a(e).$attrs.list).tid === t.id ? {} : t.index < i.value || t.index >= o.value ? { class:
|
|
637
|
+
pagination: (t) => a(a(e).$attrs.list).tid === t.id ? {} : t.index < i.value || t.index >= o.value ? { class: l("hidden") } : {},
|
|
638
638
|
load: () => {},
|
|
639
639
|
to: o,
|
|
640
640
|
from: i
|
|
641
641
|
};
|
|
642
642
|
}
|
|
643
|
-
},
|
|
643
|
+
}, t.$slots);
|
|
644
644
|
}
|
|
645
|
-
}, Pe =
|
|
645
|
+
}, Pe = n({
|
|
646
646
|
modelName: "ItemsList",
|
|
647
647
|
props: {
|
|
648
|
-
isValid:
|
|
649
|
-
beforeItemAdding:
|
|
650
|
-
whenItemAdding:
|
|
651
|
-
beforeItemDeleting:
|
|
652
|
-
whenItemDeleting:
|
|
653
|
-
whenItemActive:
|
|
654
|
-
whenItemInactive:
|
|
655
|
-
defaultDisplayComponent:
|
|
656
|
-
displayComponent:
|
|
657
|
-
itemProps:
|
|
648
|
+
isValid: c({ type: [Boolean, Function] }),
|
|
649
|
+
beforeItemAdding: c({ type: Function }),
|
|
650
|
+
whenItemAdding: c({ type: Function }),
|
|
651
|
+
beforeItemDeleting: c({ type: Function }),
|
|
652
|
+
whenItemDeleting: c({ type: Function }),
|
|
653
|
+
whenItemActive: c({ type: Function }),
|
|
654
|
+
whenItemInactive: c({ type: Function }),
|
|
655
|
+
defaultDisplayComponent: c(),
|
|
656
|
+
displayComponent: c({ default: () => e }),
|
|
657
|
+
itemProps: c({
|
|
658
658
|
type: [Function, Object],
|
|
659
659
|
default: () => ({})
|
|
660
660
|
}),
|
|
661
|
-
itemSlots:
|
|
661
|
+
itemSlots: c({
|
|
662
662
|
type: [Function, Object],
|
|
663
663
|
default: () => ({})
|
|
664
664
|
}),
|
|
665
|
-
itemKey:
|
|
665
|
+
itemKey: c({
|
|
666
666
|
type: String,
|
|
667
667
|
default: "id"
|
|
668
668
|
}),
|
|
669
|
-
paginator:
|
|
670
|
-
draggable:
|
|
671
|
-
groupable:
|
|
672
|
-
sortable:
|
|
669
|
+
paginator: c({ type: [Boolean, Object] }),
|
|
670
|
+
draggable: c({ type: Function }),
|
|
671
|
+
groupable: c({ type: Function }),
|
|
672
|
+
sortable: c({
|
|
673
673
|
type: Function,
|
|
674
674
|
default: (e) => e
|
|
675
675
|
}),
|
|
676
|
-
filterable:
|
|
676
|
+
filterable: c({
|
|
677
677
|
type: Function,
|
|
678
678
|
default: (e) => e
|
|
679
679
|
}),
|
|
680
|
-
clickable:
|
|
680
|
+
clickable: c({
|
|
681
681
|
type: Boolean,
|
|
682
682
|
default: !0
|
|
683
683
|
}),
|
|
684
|
-
selectable:
|
|
684
|
+
selectable: c({
|
|
685
685
|
type: Boolean,
|
|
686
686
|
default: !0
|
|
687
687
|
}),
|
|
688
|
-
selected:
|
|
688
|
+
selected: c({
|
|
689
689
|
type: [
|
|
690
690
|
Boolean,
|
|
691
691
|
Function,
|
|
@@ -695,51 +695,51 @@ var Me = T({
|
|
|
695
695
|
],
|
|
696
696
|
default: 0
|
|
697
697
|
}),
|
|
698
|
-
duplicate:
|
|
698
|
+
duplicate: c({
|
|
699
699
|
type: Function,
|
|
700
700
|
default: () => !1
|
|
701
701
|
}),
|
|
702
|
-
addToStart:
|
|
702
|
+
addToStart: c({
|
|
703
703
|
type: Boolean,
|
|
704
704
|
default: !0
|
|
705
705
|
}),
|
|
706
|
-
multiple:
|
|
707
|
-
"data:callback_key":
|
|
706
|
+
multiple: c({ type: Boolean }),
|
|
707
|
+
"data:callback_key": c({ type: [
|
|
708
708
|
Boolean,
|
|
709
709
|
Function,
|
|
710
710
|
String
|
|
711
711
|
] }),
|
|
712
|
-
listPaginationClass:
|
|
713
|
-
listDefaultClass:
|
|
714
|
-
listTemplateClass:
|
|
715
|
-
listClass:
|
|
712
|
+
listPaginationClass: c(),
|
|
713
|
+
listDefaultClass: c(),
|
|
714
|
+
listTemplateClass: c(),
|
|
715
|
+
listClass: c()
|
|
716
716
|
},
|
|
717
717
|
defaultData: [],
|
|
718
|
-
setup(
|
|
718
|
+
setup(t, n, i) {
|
|
719
719
|
let o = `component_${U()}`, s = M({}), c = N(U()), l = N(U()), d = N([P(c)]), f = N(), p = N(), m = N(), h = N(), v = y(() => {
|
|
720
720
|
try {
|
|
721
|
-
let
|
|
721
|
+
let e = a(t).activeComponent();
|
|
722
722
|
return typeof i.isValid == "function" ? i.isValid({
|
|
723
|
-
component:
|
|
724
|
-
list:
|
|
725
|
-
}) : typeof P(i.isValid) == "boolean" ? P(i.isValid) : P(a(
|
|
723
|
+
component: e,
|
|
724
|
+
list: t
|
|
725
|
+
}) : typeof P(i.isValid) == "boolean" ? P(i.isValid) : P(a(e).isValid);
|
|
726
726
|
} catch {
|
|
727
727
|
return !1;
|
|
728
728
|
}
|
|
729
729
|
}), b = y(() => {
|
|
730
730
|
try {
|
|
731
|
-
return a(
|
|
731
|
+
return a(t).model.getData().map((e) => {
|
|
732
732
|
try {
|
|
733
|
-
if (["Object"].includes(
|
|
734
|
-
let n = a(
|
|
735
|
-
return n || n === 0 ?
|
|
733
|
+
if (["Object"].includes(e.constructor.name)) {
|
|
734
|
+
let n = a(t).itemIdentifier(e);
|
|
735
|
+
return n || n === 0 ? e : Object.assign(e, { tid: U() });
|
|
736
736
|
} else return {
|
|
737
|
-
"":
|
|
737
|
+
"": e,
|
|
738
738
|
tid: U()
|
|
739
739
|
};
|
|
740
740
|
} catch {
|
|
741
741
|
return {
|
|
742
|
-
"":
|
|
742
|
+
"": e,
|
|
743
743
|
tid: U()
|
|
744
744
|
};
|
|
745
745
|
}
|
|
@@ -747,20 +747,20 @@ var Me = T({
|
|
|
747
747
|
} catch {
|
|
748
748
|
return [];
|
|
749
749
|
}
|
|
750
|
-
}), x = y(() => i.sortable(i.filterable(P(b),
|
|
750
|
+
}), x = y(() => i.sortable(i.filterable(P(b), t), t)), S = (e = {}, t = !0) => {
|
|
751
751
|
try {
|
|
752
752
|
return e.hasOwnProperty(i.itemKey) ? i.itemKey : t ? "tid" : i.itemKey;
|
|
753
753
|
} catch {
|
|
754
754
|
return t ? "tid" : i.itemKey;
|
|
755
755
|
}
|
|
756
|
-
}, w = (
|
|
756
|
+
}, w = (e = {}) => {
|
|
757
757
|
try {
|
|
758
|
-
return
|
|
758
|
+
return e[a(t).itemKey(e)];
|
|
759
759
|
} catch {
|
|
760
760
|
return;
|
|
761
761
|
}
|
|
762
|
-
}, T = (e) => s[e], E = () => i.defaultDisplayComponent === !1 ? C(
|
|
763
|
-
let n = a(
|
|
762
|
+
}, T = (e) => s[e], E = () => i.defaultDisplayComponent === !1 ? C(e, { class: "hidden" }) : i.defaultDisplayComponent === void 0 ? i.displayComponent : i.defaultDisplayComponent, D = () => C(i.displayComponent), O = (e = {}) => e.id === P(c) ? a(t).defaultDisplayComponent() : i.displayComponent, A = (e) => {
|
|
763
|
+
let n = a(t).itemIdentifier(e), r = a(t).getComponent(P(l)), o = a(t).getComponent(n);
|
|
764
764
|
if (o && i.duplicate({
|
|
765
765
|
id: n,
|
|
766
766
|
tid: P(c),
|
|
@@ -771,43 +771,43 @@ var Me = T({
|
|
|
771
771
|
{
|
|
772
772
|
let n = o ?? r;
|
|
773
773
|
if (n) {
|
|
774
|
-
let r = a(
|
|
775
|
-
a(n).model.replaceData(
|
|
774
|
+
let r = a(t).getComponent(P(c));
|
|
775
|
+
a(n).model.replaceData(e ?? I(r));
|
|
776
776
|
}
|
|
777
777
|
return n;
|
|
778
778
|
}
|
|
779
|
-
}, j = (
|
|
779
|
+
}, j = (e, n) => new Promise(async (r) => {
|
|
780
780
|
let i = P(x).reduce((r, i) => {
|
|
781
781
|
let { id: o = !0, force: s = !1 } = typeof n == "boolean" ? {
|
|
782
782
|
id: !0,
|
|
783
783
|
force: n
|
|
784
|
-
} : n ?? {}, c = a(
|
|
785
|
-
return i.hasOwnProperty("tid") || s ? r.concat(
|
|
786
|
-
list:
|
|
787
|
-
data: a(
|
|
784
|
+
} : n ?? {}, c = a(t).itemIdentifier(i), l = a(t).getComponent(c);
|
|
785
|
+
return i.hasOwnProperty("tid") || s ? r.concat(e({
|
|
786
|
+
list: t,
|
|
787
|
+
data: a(t).finalize(l, o),
|
|
788
788
|
component: l,
|
|
789
789
|
tid: c
|
|
790
790
|
})) : r;
|
|
791
791
|
}, []);
|
|
792
792
|
r(await Promise.all(i));
|
|
793
|
-
}), I = (e) => a(e).model.getData({ raw: !0 }) ?? a(e).model.getData(), L = async (
|
|
794
|
-
let n = i.beforeItemAdding ?? a(
|
|
793
|
+
}), I = (e) => a(e).model.getData({ raw: !0 }) ?? a(e).model.getData(), L = async (e) => {
|
|
794
|
+
let n = i.beforeItemAdding ?? a(e).beforeItemAdding, r = i.whenItemAdding ?? a(e).whenItemAdding, o = {
|
|
795
795
|
tid: P(c),
|
|
796
|
-
data: V(
|
|
797
|
-
list:
|
|
796
|
+
data: V(e),
|
|
797
|
+
list: t
|
|
798
798
|
};
|
|
799
|
-
return (await n?.(Object.assign({}, o, { component:
|
|
800
|
-
}, z = async (
|
|
801
|
-
if (!(a(
|
|
802
|
-
let n = i.beforeItemDeleting ?? a(
|
|
803
|
-
return (await n?.(Object.assign({}, o, { component:
|
|
799
|
+
return (await n?.(Object.assign({}, o, { component: e }), t) ?? !0) && (await r?.(o, t) ? await r(Object.assign({}, o, { component: e }), t) : a(t).set(g.on(I(e)).clone())), e;
|
|
800
|
+
}, z = async (e) => {
|
|
801
|
+
if (!(a(e).$attrs.default || a(e).$attrs.template)) {
|
|
802
|
+
let n = i.beforeItemDeleting ?? a(e).beforeItemDeleting, r = i.whenItemDeleting ?? a(e).whenItemDeleting, o = { list: t };
|
|
803
|
+
return (await n?.(Object.assign({}, o, { component: e }), t) ?? !0) && (await r?.(o, t) ? await r(Object.assign({}, o, { component: e }), t) : a(t).unset(g.on(I(e)).clone())), e;
|
|
804
804
|
}
|
|
805
|
-
}, ee = (
|
|
806
|
-
let n = a(
|
|
807
|
-
P(x).findIndex((
|
|
808
|
-
}, B = (
|
|
809
|
-
let n = a(
|
|
810
|
-
a(
|
|
805
|
+
}, ee = (e) => {
|
|
806
|
+
let n = a(t).itemIdentifier(e);
|
|
807
|
+
P(x).findIndex((e) => a(t).itemIdentifier(e) === n) === -1 ? (a(t).model.replaceData(i.addToStart ? [e].concat(P(x)) : P(x).concat(e)), delete s[P(l)], c.value = U(), l.value = U()) : a(t).defaultComponent(e);
|
|
808
|
+
}, B = (e) => {
|
|
809
|
+
let n = a(t).itemIdentifier(e);
|
|
810
|
+
a(t).model.replaceData(P(x).filter((e) => a(t).itemIdentifier(e) !== n)), delete s[n];
|
|
811
811
|
}, V = (e, t) => {
|
|
812
812
|
try {
|
|
813
813
|
let { tid: n, ...r } = I(e);
|
|
@@ -816,27 +816,27 @@ var Me = T({
|
|
|
816
816
|
return {};
|
|
817
817
|
}
|
|
818
818
|
}, H = () => {
|
|
819
|
-
let
|
|
820
|
-
return a(
|
|
821
|
-
}, W = () => i.selectable ? (i.multiple ? P(d) : P(d)[0]) ?? P(c) : P(c), te = ({ index:
|
|
822
|
-
let r = a(
|
|
823
|
-
event: { [
|
|
819
|
+
let e = a(t).activeItemIdentifier();
|
|
820
|
+
return a(t).getComponent(e);
|
|
821
|
+
}, W = () => i.selectable ? (i.multiple ? P(d) : P(d)[0]) ?? P(c) : P(c), te = ({ index: e, item: n }) => {
|
|
822
|
+
let r = a(t).itemIdentifier(n), o = r === P(l), u = r === P(c), p = (e) => ({
|
|
823
|
+
event: { [e]: !0 },
|
|
824
824
|
source: P(f),
|
|
825
|
-
target: a(
|
|
825
|
+
target: a(t).getComponent(r),
|
|
826
826
|
items: P(x)
|
|
827
827
|
}), m = {
|
|
828
828
|
id: r,
|
|
829
829
|
key: r,
|
|
830
|
-
list:
|
|
830
|
+
list: t,
|
|
831
831
|
instance: (e) => s[r] = e,
|
|
832
832
|
default: u,
|
|
833
833
|
template: o,
|
|
834
834
|
selected: P(d).includes(r),
|
|
835
|
-
component: a(
|
|
835
|
+
component: a(t).getComponent(r) ?? { model: _.setDefaultData(n) },
|
|
836
836
|
defaultData: Array.isArray(n) ? [] : {},
|
|
837
837
|
data: () => {
|
|
838
|
-
let n = P(x).find((
|
|
839
|
-
return n === void 0 ? P(x)[
|
|
838
|
+
let n = P(x).find((e) => a(t).itemIdentifier(e) === r);
|
|
839
|
+
return n === void 0 ? P(x)[e] : n;
|
|
840
840
|
},
|
|
841
841
|
"data:callback": (e, { component: t }) => {
|
|
842
842
|
try {
|
|
@@ -846,51 +846,51 @@ var Me = T({
|
|
|
846
846
|
a(t).model.replaceData(e.after);
|
|
847
847
|
}
|
|
848
848
|
},
|
|
849
|
-
onClick: (
|
|
850
|
-
let n = a(
|
|
851
|
-
i.selectable && (typeof a(n).whenItemSelected == "function" ? a(n).whenItemSelected(
|
|
849
|
+
onClick: (e) => {
|
|
850
|
+
let n = a(t).getComponent(r);
|
|
851
|
+
i.selectable && (typeof a(n).whenItemSelected == "function" ? a(n).whenItemSelected(e, m) : P(d).includes(r) || (d.value = [r])), i.clickable && typeof a(n).whenItemClicked == "function" && a(n).whenItemClicked(e, m);
|
|
852
852
|
},
|
|
853
853
|
...o ? { class: "hidden" } : {},
|
|
854
|
-
...typeof
|
|
854
|
+
...typeof e == "number" ? { index: e } : {},
|
|
855
855
|
...i.draggable ? {
|
|
856
856
|
draggable: !0,
|
|
857
|
-
ondragover: (
|
|
858
|
-
|
|
857
|
+
ondragover: (e) => {
|
|
858
|
+
e.preventDefault(), i.draggable(p("over"), t);
|
|
859
859
|
},
|
|
860
860
|
ondragend: () => {
|
|
861
|
-
f.value = void 0, i.draggable(p("end"),
|
|
861
|
+
f.value = void 0, i.draggable(p("end"), t);
|
|
862
862
|
},
|
|
863
863
|
ondragstart: () => {
|
|
864
|
-
f.value = a(
|
|
864
|
+
f.value = a(t).getComponent(r), i.draggable(p("start"), t);
|
|
865
865
|
},
|
|
866
866
|
ondrop: () => {
|
|
867
|
-
i.draggable(p("drop"),
|
|
867
|
+
i.draggable(p("drop"), t);
|
|
868
868
|
},
|
|
869
869
|
ondragenter: () => {
|
|
870
|
-
a(
|
|
870
|
+
a(t).itemIdentifier(I(f)) !== r && i.draggable(p("enter"), t);
|
|
871
871
|
},
|
|
872
872
|
ondragleave: () => {
|
|
873
|
-
a(
|
|
873
|
+
a(t).itemIdentifier(I(f)) !== r && i.draggable(p("leave"), t);
|
|
874
874
|
}
|
|
875
875
|
} : {}
|
|
876
876
|
};
|
|
877
877
|
return m;
|
|
878
878
|
}, ne = () => {
|
|
879
|
-
let
|
|
879
|
+
let e = a(t).itemOptions({ item: { tid: P(c) } }), n = a(t).itemOptions({ item: { tid: P(l) } });
|
|
880
880
|
return C("div", { class: i.$attrs.class }, [
|
|
881
|
-
C("div", { class: i.listClass }, P(x).reduce((
|
|
881
|
+
C("div", { class: i.listClass }, P(x).reduce((e, n, r) => e.concat(K(a(t).itemOptions({
|
|
882
882
|
index: r,
|
|
883
883
|
item: n
|
|
884
884
|
}))), [])),
|
|
885
885
|
C("div", {
|
|
886
|
-
...
|
|
887
|
-
class: R(u(
|
|
888
|
-
}, [K(
|
|
886
|
+
...r(e, ["class"]),
|
|
887
|
+
class: R(u(e.class, i.listDefaultClass).string, u(i.listDefaultClass).string)
|
|
888
|
+
}, [K(e)]),
|
|
889
889
|
C("div", {
|
|
890
|
-
...n
|
|
891
|
-
class: R(u(
|
|
892
|
-
}, [K(
|
|
893
|
-
C("div", { class: i.listPaginationClass }, [a(
|
|
890
|
+
...r(n, ["class"]),
|
|
891
|
+
class: R(u(n.class, i.listTemplateClass).string, u(i.listTemplateClass).string)
|
|
892
|
+
}, [K(n)]),
|
|
893
|
+
C("div", { class: i.listPaginationClass }, [a(t).paginationComponent()])
|
|
894
894
|
]);
|
|
895
895
|
}, G = (e) => {
|
|
896
896
|
try {
|
|
@@ -898,26 +898,26 @@ var Me = T({
|
|
|
898
898
|
} catch {
|
|
899
899
|
return !1;
|
|
900
900
|
}
|
|
901
|
-
}, K = (
|
|
902
|
-
let o = a(
|
|
903
|
-
...
|
|
901
|
+
}, K = (n) => {
|
|
902
|
+
let o = a(t).activeDisplay(n), s = typeof o == "function" ? o(n) : o, { class: c, ...l } = typeof i.itemProps == "function" ? i.itemProps(n) : i.itemProps, { class: d } = a(t).pageProps(n), { class: f, ...p } = {
|
|
903
|
+
...n,
|
|
904
904
|
...l
|
|
905
|
-
}, m = R(u(s.props.class, f, c, d).string, u(c, d).string), h = typeof i.itemSlots == "function" ? i.itemSlots(
|
|
905
|
+
}, m = R(u(s.props.class, f, c, d).string, u(c, d).string), h = typeof i.itemSlots == "function" ? i.itemSlots(n) : i.itemSlots;
|
|
906
906
|
try {
|
|
907
907
|
return G(s) ? C(s, {
|
|
908
908
|
...p,
|
|
909
909
|
class: m
|
|
910
910
|
}, h) : G(s.type) ? C(s, {
|
|
911
911
|
...p,
|
|
912
|
-
...
|
|
912
|
+
...r(s.props, "class"),
|
|
913
913
|
class: m
|
|
914
|
-
}, s.children) : C(
|
|
914
|
+
}, s.children) : C(e, {
|
|
915
915
|
...p,
|
|
916
|
-
...
|
|
916
|
+
...r(s.props, "class"),
|
|
917
917
|
class: m
|
|
918
918
|
}, () => s.children);
|
|
919
919
|
} catch (e) {
|
|
920
|
-
return console.log("component builder failed:", e, s), C("div",
|
|
920
|
+
return console.log("component builder failed:", e, s), C("div", n, "Component failed to mount!");
|
|
921
921
|
}
|
|
922
922
|
}, q = (e) => {
|
|
923
923
|
try {
|
|
@@ -927,56 +927,56 @@ var Me = T({
|
|
|
927
927
|
}
|
|
928
928
|
}, J = () => {
|
|
929
929
|
if (i.paginator) {
|
|
930
|
-
let { component:
|
|
930
|
+
let { component: e = Ne, data: n, props: r } = i.paginator?.props?.ReactiveView ? {
|
|
931
931
|
component: i.paginator,
|
|
932
|
-
props: { list:
|
|
932
|
+
props: { list: t }
|
|
933
933
|
} : i.paginator?.component || i.paginator?.data || i.paginator?.props ? {
|
|
934
934
|
...i.paginator,
|
|
935
935
|
props: {
|
|
936
|
-
list: i.paginator.list ??
|
|
936
|
+
list: i.paginator.list ?? t,
|
|
937
937
|
...i.paginator.props
|
|
938
938
|
}
|
|
939
|
-
} : { props: { list:
|
|
940
|
-
return C(
|
|
939
|
+
} : { props: { list: t } };
|
|
940
|
+
return C(e, {
|
|
941
941
|
...r,
|
|
942
942
|
instance: p,
|
|
943
943
|
...n === void 0 ? {} : { data: n }
|
|
944
944
|
});
|
|
945
945
|
}
|
|
946
|
-
}, Y = (
|
|
946
|
+
}, Y = (e) => C("button", {
|
|
947
947
|
ref: m,
|
|
948
948
|
class: "btn btn-sm btn-success text-white uppercase",
|
|
949
949
|
onClick: () => {
|
|
950
|
-
let n = a(
|
|
951
|
-
if (n) return a(
|
|
950
|
+
let n = a(t).defaultComponent(e);
|
|
951
|
+
if (n) return a(t).add(n);
|
|
952
952
|
},
|
|
953
|
-
disabled: !P(a(
|
|
954
|
-
}, "add"), X = (
|
|
955
|
-
let n = a(
|
|
953
|
+
disabled: !P(a(t).isValid)
|
|
954
|
+
}, "add"), X = (e) => {
|
|
955
|
+
let n = a(t).getComponent(a(t).itemIdentifier(e));
|
|
956
956
|
return C("button", {
|
|
957
957
|
ref: h,
|
|
958
958
|
class: "btn btn-sm btn-error text-white uppercase",
|
|
959
959
|
onClick: () => {
|
|
960
|
-
if (n) return a(
|
|
960
|
+
if (n) return a(t).remove(n);
|
|
961
961
|
},
|
|
962
962
|
disabled: !n || n === s[P(c)] || n === s[P(l)]
|
|
963
963
|
}, "delete");
|
|
964
964
|
}, Z = () => {
|
|
965
|
-
F(d, (
|
|
966
|
-
|
|
965
|
+
F(d, (e, n = []) => {
|
|
966
|
+
e.forEach((e) => {
|
|
967
967
|
setTimeout(() => {
|
|
968
|
-
let n = a(
|
|
968
|
+
let n = a(t).getComponent(e), r = i.whenItemActive ?? a(n).whenItemActive;
|
|
969
969
|
n && r && r({
|
|
970
|
-
list:
|
|
970
|
+
list: t,
|
|
971
971
|
data: a(n).model.getData(),
|
|
972
972
|
component: n
|
|
973
973
|
});
|
|
974
974
|
});
|
|
975
|
-
}), n.forEach((
|
|
975
|
+
}), n.forEach((e) => {
|
|
976
976
|
setTimeout(() => {
|
|
977
|
-
let n = a(
|
|
977
|
+
let n = a(t).getComponent(e), r = i.whenItemInactive ?? a(n).whenItemInactive;
|
|
978
978
|
n && r && r({
|
|
979
|
-
list:
|
|
979
|
+
list: t,
|
|
980
980
|
data: a(n).model.getData(),
|
|
981
981
|
component: n
|
|
982
982
|
});
|
|
@@ -984,20 +984,20 @@ var Me = T({
|
|
|
984
984
|
});
|
|
985
985
|
}, { immediate: !0 });
|
|
986
986
|
}, re = () => {
|
|
987
|
-
let
|
|
988
|
-
if (typeof n == "string") return
|
|
989
|
-
if (typeof n == "function") return
|
|
990
|
-
if (["Object"].includes(n.constructor.name)) return
|
|
991
|
-
if (["Number"].includes(n.constructor.name)) return n > -1 ?
|
|
987
|
+
let e = (e, n = "") => {
|
|
988
|
+
if (typeof n == "string") return e.find((e) => e[a(t).itemKey(e)] === n || e[""] === n);
|
|
989
|
+
if (typeof n == "function") return e.find((e) => n(e));
|
|
990
|
+
if (["Object"].includes(n.constructor.name)) return e.find((e) => e[a(t).itemKey(e)] === n.id || e[a(t).itemKey(e)] === n[a(t).itemKey(n)]);
|
|
991
|
+
if (["Number"].includes(n.constructor.name)) return n > -1 ? e[n > e.length ? e.length - 1 : n] ?? e[e.length - 1] : e[e.length - Math.abs(n)] ?? e[0];
|
|
992
992
|
};
|
|
993
993
|
F(x, (n, r) => {
|
|
994
994
|
if (r) {
|
|
995
|
-
if (n.length > r.length) d.value = [a(
|
|
995
|
+
if (n.length > r.length) d.value = [a(t).itemIdentifier(i.addToStart ? e(n, 0) : e(n, -1))];
|
|
996
996
|
else if (n.length < r.length) {
|
|
997
|
-
let i = r.findIndex((
|
|
998
|
-
i > -1 && (d.value = [a(
|
|
997
|
+
let i = r.findIndex((e) => a(t).itemIdentifier(e) === P(d)[0]);
|
|
998
|
+
i > -1 && (d.value = [a(t).itemIdentifier(e(n, i) ?? e(n, -1)) ?? P(c)]);
|
|
999
999
|
}
|
|
1000
|
-
} else d.value = [a(
|
|
1000
|
+
} else d.value = [a(t).itemIdentifier(e(n, i.selected))];
|
|
1001
1001
|
}, { immediate: !0 });
|
|
1002
1002
|
};
|
|
1003
1003
|
return k(() => {
|
|
@@ -1031,7 +1031,7 @@ var Me = T({
|
|
|
1031
1031
|
id: o
|
|
1032
1032
|
};
|
|
1033
1033
|
}
|
|
1034
|
-
}), Fe =
|
|
1034
|
+
}), Fe = n({
|
|
1035
1035
|
modelName: "CustomTableRow",
|
|
1036
1036
|
setup: (e, t, n) => {
|
|
1037
1037
|
let r = a(a(e).$attrs.list);
|
|
@@ -1069,19 +1069,19 @@ var Me = T({
|
|
|
1069
1069
|
checkedRef: y(() => P(a(r).checkedRef).has(a(r).itemIdentifier(a(e).model.getData())))
|
|
1070
1070
|
};
|
|
1071
1071
|
}
|
|
1072
|
-
}), Ie =
|
|
1072
|
+
}), Ie = n({
|
|
1073
1073
|
modelName: "Popover",
|
|
1074
1074
|
props: {
|
|
1075
|
-
autoClose:
|
|
1075
|
+
autoClose: c({
|
|
1076
1076
|
type: Boolean,
|
|
1077
1077
|
default: !0
|
|
1078
1078
|
}),
|
|
1079
|
-
timeout:
|
|
1079
|
+
timeout: c({
|
|
1080
1080
|
default: 0,
|
|
1081
1081
|
validator: (e) => /^\d+$/.test(e)
|
|
1082
1082
|
}),
|
|
1083
|
-
containerClass:
|
|
1084
|
-
boundary:
|
|
1083
|
+
containerClass: c(),
|
|
1084
|
+
boundary: c({ type: [
|
|
1085
1085
|
Function,
|
|
1086
1086
|
Object,
|
|
1087
1087
|
String
|
|
@@ -1151,30 +1151,30 @@ var Me = T({
|
|
|
1151
1151
|
popoverRef: i
|
|
1152
1152
|
};
|
|
1153
1153
|
}
|
|
1154
|
-
}), Le =
|
|
1154
|
+
}), Le = n({
|
|
1155
1155
|
modelName: "CustomTable",
|
|
1156
1156
|
props: {
|
|
1157
|
-
empty:
|
|
1158
|
-
isSelectable:
|
|
1157
|
+
empty: c({ type: Object }),
|
|
1158
|
+
isSelectable: c({
|
|
1159
1159
|
type: Boolean,
|
|
1160
1160
|
default: !0
|
|
1161
1161
|
}),
|
|
1162
|
-
isCollapsible:
|
|
1163
|
-
hasMenu:
|
|
1162
|
+
isCollapsible: c({ type: Boolean }),
|
|
1163
|
+
hasMenu: c({
|
|
1164
1164
|
type: Boolean,
|
|
1165
1165
|
default: !0
|
|
1166
1166
|
}),
|
|
1167
|
-
hasHeaderMenu:
|
|
1168
|
-
headerClass:
|
|
1169
|
-
columnLines:
|
|
1170
|
-
rowLines:
|
|
1167
|
+
hasHeaderMenu: c({ type: Boolean }),
|
|
1168
|
+
headerClass: c(),
|
|
1169
|
+
columnLines: c({ type: Boolean }),
|
|
1170
|
+
rowLines: c({
|
|
1171
1171
|
type: Boolean,
|
|
1172
1172
|
default: !0
|
|
1173
1173
|
})
|
|
1174
1174
|
},
|
|
1175
1175
|
defaultDisplayComponent: !1,
|
|
1176
1176
|
displayComponent: Fe,
|
|
1177
|
-
setup(e, t,
|
|
1177
|
+
setup(e, t, n) {
|
|
1178
1178
|
let o = N({
|
|
1179
1179
|
children: [],
|
|
1180
1180
|
props: {}
|
|
@@ -1192,23 +1192,23 @@ var Me = T({
|
|
|
1192
1192
|
a(e).model.getData().forEach((t) => {
|
|
1193
1193
|
P(a(e).checkedRef).delete(a(e).itemIdentifier(t));
|
|
1194
1194
|
});
|
|
1195
|
-
}, _ = (e) =>
|
|
1195
|
+
}, _ = (e) => n.columnLines ? `[&>.sticky]:z-1 [&>.sticky:not(:last-child):not(:has(~.sticky:not(:last-child)))]:-mr-[calc(var(--column-gap,1rem)/2)] [&>.sticky:not(:last-child):not(:has(~.sticky:not(:last-child)))]:shadow-[1px_0_0_var(--colors-EDEFF2)] [&>*:nth-child(n+3):not(:last-child):not(.sticky)]:relative [&>*:nth-child(n+3):not(:last-child)]:after:absolute [&>*:nth-child(n+3):not(:last-child)]:after:w-px [&>*:nth-child(n+3):not(:last-child)]:after:bg-(--colors-EDEFF2) [&>*:nth-child(n+3):not(:last-child)]:after:left-[calc(var(--column-gap,1rem)/-2)] ${e}` : "", b = () => n.rowLines ? "border-(--colors-EDEFF2) border-b last:border-b-0 [&:has(+:not([data-table-row]))]:border-b-0 [[data-table-row]_&]:border-b-0 [[data-table-row]_*_&]:border-t" : "", x = () => R(n.isCollapsible || n.isSelectable ? "" : "[&>:nth-child(2)]:-ml-[calc(var(--column-gap,1rem)-0.75rem)]", n.hasMenu ? "" : "[&>:nth-last-child(2)]:-mr-[calc(var(--column-gap,1rem)-0.75rem)]"), T = (e, t, n) => t ? e.props?.[`data-col-${t}`] ?? n : e.props ?? {}, D = () => C("div", {
|
|
1196
1196
|
"data-table": !0,
|
|
1197
1197
|
class: R("flex flex-col", P(o).props.class)
|
|
1198
1198
|
}, [a(e).tableHead(), a(e).tableBody()]), O = () => {
|
|
1199
1199
|
if (a(e).model.getData().length) {
|
|
1200
1200
|
let t = a(e).rowCheckbox({ row: e }), i = a(e).rowMenuButton({ row: e }), s = a(e).leftRowColumnControls({ row: e }), c = a(e).rightRowColumnControls({ row: e }), l = P(o).props["data-header-row-class"] ?? "";
|
|
1201
|
-
return C("div", { class: R(u({ "sticky top-0 z-10 bg-(--colors-F9FAFC) grid grid-cols-subgrid col-span-full": !0 },
|
|
1202
|
-
C(s.type, s.props, { default: () => [C("div", { class: "h-full bg-inherit flex items-center gap-x-2" }, [a(e).rowCollapseButton({}), t && C(t.type, E(
|
|
1201
|
+
return C("div", { class: R(u({ "sticky top-0 z-10 bg-(--colors-F9FAFC) grid grid-cols-subgrid col-span-full": !0 }, n.headerClass, l).string, u(n.headerClass, l).string, _("[&>*:nth-child(n+3):not(:last-child)]:after:inset-y-0"), x()) }, [
|
|
1202
|
+
C(s.type, s.props, { default: () => [C("div", { class: "h-full bg-inherit flex items-center gap-x-2" }, [a(e).rowCollapseButton({}), t && C(t.type, E(r(t.props, ["onChange"]), { onChange: (e) => e.target.checked ? p() : h() }), t.children)])] }),
|
|
1203
1203
|
P(o).children.map((e) => T(e, "element") ?? w(T(e, "type", "div"), { class: R(u(T(e).class).string, u(T(e, "class")).string) }, T(e, "title"))),
|
|
1204
|
-
C(c.type, c.props, { default: () => [C("div", { class: "h-full bg-inherit flex items-center" }, [i && C(i, E(
|
|
1204
|
+
C(c.type, c.props, { default: () => [C("div", { class: "h-full bg-inherit flex items-center" }, [i && C(i, E(r(i.props, ["class"]), { class: R(i.props.class, u({ hidden: !n.hasHeaderMenu }).string) }), i.children)])] })
|
|
1205
1205
|
]);
|
|
1206
1206
|
}
|
|
1207
1207
|
}, k = () => {
|
|
1208
|
-
if (!a(e).model.getData().length &&
|
|
1209
|
-
let [
|
|
1208
|
+
if (!a(e).model.getData().length && n.empty) return [a(e).emptyTableElement()];
|
|
1209
|
+
let [r, i, o, s] = a(t).template().children;
|
|
1210
1210
|
return [
|
|
1211
|
-
|
|
1211
|
+
r.children,
|
|
1212
1212
|
i.children,
|
|
1213
1213
|
o.children,
|
|
1214
1214
|
a(e).tablePagination(s.children),
|
|
@@ -1216,8 +1216,8 @@ var Me = T({
|
|
|
1216
1216
|
];
|
|
1217
1217
|
}, A = (e) => {
|
|
1218
1218
|
if (e?.some(Boolean)) return C("div", { class: "sticky bottom-0 z-10 col-span-full px-3 py-2 border-t border-(--colors-EDEFF2) bg-(--colors-white) text-sm" }, [C("div", { class: "sticky right-3 ml-auto w-max" }, [e])]);
|
|
1219
|
-
}, j = (...t) => C("div", { class: R("sticky left-0 bg-inherit self-stretch",
|
|
1220
|
-
let e = g.on(
|
|
1219
|
+
}, j = (...t) => C("div", { class: R("sticky left-0 bg-inherit self-stretch", n.isCollapsible || n.isSelectable ? "px-3" : "px-0") }, [C("div", { class: "h-full flex items-center gap-x-2 bg-inherit" }, [a(e).rowCollapseButton(...t), a(e).rowCheckbox(...t)])]), M = (...t) => C("div", { class: R("sticky right-0 bg-inherit self-stretch", n.hasMenu ? "px-3" : "px-0") }, [C("div", { class: "h-full flex items-center gap-x-2 bg-inherit" }, [a(e).rowMenuButton(...t)])]), I = () => {
|
|
1220
|
+
let e = g.on(n.empty);
|
|
1221
1221
|
return C("div", { class: {
|
|
1222
1222
|
hidden: !e.get(),
|
|
1223
1223
|
"py-8 px-3 flex flex-col gap-y-3 col-span-full": !0
|
|
@@ -1227,7 +1227,7 @@ var Me = T({
|
|
|
1227
1227
|
C("div", { class: "hidden" }, [a(t).template()])
|
|
1228
1228
|
]);
|
|
1229
1229
|
}, L = ({ row: t } = {}) => {
|
|
1230
|
-
if (
|
|
1230
|
+
if (n.hasMenu) return C(Ie, {
|
|
1231
1231
|
boundary: "[data-table]",
|
|
1232
1232
|
setup: (n, r) => ({
|
|
1233
1233
|
trigger: () => C(q, {
|
|
@@ -1262,7 +1262,7 @@ var Me = T({
|
|
|
1262
1262
|
});
|
|
1263
1263
|
}
|
|
1264
1264
|
}, ee = ({ row: t } = {}) => {
|
|
1265
|
-
if (
|
|
1265
|
+
if (n.isCollapsible) {
|
|
1266
1266
|
let n = t && a(e).itemIdentifier(a(t).model.getData()), r = t ? P(c).has(n) : P(d);
|
|
1267
1267
|
return C(q, {
|
|
1268
1268
|
unstyled: !0,
|
|
@@ -1276,7 +1276,7 @@ var Me = T({
|
|
|
1276
1276
|
} }, null) });
|
|
1277
1277
|
}
|
|
1278
1278
|
}, V = ({ row: t } = {}) => {
|
|
1279
|
-
if (
|
|
1279
|
+
if (n.isSelectable) return C(m, {
|
|
1280
1280
|
type: "checkbox",
|
|
1281
1281
|
size: "large",
|
|
1282
1282
|
indeterminate: t === e && P(f),
|
|
@@ -1289,8 +1289,8 @@ var Me = T({
|
|
|
1289
1289
|
}, H = () => {
|
|
1290
1290
|
if (P(a(e).checkedRef).size) return C("div", { class: "sticky bottom-0 z-20 col-span-full" }, [C("div", { class: "sticky left-1/2 w-0" }, [C("div", { class: {
|
|
1291
1291
|
"absolute -translate-x-1/2 bg-white rounded-xl shadow-[0_4px_24px_rgba(0,0,0,0.12)] px-5 py-3 flex items-center w-max": !0,
|
|
1292
|
-
"bottom-16": !!P(
|
|
1293
|
-
"bottom-8": !P(
|
|
1292
|
+
"bottom-16": !!P(n.$attrs.paginator),
|
|
1293
|
+
"bottom-8": !P(n.$attrs.paginator)
|
|
1294
1294
|
} }, [
|
|
1295
1295
|
C("span", { class: "font-medium" }, [P(a(e).checkedRef).size, S(" Selected")]),
|
|
1296
1296
|
C(B, { layout: "vertical" }, null),
|
|
@@ -1336,10 +1336,10 @@ var Me = T({
|
|
|
1336
1336
|
} catch (t) {
|
|
1337
1337
|
try {
|
|
1338
1338
|
return a(e).rowElement();
|
|
1339
|
-
} catch (
|
|
1340
|
-
console.warn(`[${
|
|
1339
|
+
} catch (r) {
|
|
1340
|
+
console.warn(`[${n.modelName}]: failed to set table columns`, {
|
|
1341
1341
|
e1: t,
|
|
1342
|
-
e2:
|
|
1342
|
+
e2: r
|
|
1343
1343
|
}, a(e));
|
|
1344
1344
|
}
|
|
1345
1345
|
}
|
|
@@ -1378,39 +1378,39 @@ var Me = T({
|
|
|
1378
1378
|
handleCollapsible: J
|
|
1379
1379
|
};
|
|
1380
1380
|
}
|
|
1381
|
-
}, Pe), Re =
|
|
1381
|
+
}, Pe), Re = n({
|
|
1382
1382
|
props: {
|
|
1383
|
-
defaultData:
|
|
1384
|
-
filled:
|
|
1385
|
-
timezone:
|
|
1386
|
-
time:
|
|
1387
|
-
date:
|
|
1383
|
+
defaultData: c(),
|
|
1384
|
+
filled: c({ type: Boolean }),
|
|
1385
|
+
timezone: c({ type: [Boolean, String] }),
|
|
1386
|
+
time: c({ type: Boolean }),
|
|
1387
|
+
date: c({
|
|
1388
1388
|
type: Boolean,
|
|
1389
1389
|
default: !0
|
|
1390
1390
|
}),
|
|
1391
|
-
type:
|
|
1391
|
+
type: c({
|
|
1392
1392
|
type: String,
|
|
1393
1393
|
default: "date",
|
|
1394
|
-
validator: (
|
|
1395
|
-
let
|
|
1394
|
+
validator: (e) => {
|
|
1395
|
+
let t = [
|
|
1396
1396
|
"date",
|
|
1397
1397
|
"dates",
|
|
1398
1398
|
"range"
|
|
1399
1399
|
];
|
|
1400
|
-
return
|
|
1400
|
+
return t.includes(e) || d(`[Datetime] invalid type. Must be one of ${t.join(", ")}.`);
|
|
1401
1401
|
}
|
|
1402
1402
|
}),
|
|
1403
|
-
options:
|
|
1403
|
+
options: c({
|
|
1404
1404
|
type: Object,
|
|
1405
1405
|
default: {}
|
|
1406
1406
|
}),
|
|
1407
|
-
minDate:
|
|
1407
|
+
minDate: c({
|
|
1408
1408
|
type: [Boolean, Date],
|
|
1409
1409
|
default: () => /* @__PURE__ */ new Date(),
|
|
1410
1410
|
validator: (e) => ["Boolean", "Date"].includes(e?.constructor.name) && e !== !0
|
|
1411
1411
|
}),
|
|
1412
|
-
inputClass:
|
|
1413
|
-
panelClass:
|
|
1412
|
+
inputClass: c(),
|
|
1413
|
+
panelClass: c()
|
|
1414
1414
|
},
|
|
1415
1415
|
defaultData: (e) => P(e.defaultData) ?? {
|
|
1416
1416
|
date: void 0,
|
|
@@ -1498,7 +1498,7 @@ var We = T({
|
|
|
1498
1498
|
render: Ue
|
|
1499
1499
|
}), Ge = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==", Q = null, Ke = (e) => {
|
|
1500
1500
|
!e?.setDragImage || typeof Image > "u" || (Q || (Q = new Image(), Q.src = Ge), e.setDragImage(Q, 0, 0));
|
|
1501
|
-
}, qe =
|
|
1501
|
+
}, qe = n({
|
|
1502
1502
|
modelName: "DraggableList",
|
|
1503
1503
|
defaultData: [],
|
|
1504
1504
|
setup(e, t, n) {
|