adverich-kun-ui 0.1.501 → 0.1.503
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.
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { useSlots as
|
|
2
|
-
import { RouterLink as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
const
|
|
1
|
+
import { useSlots as E, useAttrs as K, computed as a, ref as N, createBlock as u, openBlock as o, resolveDynamicComponent as c, mergeProps as T, unref as V, withCtx as F, createElementVNode as m, normalizeClass as v, renderSlot as d, createCommentVNode as f, createVNode as D, createElementBlock as g, createTextVNode as L, toDisplayString as q, h as H } from "vue";
|
|
2
|
+
import { RouterLink as P } from "vue-router";
|
|
3
|
+
import R from "../../../KunLoaderCircular/src/components/KunLoaderCircular.vue.js";
|
|
4
|
+
import G from "../../../KunIcon/src/components/KunIcon.vue.js";
|
|
5
|
+
const J = { class: "absolute inset-0 flex items-center justify-center z-10" }, M = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "mr-2 flex items-center"
|
|
8
|
-
},
|
|
8
|
+
}, Q = {
|
|
9
9
|
key: 1,
|
|
10
10
|
class: "truncate flex items-center justify-center"
|
|
11
|
-
},
|
|
11
|
+
}, U = {
|
|
12
12
|
key: 2,
|
|
13
13
|
class: "ml-2 flex items-center"
|
|
14
|
-
},
|
|
14
|
+
}, ee = {
|
|
15
15
|
__name: "KunBtn",
|
|
16
16
|
props: {
|
|
17
17
|
text: String,
|
|
@@ -47,13 +47,14 @@ const R = { class: "absolute inset-0 flex items-center justify-center z-10" }, G
|
|
|
47
47
|
iconSize: { type: String, default: null },
|
|
48
48
|
focusColor: { type: String, default: null }
|
|
49
49
|
},
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
emits: ["click", "keydown", "keyup", "keypress"],
|
|
51
|
+
setup(n, { expose: k, emit: S }) {
|
|
52
|
+
const y = E(), l = K(), t = n, i = S, $ = a(() => !!t.to || !!t.href), w = a(() => !$.value), C = a(() => t.href ? "a" : t.to ? P : "button"), p = (e) => !e || e === !1 || e === !0 && !t.icon ? null : H(G, {
|
|
52
53
|
icon: e,
|
|
53
|
-
size:
|
|
54
|
+
size: j.value,
|
|
54
55
|
color: t.textColor ?? "text-font-color",
|
|
55
56
|
disabled: t.disabled
|
|
56
|
-
}),
|
|
57
|
+
}), z = a(() => t.href ? {
|
|
57
58
|
href: t.href,
|
|
58
59
|
target: t.target ?? "_self",
|
|
59
60
|
rel: t.target === "_blank" ? "noopener noreferrer" : null
|
|
@@ -63,7 +64,7 @@ const R = { class: "absolute inset-0 flex items-center justify-center z-10" }, G
|
|
|
63
64
|
} : {
|
|
64
65
|
type: "button",
|
|
65
66
|
disabled: t.loading || t.disabled
|
|
66
|
-
}),
|
|
67
|
+
}), B = (e) => {
|
|
67
68
|
switch (e) {
|
|
68
69
|
case "xxs":
|
|
69
70
|
return "px-1 py-1 text-xs";
|
|
@@ -82,7 +83,7 @@ const R = { class: "absolute inset-0 flex items-center justify-center z-10" }, G
|
|
|
82
83
|
default:
|
|
83
84
|
return "px-3 py-2 text-sm";
|
|
84
85
|
}
|
|
85
|
-
},
|
|
86
|
+
}, j = a(() => {
|
|
86
87
|
if (t.iconSize) return t.iconSize;
|
|
87
88
|
switch (t.size) {
|
|
88
89
|
case "xxs":
|
|
@@ -102,7 +103,7 @@ const R = { class: "absolute inset-0 flex items-center justify-center z-10" }, G
|
|
|
102
103
|
default:
|
|
103
104
|
return "text-base";
|
|
104
105
|
}
|
|
105
|
-
}),
|
|
106
|
+
}), I = a(() => {
|
|
106
107
|
const e = t.bgColor, s = t.textColor;
|
|
107
108
|
switch (t.variant) {
|
|
108
109
|
case "default":
|
|
@@ -120,27 +121,27 @@ const R = { class: "absolute inset-0 flex items-center justify-center z-10" }, G
|
|
|
120
121
|
default:
|
|
121
122
|
return `${e} ${s}`;
|
|
122
123
|
}
|
|
123
|
-
}),
|
|
124
|
-
var e, s,
|
|
125
|
-
return ((e =
|
|
126
|
-
}),
|
|
127
|
-
var e, s,
|
|
128
|
-
return ((e =
|
|
129
|
-
}),
|
|
124
|
+
}), A = a(() => !!t.text), h = a(() => {
|
|
125
|
+
var e, s, r;
|
|
126
|
+
return ((e = l.class) == null ? void 0 : e.includes("w-")) || ((s = l.class) == null ? void 0 : s.includes("min-w-")) || ((r = l.class) == null ? void 0 : r.includes("max-w-"));
|
|
127
|
+
}), O = a(() => {
|
|
128
|
+
var e, s, r;
|
|
129
|
+
return ((e = l.class) == null ? void 0 : e.includes("h-")) || ((s = l.class) == null ? void 0 : s.includes("min-h-")) || ((r = l.class) == null ? void 0 : r.includes("max-h-"));
|
|
130
|
+
}), x = a(() => {
|
|
130
131
|
var s;
|
|
131
|
-
const e = ((s = t.text) == null ? void 0 : s.length) === 1 && !
|
|
132
|
-
return !!t.icon && !t.text && !
|
|
133
|
-
}),
|
|
132
|
+
const e = ((s = t.text) == null ? void 0 : s.length) === 1 && !y.default && !t.icon;
|
|
133
|
+
return !!t.icon && !t.text && !y.default || e;
|
|
134
|
+
}), W = a(() => {
|
|
134
135
|
const e = [
|
|
135
136
|
"inline-flex items-center justify-center break-keep transition-all whitespace-nowrap",
|
|
136
|
-
|
|
137
|
+
x.value ? "" : B(t.size),
|
|
137
138
|
t.fontWeight,
|
|
138
139
|
t.rounded,
|
|
139
140
|
t.textAlign,
|
|
140
|
-
|
|
141
|
+
I.value,
|
|
141
142
|
"relative"
|
|
142
143
|
];
|
|
143
|
-
if (
|
|
144
|
+
if (l.class && e.push(l.class), x.value)
|
|
144
145
|
switch (e.push("aspect-square justify-center items-center"), t.size) {
|
|
145
146
|
case "xxs":
|
|
146
147
|
e.push("p-1");
|
|
@@ -174,49 +175,53 @@ const R = { class: "absolute inset-0 flex items-center justify-center z-10" }, G
|
|
|
174
175
|
"transition duration-100 ease-in-out",
|
|
175
176
|
"cursor-pointer",
|
|
176
177
|
t.focusColor ? `${t.focusColor}` : ""
|
|
177
|
-
) : (e.push("pointer-events-none"), t.disabled && e.push("opacity-50 cursor-not-allowed")),
|
|
178
|
-
}), b =
|
|
179
|
-
return
|
|
178
|
+
) : (e.push("pointer-events-none"), t.disabled && e.push("opacity-50 cursor-not-allowed")), A.value && !x.value && !h.value && e.push(t.minWidth), e.filter(Boolean);
|
|
179
|
+
}), b = N(null);
|
|
180
|
+
return k({
|
|
180
181
|
focus: () => {
|
|
181
182
|
var e, s;
|
|
182
183
|
return (s = (e = b.value) == null ? void 0 : e.focus) == null ? void 0 : s.call(e);
|
|
183
184
|
}
|
|
184
|
-
}), (e, s) => (
|
|
185
|
+
}), (e, s) => (o(), u(c(C.value), T({
|
|
185
186
|
ref_key: "rootEl",
|
|
186
187
|
ref: b
|
|
187
|
-
},
|
|
188
|
-
class:
|
|
189
|
-
style:
|
|
190
|
-
disabled:
|
|
188
|
+
}, z.value, {
|
|
189
|
+
class: W.value,
|
|
190
|
+
style: V(l).style,
|
|
191
|
+
disabled: w.value && (n.loading || n.disabled),
|
|
192
|
+
onClick: s[0] || (s[0] = (r) => i("click", r)),
|
|
193
|
+
onKeydown: s[1] || (s[1] = (r) => i("keydown", r)),
|
|
194
|
+
onKeyup: s[2] || (s[2] = (r) => i("keyup", r)),
|
|
195
|
+
onKeypress: s[3] || (s[3] = (r) => i("keypress", r))
|
|
191
196
|
}), {
|
|
192
|
-
default:
|
|
193
|
-
|
|
194
|
-
class:
|
|
197
|
+
default: F(() => [
|
|
198
|
+
m("div", {
|
|
199
|
+
class: v(["relative flex items-center justify-center", h.value ? "" : "w-full", O.value ? "" : "h-full"])
|
|
195
200
|
}, [
|
|
196
|
-
n.loading ?
|
|
197
|
-
|
|
198
|
-
|
|
201
|
+
n.loading ? d(e.$slots, "loader", { key: 0 }, () => [
|
|
202
|
+
m("div", J, [
|
|
203
|
+
D(R, {
|
|
199
204
|
size: "20",
|
|
200
205
|
width: "5"
|
|
201
206
|
})
|
|
202
207
|
])
|
|
203
|
-
]) :
|
|
204
|
-
|
|
205
|
-
class:
|
|
208
|
+
]) : f("", !0),
|
|
209
|
+
m("div", {
|
|
210
|
+
class: v([{ "opacity-50": n.loading }, "flex items-center justify-center w-full h-full"])
|
|
206
211
|
}, [
|
|
207
|
-
e.$slots.prepend || n.prependIcon ? (
|
|
208
|
-
|
|
209
|
-
(
|
|
210
|
-
])) :
|
|
211
|
-
n.text || e.$slots.default || n.icon ? (
|
|
212
|
-
n.icon && !n.text && !e.$slots.default ? (
|
|
213
|
-
|
|
212
|
+
e.$slots.prepend || n.prependIcon ? (o(), g("span", M, [
|
|
213
|
+
d(e.$slots, "prepend"),
|
|
214
|
+
(o(), u(c(p(n.prependIcon))))
|
|
215
|
+
])) : f("", !0),
|
|
216
|
+
n.text || e.$slots.default || n.icon ? (o(), g("span", Q, [
|
|
217
|
+
n.icon && !n.text && !e.$slots.default ? (o(), u(c(p(n.icon)), { key: 0 })) : d(e.$slots, "default", { key: 1 }, () => [
|
|
218
|
+
L(q(n.text), 1)
|
|
214
219
|
])
|
|
215
|
-
])) :
|
|
216
|
-
e.$slots.append || n.appendIcon ? (
|
|
217
|
-
|
|
218
|
-
(
|
|
219
|
-
])) :
|
|
220
|
+
])) : f("", !0),
|
|
221
|
+
e.$slots.append || n.appendIcon ? (o(), g("span", U, [
|
|
222
|
+
d(e.$slots, "append"),
|
|
223
|
+
(o(), u(c(p(n.appendIcon))))
|
|
224
|
+
])) : f("", !0)
|
|
220
225
|
], 2)
|
|
221
226
|
], 2)
|
|
222
227
|
]),
|
|
@@ -225,5 +230,5 @@ const R = { class: "absolute inset-0 flex items-center justify-center z-10" }, G
|
|
|
225
230
|
}
|
|
226
231
|
};
|
|
227
232
|
export {
|
|
228
|
-
|
|
233
|
+
ee as default
|
|
229
234
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { mergeModels as Q, toRefs as Se, useModel as be, ref as
|
|
1
|
+
import { mergeModels as Q, toRefs as Se, useModel as be, ref as y, watch as q, computed as G, onMounted as Ce, createElementBlock as r, openBlock as l, mergeProps as O, createCommentVNode as u, createElementVNode as b, renderSlot as a, createBlock as C, unref as s, normalizeClass as T, withCtx as j, createVNode as F, withDirectives as J, vModelText as Te, vShow as X, normalizeProps as d, guardReactiveProps as g, Fragment as Fe, createSlots as Y, renderList as Z, toDisplayString as $e, isRef as ke, nextTick as Pe } from "vue";
|
|
2
2
|
import { isMobile as m } from "../../../../utils/_platform.js";
|
|
3
3
|
import _ from "../../../KunIcon/src/components/KunIcon.vue.js";
|
|
4
4
|
import Me from "../../../../icons/IconFilter.vue.js";
|
|
@@ -8,19 +8,19 @@ import Re from "./KunTableFooter.vue.js";
|
|
|
8
8
|
import Ee from "./KunTableRows.vue.js";
|
|
9
9
|
import Be from "./KunTableIterators.vue.js";
|
|
10
10
|
import Ve from "../../../KunBtn/src/components/KunBtn.vue.js";
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
11
|
+
import xe from "./KunTableFilter.vue.js";
|
|
12
|
+
import Oe from "../composables/useExpand.js";
|
|
13
|
+
import je from "../composables/useOptions.js";
|
|
14
14
|
import ze from "../composables/useSelect.js";
|
|
15
15
|
import De from "../composables/useFilter.js";
|
|
16
16
|
import He from "../composables/KunTableProps.js";
|
|
17
|
-
const Ne = ["placeholder"],
|
|
17
|
+
const Ne = { class: "w-full flex items-left" }, Ke = ["placeholder"], Le = { class: "flex-1 overflow-auto bg-surface" }, Ue = { key: 0 }, We = { key: 5 }, Qe = {
|
|
18
18
|
key: 1,
|
|
19
19
|
class: "h-full flex justify-center items-center"
|
|
20
|
-
},
|
|
20
|
+
}, qe = { class: "text-center text-4xl" }, Ge = {
|
|
21
21
|
key: 1,
|
|
22
22
|
class: "sticky bottom-0 z-10 print:hidden"
|
|
23
|
-
},
|
|
23
|
+
}, Je = "overflow-hidden h-full w-full flex flex-col border border-slate-200 dark:border-slate-800 rounded", Xe = "table-auto w-full h-fit text-sm text-left", fs = {
|
|
24
24
|
__name: "KunTable",
|
|
25
25
|
props: /* @__PURE__ */ Q(He(), {
|
|
26
26
|
selectedItems: { type: Array, default: () => [] },
|
|
@@ -28,24 +28,24 @@ const Ne = ["placeholder"], Ke = { class: "flex-1 overflow-auto bg-surface" }, L
|
|
|
28
28
|
}),
|
|
29
29
|
emits: /* @__PURE__ */ Q(["update:page", "update:itemsPerPage", "update:sortBy", "update:search", "focusOnSearch"], ["update:selectedItems"]),
|
|
30
30
|
setup(z, { emit: ee }) {
|
|
31
|
-
const S = ee, p = z,
|
|
31
|
+
const S = ee, p = z, $ = Se(p), se = be(z, "selectedItems"), {
|
|
32
32
|
headers: D,
|
|
33
|
-
showExpand:
|
|
34
|
-
showSelect:
|
|
33
|
+
showExpand: k,
|
|
34
|
+
showSelect: P,
|
|
35
35
|
rowClass: H,
|
|
36
36
|
hideDefaultFooter: oe,
|
|
37
37
|
hideDefaultHeader: te,
|
|
38
38
|
tableClass: le,
|
|
39
39
|
wrapperClass: ae,
|
|
40
40
|
pageOptions: ne,
|
|
41
|
-
items:
|
|
41
|
+
items: Ye,
|
|
42
42
|
searchable: N,
|
|
43
43
|
debounceTime: re
|
|
44
|
-
} =
|
|
44
|
+
} = $, w = y(p.search);
|
|
45
45
|
q(() => p.search, (e) => {
|
|
46
46
|
e !== w.value && (w.value = e);
|
|
47
47
|
});
|
|
48
|
-
const
|
|
48
|
+
const M = G(() => p.headers.map((e) => {
|
|
49
49
|
var t, c;
|
|
50
50
|
const o = { ...e };
|
|
51
51
|
if ((e.columnType === "function" || e.columnType == "objectFunction" || e.columnType == "simpleFunction") && typeof e.columnFunction == "string") {
|
|
@@ -61,59 +61,61 @@ const Ne = ["placeholder"], Ke = { class: "flex-1 overflow-auto bg-surface" }, L
|
|
|
61
61
|
), o.columnRowText = () => "");
|
|
62
62
|
}
|
|
63
63
|
return o;
|
|
64
|
-
})), { filteredItems: K, setSearch: ie, modalFilter:
|
|
64
|
+
})), { filteredItems: K, setSearch: ie, modalFilter: v, applyColumnFilters: ce, clearFilters: ue, appliedFilters: de } = De($, re, M);
|
|
65
65
|
q(w, (e) => {
|
|
66
66
|
S("update:search", e), ie(e);
|
|
67
67
|
});
|
|
68
|
-
const { options: i, paginatedItems: f, updateSort: pe } =
|
|
68
|
+
const { options: i, paginatedItems: f, updateSort: pe } = je($, S, K), { isSelected: A, toggleSelect: I, toggleSelectAll: me, allSelected: fe, someSelected: he } = ze(f, se), { isExpanded: R, toggleExpand: E } = Oe(), h = G(() => ({
|
|
69
69
|
items: f.value,
|
|
70
70
|
headers: D.value,
|
|
71
71
|
page: i.page,
|
|
72
72
|
itemsPerPage: i.itemsPerPage,
|
|
73
|
-
toggleSelect:
|
|
74
|
-
isSelected:
|
|
75
|
-
toggleExpand:
|
|
76
|
-
isExpanded:
|
|
73
|
+
toggleSelect: I,
|
|
74
|
+
isSelected: A,
|
|
75
|
+
toggleExpand: E,
|
|
76
|
+
isExpanded: R,
|
|
77
77
|
sortBy: i.sortBy,
|
|
78
78
|
hasActions: p.hasActions
|
|
79
|
-
})), ge = [
|
|
79
|
+
})), ge = [Je, ae.value], we = [Xe, le.value];
|
|
80
80
|
Ce(() => U());
|
|
81
|
-
const L =
|
|
82
|
-
function ye() {
|
|
83
|
-
ve();
|
|
84
|
-
}
|
|
81
|
+
const L = y(null), B = y(!0), V = y(!1);
|
|
85
82
|
function ve() {
|
|
83
|
+
ye();
|
|
84
|
+
}
|
|
85
|
+
function ye() {
|
|
86
86
|
m.value && (W(), Pe(() => {
|
|
87
87
|
L.value.focus();
|
|
88
88
|
}));
|
|
89
89
|
}
|
|
90
90
|
function U() {
|
|
91
|
-
m.value && (
|
|
91
|
+
m.value && (x.value = "w-fit", B.value = !1, V.value = !0, S("focusOnSearch", !1));
|
|
92
92
|
}
|
|
93
93
|
function W() {
|
|
94
|
-
m.value && (
|
|
94
|
+
m.value && (x.value = "w-full border", V.value = !1, B.value = !0, S("focusOnSearch", !0));
|
|
95
95
|
}
|
|
96
|
-
const
|
|
96
|
+
const x = y("w-full border max-w-sm");
|
|
97
97
|
return (e, o) => (l(), r("div", O({ class: ge }, e.$attrs, { style: { "user-select": "text" } }), [
|
|
98
98
|
s(N) || e.filterable || e.$slots.prependSearch || e.$slots.appendSearch ? (l(), r("div", {
|
|
99
99
|
key: 0,
|
|
100
|
-
class:
|
|
100
|
+
class: T(["p-2 bg-surface print:hidden", {
|
|
101
101
|
"justify-start flex": e.searchPosition === "start",
|
|
102
102
|
"justify-center flex": e.searchPosition === "center",
|
|
103
103
|
"justify-end flex": e.searchPosition === "end"
|
|
104
104
|
}])
|
|
105
105
|
}, [
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
b("div", Ne, [
|
|
107
|
+
a(e.$slots, "prependSearch")
|
|
108
|
+
]),
|
|
109
|
+
e.filterable && e.filters.length ? (l(), C(Ve, {
|
|
108
110
|
key: 0,
|
|
109
111
|
class: "h-fit",
|
|
110
|
-
onClick: o[0] || (o[0] = (t) =>
|
|
112
|
+
onClick: o[0] || (o[0] = (t) => v.value = !0),
|
|
111
113
|
rounded: "rounded-full",
|
|
112
114
|
size: "xs",
|
|
113
115
|
bgColor: "bg-green-200 dark:bg-green-800"
|
|
114
116
|
}, {
|
|
115
|
-
default:
|
|
116
|
-
|
|
117
|
+
default: j(() => [
|
|
118
|
+
F(_, {
|
|
117
119
|
class: "h-fit",
|
|
118
120
|
icon: Me,
|
|
119
121
|
size: "text-lg"
|
|
@@ -123,44 +125,44 @@ const Ne = ["placeholder"], Ke = { class: "flex-1 overflow-auto bg-surface" }, L
|
|
|
123
125
|
})) : u("", !0),
|
|
124
126
|
s(N) ? (l(), r("div", {
|
|
125
127
|
key: 1,
|
|
126
|
-
class:
|
|
128
|
+
class: T(["rounded flex mx-2", [x.value]])
|
|
127
129
|
}, [
|
|
128
|
-
J(
|
|
130
|
+
J(b("input", {
|
|
129
131
|
"onUpdate:modelValue": o[1] || (o[1] = (t) => w.value = t),
|
|
130
132
|
type: "text",
|
|
131
133
|
placeholder: e.searchPlaceholder,
|
|
132
|
-
class:
|
|
134
|
+
class: T(["w-full text-sm", s(m) ? "px-1" : "px-2 py-1"]),
|
|
133
135
|
ref_key: "searchRef",
|
|
134
136
|
ref: L,
|
|
135
137
|
onFocus: W,
|
|
136
138
|
onBlur: U
|
|
137
|
-
}, null, 42,
|
|
139
|
+
}, null, 42, Ke), [
|
|
138
140
|
[Te, w.value],
|
|
139
|
-
[X,
|
|
141
|
+
[X, B.value]
|
|
140
142
|
]),
|
|
141
|
-
J(
|
|
143
|
+
J(F(_, {
|
|
142
144
|
icon: Ae,
|
|
143
|
-
onClick:
|
|
145
|
+
onClick: ve
|
|
144
146
|
}, null, 512), [
|
|
145
|
-
[X,
|
|
147
|
+
[X, V.value]
|
|
146
148
|
])
|
|
147
149
|
], 2)) : u("", !0),
|
|
148
150
|
a(e.$slots, "appendSearch")
|
|
149
151
|
], 2)) : u("", !0),
|
|
150
|
-
|
|
152
|
+
b("div", Le, [
|
|
151
153
|
s(f).length ? (l(), r("table", {
|
|
152
154
|
key: 0,
|
|
153
|
-
class:
|
|
155
|
+
class: T(we)
|
|
154
156
|
}, [
|
|
155
|
-
e.$slots.colgroup && !s(m) ? (l(), r("colgroup",
|
|
157
|
+
e.$slots.colgroup && !s(m) ? (l(), r("colgroup", Ue, [
|
|
156
158
|
a(e.$slots, "colgroup", d(g(h.value)))
|
|
157
159
|
])) : u("", !0),
|
|
158
|
-
!s(te) && !s(m) ? (l(),
|
|
160
|
+
!s(te) && !s(m) ? (l(), C(Ie, {
|
|
159
161
|
key: 1,
|
|
160
162
|
headers: s(D),
|
|
161
163
|
"sort-by": s(i).sortBy,
|
|
162
|
-
"show-select": s(
|
|
163
|
-
"show-expand": s(
|
|
164
|
+
"show-select": s(P),
|
|
165
|
+
"show-expand": s(k),
|
|
164
166
|
"all-selected": s(fe),
|
|
165
167
|
"some-selected": s(he),
|
|
166
168
|
"thead-class": e.theadClass,
|
|
@@ -172,33 +174,33 @@ const Ne = ["placeholder"], Ke = { class: "flex-1 overflow-auto bg-surface" }, L
|
|
|
172
174
|
onToggleSelectAll: s(me),
|
|
173
175
|
customHeaders: e.customSlots
|
|
174
176
|
}, null, 8, ["headers", "sort-by", "show-select", "show-expand", "all-selected", "some-selected", "thead-class", "tr-class", "th-class", "has-actions", "action-label", "onSort", "onToggleSelectAll", "customHeaders"])) : a(e.$slots, "thead", d(O({ key: 2 }, h.value))),
|
|
175
|
-
s(m) ? (l(),
|
|
177
|
+
s(m) ? (l(), C(Be, {
|
|
176
178
|
key: 4,
|
|
177
179
|
items: s(f),
|
|
178
|
-
headers:
|
|
180
|
+
headers: M.value,
|
|
179
181
|
"row-class": s(H),
|
|
180
182
|
"row-class-condition": e.rowClassCondition,
|
|
181
|
-
"is-selected": s(
|
|
182
|
-
"is-expanded": s(
|
|
183
|
-
"show-select": s(
|
|
184
|
-
"show-expand": s(
|
|
183
|
+
"is-selected": s(A),
|
|
184
|
+
"is-expanded": s(R),
|
|
185
|
+
"show-select": s(P),
|
|
186
|
+
"show-expand": s(k),
|
|
185
187
|
"has-actions": e.hasActions,
|
|
186
188
|
"action-loading-map": e.actionLoadingMap,
|
|
187
|
-
onToggleExpand: s(
|
|
188
|
-
onToggleSelect: s(
|
|
189
|
+
onToggleExpand: s(E),
|
|
190
|
+
onToggleSelect: s(I),
|
|
189
191
|
customSlots: e.customSlots
|
|
190
192
|
}, Y({ _: 2 }, [
|
|
191
193
|
Z(e.$slots, (t, c) => ({
|
|
192
194
|
name: c,
|
|
193
|
-
fn:
|
|
195
|
+
fn: j((n) => [
|
|
194
196
|
a(e.$slots, c, d(g(n)))
|
|
195
197
|
])
|
|
196
198
|
}))
|
|
197
199
|
]), 1032, ["items", "headers", "row-class", "row-class-condition", "is-selected", "is-expanded", "show-select", "show-expand", "has-actions", "action-loading-map", "onToggleExpand", "onToggleSelect", "customSlots"])) : (l(), r(Fe, { key: 3 }, [
|
|
198
200
|
a(e.$slots, "body.prepend", d(g(h.value))),
|
|
199
|
-
|
|
201
|
+
F(Ee, {
|
|
200
202
|
items: s(f),
|
|
201
|
-
headers:
|
|
203
|
+
headers: M.value,
|
|
202
204
|
"tbody-class": e.tbodyClass,
|
|
203
205
|
"row-class": s(H),
|
|
204
206
|
"row-class-condition": e.rowClassCondition,
|
|
@@ -206,35 +208,35 @@ const Ne = ["placeholder"], Ke = { class: "flex-1 overflow-auto bg-surface" }, L
|
|
|
206
208
|
"td-class": e.tdClass,
|
|
207
209
|
"selected-class": e.selectedClass,
|
|
208
210
|
"striped-class": e.stripedClass,
|
|
209
|
-
"is-selected": s(
|
|
210
|
-
"is-expanded": s(
|
|
211
|
-
"show-select": s(
|
|
212
|
-
"show-expand": s(
|
|
211
|
+
"is-selected": s(A),
|
|
212
|
+
"is-expanded": s(R),
|
|
213
|
+
"show-select": s(P),
|
|
214
|
+
"show-expand": s(k),
|
|
213
215
|
"has-actions": e.hasActions,
|
|
214
216
|
"action-loading-map": e.actionLoadingMap,
|
|
215
|
-
onToggleExpand: s(
|
|
216
|
-
onToggleSelect: s(
|
|
217
|
+
onToggleExpand: s(E),
|
|
218
|
+
onToggleSelect: s(I),
|
|
217
219
|
customSlots: e.customSlots
|
|
218
220
|
}, Y({ _: 2 }, [
|
|
219
221
|
Z(e.$slots, (t, c) => ({
|
|
220
222
|
name: c,
|
|
221
|
-
fn:
|
|
223
|
+
fn: j((n) => [
|
|
222
224
|
a(e.$slots, c, d(g(n)))
|
|
223
225
|
])
|
|
224
226
|
}))
|
|
225
227
|
]), 1032, ["items", "headers", "tbody-class", "row-class", "row-class-condition", "tr-class", "td-class", "selected-class", "striped-class", "is-selected", "is-expanded", "show-select", "show-expand", "has-actions", "action-loading-map", "onToggleExpand", "onToggleSelect", "customSlots"]),
|
|
226
228
|
a(e.$slots, "body.append", d(g(h.value)))
|
|
227
229
|
], 64)),
|
|
228
|
-
e.$slots.tfoot ? (l(), r("tfoot",
|
|
230
|
+
e.$slots.tfoot ? (l(), r("tfoot", We, [
|
|
229
231
|
a(e.$slots, "tfoot", d(g(h.value)))
|
|
230
232
|
])) : u("", !0)
|
|
231
233
|
])) : u("", !0),
|
|
232
|
-
s(f).length ? u("", !0) : (l(), r("div",
|
|
233
|
-
|
|
234
|
+
s(f).length ? u("", !0) : (l(), r("div", Qe, [
|
|
235
|
+
b("div", qe, $e(e.noDataText), 1)
|
|
234
236
|
]))
|
|
235
237
|
]),
|
|
236
|
-
s(oe) ? a(e.$slots, "footer", d(O({ key: 2 }, h.value))) : (l(), r("div",
|
|
237
|
-
|
|
238
|
+
s(oe) ? a(e.$slots, "footer", d(O({ key: 2 }, h.value))) : (l(), r("div", Ge, [
|
|
239
|
+
F(Re, {
|
|
238
240
|
"items-length": s(K).length,
|
|
239
241
|
"items-per-page": s(i).itemsPerPage,
|
|
240
242
|
"current-page": s(i).page,
|
|
@@ -243,11 +245,11 @@ const Ne = ["placeholder"], Ke = { class: "flex-1 overflow-auto bg-surface" }, L
|
|
|
243
245
|
"onUpdate:page": o[3] || (o[3] = (t) => s(i).page = t)
|
|
244
246
|
}, null, 8, ["items-length", "items-per-page", "current-page", "page-options"])
|
|
245
247
|
])),
|
|
246
|
-
e.filterable && s(
|
|
248
|
+
e.filterable && s(v) ? (l(), C(xe, {
|
|
247
249
|
key: 3,
|
|
248
250
|
filters: e.filters,
|
|
249
|
-
modelValue: s(
|
|
250
|
-
"onUpdate:modelValue": o[4] || (o[4] = (t) => ke(
|
|
251
|
+
modelValue: s(v),
|
|
252
|
+
"onUpdate:modelValue": o[4] || (o[4] = (t) => ke(v) ? v.value = t : null),
|
|
251
253
|
onApplyFilters: s(ce),
|
|
252
254
|
onClearFilters: s(ue),
|
|
253
255
|
activeFilters: s(de).byColumn
|
|
@@ -256,5 +258,5 @@ const Ne = ["placeholder"], Ke = { class: "flex-1 overflow-auto bg-surface" }, L
|
|
|
256
258
|
}
|
|
257
259
|
};
|
|
258
260
|
export {
|
|
259
|
-
|
|
261
|
+
fs as default
|
|
260
262
|
};
|
|
@@ -1,25 +1,21 @@
|
|
|
1
|
-
function
|
|
2
|
-
var
|
|
1
|
+
function f(t, n) {
|
|
2
|
+
var o;
|
|
3
3
|
if (!t || !t.value) return;
|
|
4
4
|
if (t.columnType === "relation") {
|
|
5
|
-
const i =
|
|
5
|
+
const i = a(n, t.relationPath);
|
|
6
6
|
return u(i);
|
|
7
7
|
}
|
|
8
8
|
if (t.columnType === "function") {
|
|
9
|
-
const i = (
|
|
10
|
-
return u(i);
|
|
11
|
-
}
|
|
12
|
-
if (t.columnFormat === "function") {
|
|
13
|
-
const i = (c = t.columnFunction) == null ? void 0 : c.call(t, n, t);
|
|
9
|
+
const i = (o = t.columnFunction) == null ? void 0 : o.call(t, n, t);
|
|
14
10
|
return u(i);
|
|
15
11
|
}
|
|
16
|
-
const
|
|
17
|
-
return u(
|
|
12
|
+
const e = n == null ? void 0 : n[t.value];
|
|
13
|
+
return u(e);
|
|
18
14
|
}
|
|
19
|
-
function
|
|
20
|
-
return t.columnType === "toComplete" ? "" : n == null ? "Sin datos" : t.columnType === "dateTime" || t.columnType === "date" ? (
|
|
15
|
+
function m(t, n) {
|
|
16
|
+
return t.columnType === "toComplete" ? "" : n == null ? "Sin datos" : t.columnType === "dateTime" || t.columnType === "date" ? (r[t.columnType] || r.default)(n) : (r[t.columnFormat] || r.default)(n);
|
|
21
17
|
}
|
|
22
|
-
const
|
|
18
|
+
const r = {
|
|
23
19
|
default: (t) => t,
|
|
24
20
|
// TEXTS
|
|
25
21
|
text: (t) => String(t),
|
|
@@ -61,14 +57,14 @@ const e = {
|
|
|
61
57
|
hourCycle: "h23"
|
|
62
58
|
}).format(n);
|
|
63
59
|
},
|
|
64
|
-
secondsToTime: (t) =>
|
|
60
|
+
secondsToTime: (t) => c(t ?? 0)
|
|
65
61
|
};
|
|
66
|
-
function
|
|
67
|
-
return !t || !n ? t : n.split(".").reduce((
|
|
62
|
+
function a(t, n) {
|
|
63
|
+
return !t || !n ? t : n.split(".").reduce((e, o) => e == null ? void 0 : e[o], t);
|
|
68
64
|
}
|
|
69
|
-
function
|
|
70
|
-
const n = Math.floor(t / 3600),
|
|
71
|
-
return `${n} horas, ${
|
|
65
|
+
function c(t) {
|
|
66
|
+
const n = Math.floor(t / 3600), e = Math.floor(t % 3600 / 60), o = t % 60;
|
|
67
|
+
return `${n} horas, ${e} minutos y ${o} segundos`;
|
|
72
68
|
}
|
|
73
69
|
function u(t) {
|
|
74
70
|
if (t != null && !(t === "null" || t === "undefined"))
|
|
@@ -79,8 +75,8 @@ function s(t) {
|
|
|
79
75
|
return !isNaN(n.getTime());
|
|
80
76
|
}
|
|
81
77
|
export {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
78
|
+
m as formatValue,
|
|
79
|
+
r as formatters,
|
|
80
|
+
a as getNestedValue,
|
|
81
|
+
f as getValue
|
|
86
82
|
};
|