@oneb/ui-vue 0.3.13 → 0.3.15
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/CheckIcon-09b84cf5.cjs +1 -0
- package/dist/CheckIcon-f1c94824.js +20 -0
- package/dist/ChevronDownIcon-6805ce6c.js +20 -0
- package/dist/ChevronDownIcon-6889ac87.cjs +1 -0
- package/dist/{ChevronRightIcon-8df1af46.js → ChevronRightIcon-4549a26b.js} +4 -21
- package/dist/ChevronRightIcon-7a2f0c20.cjs +1 -0
- package/dist/NoSymbolIcon-5d326416.cjs +1 -0
- package/dist/NoSymbolIcon-e58a9aee.js +71 -0
- package/dist/OneHelpMenu-66a2d4c2.cjs +1 -0
- package/dist/OneHelpMenu-d7a39a69.js +856 -0
- package/dist/OneMarkdown.vue_vue_type_style_index_0_lang-0ea8fbf8.cjs +1 -0
- package/dist/OneMarkdown.vue_vue_type_style_index_0_lang-4ed993c7.js +1 -0
- package/dist/{SpinnerIcon-516264ba.js → SpinnerIcon-74648c98.js} +6 -5
- package/dist/SpinnerIcon-ccb6f3fc.cjs +1 -0
- package/dist/SpinnerIcon.vue_vue_type_style_index_0_lang-0ea8fbf8.cjs +1 -0
- package/dist/SpinnerIcon.vue_vue_type_style_index_0_lang-4ed993c7.js +1 -0
- package/dist/button/index.cjs +1 -1
- package/dist/button/index.js +17 -16
- package/dist/buttonGroup/index.cjs +1 -0
- package/dist/buttonGroup/index.js +31 -0
- package/dist/checkbox/index.cjs +1 -0
- package/dist/checkbox/index.js +124 -0
- package/dist/collapse/index.cjs +1 -0
- package/dist/collapse/index.js +58 -0
- package/dist/common/index.cjs +1 -16
- package/dist/common/index.js +14 -3120
- package/dist/dataTable/index.cjs +1 -1
- package/dist/dataTable/index.js +846 -9
- package/dist/dropdown/index.cjs +1 -1
- package/dist/dropdown/index.js +792 -17
- package/dist/entityPicker/index.cjs +1 -0
- package/dist/entityPicker/index.js +584 -0
- package/dist/errorsPage/index.cjs +1 -0
- package/dist/errorsPage/index.js +63 -0
- package/dist/floating-ui.dom-2121a4fd.cjs +1 -0
- package/dist/floating-ui.dom-4509432e.js +941 -0
- package/dist/i18n/index.cjs +1 -0
- package/dist/{useI18n-2103b39e.js → i18n/index.js} +4 -4
- package/dist/index.cjs +1 -1
- package/dist/index.js +114 -10295
- package/dist/indicators/index.cjs +1 -0
- package/dist/indicators/index.js +84 -0
- package/dist/infobox/index.cjs +1 -0
- package/dist/infobox/index.js +111 -0
- package/dist/label/index.cjs +1 -0
- package/dist/label/index.js +47 -0
- package/dist/layout/index.cjs +1 -1
- package/dist/layout/index.js +115 -109
- package/dist/modal/index.cjs +1 -0
- package/dist/modal/index.js +41 -0
- package/dist/periodPicker/index.cjs +1 -0
- package/dist/periodPicker/index.js +1323 -0
- package/dist/radio/index.cjs +1 -0
- package/dist/radio/index.js +73 -0
- package/dist/skeleton/index.cjs +1 -0
- package/dist/skeleton/index.js +46 -0
- package/dist/style.css +1 -1
- package/dist/switch/index.cjs +1 -0
- package/dist/switch/index.js +142 -0
- package/dist/toast/index.cjs +1 -0
- package/dist/toast/index.js +140 -0
- package/dist/tooltip/index.cjs +1 -0
- package/dist/tooltip/index.js +20 -0
- package/dist/useModal-85f57682.js +177 -0
- package/dist/useModal-98810f6a.cjs +1 -0
- package/package.json +4 -4
- package/dist/ChevronRightIcon-6aa413c4.cjs +0 -1
- package/dist/OneHelpMenu-8e315cb3.js +0 -1791
- package/dist/OneHelpMenu-95ae3d5a.cjs +0 -1
- package/dist/SpinnerIcon-01be39fe.cjs +0 -1
- package/dist/index-19e93dfb.js +0 -954
- package/dist/index-85e729ab.cjs +0 -1
- package/dist/index-8b41a099.cjs +0 -1
- package/dist/index-98daa7ed.js +0 -862
- package/dist/useI18n-bcf9c640.cjs +0 -1
package/dist/dataTable/index.js
CHANGED
|
@@ -1,11 +1,848 @@
|
|
|
1
|
-
import { _ as p,
|
|
2
|
-
import "
|
|
3
|
-
import "../
|
|
4
|
-
import "../
|
|
5
|
-
import "../
|
|
6
|
-
import "../
|
|
1
|
+
import { openBlock as l, createElementBlock as i, createElementVNode as c, defineComponent as ee, computed as y, normalizeClass as b, toDisplayString as S, Fragment as _, renderList as E, unref as p, createCommentVNode as h, createBlock as C, resolveDynamicComponent as k, useSlots as we, ref as N, provide as je, watch as W, withDirectives as Ne, renderSlot as P, vShow as Ae, normalizeStyle as J, createTextVNode as Q, withModifiers as fe, createVNode as Ke, inject as Ve, onBeforeUnmount as We } from "vue";
|
|
2
|
+
import { useOnebI18n as Ce } from "../i18n/index.js";
|
|
3
|
+
import { a as ke, r as Ue } from "../ChevronRightIcon-4549a26b.js";
|
|
4
|
+
import { S as ye } from "../SpinnerIcon-74648c98.js";
|
|
5
|
+
import { r as ge } from "../ChevronDownIcon-6805ce6c.js";
|
|
6
|
+
import { r as he } from "../CheckIcon-f1c94824.js";
|
|
7
|
+
import { _ as Ie } from "../_plugin-vue_export-helper-dad06003.js";
|
|
8
|
+
import "../SpinnerIcon.vue_vue_type_style_index_0_lang-4ed993c7.js";
|
|
9
|
+
function He(d, a) {
|
|
10
|
+
return l(), i("svg", {
|
|
11
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
12
|
+
fill: "none",
|
|
13
|
+
viewBox: "0 0 24 24",
|
|
14
|
+
"stroke-width": "1.8",
|
|
15
|
+
stroke: "currentColor",
|
|
16
|
+
"aria-hidden": "true"
|
|
17
|
+
}, [
|
|
18
|
+
c("path", {
|
|
19
|
+
"stroke-linecap": "round",
|
|
20
|
+
"stroke-linejoin": "round",
|
|
21
|
+
d: "M15.75 19.5L8.25 12l7.5-7.5"
|
|
22
|
+
})
|
|
23
|
+
]);
|
|
24
|
+
}
|
|
25
|
+
function be(d, a) {
|
|
26
|
+
return l(), i("svg", {
|
|
27
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
28
|
+
fill: "none",
|
|
29
|
+
viewBox: "0 0 24 24",
|
|
30
|
+
"stroke-width": "1.8",
|
|
31
|
+
stroke: "currentColor",
|
|
32
|
+
"aria-hidden": "true"
|
|
33
|
+
}, [
|
|
34
|
+
c("path", {
|
|
35
|
+
"stroke-linecap": "round",
|
|
36
|
+
"stroke-linejoin": "round",
|
|
37
|
+
d: "M8.25 15L12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9"
|
|
38
|
+
})
|
|
39
|
+
]);
|
|
40
|
+
}
|
|
41
|
+
const Ge = {
|
|
42
|
+
field: {
|
|
43
|
+
type: String,
|
|
44
|
+
required: !1
|
|
45
|
+
},
|
|
46
|
+
header: {
|
|
47
|
+
type: String,
|
|
48
|
+
required: !1
|
|
49
|
+
},
|
|
50
|
+
sortable: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: !1
|
|
53
|
+
},
|
|
54
|
+
sortField: {
|
|
55
|
+
type: String,
|
|
56
|
+
required: !1
|
|
57
|
+
},
|
|
58
|
+
filterable: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
default: !1
|
|
61
|
+
},
|
|
62
|
+
filterField: {
|
|
63
|
+
type: String,
|
|
64
|
+
required: !1
|
|
65
|
+
},
|
|
66
|
+
expander: {
|
|
67
|
+
type: Boolean,
|
|
68
|
+
default: !1
|
|
69
|
+
},
|
|
70
|
+
width: {
|
|
71
|
+
type: String,
|
|
72
|
+
required: !1
|
|
73
|
+
},
|
|
74
|
+
headerClass: {
|
|
75
|
+
type: String,
|
|
76
|
+
required: !1
|
|
77
|
+
},
|
|
78
|
+
bodyClass: {
|
|
79
|
+
type: String,
|
|
80
|
+
required: !1
|
|
81
|
+
},
|
|
82
|
+
headerStyle: {
|
|
83
|
+
type: [String, Object],
|
|
84
|
+
required: !1
|
|
85
|
+
},
|
|
86
|
+
bodyStyle: {
|
|
87
|
+
type: [String, Object],
|
|
88
|
+
required: !1
|
|
89
|
+
}
|
|
90
|
+
}, Je = {
|
|
91
|
+
value: {
|
|
92
|
+
type: Array,
|
|
93
|
+
default: () => []
|
|
94
|
+
},
|
|
95
|
+
dataKey: {
|
|
96
|
+
type: String,
|
|
97
|
+
required: !1
|
|
98
|
+
},
|
|
99
|
+
lazy: {
|
|
100
|
+
type: Boolean,
|
|
101
|
+
default: !1
|
|
102
|
+
},
|
|
103
|
+
paginator: {
|
|
104
|
+
type: Boolean,
|
|
105
|
+
default: !1
|
|
106
|
+
},
|
|
107
|
+
rows: {
|
|
108
|
+
type: Number,
|
|
109
|
+
default: 10
|
|
110
|
+
},
|
|
111
|
+
first: {
|
|
112
|
+
type: Number,
|
|
113
|
+
default: 0
|
|
114
|
+
},
|
|
115
|
+
totalRecords: {
|
|
116
|
+
type: Number,
|
|
117
|
+
required: !1
|
|
118
|
+
},
|
|
119
|
+
rowsPerPageOptions: {
|
|
120
|
+
type: Array,
|
|
121
|
+
default: () => [10, 25, 50, 100]
|
|
122
|
+
},
|
|
123
|
+
sortField: {
|
|
124
|
+
type: String,
|
|
125
|
+
required: !1
|
|
126
|
+
},
|
|
127
|
+
sortOrder: {
|
|
128
|
+
type: Number,
|
|
129
|
+
default: null
|
|
130
|
+
},
|
|
131
|
+
selectionMode: {
|
|
132
|
+
type: String,
|
|
133
|
+
required: !1
|
|
134
|
+
},
|
|
135
|
+
selection: {
|
|
136
|
+
type: [Object, Array],
|
|
137
|
+
required: !1
|
|
138
|
+
},
|
|
139
|
+
expandedRows: {
|
|
140
|
+
type: [Array, Object],
|
|
141
|
+
default: () => []
|
|
142
|
+
},
|
|
143
|
+
filters: {
|
|
144
|
+
type: Object,
|
|
145
|
+
required: !1
|
|
146
|
+
},
|
|
147
|
+
filterDisplay: {
|
|
148
|
+
type: String,
|
|
149
|
+
default: null
|
|
150
|
+
},
|
|
151
|
+
globalFilterFields: {
|
|
152
|
+
type: Array,
|
|
153
|
+
required: !1
|
|
154
|
+
},
|
|
155
|
+
loading: {
|
|
156
|
+
type: Boolean,
|
|
157
|
+
default: !1
|
|
158
|
+
},
|
|
159
|
+
striped: {
|
|
160
|
+
type: Boolean,
|
|
161
|
+
default: !1
|
|
162
|
+
},
|
|
163
|
+
hoverable: {
|
|
164
|
+
type: Boolean,
|
|
165
|
+
default: !0
|
|
166
|
+
},
|
|
167
|
+
bordered: {
|
|
168
|
+
type: Boolean,
|
|
169
|
+
default: !1
|
|
170
|
+
},
|
|
171
|
+
size: {
|
|
172
|
+
type: String,
|
|
173
|
+
default: "md"
|
|
174
|
+
},
|
|
175
|
+
tableClass: {
|
|
176
|
+
type: String,
|
|
177
|
+
required: !1
|
|
178
|
+
},
|
|
179
|
+
hasNextPage: {
|
|
180
|
+
type: Boolean,
|
|
181
|
+
default: !1
|
|
182
|
+
},
|
|
183
|
+
loadingNext: {
|
|
184
|
+
type: Boolean,
|
|
185
|
+
default: !1
|
|
186
|
+
},
|
|
187
|
+
loadMoreLabel: {
|
|
188
|
+
type: String,
|
|
189
|
+
default: ""
|
|
190
|
+
},
|
|
191
|
+
colWidths: {
|
|
192
|
+
type: [Array, Function],
|
|
193
|
+
required: !1
|
|
194
|
+
},
|
|
195
|
+
verticalBorders: {
|
|
196
|
+
type: String,
|
|
197
|
+
default: "none"
|
|
198
|
+
},
|
|
199
|
+
headerVariant: {
|
|
200
|
+
type: String,
|
|
201
|
+
default: "default"
|
|
202
|
+
},
|
|
203
|
+
headerBgClass: {
|
|
204
|
+
type: String,
|
|
205
|
+
required: !1
|
|
206
|
+
},
|
|
207
|
+
bodyBgClass: {
|
|
208
|
+
type: String,
|
|
209
|
+
required: !1
|
|
210
|
+
},
|
|
211
|
+
wrapperClass: {
|
|
212
|
+
type: String,
|
|
213
|
+
required: !1
|
|
214
|
+
},
|
|
215
|
+
wrapperBordered: {
|
|
216
|
+
type: Boolean,
|
|
217
|
+
default: !0
|
|
218
|
+
}
|
|
219
|
+
}, Se = Symbol("OneDataTable"), ve = {
|
|
220
|
+
contains: (d, a) => String(d ?? "").toLowerCase().includes(String(a).toLowerCase()),
|
|
221
|
+
startsWith: (d, a) => String(d ?? "").toLowerCase().startsWith(String(a).toLowerCase()),
|
|
222
|
+
endsWith: (d, a) => String(d ?? "").toLowerCase().endsWith(String(a).toLowerCase()),
|
|
223
|
+
equals: (d, a) => String(d ?? "").toLowerCase() === String(a).toLowerCase(),
|
|
224
|
+
notEquals: (d, a) => String(d ?? "").toLowerCase() !== String(a).toLowerCase()
|
|
225
|
+
}, Qe = (d = !0) => {
|
|
226
|
+
const a = ["overflow-x-auto", "w-full"];
|
|
227
|
+
return d && a.push("border", "border-gray-100", "rounded"), a;
|
|
228
|
+
}, Xe = (d) => {
|
|
229
|
+
const a = ["min-w-full", "text-left", "relative"];
|
|
230
|
+
return d === "sm" ? a.push("text-xs") : d === "lg" ? a.push("text-base") : a.push("text-sm"), a;
|
|
231
|
+
}, X = (d, a, t = "none", o = "default", g) => {
|
|
232
|
+
const f = [];
|
|
233
|
+
return o === "minimal" ? f.push(
|
|
234
|
+
g || "bg-gray-50",
|
|
235
|
+
"text-gray-700",
|
|
236
|
+
"font-medium",
|
|
237
|
+
"text-sm",
|
|
238
|
+
"normal-case",
|
|
239
|
+
"border-b",
|
|
240
|
+
"border-gray-200"
|
|
241
|
+
) : f.push(
|
|
242
|
+
g || "bg-gray-100",
|
|
243
|
+
"text-gray-600",
|
|
244
|
+
"font-semibold",
|
|
245
|
+
"text-xs",
|
|
246
|
+
"uppercase",
|
|
247
|
+
"tracking-wide",
|
|
248
|
+
"border-b",
|
|
249
|
+
"border-gray-200",
|
|
250
|
+
"whitespace-nowrap"
|
|
251
|
+
), a && f.push("cursor-pointer", "select-none", "hover:text-primary-base", "transition-colors"), t === "always" ? f.push("border-r", "border-r-gray-200", "last:border-r-0") : (t === "hover" || t === "hover-table") && f.push("border-r", "border-r-transparent", "last:border-r-0"), d === "sm" ? f.push("px-1.5", "py-1") : d === "lg" ? f.push("px-4", "py-3") : f.push("p-2"), f;
|
|
252
|
+
}, Y = (d, a, t = "none", o) => {
|
|
253
|
+
const g = ["border-b", "border-gray-100", "text-gray-900"];
|
|
254
|
+
return o && g.push(o), a && g.push("border-r"), t === "always" ? g.push("border-r", "border-r-gray-200", "last:border-r-0") : (t === "hover" || t === "hover-table") && g.push("border-r", "border-r-transparent", "last:border-r-0"), d === "sm" ? g.push("px-1.5", "py-1") : d === "lg" ? g.push("px-4", "py-3") : g.push("px-2", "py-1.5"), g;
|
|
255
|
+
}, Ye = (d, a, t, o, g = !1) => {
|
|
256
|
+
const f = [];
|
|
257
|
+
return g && f.push("group"), o ? f.push("bg-primary-25") : d && t && f.push("bg-gray-50"), a && (o ? f.push("hover:bg-primary-25-hover", "transition-colors") : f.push("hover:bg-gray-50", "transition-colors")), f;
|
|
258
|
+
}, U = (d) => {
|
|
259
|
+
const a = ["w-3.5", "h-3.5", "inline-block", "ml-1"];
|
|
260
|
+
return d ? a.push("text-primary-base") : a.push("text-gray-400"), a.push("transition-transform", "duration-200"), a;
|
|
261
|
+
}, D = (d) => {
|
|
262
|
+
const a = ["text-center"];
|
|
263
|
+
return d === "sm" ? a.push("w-8") : d === "lg" ? a.push("w-14") : a.push("w-12"), a;
|
|
264
|
+
}, me = (d) => D(d), Ze = () => [
|
|
265
|
+
"flex",
|
|
266
|
+
"items-center",
|
|
267
|
+
"justify-between",
|
|
268
|
+
"px-2",
|
|
269
|
+
"py-2",
|
|
270
|
+
"border-t",
|
|
271
|
+
"border-gray-100",
|
|
272
|
+
"bg-white",
|
|
273
|
+
"text-sm"
|
|
274
|
+
], Z = (d) => {
|
|
275
|
+
const a = ["bg-gray-100", "border-b", "border-gray-200"];
|
|
276
|
+
return d === "sm" ? a.push("px-1.5", "py-1") : d === "lg" ? a.push("px-4", "py-2") : a.push("px-2", "py-1.5"), a;
|
|
277
|
+
}, De = { class: "flex items-center gap-4" }, et = { class: "text-gray-600" }, tt = ["value"], st = ["value"], rt = { class: "flex items-center gap-1" }, lt = ["disabled"], ot = { class: "px-2 text-gray-600" }, at = ["disabled"], nt = /* @__PURE__ */ ee({
|
|
278
|
+
__name: "OneDataTablePaginator",
|
|
279
|
+
props: {
|
|
280
|
+
first: {
|
|
281
|
+
type: Number,
|
|
282
|
+
required: !0
|
|
283
|
+
},
|
|
284
|
+
rows: {
|
|
285
|
+
type: Number,
|
|
286
|
+
required: !0
|
|
287
|
+
},
|
|
288
|
+
totalRecords: {
|
|
289
|
+
type: Number,
|
|
290
|
+
required: !0
|
|
291
|
+
},
|
|
292
|
+
rowsPerPageOptions: {
|
|
293
|
+
type: Array,
|
|
294
|
+
default: () => [10, 25, 50, 100]
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
emits: ["update:first", "update:rows", "page"],
|
|
298
|
+
setup(d, { emit: a }) {
|
|
299
|
+
const t = d, o = a, g = Ce(), f = y(() => Math.ceil(t.totalRecords / t.rows)), R = y(() => Math.floor(t.first / t.rows) + 1), te = y(() => t.totalRecords === 0 ? 0 : t.first + 1), se = y(() => Math.min(t.first + t.rows, t.totalRecords)), B = y(() => t.first === 0), z = y(() => t.first + t.rows >= t.totalRecords), T = y(() => Ze()), O = (m) => {
|
|
300
|
+
m < 0 || m >= t.totalRecords || (o("update:first", m), o("page", {
|
|
301
|
+
first: m,
|
|
302
|
+
rows: t.rows,
|
|
303
|
+
page: Math.floor(m / t.rows),
|
|
304
|
+
pageCount: f.value
|
|
305
|
+
}));
|
|
306
|
+
}, A = () => {
|
|
307
|
+
O(Math.max(0, t.first - t.rows));
|
|
308
|
+
}, K = () => {
|
|
309
|
+
O(t.first + t.rows);
|
|
310
|
+
}, F = (m) => {
|
|
311
|
+
const w = parseInt(m.target.value);
|
|
312
|
+
o("update:rows", w), o("update:first", 0), o("page", {
|
|
313
|
+
first: 0,
|
|
314
|
+
rows: w,
|
|
315
|
+
page: 0,
|
|
316
|
+
pageCount: Math.ceil(t.totalRecords / w)
|
|
317
|
+
});
|
|
318
|
+
};
|
|
319
|
+
return (m, w) => (l(), i("div", {
|
|
320
|
+
class: b(T.value)
|
|
321
|
+
}, [
|
|
322
|
+
c("div", De, [
|
|
323
|
+
c("span", et, S(te.value) + "–" + S(se.value) + " of " + S(d.totalRecords), 1),
|
|
324
|
+
d.rowsPerPageOptions.length > 1 ? (l(), i("select", {
|
|
325
|
+
key: 0,
|
|
326
|
+
value: d.rows,
|
|
327
|
+
class: "border border-gray-300 rounded px-2 py-1 text-sm bg-white focus:outline-none focus:ring-1 focus:ring-primary-glow",
|
|
328
|
+
onChange: F
|
|
329
|
+
}, [
|
|
330
|
+
(l(!0), i(_, null, E(d.rowsPerPageOptions, (q) => (l(), i("option", {
|
|
331
|
+
key: q,
|
|
332
|
+
value: q
|
|
333
|
+
}, S(p(g)("ui.dataTable.perPage", { count: q })), 9, st))), 128))
|
|
334
|
+
], 40, tt)) : h("", !0)
|
|
335
|
+
]),
|
|
336
|
+
c("div", rt, [
|
|
337
|
+
c("button", {
|
|
338
|
+
disabled: B.value,
|
|
339
|
+
class: "p-1.5 rounded hover:bg-gray-100 disabled:opacity-30 disabled:cursor-default transition-colors",
|
|
340
|
+
onClick: A
|
|
341
|
+
}, [
|
|
342
|
+
(l(), C(k(p(He)), { class: "w-4 h-4 text-gray-600" }))
|
|
343
|
+
], 8, lt),
|
|
344
|
+
c("span", ot, S(R.value) + " / " + S(f.value), 1),
|
|
345
|
+
c("button", {
|
|
346
|
+
disabled: z.value,
|
|
347
|
+
class: "p-1.5 rounded hover:bg-gray-100 disabled:opacity-30 disabled:cursor-default transition-colors",
|
|
348
|
+
onClick: K
|
|
349
|
+
}, [
|
|
350
|
+
(l(), C(k(p(ke)), { class: "w-4 h-4 text-gray-600" }))
|
|
351
|
+
], 8, at)
|
|
352
|
+
])
|
|
353
|
+
], 2));
|
|
354
|
+
}
|
|
355
|
+
}), it = {
|
|
356
|
+
key: 0,
|
|
357
|
+
class: "mb-3"
|
|
358
|
+
}, dt = { key: 0 }, ut = {
|
|
359
|
+
key: 0,
|
|
360
|
+
class: "w-5 h-5 rounded bg-primary-base flex items-center justify-center text-white"
|
|
361
|
+
}, pt = {
|
|
362
|
+
key: 1,
|
|
363
|
+
class: "w-5 h-5 rounded border border-gray-300 bg-white"
|
|
364
|
+
}, ct = ["onClick"], ft = {
|
|
365
|
+
key: 1,
|
|
366
|
+
class: "inline-flex items-center gap-1"
|
|
367
|
+
}, yt = { key: 0 }, gt = ["value", "placeholder", "onInput"], ht = { key: 1 }, bt = ["onClick"], vt = ["onClick"], mt = {
|
|
368
|
+
key: 0,
|
|
369
|
+
class: "w-5 h-5 rounded bg-primary-base flex items-center justify-center text-white"
|
|
370
|
+
}, wt = {
|
|
371
|
+
key: 1,
|
|
372
|
+
class: "w-5 h-5 rounded border border-gray-300 bg-white"
|
|
373
|
+
}, Ct = ["onClick"], kt = {
|
|
374
|
+
key: 0,
|
|
375
|
+
class: "w-5 h-5 rounded-full bg-primary-base flex items-center justify-center"
|
|
376
|
+
}, St = {
|
|
377
|
+
key: 1,
|
|
378
|
+
class: "w-5 h-5 rounded-full border border-gray-300 bg-white"
|
|
379
|
+
}, xt = ["onClick"], Rt = { key: 0 }, _t = ["colspan"], Bt = { key: 2 }, Ft = ["colspan"], Mt = { class: "flex items-center justify-center gap-2 text-gray-500" }, Pt = { key: 3 }, Ot = ["colspan"], qt = { class: "text-gray-400" }, $t = { key: 4 }, Lt = ["colspan"], Et = ["disabled"], zt = {
|
|
380
|
+
key: 2,
|
|
381
|
+
class: "mt-3"
|
|
382
|
+
}, Tt = /* @__PURE__ */ ee({
|
|
383
|
+
__name: "OneDataTable",
|
|
384
|
+
props: Je,
|
|
385
|
+
emits: [
|
|
386
|
+
"update:selection",
|
|
387
|
+
"update:expandedRows",
|
|
388
|
+
"update:first",
|
|
389
|
+
"update:rows",
|
|
390
|
+
"update:sortField",
|
|
391
|
+
"update:sortOrder",
|
|
392
|
+
"update:filters",
|
|
393
|
+
"sort",
|
|
394
|
+
"page",
|
|
395
|
+
"filter",
|
|
396
|
+
"row-click",
|
|
397
|
+
"row-select",
|
|
398
|
+
"row-unselect",
|
|
399
|
+
"row-expand",
|
|
400
|
+
"row-collapse",
|
|
401
|
+
"load:next"
|
|
402
|
+
],
|
|
403
|
+
setup(d, { emit: a }) {
|
|
404
|
+
const t = d, o = a, g = we(), f = Ce(), R = N([]);
|
|
405
|
+
je(Se, { registerColumn: (e) => {
|
|
406
|
+
R.value.push(e);
|
|
407
|
+
}, unregisterColumn: (e) => {
|
|
408
|
+
const r = R.value.indexOf(e);
|
|
409
|
+
r > -1 && R.value.splice(r, 1);
|
|
410
|
+
} });
|
|
411
|
+
const B = N(t.first), z = N(t.rows), T = N(t.sortField), O = N(t.sortOrder);
|
|
412
|
+
W(
|
|
413
|
+
() => t.first,
|
|
414
|
+
(e) => {
|
|
415
|
+
B.value = e;
|
|
416
|
+
}
|
|
417
|
+
), W(
|
|
418
|
+
() => t.rows,
|
|
419
|
+
(e) => {
|
|
420
|
+
z.value = e;
|
|
421
|
+
}
|
|
422
|
+
), W(
|
|
423
|
+
() => t.sortField,
|
|
424
|
+
(e) => {
|
|
425
|
+
T.value = e;
|
|
426
|
+
}
|
|
427
|
+
), W(
|
|
428
|
+
() => t.sortOrder,
|
|
429
|
+
(e) => {
|
|
430
|
+
O.value = e;
|
|
431
|
+
}
|
|
432
|
+
);
|
|
433
|
+
const A = y(() => B.value), K = y(() => z.value), F = y(() => T.value), m = y(() => O.value), w = (e, r) => r ? r.split(".").reduce((s, u) => s == null ? void 0 : s[u], e) : e, q = (e) => t.dataKey ? w(e, t.dataKey) : e, x = (e, r) => e == null || r == null ? e === r : t.dataKey ? w(e, t.dataKey) === w(r, t.dataKey) : e === r, xe = (e, r) => t.dataKey ? w(e, t.dataKey) : r, M = y(() => R.value.some((e) => e.props.expander)), $ = y(() => !!t.selectionMode), re = y(() => t.selectionMode === "multiple"), j = y(() => R.value.filter((e) => !e.props.expander)), V = y(
|
|
434
|
+
() => R.value.length + ($.value ? 1 : 0) + (M.value ? 1 : 0)
|
|
435
|
+
), le = y(() => {
|
|
436
|
+
var s, u;
|
|
437
|
+
if (t.lazy || !t.filters)
|
|
438
|
+
return t.value;
|
|
439
|
+
let e = [...t.value];
|
|
440
|
+
const r = t.filters;
|
|
441
|
+
if ((s = r.global) != null && s.value && ((u = t.globalFilterFields) != null && u.length)) {
|
|
442
|
+
const n = r.global.value;
|
|
443
|
+
e = e.filter(
|
|
444
|
+
(v) => t.globalFilterFields.some(
|
|
445
|
+
(G) => ve.contains(w(v, G), n)
|
|
446
|
+
)
|
|
447
|
+
);
|
|
448
|
+
}
|
|
449
|
+
for (const [n, v] of Object.entries(r)) {
|
|
450
|
+
if (n === "global" || !v.value)
|
|
451
|
+
continue;
|
|
452
|
+
const G = v.matchMode || "contains", ce = ve[G];
|
|
453
|
+
ce && (e = e.filter((Te) => ce(w(Te, n), v.value)));
|
|
454
|
+
}
|
|
455
|
+
return e;
|
|
456
|
+
}), Re = y(() => {
|
|
457
|
+
const e = le.value;
|
|
458
|
+
return t.lazy || !F.value || !m.value ? e : [...e].sort((r, s) => {
|
|
459
|
+
const u = w(r, F.value), n = w(s, F.value);
|
|
460
|
+
if (u == null && n == null)
|
|
461
|
+
return 0;
|
|
462
|
+
if (u == null)
|
|
463
|
+
return 1;
|
|
464
|
+
if (n == null)
|
|
465
|
+
return -1;
|
|
466
|
+
let v;
|
|
467
|
+
return typeof u == "number" && typeof n == "number" ? v = u - n : v = String(u).localeCompare(String(n)), m.value === 1 ? v : -v;
|
|
468
|
+
});
|
|
469
|
+
}), oe = y(() => t.totalRecords ?? le.value.length), L = y(() => {
|
|
470
|
+
const e = Re.value;
|
|
471
|
+
if (t.paginator && !t.lazy) {
|
|
472
|
+
const r = A.value, s = r + K.value;
|
|
473
|
+
return e.slice(r, s);
|
|
474
|
+
}
|
|
475
|
+
return e;
|
|
476
|
+
}), _e = (e) => {
|
|
477
|
+
let r;
|
|
478
|
+
F.value === e ? m.value === 1 ? r = -1 : m.value === -1 ? r = null : r = 1 : r = 1, T.value = e, O.value = r, o("update:sortField", e), o("update:sortOrder", r), o("sort", { field: e, order: r }), !t.lazy && t.paginator && (B.value = 0, o("update:first", 0));
|
|
479
|
+
}, ae = (e) => e.props.sortField || e.props.field, Be = (e) => F.value === ae(e), I = (e) => t.selection ? t.selectionMode === "single" ? x(t.selection, e) : t.selectionMode === "multiple" ? t.selection.some((r) => x(r, e)) : !1 : !1, ne = (e, r, s) => {
|
|
480
|
+
if (o("row-click", { originalEvent: e, data: r, index: s }), t.selectionMode === "single") {
|
|
481
|
+
const u = x(t.selection, r) ? null : r;
|
|
482
|
+
o("update:selection", u), u ? o("row-select", { originalEvent: e, data: r }) : o("row-unselect", { originalEvent: e, data: r });
|
|
483
|
+
}
|
|
484
|
+
}, Fe = (e, r) => {
|
|
485
|
+
if (e.stopPropagation(), t.selectionMode === "multiple") {
|
|
486
|
+
const s = t.selection || [], u = s.some((v) => x(v, r));
|
|
487
|
+
let n;
|
|
488
|
+
u ? (n = s.filter((v) => !x(v, r)), o("row-unselect", { originalEvent: e, data: r })) : (n = [...s, r], o("row-select", { originalEvent: e, data: r })), o("update:selection", n);
|
|
489
|
+
}
|
|
490
|
+
}, ie = y(() => {
|
|
491
|
+
if (t.selectionMode !== "multiple" || !t.selection)
|
|
492
|
+
return !1;
|
|
493
|
+
const e = t.selection;
|
|
494
|
+
return L.value.length > 0 && L.value.every((r) => e.some((s) => x(s, r)));
|
|
495
|
+
}), Me = (e) => {
|
|
496
|
+
e.stopPropagation();
|
|
497
|
+
const r = t.selection || [];
|
|
498
|
+
if (ie.value) {
|
|
499
|
+
const s = r.filter(
|
|
500
|
+
(u) => !L.value.some((n) => x(u, n))
|
|
501
|
+
);
|
|
502
|
+
o("update:selection", s);
|
|
503
|
+
} else {
|
|
504
|
+
const s = [...r];
|
|
505
|
+
L.value.forEach((u) => {
|
|
506
|
+
s.some((n) => x(n, u)) || s.push(u);
|
|
507
|
+
}), o("update:selection", s);
|
|
508
|
+
}
|
|
509
|
+
}, H = (e) => {
|
|
510
|
+
if (!t.expandedRows)
|
|
511
|
+
return !1;
|
|
512
|
+
if (Array.isArray(t.expandedRows))
|
|
513
|
+
return t.expandedRows.some((r) => x(r, e));
|
|
514
|
+
if (t.dataKey) {
|
|
515
|
+
const r = String(q(e));
|
|
516
|
+
return !!t.expandedRows[r];
|
|
517
|
+
}
|
|
518
|
+
return !1;
|
|
519
|
+
}, Pe = (e, r) => {
|
|
520
|
+
e.stopPropagation();
|
|
521
|
+
const s = H(r);
|
|
522
|
+
if (Array.isArray(t.expandedRows)) {
|
|
523
|
+
let u;
|
|
524
|
+
s ? (u = t.expandedRows.filter((n) => !x(n, r)), o("row-collapse", { originalEvent: e, data: r })) : (u = [...t.expandedRows, r], o("row-expand", { originalEvent: e, data: r })), o("update:expandedRows", u);
|
|
525
|
+
} else if (t.dataKey) {
|
|
526
|
+
const u = String(q(r)), n = { ...t.expandedRows };
|
|
527
|
+
s ? (delete n[u], o("row-collapse", { originalEvent: e, data: r })) : (n[u] = !0, o("row-expand", { originalEvent: e, data: r })), o("update:expandedRows", n);
|
|
528
|
+
}
|
|
529
|
+
}, Oe = (e, r, s) => {
|
|
530
|
+
var n;
|
|
531
|
+
if (!t.filters)
|
|
532
|
+
return;
|
|
533
|
+
const u = {
|
|
534
|
+
...t.filters,
|
|
535
|
+
[e]: { value: r, matchMode: s || ((n = t.filters[e]) == null ? void 0 : n.matchMode) || "contains" }
|
|
536
|
+
};
|
|
537
|
+
o("update:filters", u), t.lazy && o("filter", { filters: u }), t.paginator && (B.value = 0, o("update:first", 0));
|
|
538
|
+
}, de = (e) => {
|
|
539
|
+
var r;
|
|
540
|
+
return ((r = t.filters) == null ? void 0 : r[e]) || { value: null };
|
|
541
|
+
}, qe = (e) => () => {
|
|
542
|
+
t.filters && (o("update:filters", { ...t.filters }), t.lazy && o("filter", { filters: t.filters }), t.paginator && (B.value = 0, o("update:first", 0)));
|
|
543
|
+
}, $e = (e) => {
|
|
544
|
+
B.value = e, o("update:first", e);
|
|
545
|
+
}, Le = (e) => {
|
|
546
|
+
z.value = e, o("update:rows", e);
|
|
547
|
+
}, ue = y(() => {
|
|
548
|
+
const e = [];
|
|
549
|
+
if (t.colWidths) {
|
|
550
|
+
if (typeof t.colWidths == "function") {
|
|
551
|
+
const r = t.colWidths(j.value), s = [];
|
|
552
|
+
return $.value && s.push(""), M.value && s.push(""), [...s, ...r];
|
|
553
|
+
}
|
|
554
|
+
return t.colWidths;
|
|
555
|
+
}
|
|
556
|
+
return $.value && e.push(""), M.value && e.push(""), j.value.forEach((r) => {
|
|
557
|
+
e.push(r.props.width || "");
|
|
558
|
+
}), e;
|
|
559
|
+
}), pe = y(() => ue.value.some((e) => e !== "" && e != null)), Ee = y(() => t.wrapperClass ? ["overflow-x-auto", "w-full", t.wrapperClass] : t.verticalBorders === "hover-table" ? ["overflow-x-auto", "w-full", "border", "border-transparent", "rounded"] : Qe(t.wrapperBordered)), ze = y(() => {
|
|
560
|
+
const e = Xe(t.size);
|
|
561
|
+
return t.tableClass && e.push(t.tableClass), t.bordered && e.push("border", "border-gray-100"), e;
|
|
562
|
+
});
|
|
563
|
+
return (e, r) => (l(), i("div", null, [
|
|
564
|
+
Ne(c("div", null, [
|
|
565
|
+
P(e.$slots, "default", {}, void 0, !0)
|
|
566
|
+
], 512), [
|
|
567
|
+
[Ae, !1]
|
|
568
|
+
]),
|
|
569
|
+
p(g).header ? (l(), i("div", it, [
|
|
570
|
+
P(e.$slots, "header", {}, void 0, !0)
|
|
571
|
+
])) : h("", !0),
|
|
572
|
+
c("div", {
|
|
573
|
+
class: b([...Ee.value, e.verticalBorders === "hover-table" ? "vb-hover" : ""])
|
|
574
|
+
}, [
|
|
575
|
+
c("table", {
|
|
576
|
+
class: b([
|
|
577
|
+
...ze.value,
|
|
578
|
+
e.verticalBorders !== "none" ? "border-separate border-spacing-0" : "border-collapse",
|
|
579
|
+
e.verticalBorders === "hover" ? "vb-hover" : "",
|
|
580
|
+
pe.value ? "table-fixed" : ""
|
|
581
|
+
])
|
|
582
|
+
}, [
|
|
583
|
+
pe.value ? (l(), i("colgroup", dt, [
|
|
584
|
+
(l(!0), i(_, null, E(ue.value, (s, u) => (l(), i("col", {
|
|
585
|
+
key: `col-${u}`,
|
|
586
|
+
style: J(s ? { width: s } : {})
|
|
587
|
+
}, null, 4))), 128))
|
|
588
|
+
])) : h("", !0),
|
|
589
|
+
c("thead", null, [
|
|
590
|
+
c("tr", null, [
|
|
591
|
+
$.value ? (l(), i("th", {
|
|
592
|
+
key: 0,
|
|
593
|
+
class: b([
|
|
594
|
+
...p(X)(e.size, !1, e.verticalBorders, e.headerVariant, e.headerBgClass),
|
|
595
|
+
...p(D)(e.size)
|
|
596
|
+
])
|
|
597
|
+
}, [
|
|
598
|
+
re.value ? (l(), i("div", {
|
|
599
|
+
key: 0,
|
|
600
|
+
class: "flex items-center justify-center cursor-pointer",
|
|
601
|
+
onClick: r[0] || (r[0] = (s) => Me(s))
|
|
602
|
+
}, [
|
|
603
|
+
ie.value ? (l(), i("div", ut, [
|
|
604
|
+
(l(), C(k(p(he)), { class: "w-3.5 h-3.5" }))
|
|
605
|
+
])) : (l(), i("div", pt))
|
|
606
|
+
])) : h("", !0)
|
|
607
|
+
], 2)) : h("", !0),
|
|
608
|
+
M.value ? (l(), i("th", {
|
|
609
|
+
key: 1,
|
|
610
|
+
class: b([
|
|
611
|
+
...p(X)(e.size, !1, e.verticalBorders, e.headerVariant, e.headerBgClass),
|
|
612
|
+
...p(me)(e.size)
|
|
613
|
+
])
|
|
614
|
+
}, null, 2)) : h("", !0),
|
|
615
|
+
(l(!0), i(_, null, E(j.value, (s, u) => (l(), i("th", {
|
|
616
|
+
key: u,
|
|
617
|
+
class: b([
|
|
618
|
+
...p(X)(e.size, s.props.sortable, e.verticalBorders, e.headerVariant, e.headerBgClass),
|
|
619
|
+
s.props.headerClass
|
|
620
|
+
]),
|
|
621
|
+
style: J([s.props.headerStyle, s.props.width ? { width: s.props.width } : {}]),
|
|
622
|
+
onClick: (n) => s.props.sortable ? _e(ae(s)) : void 0
|
|
623
|
+
}, [
|
|
624
|
+
s.slots.header ? (l(), C(k(s.slots.header), { key: 0 })) : (l(), i("span", ft, [
|
|
625
|
+
Q(S(s.props.header) + " ", 1),
|
|
626
|
+
s.props.sortable ? (l(), i(_, { key: 0 }, [
|
|
627
|
+
Be(s) ? m.value === 1 ? (l(), C(k(p(Ue)), {
|
|
628
|
+
key: 1,
|
|
629
|
+
class: b(p(U)(!0))
|
|
630
|
+
}, null, 8, ["class"])) : m.value === -1 ? (l(), C(k(p(ge)), {
|
|
631
|
+
key: 2,
|
|
632
|
+
class: b(p(U)(!0))
|
|
633
|
+
}, null, 8, ["class"])) : (l(), C(k(p(be)), {
|
|
634
|
+
key: 3,
|
|
635
|
+
class: b(p(U)(!1))
|
|
636
|
+
}, null, 8, ["class"])) : (l(), C(k(p(be)), {
|
|
637
|
+
key: 0,
|
|
638
|
+
class: b(p(U)(!1))
|
|
639
|
+
}, null, 8, ["class"]))
|
|
640
|
+
], 64)) : h("", !0)
|
|
641
|
+
]))
|
|
642
|
+
], 14, ct))), 128))
|
|
643
|
+
]),
|
|
644
|
+
e.filterDisplay === "row" ? (l(), i("tr", yt, [
|
|
645
|
+
$.value ? (l(), i("th", {
|
|
646
|
+
key: 0,
|
|
647
|
+
class: b(p(Z)(e.size))
|
|
648
|
+
}, null, 2)) : h("", !0),
|
|
649
|
+
M.value ? (l(), i("th", {
|
|
650
|
+
key: 1,
|
|
651
|
+
class: b(p(Z)(e.size))
|
|
652
|
+
}, null, 2)) : h("", !0),
|
|
653
|
+
(l(!0), i(_, null, E(j.value, (s, u) => (l(), i("th", {
|
|
654
|
+
key: `filter-${u}`,
|
|
655
|
+
class: b(p(Z)(e.size))
|
|
656
|
+
}, [
|
|
657
|
+
s.props.filterable && s.slots.filter ? (l(), C(k(s.slots.filter), {
|
|
658
|
+
key: 0,
|
|
659
|
+
filterModel: de(
|
|
660
|
+
s.props.filterField || s.props.field
|
|
661
|
+
),
|
|
662
|
+
filterCallback: qe(
|
|
663
|
+
s.props.filterField || s.props.field
|
|
664
|
+
)
|
|
665
|
+
}, null, 8, ["filterModel", "filterCallback"])) : s.props.filterable && s.props.field ? (l(), i("input", {
|
|
666
|
+
key: 1,
|
|
667
|
+
type: "text",
|
|
668
|
+
value: de(
|
|
669
|
+
s.props.filterField || s.props.field
|
|
670
|
+
).value || "",
|
|
671
|
+
class: "w-full border border-gray-300 rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-primary-glow",
|
|
672
|
+
placeholder: `Filter ${s.props.header || s.props.field}`,
|
|
673
|
+
onInput: (n) => Oe(
|
|
674
|
+
s.props.filterField || s.props.field,
|
|
675
|
+
n.target.value
|
|
676
|
+
)
|
|
677
|
+
}, null, 40, gt)) : h("", !0)
|
|
678
|
+
], 2))), 128))
|
|
679
|
+
])) : h("", !0)
|
|
680
|
+
]),
|
|
681
|
+
!e.loading && L.value.length > 0 ? (l(), i("tbody", ht, [
|
|
682
|
+
(l(!0), i(_, null, E(L.value, (s, u) => (l(), i(_, {
|
|
683
|
+
key: xe(s, u)
|
|
684
|
+
}, [
|
|
685
|
+
c("tr", {
|
|
686
|
+
class: b([
|
|
687
|
+
...p(Ye)(
|
|
688
|
+
e.striped,
|
|
689
|
+
e.hoverable,
|
|
690
|
+
u % 2 === 1,
|
|
691
|
+
I(s),
|
|
692
|
+
!1
|
|
693
|
+
),
|
|
694
|
+
e.selectionMode ? "cursor-pointer" : ""
|
|
695
|
+
]),
|
|
696
|
+
onClick: (n) => ne(n, s, u)
|
|
697
|
+
}, [
|
|
698
|
+
$.value ? (l(), i("td", {
|
|
699
|
+
key: 0,
|
|
700
|
+
class: b([
|
|
701
|
+
...p(Y)(e.size, e.bordered, e.verticalBorders, e.bodyBgClass),
|
|
702
|
+
...p(D)(e.size)
|
|
703
|
+
])
|
|
704
|
+
}, [
|
|
705
|
+
re.value ? (l(), i("div", {
|
|
706
|
+
key: 0,
|
|
707
|
+
class: "flex items-center justify-center cursor-pointer",
|
|
708
|
+
onClick: fe((n) => Fe(n, s), ["stop"])
|
|
709
|
+
}, [
|
|
710
|
+
I(s) ? (l(), i("div", mt, [
|
|
711
|
+
(l(), C(k(p(he)), { class: "w-3.5 h-3.5" }))
|
|
712
|
+
])) : (l(), i("div", wt))
|
|
713
|
+
], 8, vt)) : (l(), i("div", {
|
|
714
|
+
key: 1,
|
|
715
|
+
class: "flex items-center justify-center cursor-pointer",
|
|
716
|
+
onClick: fe((n) => ne(n, s, u), ["stop"])
|
|
717
|
+
}, [
|
|
718
|
+
I(s) ? (l(), i("div", kt, [...r[3] || (r[3] = [
|
|
719
|
+
c("div", { class: "w-2 h-2 rounded-full bg-white" }, null, -1)
|
|
720
|
+
])])) : (l(), i("div", St))
|
|
721
|
+
], 8, Ct))
|
|
722
|
+
], 2)) : h("", !0),
|
|
723
|
+
M.value ? (l(), i("td", {
|
|
724
|
+
key: 1,
|
|
725
|
+
class: b([
|
|
726
|
+
...p(Y)(e.size, e.bordered, e.verticalBorders, e.bodyBgClass),
|
|
727
|
+
...p(me)(e.size)
|
|
728
|
+
])
|
|
729
|
+
}, [
|
|
730
|
+
c("button", {
|
|
731
|
+
class: "p-1 rounded hover:bg-gray-100 transition-colors",
|
|
732
|
+
onClick: (n) => Pe(n, s)
|
|
733
|
+
}, [
|
|
734
|
+
(l(), C(k(H(s) ? p(ge) : p(ke)), { class: "w-4 h-4 text-gray-500" }))
|
|
735
|
+
], 8, xt)
|
|
736
|
+
], 2)) : h("", !0),
|
|
737
|
+
(l(!0), i(_, null, E(j.value, (n, v) => (l(), i("td", {
|
|
738
|
+
key: v,
|
|
739
|
+
class: b([
|
|
740
|
+
...p(Y)(e.size, e.bordered, e.verticalBorders, e.bodyBgClass),
|
|
741
|
+
n.props.bodyClass
|
|
742
|
+
]),
|
|
743
|
+
style: J(n.props.bodyStyle)
|
|
744
|
+
}, [
|
|
745
|
+
n.slots.body ? (l(), C(k(n.slots.body), {
|
|
746
|
+
key: 0,
|
|
747
|
+
data: s,
|
|
748
|
+
field: n.props.field,
|
|
749
|
+
index: u
|
|
750
|
+
}, null, 8, ["data", "field", "index"])) : n.props.field ? (l(), i(_, { key: 1 }, [
|
|
751
|
+
Q(S(w(s, n.props.field)), 1)
|
|
752
|
+
], 64)) : h("", !0)
|
|
753
|
+
], 6))), 128))
|
|
754
|
+
], 10, bt),
|
|
755
|
+
M.value && H(s) ? (l(), i("tr", Rt, [
|
|
756
|
+
c("td", {
|
|
757
|
+
colspan: V.value,
|
|
758
|
+
class: "p-0"
|
|
759
|
+
}, [
|
|
760
|
+
P(e.$slots, "expansion", {
|
|
761
|
+
data: s,
|
|
762
|
+
index: u
|
|
763
|
+
}, void 0, !0)
|
|
764
|
+
], 8, _t)
|
|
765
|
+
])) : h("", !0)
|
|
766
|
+
], 64))), 128))
|
|
767
|
+
])) : e.loading ? (l(), i("tbody", Bt, [
|
|
768
|
+
c("tr", null, [
|
|
769
|
+
c("td", {
|
|
770
|
+
colspan: V.value,
|
|
771
|
+
class: "text-center py-12"
|
|
772
|
+
}, [
|
|
773
|
+
P(e.$slots, "loading", {}, () => [
|
|
774
|
+
c("div", Mt, [
|
|
775
|
+
Ke(ye, { class: "w-5 h-5" }),
|
|
776
|
+
c("span", null, S(p(f)("ui.dataTable.loading")), 1)
|
|
777
|
+
])
|
|
778
|
+
], !0)
|
|
779
|
+
], 8, Ft)
|
|
780
|
+
])
|
|
781
|
+
])) : (l(), i("tbody", Pt, [
|
|
782
|
+
c("tr", null, [
|
|
783
|
+
c("td", {
|
|
784
|
+
colspan: V.value,
|
|
785
|
+
class: "text-center py-12"
|
|
786
|
+
}, [
|
|
787
|
+
P(e.$slots, "empty", {}, () => [
|
|
788
|
+
c("span", qt, S(p(f)("ui.dataTable.noRecords")), 1)
|
|
789
|
+
], !0)
|
|
790
|
+
], 8, Ot)
|
|
791
|
+
])
|
|
792
|
+
])),
|
|
793
|
+
e.hasNextPage && !e.loading ? (l(), i("tfoot", $t, [
|
|
794
|
+
c("tr", null, [
|
|
795
|
+
c("td", {
|
|
796
|
+
colspan: V.value,
|
|
797
|
+
class: "px-3 pb-3 pt-2"
|
|
798
|
+
}, [
|
|
799
|
+
c("button", {
|
|
800
|
+
class: "w-full p-2 rounded bg-primary-base bg-opacity-10 text-primary-base text-sm font-medium hover:bg-opacity-20 transition-colors disabled:opacity-50 disabled:cursor-default flex items-center justify-center gap-2",
|
|
801
|
+
disabled: e.loadingNext,
|
|
802
|
+
onClick: r[1] || (r[1] = (s) => o("load:next"))
|
|
803
|
+
}, [
|
|
804
|
+
e.loadingNext ? (l(), C(ye, {
|
|
805
|
+
key: 0,
|
|
806
|
+
class: "w-4 h-4"
|
|
807
|
+
})) : h("", !0),
|
|
808
|
+
Q(" " + S(e.loadMoreLabel || p(f)("ui.dataTable.showMore")), 1)
|
|
809
|
+
], 8, Et)
|
|
810
|
+
], 8, Lt)
|
|
811
|
+
])
|
|
812
|
+
])) : h("", !0)
|
|
813
|
+
], 2)
|
|
814
|
+
], 2),
|
|
815
|
+
e.paginator && oe.value > 0 ? (l(), C(nt, {
|
|
816
|
+
key: 1,
|
|
817
|
+
first: A.value,
|
|
818
|
+
rows: K.value,
|
|
819
|
+
"total-records": oe.value,
|
|
820
|
+
"rows-per-page-options": e.rowsPerPageOptions,
|
|
821
|
+
"onUpdate:first": $e,
|
|
822
|
+
"onUpdate:rows": Le,
|
|
823
|
+
onPage: r[2] || (r[2] = (s) => o("page", s))
|
|
824
|
+
}, null, 8, ["first", "rows", "total-records", "rows-per-page-options"])) : h("", !0),
|
|
825
|
+
p(g).footer ? (l(), i("div", zt, [
|
|
826
|
+
P(e.$slots, "footer", {}, void 0, !0)
|
|
827
|
+
])) : h("", !0)
|
|
828
|
+
]));
|
|
829
|
+
}
|
|
830
|
+
});
|
|
831
|
+
const Ht = /* @__PURE__ */ Ie(Tt, [["__scopeId", "data-v-abd207a8"]]), Gt = /* @__PURE__ */ ee({
|
|
832
|
+
__name: "OneColumn",
|
|
833
|
+
props: Ge,
|
|
834
|
+
setup(d) {
|
|
835
|
+
const a = d, t = we(), o = Ve(Se), g = {
|
|
836
|
+
props: a,
|
|
837
|
+
slots: t
|
|
838
|
+
};
|
|
839
|
+
return o && o.registerColumn(g), We(() => {
|
|
840
|
+
o && o.unregisterColumn(g);
|
|
841
|
+
}), (f, R) => P(f.$slots, "default");
|
|
842
|
+
}
|
|
843
|
+
});
|
|
7
844
|
export {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
845
|
+
Gt as OneColumn,
|
|
846
|
+
Ht as OneDataTable,
|
|
847
|
+
nt as OneDataTablePaginator
|
|
11
848
|
};
|