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