@pantograph/vue 0.13.0 → 0.14.0

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 (87) hide show
  1. package/dist/ActionButton/ActionButton.d.ts +4 -4
  2. package/dist/ActionButton/index.js +1 -1
  3. package/dist/{ActionButton.vue_vue_type_script_setup_true_lang-Bkuz_iUP.js → ActionButton.vue_vue_type_script_setup_true_lang-DaeklrrN.js} +1 -1
  4. package/dist/Alert/index.js +4 -119
  5. package/dist/Alert/index.umd.cjs +1 -1
  6. package/dist/Alert.vue_vue_type_style_index_0_lang--7bfc5C-.js +1 -0
  7. package/dist/Alert.vue_vue_type_style_index_0_lang-BC_IaSi8.js +120 -0
  8. package/dist/Avatar/index.js +1 -1
  9. package/dist/{Avatar.vue_vue_type_style_index_0_lang-BHfzjXmT.js → Avatar.vue_vue_type_style_index_0_lang-Dlk0AXBn.js} +3 -3
  10. package/dist/AvatarGroup/index.js +1 -1
  11. package/dist/Badge/index.js +1 -1
  12. package/dist/{Badge.vue_vue_type_script_setup_true_lang-CeXpqXtw.js → Badge.vue_vue_type_script_setup_true_lang-Ck0gfAPv.js} +6 -6
  13. package/dist/{BaseBadge.vue_vue_type_style_index_0_lang-DnB978eI.js → BaseBadge.vue_vue_type_style_index_0_lang-BoPWxJgb.js} +4 -4
  14. package/dist/{BaseButton.vue_vue_type_style_index_0_lang-hgXHwNIC.js → BaseButton.vue_vue_type_style_index_0_lang-jR9htGtl.js} +5 -5
  15. package/dist/Button/Button.d.ts +4 -4
  16. package/dist/Button/index.js +1 -1
  17. package/dist/{Button.vue_vue_type_script_setup_true_lang-CJv66ooM.js → Button.vue_vue_type_script_setup_true_lang-DxYAiv5-.js} +1 -1
  18. package/dist/ButtonGroup/index.js +1 -1
  19. package/dist/{ButtonGroup.vue_vue_type_script_setup_true_lang-pokTDMXb.js → ButtonGroup.vue_vue_type_script_setup_true_lang-BCxUeTU6.js} +2 -2
  20. package/dist/Checkbox/index.js +1 -1
  21. package/dist/{Checkbox.vue_vue_type_style_index_0_lang-Bj-0gSIp.js → Checkbox.vue_vue_type_style_index_0_lang-C741-uKz.js} +1 -1
  22. package/dist/CheckboxGroup/index.js +1 -1
  23. package/dist/ColorPicker/index.js +1 -1
  24. package/dist/{ColorPicker.vue_vue_type_style_index_0_lang-zw5qynUn.js → ColorPicker.vue_vue_type_style_index_0_lang-CGOaJvqg.js} +3 -3
  25. package/dist/ColorSwatch/index.js +1 -1
  26. package/dist/{ColorSwatch.vue_vue_type_style_index_0_lang-IJyJA0LN.js → ColorSwatch.vue_vue_type_style_index_0_lang-C_ucF_yu.js} +2 -2
  27. package/dist/ColorSwatchGroup/index.js +1 -1
  28. package/dist/{ColorSwatchGroup.vue_vue_type_style_index_0_lang-DJDJEbIy.js → ColorSwatchGroup.vue_vue_type_style_index_0_lang-BtxjxG9e.js} +4 -4
  29. package/dist/ColorTrigger/index.js +1 -1
  30. package/dist/{ColorTrigger.vue_vue_type_style_index_0_lang-CmGF_rFV.js → ColorTrigger.vue_vue_type_style_index_0_lang-CpboYwky.js} +3 -3
  31. package/dist/ConfigProvider/index.js +4 -4
  32. package/dist/DataTable/index.js +3 -784
  33. package/dist/DataTable/index.umd.cjs +1 -1
  34. package/dist/DataTable.vue_vue_type_style_index_0_lang-C4_xSg7e.js +1 -0
  35. package/dist/DataTable.vue_vue_type_style_index_0_lang-DMa_QFrL.js +785 -0
  36. package/dist/Empty/index.js +1 -1
  37. package/dist/{Empty.vue_vue_type_style_index_0_lang-ylfi6RV1.js → Empty.vue_vue_type_style_index_0_lang-Cz88kxid.js} +1 -1
  38. package/dist/FloatButton/FloatButton.d.ts +4 -4
  39. package/dist/FloatButton/index.js +1 -1
  40. package/dist/{FloatButton.vue_vue_type_script_setup_true_lang-B9DvMjig.js → FloatButton.vue_vue_type_script_setup_true_lang-CI_ILBah.js} +1 -1
  41. package/dist/GraphicalObject/index.js +1 -1
  42. package/dist/{GraphicalObject.vue_vue_type_script_setup_true_lang-B57gv_5O.js → GraphicalObject.vue_vue_type_script_setup_true_lang-CnSiDVWQ.js} +1 -1
  43. package/dist/Icon/index.js +1 -1
  44. package/dist/{Icon.vue_vue_type_style_index_0_lang-BFTlmCAO.js → Icon.vue_vue_type_style_index_0_lang-BOEBJy1n.js} +1 -1
  45. package/dist/IconButton/IconButton.d.ts +4 -4
  46. package/dist/IconButton/index.js +1 -1
  47. package/dist/{IconButton.vue_vue_type_script_setup_true_lang-DwSwWylD.js → IconButton.vue_vue_type_script_setup_true_lang-aNYHKjEX.js} +1 -1
  48. package/dist/Image/index.js +1 -1
  49. package/dist/{Image.vue_vue_type_style_index_0_lang-Ba5p3XBO.js → Image.vue_vue_type_style_index_0_lang-ojGZYu59.js} +2 -2
  50. package/dist/IndentLevel/IndentLevel.d.ts +1 -1
  51. package/dist/IndentLevel/index.js +1 -1
  52. package/dist/{IndentLevel.vue_vue_type_style_index_0_lang-Bqr8NvMZ.js → IndentLevel.vue_vue_type_style_index_0_lang-kxY9UBCJ.js} +2 -2
  53. package/dist/Indicator/index.js +1 -1
  54. package/dist/{Indicator.vue_vue_type_script_setup_true_lang-BNc4K0mZ.js → Indicator.vue_vue_type_script_setup_true_lang-CRmpJaKR.js} +4 -4
  55. package/dist/Input/index.js +1 -1
  56. package/dist/{Input.vue_vue_type_style_index_0_lang-osOWuv4Y.js → Input.vue_vue_type_style_index_0_lang-07-tyz6h.js} +1 -1
  57. package/dist/Kbd/index.js +1 -1
  58. package/dist/{Kbd.vue_vue_type_style_index_0_lang-AT19IxM-.js → Kbd.vue_vue_type_style_index_0_lang-qS65z9Bz.js} +1 -1
  59. package/dist/Link/index.js +1 -1
  60. package/dist/{Link.vue_vue_type_style_index_0_lang-Dp25vaUV.js → Link.vue_vue_type_style_index_0_lang-K7EUHqqW.js} +1 -1
  61. package/dist/Menu/index.js +1 -1
  62. package/dist/{Menu.vue_vue_type_style_index_0_lang-BTO-YwB5.js → Menu.vue_vue_type_style_index_0_lang-DsGOSTfu.js} +3 -3
  63. package/dist/MenuItem/MenuItem.d.ts +1 -1
  64. package/dist/MenuItem/index.js +1 -1
  65. package/dist/Popover/index.js +1 -1
  66. package/dist/{Popover.vue_vue_type_style_index_0_lang-CAikz7cp.js → Popover.vue_vue_type_style_index_0_lang-Bh6rugB0.js} +1 -1
  67. package/dist/ScrollContainer/Mask.d.ts +9 -0
  68. package/dist/ScrollContainer/ScrollContainer.d.ts +215 -0
  69. package/dist/ScrollContainer/ScrollContainer.model.d.ts +2 -0
  70. package/dist/ScrollContainer/index.d.ts +2 -0
  71. package/dist/ScrollContainer/index.js +148 -0
  72. package/dist/ScrollContainer/index.umd.cjs +1 -0
  73. package/dist/Shortcut/index.js +1 -1
  74. package/dist/{Shortcut.vue_vue_type_style_index_0_lang-DWc3jZLn.js → Shortcut.vue_vue_type_style_index_0_lang-4v-K4pSO.js} +2 -2
  75. package/dist/Spinner/index.js +1 -1
  76. package/dist/{Spinner.vue_vue_type_style_index_0_lang-BXXS6me6.js → Spinner.vue_vue_type_style_index_0_lang-CQL0u4nz.js} +1 -1
  77. package/dist/Switch/index.js +1 -1
  78. package/dist/{Switch.vue_vue_type_style_index_0_lang-DQMhplS7.js → Switch.vue_vue_type_style_index_0_lang-X8rMBTNH.js} +1 -1
  79. package/dist/Tree/Tree.d.ts +2 -2
  80. package/dist/Tree/index.js +1 -1
  81. package/dist/{Tree.vue_vue_type_style_index_0_lang-yfNHbbTS.js → Tree.vue_vue_type_style_index_0_lang-DT7izWYN.js} +3 -3
  82. package/dist/{index-BCMo0YVL.js → index-DXzWdQsN.js} +2 -2
  83. package/dist/index.d.ts +40 -32
  84. package/dist/index.js +150 -128
  85. package/dist/index.umd.cjs +1 -1
  86. package/dist/style/index.css +1 -1
  87. package/package.json +7 -2
@@ -1,786 +1,5 @@
1
- import { h as Ee, ref as Z, computed as D, watch as le, defineComponent as He, useSlots as Le, unref as t, useTemplateRef as Me, onBeforeUnmount as Ve, shallowRef as Ne, createElementBlock as v, openBlock as a, normalizeClass as y, createVNode as d, withCtx as m, createElementVNode as $, normalizeStyle as Oe, createBlock as A, createCommentVNode as I, Fragment as z, renderList as V, mergeProps as _, renderSlot as T, createSlots as ge, withModifiers as ye, toDisplayString as qe, normalizeProps as Fe, guardReactiveProps as xe, nextTick as oe } from "vue";
2
- import { createColumnHelper as Ge, flattenBy as Ze, useVueTable as Ue, getSortedRowModel as Je, getCoreRowModel as Qe } from "@tanstack/vue-table";
3
- import { b as Xe } from "../_baseIsEqual-D6OIyc9x.js";
4
- import { a as Ye, b as eo, i as te } from "../isArray-DGJFqUD8.js";
5
- import { _ as we } from "../Checkbox.vue_vue_type_style_index_0_lang-Bj-0gSIp.js";
6
- import { _ as oo, a as ne } from "../Menu.vue_vue_type_style_index_0_lang-BTO-YwB5.js";
7
- import { _ as to } from "../ActionButton.vue_vue_type_script_setup_true_lang-Bkuz_iUP.js";
8
- import { _ as no } from "../Empty.vue_vue_type_style_index_0_lang-ylfi6RV1.js";
9
- import { o as se } from "../omit-BsFVls5E.js";
10
- import { u as ro } from "../uniq-DI-nuzAz.js";
11
- import { f as U, h as K } from "../_getTag-C1N7G_It.js";
12
- import { getBemBlock as lo, wgt_pre as so, generateVariantClassList as io, getBemElement as C, usePCId as co } from "@pantograph/utils";
13
- import { getBreakpoints as ao } from "@pantograph/tokens";
14
- import { useBreakpoints as uo, useIntersectionObserver as mo } from "@vueuse/core";
15
- import { _ as fo } from "../Skeleton.vue_vue_type_style_index_0_lang-aSGb2hn6.js";
16
- import { _ as he } from "../Popover.vue_vue_type_style_index_0_lang-CAikz7cp.js";
17
- import { _ as po } from "../Badge.vue_vue_type_script_setup_true_lang-CeXpqXtw.js";
18
- import { _ as be } from "../Divider.vue_vue_type_style_index_0_lang-DapqjSGc.js";
19
- import { _ as ve } from "../IconButton.vue_vue_type_script_setup_true_lang-DwSwWylD.js";
20
- import { _ as re } from "../Icon.vue_vue_type_style_index_0_lang-BFTlmCAO.js";
21
- import { _ as go } from "../Switch.vue_vue_type_style_index_0_lang-DQMhplS7.js";
22
- import { g as Ce } from "../get-9cMI4wkc.js";
23
- import { cva as yo } from "class-variance-authority";
24
- import { i as Se } from "../isEmpty-BfqMcSem.js";
25
- import { _ as wo, e as ho, c as x, a as bo, d as vo, b as G } from "../THead.vue_vue_type_style_index_0_lang-B4yro5EP.js";
26
- function _e(B, k) {
27
- return Xe(B, k);
28
- }
29
- const Co = (B, { isColumnWrapped: k, selectionId: l }) => {
30
- const N = (o) => {
31
- var f;
32
- const c = (w) => w === "list" ? "md" : "sm";
33
- return {
34
- ...(o == null ? void 0 : o.skeletonProps) ?? {},
35
- style: "width: 100%",
36
- size: c((f = o == null ? void 0 : o.skeletonProps) == null ? void 0 : f.type)
37
- };
38
- }, S = (o) => {
39
- var f, w;
40
- const c = (f = o.props) == null ? void 0 : f.column.columnDef;
41
- return K(c == null ? void 0 : c.render) && o.props.row ? (w = c == null ? void 0 : c.render) == null ? void 0 : w.call(c, {
42
- index: o.props.row.index,
43
- record: o.props.row.original,
44
- column: se(c, "render")
45
- }) : typeof o.render == "function" || typeof o.render == "object" ? Ee(o.render, o.props) : o.render;
46
- }, u = (o) => {
47
- let c = {};
48
- if (o) {
49
- const f = (j) => Number(j) >= 0 ? `${j}px` : j, { width: w, maxWidth: W, minWidth: P } = o;
50
- (w || W || P) && (c = {
51
- width: f(w),
52
- maxWidth: f(W),
53
- minWidth: f(P),
54
- overflow: w || W ? "hidden" : void 0
55
- });
56
- }
57
- return c;
58
- }, R = {}, i = (o, c = !0) => {
59
- var w;
60
- let f = 1;
61
- return ((w = o == null ? void 0 : o.subHeaders) == null ? void 0 : w.length) === 1 && o.column.id === o.subHeaders[0].column.id && (f += i(o.subHeaders[0], !1)), c && (!R[o.column.id] || R[o.column.id] < f) && (R[o.column.id] = f), f;
62
- }, g = (o, c = {}) => {
63
- var f;
64
- if (o != null && o.column) {
65
- const w = (f = o == null ? void 0 : o.column) == null ? void 0 : f.columnDef, W = [], P = {};
66
- if (U(w)) {
67
- let j = k(o.column.id);
68
- const { customCell: E, class: F } = w;
69
- if (Se(F) || W.push(F), E && (U(E) || K(E))) {
70
- const q = (h) => {
71
- if (U(h)) {
72
- const { wrap: H, colSpan: Q, rowSpan: X } = h;
73
- j = j || (H ?? !1), P.colSpan = Q, P.rowSpan = X;
74
- }
75
- };
76
- K(E) && o.row ? q(
77
- E({
78
- index: o.row.index,
79
- record: o.row.original,
80
- column: w
81
- })
82
- ) : q(E);
83
- }
84
- o.header ? P.rowSpan = i(o.header) : j && (P.wrap = !0);
85
- }
86
- return {
87
- class: Se(W) ? void 0 : W,
88
- ...P,
89
- ...c
90
- };
91
- }
92
- return {};
93
- };
94
- return {
95
- getSkeletonProps: N,
96
- RenderCell: S,
97
- getThProps: (o) => {
98
- var c, f, w;
99
- return g(o, {
100
- colSpan: (c = o == null ? void 0 : o.header) == null ? void 0 : c.colSpan,
101
- "data-has-children": ((w = (f = o == null ? void 0 : o.column) == null ? void 0 : f.columns) == null ? void 0 : w.length) > 1 ? !0 : void 0
102
- });
103
- },
104
- getTdProps: (o) => g(o),
105
- getColProps: (o) => {
106
- const c = u(o.columnDef);
107
- return o.id === l && (c.width = "var(--pt-dimension-2800)"), {
108
- style: c
109
- };
110
- },
111
- isThVisible: (o, c, f) => R[f] === 1 ? !0 : c - o === R[f]
112
- };
113
- };
114
- var So = "[object Boolean]";
115
- function _o(B) {
116
- return B === !0 || B === !1 || Ye(B) && eo(B) == So;
117
- }
118
- const ko = (B) => {
119
- const k = Z([]), l = (i) => i ? k.value.findIndex((g) => g.id === i) : -1, N = (i) => {
120
- if (i) return k.value.find((g) => g.id === i);
121
- }, S = (i) => {
122
- var g;
123
- return !!((g = N(i)) != null && g.wrap);
124
- }, u = (i) => {
125
- const { id: g } = i;
126
- if (!g) return !1;
127
- const M = i.wrap ?? !S(g), O = l(g);
128
- return O >= 0 ? k.value[O] = { id: g, wrap: M } : k.value.push({ id: g, wrap: M }), !0;
129
- }, R = D(
130
- () => (B.columns ?? []).filter((i) => _o(i.wrap)).map((i) => ({
131
- id: i.id,
132
- wrap: !!i.wrap
133
- }))
134
- );
135
- return le(
136
- R,
137
- (i) => {
138
- k.value = [...k.value, ...i];
139
- },
140
- {
141
- immediate: !0,
142
- deep: !0
143
- }
144
- ), {
145
- isColumnWrapped: S,
146
- toggleWrap: u
147
- };
148
- }, Jo = /* @__PURE__ */ He({
149
- __name: "DataTable",
150
- props: {
151
- columns: {},
152
- childrenColumnName: { default: "children" },
153
- data: {},
154
- class: {},
155
- scrollViewportCls: {},
156
- scrollAreaCls: {},
157
- theadCls: {},
158
- tbodyCls: {},
159
- actionHoverCls: {},
160
- rootCls: {},
161
- rowSelection: {},
162
- rowKey: {},
163
- lazyLoading: { type: Boolean },
164
- loading: { type: Boolean },
165
- emptyProps: {},
166
- size: {},
167
- batchActionsTitle: { default: "Records selected :" },
168
- loadingRowCount: { default: 5 },
169
- stickyHeader: { type: Boolean },
170
- zebra: { type: Boolean, default: !0 },
171
- tableLayout: { default: "fixed" },
172
- actionCol: {},
173
- noHeader: { type: Boolean },
174
- rowProps: {}
175
- },
176
- emits: ["fetch", "rowClick"],
177
- setup(B, { emit: k }) {
178
- const l = B, N = k, S = Le(), u = lo("data_table", so), R = Ge(), i = `$${u}_selection$`, g = D(() => {
179
- var e;
180
- return ((e = l.actionCol) == null ? void 0 : e.id) ?? `$${u}_action$`;
181
- }), M = (e) => se(e ?? {}, "title", "sorter", "columns", "id", "dataIndex"), O = D(() => {
182
- var p;
183
- const e = (n) => {
184
- var L;
185
- const b = n.id ?? co(`${u}--col`);
186
- return te(Ce(n, l.childrenColumnName)) ? R.group({
187
- header: n.title,
188
- id: b,
189
- columns: (L = Ce(n, l.childrenColumnName) ?? []) == null ? void 0 : L.map(e),
190
- enableSorting: !1,
191
- ...M(n)
192
- }) : R.accessor(n.dataIndex ?? n.id, {
193
- header: n.title,
194
- id: b,
195
- sortingFn: typeof n.sorter == "function" ? (ee, je) => n.sorter(ee.original, je.original) : n.sorter,
196
- enableSorting: !!n.sorter,
197
- ...M(n)
198
- });
199
- };
200
- if (!te(l.columns)) throw "no columns";
201
- const r = l.columns.map(({ id: n }) => n);
202
- if (ro(r).length !== r.length) throw "no uniq column ids";
203
- const s = [];
204
- return l.rowSelection && l.rowKey && s.push(
205
- R.accessor(i, {
206
- id: i,
207
- enableSorting: !1
208
- })
209
- ), l.columns.forEach((n) => {
210
- s.push(e(n));
211
- }), (S.action || S.hoverAction) && s.push(
212
- R.accessor(g.value, {
213
- id: g.value,
214
- header: (p = l.actionCol) == null ? void 0 : p.title,
215
- enableSorting: !1,
216
- ...M(l.actionCol)
217
- })
218
- ), s;
219
- }), { toggleWrap: ie, isColumnWrapped: J } = ko(l), o = Z({}), c = D(() => Object.keys(o.value)), f = D(
220
- () => l.rowKey ? Ze(l.data, (e) => e.children).map(
221
- (e) => e[l.rowKey]
222
- ) : []
223
- ), w = () => {
224
- const e = Object.fromEntries(
225
- c.value.filter((r) => {
226
- var s;
227
- return !((s = l.rowSelection) != null && s.preserveSelectedRowKeys) && l.rowKey ? f.value.includes(r) : !0;
228
- }).map((r) => [r, !0])
229
- );
230
- Object.keys(e).length !== c.value.length && (o.value = e, oe(() => {
231
- var r;
232
- K((r = l.rowSelection) == null ? void 0 : r.onChange) && l.rowSelection.onChange(H.value);
233
- }));
234
- }, W = D(() => (w(), [...l.data])), P = ao(), E = uo(
235
- Object.fromEntries(
236
- Object.keys(P).map((e) => [e, P[e].minWidth])
237
- ),
238
- { strategy: "min-width" }
239
- ).active(), F = Z({});
240
- le(
241
- E,
242
- (e) => {
243
- F.value = Object.fromEntries(
244
- O.value.map((r) => {
245
- var s;
246
- return [
247
- r.id,
248
- te(r == null ? void 0 : r.responsive) ? (s = r.responsive) == null ? void 0 : s.includes(e) : !0
249
- ];
250
- })
251
- );
252
- },
253
- { immediate: !0 }
254
- );
255
- const q = Z([]), h = Ue({
256
- // debugTable: true,
257
- getSubRows: (e) => e.children,
258
- enableSorting: !0,
259
- enableMultiSort: !0,
260
- get data() {
261
- return W.value;
262
- },
263
- onSortingChange: (e) => {
264
- q.value = typeof e == "function" ? e(q.value) : e;
265
- },
266
- state: {
267
- get sorting() {
268
- return q.value;
269
- },
270
- get rowSelection() {
271
- return o.value;
272
- },
273
- get columnVisibility() {
274
- return F.value;
275
- }
276
- },
277
- enableRowSelection: !0,
278
- get columns() {
279
- return O.value;
280
- },
281
- getRowId(e, r) {
282
- return l.rowKey ? e[l.rowKey] : r;
283
- },
284
- getRowCanExpand: () => !0,
285
- getCoreRowModel: Qe(),
286
- getSortedRowModel: Je(),
287
- onRowSelectionChange: (e) => {
288
- o.value = typeof e == "function" ? e(o.value) : e;
289
- }
290
- }), H = D(() => ({
291
- selectedRowKeys: c.value,
292
- selectedRows: h.getFilteredSelectedRowModel().flatRows.map((e) => e.original)
293
- }));
294
- le(
295
- () => {
296
- var e;
297
- return (e = l.rowSelection) == null ? void 0 : e.selectedRowKeys;
298
- },
299
- (e, r) => {
300
- var s, p;
301
- if ((p = (s = l.rowSelection) == null ? void 0 : s.selectedRowKeys) != null && p.length && !_e(e, r)) {
302
- const n = Object.fromEntries(
303
- t(l.rowSelection.selectedRowKeys ?? Object.keys(o.value)).map(
304
- (b) => [b, !0]
305
- )
306
- );
307
- _e(n, o.value) || (o.value = n);
308
- }
309
- },
310
- { immediate: !0 }
311
- );
312
- const Q = D(() => h.getIsAllRowsSelected() ? !0 : h.getIsSomeRowsSelected() ? "indeterminate" : !1), X = (e) => {
313
- h.getIsSomeRowsSelected() || h.getIsAllRowsSelected() ? h.toggleAllRowsSelected(!1) : h.toggleAllRowsSelected(!0), oe(() => {
314
- var r, s;
315
- K((r = l.rowSelection) == null ? void 0 : r.onSelectAll) && l.rowSelection.onSelectAll({ ...H.value, selected: e }), K((s = l.rowSelection) == null ? void 0 : s.onChange) && l.rowSelection.onChange(H.value);
316
- });
317
- }, ke = (e, r) => {
318
- var s;
319
- r.toggleSelected(e, {
320
- selectChildren: !((s = l.rowSelection) != null && s.checkStrictly)
321
- }), oe(() => {
322
- var p, n;
323
- K((p = l.rowSelection) == null ? void 0 : p.onSelect) && l.rowSelection.onSelect({
324
- ...H.value,
325
- selected: e,
326
- record: r.original
327
- }), K((n = l.rowSelection) == null ? void 0 : n.onChange) && l.rowSelection.onChange(H.value);
328
- });
329
- }, Re = (e) => {
330
- var r, s;
331
- return K((r = l.rowSelection) == null ? void 0 : r.getCheckboxProps) && ((s = l.rowSelection) == null || s.getCheckboxProps(e)), {};
332
- }, ce = (e) => {
333
- var r;
334
- if (e.getIsSelected()) return !0;
335
- if ((r = e.subRows) != null && r.length) {
336
- if (e.getIsAllSubRowsSelected()) return !0;
337
- if (e.getIsSomeSelected()) return "indeterminate";
338
- }
339
- return !1;
340
- }, ae = Me("target"), { stop: $e } = mo(ae, ([e]) => {
341
- l.lazyLoading && !l.loading && (e != null && e.isIntersecting) && N("fetch");
342
- });
343
- Ve($e);
344
- const { getSkeletonProps: ze, getThProps: Be, RenderCell: ue, getTdProps: Y, getColProps: Pe, isThVisible: Ae } = Co(l, {
345
- selectionId: i,
346
- isColumnWrapped: J
347
- }), me = D(() => Object.keys(o.value).length), Ie = () => {
348
- o.value = {};
349
- }, Te = yo(u, {
350
- variants: {
351
- empty: io("empty", u)
352
- }
353
- }), fe = Ne(0), De = ({ item: e }, r) => {
354
- e.key === "a-z" && r.toggleSorting(!1, !1), e.key === "z-a" && r.toggleSorting(!0, !1), e.key === "wrap" && ie({ id: r.id }), fe.value++;
355
- }, Ke = (e) => {
356
- const r = e.getIsSorted();
357
- if (!r) return "tabler:arrows-up-down";
358
- if (r === "desc") return "tabler:arrow-down";
359
- if (r === "asc") return "tabler:arrow-up";
360
- }, de = D(
361
- () => h.getHeaderGroups().map((e) => ({
362
- ...e,
363
- headers: e.headers.map((r) => ({
364
- ...r,
365
- bindings: Be(r.getContext())
366
- }))
367
- }))
368
- ), pe = (e, r) => {
369
- const s = se(r ?? {}, "row");
370
- if (l.rowProps) {
371
- if (K(l.rowProps))
372
- return { ...l.rowProps(e, r == null ? void 0 : r.row) ?? {}, ...s };
373
- if (U(l.rowProps)) return { ...l.rowProps, ...s };
374
- }
375
- return s;
376
- }, We = (e, r) => N("rowClick", e, r);
377
- return (e, r) => (a(), v("div", {
378
- class: y([t(C)(t(u), "root"), e.rootCls])
379
- }, [
380
- d(he, {
381
- "z-index": "1",
382
- open: !!(me.value && S.batchActions),
383
- placement: "bottom",
384
- "side-offset": -54,
385
- "container-cls": "pantograph-tokens pantograph-dark"
386
- }, {
387
- content: m(() => [
388
- $("div", {
389
- class: y(t(C)(t(u), "batch_actions"))
390
- }, [
391
- d(po, {
392
- text: me.value,
393
- size: "xsm"
394
- }, null, 8, ["text"]),
395
- $("div", {
396
- class: y(t(C)(t(u), "batch_actions__title"))
397
- }, qe(e.batchActionsTitle), 3),
398
- $("div", {
399
- class: y(t(C)(t(u), "batch_actions__actions"))
400
- }, [
401
- T(e.$slots, "batchActions", Fe(xe(H.value)))
402
- ], 2),
403
- d(be, {
404
- type: "vertical",
405
- class: y(t(C)(t(u), "batch_actions__divider"))
406
- }, null, 8, ["class"]),
407
- d(ve, {
408
- icon: "tabler:x",
409
- color: "gray",
410
- type: "ghost",
411
- onClick: Ie
412
- })
413
- ], 2)
414
- ]),
415
- default: m(() => [
416
- $("div", {
417
- class: y([t(C)(t(u), "scroll_area"), e.scrollAreaCls])
418
- }, [
419
- $("div", {
420
- class: y([t(C)(t(u), "scroll_viewport"), e.scrollViewportCls])
421
- }, [
422
- d(t(wo), {
423
- size: e.size,
424
- style: Oe({
425
- tableLayout: e.tableLayout
426
- }),
427
- class: y([
428
- t(Te)({
429
- empty: !t(h).getRowModel().rows.length
430
- }),
431
- l.class
432
- ])
433
- }, {
434
- default: m(() => [
435
- $("colgroup", null, [
436
- (a(!0), v(z, null, V(t(h).getVisibleLeafColumns(), (s, p) => (a(), v("col", _({
437
- key: s.id,
438
- ref_for: !0
439
- }, t(Pe)(s)), null, 16))), 128))
440
- ]),
441
- e.noHeader ? I("", !0) : (a(), A(t(ho), {
442
- key: 0,
443
- class: y(e.theadCls),
444
- sticky: e.stickyHeader
445
- }, {
446
- default: m(() => [
447
- (a(!0), v(z, null, V(de.value, (s, p) => (a(), A(t(x), _({
448
- key: s.id,
449
- ref_for: !0
450
- }, pe(p * -1 - 1)), {
451
- default: m(() => [
452
- (a(!0), v(z, null, V(s.headers, (n) => (a(), v(z, {
453
- key: n.id
454
- }, [
455
- t(Ae)(p, de.value.length, n.column.id) ? (a(), A(t(bo), _({
456
- key: 0,
457
- ref_for: !0
458
- }, n.bindings, {
459
- "data-selection": n.column.id === i
460
- }), {
461
- default: m(() => [
462
- $("div", {
463
- class: y(t(C)(t(u), "header"))
464
- }, [
465
- $("div", {
466
- class: y(t(C)(t(u), "header__content"))
467
- }, [
468
- n.column.id !== i ? (a(), v(z, { key: 0 }, [
469
- $("div", {
470
- class: y(t(C)(t(u), "header__content__title"))
471
- }, [
472
- T(e.$slots, "headerCell", _({ ref_for: !0 }, {
473
- column: n.column.columnDef
474
- }), () => [
475
- d(t(ue), {
476
- props: n.getContext(),
477
- render: n.column.columnDef.header
478
- }, null, 8, ["props", "render"])
479
- ])
480
- ], 2),
481
- n.column.getCanSort() ? (a(), A(to, {
482
- key: 0,
483
- class: y({ hide_filter_action: !n.column.getIsSorted() }),
484
- icon: Ke(n.column),
485
- size: "sm",
486
- type: "ghost",
487
- variant: "icon",
488
- active: !!n.column.getIsSorted(),
489
- onClick: (b) => {
490
- var L;
491
- return (L = n.column.getToggleSortingHandler()) == null ? void 0 : L(b);
492
- }
493
- }, null, 8, ["class", "icon", "active", "onClick"])) : I("", !0)
494
- ], 64)) : (a(), v(z, { key: 1 }, [
495
- $("div", {
496
- class: y(t(C)(t(u), "selection_space"))
497
- }, null, 2),
498
- d(we, {
499
- rootCls: "w-fit",
500
- checked: Q.value,
501
- onChange: X
502
- }, null, 8, ["checked"])
503
- ], 64))
504
- ], 2),
505
- ![g.value, i].includes(n.column.id) && !n.column.columns.length ? (a(), v("div", {
506
- key: 0,
507
- class: y(t(C)(t(u), "header__action"))
508
- }, [
509
- (a(), A(he, {
510
- "z-index": "1",
511
- placement: "bottom-end",
512
- key: fe.value
513
- }, {
514
- content: m(() => [
515
- d(oo, {
516
- onSelect: (b) => De(b, n.column)
517
- }, {
518
- default: m(() => [
519
- n.column.getCanSort() ? (a(), v(z, { key: 0 }, [
520
- d(ne, {
521
- title: "Sort A → Z",
522
- key: "a-z"
523
- }, {
524
- leading: m(({ iconSize: b }) => [
525
- d(re, {
526
- icon: "tabler:arrow-up",
527
- size: b
528
- }, null, 8, ["size"])
529
- ]),
530
- _: 1
531
- }),
532
- d(ne, {
533
- title: "Sort Z → A",
534
- key: "z-a"
535
- }, {
536
- leading: m(({ iconSize: b }) => [
537
- d(re, {
538
- icon: "tabler:arrow-down",
539
- size: b
540
- }, null, 8, ["size"])
541
- ]),
542
- _: 1
543
- }),
544
- d(be)
545
- ], 64)) : I("", !0),
546
- d(ne, {
547
- title: "Wrap Column",
548
- key: "wrap"
549
- }, {
550
- leading: m(({ iconSize: b }) => [
551
- d(re, {
552
- icon: "tabler:text-wrap",
553
- size: b
554
- }, null, 8, ["size"])
555
- ]),
556
- trailing: m(() => [
557
- d(go, {
558
- checked: t(J)(n.column.id)
559
- }, null, 8, ["checked"])
560
- ]),
561
- _: 2
562
- }, 1024)
563
- ]),
564
- _: 2
565
- }, 1032, ["onSelect"])
566
- ]),
567
- default: m(() => [
568
- d(ve, {
569
- icon: "tabler:dots-vertical",
570
- size: "sm",
571
- color: "gray",
572
- type: "ghost",
573
- class: y(t(C)(t(u), "header__action__hover"))
574
- }, null, 8, ["class"])
575
- ]),
576
- _: 2
577
- }, 1024))
578
- ], 2)) : I("", !0)
579
- ], 2)
580
- ]),
581
- _: 2
582
- }, 1040, ["data-selection"])) : I("", !0)
583
- ], 64))), 128))
584
- ]),
585
- _: 2
586
- }, 1040))), 128))
587
- ]),
588
- _: 3
589
- }, 8, ["class", "sticky"])),
590
- d(t(vo), {
591
- class: y(e.tbodyCls)
592
- }, {
593
- default: m(() => [
594
- (a(!0), v(z, null, V(t(h).getRowModel().rows, (s, p) => (a(), A(t(x), _({
595
- key: s.id,
596
- onClick: (n) => We(s.original, n),
597
- ref_for: !0
598
- }, pe(p, { zebra: e.zebra, checked: !!ce(s) })), {
599
- default: m(() => [
600
- (a(!0), v(z, null, V(s.getVisibleCells(), (n) => {
601
- var b, L;
602
- return a(), v(z, {
603
- key: n.id
604
- }, [
605
- ((b = t(Y)(n.getContext())) == null ? void 0 : b.colSpan) !== 0 && ((L = t(Y)(n.getContext())) == null ? void 0 : L.rowSpan) !== 0 ? (a(), A(t(G), _({
606
- key: 0,
607
- ref_for: !0
608
- }, t(Y)(n.getContext())), ge({
609
- default: m(() => [
610
- n.column.id === g.value && (S.hoverAction || S.action) ? (a(), v("div", {
611
- key: 0,
612
- onClick: r[0] || (r[0] = ye(() => {
613
- }, ["stop"])),
614
- class: y(t(C)(t(u), "action_cell"))
615
- }, [
616
- $("div", {
617
- class: y([t(C)(t(u), "action_cell__hover"), e.actionHoverCls])
618
- }, [
619
- T(e.$slots, "hoverAction", _(
620
- { ref_for: !0 },
621
- {
622
- column: n.column.columnDef,
623
- record: s.original,
624
- index: p
625
- }
626
- ))
627
- ], 2),
628
- T(e.$slots, "action", _(
629
- { ref_for: !0 },
630
- {
631
- column: n.column.columnDef,
632
- record: s.original,
633
- index: p
634
- }
635
- ))
636
- ], 2)) : n.column.id !== i ? T(e.$slots, "bodyCell", _(
637
- {
638
- key: 1,
639
- ref_for: !0
640
- },
641
- {
642
- column: n.column.columnDef,
643
- record: s.original,
644
- index: p
645
- }
646
- ), () => [
647
- d(t(ue), {
648
- render: n.column.columnDef.cell,
649
- props: n.getContext()
650
- }, null, 8, ["render", "props"])
651
- ]) : e.rowKey && s.original[e.rowKey] ? (a(), v("div", {
652
- key: 2,
653
- class: y(t(C)(t(u), "selection")),
654
- onClick: r[1] || (r[1] = ye(() => {
655
- }, ["stop"]))
656
- }, [
657
- $("div", {
658
- class: y(t(C)(t(u), "selection_space"))
659
- }, null, 2),
660
- d(we, _({
661
- rootCls: "w-fit",
662
- disabled: !s.getCanSelect(),
663
- checked: ce(s),
664
- onChange: (ee) => ke(ee, s),
665
- ref_for: !0
666
- }, Re(s.original)), null, 16, ["disabled", "checked", "onChange"])
667
- ], 2)) : I("", !0)
668
- ]),
669
- _: 2
670
- }, [
671
- S.cellAction && ![g.value, i].includes(n.column.id) ? {
672
- name: "absoluteAction",
673
- fn: m(() => [
674
- T(e.$slots, "cellAction", _(
675
- { ref_for: !0 },
676
- {
677
- column: n.column.columnDef,
678
- record: s.original,
679
- index: p
680
- }
681
- ))
682
- ]),
683
- key: "0"
684
- } : void 0
685
- ]), 1040)) : I("", !0)
686
- ], 64);
687
- }), 128))
688
- ]),
689
- _: 2
690
- }, 1040, ["onClick"]))), 128)),
691
- l.loading ? (a(!0), v(z, { key: 0 }, V(t(h).getRowModel().rows.length ? 2 : e.loadingRowCount, (s) => (a(), A(t(x), {
692
- key: s,
693
- zebra: e.zebra
694
- }, {
695
- default: m(() => [
696
- (a(!0), v(z, null, V(t(h).getVisibleLeafColumns(), (p, n) => (a(), A(t(G), { key: n }, {
697
- default: m(() => [
698
- p.id !== i ? T(e.$slots, "skeleton", _({
699
- key: 0,
700
- ref_for: !0
701
- }, { index: n, column: p.columnDef }), () => [
702
- d(fo, _({ ref_for: !0 }, t(ze)(p.columnDef)), null, 16)
703
- ]) : I("", !0)
704
- ]),
705
- _: 2
706
- }, 1024))), 128))
707
- ]),
708
- _: 2
709
- }, 1032, ["zebra"]))), 128)) : I("", !0),
710
- t(h).getRowModel().rows.length ? I("", !0) : (a(), A(t(x), {
711
- key: 1,
712
- empty: ""
713
- }, {
714
- default: m(() => [
715
- d(t(G), {
716
- colspan: t(h).getVisibleLeafColumns().length,
717
- empty: ""
718
- }, {
719
- default: m(() => [
720
- d(no, _({ type: "advance" }, e.emptyProps), ge({ _: 2 }, [
721
- S.emptyTitle ? {
722
- name: "title",
723
- fn: m(() => [
724
- T(e.$slots, "emptyTitle")
725
- ]),
726
- key: "0"
727
- } : void 0,
728
- S.emptyDescription ? {
729
- name: "title",
730
- fn: m(() => [
731
- T(e.$slots, "emptyDescription")
732
- ]),
733
- key: "1"
734
- } : void 0,
735
- S.emptyActions ? {
736
- name: "title",
737
- fn: m(() => [
738
- T(e.$slots, "emptyActions")
739
- ]),
740
- key: "2"
741
- } : void 0,
742
- S.emptyImage ? {
743
- name: "title",
744
- fn: m(() => [
745
- T(e.$slots, "emptyImage")
746
- ]),
747
- key: "3"
748
- } : void 0
749
- ]), 1040)
750
- ]),
751
- _: 3
752
- }, 8, ["colspan"])
753
- ]),
754
- _: 3
755
- })),
756
- e.lazyLoading ? (a(), A(t(x), {
757
- key: 2,
758
- "lazy-load-observer": ""
759
- }, {
760
- default: m(() => [
761
- d(t(G), {
762
- ref_key: "target",
763
- ref: ae,
764
- "lazy-load-observer": ""
765
- }, null, 512)
766
- ]),
767
- _: 1
768
- })) : I("", !0)
769
- ]),
770
- _: 3
771
- }, 8, ["class"])
772
- ]),
773
- _: 3
774
- }, 8, ["size", "style", "class"])
775
- ], 2)
776
- ], 2)
777
- ]),
778
- _: 3
779
- }, 8, ["open"])
780
- ], 2));
781
- }
782
- });
1
+ import { _ as t, _ as f } from "../DataTable.vue_vue_type_style_index_0_lang-DMa_QFrL.js";
783
2
  export {
784
- Jo as DataTable,
785
- Jo as default
3
+ t as DataTable,
4
+ f as default
786
5
  };