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