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