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