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