@vtable-guild/vtable-guild 2.8.1 → 2.9.0-alpha.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 (171) hide show
  1. package/css/presets/antdv.css +20 -0
  2. package/css/presets/element-plus.css +20 -0
  3. package/css/style.css +341 -0
  4. package/css/tailwind3-utilities.css +301 -0
  5. package/css/tailwind3.css +40 -0
  6. package/css/tailwind4.css +40 -0
  7. package/dist/core/src/components/Tooltip.d.ts +1 -1
  8. package/dist/core/src/components/Tooltip.d.ts.map +1 -1
  9. package/dist/core/src/components/Tooltip.mjs +49 -46
  10. package/dist/core/src/components/Tooltip.test.d.ts +2 -0
  11. package/dist/core/src/components/Tooltip.test.d.ts.map +1 -0
  12. package/dist/core/src/index.d.ts +1 -1
  13. package/dist/core/src/index.d.ts.map +1 -1
  14. package/dist/core/src/utils/types.d.ts +39 -1
  15. package/dist/core/src/utils/types.d.ts.map +1 -1
  16. package/dist/css/presets/antdv.css +20 -0
  17. package/dist/css/presets/element-plus.css +20 -0
  18. package/dist/css/style.css +341 -0
  19. package/dist/css/tailwind3-utilities.css +301 -0
  20. package/dist/css/tailwind3.css +40 -0
  21. package/dist/css/tailwind4.css +40 -0
  22. package/dist/icons/src/ColumnHeightOutlinedIcon.d.ts +3 -0
  23. package/dist/icons/src/ColumnHeightOutlinedIcon.d.ts.map +1 -0
  24. package/dist/icons/src/ColumnHeightOutlinedIcon.mjs +9 -0
  25. package/dist/icons/src/FullscreenExitOutlinedIcon.d.ts +3 -0
  26. package/dist/icons/src/FullscreenExitOutlinedIcon.d.ts.map +1 -0
  27. package/dist/icons/src/FullscreenExitOutlinedIcon.mjs +9 -0
  28. package/dist/icons/src/FullscreenOutlinedIcon.d.ts +3 -0
  29. package/dist/icons/src/FullscreenOutlinedIcon.d.ts.map +1 -0
  30. package/dist/icons/src/FullscreenOutlinedIcon.mjs +9 -0
  31. package/dist/icons/src/ReloadOutlinedIcon.d.ts +3 -0
  32. package/dist/icons/src/ReloadOutlinedIcon.d.ts.map +1 -0
  33. package/dist/icons/src/ReloadOutlinedIcon.mjs +9 -0
  34. package/dist/icons/src/SettingOutlinedIcon.d.ts +3 -0
  35. package/dist/icons/src/SettingOutlinedIcon.d.ts.map +1 -0
  36. package/dist/icons/src/SettingOutlinedIcon.mjs +9 -0
  37. package/dist/icons/src/index.d.ts +5 -0
  38. package/dist/icons/src/index.d.ts.map +1 -1
  39. package/dist/index.full.mjs +6088 -4458
  40. package/dist/index.mjs +115 -87
  41. package/dist/table/src/components/FilterDropdown.d.ts +1 -1
  42. package/dist/table/src/components/Table.d.ts +31 -4
  43. package/dist/table/src/components/Table.d.ts.map +1 -1
  44. package/dist/table/src/components/Table.mjs +516 -476
  45. package/dist/table/src/components/TableBody.d.ts.map +1 -1
  46. package/dist/table/src/components/TableBody.mjs +37 -36
  47. package/dist/table/src/components/TableCell.d.ts.map +1 -1
  48. package/dist/table/src/components/TableCell.mjs +95 -83
  49. package/dist/table/src/components/TableColumnSettings.d.ts +41 -0
  50. package/dist/table/src/components/TableColumnSettings.d.ts.map +1 -0
  51. package/dist/table/src/components/TableColumnSettings.mjs +360 -0
  52. package/dist/table/src/components/TableColumnSettings.test.d.ts +2 -0
  53. package/dist/table/src/components/TableColumnSettings.test.d.ts.map +1 -0
  54. package/dist/table/src/components/TableCopyButton.d.ts +41 -0
  55. package/dist/table/src/components/TableCopyButton.d.ts.map +1 -0
  56. package/dist/table/src/components/TableCopyButton.mjs +94 -0
  57. package/dist/table/src/components/TableEnterprise.test.d.ts +2 -0
  58. package/dist/table/src/components/TableEnterprise.test.d.ts.map +1 -0
  59. package/dist/table/src/components/TableHeaderCell.d.ts.map +1 -1
  60. package/dist/table/src/components/TableHeaderCell.mjs +284 -241
  61. package/dist/table/src/components/TableSelectionAlert.d.ts +50 -0
  62. package/dist/table/src/components/TableSelectionAlert.d.ts.map +1 -0
  63. package/dist/table/src/components/TableSelectionAlert.mjs +86 -0
  64. package/dist/table/src/components/TableSelectionAlert.test.d.ts +2 -0
  65. package/dist/table/src/components/TableSelectionAlert.test.d.ts.map +1 -0
  66. package/dist/table/src/components/TableToolbar.d.ts +87 -0
  67. package/dist/table/src/components/TableToolbar.d.ts.map +1 -0
  68. package/dist/table/src/components/TableToolbar.mjs +265 -0
  69. package/dist/table/src/components/TableToolbar.test.d.ts +2 -0
  70. package/dist/table/src/components/TableToolbar.test.d.ts.map +1 -0
  71. package/dist/table/src/components/VTable.vue.d.ts.map +1 -1
  72. package/dist/table/src/components/VTable.vue.mjs +24 -15
  73. package/dist/table/src/components/VTableColumnSettings.vue.d.ts +20 -0
  74. package/dist/table/src/components/VTableColumnSettings.vue.d.ts.map +1 -0
  75. package/dist/table/src/components/VTableColumnSettings.vue.mjs +42 -0
  76. package/dist/table/src/components/VTableColumnSettings.vue2.mjs +4 -0
  77. package/dist/table/src/components/VTableSelectionAlert.vue.d.ts +19 -0
  78. package/dist/table/src/components/VTableSelectionAlert.vue.d.ts.map +1 -0
  79. package/dist/table/src/components/VTableSelectionAlert.vue.mjs +54 -0
  80. package/dist/table/src/components/VTableSelectionAlert.vue2.mjs +4 -0
  81. package/dist/table/src/components/VTableToolbar.vue.d.ts +27 -0
  82. package/dist/table/src/components/VTableToolbar.vue.d.ts.map +1 -0
  83. package/dist/table/src/components/VTableToolbar.vue.mjs +108 -0
  84. package/dist/table/src/components/VTableToolbar.vue2.mjs +4 -0
  85. package/dist/table/src/composables/useColumnState.d.ts +32 -0
  86. package/dist/table/src/composables/useColumnState.d.ts.map +1 -0
  87. package/dist/table/src/composables/useColumnState.mjs +107 -0
  88. package/dist/table/src/composables/useColumnState.test.d.ts +2 -0
  89. package/dist/table/src/composables/useColumnState.test.d.ts.map +1 -0
  90. package/dist/table/src/composables/useFilter.d.ts.map +1 -1
  91. package/dist/table/src/composables/useFilter.mjs +28 -25
  92. package/dist/table/src/composables/usePagination.d.ts +1 -0
  93. package/dist/table/src/composables/usePagination.d.ts.map +1 -1
  94. package/dist/table/src/composables/usePagination.mjs +35 -34
  95. package/dist/table/src/composables/useTableRequest.d.ts +4 -0
  96. package/dist/table/src/composables/useTableRequest.d.ts.map +1 -0
  97. package/dist/table/src/composables/useTableRequest.mjs +127 -0
  98. package/dist/table/src/composables/useTableRequest.test.d.ts +2 -0
  99. package/dist/table/src/composables/useTableRequest.test.d.ts.map +1 -0
  100. package/dist/table/src/context.d.ts +9 -2
  101. package/dist/table/src/context.d.ts.map +1 -1
  102. package/dist/table/src/index.d.ts +17 -1
  103. package/dist/table/src/index.d.ts.map +1 -1
  104. package/dist/table/src/types/column-settings.d.ts +31 -0
  105. package/dist/table/src/types/column-settings.d.ts.map +1 -0
  106. package/dist/table/src/types/column-state.typecheck.d.ts +2 -0
  107. package/dist/table/src/types/column-state.typecheck.d.ts.map +1 -0
  108. package/dist/table/src/types/column.d.ts +15 -3
  109. package/dist/table/src/types/column.d.ts.map +1 -1
  110. package/dist/table/src/types/index.d.ts +2 -0
  111. package/dist/table/src/types/index.d.ts.map +1 -1
  112. package/dist/table/src/types/presentation.d.ts +24 -0
  113. package/dist/table/src/types/presentation.d.ts.map +1 -0
  114. package/dist/table/src/types/request.d.ts +65 -0
  115. package/dist/table/src/types/request.d.ts.map +1 -0
  116. package/dist/table/src/types/request.typecheck.d.ts +13 -0
  117. package/dist/table/src/types/request.typecheck.d.ts.map +1 -0
  118. package/dist/table/src/types/selection-alert.d.ts +30 -0
  119. package/dist/table/src/types/selection-alert.d.ts.map +1 -0
  120. package/dist/table/src/types/selection-alert.typecheck.d.ts +12 -0
  121. package/dist/table/src/types/selection-alert.typecheck.d.ts.map +1 -0
  122. package/dist/table/src/types/table.d.ts +12 -1
  123. package/dist/table/src/types/table.d.ts.map +1 -1
  124. package/dist/table/src/types/toolbar.d.ts +58 -0
  125. package/dist/table/src/types/toolbar.d.ts.map +1 -0
  126. package/dist/table/src/utils/cell.d.ts +4 -0
  127. package/dist/table/src/utils/cell.d.ts.map +1 -1
  128. package/dist/table/src/utils/cell.mjs +49 -45
  129. package/dist/table/src/utils/columnSettings.d.ts +22 -0
  130. package/dist/table/src/utils/columnSettings.d.ts.map +1 -0
  131. package/dist/table/src/utils/columnSettings.mjs +107 -0
  132. package/dist/table/src/utils/columnSettings.test.d.ts +2 -0
  133. package/dist/table/src/utils/columnSettings.test.d.ts.map +1 -0
  134. package/dist/table/src/utils/manual.d.ts +3 -0
  135. package/dist/table/src/utils/manual.d.ts.map +1 -0
  136. package/dist/table/src/utils/manual.mjs +6 -0
  137. package/dist/table/src/utils/valueEnum.d.ts +7 -0
  138. package/dist/table/src/utils/valueEnum.d.ts.map +1 -0
  139. package/dist/table/src/utils/valueEnum.mjs +23 -0
  140. package/dist/theme/src/augment.d.ts +4 -0
  141. package/dist/theme/src/augment.d.ts.map +1 -1
  142. package/dist/theme/src/column-settings.d.ts +160 -0
  143. package/dist/theme/src/column-settings.d.ts.map +1 -0
  144. package/dist/theme/src/column-settings.mjs +84 -0
  145. package/dist/theme/src/index.d.ts +12 -0
  146. package/dist/theme/src/index.d.ts.map +1 -1
  147. package/dist/theme/src/presets/antdv/table-locale.d.ts +10 -0
  148. package/dist/theme/src/presets/antdv/table-locale.d.ts.map +1 -1
  149. package/dist/theme/src/presets/antdv/table-locale.mjs +2 -0
  150. package/dist/theme/src/presets/antdv/table.d.ts +4 -0
  151. package/dist/theme/src/presets/antdv/table.d.ts.map +1 -1
  152. package/dist/theme/src/presets/antdv/table.mjs +4 -0
  153. package/dist/theme/src/presets/element-plus/table-locale.d.ts +10 -0
  154. package/dist/theme/src/presets/element-plus/table-locale.d.ts.map +1 -1
  155. package/dist/theme/src/presets/element-plus/table-locale.mjs +2 -0
  156. package/dist/theme/src/presets/element-plus/table.d.ts +4 -0
  157. package/dist/theme/src/presets/element-plus/table.d.ts.map +1 -1
  158. package/dist/theme/src/presets/element-plus/table.mjs +4 -0
  159. package/dist/theme/src/presets/index.d.ts.map +1 -1
  160. package/dist/theme/src/presets/index.mjs +100 -67
  161. package/dist/theme/src/presets/types.d.ts +3 -0
  162. package/dist/theme/src/presets/types.d.ts.map +1 -1
  163. package/dist/theme/src/selection-alert.d.ts +54 -0
  164. package/dist/theme/src/selection-alert.d.ts.map +1 -0
  165. package/dist/theme/src/selection-alert.mjs +36 -0
  166. package/dist/theme/src/toolbar.d.ts +105 -0
  167. package/dist/theme/src/toolbar.d.ts.map +1 -0
  168. package/dist/theme/src/toolbar.mjs +57 -0
  169. package/dist/vtable-guild/src/augment.d.ts +4 -1
  170. package/dist/vtable-guild/src/augment.d.ts.map +1 -1
  171. package/package.json +1 -1
@@ -0,0 +1,42 @@
1
+ import { defineComponent as i, createBlock as a, openBlock as p, unref as u, mergeProps as m, createSlots as d, withCtx as c, renderSlot as f, normalizeProps as b, guardReactiveProps as g } from "vue";
2
+ import C from "./TableColumnSettings.mjs";
3
+ const P = /* @__PURE__ */ i({
4
+ name: "VTableColumnSettings",
5
+ inheritAttrs: !1,
6
+ __name: "VTableColumnSettings",
7
+ props: {
8
+ columns: {},
9
+ size: {},
10
+ disabled: { type: Boolean },
11
+ options: {},
12
+ locale: {},
13
+ ui: {},
14
+ class: {},
15
+ getPopupContainer: { type: Function }
16
+ },
17
+ emits: ["update:columns", "update:size", "reset"],
18
+ setup(s, { emit: r }) {
19
+ const l = s, n = r;
20
+ function z(o) {
21
+ return o;
22
+ }
23
+ return (o, e) => (p(), a(u(C), m({ ...o.$attrs, ...l }, {
24
+ "onUpdate:columns": e[0] || (e[0] = (t) => n("update:columns", t)),
25
+ "onUpdate:size": e[1] || (e[1] = (t) => n("update:size", t)),
26
+ onReset: e[2] || (e[2] = (t) => n("reset"))
27
+ }), d({ _: 2 }, [
28
+ o.$slots.columnLabel ? {
29
+ name: "columnLabel",
30
+ fn: c((t) => [
31
+ f(o.$slots, "columnLabel", b(g(
32
+ t
33
+ )))
34
+ ]),
35
+ key: "0"
36
+ } : void 0
37
+ ]), 1040));
38
+ }
39
+ });
40
+ export {
41
+ P as default
42
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./VTableColumnSettings.vue.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,19 @@
1
+ import { Key } from '../types/column';
2
+ import { TableSelectionAlertProps, TableSelectionAlertSlots } from '../types/selection-alert';
3
+ declare const _default: <TRecord extends object = 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_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
4
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
5
+ readonly onClear?: ((selectedRowKeys: readonly Key[], selectedRows: readonly TRecord[]) => any) | undefined;
6
+ readonly "onUpdate:selectedRowKeys"?: ((keys: Key[]) => any) | undefined;
7
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onClear" | "onUpdate:selectedRowKeys"> & TableSelectionAlertProps<TRecord> & Partial<{}>> & import('vue').PublicProps;
8
+ expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
9
+ attrs: any;
10
+ slots: Readonly<TableSelectionAlertSlots<TRecord>> & TableSelectionAlertSlots<TRecord>;
11
+ emit: ((evt: "clear", selectedRowKeys: readonly Key[], selectedRows: readonly TRecord[]) => void) & ((evt: "update:selectedRowKeys", keys: Key[]) => void);
12
+ }>) => import('vue').VNode & {
13
+ __ctx?: Awaited<typeof __VLS_setup>;
14
+ };
15
+ export default _default;
16
+ type __VLS_PrettifyLocal<T> = {
17
+ [K in keyof T]: T[K];
18
+ } & {};
19
+ //# sourceMappingURL=VTableSelectionAlert.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VTableSelectionAlert.vue.d.ts","sourceRoot":"","sources":["../../../../../table/src/components/VTableSelectionAlert.vue"],"names":[],"mappings":"AAqDA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAC1C,OAAO,KAAK,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAA;yBAEjF,OAAO,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChE,aAAa,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,EAC9D,YAAY,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,EAC3G,eAAe,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,EACjE;WAoHO,mBAAmB,CAAC;;;8MAAkE,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;;;EAIP,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AA/HzE,wBA+H4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
@@ -0,0 +1,54 @@
1
+ import { defineComponent as f, createBlock as m, openBlock as u, unref as y, mergeProps as w, createSlots as R, withCtx as n, renderSlot as s, normalizeProps as a, guardReactiveProps as r } from "vue";
2
+ import B from "./TableSelectionAlert.mjs";
3
+ const $ = /* @__PURE__ */ f({
4
+ name: "VTableSelectionAlert",
5
+ inheritAttrs: !1,
6
+ __name: "VTableSelectionAlert",
7
+ props: {
8
+ selectedRowKeys: {},
9
+ selectedRows: {},
10
+ alwaysShow: { type: Boolean },
11
+ disabled: { type: Boolean },
12
+ loading: { type: Boolean },
13
+ showClear: { type: Boolean, default: !0 },
14
+ locale: {},
15
+ ui: {},
16
+ class: {}
17
+ },
18
+ emits: ["update:selectedRowKeys", "clear"],
19
+ setup(i, { emit: c }) {
20
+ const p = i, l = c;
21
+ function S(e) {
22
+ return e;
23
+ }
24
+ function d(e, t) {
25
+ l("clear", e, t);
26
+ }
27
+ return (e, t) => (u(), m(y(B), w({ ...e.$attrs, ...p }, {
28
+ "onUpdate:selectedRowKeys": t[0] || (t[0] = (o) => l("update:selectedRowKeys", o)),
29
+ onClear: d
30
+ }), R({ _: 2 }, [
31
+ e.$slots.info ? {
32
+ name: "info",
33
+ fn: n((o) => [
34
+ s(e.$slots, "info", a(r(
35
+ o
36
+ )))
37
+ ]),
38
+ key: "0"
39
+ } : void 0,
40
+ e.$slots.actions ? {
41
+ name: "actions",
42
+ fn: n((o) => [
43
+ s(e.$slots, "actions", a(r(
44
+ o
45
+ )))
46
+ ]),
47
+ key: "1"
48
+ } : void 0
49
+ ]), 1040));
50
+ }
51
+ });
52
+ export {
53
+ $ as default
54
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./VTableSelectionAlert.vue.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,27 @@
1
+ import { ColumnsType } from '../types';
2
+ import { TableColumnSettingsSize } from '../types/column-settings';
3
+ import { TableToolbarProps, TableToolbarSlots } from '../types/toolbar';
4
+ declare const _default: <TRecord extends object = 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_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
5
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
6
+ readonly onSearch?: ((value: string) => any) | undefined;
7
+ readonly onReset?: (() => any) | undefined;
8
+ readonly onClearSearch?: (() => any) | undefined;
9
+ readonly onReload?: (() => any) | undefined;
10
+ readonly "onUpdate:columns"?: ((columns: ColumnsType<TRecord>) => any) | undefined;
11
+ readonly "onUpdate:size"?: ((size: TableColumnSettingsSize) => any) | undefined;
12
+ readonly "onUpdate:searchValue"?: ((value: string) => any) | undefined;
13
+ readonly onFullscreenChange?: ((active: boolean) => any) | undefined;
14
+ readonly onFullscreenError?: ((error: unknown) => any) | undefined;
15
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onReset" | "onUpdate:columns" | "onUpdate:size" | "onReload" | "onSearch" | "onClearSearch" | "onUpdate:searchValue" | "onFullscreenChange" | "onFullscreenError"> & TableToolbarProps<TRecord> & Partial<{}>> & import('vue').PublicProps;
16
+ expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
17
+ attrs: any;
18
+ slots: Readonly<TableToolbarSlots<TRecord>> & TableToolbarSlots<TRecord>;
19
+ emit: ((evt: "search", value: string) => void) & ((evt: "reset") => void) & ((evt: "clearSearch") => void) & ((evt: "reload") => void) & ((evt: "update:columns", columns: ColumnsType<TRecord>) => void) & ((evt: "update:size", size: TableColumnSettingsSize) => void) & ((evt: "update:searchValue", value: string) => void) & ((evt: "fullscreenChange", active: boolean) => void) & ((evt: "fullscreenError", error: unknown) => void);
20
+ }>) => import('vue').VNode & {
21
+ __ctx?: Awaited<typeof __VLS_setup>;
22
+ };
23
+ export default _default;
24
+ type __VLS_PrettifyLocal<T> = {
25
+ [K in keyof T]: T[K];
26
+ } & {};
27
+ //# sourceMappingURL=VTableToolbar.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VTableToolbar.vue.d.ts","sourceRoot":"","sources":["../../../../../table/src/components/VTableToolbar.vue"],"names":[],"mappings":"AAsGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAC3C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAA;AACvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;yBAE3D,OAAO,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChE,aAAa,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,EAC9D,YAAY,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,EAC3G,eAAe,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,EACjE;WAiOO,mBAAmB,CAAC;;;;;;;;;;mUAAkE,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;;;EAIP,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AA5OzE,wBA4O4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
@@ -0,0 +1,108 @@
1
+ import { defineComponent as m, createBlock as d, openBlock as f, unref as $, mergeProps as y, createSlots as b, withCtx as t, renderSlot as n, normalizeProps as r, guardReactiveProps as a } from "vue";
2
+ import g from "./TableToolbar.mjs";
3
+ const S = /* @__PURE__ */ m({
4
+ name: "VTableToolbar",
5
+ inheritAttrs: !1,
6
+ __name: "VTableToolbar",
7
+ props: {
8
+ title: { type: [Object, String, Number, Boolean, null, Array] },
9
+ columns: {},
10
+ size: {},
11
+ options: { type: [Boolean, Object], default: void 0 },
12
+ loading: { type: Boolean },
13
+ search: { type: [Boolean, Object] },
14
+ searchValue: {},
15
+ multipleLine: { type: Boolean },
16
+ disabled: { type: Boolean },
17
+ fullscreenTarget: {},
18
+ columnSettings: {},
19
+ locale: {},
20
+ ui: {},
21
+ class: {}
22
+ },
23
+ emits: ["update:columns", "update:size", "reset", "reload", "update:searchValue", "search", "clearSearch", "fullscreenChange", "fullscreenError"],
24
+ setup(i, { emit: u }) {
25
+ const p = i, l = u;
26
+ function v(s) {
27
+ return s;
28
+ }
29
+ return (s, o) => (f(), d($(g), y({ ...s.$attrs, ...p }, {
30
+ "onUpdate:columns": o[0] || (o[0] = (e) => l("update:columns", e)),
31
+ "onUpdate:size": o[1] || (o[1] = (e) => l("update:size", e)),
32
+ onReset: o[2] || (o[2] = (e) => l("reset")),
33
+ onReload: o[3] || (o[3] = (e) => l("reload")),
34
+ "onUpdate:searchValue": o[4] || (o[4] = (e) => l("update:searchValue", e)),
35
+ onSearch: o[5] || (o[5] = (e) => l("search", e)),
36
+ onClearSearch: o[6] || (o[6] = (e) => l("clearSearch")),
37
+ onFullscreenChange: o[7] || (o[7] = (e) => l("fullscreenChange", e)),
38
+ onFullscreenError: o[8] || (o[8] = (e) => l("fullscreenError", e))
39
+ }), b({ _: 2 }, [
40
+ s.$slots.title ? {
41
+ name: "title",
42
+ fn: t((e) => [
43
+ n(s.$slots, "title", r(a(
44
+ e
45
+ )))
46
+ ]),
47
+ key: "0"
48
+ } : void 0,
49
+ s.$slots.actions ? {
50
+ name: "actions",
51
+ fn: t((e) => [
52
+ n(s.$slots, "actions", r(a(
53
+ e
54
+ )))
55
+ ]),
56
+ key: "1"
57
+ } : void 0,
58
+ s.$slots.settings ? {
59
+ name: "settings",
60
+ fn: t((e) => [
61
+ n(s.$slots, "settings", r(a(
62
+ e
63
+ )))
64
+ ]),
65
+ key: "2"
66
+ } : void 0,
67
+ s.$slots.columnLabel ? {
68
+ name: "columnLabel",
69
+ fn: t((e) => [
70
+ n(s.$slots, "columnLabel", r(a(
71
+ e
72
+ )))
73
+ ]),
74
+ key: "3"
75
+ } : void 0,
76
+ s.$slots.search ? {
77
+ name: "search",
78
+ fn: t((e) => [
79
+ n(s.$slots, "search", r(a(
80
+ e
81
+ )))
82
+ ]),
83
+ key: "4"
84
+ } : void 0,
85
+ s.$slots.filter ? {
86
+ name: "filter",
87
+ fn: t((e) => [
88
+ n(s.$slots, "filter", r(a(
89
+ e
90
+ )))
91
+ ]),
92
+ key: "5"
93
+ } : void 0,
94
+ s.$slots.extra ? {
95
+ name: "extra",
96
+ fn: t((e) => [
97
+ n(s.$slots, "extra", r(a(
98
+ e
99
+ )))
100
+ ]),
101
+ key: "6"
102
+ } : void 0
103
+ ]), 1040));
104
+ }
105
+ });
106
+ export {
107
+ S as default
108
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./VTableToolbar.vue.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,32 @@
1
+ import { MaybeRefOrGetter } from 'vue';
2
+ import { ColumnsType } from '../types';
3
+ export interface TableColumnStateValue {
4
+ visible?: boolean;
5
+ /** Pinning and ordering belong to top-level columns/groups. */
6
+ fixed?: 'left' | 'right' | false;
7
+ order?: number;
8
+ }
9
+ /** Keys are the stable column paths returned by this helper's state. */
10
+ export type TableColumnState = Record<string, TableColumnStateValue>;
11
+ export interface UseColumnStateOptions {
12
+ defaultValue?: TableColumnState;
13
+ storageKey?: string;
14
+ storageType?: 'localStorage' | 'sessionStorage';
15
+ version?: string | number;
16
+ /** Optional application storage adapter. Only serializable state is stored. */
17
+ storage?: Pick<Storage, 'getItem' | 'setItem' | 'removeItem'>;
18
+ onError?: (error: unknown) => void;
19
+ }
20
+ /**
21
+ * Compose controlled columns with serializable preferences. The source owns column definitions;
22
+ * assigning columns records preferences without serializing or replacing renderers and sorters.
23
+ */
24
+ export declare function useColumnState<T extends object>(source: MaybeRefOrGetter<ColumnsType<T>>, options?: UseColumnStateOptions): {
25
+ columns: import('vue').WritableComputedRef<ColumnsType<T>, ColumnsType<T>>;
26
+ state: import('vue').ComputedRef<TableColumnState>;
27
+ setState: (value: TableColumnState) => void;
28
+ reset: () => void;
29
+ restore: () => void;
30
+ save: () => void;
31
+ };
32
+ //# sourceMappingURL=useColumnState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useColumnState.d.ts","sourceRoot":"","sources":["../../../../../table/src/composables/useColumnState.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,gBAAgB,EACtB,MAAM,KAAK,CAAA;AACZ,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAW3C,MAAM,WAAW,qBAAqB;IACpC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,+DAA+D;IAC/D,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,KAAK,CAAA;IAChC,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,wEAAwE;AACxE,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAA;AAEpE,MAAM,WAAW,qBAAqB;IACpC,YAAY,CAAC,EAAE,gBAAgB,CAAA;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,WAAW,CAAC,EAAE,cAAc,GAAG,gBAAgB,CAAA;IAC/C,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACzB,+EAA+E;IAC/E,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS,GAAG,SAAS,GAAG,YAAY,CAAC,CAAA;IAC7D,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAA;CACnC;AAqCD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,MAAM,EAC7C,MAAM,EAAE,gBAAgB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EACxC,OAAO,GAAE,qBAA0B;;;sBAyFV,gBAAgB;;;;EAY1C"}
@@ -0,0 +1,107 @@
1
+ import { shallowRef as k, watch as j, toValue as p, computed as O, getCurrentInstance as N, onMounted as D } from "vue";
2
+ import { settingsEntries as g, columnFixedRegion as m, setColumnFixed as F, isColumnSettingDisabled as J, moveSettingColumn as M, setColumnVisibility as R } from "../utils/columnSettings.mjs";
3
+ function S(u) {
4
+ const e = {};
5
+ function s(f, i = !1) {
6
+ f.forEach((c, l) => {
7
+ const d = m(c.column);
8
+ e[c.id] = {
9
+ visible: c.column.visible !== !1,
10
+ ...!i && d !== "mixed" ? { fixed: d ?? !1, order: l } : {}
11
+ }, s(c.children, !0);
12
+ });
13
+ }
14
+ return s(g(u)), e;
15
+ }
16
+ function a(u) {
17
+ const e = {};
18
+ if (!u || typeof u != "object" || Array.isArray(u)) return e;
19
+ for (const [s, f] of Object.entries(u)) {
20
+ if (!s.startsWith("/") || !f || typeof f != "object" || Array.isArray(f)) continue;
21
+ const i = f;
22
+ e[s] = {
23
+ ...typeof i.visible == "boolean" ? { visible: i.visible } : {},
24
+ ...i.fixed === !1 || i.fixed === "left" || i.fixed === "right" ? { fixed: i.fixed } : {},
25
+ ...typeof i.order == "number" && Number.isSafeInteger(i.order) && i.order >= 0 ? { order: i.order } : {}
26
+ };
27
+ }
28
+ return e;
29
+ }
30
+ function q(u, e = {}) {
31
+ const s = k(a(e.defaultValue)), f = {};
32
+ j(
33
+ () => S(p(u)),
34
+ (t) => {
35
+ for (const [r, b] of Object.entries(t))
36
+ r in f || (f[r] = b);
37
+ },
38
+ { immediate: !0, deep: !0, flush: "sync" }
39
+ );
40
+ function i(t) {
41
+ let r = p(u);
42
+ const b = g(r);
43
+ for (const n of b) {
44
+ const o = t[n.id];
45
+ n.column.hideInSetting || !o || o.fixed === void 0 || m(n.column) !== (o.fixed || void 0) && (r = F(r, n.id, o.fixed || void 0));
46
+ }
47
+ const x = g(r).filter((n) => !n.column.hideInSetting).sort((n, o) => (t[n.id]?.order ?? 1 / 0) - (t[o.id]?.order ?? 1 / 0));
48
+ for (let n = x.length - 1; n >= 0; n--) {
49
+ const o = x[n], E = g(r), C = m(o.column), K = x.filter(
50
+ (h) => m(h.column) === C
51
+ ), I = E.filter(
52
+ (h) => m(h.column) === C
53
+ )[K.indexOf(o)];
54
+ I && !J(o.column, "order") && (r = M(r, o.id, I.id));
55
+ }
56
+ const w = /* @__PURE__ */ new Map();
57
+ for (const [n, o] of Object.entries(t))
58
+ o.visible !== void 0 && w.set(n, o.visible);
59
+ return R(r, w);
60
+ }
61
+ const c = O({
62
+ get: () => i(s.value),
63
+ set: (t) => {
64
+ s.value = S(t);
65
+ }
66
+ }), l = O(() => S(c.value)), d = () => {
67
+ if (e.storage) return e.storage;
68
+ if (!(typeof window > "u"))
69
+ return window[e.storageType ?? "localStorage"];
70
+ };
71
+ function y() {
72
+ if (e.storageKey)
73
+ try {
74
+ d()?.setItem(
75
+ e.storageKey,
76
+ JSON.stringify({
77
+ version: e.version ?? 1,
78
+ state: l.value
79
+ })
80
+ );
81
+ } catch (t) {
82
+ e.onError?.(t);
83
+ }
84
+ }
85
+ function v() {
86
+ if (e.storageKey)
87
+ try {
88
+ const t = d()?.getItem(e.storageKey);
89
+ if (!t) return;
90
+ const r = JSON.parse(t);
91
+ if (!r || typeof r != "object" || r.version !== (e.version ?? 1)) return;
92
+ s.value = { ...a(e.defaultValue), ...a(r.state) };
93
+ } catch (t) {
94
+ e.onError?.(t);
95
+ }
96
+ }
97
+ function V(t) {
98
+ s.value = a(t);
99
+ }
100
+ function A() {
101
+ s.value = { ...f, ...a(e.defaultValue) }, y();
102
+ }
103
+ return N() ? D(v) : v(), j(l, y, { deep: !0 }), { columns: c, state: l, setState: V, reset: A, restore: v, save: y };
104
+ }
105
+ export {
106
+ q as useColumnState
107
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=useColumnState.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useColumnState.test.d.ts","sourceRoot":"","sources":["../../../../../table/src/composables/useColumnState.test.ts"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"useFilter.d.ts","sourceRoot":"","sources":["../../../../../table/src/composables/useFilter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAI1C,kCAAkC;AAClC,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,EAAE,GAAG,IAAI,CAAC,CAAA;AAEhF,MAAM,WAAW,gBAAgB;IAC/B,oBAAoB;IACpB,OAAO,EAAE,MAAM,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAA;IACpD,aAAa;IACb,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,CAAA;CAClD;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,gBAAgB;+BAwBvC,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,KAC1C,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,EAAE;4BA4DtB,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,UACnC,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,EAAE,KACpC,IAAI;0BAcsB,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,KAAG,IAAI;yBAW7C,aAAa;iBAUnB,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,QAAQ,OAAO,EAAE,KAAG,OAAO,EAAE;EAmBzF"}
1
+ {"version":3,"file":"useFilter.d.ts","sourceRoot":"","sources":["../../../../../table/src/composables/useFilter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAK1C,kCAAkC;AAClC,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,EAAE,GAAG,IAAI,CAAC,CAAA;AAEhF,MAAM,WAAW,gBAAgB;IAC/B,oBAAoB;IACpB,OAAO,EAAE,MAAM,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAA;IACpD,aAAa;IACb,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,CAAA;CAClD;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,gBAAgB;+BAwBvC,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,KAC1C,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,EAAE;4BA4DtB,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,UACnC,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,EAAE,KACpC,IAAI;0BAcsB,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,KAAG,IAAI;yBAW7C,aAAa;iBAUnB,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,QAAQ,OAAO,EAAE,KAAG,OAAO,EAAE;EAuBzF"}
@@ -1,68 +1,71 @@
1
1
  import { computed as k } from "vue";
2
- import { getColumnKey as l } from "./useColumns.mjs";
3
- import { useControlledColumnState as C } from "./useControlledColumnState.mjs";
4
- function w(d) {
5
- const { columns: u, onFilterChange: F } = d, {
2
+ import { getColumnKey as l, getByDataIndex as x } from "./useColumns.mjs";
3
+ import { matchesEnumFilter as C } from "../utils/valueEnum.mjs";
4
+ import { useControlledColumnState as D } from "./useControlledColumnState.mjs";
5
+ function z(d) {
6
+ const { columns: f, onFilterChange: F } = d, {
6
7
  innerState: g,
7
8
  readValue: V,
8
- writeValue: v
9
- } = C({
9
+ writeValue: p
10
+ } = D({
10
11
  controlledValue: (e) => e.filteredValue
11
12
  });
12
- for (const e of u()) {
13
+ for (const e of f()) {
13
14
  const t = l(e);
14
15
  t !== void 0 && e.defaultFilteredValue && (g[String(t)] = [...e.defaultFilteredValue]);
15
16
  }
16
- function f(e) {
17
+ function u(e) {
17
18
  return V(e, []);
18
19
  }
19
- function S(e) {
20
+ function y(e) {
20
21
  return [...e];
21
22
  }
22
23
  const h = k(() => {
23
24
  const e = [];
24
- for (const t of u()) {
25
- if (!t.onFilter) continue;
26
- const r = f(t);
25
+ for (const t of f()) {
26
+ if (t.onFilter === !1 || !t.onFilter && t.filters !== !0) continue;
27
+ const r = u(t);
27
28
  r.length > 0 && e.push({ column: t, values: r });
28
29
  }
29
30
  return e;
30
31
  });
31
- function c(e, t) {
32
+ function a(e, t) {
32
33
  const r = {}, i = e ? l(e) : void 0;
33
- for (const o of u()) {
34
+ for (const o of f()) {
34
35
  const n = l(o);
35
36
  if (n === void 0) continue;
36
- const a = i !== void 0 && String(n) === String(i) && t !== void 0 ? S(t) : f(o);
37
- r[String(n)] = a.length > 0 ? a : null;
37
+ const c = i !== void 0 && String(n) === String(i) && t !== void 0 ? y(t) : u(o);
38
+ r[String(n)] = c.length > 0 ? c : null;
38
39
  }
39
40
  return r;
40
41
  }
41
42
  function s(e, t) {
42
- l(e) !== void 0 && (v(e, t.length === 0 ? void 0 : [...t]), F?.(c(e, t)));
43
+ l(e) !== void 0 && (p(e, t.length === 0 ? void 0 : [...t]), F?.(a(e, t)));
43
44
  }
44
45
  function m(e) {
45
46
  e.filterResetToDefaultFilteredValue && e.defaultFilteredValue ? s(e, [...e.defaultFilteredValue]) : s(e, []);
46
47
  }
47
- function p() {
48
- return c();
48
+ function v() {
49
+ return a();
49
50
  }
50
- function y(e) {
51
+ function S(e) {
51
52
  const t = h.value;
52
53
  return t.length === 0 ? e : e.filter(
53
54
  (r) => t.every(
54
- ({ column: i, values: o }) => o.some((n) => i.onFilter(n, r))
55
+ ({ column: i, values: o }) => o.some(
56
+ (n) => typeof i.onFilter == "function" ? i.onFilter(n, r) : C(i, n, x(r, i.dataIndex))
57
+ )
55
58
  )
56
59
  );
57
60
  }
58
61
  return {
59
- getFilteredValue: f,
62
+ getFilteredValue: u,
60
63
  confirmFilter: s,
61
64
  resetFilter: m,
62
- getAllFilters: p,
63
- filterData: y
65
+ getAllFilters: v,
66
+ filterData: S
64
67
  };
65
68
  }
66
69
  export {
67
- w as useFilter
70
+ z as useFilter
68
71
  };
@@ -3,6 +3,7 @@ export declare function positiveInteger(value: unknown, fallback: number): numbe
3
3
  export declare function usePagination<T>(options: {
4
4
  pagination: () => false | TablePaginationConfig | undefined;
5
5
  data: () => T[];
6
+ manual?: () => boolean;
6
7
  onChange: (state: TablePaginationState) => void;
7
8
  }): {
8
9
  enabled: import('vue').ComputedRef<boolean>;
@@ -1 +1 @@
1
- {"version":3,"file":"usePagination.d.ts","sourceRoot":"","sources":["../../../../../table/src/composables/usePagination.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAEtF,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAExE;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,OAAO,EAAE;IACxC,UAAU,EAAE,MAAM,KAAK,GAAG,qBAAqB,GAAG,SAAS,CAAA;IAC3D,IAAI,EAAE,MAAM,CAAC,EAAE,CAAA;IACf,QAAQ,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,CAAA;CAChD;;;;;sBAsE0B,MAAM;0BAeJ,oBAAoB,GAAG,SAAS;EAQ5D"}
1
+ {"version":3,"file":"usePagination.d.ts","sourceRoot":"","sources":["../../../../../table/src/composables/usePagination.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAEtF,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAExE;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,OAAO,EAAE;IACxC,UAAU,EAAE,MAAM,KAAK,GAAG,qBAAqB,GAAG,SAAS,CAAA;IAC3D,IAAI,EAAE,MAAM,CAAC,EAAE,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,OAAO,CAAA;IACtB,QAAQ,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,CAAA;CAChD;;;;;sBA4E0B,MAAM;0BAeJ,oBAAoB,GAAG,SAAS;EAQ5D"}
@@ -1,65 +1,66 @@
1
- import { computed as g, ref as p, watch as f } from "vue";
2
- function o(r, u) {
3
- return typeof r == "number" && Number.isSafeInteger(r) && r > 0 ? r : u;
1
+ import { computed as f, ref as h, watch as s } from "vue";
2
+ function c(u, r) {
3
+ return typeof u == "number" && Number.isSafeInteger(u) && u > 0 ? u : r;
4
4
  }
5
- function C(r) {
6
- const u = g(() => !!r.pagination()), l = g(() => r.pagination() || {}), c = p(1), v = p(10);
7
- let d = !1;
8
- f(
9
- u,
5
+ function x(u) {
6
+ const r = f(() => !!u.pagination()), l = f(() => u.pagination() || {}), o = h(1), v = h(10);
7
+ let m = !1;
8
+ s(
9
+ r,
10
10
  (e) => {
11
- !e || d || (d = !0, v.value = o(l.value.defaultPageSize, 10), c.value = o(l.value.defaultCurrent, 1));
11
+ !e || m || (m = !0, v.value = c(l.value.defaultPageSize, 10), o.value = c(l.value.defaultCurrent, 1));
12
12
  },
13
13
  { immediate: !0, flush: "sync" }
14
14
  );
15
- const i = g(() => {
16
- const e = l.value, n = o(e.pageSize, v.value), t = o(e.total, r.data().length);
15
+ const i = f(() => {
16
+ const e = l.value, n = c(e.pageSize, v.value), t = u.manual?.() && typeof e.total == "number" && Number.isSafeInteger(e.total) && e.total >= 0 ? e.total : c(e.total, u.data().length);
17
17
  return { current: Math.min(
18
- o(e.current, c.value),
18
+ c(e.current, o.value),
19
19
  Math.max(1, Math.ceil(t / n))
20
20
  ), pageSize: n, total: t };
21
21
  });
22
- f(
22
+ s(
23
23
  () => i.value.current,
24
24
  (e) => {
25
- u.value && l.value.current === void 0 && (c.value = e);
25
+ r.value && l.value.current === void 0 && (o.value = e);
26
26
  },
27
27
  { flush: "sync" }
28
28
  );
29
- const m = g(() => {
30
- const e = r.data();
31
- if (!u.value) return e;
29
+ const p = f(() => {
30
+ const e = u.data();
31
+ if (!r.value || u.manual?.()) return e;
32
32
  const { current: n, pageSize: t, total: a } = i.value;
33
33
  return e.length < a && e.length <= t ? e : e.slice((n - 1) * t, n * t);
34
34
  });
35
- f(
36
- () => [u.value, r.data().length, i.value.total, i.value.pageSize],
35
+ s(
36
+ () => [r.value, u.data().length, i.value.total, i.value.pageSize],
37
37
  ([e, n, t, a]) => {
38
+ e && !u.manual?.() && n < t && n > a;
38
39
  },
39
40
  { immediate: !0 }
40
41
  );
41
- function h(e, n, t) {
42
+ function d(e, n, t) {
42
43
  const a = l.value;
43
- a.current === void 0 && (c.value = e), a.pageSize === void 0 && (v.value = n), a["onUpdate:current"]?.(e), t && (a["onUpdate:pageSize"]?.(n), a.onShowSizeChange?.(e, n)), a.onChange?.(e, n);
44
+ a.current === void 0 && (o.value = e), a.pageSize === void 0 && (v.value = n), a["onUpdate:current"]?.(e), t && (a["onUpdate:pageSize"]?.(n), a.onShowSizeChange?.(e, n)), a.onChange?.(e, n);
44
45
  }
45
- function z(e, n = i.value.pageSize) {
46
- if (!u.value || l.value.disabled) return;
47
- const t = i.value, a = o(n, t.pageSize), s = Math.min(
48
- o(e, t.current),
46
+ function S(e, n = i.value.pageSize) {
47
+ if (!r.value || l.value.disabled) return;
48
+ const t = i.value, a = c(n, t.pageSize), g = Math.min(
49
+ c(e, t.current),
49
50
  Math.max(1, Math.ceil(t.total / a))
50
51
  );
51
- if (s === t.current && a === t.pageSize) return;
52
- const M = { current: s, pageSize: a, total: t.total };
53
- h(s, a, a !== t.pageSize), r.onChange(M);
52
+ if (g === t.current && a === t.pageSize) return;
53
+ const b = { current: g, pageSize: a, total: t.total };
54
+ d(g, a, a !== t.pageSize), u.onChange(b);
54
55
  }
55
- function S() {
56
- if (!u.value) return;
56
+ function z() {
57
+ if (!r.value) return;
57
58
  const e = { ...i.value, current: 1 };
58
- return h(1, e.pageSize, !1), e;
59
+ return d(1, e.pageSize, !1), e;
59
60
  }
60
- return { enabled: u, config: l, state: i, pageData: m, change: z, resetForFilter: S };
61
+ return { enabled: r, config: l, state: i, pageData: p, change: S, resetForFilter: z };
61
62
  }
62
63
  export {
63
- o as positiveInteger,
64
- C as usePagination
64
+ c as positiveInteger,
65
+ x as usePagination
65
66
  };