@bridge-ui/vue 0.16.0 → 0.17.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.
Files changed (55) hide show
  1. package/ai/skills/bridge-ui-components/SKILL.md +2 -1
  2. package/dist/Actions/Snackbar/createBridgeSnackbarApi.js +1 -1
  3. package/dist/Actions/actionHostRegistry.d.ts +2 -1
  4. package/dist/Actions/actionHostRegistry.js +11 -7
  5. package/dist/Components/DataTable/DataTable.vue.d.ts +5 -3
  6. package/dist/Components/DataTable/DataTable.vue_vue_type_script_setup_true_lang.js +138 -117
  7. package/dist/Components/DataTable/composables/useDataTable.d.ts +4 -2
  8. package/dist/Components/DataTable/composables/useDataTable.js +293 -273
  9. package/dist/Components/DataTable/dataTable.types.d.ts +35 -2
  10. package/dist/Components/Drawer/Drawer.vue_vue_type_script_setup_true_lang.js +4 -3
  11. package/dist/Components/Drawer/composables/useDrawer.js +68 -67
  12. package/dist/Components/Menu/Menu.vue_vue_type_script_setup_true_lang.js +3 -5
  13. package/dist/Components/Modal/Modal.vue_vue_type_script_setup_true_lang.js +4 -3
  14. package/dist/Components/Modal/composables/useModal.js +129 -119
  15. package/dist/Components/Pagination/Pagination.vue.d.ts +6 -0
  16. package/dist/Components/Pagination/Pagination.vue_vue_type_script_setup_true_lang.js +23 -11
  17. package/dist/Components/Pagination/composables/usePagination.d.ts +3 -3
  18. package/dist/Components/Pagination/composables/usePagination.js +95 -84
  19. package/dist/Components/Pagination/pagination.types.d.ts +30 -2
  20. package/dist/Components/Resizable/Resizable.js +5 -0
  21. package/dist/Components/Resizable/Resizable.vue.d.ts +17 -0
  22. package/dist/Components/Resizable/Resizable.vue_vue_type_script_setup_true_lang.js +30 -0
  23. package/dist/Components/Resizable/composables/useResizable.d.ts +18 -0
  24. package/dist/Components/Resizable/composables/useResizable.js +195 -0
  25. package/dist/Components/Resizable/index.d.ts +4 -0
  26. package/dist/Components/Resizable/index.js +4 -0
  27. package/dist/Components/Resizable/resizable.types.d.ts +53 -0
  28. package/dist/Components/Resizable/resizableInjectionKey.d.ts +111 -0
  29. package/dist/Components/Resizable/resizableInjectionKey.js +4 -0
  30. package/dist/Components/ResizableHandle/ResizableHandle.js +5 -0
  31. package/dist/Components/ResizableHandle/ResizableHandle.vue.d.ts +14 -0
  32. package/dist/Components/ResizableHandle/ResizableHandle.vue_vue_type_script_setup_true_lang.js +31 -0
  33. package/dist/Components/ResizableHandle/composables/useResizableHandle.d.ts +35 -0
  34. package/dist/Components/ResizableHandle/composables/useResizableHandle.js +85 -0
  35. package/dist/Components/ResizableHandle/index.d.ts +3 -0
  36. package/dist/Components/ResizableHandle/index.js +3 -0
  37. package/dist/Components/ResizableHandle/resizableHandle.types.d.ts +58 -0
  38. package/dist/Components/ResizablePanel/ResizablePanel.js +5 -0
  39. package/dist/Components/ResizablePanel/ResizablePanel.vue.d.ts +24 -0
  40. package/dist/Components/ResizablePanel/ResizablePanel.vue_vue_type_script_setup_true_lang.js +39 -0
  41. package/dist/Components/ResizablePanel/composables/useResizablePanel.d.ts +21 -0
  42. package/dist/Components/ResizablePanel/composables/useResizablePanel.js +87 -0
  43. package/dist/Components/ResizablePanel/index.d.ts +3 -0
  44. package/dist/Components/ResizablePanel/index.js +3 -0
  45. package/dist/Components/ResizablePanel/resizablePanel.types.d.ts +71 -0
  46. package/dist/Components/Snackbar/composables/useSnackbar.js +140 -146
  47. package/dist/Components/Tooltip/Tooltip.vue_vue_type_script_setup_true_lang.js +4 -6
  48. package/dist/augments.d.ts +15 -0
  49. package/dist/index.d.ts +6 -0
  50. package/dist/index.js +70 -63
  51. package/docs/README.md +1 -0
  52. package/docs/components/DataTable.md +19 -0
  53. package/docs/components/Pagination.md +17 -5
  54. package/docs/components/Resizable.md +224 -0
  55. package/package.json +2 -2
@@ -2,7 +2,7 @@
2
2
  name: bridge-ui-components
3
3
  description: >-
4
4
  Use Bridge UI Vue components — Button, ButtonGroup, Avatar, Card, Alert, Accordion, ActionFooter, Badge, Icon,
5
- Link, List, Table, DataTable, Tabs, Spinner, Skeleton, EmptyState, Sidebar, Progress, Stepper, Carousel, Chart, Pagination, TextField, Select,
5
+ Link, List, Table, DataTable, Tabs, Spinner, Skeleton, EmptyState, Sidebar, Progress, Stepper, Carousel, Resizable, Chart, Pagination, TextField, Select,
6
6
  Autocomplete, DateField, DatePicker, DateRangeField, DateRangePicker,
7
7
  TimeField, TimePicker, DateTimeField, DateTimePicker, ColorField, ColorPicker,
8
8
  classes, customProps, slots. Use when building UI with Bridge components.
@@ -27,6 +27,7 @@ In templates, use kebab-case attrs (`start-icon`, `custom-props`, `error-message
27
27
  | Action footer | `.ai/docs/components/ActionFooter.md` |
28
28
  | Stepper | `.ai/docs/components/Stepper.md` |
29
29
  | Carousel | `.ai/docs/components/Carousel.md` |
30
+ | Resizable panels | `.ai/docs/components/Resizable.md` |
30
31
  | Chart | `.ai/docs/components/Chart.md` |
31
32
  | Icon | `.ai/docs/components/Icon.md` |
32
33
  | Lists | `.ai/docs/components/List.md` |
@@ -41,7 +41,7 @@ function m(t = {}) {
41
41
  h.value = d(h.value, e, t, ["props"]);
42
42
  }
43
43
  function C(e, t) {
44
- (!t || h.value.some((t) => t.id === e && t.show)) && (h.value = l(h.value, e, t));
44
+ h.value = l(h.value, e, t);
45
45
  }
46
46
  return {
47
47
  open: g,
@@ -8,6 +8,7 @@ export declare const drawerActionHosts: ActionHostRegistry<BridgeDrawerControlle
8
8
  export declare const modalActionHosts: ActionHostRegistry<BridgeModalController>;
9
9
  export declare const snackbarActionHosts: ActionHostRegistry<BridgeSnackbarController>;
10
10
  /**
11
- * Registers `api` until the current component unmounts.
11
+ * Registers `api` while the current component is mounted. Lifecycle hooks
12
+ * never run during SSR, so server renders don't leak hosts into the registry.
12
13
  */
13
14
  export declare function registerActionHost<T>(registry: ActionHostRegistry<T>, api: T): void;
@@ -1,10 +1,14 @@
1
- import { onUnmounted as e } from "vue";
2
- import { createActionHostRegistry as t } from "@bridge-ui/core/Layer";
1
+ import { onBeforeMount as e, onUnmounted as t } from "vue";
2
+ import { createActionHostRegistry as n } from "@bridge-ui/core/Layer";
3
3
  //#region src/Actions/actionHostRegistry.ts
4
- var n = t(), r = t(), i = t(), a = t();
5
- function o(t, n) {
6
- let r = t.register(n);
7
- e(r);
4
+ var r = n(), i = n(), a = n(), o = n();
5
+ function s(n, r) {
6
+ let i = null;
7
+ e(() => {
8
+ i = n.register(r);
9
+ }), t(() => {
10
+ i?.();
11
+ });
8
12
  }
9
13
  //#endregion
10
- export { n as dialogActionHosts, r as drawerActionHosts, i as modalActionHosts, o as registerActionHost, a as snackbarActionHosts };
14
+ export { r as dialogActionHosts, i as drawerActionHosts, a as modalActionHosts, s as registerActionHost, o as snackbarActionHosts };
@@ -1,18 +1,20 @@
1
1
  import { VNodeChild } from 'vue';
2
- import { DataTableColumnSearch, DataTableFilters } from '@bridge-ui/core/Domain';
2
+ import { DataTableColumnSearch, DataTableFilters, PaginationCursor } from '@bridge-ui/core/Domain';
3
3
  import { DataTableItemSlotProps, DataTableOwnProps, DataTableSlots, DataTableSorting } from './dataTable.types';
4
4
  declare const __VLS_export: <T extends Record<string, unknown>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
5
- props: import('vue').PublicProps & __VLS_PrettifyLocal<(Omit<DataTableOwnProps<T>, "search" | "page" | "filters" | "expanded" | "selection" | "columnSearch" | "hiddenColumns" | "perPage" | "sorting"> & {
5
+ props: import('vue').PublicProps & __VLS_PrettifyLocal<(Omit<DataTableOwnProps<T>, "search" | "cursor" | "page" | "filters" | "expanded" | "selection" | "columnSearch" | "hiddenColumns" | "perPage" | "sorting"> & {
6
6
  page?: number;
7
7
  perPage?: number;
8
8
  search?: string;
9
9
  expanded?: string[];
10
10
  selection?: string[];
11
+ cursor?: PaginationCursor;
11
12
  filters?: DataTableFilters;
12
13
  sorting?: DataTableSorting;
13
14
  hiddenColumns?: string[];
14
15
  columnSearch?: DataTableColumnSearch;
15
16
  }) & {
17
+ "onUpdate:cursor"?: ((value: PaginationCursor | undefined) => any) | undefined;
16
18
  "onUpdate:page"?: ((value: number | undefined) => any) | undefined;
17
19
  "onUpdate:perPage"?: ((value: number | undefined) => any) | undefined;
18
20
  "onUpdate:search"?: ((value: string | undefined) => any) | undefined;
@@ -30,7 +32,7 @@ declare const __VLS_export: <T extends Record<string, unknown>>(__VLS_props: Non
30
32
  slots: DataTableSlots<T> & {
31
33
  [x: `item.${string}`]: ((props: DataTableItemSlotProps<T>) => VNodeChild) | undefined;
32
34
  };
33
- emit: ((event: "update:page", value: number | undefined) => void) & ((event: "update:perPage", value: number | undefined) => void) & ((event: "update:search", value: string | undefined) => void) & ((event: "update:expanded", value: string[] | undefined) => void) & ((event: "update:selection", value: string[] | undefined) => void) & ((event: "update:filters", value: DataTableFilters | undefined) => void) & ((event: "update:sorting", value: DataTableSorting | undefined) => void) & ((event: "update:hiddenColumns", value: string[] | undefined) => void) & ((event: "update:columnSearch", value: DataTableColumnSearch | undefined) => void);
35
+ emit: ((event: "update:cursor", value: PaginationCursor | undefined) => void) & ((event: "update:page", value: number | undefined) => void) & ((event: "update:perPage", value: number | undefined) => void) & ((event: "update:search", value: string | undefined) => void) & ((event: "update:expanded", value: string[] | undefined) => void) & ((event: "update:selection", value: string[] | undefined) => void) & ((event: "update:filters", value: DataTableFilters | undefined) => void) & ((event: "update:sorting", value: DataTableSorting | undefined) => void) & ((event: "update:hiddenColumns", value: string[] | undefined) => void) & ((event: "update:columnSearch", value: DataTableColumnSearch | undefined) => void);
34
36
  }>) => import('vue').VNode & {
35
37
  __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
36
38
  };
@@ -3,39 +3,40 @@ import { hasNamedSlot as t } from "../../Utils/slotOrProp.js";
3
3
  import n from "../Icon/Icon.js";
4
4
  import ee from "../Progress/Progress.js";
5
5
  import te from "../EmptyState/EmptyState.js";
6
- import ne from "../Select/Select.js";
6
+ import ne from "../Pagination/Pagination.js";
7
+ import re from "../Select/Select.js";
7
8
  import { useDataTable as r } from "./composables/useDataTable.js";
8
- import re from "./DataTableCellContent.js";
9
- import ie from "./DataTableColumnsMenu.js";
10
- import ae from "./DataTableFilterMenu.js";
11
- import oe from "./DataTablePagination.js";
12
- import se from "./DataTableSearch.js";
9
+ import ie from "./DataTableCellContent.js";
10
+ import ae from "./DataTableColumnsMenu.js";
11
+ import oe from "./DataTableFilterMenu.js";
12
+ import se from "./DataTablePagination.js";
13
+ import ce from "./DataTableSearch.js";
13
14
  import i from "./DataTableSelection.js";
14
- import ce from "./DataTableSortButton.js";
15
- import le from "../Table/Table.js";
16
- import ue from "../Table/TableBody.js";
15
+ import le from "./DataTableSortButton.js";
16
+ import ue from "../Table/Table.js";
17
+ import de from "../Table/TableBody.js";
17
18
  import a from "../Table/TableCell.js";
18
- import de from "../Table/TableFooter.js";
19
- import fe from "../Table/TableHead.js";
20
- import pe from "../Table/TableHeader.js";
19
+ import fe from "../Table/TableFooter.js";
20
+ import pe from "../Table/TableHead.js";
21
+ import me from "../Table/TableHeader.js";
21
22
  import o from "../Table/TableRow.js";
22
- import { Fragment as s, computed as c, createBlock as l, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createTextVNode as me, createVNode as p, defineComponent as m, guardReactiveProps as h, mergeModels as g, mergeProps as _, normalizeClass as v, normalizeProps as y, openBlock as b, renderList as x, renderSlot as S, toDisplayString as C, unref as w, useId as he, useModel as T, useSlots as ge, withCtx as E } from "vue";
23
+ import { Fragment as s, computed as c, createBlock as l, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createTextVNode as he, createVNode as p, defineComponent as m, guardReactiveProps as h, mergeModels as g, mergeProps as _, normalizeClass as v, normalizeProps as y, openBlock as b, renderList as x, renderSlot as S, toDisplayString as C, unref as w, useId as ge, useModel as T, useSlots as _e, withCtx as E } from "vue";
23
24
  import { cn as D } from "@bridge-ui/core/Utils";
24
25
  //#region src/Components/DataTable/DataTable.vue?vue&type=script&setup=true&lang.ts
25
- var _e = { class: "min-w-0 flex-1" }, ve = { class: "flex shrink-0 items-center gap-2" }, ye = {
26
+ var ve = { class: "min-w-0 flex-1" }, ye = { class: "flex shrink-0 items-center gap-2" }, be = {
26
27
  key: 0,
27
28
  class: "inline-flex items-center rounded-lg border border-dark-200 bg-white p-0.5 dark:border-dark-700 dark:bg-dark-900"
28
- }, be = { class: "relative" }, xe = {
29
+ }, xe = { class: "relative" }, O = {
29
30
  key: 1,
30
31
  class: "flex w-full min-w-0 items-center gap-1.5"
31
- }, O = { class: "min-w-0 truncate leading-normal" }, k = [
32
+ }, k = { class: "min-w-0 truncate leading-normal" }, A = [
32
33
  "aria-expanded",
33
34
  "aria-label",
34
35
  "onClick"
35
- ], A = ["aria-hidden"], j = { class: "min-h-0 overflow-hidden" }, M = { class: "p-3" }, Se = ["aria-hidden"], Ce = ["aria-label"], we = { class: "flex shrink-0 items-center gap-2" }, Te = { class: "text-sm whitespace-nowrap" }, Ee = {
36
+ ], j = ["aria-hidden"], M = { class: "min-h-0 overflow-hidden" }, Se = { class: "p-3" }, Ce = ["aria-hidden"], we = ["aria-label"], Te = { class: "flex shrink-0 items-center gap-2" }, Ee = { class: "text-sm whitespace-nowrap" }, De = {
36
37
  key: 2,
37
38
  class: "flex shrink-0 items-center gap-3"
38
- }, De = {
39
+ }, Oe = {
39
40
  key: 0,
40
41
  class: "text-sm font-medium whitespace-nowrap"
41
42
  }, N = /*@__PURE__*/ m({
@@ -65,8 +66,10 @@ var _e = { class: "min-w-0 flex-1" }, ve = { class: "flex shrink-0 items-center
65
66
  default: !1
66
67
  },
67
68
  loadingVariant: { default: "overlay" },
69
+ nextCursor: {},
68
70
  pageCount: {},
69
71
  perPageOptions: {},
72
+ prevCursor: {},
70
73
  rounded: {},
71
74
  rows: {},
72
75
  selectionMode: {},
@@ -100,6 +103,8 @@ var _e = { class: "min-w-0 flex-1" }, ve = { class: "flex shrink-0 items-center
100
103
  expandedModifiers: {},
101
104
  selection: {},
102
105
  selectionModifiers: {},
106
+ cursor: {},
107
+ cursorModifiers: {},
103
108
  filters: {},
104
109
  filtersModifiers: {},
105
110
  sorting: {},
@@ -115,13 +120,14 @@ var _e = { class: "min-w-0 flex-1" }, ve = { class: "flex shrink-0 items-center
115
120
  "update:search",
116
121
  "update:expanded",
117
122
  "update:selection",
123
+ "update:cursor",
118
124
  "update:filters",
119
125
  "update:sorting",
120
126
  "update:hiddenColumns",
121
127
  "update:columnSearch"
122
128
  ],
123
129
  setup(m) {
124
- let g = m, N = ge(), P = e(), F = T(m, "page"), I = T(m, "perPage"), L = T(m, "search"), Oe = T(m, "expanded"), ke = T(m, "selection"), Ae = T(m, "filters"), je = T(m, "sorting"), Me = T(m, "hiddenColumns"), Ne = T(m, "columnSearch"), { merged: R, rowViews: Pe, rootBind: Fe, emptyBind: Ie, showEmpty: z, frameBind: Le, showPager: Re, tableProps: ze, footerBind: Be, loadingBar: B, showSearch: Ve, getHeadBind: He, headerViews: Ue, loadingBind: We, onToggleRow: Ge, toolbarBind: Ke, getCellBind: V, columnCount: H, showPerPage: qe, showToolbar: Je, selectedBind: Ye, showSelected: Xe, getHeadAlign: Ze, getCellAlign: U, onTogglePage: Qe, onToggleSort: $e, summaryCells: W, showFooterBar: et, expandEnabled: tt, loadingBarBind: nt, paginationBind: rt, selectAllState: G, onChangeSearch: it, onToggleExpand: at, visibilityItems: ot, perPageSlotProps: K, selectedSlotProps: q, resolvedPageCount: J, selectionMultiple: Y, visibilityEnabled: st, paginationSlotProps: X, onCommitColumnFilter: ct, onHiddenColumnsChange: lt } = r(g, {
130
+ let g = m, N = _e(), 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: We, getHeadBind: Ge, headerViews: Ke, loadingBind: qe, onToggleRow: Je, toolbarBind: Ye, getCellBind: B, columnCount: V, cursorPaged: Xe, showPerPage: Ze, showToolbar: Qe, selectedBind: $e, showSelected: et, getHeadAlign: tt, getCellAlign: H, onTogglePage: nt, onToggleSort: rt, summaryCells: U, showFooterBar: it, expandEnabled: at, loadingBarBind: ot, paginationBind: st, selectAllState: W, onChangeSearch: ct, onToggleExpand: lt, visibilityItems: ut, perPageSlotProps: G, selectedSlotProps: K, resolvedPageCount: q, selectionMultiple: J, visibilityEnabled: dt, paginationSlotProps: Y, onCommitColumnFilter: ft, onHiddenColumnsChange: pt } = r(g, {
125
131
  size: "md",
126
132
  full: !0,
127
133
  rounded: "lg",
@@ -136,22 +142,23 @@ var _e = { class: "min-w-0 flex-1" }, ve = { class: "flex shrink-0 items-center
136
142
  loadingVariant: "overlay"
137
143
  }, {
138
144
  page: F,
139
- search: L,
140
- perPage: I,
141
- filters: Ae,
142
- sorting: je,
143
- expanded: Oe,
144
- selection: ke,
145
- columnSearch: Ne,
146
- hiddenColumns: Me
147
- }), Z = c(() => R.value.size === "lg" ? "md" : "sm"), ut = c(() => P("{{selected}} of {{total}} row(s) selected.", q.value.selectedCount, {
148
- total: q.value.totalCount,
149
- selected: q.value.selectedCount
150
- })), dt = c(() => P("Page {{page}} of {{count}}", {
151
- page: X.value.page,
152
- count: X.value.count
145
+ cursor: Me,
146
+ search: I,
147
+ perPage: ke,
148
+ filters: Ne,
149
+ sorting: Pe,
150
+ expanded: Ae,
151
+ selection: je,
152
+ columnSearch: Ie,
153
+ hiddenColumns: Fe
154
+ }), X = c(() => L.value.size === "lg" ? "md" : "sm"), mt = c(() => P("{{selected}} of {{total}} row(s) selected.", K.value.selectedCount, {
155
+ total: K.value.totalCount,
156
+ selected: K.value.selectedCount
157
+ })), ht = c(() => P("Page {{page}} of {{count}}", {
158
+ page: Y.value.page,
159
+ count: Y.value.count
153
160
  }));
154
- function ft(e, t) {
161
+ function gt(e, t) {
155
162
  let n = N[`item.${t.id}`] ?? N.item;
156
163
  return n ? n({
157
164
  id: t.id,
@@ -159,21 +166,21 @@ var _e = { class: "min-w-0 flex-1" }, ve = { class: "flex shrink-0 items-center
159
166
  value: t.value
160
167
  }) : t.content;
161
168
  }
162
- let Q = c({
169
+ let Z = c({
163
170
  get: () => F.value ?? 1,
164
171
  set: (e) => {
165
172
  F.value = e;
166
173
  }
167
- }), pt = c(() => K.value.options.map((e) => ({
174
+ }), _t = c(() => G.value.options.map((e) => ({
168
175
  value: e,
169
176
  label: String(e)
170
177
  })));
171
- function mt(e) {
178
+ function vt(e) {
172
179
  let t = Number(e);
173
- !Number.isFinite(t) || t < 1 || K.value.onPerPageChange(t);
180
+ !Number.isFinite(t) || t < 1 || G.value.onPerPageChange(t);
174
181
  }
175
- let ht = c(() => {
176
- let e = R.value.customProps?.perPage?.customProps;
182
+ let yt = c(() => {
183
+ let e = L.value.customProps?.perPage?.customProps;
177
184
  return {
178
185
  ...e,
179
186
  listbox: {
@@ -182,13 +189,13 @@ var _e = { class: "min-w-0 flex-1" }, ve = { class: "flex shrink-0 items-center
182
189
  ...e?.listbox
183
190
  }
184
191
  };
185
- }), gt = he(), $ = (e) => e.node ?? null;
186
- return (e, r) => (b(), d("div", y(h(w(Fe))), [w(Je) ? (b(), d("div", y(_({ key: 0 }, w(Ke))), [f("div", _e, [S(e.$slots, "toolbar")]), f("div", ve, [
187
- w(st) ? (b(), d("div", ye, [p(ie, {
188
- items: w(ot),
189
- overlay: w(R).columnsOverlay,
190
- onChange: w(lt),
191
- "show-footer": w(R).columnsShowFooter
192
+ }), Q = ge(), $ = (e) => e.node ?? null;
193
+ return (e, r) => (b(), d("div", y(h(w(Re))), [w(Qe) ? (b(), d("div", y(_({ key: 0 }, w(Ye))), [f("div", ve, [S(e.$slots, "toolbar")]), f("div", ye, [
194
+ w(dt) ? (b(), d("div", be, [p(ae, {
195
+ items: w(ut),
196
+ overlay: w(L).columnsOverlay,
197
+ onChange: w(pt),
198
+ "show-footer": w(L).columnsShowFooter
192
199
  }, null, 8, [
193
200
  "items",
194
201
  "overlay",
@@ -196,56 +203,56 @@ var _e = { class: "min-w-0 flex-1" }, ve = { class: "flex shrink-0 items-center
196
203
  "show-footer"
197
204
  ])])) : u("", !0),
198
205
  S(e.$slots, "toolbarActions"),
199
- w(Ve) ? S(e.$slots, "search", {}, () => [p(se, {
200
- "model-value": L.value ?? "",
201
- "onUpdate:modelValue": w(it),
202
- "field-props": w(R).customProps?.search
206
+ w(We) ? S(e.$slots, "search", {}, () => [p(ce, {
207
+ "model-value": I.value ?? "",
208
+ "onUpdate:modelValue": w(ct),
209
+ "field-props": w(L).customProps?.search
203
210
  }, null, 8, [
204
211
  "model-value",
205
212
  "onUpdate:modelValue",
206
213
  "field-props"
207
214
  ])], void 0, 1) : u("", !0)
208
- ])], 16)) : u("", !0), f("div", y(h(w(Le))), [
209
- f("div", be, [p(w(le), y(h(w(ze))), {
215
+ ])], 16)) : u("", !0), f("div", y(h(w(Be))), [
216
+ f("div", xe, [p(w(ue), y(h(w(He))), {
210
217
  default: E(() => [
211
- p(w(pe), y(h(w(R).customProps?.header)), {
212
- default: E(() => [p(w(o), y(h(w(R).customProps?.row)), {
213
- default: E(() => [(b(!0), d(s, null, x(w(Ue), (e) => (b(), l(w(fe), _({
218
+ p(w(me), y(h(w(L).customProps?.header)), {
219
+ default: E(() => [p(w(o), y(h(w(L).customProps?.row)), {
220
+ default: E(() => [(b(!0), d(s, null, x(w(Ke), (e) => (b(), l(w(pe), _({
214
221
  key: e.id,
215
- align: w(Ze)(e)
216
- }, { ref_for: !0 }, w(He)(e)), {
217
- default: E(() => [e.isSelection && w(Y) ? (b(), l(i, {
222
+ align: w(tt)(e)
223
+ }, { ref_for: !0 }, w(Ge)(e)), {
224
+ default: E(() => [e.isSelection && w(J) ? (b(), l(i, {
218
225
  key: 0,
219
226
  kind: "page",
220
- size: Z.value,
221
- onChange: w(Qe),
222
- checked: w(G).checked,
223
- indeterminate: w(G).indeterminate,
224
- "checkbox-props": w(R).customProps?.checkbox
227
+ size: X.value,
228
+ onChange: w(nt),
229
+ checked: w(W).checked,
230
+ indeterminate: w(W).indeterminate,
231
+ "checkbox-props": w(L).customProps?.checkbox
225
232
  }, null, 8, [
226
233
  "size",
227
234
  "onChange",
228
235
  "checked",
229
236
  "indeterminate",
230
237
  "checkbox-props"
231
- ])) : !e.isSelection && !e.isExpand ? (b(), d("div", xe, [
232
- f("span", O, [p($, { node: e.header }, null, 8, ["node"])]),
233
- e.sortable ? (b(), l(ce, {
238
+ ])) : !e.isSelection && !e.isExpand ? (b(), d("div", O, [
239
+ f("span", k, [p($, { node: e.header }, null, 8, ["node"])]),
240
+ e.sortable ? (b(), l(le, {
234
241
  key: 0,
235
242
  sort: e.ariaSort,
236
- onClick: (t) => w($e)(e.id)
243
+ onClick: (t) => w(rt)(e.id)
237
244
  }, null, 8, ["sort", "onClick"])) : u("", !0),
238
- e.filterable ? (b(), l(ae, {
245
+ e.filterable ? (b(), l(oe, {
239
246
  key: 1,
240
247
  "column-id": e.id,
241
248
  active: e.filterActive,
242
249
  values: e.filterValues,
243
- overlay: w(R).filterOverlay,
250
+ overlay: w(L).filterOverlay,
244
251
  options: e.filterOptions,
245
252
  searchable: e.searchable,
246
253
  multiple: e.filterMultiple,
247
254
  "search-value": e.searchQuery,
248
- onApply: (t, n) => w(ct)(e.id, t, n)
255
+ onApply: (t, n) => w(ft)(e.id, t, n)
249
256
  }, null, 8, [
250
257
  "column-id",
251
258
  "active",
@@ -261,54 +268,54 @@ var _e = { class: "min-w-0 flex-1" }, ve = { class: "flex shrink-0 items-center
261
268
  _: 2
262
269
  }, 1040, ["align"]))), 128))]),
263
270
  _: 1
264
- }, 16), w(R).loading && w(B) ? (b(), l(w(o), {
271
+ }, 16), w(L).loading && w(z) ? (b(), l(w(o), {
265
272
  key: 0,
266
273
  classes: { root: "h-0" }
267
274
  }, {
268
275
  default: E(() => [p(w(a), {
269
- colspan: w(H),
276
+ colspan: w(V),
270
277
  classes: { root: "relative h-0 border-0 p-0 after:hidden" }
271
278
  }, {
272
- default: E(() => [f("div", y(h(w(nt))), [S(e.$slots, "loading", {}, () => [p(w(ee), _({
279
+ default: E(() => [f("div", y(h(w(ot))), [S(e.$slots, "loading", {}, () => [p(w(ee), _({
273
280
  size: "xs",
274
281
  rounded: "none"
275
- }, w(R).customProps?.progress), null, 16)])], 16)]),
282
+ }, w(L).customProps?.progress), null, 16)])], 16)]),
276
283
  _: 3
277
284
  }, 8, ["colspan"])]),
278
285
  _: 3
279
286
  })) : u("", !0)]),
280
287
  _: 3
281
288
  }, 16),
282
- p(w(ue), y(h(w(R).customProps?.body)), {
283
- default: E(() => [w(z) ? (b(), l(w(o), { key: 0 }, {
289
+ p(w(de), y(h(w(L).customProps?.body)), {
290
+ default: E(() => [w(R) ? (b(), l(w(o), { key: 0 }, {
284
291
  default: E(() => [p(w(a), {
285
292
  align: "center",
286
- colspan: w(H)
293
+ colspan: w(V)
287
294
  }, {
288
- default: E(() => [f("div", y(h(w(Ie))), [S(e.$slots, "empty", {}, () => [p(w(te), {
295
+ default: E(() => [f("div", y(h(w(ze))), [S(e.$slots, "empty", {}, () => [p(w(te), {
289
296
  icon: "inbox",
290
- size: w(R).size,
297
+ size: w(L).size,
291
298
  title: w(P)("No data")
292
299
  }, null, 8, ["size", "title"])])], 16)]),
293
300
  _: 3
294
301
  }, 8, ["colspan"])]),
295
302
  _: 3
296
- })) : u("", !0), w(z) ? u("", !0) : (b(!0), d(s, { key: 1 }, x(w(Pe), (t) => (b(), d(s, { key: t.id }, [p(w(o), _({ ref_for: !0 }, w(R).customProps?.row), {
303
+ })) : u("", !0), w(R) ? u("", !0) : (b(!0), d(s, { key: 1 }, x(w(Le), (t) => (b(), d(s, { key: t.id }, [p(w(o), _({ ref_for: !0 }, w(L).customProps?.row), {
297
304
  default: E(() => [(b(!0), d(s, null, x(t.cells, (e) => (b(), l(w(a), _({
298
305
  key: e.id,
299
- align: w(U)(e)
300
- }, { ref_for: !0 }, w(V)(e)), {
306
+ align: w(H)(e)
307
+ }, { ref_for: !0 }, w(B)(e)), {
301
308
  default: E(() => [e.isSelection ? (b(), l(i, {
302
309
  key: 0,
303
310
  kind: "row",
304
311
  value: t.id,
305
- size: Z.value,
306
- name: w(gt),
312
+ size: X.value,
313
+ name: w(Q),
307
314
  checked: t.selected,
308
- multiple: w(Y),
309
- "radio-props": w(R).customProps?.radio,
310
- "checkbox-props": w(R).customProps?.checkbox,
311
- onChange: (e) => w(Ge)(t.id, e)
315
+ multiple: w(J),
316
+ "radio-props": w(L).customProps?.radio,
317
+ "checkbox-props": w(L).customProps?.checkbox,
318
+ onChange: (e) => w(Je)(t.id, e)
312
319
  }, null, 8, [
313
320
  "value",
314
321
  "size",
@@ -323,25 +330,25 @@ var _e = { class: "min-w-0 flex-1" }, ve = { class: "flex shrink-0 items-center
323
330
  type: "button",
324
331
  "aria-expanded": t.expanded,
325
332
  "aria-label": w(P)("Expand row"),
326
- onClick: (e) => w(at)(t.id, !t.expanded),
333
+ onClick: (e) => w(lt)(t.id, !t.expanded),
327
334
  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"
328
335
  }, [f("span", { class: v([{ "rotate-90": t.expanded }, "inline-flex transition-transform duration-200 motion-reduce:transition-none"]) }, [p(w(n), {
329
336
  size: "sm",
330
337
  icon: "chevronRight"
331
- })], 2)], 8, k)) : (b(), l(re, {
338
+ })], 2)], 8, A)) : (b(), l(ie, {
332
339
  key: 2,
333
340
  tooltip: e.tooltip,
334
341
  ellipsis: e.ellipsis
335
342
  }, {
336
- default: E(() => [p($, { node: ft(t, e) }, null, 8, ["node"])]),
343
+ default: E(() => [p($, { node: gt(t, e) }, null, 8, ["node"])]),
337
344
  _: 2
338
345
  }, 1032, ["tooltip", "ellipsis"]))]),
339
346
  _: 2
340
347
  }, 1040, ["align"]))), 128))]),
341
348
  _: 2
342
- }, 1040), w(tt) ? (b(), l(w(o), { key: 0 }, {
349
+ }, 1040), w(at) ? (b(), l(w(o), { key: 0 }, {
343
350
  default: E(() => [p(w(a), {
344
- colspan: w(H),
351
+ colspan: w(V),
345
352
  classes: { root: w(D)({
346
353
  "p-0": !0,
347
354
  "border-0": !t.expanded
@@ -354,19 +361,19 @@ var _e = { class: "min-w-0 flex-1" }, ve = { class: "flex shrink-0 items-center
354
361
  "grid-rows-[1fr]": t.expanded,
355
362
  "grid-rows-[0fr]": !t.expanded
356
363
  }))
357
- }, [f("div", j, [f("div", M, [S(e.$slots, "expanded", { row: t.original })])])], 10, A)]),
364
+ }, [f("div", M, [f("div", Se, [S(e.$slots, "expanded", { row: t.original })])])], 10, j)]),
358
365
  _: 2
359
366
  }, 1032, ["colspan", "classes"])]),
360
367
  _: 2
361
368
  }, 1024)) : u("", !0)], 64))), 128))]),
362
369
  _: 3
363
370
  }, 16),
364
- w(W) ? (b(), l(w(de), { key: 0 }, {
365
- default: E(() => [p(w(o), y(h(w(R).customProps?.row)), {
366
- default: E(() => [(b(!0), d(s, null, x(w(W), (e) => (b(), l(w(a), _({
371
+ w(U) ? (b(), l(w(fe), { key: 0 }, {
372
+ default: E(() => [p(w(o), y(h(w(L).customProps?.row)), {
373
+ default: E(() => [(b(!0), d(s, null, x(w(U), (e) => (b(), l(w(a), _({
367
374
  key: e.id,
368
- align: w(U)(e)
369
- }, { ref_for: !0 }, w(V)(e)), {
375
+ align: w(H)(e)
376
+ }, { ref_for: !0 }, w(B)(e)), {
370
377
  default: E(() => [p($, { node: e.content }, null, 8, ["node"])]),
371
378
  _: 2
372
379
  }, 1040, ["align"]))), 128))]),
@@ -376,7 +383,7 @@ var _e = { class: "min-w-0 flex-1" }, ve = { class: "flex shrink-0 items-center
376
383
  })) : u("", !0)
377
384
  ]),
378
385
  _: 3
379
- }, 16), w(R).loading ? (b(), d("div", _({ key: 0 }, w(We), { "aria-hidden": w(B) || void 0 }), [w(B) ? u("", !0) : S(e.$slots, "loading", {}, () => [f("span", {
386
+ }, 16), w(L).loading ? (b(), d("div", _({ key: 0 }, w(qe), { "aria-hidden": w(z) || void 0 }), [w(z) ? u("", !0) : S(e.$slots, "loading", {}, () => [f("span", {
380
387
  role: "status",
381
388
  "aria-label": w(P)("Loading"),
382
389
  class: "relative inline-block size-5 animate-spin motion-reduce:animate-none"
@@ -385,22 +392,22 @@ var _e = { class: "min-w-0 flex-1" }, ve = { class: "flex shrink-0 items-center
385
392
  f("span", { class: "absolute inset-e-0 top-0 size-2 rounded-full bg-primary-500 opacity-50 dark:bg-primary-400" }, null, -1),
386
393
  f("span", { class: "absolute inset-e-0 bottom-0 size-2 rounded-full bg-primary-500 dark:bg-primary-400" }, null, -1),
387
394
  f("span", { class: "absolute inset-s-0 bottom-0 size-2 rounded-full bg-primary-500 opacity-70 dark:bg-primary-400" }, null, -1)
388
- ]], 8, Ce)], void 0, 0)], 16, Se)) : u("", !0)]),
389
- w(t)(w(N), "footer") ? (b(), d("div", y(_({ key: 0 }, w(Be))), [S(e.$slots, "footer")], 16)) : u("", !0),
390
- w(et) ? (b(), d("div", y(_({ key: 1 }, w(rt))), [
391
- w(Xe) ? (b(), d("div", y(_({ key: 0 }, w(Ye))), [S(e.$slots, "selected", y(h(w(q))), () => [me(C(ut.value), 1)])], 16)) : u("", !0),
392
- w(qe) ? S(e.$slots, "perPage", y(h(w(K))), () => [f("div", we, [f("span", Te, C(w(P)("Rows per page")), 1), p(w(ne), _({ size: "sm" }, w(R).customProps?.perPage, {
395
+ ]], 8, we)], void 0, 0)], 16, Ce)) : u("", !0)]),
396
+ w(t)(w(N), "footer") ? (b(), d("div", y(_({ key: 0 }, w(Ue))), [S(e.$slots, "footer")], 16)) : u("", !0),
397
+ w(it) ? (b(), d("div", y(_({ key: 1 }, w(st))), [
398
+ w(et) ? (b(), d("div", y(_({ key: 0 }, w($e))), [S(e.$slots, "selected", y(h(w(K))), () => [he(C(mt.value), 1)])], 16)) : u("", !0),
399
+ w(Ze) ? S(e.$slots, "perPage", y(h(w(G))), () => [f("div", Te, [f("span", Ee, C(w(P)("Rows per page")), 1), p(w(re), _({ size: "sm" }, w(L).customProps?.perPage, {
393
400
  overlay: "menu",
394
401
  clearable: !1,
395
402
  "hide-error-message": "",
396
- options: pt.value,
397
- "custom-props": ht.value,
398
- "model-value": w(K).perPage,
399
- "onUpdate:modelValue": mt,
403
+ options: _t.value,
404
+ "custom-props": yt.value,
405
+ "model-value": w(G).perPage,
406
+ "onUpdate:modelValue": vt,
400
407
  "aria-label": w(P)("Rows per page"),
401
408
  classes: {
402
- ...w(R).customProps?.perPage?.classes,
403
- root: w(D)("w-20", w(R).customProps?.perPage?.classes?.root)
409
+ ...w(L).customProps?.perPage?.classes,
410
+ root: w(D)("w-20", w(L).customProps?.perPage?.classes?.root)
404
411
  }
405
412
  }), null, 16, [
406
413
  "options",
@@ -409,13 +416,27 @@ var _e = { class: "min-w-0 flex-1" }, ve = { class: "flex shrink-0 items-center
409
416
  "aria-label",
410
417
  "classes"
411
418
  ])])], void 0, 1) : u("", !0),
412
- w(Re) ? (b(), d("div", Ee, [w(J) !== void 0 && !w(t)(w(N), "pagination") ? (b(), d("span", De, C(dt.value), 1)) : u("", !0), S(e.$slots, "pagination", y(h(w(X))), () => [w(J) === void 0 ? u("", !0) : (b(), l(oe, _({
419
+ w(Ve) ? (b(), d("div", De, [w(q) !== void 0 && !w(t)(w(N), "pagination") ? (b(), d("span", Oe, C(ht.value), 1)) : u("", !0), S(e.$slots, "pagination", y(h(w(Y))), () => [w(Xe) ? (b(), l(w(ne), _({
413
420
  key: 0,
414
421
  size: "sm"
415
- }, w(R).customProps?.pagination, {
416
- modelValue: Q.value,
417
- "onUpdate:modelValue": r[0] ||= (e) => Q.value = e,
418
- count: w(J)
422
+ }, w(L).customProps?.cursorPagination, {
423
+ mode: "simple",
424
+ onNext: w(Y).onNext,
425
+ "has-next": w(Y).hasNext,
426
+ onPrevious: w(Y).onPrevious,
427
+ "has-previous": w(Y).hasPrevious
428
+ }), null, 16, [
429
+ "onNext",
430
+ "has-next",
431
+ "onPrevious",
432
+ "has-previous"
433
+ ])) : w(q) === void 0 ? u("", !0) : (b(), l(se, _({
434
+ key: 1,
435
+ size: "sm"
436
+ }, w(L).customProps?.pagination, {
437
+ modelValue: Z.value,
438
+ "onUpdate:modelValue": r[0] ||= (e) => Z.value = e,
439
+ count: w(q)
419
440
  }), null, 16, ["modelValue", "count"]))])])) : u("", !0)
420
441
  ], 16)) : u("", !0)
421
442
  ], 16)], 16));
@@ -1,5 +1,5 @@
1
1
  import { Ref, VNode, VNodeChild } from 'vue';
2
- import { getDataTableAriaSort, getDataTableSortIcon, DataTableColumnSearch, DataTableFilterOption, DataTableFilters, DataTablePaginationSlotProps, DataTablePerPageSlotProps, DataTableSelectedSlotProps, DataTableSorting, DataTableStickyEdge, DataTableStickyInset } from '@bridge-ui/core/Domain';
2
+ import { getDataTableAriaSort, getDataTableSortIcon, DataTableColumnSearch, DataTableFilterOption, DataTableFilters, DataTablePaginationSlotProps, DataTablePerPageSlotProps, DataTableSelectedSlotProps, DataTableSorting, DataTableStickyEdge, DataTableStickyInset, PaginationCursor } from '@bridge-ui/core/Domain';
3
3
  import { LibDefaultsShape, MergeLibDefaults } from '@bridge-ui/core/Utils';
4
4
  import { DataTableColumn, DataTableOwnProps, DataTableProps } from '../dataTable.types';
5
5
  type DataTableLibDefaults = LibDefaultsShape<DataTableOwnProps<unknown>, "full" | "size" | "loading" | "rounded" | "striped" | "variant" | "hoverable" | "stickyHeader" | "filterOverlay" | "selectionMode" | "columnsOverlay" | "loadingVariant">;
@@ -58,6 +58,7 @@ export type DataTableVisibilityItem = {
58
58
  };
59
59
  export type DataTableModels = {
60
60
  columnSearch: Ref<undefined | DataTableColumnSearch>;
61
+ cursor?: Ref<undefined | PaginationCursor>;
61
62
  expanded: Ref<string[] | undefined>;
62
63
  filters: Ref<undefined | DataTableFilters>;
63
64
  hiddenColumns: Ref<string[] | undefined>;
@@ -73,7 +74,7 @@ export declare function useDataTable<T extends Record<string, unknown>>(props: D
73
74
  rowViews: import('vue').ComputedRef<DataTableRowView<T>[]>;
74
75
  rootBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<{
75
76
  class: string;
76
- }, "class", import('vue').HTMLAttributes | undefined, Partial<Omit<DataTableProps<T>, "search" | "columns" | "size" | "classes" | "customProps" | "full" | "loading" | "rounded" | "variant" | "page" | "filters" | "rows" | "expanded" | "selection" | "hoverable" | "stickyHeader" | "striped" | "columnSearch" | "columnsOverlay" | "columnsShowFooter" | "filterOverlay" | "getRowId" | "hiddenColumns" | "loadingVariant" | "pageCount" | "perPage" | "perPageOptions" | "selectionMode" | "showColumnVisibility" | "showSearch" | "sorting" | "totalCount">>>>;
77
+ }, "class", import('vue').HTMLAttributes | undefined, Partial<Omit<DataTableProps<T>, "search" | "columns" | "cursor" | "size" | "classes" | "customProps" | "full" | "loading" | "rounded" | "variant" | "page" | "filters" | "rows" | "expanded" | "selection" | "nextCursor" | "prevCursor" | "hoverable" | "stickyHeader" | "striped" | "columnSearch" | "columnsOverlay" | "columnsShowFooter" | "filterOverlay" | "getRowId" | "hiddenColumns" | "loadingVariant" | "pageCount" | "perPage" | "perPageOptions" | "selectionMode" | "showColumnVisibility" | "showSearch" | "sorting" | "totalCount">>>>;
77
78
  emptyBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<{
78
79
  class: string;
79
80
  }, "class", import('vue').HTMLAttributes | undefined, {}>>;
@@ -521,6 +522,7 @@ export declare function useDataTable<T extends Record<string, unknown>>(props: D
521
522
  }, "class", import('vue').HTMLAttributes | undefined, {}>;
522
523
  columnCount: import('vue').ComputedRef<number>;
523
524
  clientPaged: import('vue').ComputedRef<boolean>;
525
+ cursorPaged: import('vue').ComputedRef<boolean>;
524
526
  serverPaged: import('vue').ComputedRef<boolean>;
525
527
  showPerPage: import('vue').ComputedRef<boolean>;
526
528
  showToolbar: import('vue').ComputedRef<boolean>;