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