@indielayer/ui 1.13.2 → 1.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/docs/pages/component/accordion/index.vue +1 -1
  2. package/docs/pages/component/button/index.vue +1 -1
  3. package/docs/pages/component/checkbox/index.vue +1 -1
  4. package/docs/pages/component/container/index.vue +1 -1
  5. package/docs/pages/component/drawer/index.vue +1 -1
  6. package/docs/pages/component/form/index.vue +1 -1
  7. package/docs/pages/component/formGroup/index.vue +1 -1
  8. package/docs/pages/component/icon/index.vue +1 -1
  9. package/docs/pages/component/notifications/index.vue +1 -1
  10. package/docs/pages/component/pagination/index.vue +1 -1
  11. package/docs/pages/component/popover/index.vue +1 -1
  12. package/docs/pages/component/progress/index.vue +1 -1
  13. package/docs/pages/component/scroll/index.vue +1 -1
  14. package/docs/pages/component/skeleton/index.vue +1 -1
  15. package/docs/pages/component/slider/index.vue +1 -1
  16. package/docs/pages/component/spacer/index.vue +1 -1
  17. package/docs/pages/component/spinner/index.vue +1 -1
  18. package/docs/pages/component/table/index.vue +7 -0
  19. package/docs/pages/component/table/selectable.vue +68 -0
  20. package/docs/pages/component/table/usage.vue +1 -4
  21. package/docs/pages/component/table/virtual.vue +3 -0
  22. package/docs/pages/component/tag/index.vue +1 -1
  23. package/docs/pages/component/textarea/index.vue +1 -1
  24. package/docs/pages/component/toggle/index.vue +1 -1
  25. package/docs/pages/component/upload/index.vue +1 -1
  26. package/docs/search/components.json +1 -1
  27. package/lib/components/button/theme/Button.base.theme.js +21 -21
  28. package/lib/components/menu/MenuItem.vue.js +1 -1
  29. package/lib/components/menu/MenuItem.vue2.js +82 -84
  30. package/lib/components/radio/theme/Radio.base.theme.js +24 -24
  31. package/lib/components/select/Select.vue.js +121 -112
  32. package/lib/components/table/Table.vue.d.ts +62 -8
  33. package/lib/components/table/Table.vue.js +194 -139
  34. package/lib/components/table/TableHeader.vue.d.ts +5 -5
  35. package/lib/components/table/TableHeader.vue.js +37 -34
  36. package/lib/components/table/TableRow.vue.d.ts +4 -0
  37. package/lib/components/table/TableRow.vue.js +3 -2
  38. package/lib/components/table/theme/TableHeader.base.theme.js +9 -9
  39. package/lib/components/table/theme/TableHeader.carbon.theme.js +1 -1
  40. package/lib/components/table/theme/TableRow.base.theme.js +3 -3
  41. package/lib/composables/useFocusTrap.d.ts +9 -4
  42. package/lib/composables/useFocusTrap.js +42 -27
  43. package/lib/index.js +1 -1
  44. package/lib/index.umd.js +4 -4
  45. package/lib/version.d.ts +1 -1
  46. package/lib/version.js +1 -1
  47. package/package.json +1 -1
  48. package/src/components/button/theme/Button.base.theme.ts +1 -1
  49. package/src/components/menu/MenuItem.vue +1 -0
  50. package/src/components/radio/theme/Radio.base.theme.ts +1 -1
  51. package/src/components/select/Select.vue +20 -5
  52. package/src/components/table/Table.vue +113 -15
  53. package/src/components/table/TableHeader.vue +7 -5
  54. package/src/components/table/TableRow.vue +1 -0
  55. package/src/components/table/theme/TableHeader.base.theme.ts +4 -3
  56. package/src/components/table/theme/TableHeader.carbon.theme.ts +0 -1
  57. package/src/components/table/theme/TableRow.base.theme.ts +2 -2
  58. package/src/composables/useFocusTrap.ts +73 -42
  59. package/src/version.ts +1 -1
@@ -47,6 +47,12 @@ declare const tableProps: {
47
47
  default: number;
48
48
  };
49
49
  keyProp: StringConstructor;
50
+ selectable: BooleanConstructor;
51
+ singleSelect: BooleanConstructor;
52
+ autoClearSelected: {
53
+ type: BooleanConstructor;
54
+ default: boolean;
55
+ };
50
56
  };
51
57
  export type TableHeader = {
52
58
  sortable?: boolean;
@@ -81,6 +87,9 @@ declare const _default: <T>(__VLS_props: Partial<{
81
87
  scrollable: boolean;
82
88
  stickyHeader: boolean;
83
89
  expandable: boolean;
90
+ selectable: boolean;
91
+ singleSelect: boolean;
92
+ autoClearSelected: boolean;
84
93
  }> & Omit<{
85
94
  readonly error: boolean;
86
95
  readonly sort: string[];
@@ -99,6 +108,9 @@ declare const _default: <T>(__VLS_props: Partial<{
99
108
  readonly scrollable: boolean;
100
109
  readonly stickyHeader: boolean;
101
110
  readonly expandable: boolean;
111
+ readonly selectable: boolean;
112
+ readonly singleSelect: boolean;
113
+ readonly autoClearSelected: boolean;
102
114
  readonly virtualListOffsetTop?: number | undefined;
103
115
  readonly virtualListOffsetBottom?: number | undefined;
104
116
  readonly keyProp?: string | undefined;
@@ -149,11 +161,17 @@ declare const _default: <T>(__VLS_props: Partial<{
149
161
  default: number;
150
162
  };
151
163
  keyProp: StringConstructor;
164
+ selectable: BooleanConstructor;
165
+ singleSelect: BooleanConstructor;
166
+ autoClearSelected: {
167
+ type: BooleanConstructor;
168
+ default: boolean;
169
+ };
152
170
  }>> & Readonly<{
153
171
  "onUpdate:sort"?: ((...args: any[]) => any) | undefined;
154
172
  "onClick-row"?: ((...args: any[]) => any) | undefined;
155
- }>, "error" | "sort" | "items" | "loading" | "fixed" | "virtualList" | "virtualListItemHeight" | "virtualListOverscan" | "headers" | "loadingSkeleton" | "loadingLines" | "dense" | "striped" | "pointer" | "scrollable" | "stickyHeader" | "expandable"> & {
156
- selected?: string | number | undefined;
173
+ }>, "error" | "sort" | "items" | "loading" | "fixed" | "virtualList" | "virtualListItemHeight" | "virtualListOverscan" | "headers" | "loadingSkeleton" | "loadingLines" | "dense" | "striped" | "pointer" | "scrollable" | "stickyHeader" | "expandable" | "selectable" | "singleSelect" | "autoClearSelected"> & {
174
+ selected?: string | number | (string | number)[] | undefined;
157
175
  } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, __VLS_ctx?: Pick<{
158
176
  props: Partial<{
159
177
  error: boolean;
@@ -173,6 +191,9 @@ declare const _default: <T>(__VLS_props: Partial<{
173
191
  scrollable: boolean;
174
192
  stickyHeader: boolean;
175
193
  expandable: boolean;
194
+ selectable: boolean;
195
+ singleSelect: boolean;
196
+ autoClearSelected: boolean;
176
197
  }> & Omit<{
177
198
  readonly error: boolean;
178
199
  readonly sort: string[];
@@ -191,6 +212,9 @@ declare const _default: <T>(__VLS_props: Partial<{
191
212
  readonly scrollable: boolean;
192
213
  readonly stickyHeader: boolean;
193
214
  readonly expandable: boolean;
215
+ readonly selectable: boolean;
216
+ readonly singleSelect: boolean;
217
+ readonly autoClearSelected: boolean;
194
218
  readonly virtualListOffsetTop?: number | undefined;
195
219
  readonly virtualListOffsetBottom?: number | undefined;
196
220
  readonly keyProp?: string | undefined;
@@ -241,11 +265,17 @@ declare const _default: <T>(__VLS_props: Partial<{
241
265
  default: number;
242
266
  };
243
267
  keyProp: StringConstructor;
268
+ selectable: BooleanConstructor;
269
+ singleSelect: BooleanConstructor;
270
+ autoClearSelected: {
271
+ type: BooleanConstructor;
272
+ default: boolean;
273
+ };
244
274
  }>> & Readonly<{
245
275
  "onUpdate:sort"?: ((...args: any[]) => any) | undefined;
246
276
  "onClick-row"?: ((...args: any[]) => any) | undefined;
247
- }>, "error" | "sort" | "items" | "loading" | "fixed" | "virtualList" | "virtualListItemHeight" | "virtualListOverscan" | "headers" | "loadingSkeleton" | "loadingLines" | "dense" | "striped" | "pointer" | "scrollable" | "stickyHeader" | "expandable"> & {
248
- selected?: string | number | undefined;
277
+ }>, "error" | "sort" | "items" | "loading" | "fixed" | "virtualList" | "virtualListItemHeight" | "virtualListOverscan" | "headers" | "loadingSkeleton" | "loadingLines" | "dense" | "striped" | "pointer" | "scrollable" | "stickyHeader" | "expandable" | "selectable" | "singleSelect" | "autoClearSelected"> & {
278
+ selected?: string | number | (string | number)[] | undefined;
249
279
  };
250
280
  expose(exposed: {}): void;
251
281
  attrs: any;
@@ -284,6 +314,9 @@ declare const _default: <T>(__VLS_props: Partial<{
284
314
  scrollable: boolean;
285
315
  stickyHeader: boolean;
286
316
  expandable: boolean;
317
+ selectable: boolean;
318
+ singleSelect: boolean;
319
+ autoClearSelected: boolean;
287
320
  }> & Omit<{
288
321
  readonly error: boolean;
289
322
  readonly sort: string[];
@@ -302,6 +335,9 @@ declare const _default: <T>(__VLS_props: Partial<{
302
335
  readonly scrollable: boolean;
303
336
  readonly stickyHeader: boolean;
304
337
  readonly expandable: boolean;
338
+ readonly selectable: boolean;
339
+ readonly singleSelect: boolean;
340
+ readonly autoClearSelected: boolean;
305
341
  readonly virtualListOffsetTop?: number | undefined;
306
342
  readonly virtualListOffsetBottom?: number | undefined;
307
343
  readonly keyProp?: string | undefined;
@@ -352,11 +388,17 @@ declare const _default: <T>(__VLS_props: Partial<{
352
388
  default: number;
353
389
  };
354
390
  keyProp: StringConstructor;
391
+ selectable: BooleanConstructor;
392
+ singleSelect: BooleanConstructor;
393
+ autoClearSelected: {
394
+ type: BooleanConstructor;
395
+ default: boolean;
396
+ };
355
397
  }>> & Readonly<{
356
398
  "onUpdate:sort"?: ((...args: any[]) => any) | undefined;
357
399
  "onClick-row"?: ((...args: any[]) => any) | undefined;
358
- }>, "error" | "sort" | "items" | "loading" | "fixed" | "virtualList" | "virtualListItemHeight" | "virtualListOverscan" | "headers" | "loadingSkeleton" | "loadingLines" | "dense" | "striped" | "pointer" | "scrollable" | "stickyHeader" | "expandable"> & {
359
- selected?: string | number | undefined;
400
+ }>, "error" | "sort" | "items" | "loading" | "fixed" | "virtualList" | "virtualListItemHeight" | "virtualListOverscan" | "headers" | "loadingSkeleton" | "loadingLines" | "dense" | "striped" | "pointer" | "scrollable" | "stickyHeader" | "expandable" | "selectable" | "singleSelect" | "autoClearSelected"> & {
401
+ selected?: string | number | (string | number)[] | undefined;
360
402
  };
361
403
  expose(exposed: {}): void;
362
404
  attrs: any;
@@ -398,6 +440,9 @@ declare const _default: <T>(__VLS_props: Partial<{
398
440
  scrollable: boolean;
399
441
  stickyHeader: boolean;
400
442
  expandable: boolean;
443
+ selectable: boolean;
444
+ singleSelect: boolean;
445
+ autoClearSelected: boolean;
401
446
  }> & Omit<{
402
447
  readonly error: boolean;
403
448
  readonly sort: string[];
@@ -416,6 +461,9 @@ declare const _default: <T>(__VLS_props: Partial<{
416
461
  readonly scrollable: boolean;
417
462
  readonly stickyHeader: boolean;
418
463
  readonly expandable: boolean;
464
+ readonly selectable: boolean;
465
+ readonly singleSelect: boolean;
466
+ readonly autoClearSelected: boolean;
419
467
  readonly virtualListOffsetTop?: number | undefined;
420
468
  readonly virtualListOffsetBottom?: number | undefined;
421
469
  readonly keyProp?: string | undefined;
@@ -466,11 +514,17 @@ declare const _default: <T>(__VLS_props: Partial<{
466
514
  default: number;
467
515
  };
468
516
  keyProp: StringConstructor;
517
+ selectable: BooleanConstructor;
518
+ singleSelect: BooleanConstructor;
519
+ autoClearSelected: {
520
+ type: BooleanConstructor;
521
+ default: boolean;
522
+ };
469
523
  }>> & Readonly<{
470
524
  "onUpdate:sort"?: ((...args: any[]) => any) | undefined;
471
525
  "onClick-row"?: ((...args: any[]) => any) | undefined;
472
- }>, "error" | "sort" | "items" | "loading" | "fixed" | "virtualList" | "virtualListItemHeight" | "virtualListOverscan" | "headers" | "loadingSkeleton" | "loadingLines" | "dense" | "striped" | "pointer" | "scrollable" | "stickyHeader" | "expandable"> & {
473
- selected?: string | number | undefined;
526
+ }>, "error" | "sort" | "items" | "loading" | "fixed" | "virtualList" | "virtualListItemHeight" | "virtualListOverscan" | "headers" | "loadingSkeleton" | "loadingLines" | "dense" | "striped" | "pointer" | "scrollable" | "stickyHeader" | "expandable" | "selectable" | "singleSelect" | "autoClearSelected"> & {
527
+ selected?: string | number | (string | number)[] | undefined;
474
528
  };
475
529
  expose(exposed: {}): void;
476
530
  attrs: any;
@@ -1,16 +1,17 @@
1
- import { defineComponent as K, mergeModels as S, useModel as Q, computed as x, ref as R, watch as U, openBlock as o, createElementBlock as r, mergeProps as C, unref as n, renderSlot as p, createElementVNode as f, normalizeStyle as H, normalizeClass as m, createVNode as v, withCtx as c, createBlock as g, createCommentVNode as $, Fragment as k, renderList as h, createTextVNode as O, toDisplayString as P } from "vue";
2
- import { useTheme as Y } from "../../composables/useTheme.js";
3
- import { useVirtualList as Z } from "../../composables/useVirtualList.js";
4
- import j from "./TableHead.vue.js";
5
- import I from "./TableHeader.vue.js";
6
- import ee from "./TableBody.js";
7
- import T from "./TableRow.vue.js";
8
- import _ from "./TableCell.vue.js";
9
- import te from "../spinner/Spinner.vue.js";
10
- import se from "../skeleton/Skeleton.vue.js";
11
- import oe from "../icon/Icon.vue.js";
12
- import { chevronDownIcon as le } from "../../common/icons.js";
13
- const ie = { key: 1 }, ae = { colspan: "999" }, re = { key: 2 }, ne = { colspan: "999" }, de = ["onClick"], ue = { colspan: "999" }, pe = {
1
+ import { defineComponent as te, mergeModels as R, useModel as le, computed as B, ref as ae, watch as re, openBlock as s, createElementBlock as u, mergeProps as V, unref as d, renderSlot as f, createElementVNode as g, normalizeStyle as M, normalizeClass as k, createVNode as v, withCtx as c, createBlock as m, withModifiers as N, createCommentVNode as h, Fragment as S, renderList as $, createTextVNode as X, toDisplayString as D } from "vue";
2
+ import { useTheme as se } from "../../composables/useTheme.js";
3
+ import { useVirtualList as ie } from "../../composables/useVirtualList.js";
4
+ import oe from "./TableHead.vue.js";
5
+ import _ from "./TableHeader.vue.js";
6
+ import ne from "./TableBody.js";
7
+ import E from "./TableRow.vue.js";
8
+ import C from "./TableCell.vue.js";
9
+ import ue from "../spinner/Spinner.vue.js";
10
+ import de from "../skeleton/Skeleton.vue.js";
11
+ import ce from "../icon/Icon.vue.js";
12
+ import J from "../checkbox/Checkbox.vue.js";
13
+ import { chevronDownIcon as pe } from "../../common/icons.js";
14
+ const fe = { key: 1 }, ve = { colspan: "999" }, me = { key: 2 }, ye = { colspan: "999" }, ge = ["onClick"], ke = { colspan: "999" }, be = {
14
15
  headers: {
15
16
  type: Array,
16
17
  default: () => []
@@ -54,11 +55,17 @@ const ie = { key: 1 }, ae = { colspan: "999" }, re = { key: 2 }, ne = { colspan:
54
55
  type: Number,
55
56
  default: 5
56
57
  },
57
- keyProp: String
58
- }, ce = { name: "XTable" }, Le = /* @__PURE__ */ K({
59
- ...ce,
60
- props: /* @__PURE__ */ S({
61
- ...pe,
58
+ keyProp: String,
59
+ selectable: Boolean,
60
+ singleSelect: Boolean,
61
+ autoClearSelected: {
62
+ type: Boolean,
63
+ default: !0
64
+ }
65
+ }, he = { name: "XTable" }, xe = /* @__PURE__ */ te({
66
+ ...he,
67
+ props: /* @__PURE__ */ R({
68
+ ...be,
62
69
  items: {
63
70
  type: Array,
64
71
  default: () => []
@@ -67,95 +74,125 @@ const ie = { key: 1 }, ae = { colspan: "999" }, re = { key: 2 }, ne = { colspan:
67
74
  selected: {},
68
75
  selectedModifiers: {}
69
76
  }),
70
- emits: /* @__PURE__ */ S(["update:sort", "click-row"], ["update:selected"]),
71
- setup(B, { emit: z }) {
72
- const a = B, L = Q(B, "selected"), A = x(() => typeof L.value < "u");
73
- function V(e) {
77
+ emits: /* @__PURE__ */ R(["update:sort", "click-row"], ["update:selected"]),
78
+ setup(H, { emit: F }) {
79
+ const l = H, a = le(H, "selected");
80
+ function W(e) {
74
81
  try {
75
82
  return JSON.parse(JSON.stringify(e));
76
83
  } catch {
77
84
  return [];
78
85
  }
79
86
  }
80
- const b = x(() => a.items), { list: M, containerProps: D, wrapperProps: E } = Z(
81
- b,
87
+ const w = B(() => l.items), { list: q, containerProps: G, wrapperProps: Q } = ie(
88
+ w,
82
89
  {
83
- disabled: !a.virtualList,
84
- itemHeight: a.virtualListItemHeight || 54,
85
- topOffset: a.virtualListOffsetTop || 0,
86
- bottomOffset: a.virtualListOffsetBottom || 0,
87
- overscan: a.virtualListOverscan
90
+ disabled: !l.virtualList,
91
+ itemHeight: l.virtualListItemHeight || 54,
92
+ topOffset: l.virtualListOffsetTop || 0,
93
+ bottomOffset: l.virtualListOffsetBottom || 0,
94
+ overscan: l.virtualListOverscan
88
95
  }
89
- ), y = R([]);
90
- U(b, (e) => {
91
- a.expandable && (y.value = V(e));
92
- }, { immediate: !0 });
93
- const J = z;
94
- function X(e, l) {
96
+ ), b = ae([]), O = F;
97
+ function U(e, r) {
95
98
  if (e)
96
- for (let t = 0; t < l.length; t++) {
97
- const { 0: i, 1: s } = l[t].split(",");
98
- if (e === i)
99
- return parseInt(s) > 0 ? 1 : -1;
99
+ for (let t = 0; t < r.length; t++) {
100
+ const { 0: o, 1: i } = r[t].split(",");
101
+ if (e === o)
102
+ return parseInt(i) > 0 ? 1 : -1;
100
103
  }
101
104
  }
102
- function F(e) {
103
- const l = a.sort.slice(0);
105
+ function Y(e) {
106
+ const r = l.sort.slice(0);
104
107
  let t = !1;
105
- for (let i = 0; i < l.length; i++) {
106
- const { 0: s, 1: d } = l[i].split(",");
107
- if (s === e.value) {
108
- if (t = !0, d === "-1") {
109
- l.splice(i, 1, `${e.value},1`);
108
+ for (let o = 0; o < r.length; o++) {
109
+ const { 0: i, 1: p } = r[o].split(",");
110
+ if (i === e.value) {
111
+ if (t = !0, p === "-1") {
112
+ r.splice(o, 1, `${e.value},1`);
110
113
  break;
111
- } else if (d === "1") {
112
- l.splice(i, 1);
114
+ } else if (p === "1") {
115
+ r.splice(o, 1);
113
116
  break;
114
117
  }
115
118
  }
116
119
  }
117
- t || l.push(`${e.value},-1`), J("update:sort", l);
120
+ t || r.push(`${e.value},-1`), O("update:sort", r);
118
121
  }
119
- function W(e, l) {
120
- if (!l)
122
+ function Z(e, r) {
123
+ if (!r)
121
124
  return "";
122
- const t = Array.isArray(l) ? l : l.match(/([^[.\]])+/g);
123
- return (t == null ? void 0 : t.reduce((s, d) => s && s[d], e)) ?? "";
125
+ const t = Array.isArray(r) ? r : r.match(/([^[.\]])+/g);
126
+ return (t == null ? void 0 : t.reduce((i, p) => i && i[p], e)) ?? "";
124
127
  }
125
- const { styles: q, classes: w, className: G } = Y("Table", {}, a);
126
- return (e, l) => (o(), r("div", C({
127
- class: [n(G), n(w).wrapper]
128
- }, n(D)), [
129
- p(e.$slots, "title"),
130
- p(e.$slots, "actions"),
131
- f("div", C(n(E), {
132
- class: {
133
- "!h-auto": a.loading
134
- }
128
+ const y = B(() => l.selectable ? w.value.map((e, r) => l.keyProp ? e[l.keyProp] : r) : []), T = B(() => !l.selectable || l.singleSelect ? !1 : Array.isArray(a.value) && a.value.length > 0 && y.value.length > 0 && a.value.length === y.value.length), P = B(() => !l.selectable || l.singleSelect ? !1 : Array.isArray(a.value) && a.value.length > 0 && y.value.length > 0 && a.value.length !== y.value.length);
129
+ function x(e) {
130
+ return l.selectable ? l.singleSelect ? a.value === e : Array.isArray(a.value) && a.value.includes(e) : !1;
131
+ }
132
+ function L(e) {
133
+ l.selectable && (l.singleSelect ? a.value = a.value === e ? void 0 : e : (Array.isArray(a.value) || (a.value = []), a.value.includes(e) ? a.value = a.value.filter((r) => r !== e) : a.value = [...a.value, e]));
134
+ }
135
+ function I() {
136
+ !l.selectable || l.singleSelect || (T.value || P.value ? a.value = [] : a.value = y.value);
137
+ }
138
+ function j(e, r) {
139
+ l.selectable && l.singleSelect && L(l.keyProp ? e[l.keyProp] : r), O("click-row", e, r);
140
+ }
141
+ re(w, (e) => {
142
+ l.expandable && (b.value = W(e)), l.selectable && l.autoClearSelected && (l.singleSelect ? y.value.includes(a.value) || (a.value = void 0) : Array.isArray(a.value) && (a.value = a.value.filter((r) => y.value.includes(r))));
143
+ }, { immediate: !0 });
144
+ const { styles: K, classes: A, className: ee } = se("Table", {}, l);
145
+ return (e, r) => (s(), u("div", V({
146
+ class: [d(ee), d(A).wrapper]
147
+ }, d(G)), [
148
+ f(e.$slots, "title"),
149
+ f(e.$slots, "actions"),
150
+ g("div", V(d(Q), {
151
+ class: ["relative", {
152
+ "!h-auto": l.loading
153
+ }]
135
154
  }), [
136
- f("table", {
137
- style: H(n(q)),
138
- class: m(n(w).table)
155
+ g("table", {
156
+ style: M(d(K)),
157
+ class: k(d(A).table)
139
158
  }, [
140
- v(j, { "sticky-header": e.stickyHeader }, {
159
+ v(oe, { "sticky-header": e.stickyHeader }, {
141
160
  default: c(() => [
142
- e.expandable ? (o(), g(I, {
161
+ l.selectable && !l.singleSelect ? (s(), m(_, {
143
162
  key: 0,
163
+ width: "40",
164
+ class: "!pl-3.5 !pr-0.5 !py-2.5 cursor-pointer",
165
+ onClick: I
166
+ }, {
167
+ default: c(() => [
168
+ v(J, {
169
+ "model-value": T.value || P.value,
170
+ indeterminate: P.value,
171
+ "hide-footer": "",
172
+ "aria-label": "Select all rows",
173
+ "skip-form-registry": "",
174
+ onClick: N(I, ["prevent", "stop"])
175
+ }, null, 8, ["model-value", "indeterminate"])
176
+ ]),
177
+ _: 1
178
+ })) : h("", !0),
179
+ e.expandable ? (s(), m(_, {
180
+ key: 1,
144
181
  width: "48",
145
182
  class: "!p-0"
146
- })) : $("", !0),
147
- (o(!0), r(k, null, h(e.headers, (t, i) => (o(), g(I, {
148
- key: i,
183
+ })) : h("", !0),
184
+ (s(!0), u(S, null, $(e.headers, (t, o) => (s(), m(_, {
185
+ key: o,
149
186
  "text-align": t.align,
150
- sort: X(t.value, e.sort),
187
+ sort: U(t.value, e.sort),
151
188
  sortable: t.sortable,
152
189
  width: t.width,
153
190
  tooltip: t.tooltip,
154
- onClick: (s) => t.sortable ? F(t) : null
191
+ onClick: (i) => t.sortable ? Y(t) : null
155
192
  }, {
156
193
  default: c(() => [
157
- p(e.$slots, `header-${t.value}`, { header: t }, () => [
158
- O(P(t.text), 1)
194
+ f(e.$slots, `header-${t.value}`, { header: t }, () => [
195
+ X(D(t.text), 1)
159
196
  ])
160
197
  ]),
161
198
  _: 2
@@ -163,28 +200,28 @@ const ie = { key: 1 }, ae = { colspan: "999" }, re = { key: 2 }, ne = { colspan:
163
200
  ]),
164
201
  _: 3
165
202
  }, 8, ["sticky-header"]),
166
- v(n(ee), null, {
203
+ v(d(ne), null, {
167
204
  default: c(() => [
168
- e.loading ? (o(!0), r(k, { key: 0 }, h(Number(e.loadingLines), (t, i) => (o(), g(T, {
169
- key: i,
205
+ e.loading ? (s(!0), u(S, { key: 0 }, $(Number(e.loadingLines), (t, o) => (s(), m(E, {
206
+ key: o,
170
207
  striped: e.striped
171
208
  }, {
172
209
  default: c(() => [
173
- (o(!0), r(k, null, h(e.headers, (s, d) => (o(), g(_, {
174
- key: d,
175
- "text-align": s.align,
176
- width: s.width,
210
+ (s(!0), u(S, null, $(e.headers, (i, p) => (s(), m(C, {
211
+ key: p,
212
+ "text-align": i.align,
213
+ width: i.width,
177
214
  dense: e.dense,
178
215
  fixed: e.fixed
179
216
  }, {
180
217
  default: c(() => [
181
- p(e.$slots, `loading-${s.value}`, { item: t }, () => [
182
- v(se, {
183
- class: m(["max-w-[60%]", {
184
- "mx-auto": s.align === "center",
185
- "ml-auto": s.align === "right"
218
+ f(e.$slots, `loading-${i.value}`, { item: t }, () => [
219
+ v(de, {
220
+ class: k(["max-w-[60%]", {
221
+ "mx-auto": i.align === "center",
222
+ "ml-auto": i.align === "right"
186
223
  }]),
187
- shape: s.skeletonShape || "line"
224
+ shape: i.skeletonShape || "line"
188
225
  }, null, 8, ["shape", "class"])
189
226
  ])
190
227
  ]),
@@ -192,106 +229,124 @@ const ie = { key: 1 }, ae = { colspan: "999" }, re = { key: 2 }, ne = { colspan:
192
229
  }, 1032, ["text-align", "width", "dense", "fixed"]))), 128))
193
230
  ]),
194
231
  _: 2
195
- }, 1032, ["striped"]))), 128)) : e.error ? (o(), r("tr", ie, [
196
- f("td", ae, [
197
- p(e.$slots, "error")
232
+ }, 1032, ["striped"]))), 128)) : e.error ? (s(), u("tr", fe, [
233
+ g("td", ve, [
234
+ f(e.$slots, "error")
198
235
  ])
199
- ])) : !b.value || b.value.length === 0 ? (o(), r("tr", re, [
200
- f("td", ne, [
201
- p(e.$slots, "empty")
236
+ ])) : !w.value || w.value.length === 0 ? (s(), u("tr", me, [
237
+ g("td", ye, [
238
+ f(e.$slots, "empty")
202
239
  ])
203
- ])) : (o(!0), r(k, { key: 3 }, h(n(M), (t, i) => {
204
- var s, d;
205
- return o(), r(k, {
206
- key: e.keyProp ?? i
240
+ ])) : (s(!0), u(S, { key: 3 }, $(d(q), (t, o) => {
241
+ var i, p;
242
+ return s(), u(S, {
243
+ key: e.keyProp ? t.data[e.keyProp] : t.index
207
244
  }, [
208
- v(T, {
245
+ v(E, {
209
246
  pointer: e.pointer,
210
247
  striped: e.striped,
211
- selected: A.value ? L.value === (e.keyProp ? t.data[e.keyProp] : t.index) : void 0,
212
- onClick: (u) => e.$emit("click-row", t.data, t.index)
248
+ selected: x(e.keyProp ? t.data[e.keyProp] : t.index),
249
+ "single-select": e.singleSelect,
250
+ onClick: (n) => j(t.data, t.index)
213
251
  }, {
214
252
  default: c(() => [
215
- e.expandable ? (o(), g(_, {
253
+ l.selectable && !e.singleSelect ? (s(), m(C, {
216
254
  key: 0,
255
+ width: "40",
256
+ class: "!pl-3.5 !pr-0.5 cursor-pointer",
257
+ onClick: N((n) => L(e.keyProp ? t.data[e.keyProp] : t.index), ["stop"])
258
+ }, {
259
+ default: c(() => [
260
+ v(J, {
261
+ "model-value": x(e.keyProp ? t.data[e.keyProp] : t.index),
262
+ "hide-footer": "",
263
+ "aria-label": `Select row ${o + 1}`,
264
+ "skip-form-registry": "",
265
+ onClick: N((n) => L(e.keyProp ? t.data[e.keyProp] : t.index), ["prevent", "stop"])
266
+ }, null, 8, ["model-value", "aria-label", "onClick"])
267
+ ]),
268
+ _: 2
269
+ }, 1032, ["onClick"])) : h("", !0),
270
+ e.expandable ? (s(), m(C, {
271
+ key: 1,
217
272
  width: "48",
218
273
  class: "!p-1"
219
274
  }, {
220
275
  default: c(() => {
221
- var u;
276
+ var n;
222
277
  return [
223
- f("button", {
278
+ g("button", {
224
279
  type: "button",
225
- class: m(["px-3 p-2", [e.dense ? "p-0.5" : "px-3 py-2"]]),
226
- onClick: (N) => y.value[t.index].__expanded = !y.value[t.index].__expanded
280
+ class: k(["px-3 p-2", [e.dense ? "p-0.5" : "px-3 py-2"]]),
281
+ onClick: (z) => b.value[t.index].__expanded = !b.value[t.index].__expanded
227
282
  }, [
228
- v(oe, {
229
- icon: n(le),
283
+ v(ce, {
284
+ icon: d(pe),
230
285
  size: e.dense ? "xs" : "md",
231
- class: m(["transition-transform", {
232
- "rotate-180": (u = y.value[t.index]) == null ? void 0 : u.__expanded
286
+ class: k(["transition-transform", {
287
+ "rotate-180": (n = b.value[t.index]) == null ? void 0 : n.__expanded
233
288
  }])
234
289
  }, null, 8, ["icon", "size", "class"])
235
- ], 10, de)
290
+ ], 10, ge)
236
291
  ];
237
292
  }),
238
293
  _: 2
239
- }, 1024)) : $("", !0),
240
- (o(!0), r(k, null, h(e.headers, (u, N) => (o(), g(_, {
241
- key: N,
242
- "text-align": u.align,
243
- truncate: u.truncate,
244
- width: u.width,
294
+ }, 1024)) : h("", !0),
295
+ (s(!0), u(S, null, $(e.headers, (n, z) => (s(), m(C, {
296
+ key: z,
297
+ "text-align": n.align,
298
+ truncate: n.truncate,
299
+ width: n.width,
245
300
  dense: e.dense,
246
- style: H([a.virtualList ? {
247
- height: `${a.virtualListItemHeight}px`,
248
- maxHeight: `${a.virtualListItemHeight}px`,
301
+ style: M([l.virtualList ? {
302
+ height: `${l.virtualListItemHeight}px`,
303
+ maxHeight: `${l.virtualListItemHeight}px`,
249
304
  overflow: "hidden",
250
305
  whiteSpace: "nowrap"
251
306
  } : {}])
252
307
  }, {
253
308
  default: c(() => [
254
- p(e.$slots, `item-${u.value}`, {
309
+ f(e.$slots, `item-${n.value}`, {
255
310
  item: t.data
256
311
  }, () => [
257
- O(P(W(t.data, u.value)), 1)
312
+ X(D(Z(t.data, n.value)), 1)
258
313
  ])
259
314
  ]),
260
315
  _: 2
261
316
  }, 1032, ["text-align", "truncate", "width", "dense", "style"]))), 128))
262
317
  ]),
263
318
  _: 2
264
- }, 1032, ["pointer", "striped", "selected", "onClick"]),
265
- e.expandable ? (o(), r("tr", {
319
+ }, 1032, ["pointer", "striped", "selected", "single-select", "onClick"]),
320
+ e.expandable ? (s(), u("tr", {
266
321
  key: 0,
267
- class: m({ hidden: !((s = y.value[t.index]) != null && s.__expanded) })
322
+ class: k({ hidden: !((i = b.value[t.index]) != null && i.__expanded) })
268
323
  }, [
269
- f("td", ue, [
270
- f("div", {
271
- class: m(["overflow-hidden transition-opacity", [(d = y.value[t.index]) != null && d.__expanded ? "" : "opacity-0 max-h-0"]])
324
+ g("td", ke, [
325
+ g("div", {
326
+ class: k(["overflow-hidden transition-opacity", [(p = b.value[t.index]) != null && p.__expanded ? "" : "opacity-0 max-h-0"]])
272
327
  }, [
273
- p(e.$slots, "expanded-row", {
328
+ f(e.$slots, "expanded-row", {
274
329
  item: t.data
275
330
  })
276
331
  ], 2)
277
332
  ])
278
- ], 2)) : $("", !0)
333
+ ], 2)) : h("", !0)
279
334
  ], 64);
280
335
  }), 128))
281
336
  ]),
282
337
  _: 3
283
- }),
284
- e.loading ? (o(), r("div", {
285
- key: 0,
286
- class: m(n(w).loadingWrapper)
287
- }, [
288
- v(te, { size: "lg" })
289
- ], 2)) : $("", !0)
290
- ], 6)
338
+ })
339
+ ], 6),
340
+ e.loading ? (s(), u("div", {
341
+ key: 0,
342
+ class: k(d(A).loadingWrapper)
343
+ }, [
344
+ v(ue, { size: "lg" })
345
+ ], 2)) : h("", !0)
291
346
  ], 16)
292
347
  ], 16));
293
348
  }
294
349
  });
295
350
  export {
296
- Le as default
351
+ xe as default
297
352
  };