@bridge-ui/vue 0.16.0 → 0.17.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.
- package/ai/skills/bridge-ui-components/SKILL.md +2 -1
- package/dist/Actions/Snackbar/createBridgeSnackbarApi.js +1 -1
- package/dist/Actions/actionHostRegistry.d.ts +2 -1
- package/dist/Actions/actionHostRegistry.js +11 -7
- package/dist/Components/Chart/Chart.vue_vue_type_script_setup_true_lang.js +7 -7
- package/dist/Components/Chart/composables/useChart.js +16 -14
- package/dist/Components/DataTable/DataTable.vue.d.ts +5 -3
- package/dist/Components/DataTable/DataTable.vue_vue_type_script_setup_true_lang.js +114 -101
- package/dist/Components/DataTable/composables/useDataTable.d.ts +4 -2
- package/dist/Components/DataTable/composables/useDataTable.js +293 -273
- package/dist/Components/DataTable/dataTable.types.d.ts +35 -2
- package/dist/Components/Drawer/Drawer.vue_vue_type_script_setup_true_lang.js +4 -3
- package/dist/Components/Drawer/composables/useDrawer.js +68 -67
- package/dist/Components/Menu/Menu.vue_vue_type_script_setup_true_lang.js +3 -5
- package/dist/Components/Modal/Modal.vue_vue_type_script_setup_true_lang.js +4 -3
- package/dist/Components/Modal/composables/useModal.js +129 -119
- package/dist/Components/Pagination/Pagination.vue.d.ts +6 -0
- package/dist/Components/Pagination/Pagination.vue_vue_type_script_setup_true_lang.js +23 -11
- package/dist/Components/Pagination/composables/usePagination.d.ts +3 -3
- package/dist/Components/Pagination/composables/usePagination.js +95 -84
- package/dist/Components/Pagination/pagination.types.d.ts +30 -2
- package/dist/Components/Resizable/Resizable.js +5 -0
- package/dist/Components/Resizable/Resizable.vue.d.ts +17 -0
- package/dist/Components/Resizable/Resizable.vue_vue_type_script_setup_true_lang.js +30 -0
- package/dist/Components/Resizable/composables/useResizable.d.ts +18 -0
- package/dist/Components/Resizable/composables/useResizable.js +195 -0
- package/dist/Components/Resizable/index.d.ts +4 -0
- package/dist/Components/Resizable/index.js +4 -0
- package/dist/Components/Resizable/resizable.types.d.ts +53 -0
- package/dist/Components/Resizable/resizableInjectionKey.d.ts +111 -0
- package/dist/Components/Resizable/resizableInjectionKey.js +4 -0
- package/dist/Components/ResizableHandle/ResizableHandle.js +5 -0
- package/dist/Components/ResizableHandle/ResizableHandle.vue.d.ts +14 -0
- package/dist/Components/ResizableHandle/ResizableHandle.vue_vue_type_script_setup_true_lang.js +31 -0
- package/dist/Components/ResizableHandle/composables/useResizableHandle.d.ts +35 -0
- package/dist/Components/ResizableHandle/composables/useResizableHandle.js +85 -0
- package/dist/Components/ResizableHandle/index.d.ts +3 -0
- package/dist/Components/ResizableHandle/index.js +3 -0
- package/dist/Components/ResizableHandle/resizableHandle.types.d.ts +58 -0
- package/dist/Components/ResizablePanel/ResizablePanel.js +5 -0
- package/dist/Components/ResizablePanel/ResizablePanel.vue.d.ts +24 -0
- package/dist/Components/ResizablePanel/ResizablePanel.vue_vue_type_script_setup_true_lang.js +39 -0
- package/dist/Components/ResizablePanel/composables/useResizablePanel.d.ts +21 -0
- package/dist/Components/ResizablePanel/composables/useResizablePanel.js +87 -0
- package/dist/Components/ResizablePanel/index.d.ts +3 -0
- package/dist/Components/ResizablePanel/index.js +3 -0
- package/dist/Components/ResizablePanel/resizablePanel.types.d.ts +71 -0
- package/dist/Components/Snackbar/composables/useSnackbar.js +140 -146
- package/dist/Components/Tooltip/Tooltip.vue_vue_type_script_setup_true_lang.js +4 -6
- package/dist/Utils/LoadingSpin.js +5 -0
- package/dist/Utils/LoadingSpin.vue.d.ts +3 -0
- package/dist/Utils/LoadingSpin.vue_vue_type_script_setup_true_lang.js +21 -0
- package/dist/augments.d.ts +15 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +70 -63
- package/docs/README.md +1 -0
- package/docs/components/Chart.md +3 -1
- package/docs/components/DataTable.md +19 -0
- package/docs/components/Pagination.md +17 -5
- package/docs/components/Resizable.md +224 -0
- package/package.json +2 -2
|
@@ -1,98 +1,108 @@
|
|
|
1
1
|
import { mergePartBind as e, useBridgeUIComponent as t, useBridgeUIMergedRegistryClasses as n } from "../../../Utils/index.js";
|
|
2
|
-
import { computed as r, getCurrentInstance as i, onBeforeUnmount as a, ref as
|
|
3
|
-
import { compact as
|
|
4
|
-
import { DATATABLE_EXPAND_COLUMN_ID as u, DATATABLE_SELECTION_COLUMN_ID as d, getDataTableAriaSort as
|
|
5
|
-
import { tableVariantProps as
|
|
6
|
-
import { cn as
|
|
7
|
-
import { columnFilteringFeature as
|
|
2
|
+
import { computed as r, getCurrentInstance as i, onBeforeUnmount as a, ref as ee, useAttrs as te, useSlots as ne, watch as re } from "vue";
|
|
3
|
+
import { compact as ie, fromPairs as ae, get as o, head as s, isArray as oe, isEmpty as se, isFunction as c, isNil as ce, isString as le, keyBy as ue, map as l, omit as de } from "es-toolkit/compat";
|
|
4
|
+
import { DATATABLE_AMBIGUOUS_PAGING_WARNING as fe, DATATABLE_EXPAND_COLUMN_ID as u, DATATABLE_SELECTION_COLUMN_ID as d, getDataTableAriaSort as pe, getDataTableColumnAccessor as me, getDataTableColumnCssWidth as he, getDataTableColumnFilterValues as ge, getDataTableColumnSearch as _e, getDataTableDefaultCellContent as ve, getDataTableFooterLayout as ye, getDataTablePaginationSlotProps as be, getDataTablePerPageSelectOptions as xe, getDataTableResolvedPageCount as Se, getDataTableResolvedPerPage as Ce, getDataTableSelectAllState as we, getDataTableSelectionTotal as Te, getDataTableSortIcon as Ee, getDataTableStickyInsets as f, getDataTableStickyPing as De, isDataTableClientPaged as Oe, isDataTableColumnFilterable as p, isDataTableColumnFiltered as ke, isDataTableColumnSearchable as Ae, isDataTableColumnSearched as je, isDataTableCursorPaged as Me, isDataTableExpandEnabled as Ne, isDataTablePagingAmbiguous as Pe, isDataTablePerPageEnabled as Fe, isDataTableSearchEnabled as Ie, isDataTableSelectionEnabled as Le, isDataTableSelectionMultiple as Re, isDataTableServerPaged as ze, isDataTableStickyHeader as Be, isDataTableStickyHeaderBoxed as Ve, isDataTableVisibilityEnabled as He, observeDataTablePaginationInline as Ue, resolveDataTableRowId as We, rowMatchesDataTableColumnSearch as Ge, rowMatchesDataTableToolbarSearch as Ke, rowSelectionToIds as qe, selectionToRowSelection as Je, setDataTableColumnFilter as Ye, setDataTableColumnSearch as Xe, setDataTableRowSelection as Ze, sliceDataTablePage as Qe, toggleDataTableColumnVisibility as $e, toggleDataTablePageSelection as et, toggleDataTableRowExpansion as tt, toggleDataTableSorting as nt } from "@bridge-ui/core/Domain";
|
|
5
|
+
import { tableVariantProps as rt } from "@bridge-ui/core/Tokens";
|
|
6
|
+
import { cn as m, mergeBridgeUILayeredClasses as it, splitComponentProps as at } from "@bridge-ui/core/Utils";
|
|
7
|
+
import { columnFilteringFeature as ot, columnVisibilityFeature as st, createFilteredRowModel as h, createSortedRowModel as g, rowSelectionFeature as _, rowSortingFeature as v, sortFn_alphanumeric as y, sortFn_datetime as b, sortFn_text as ct, tableFeatures as x, useTable as lt } from "@tanstack/vue-table";
|
|
8
8
|
//#region src/Components/DataTable/composables/useDataTable.ts
|
|
9
|
-
var
|
|
9
|
+
var ut = /* @__PURE__ */ "full.page.rows.size.cursor.search.classes.columns.filters.loading.perPage.rounded.sorting.striped.variant.expanded.getRowId.hoverable.pageCount.selection.nextCursor.prevCursor.showSearch.totalCount.customProps.columnSearch.stickyHeader.filterOverlay.hiddenColumns.selectionMode.columnsOverlay.loadingVariant.perPageOptions.columnsShowFooter.showColumnVisibility".split("."), dt = {
|
|
10
10
|
enableHiding: !1,
|
|
11
11
|
enableSorting: !1,
|
|
12
12
|
cell: () => null,
|
|
13
13
|
header: () => null
|
|
14
|
-
},
|
|
15
|
-
rowSortingFeature:
|
|
16
|
-
rowSelectionFeature:
|
|
17
|
-
columnFilteringFeature:
|
|
18
|
-
columnVisibilityFeature:
|
|
19
|
-
sortedRowModel:
|
|
20
|
-
filteredRowModel:
|
|
14
|
+
}, ft = [], pt = [], mt = [], ht = x({
|
|
15
|
+
rowSortingFeature: v,
|
|
16
|
+
rowSelectionFeature: _,
|
|
17
|
+
columnFilteringFeature: ot,
|
|
18
|
+
columnVisibilityFeature: st,
|
|
19
|
+
sortedRowModel: g(),
|
|
20
|
+
filteredRowModel: h(),
|
|
21
21
|
sortFns: {
|
|
22
|
-
text:
|
|
23
|
-
datetime:
|
|
24
|
-
alphanumeric:
|
|
22
|
+
text: ct,
|
|
23
|
+
datetime: b,
|
|
24
|
+
alphanumeric: y
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
|
-
function S(
|
|
28
|
-
let
|
|
29
|
-
bridgeKeys:
|
|
27
|
+
function S(ot, st, h) {
|
|
28
|
+
let g = te(), _ = ne(), v = i(), y = r(() => at({
|
|
29
|
+
bridgeKeys: ut,
|
|
30
30
|
props: {
|
|
31
|
-
...
|
|
32
|
-
...
|
|
33
|
-
page:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
31
|
+
...g,
|
|
32
|
+
...ot,
|
|
33
|
+
page: h.page.value,
|
|
34
|
+
cursor: h.cursor?.value,
|
|
35
|
+
perPage: h.perPage.value,
|
|
36
|
+
filters: h.filters.value,
|
|
37
|
+
sorting: h.sorting.value,
|
|
38
|
+
expanded: h.expanded.value,
|
|
39
|
+
selection: h.selection.value,
|
|
40
|
+
columnSearch: h.columnSearch.value,
|
|
41
|
+
hiddenColumns: h.hiddenColumns.value
|
|
41
42
|
}
|
|
42
|
-
})), { merged:
|
|
43
|
-
libDefaults:
|
|
43
|
+
})), { merged: b, components: ct, entry: x } = t({
|
|
44
|
+
libDefaults: st,
|
|
44
45
|
componentName: "DataTable",
|
|
45
|
-
props: () =>
|
|
46
|
-
}), S = r(() =>
|
|
46
|
+
props: () => y.value.componentProps
|
|
47
|
+
}), S = r(() => b.value.customProps), gt = r(() => de(y.value.inheritedAttrs, ["children"])), C = n({
|
|
47
48
|
entry: x,
|
|
48
|
-
props: () =>
|
|
49
|
-
}),
|
|
49
|
+
props: () => y.value.componentProps
|
|
50
|
+
}), _t = r(() => it(rt, o(ct.value, [
|
|
50
51
|
"Table",
|
|
51
52
|
"tokens",
|
|
52
53
|
"variant"
|
|
53
|
-
]))), w = r(() =>
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
]))), w = r(() => o(_t.value, b.value.variant)), T = r(() => b.value.columns ?? pt), E = r(() => ue(T.value, "id")), vt = r(() => b.value.rows ?? ft), D = r(() => Le(h.selection.value, g["onUpdate:selection"] !== void 0)), yt = r(() => Ne(h.expanded.value, g["onUpdate:expanded"] !== void 0, _.expanded !== void 0)), O = r(() => He(h.hiddenColumns.value, g["onUpdate:hiddenColumns"] !== void 0, b.value.showColumnVisibility)), k = r(() => Re(b.value.selectionMode)), A = r(() => Me({
|
|
55
|
+
cursor: h.cursor?.value,
|
|
56
|
+
nextCursor: b.value.nextCursor,
|
|
57
|
+
prevCursor: b.value.prevCursor,
|
|
58
|
+
hasCursorHandler: v?.vnode.props?.["onUpdate:cursor"] !== void 0
|
|
59
|
+
}));
|
|
60
|
+
re(() => Pe(h.page.value, b.value.pageCount, b.value.totalCount, A.value), (e) => {
|
|
61
|
+
e && process.env.NODE_ENV !== "production" && console.warn(fe);
|
|
62
|
+
}, { immediate: !0 });
|
|
63
|
+
let j = r(() => ze(h.page.value, b.value.pageCount, b.value.totalCount, A.value)), M = r(() => Oe(h.page.value, h.perPage.value, b.value.pageCount, b.value.totalCount, A.value)), N = r(() => Ce(h.perPage.value)), P = r(() => Be(b.value.stickyHeader)), F = r(() => Ve(b.value.stickyHeader)), bt = r(() => h.sorting.value ? [{
|
|
64
|
+
id: h.sorting.value.id,
|
|
65
|
+
desc: h.sorting.value.desc
|
|
66
|
+
}] : []), xt = r(() => l(h.filters.value ?? {}, (e, t) => ({
|
|
57
67
|
id: t,
|
|
58
68
|
value: e
|
|
59
|
-
}))),
|
|
69
|
+
}))), St = r(() => Je(h.selection.value)), I = r(() => h.hiddenColumns.value ?? mt), Ct = r(() => ae(I.value.map((e) => [e, !1]))), wt = r(() => {
|
|
60
70
|
let e = T.value.map((e) => ({
|
|
61
71
|
id: e.id,
|
|
62
72
|
enableSorting: e.sortable === !0,
|
|
63
73
|
enableHiding: e.hideable !== !1,
|
|
64
|
-
enableColumnFilter:
|
|
74
|
+
enableColumnFilter: p(e),
|
|
65
75
|
header: () => e.header,
|
|
66
76
|
cell: (t) => e.cell?.(t.row.original) ?? null,
|
|
67
|
-
accessorFn: (t) =>
|
|
77
|
+
accessorFn: (t) => me(t, e),
|
|
68
78
|
filterFn: (e, t, n) => {
|
|
69
|
-
let r =
|
|
70
|
-
return
|
|
79
|
+
let r = oe(n) ? n : [];
|
|
80
|
+
return se(r) ? !0 : r.includes(String(e.getValue(t) ?? ""));
|
|
71
81
|
}
|
|
72
82
|
}));
|
|
73
|
-
return
|
|
83
|
+
return ie([
|
|
74
84
|
D.value ? {
|
|
75
|
-
...
|
|
85
|
+
...dt,
|
|
76
86
|
id: d
|
|
77
87
|
} : void 0,
|
|
78
|
-
|
|
79
|
-
...
|
|
88
|
+
yt.value ? {
|
|
89
|
+
...dt,
|
|
80
90
|
id: u
|
|
81
91
|
} : void 0,
|
|
82
92
|
...e
|
|
83
93
|
]);
|
|
84
|
-
}),
|
|
85
|
-
data:
|
|
94
|
+
}), Tt = lt({
|
|
95
|
+
data: vt,
|
|
86
96
|
enableSortingRemoval: !0,
|
|
87
|
-
features:
|
|
97
|
+
features: ht,
|
|
88
98
|
get columns() {
|
|
89
|
-
return
|
|
99
|
+
return wt.value;
|
|
90
100
|
},
|
|
91
101
|
get manualSorting() {
|
|
92
|
-
return
|
|
102
|
+
return j.value;
|
|
93
103
|
},
|
|
94
104
|
get manualFiltering() {
|
|
95
|
-
return
|
|
105
|
+
return j.value;
|
|
96
106
|
},
|
|
97
107
|
get enableHiding() {
|
|
98
108
|
return O.value;
|
|
@@ -103,40 +113,40 @@ function S(nt, rt, m) {
|
|
|
103
113
|
get enableMultiRowSelection() {
|
|
104
114
|
return k.value;
|
|
105
115
|
},
|
|
106
|
-
getRowId: (e, t) =>
|
|
116
|
+
getRowId: (e, t) => We(e, t, b.value.getRowId),
|
|
107
117
|
onRowSelectionChange: (e) => {
|
|
108
|
-
let t = c(e) ? e(
|
|
109
|
-
|
|
118
|
+
let t = c(e) ? e(St.value) : e;
|
|
119
|
+
h.selection.value = qe(t);
|
|
110
120
|
},
|
|
111
121
|
onSortingChange: (e) => {
|
|
112
|
-
let t = c(e) ? e(
|
|
113
|
-
|
|
122
|
+
let t = c(e) ? e(bt.value) : e, n = s(t);
|
|
123
|
+
h.sorting.value = n ? {
|
|
114
124
|
id: n.id,
|
|
115
125
|
desc: n.desc
|
|
116
126
|
} : null;
|
|
117
127
|
},
|
|
118
128
|
state: {
|
|
119
129
|
get sorting() {
|
|
120
|
-
return
|
|
130
|
+
return bt.value;
|
|
121
131
|
},
|
|
122
132
|
get rowSelection() {
|
|
123
|
-
return
|
|
133
|
+
return St.value;
|
|
124
134
|
},
|
|
125
135
|
get columnFilters() {
|
|
126
|
-
return
|
|
136
|
+
return xt.value;
|
|
127
137
|
},
|
|
128
138
|
get columnVisibility() {
|
|
129
|
-
return
|
|
139
|
+
return Ct.value;
|
|
130
140
|
}
|
|
131
141
|
}
|
|
132
|
-
}),
|
|
133
|
-
let e =
|
|
134
|
-
if (
|
|
135
|
-
let t =
|
|
136
|
-
return e.filter((e) =>
|
|
137
|
-
}),
|
|
138
|
-
let e = (
|
|
139
|
-
let t =
|
|
142
|
+
}), L = r(() => {
|
|
143
|
+
let e = Tt.getRowModel().rows;
|
|
144
|
+
if (j.value) return e;
|
|
145
|
+
let t = h.search.value ?? "", n = I.value;
|
|
146
|
+
return e.filter((e) => Ge(e.original, T.value, h.columnSearch.value, n) ? Ke(e.original, T.value, t, n) : !1);
|
|
147
|
+
}), R = r(() => M.value ? Qe(L.value, h.page.value ?? 1, N.value) : L.value), z = r(() => l(R.value, "id")), Et = r(() => we(z.value, h.selection.value ?? [])), B = r(() => {
|
|
148
|
+
let e = (s(Tt.getHeaderGroups())?.headers ?? []).map((e) => {
|
|
149
|
+
let t = o(E.value, e.column.id);
|
|
140
150
|
return {
|
|
141
151
|
column: t,
|
|
142
152
|
id: e.column.id,
|
|
@@ -145,9 +155,9 @@ function S(nt, rt, m) {
|
|
|
145
155
|
isExpand: e.column.id === u,
|
|
146
156
|
isSelection: e.column.id === d
|
|
147
157
|
};
|
|
148
|
-
}), t =
|
|
158
|
+
}), t = f(e, P.value ? 20 : 10);
|
|
149
159
|
return e.map((e) => {
|
|
150
|
-
let n =
|
|
160
|
+
let n = o(t, e.id), r = e.column?.sortable ? pe(h.sorting.value ?? null, e.id) : "none";
|
|
151
161
|
return {
|
|
152
162
|
ariaSort: r,
|
|
153
163
|
id: e.id,
|
|
@@ -162,34 +172,34 @@ function S(nt, rt, m) {
|
|
|
162
172
|
stickyEdge: n?.edge === !0,
|
|
163
173
|
ellipsis: e.column?.ellipsis === !0,
|
|
164
174
|
sortable: e.column?.sortable === !0,
|
|
165
|
-
sortIcon:
|
|
175
|
+
sortIcon: Ee(r),
|
|
166
176
|
hideable: e.column?.hideable !== !1,
|
|
167
177
|
filterOptions: e.column?.filters ?? [],
|
|
168
|
-
filterable:
|
|
169
|
-
searchable:
|
|
178
|
+
filterable: p(e.column),
|
|
179
|
+
searchable: Ae(e.column),
|
|
170
180
|
filterMultiple: e.column?.filterMultiple !== !1,
|
|
171
|
-
searchQuery:
|
|
172
|
-
filterValues:
|
|
173
|
-
filterActive:
|
|
181
|
+
searchQuery: _e(h.columnSearch.value, e.id),
|
|
182
|
+
filterValues: ge(h.filters.value, e.id),
|
|
183
|
+
filterActive: ke(h.filters.value, e.id) || je(h.columnSearch.value, e.id)
|
|
174
184
|
};
|
|
175
185
|
});
|
|
176
|
-
}),
|
|
177
|
-
let e =
|
|
186
|
+
}), V = r(() => {
|
|
187
|
+
let e = f(B.value.map((e) => ({
|
|
178
188
|
id: e.id,
|
|
179
189
|
width: e.width,
|
|
180
190
|
sticky: e.sticky,
|
|
181
191
|
isExpand: e.isExpand,
|
|
182
192
|
isSelection: e.isSelection
|
|
183
193
|
})), 1);
|
|
184
|
-
return
|
|
194
|
+
return R.value.map((t) => ({
|
|
185
195
|
id: t.id,
|
|
186
196
|
original: t.original,
|
|
187
|
-
expanded: (
|
|
188
|
-
selected: (
|
|
197
|
+
expanded: (h.expanded.value ?? []).includes(t.id),
|
|
198
|
+
selected: (h.selection.value ?? []).includes(t.id),
|
|
189
199
|
cells: t.getVisibleCells().map((n) => {
|
|
190
|
-
let r =
|
|
200
|
+
let r = o(E.value, n.column.id), i = o(e, n.column.id), a = r ? me(t.original, r) : void 0;
|
|
191
201
|
return {
|
|
192
|
-
tooltip: r?.ellipsis === !0 && !
|
|
202
|
+
tooltip: r?.ellipsis === !0 && !ce(a) && a !== "" ? String(a) : void 0,
|
|
193
203
|
value: a,
|
|
194
204
|
id: n.column.id,
|
|
195
205
|
width: r?.width,
|
|
@@ -201,109 +211,111 @@ function S(nt, rt, m) {
|
|
|
201
211
|
ellipsis: r?.ellipsis === !0,
|
|
202
212
|
isExpand: n.column.id === u,
|
|
203
213
|
isSelection: n.column.id === d,
|
|
204
|
-
content: r?.cell ? r.cell(t.original) :
|
|
214
|
+
content: r?.cell ? r.cell(t.original) : ve(a)
|
|
205
215
|
};
|
|
206
216
|
})
|
|
207
217
|
}));
|
|
208
|
-
}),
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
218
|
+
}), Dt = r(() => B.value.length), H = r(() => Fe(h.perPage.value, v?.vnode.props?.["onUpdate:perPage"] !== void 0, !!_.perPage)), U = r(() => {
|
|
219
|
+
if (!A.value) return Se({
|
|
220
|
+
perPage: h.perPage.value,
|
|
221
|
+
clientPaged: M.value,
|
|
222
|
+
pageCount: b.value.pageCount,
|
|
223
|
+
totalCount: b.value.totalCount,
|
|
224
|
+
filteredCount: L.value.length
|
|
225
|
+
});
|
|
226
|
+
}), W = r(() => D.value), G = r(() => !!_.pagination || A.value || U.value !== void 0), Ot = r(() => W.value || G.value || H.value), kt = r(() => V.value.length === 0), At = r(() => e(S.value?.root, gt.value, { class: m({ [F.value ? "" : o(C.value, "root") ?? ""]: !0 }) })), jt = r(() => B.value.some((e) => e.ellipsis)), Mt = r(() => B.value.some((e) => !!e.stickyStyle)), K = ee({
|
|
215
227
|
end: !1,
|
|
216
228
|
start: !1
|
|
217
|
-
}),
|
|
218
|
-
function
|
|
219
|
-
let t = e ?
|
|
229
|
+
}), q;
|
|
230
|
+
function J(e) {
|
|
231
|
+
let t = e ? De(e.scrollLeft, e.scrollWidth, e.clientWidth) : {
|
|
220
232
|
end: !1,
|
|
221
233
|
start: !1
|
|
222
234
|
};
|
|
223
|
-
(
|
|
235
|
+
(K.value.end !== t.end || K.value.start !== t.start) && (K.value = t);
|
|
224
236
|
}
|
|
225
|
-
function
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
}),
|
|
237
|
+
function Y(e) {
|
|
238
|
+
q?.disconnect(), q = void 0, J(e), e && typeof ResizeObserver < "u" && (q = new ResizeObserver(() => {
|
|
239
|
+
J(e);
|
|
240
|
+
}), q.observe(e));
|
|
229
241
|
}
|
|
230
|
-
let
|
|
231
|
-
function
|
|
232
|
-
|
|
233
|
-
|
|
242
|
+
let X = ee(!1), Z;
|
|
243
|
+
function Q(e) {
|
|
244
|
+
Z?.(), Z = void 0, e && (Z = Ue(e, (e) => {
|
|
245
|
+
X.value !== e && (X.value = e);
|
|
234
246
|
}));
|
|
235
247
|
}
|
|
236
|
-
function
|
|
248
|
+
function Nt(e) {
|
|
237
249
|
let t = e.el;
|
|
238
|
-
|
|
250
|
+
Q(t instanceof HTMLElement ? t : null);
|
|
239
251
|
}
|
|
240
|
-
function
|
|
241
|
-
|
|
252
|
+
function Pt() {
|
|
253
|
+
Q(null);
|
|
242
254
|
}
|
|
243
|
-
function
|
|
255
|
+
function Ft(e) {
|
|
244
256
|
let t = S.value?.wrapper?.onScroll;
|
|
245
257
|
c(t) && t(e);
|
|
246
258
|
let n = e.currentTarget;
|
|
247
|
-
n instanceof HTMLElement &&
|
|
259
|
+
n instanceof HTMLElement && J(n);
|
|
248
260
|
}
|
|
249
|
-
function
|
|
261
|
+
function It(e, t) {
|
|
250
262
|
let n = S.value?.wrapper?.[e];
|
|
251
263
|
c(n) && n(t);
|
|
252
264
|
}
|
|
253
|
-
function
|
|
254
|
-
|
|
265
|
+
function Lt(e) {
|
|
266
|
+
It("onVnodeMounted", e);
|
|
255
267
|
let t = e.el;
|
|
256
|
-
|
|
268
|
+
Y(t instanceof HTMLElement ? t : null);
|
|
257
269
|
}
|
|
258
|
-
function
|
|
259
|
-
|
|
270
|
+
function Rt(e) {
|
|
271
|
+
It("onVnodeUnmounted", e), Y(null);
|
|
260
272
|
}
|
|
261
273
|
a(() => {
|
|
262
|
-
|
|
274
|
+
Y(null), Q(null);
|
|
263
275
|
});
|
|
264
|
-
let
|
|
265
|
-
size:
|
|
266
|
-
variant:
|
|
267
|
-
rounded:
|
|
268
|
-
full:
|
|
269
|
-
striped:
|
|
270
|
-
stickyHeader:
|
|
271
|
-
hoverable:
|
|
276
|
+
let zt = r(() => ({
|
|
277
|
+
size: b.value.size,
|
|
278
|
+
variant: b.value.variant,
|
|
279
|
+
rounded: b.value.rounded,
|
|
280
|
+
full: b.value.full !== !1,
|
|
281
|
+
striped: b.value.striped === !0,
|
|
282
|
+
stickyHeader: P.value,
|
|
283
|
+
hoverable: b.value.hoverable === !0,
|
|
272
284
|
customProps: {
|
|
273
285
|
table: {
|
|
274
286
|
...S.value?.table,
|
|
275
|
-
"aria-busy":
|
|
287
|
+
"aria-busy": b.value.loading || void 0
|
|
276
288
|
},
|
|
277
289
|
root: {
|
|
278
290
|
...S.value?.wrapper,
|
|
279
|
-
onScroll:
|
|
280
|
-
onVnodeMounted:
|
|
281
|
-
onVnodeUnmounted:
|
|
291
|
+
onScroll: Ft,
|
|
292
|
+
onVnodeMounted: Lt,
|
|
293
|
+
onVnodeUnmounted: Rt
|
|
282
294
|
}
|
|
283
295
|
},
|
|
284
296
|
classes: {
|
|
285
|
-
row:
|
|
286
|
-
body:
|
|
287
|
-
cell:
|
|
288
|
-
head:
|
|
289
|
-
header:
|
|
290
|
-
"relative z-40":
|
|
291
|
-
[
|
|
297
|
+
row: o(C.value, "row"),
|
|
298
|
+
body: o(C.value, "body"),
|
|
299
|
+
cell: o(C.value, "cell"),
|
|
300
|
+
head: o(C.value, "head"),
|
|
301
|
+
header: m({
|
|
302
|
+
"relative z-40": b.value.loading && b.value.loadingVariant === "bar",
|
|
303
|
+
[o(C.value, "header") ?? ""]: !0
|
|
292
304
|
}),
|
|
293
|
-
root:
|
|
294
|
-
"overflow-auto":
|
|
295
|
-
[
|
|
296
|
-
[
|
|
305
|
+
root: m({
|
|
306
|
+
"overflow-auto": F.value,
|
|
307
|
+
[o(C.value, "wrapper") ?? ""]: !0,
|
|
308
|
+
[F.value ? o(C.value, "root") ?? "" : ""]: !0
|
|
297
309
|
}),
|
|
298
|
-
table:
|
|
299
|
-
"w-full table-fixed":
|
|
300
|
-
"border-separate border-spacing-0":
|
|
301
|
-
[
|
|
310
|
+
table: m({
|
|
311
|
+
"w-full table-fixed": jt.value,
|
|
312
|
+
"border-separate border-spacing-0": Mt.value && !P.value,
|
|
313
|
+
[o(C.value, "table") ?? ""]: !0
|
|
302
314
|
})
|
|
303
315
|
}
|
|
304
316
|
}));
|
|
305
|
-
function
|
|
306
|
-
let n =
|
|
317
|
+
function Bt(e, t = !1) {
|
|
318
|
+
let n = he(e.width, e.isExpand || e.isSelection), r = t && P.value;
|
|
307
319
|
return {
|
|
308
320
|
...n ? {
|
|
309
321
|
width: n,
|
|
@@ -318,71 +330,71 @@ function S(nt, rt, m) {
|
|
|
318
330
|
} : {}
|
|
319
331
|
};
|
|
320
332
|
}
|
|
321
|
-
function
|
|
333
|
+
function Vt(e) {
|
|
322
334
|
return e.isSelection || e.isExpand ? "center" : e.align ?? "start";
|
|
323
335
|
}
|
|
324
|
-
function
|
|
336
|
+
function Ht(e) {
|
|
325
337
|
return e.isSelection || e.isExpand ? "center" : e.align ?? "start";
|
|
326
338
|
}
|
|
327
|
-
function
|
|
339
|
+
function Ut(t) {
|
|
328
340
|
let n = t.isSelection || t.isExpand;
|
|
329
341
|
return e(S.value?.head, {}, {
|
|
330
|
-
style:
|
|
342
|
+
style: Bt(t, !0),
|
|
331
343
|
"aria-sort": t.sortable ? t.ariaSort : void 0,
|
|
332
|
-
class:
|
|
344
|
+
class: m({
|
|
333
345
|
"min-w-0": !0,
|
|
334
346
|
"border-e-0": n,
|
|
335
347
|
"sticky z-20": !!t.stickyStyle,
|
|
336
348
|
"after:hidden": n,
|
|
337
|
-
[
|
|
338
|
-
[
|
|
349
|
+
[o(w.value, "cellStickyEdgeStart") ?? ""]: t.sticky === "start" && t.stickyEdge && K.value.start,
|
|
350
|
+
[o(w.value, "cellStickyEdgeEnd") ?? ""]: t.sticky === "end" && t.stickyEdge && K.value.end,
|
|
339
351
|
[t.classes?.header ?? ""]: !0
|
|
340
352
|
})
|
|
341
353
|
});
|
|
342
354
|
}
|
|
343
|
-
function
|
|
355
|
+
function Wt(t) {
|
|
344
356
|
let n = t.isSelection || t.isExpand;
|
|
345
357
|
return e(S.value?.cell, {}, {
|
|
346
|
-
style:
|
|
347
|
-
class:
|
|
358
|
+
style: Bt(t),
|
|
359
|
+
class: m({
|
|
348
360
|
"min-w-0": !0,
|
|
349
361
|
"overflow-hidden": t.ellipsis,
|
|
350
362
|
"border-e-0": n,
|
|
351
363
|
"after:hidden": n,
|
|
352
|
-
[
|
|
353
|
-
[
|
|
354
|
-
[
|
|
364
|
+
[o(w.value, "cellSticky") ?? ""]: !!t.stickyStyle,
|
|
365
|
+
[o(w.value, "cellStickyEdgeStart") ?? ""]: t.sticky === "start" && t.stickyEdge && K.value.start,
|
|
366
|
+
[o(w.value, "cellStickyEdgeEnd") ?? ""]: t.sticky === "end" && t.stickyEdge && K.value.end,
|
|
355
367
|
[t.classes?.cell ?? ""]: !0
|
|
356
368
|
})
|
|
357
369
|
});
|
|
358
370
|
}
|
|
359
|
-
let
|
|
371
|
+
let Gt = r(() => e(S.value?.toolbar, {}, { class: m({
|
|
360
372
|
"flex items-center justify-between gap-3 pb-3": !0,
|
|
361
|
-
[
|
|
362
|
-
}) })),
|
|
373
|
+
[o(C.value, "toolbar") ?? ""]: !0
|
|
374
|
+
}) })), Kt = r(() => e(S.value?.empty, {}, { class: m({
|
|
363
375
|
"w-full": !0,
|
|
364
|
-
[
|
|
365
|
-
}) })),
|
|
376
|
+
[o(C.value, "empty") ?? ""]: !0
|
|
377
|
+
}) })), qt = r(() => e(S.value?.loading, {}, { class: m({
|
|
366
378
|
"absolute inset-0 z-30 bg-white/50 dark:bg-dark-900/50": !0,
|
|
367
|
-
"flex items-center justify-center":
|
|
368
|
-
[
|
|
369
|
-
}) })),
|
|
370
|
-
"w-0 min-w-full":
|
|
379
|
+
"flex items-center justify-center": b.value.loadingVariant !== "bar",
|
|
380
|
+
[o(C.value, "loading") ?? ""]: !0
|
|
381
|
+
}) })), Jt = r(() => e({}, {}, { class: m({ "pointer-events-none absolute inset-x-0 top-0 z-40": !0 }) })), Yt = r(() => e({}, {}, { class: m({ "w-fit min-w-0 max-w-full": b.value.full === !1 }) })), Xt = r(() => e(S.value?.footer, {}, { class: m({
|
|
382
|
+
"w-0 min-w-full": b.value.full === !1,
|
|
371
383
|
"border-t border-dark-200 bg-dark-50 px-3 py-2.5 text-sm text-dark-600 dark:border-dark-700 dark:bg-dark-800 dark:text-dark-300": !0,
|
|
372
|
-
[
|
|
373
|
-
}) })), $ = r(() =>
|
|
374
|
-
showPager:
|
|
375
|
-
showPerPage:
|
|
376
|
-
inline:
|
|
377
|
-
showSelected:
|
|
378
|
-
})),
|
|
384
|
+
[o(C.value, "footer") ?? ""]: !0
|
|
385
|
+
}) })), $ = r(() => ye({
|
|
386
|
+
showPager: G.value,
|
|
387
|
+
showPerPage: H.value,
|
|
388
|
+
inline: X.value,
|
|
389
|
+
showSelected: W.value
|
|
390
|
+
})), Zt = r(() => e(S.value?.selected, {}, { class: m({
|
|
379
391
|
grow: !$.value.stack,
|
|
380
392
|
"whitespace-nowrap text-sm text-dark-500 dark:text-dark-400": !0,
|
|
381
|
-
[
|
|
382
|
-
}) })),
|
|
383
|
-
onVnodeMounted:
|
|
384
|
-
onVnodeUnmounted:
|
|
385
|
-
class:
|
|
393
|
+
[o(C.value, "selected") ?? ""]: !0
|
|
394
|
+
}) })), Qt = r(() => e({}, {}, {
|
|
395
|
+
onVnodeMounted: Nt,
|
|
396
|
+
onVnodeUnmounted: Pt,
|
|
397
|
+
class: m({
|
|
386
398
|
"flex items-center gap-3 py-3 [&>*]:shrink-0": !0,
|
|
387
399
|
"flex-col": $.value.stack,
|
|
388
400
|
"flex-row": !$.value.stack,
|
|
@@ -390,61 +402,68 @@ function S(nt, rt, m) {
|
|
|
390
402
|
"justify-end": $.value.justify === "end",
|
|
391
403
|
"justify-between": $.value.justify === "between",
|
|
392
404
|
"justify-start": $.value.justify === "start",
|
|
393
|
-
"w-full":
|
|
394
|
-
"w-0 min-w-full":
|
|
395
|
-
[
|
|
405
|
+
"w-full": b.value.full !== !1,
|
|
406
|
+
"w-0 min-w-full": b.value.full === !1,
|
|
407
|
+
[o(C.value, "pagination") ?? ""]: !0
|
|
396
408
|
})
|
|
397
409
|
}));
|
|
398
|
-
function
|
|
399
|
-
|
|
410
|
+
function $t(e) {
|
|
411
|
+
h.sorting.value = nt(h.sorting.value ?? null, e);
|
|
400
412
|
}
|
|
401
|
-
function
|
|
402
|
-
|
|
413
|
+
function en(e, t) {
|
|
414
|
+
h.selection.value = Ze(h.selection.value ?? [], e, t, b.value.selectionMode);
|
|
403
415
|
}
|
|
404
|
-
function
|
|
405
|
-
|
|
416
|
+
function tn(e) {
|
|
417
|
+
h.perPage.value = e, h.page.value !== 1 && (h.page.value = 1);
|
|
406
418
|
}
|
|
407
|
-
function
|
|
408
|
-
|
|
419
|
+
function nn(e) {
|
|
420
|
+
h.search.value = e, h.page.value !== 1 && (h.page.value = 1);
|
|
409
421
|
}
|
|
410
|
-
let
|
|
411
|
-
page:
|
|
412
|
-
|
|
422
|
+
let rn = r(() => be({
|
|
423
|
+
page: h.page.value,
|
|
424
|
+
cursor: h.cursor?.value,
|
|
425
|
+
cursorPaged: A.value,
|
|
426
|
+
count: U.value,
|
|
427
|
+
nextCursor: b.value.nextCursor,
|
|
428
|
+
prevCursor: b.value.prevCursor,
|
|
413
429
|
onPageChange: (e) => {
|
|
414
|
-
|
|
430
|
+
h.page.value = e;
|
|
431
|
+
},
|
|
432
|
+
onCursorChange: (e) => {
|
|
433
|
+
h.cursor && (h.cursor.value = e);
|
|
415
434
|
}
|
|
416
|
-
})),
|
|
417
|
-
perPage:
|
|
418
|
-
onPerPageChange:
|
|
419
|
-
options:
|
|
420
|
-
})),
|
|
421
|
-
selectedCount: (
|
|
422
|
-
totalCount:
|
|
423
|
-
totalCount:
|
|
424
|
-
filteredCount:
|
|
435
|
+
})), an = r(() => ({
|
|
436
|
+
perPage: N.value,
|
|
437
|
+
onPerPageChange: tn,
|
|
438
|
+
options: xe(N.value, b.value.perPageOptions)
|
|
439
|
+
})), on = r(() => ({
|
|
440
|
+
selectedCount: (h.selection.value ?? []).length,
|
|
441
|
+
totalCount: Te({
|
|
442
|
+
totalCount: b.value.totalCount,
|
|
443
|
+
filteredCount: L.value.length
|
|
425
444
|
})
|
|
426
445
|
}));
|
|
427
|
-
function
|
|
428
|
-
|
|
446
|
+
function sn(e) {
|
|
447
|
+
h.selection.value = et(h.selection.value ?? [], z.value, e);
|
|
429
448
|
}
|
|
430
|
-
function
|
|
431
|
-
let r =
|
|
432
|
-
r?.filters && r.filters.length > 0 && (
|
|
449
|
+
function cn(e, t, n) {
|
|
450
|
+
let r = o(E.value, e);
|
|
451
|
+
r?.filters && r.filters.length > 0 && (h.filters.value = Ye(h.filters.value, e, t)), Ae(r) && (h.columnSearch.value = Xe(h.columnSearch.value, e, n)), h.page.value !== 1 && (h.page.value = 1);
|
|
433
452
|
}
|
|
434
|
-
function
|
|
435
|
-
|
|
453
|
+
function ln(e, t) {
|
|
454
|
+
h.expanded.value = tt(h.expanded.value ?? [], e, t);
|
|
436
455
|
}
|
|
437
|
-
function
|
|
438
|
-
|
|
456
|
+
function un(e, t) {
|
|
457
|
+
h.hiddenColumns.value = $e(h.hiddenColumns.value ?? [], e, t, l(T.value, "id"));
|
|
439
458
|
}
|
|
440
|
-
function
|
|
441
|
-
|
|
459
|
+
function dn(e) {
|
|
460
|
+
h.hiddenColumns.value = e;
|
|
442
461
|
}
|
|
443
|
-
let
|
|
462
|
+
let fn = r(() => {
|
|
444
463
|
if (!T.value.some((e) => e.summary !== void 0)) return null;
|
|
445
|
-
let e = l(
|
|
446
|
-
return
|
|
447
|
-
let n =
|
|
464
|
+
let e = l(L.value, "original");
|
|
465
|
+
return B.value.map((t) => {
|
|
466
|
+
let n = o(E.value, t.id);
|
|
448
467
|
return {
|
|
449
468
|
id: t.id,
|
|
450
469
|
ellipsis: !1,
|
|
@@ -461,63 +480,64 @@ function S(nt, rt, m) {
|
|
|
461
480
|
content: t.isSelection || t.isExpand ? null : n?.summary?.(e) ?? null
|
|
462
481
|
};
|
|
463
482
|
});
|
|
464
|
-
}),
|
|
483
|
+
}), pn = r(() => T.value.map((e) => ({
|
|
465
484
|
id: e.id,
|
|
466
485
|
hideable: e.hideable !== !1,
|
|
467
|
-
hidden:
|
|
468
|
-
label:
|
|
469
|
-
}))),
|
|
486
|
+
hidden: I.value.includes(e.id),
|
|
487
|
+
label: le(e.header) ? e.header : e.id
|
|
488
|
+
}))), mn = r(() => Ie(h.search.value, v?.vnode.props?.["onUpdate:search"] !== void 0, _.search !== void 0, b.value.showSearch));
|
|
470
489
|
return {
|
|
471
|
-
merged:
|
|
472
|
-
pageIds:
|
|
473
|
-
rowViews:
|
|
474
|
-
rootBind:
|
|
475
|
-
emptyBind:
|
|
476
|
-
showEmpty:
|
|
477
|
-
frameBind:
|
|
478
|
-
showPager:
|
|
479
|
-
tableProps:
|
|
480
|
-
footerBind:
|
|
481
|
-
showSearch:
|
|
482
|
-
getHeadBind:
|
|
483
|
-
headerViews:
|
|
484
|
-
loadingBind:
|
|
485
|
-
onToggleRow:
|
|
486
|
-
toolbarBind:
|
|
487
|
-
getCellBind:
|
|
488
|
-
columnCount:
|
|
489
|
-
clientPaged:
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
490
|
+
merged: b,
|
|
491
|
+
pageIds: z,
|
|
492
|
+
rowViews: V,
|
|
493
|
+
rootBind: At,
|
|
494
|
+
emptyBind: Kt,
|
|
495
|
+
showEmpty: kt,
|
|
496
|
+
frameBind: Yt,
|
|
497
|
+
showPager: G,
|
|
498
|
+
tableProps: zt,
|
|
499
|
+
footerBind: Xt,
|
|
500
|
+
showSearch: mn,
|
|
501
|
+
getHeadBind: Ut,
|
|
502
|
+
headerViews: B,
|
|
503
|
+
loadingBind: qt,
|
|
504
|
+
onToggleRow: en,
|
|
505
|
+
toolbarBind: Gt,
|
|
506
|
+
getCellBind: Wt,
|
|
507
|
+
columnCount: Dt,
|
|
508
|
+
clientPaged: M,
|
|
509
|
+
cursorPaged: A,
|
|
510
|
+
serverPaged: j,
|
|
511
|
+
showPerPage: H,
|
|
512
|
+
showToolbar: r(() => !!_.toolbar || !!_.toolbarActions || O.value || mn.value),
|
|
513
|
+
selectedBind: Zt,
|
|
514
|
+
showSelected: W,
|
|
515
|
+
getHeadAlign: Vt,
|
|
516
|
+
getCellAlign: Ht,
|
|
517
|
+
onTogglePage: sn,
|
|
518
|
+
onToggleSort: $t,
|
|
519
|
+
summaryCells: fn,
|
|
520
|
+
showFooterBar: Ot,
|
|
521
|
+
expandEnabled: yt,
|
|
522
|
+
onChangeSearch: nn,
|
|
523
|
+
loadingBarBind: Jt,
|
|
524
|
+
paginationBind: Qt,
|
|
525
|
+
selectAllState: Et,
|
|
526
|
+
onToggleExpand: ln,
|
|
527
|
+
visibilityItems: pn,
|
|
528
|
+
onChangePerPage: tn,
|
|
529
|
+
resolvedPerPage: N,
|
|
510
530
|
selectionEnabled: D,
|
|
511
|
-
perPageSlotProps:
|
|
512
|
-
selectedSlotProps:
|
|
513
|
-
resolvedPageCount:
|
|
531
|
+
perPageSlotProps: an,
|
|
532
|
+
selectedSlotProps: on,
|
|
533
|
+
resolvedPageCount: U,
|
|
514
534
|
selectionMultiple: k,
|
|
515
535
|
visibilityEnabled: O,
|
|
516
|
-
paginationSlotProps:
|
|
517
|
-
onCommitColumnFilter:
|
|
518
|
-
onHiddenColumnsChange:
|
|
519
|
-
onToggleColumnVisibility:
|
|
520
|
-
loadingBar: r(() =>
|
|
536
|
+
paginationSlotProps: rn,
|
|
537
|
+
onCommitColumnFilter: cn,
|
|
538
|
+
onHiddenColumnsChange: dn,
|
|
539
|
+
onToggleColumnVisibility: un,
|
|
540
|
+
loadingBar: r(() => b.value.loadingVariant === "bar")
|
|
521
541
|
};
|
|
522
542
|
}
|
|
523
543
|
//#endregion
|