@mantine-vue/table 3.0.0 → 3.2.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 (134) hide show
  1. package/cjs/index.cjs +5966 -2889
  2. package/cjs/index.cjs.map +1 -1
  3. package/esm/index.mjs +5884 -2833
  4. package/esm/index.mjs.map +1 -1
  5. package/lib/components/MVT_TableSlots.d.ts +28 -0
  6. package/lib/components/MantineVueTable.vue.d.ts +14 -0
  7. package/lib/components/body/MVT_TableBody.vue.d.ts +9 -0
  8. package/lib/components/body/MVT_TableBodyCell.vue.d.ts +14 -0
  9. package/lib/components/body/MVT_TableBodyCellValue.vue.d.ts +14 -0
  10. package/lib/components/body/MVT_TableBodyEmptyRow.vue.d.ts +10 -0
  11. package/lib/components/body/MVT_TableBodyRow.vue.d.ts +31 -0
  12. package/lib/components/body/MVT_TableBodyRowGrabHandle.vue.d.ts +10 -0
  13. package/lib/components/body/MVT_TableBodyRowPinButton.vue.d.ts +8 -0
  14. package/lib/components/body/MVT_TableDetailPanel.vue.d.ts +14 -0
  15. package/lib/components/buttons/MVT_ColumnPinningButtons.vue.d.ts +8 -0
  16. package/lib/components/buttons/MVT_CopyButton.vue.d.ts +17 -0
  17. package/lib/components/buttons/MVT_EditActionButtons.vue.d.ts +9 -0
  18. package/lib/components/buttons/MVT_ExpandAllButton.vue.d.ts +19 -0
  19. package/lib/components/buttons/MVT_ExpandButton.vue.d.ts +20 -0
  20. package/lib/components/buttons/MVT_GrabHandleButton.vue.d.ts +21 -0
  21. package/lib/components/buttons/MVT_RowPinButton.vue.d.ts +9 -0
  22. package/lib/components/buttons/MVT_ShowHideColumnsButton.vue.d.ts +7 -0
  23. package/lib/components/buttons/MVT_ToggleDensePaddingButton.vue.d.ts +8 -0
  24. package/lib/components/buttons/MVT_ToggleFiltersButton.vue.d.ts +7 -0
  25. package/lib/components/buttons/MVT_ToggleFullScreenButton.vue.d.ts +7 -0
  26. package/lib/components/buttons/MVT_ToggleGlobalFilterButton.vue.d.ts +7 -0
  27. package/lib/components/buttons/MVT_ToggleRowActionMenuButton.vue.d.ts +22 -0
  28. package/lib/components/footer/MVT_TableFooter.vue.d.ts +8 -0
  29. package/lib/components/footer/MVT_TableFooterCell.vue.d.ts +9 -0
  30. package/lib/components/footer/MVT_TableFooterRow.vue.d.ts +9 -0
  31. package/lib/components/head/MVT_TableHead.vue.d.ts +8 -0
  32. package/lib/components/head/MVT_TableHeadCell.vue.d.ts +10 -0
  33. package/lib/components/head/MVT_TableHeadCellFilterContainer.vue.d.ts +21 -0
  34. package/lib/components/head/MVT_TableHeadCellFilterLabel.vue.d.ts +8 -0
  35. package/lib/components/head/MVT_TableHeadCellGrabHandle.vue.d.ts +10 -0
  36. package/lib/components/head/MVT_TableHeadCellResizeHandle.vue.d.ts +8 -0
  37. package/lib/components/head/MVT_TableHeadCellSortLabel.vue.d.ts +8 -0
  38. package/lib/components/head/MVT_TableHeadRow.vue.d.ts +9 -0
  39. package/lib/components/inputs/MVT_EditCellTextInput.vue.d.ts +22 -0
  40. package/lib/components/inputs/MVT_FilterCheckbox.vue.d.ts +8 -0
  41. package/lib/components/inputs/MVT_FilterRangeFields.vue.d.ts +8 -0
  42. package/lib/components/inputs/MVT_FilterRangeSlider.vue.d.ts +8 -0
  43. package/lib/components/inputs/MVT_FilterTextInput.vue.d.ts +23 -0
  44. package/lib/components/inputs/MVT_GlobalFilterTextInput.vue.d.ts +7 -0
  45. package/lib/components/inputs/MVT_SelectCheckbox.vue.d.ts +9 -0
  46. package/lib/components/menus/MVT_ColumnActionMenu.vue.d.ts +24 -0
  47. package/lib/components/menus/MVT_FilterOptionMenu.vue.d.ts +26 -0
  48. package/lib/components/menus/MVT_RowActionMenu.vue.d.ts +21 -0
  49. package/lib/components/menus/MVT_ShowHideColumnsMenu.vue.d.ts +7 -0
  50. package/lib/components/menus/MVT_ShowHideColumnsMenuItems.vue.d.ts +15 -0
  51. package/lib/components/modals/MVT_EditRowModal.vue.d.ts +36 -0
  52. package/lib/components/table/MVT_Table.vue.d.ts +7 -0
  53. package/lib/components/table/MVT_TableContainer.vue.d.ts +7 -0
  54. package/lib/components/table/MVT_TablePaper.vue.d.ts +7 -0
  55. package/lib/components/toolbar/MVT_BottomToolbar.vue.d.ts +7 -0
  56. package/lib/components/toolbar/MVT_ProgressBar.vue.d.ts +8 -0
  57. package/lib/components/toolbar/MVT_TablePagination.vue.d.ts +10 -0
  58. package/lib/components/toolbar/MVT_ToolbarAlertBanner.vue.d.ts +22 -0
  59. package/lib/components/toolbar/MVT_ToolbarDropZone.vue.d.ts +7 -0
  60. package/lib/components/toolbar/MVT_ToolbarInternalButtons.vue.d.ts +7 -0
  61. package/lib/components/toolbar/MVT_TopToolbar.vue.d.ts +7 -0
  62. package/lib/index.d.mts +63 -56
  63. package/lib/index.d.ts +63 -56
  64. package/lib/server-grouping/MVT_ServerGroupingBody.vue.d.ts +66 -0
  65. package/lib/server-grouping/MVT_ServerGroupingGroupBy.vue.d.ts +31 -0
  66. package/lib/server-grouping/createServerGroupingProvider.d.ts +39 -0
  67. package/lib/server-grouping/serverGrouping.types.d.ts +494 -0
  68. package/lib/server-grouping/serverGrouping.utils.d.ts +31 -0
  69. package/lib/server-grouping/serverGroupingSelection.d.ts +65 -0
  70. package/lib/server-grouping/useMVT_ServerGrouping.d.ts +50 -0
  71. package/lib/types.d.ts +36 -2
  72. package/lib/utils/renderable.d.ts +39 -0
  73. package/lib/utils/style.utils.d.ts +12 -0
  74. package/locales/en.cjs +11 -0
  75. package/locales/en.mjs +11 -0
  76. package/package.json +4 -4
  77. package/styles.css +60 -0
  78. package/styles.layer.css +60 -0
  79. package/lib/components/MantineVueTable.d.ts +0 -18
  80. package/lib/components/body/MVT_TableBody.d.ts +0 -64
  81. package/lib/components/body/MVT_TableBodyCell.d.ts +0 -136
  82. package/lib/components/body/MVT_TableBodyCellValue.d.ts +0 -40
  83. package/lib/components/body/MVT_TableBodyEmptyRow.d.ts +0 -42
  84. package/lib/components/body/MVT_TableBodyRow.d.ts +0 -170
  85. package/lib/components/body/MVT_TableBodyRowGrabHandle.d.ts +0 -31
  86. package/lib/components/body/MVT_TableBodyRowPinButton.d.ts +0 -23
  87. package/lib/components/body/MVT_TableDetailPanel.d.ts +0 -68
  88. package/lib/components/buttons/MVT_ColumnPinningButtons.d.ts +0 -23
  89. package/lib/components/buttons/MVT_CopyButton.d.ts +0 -23
  90. package/lib/components/buttons/MVT_EditActionButtons.d.ts +0 -33
  91. package/lib/components/buttons/MVT_ExpandAllButton.d.ts +0 -15
  92. package/lib/components/buttons/MVT_ExpandButton.d.ts +0 -23
  93. package/lib/components/buttons/MVT_GrabHandleButton.d.ts +0 -41
  94. package/lib/components/buttons/MVT_RowPinButton.d.ts +0 -31
  95. package/lib/components/buttons/MVT_ShowHideColumnsButton.d.ts +0 -15
  96. package/lib/components/buttons/MVT_ToggleDensePaddingButton.d.ts +0 -15
  97. package/lib/components/buttons/MVT_ToggleFiltersButton.d.ts +0 -15
  98. package/lib/components/buttons/MVT_ToggleFullScreenButton.d.ts +0 -15
  99. package/lib/components/buttons/MVT_ToggleGlobalFilterButton.d.ts +0 -15
  100. package/lib/components/buttons/MVT_ToggleRowActionMenuButton.d.ts +0 -31
  101. package/lib/components/footer/MVT_TableFooter.d.ts +0 -25
  102. package/lib/components/footer/MVT_TableFooterCell.d.ts +0 -33
  103. package/lib/components/footer/MVT_TableFooterRow.d.ts +0 -33
  104. package/lib/components/head/MVT_TableHead.d.ts +0 -25
  105. package/lib/components/head/MVT_TableHeadCell.d.ts +0 -42
  106. package/lib/components/head/MVT_TableHeadCellFilterContainer.d.ts +0 -23
  107. package/lib/components/head/MVT_TableHeadCellFilterLabel.d.ts +0 -23
  108. package/lib/components/head/MVT_TableHeadCellGrabHandle.d.ts +0 -31
  109. package/lib/components/head/MVT_TableHeadCellResizeHandle.d.ts +0 -23
  110. package/lib/components/head/MVT_TableHeadCellSortLabel.d.ts +0 -23
  111. package/lib/components/head/MVT_TableHeadRow.d.ts +0 -33
  112. package/lib/components/inputs/MVT_EditCellTextInput.d.ts +0 -23
  113. package/lib/components/inputs/MVT_FilterCheckbox.d.ts +0 -23
  114. package/lib/components/inputs/MVT_FilterRangeFields.d.ts +0 -23
  115. package/lib/components/inputs/MVT_FilterRangeSlider.d.ts +0 -23
  116. package/lib/components/inputs/MVT_FilterTextInput.d.ts +0 -33
  117. package/lib/components/inputs/MVT_GlobalFilterTextInput.d.ts +0 -15
  118. package/lib/components/inputs/MVT_SelectCheckbox.d.ts +0 -34
  119. package/lib/components/menus/MVT_ColumnActionMenu.d.ts +0 -42
  120. package/lib/components/menus/MVT_FilterOptionMenu.d.ts +0 -35
  121. package/lib/components/menus/MVT_RowActionMenu.d.ts +0 -31
  122. package/lib/components/menus/MVT_ShowHideColumnsMenu.d.ts +0 -15
  123. package/lib/components/menus/MVT_ShowHideColumnsMenuItems.d.ts +0 -54
  124. package/lib/components/modals/MVT_EditRowModal.d.ts +0 -29
  125. package/lib/components/table/MVT_Table.d.ts +0 -15
  126. package/lib/components/table/MVT_TableContainer.d.ts +0 -15
  127. package/lib/components/table/MVT_TablePaper.d.ts +0 -15
  128. package/lib/components/toolbar/MVT_BottomToolbar.d.ts +0 -15
  129. package/lib/components/toolbar/MVT_ProgressBar.d.ts +0 -23
  130. package/lib/components/toolbar/MVT_TablePagination.d.ts +0 -25
  131. package/lib/components/toolbar/MVT_ToolbarAlertBanner.d.ts +0 -25
  132. package/lib/components/toolbar/MVT_ToolbarDropZone.d.ts +0 -15
  133. package/lib/components/toolbar/MVT_ToolbarInternalButtons.d.ts +0 -15
  134. package/lib/components/toolbar/MVT_TopToolbar.d.ts +0 -15
@@ -0,0 +1,50 @@
1
+ import type { MVT_ColumnFiltersState, MVT_Row, MVT_RowData, MVT_SortingState, MVT_TableInstance, MVT_Updater } from '../types';
2
+ import { type MVT_ServerGroupNode, type MVT_ServerGroupPathId, type MVT_ServerGroupPathItem, type MVT_ServerGroupingExpandedState, type MVT_ServerGroupingOptions, type MVT_ServerGroupingPathState, type MVT_ServerGroupingSelectAllState, type MVT_ServerGroupingState, type MVT_ServerPageState } from './serverGrouping.types';
3
+ /**
4
+ * Internal server-grouping engine. Owns per-path query state (pagination,
5
+ * sorting, filters, loading, errors), lazy loading, request cancellation,
6
+ * stale-response protection, the optional cache, and expansion state.
7
+ *
8
+ * Created by `useMVT_TableInstance` when `serverGrouping.provider` is set; the
9
+ * public surface is exposed through the `table.*ServerGrouping*` instance
10
+ * methods and the `<MantineVueTable>` built-in rendering.
11
+ */
12
+ export interface MVT_ServerGroupingManager<TData extends MVT_RowData = MVT_RowData> {
13
+ options: MVT_ServerGroupingOptions<TData, any, any, any>;
14
+ getGroupingFields: () => string[];
15
+ getExpanded: () => MVT_ServerGroupingExpandedState;
16
+ setExpanded: (updater: MVT_Updater<MVT_ServerGroupingExpandedState>) => void;
17
+ /** "All matching records" (exclude-mode) selection state. */
18
+ getSelectAll: () => MVT_ServerGroupingSelectAllState;
19
+ setSelectAll: (updater: MVT_Updater<MVT_ServerGroupingSelectAllState>) => void;
20
+ isExpanded: (pathId: MVT_ServerGroupPathId) => boolean;
21
+ getState: () => MVT_ServerGroupingState<TData>;
22
+ getPathState: (pathId: MVT_ServerGroupPathId) => MVT_ServerGroupingPathState<TData> | undefined;
23
+ /** Table rows of one loaded record page (created once, cached per page). */
24
+ getRecordRows: (pathId: MVT_ServerGroupPathId) => MVT_Row<TData>[];
25
+ /** All loaded record rows inside currently expanded groups. */
26
+ getVisibleRecordRows: () => MVT_Row<TData>[];
27
+ getNode: (pathId: MVT_ServerGroupPathId) => MVT_ServerGroupNode | undefined;
28
+ getParentItems: (pathId: MVT_ServerGroupPathId) => MVT_ServerGroupPathItem[];
29
+ expand: (pathId: MVT_ServerGroupPathId) => void;
30
+ collapse: (pathId: MVT_ServerGroupPathId) => void;
31
+ toggle: (pathId: MVT_ServerGroupPathId) => void;
32
+ ensureLoaded: (pathId: MVT_ServerGroupPathId) => void;
33
+ reload: (pathId?: MVT_ServerGroupPathId) => void;
34
+ invalidate: (pathId?: MVT_ServerGroupPathId) => void;
35
+ retry: (pathId: MVT_ServerGroupPathId) => void;
36
+ reset: () => void;
37
+ setPagination: (pathId: MVT_ServerGroupPathId, updater: ((prev: MVT_ServerPageState) => MVT_ServerPageState) | Partial<MVT_ServerPageState>) => void;
38
+ setSorting: (pathId: MVT_ServerGroupPathId, updater: MVT_Updater<MVT_SortingState>) => void;
39
+ setColumnFilters: (pathId: MVT_ServerGroupPathId, updater: MVT_Updater<MVT_ColumnFiltersState>) => void;
40
+ setGlobalFilter: (pathId: MVT_ServerGroupPathId, value: unknown) => void;
41
+ }
42
+ export declare const createMVT_ServerGroupingManager: <TData extends MVT_RowData>(table: MVT_TableInstance<TData>,
43
+ /**
44
+ * Reader for the user-controlled `state.serverGroupingExpanded` slice.
45
+ * Injected by `useMVT_TableInstance` to avoid reading back the merged state
46
+ * object (which would recurse); defaults to reading `table.options.state`.
47
+ */
48
+ controlledExpandedReader?: () => MVT_ServerGroupingExpandedState | undefined,
49
+ /** Same, for the controlled `state.serverGroupingSelectAll` slice. */
50
+ controlledSelectAllReader?: () => MVT_ServerGroupingSelectAllState | undefined) => MVT_ServerGroupingManager<TData> | undefined;
package/lib/types.d.ts CHANGED
@@ -6,6 +6,7 @@ import { type MVT_AggregationFns } from './fns/aggregationFns';
6
6
  import { type MVT_FilterFns } from './fns/filterFns';
7
7
  import { type MVT_SortingFns } from './fns/sortingFns';
8
8
  import { type MVT_Icons } from './icons';
9
+ import type { MVT_ColumnServerGroupingOptions, MVT_ServerGroupingExpandedState, MVT_ServerGroupingOptions, MVT_ServerGroupingSelectAllState, MVT_ServerGroupingTableApi } from './server-grouping/serverGrouping.types';
9
10
  export type { MVT_Icons };
10
11
  /**
11
12
  * A Vue renderable node. Used for
@@ -120,6 +121,31 @@ export interface MVT_Localization {
120
121
  goToNextPage: string;
121
122
  goToPreviousPage: string;
122
123
  grab: string;
124
+ /** Optional (falls back to English) shown while a server-grouping level loads. */
125
+ loading?: string;
126
+ /** Optional (falls back to English) server-grouping load failure message. */
127
+ errorLoadingData?: string;
128
+ /** Optional (falls back to English) retry button of a failed server-grouping level. */
129
+ retry?: string;
130
+ /** Optional (falls back to English) group-by toolbar button label. */
131
+ groupBy?: string;
132
+ /** Optional (falls back to English) clear-grouping menu action. */
133
+ clearGrouping?: string;
134
+ /** Optional (falls back to English) empty group-by menu message. */
135
+ noGroupableColumns?: string;
136
+ /** Optional (falls back to English) reorder grouping level up. */
137
+ moveUp?: string;
138
+ /** Optional (falls back to English) reorder grouping level down. */
139
+ moveDown?: string;
140
+ /** Optional (falls back to English) select every record matching the filters. */
141
+ selectAllMatching?: string;
142
+ /** Optional (falls back to English) shown while a query selection is active. */
143
+ allMatchingRecordsSelected?: string;
144
+ /**
145
+ * Optional (falls back to English) selection count without a total — used
146
+ * while server grouping is active, where the row count refers to groups.
147
+ */
148
+ selectedCountRowsSelected?: string;
123
149
  groupByColumn: string;
124
150
  groupedBy: string;
125
151
  hideAll: string;
@@ -220,7 +246,9 @@ export type MVT_TableInstance<TData extends MVT_RowData> = {
220
246
  setShowColumnFilters: MVT_SetState<boolean>;
221
247
  setShowGlobalFilter: MVT_SetState<boolean>;
222
248
  setShowToolbarDropZone: MVT_SetState<boolean>;
223
- } & Omit<Table<TData>, 'getAllColumns' | 'getAllFlatColumns' | 'getAllLeafColumns' | 'getBottomRows' | 'getCenterLeafColumns' | 'getCenterRows' | 'getColumn' | 'getExpandedRowModel' | 'getFlatHeaders' | 'getHeaderGroups' | 'getLeftLeafColumns' | 'getPaginationRowModel' | 'getPreFilteredRowModel' | 'getPrePaginationRowModel' | 'getRightLeafColumns' | 'getRowModel' | 'getSelectedRowModel' | 'getState' | 'getTopRows' | 'options'>;
249
+ /** @internal server-grouping engine, present when `serverGrouping.provider` is set */
250
+ _serverGrouping?: unknown;
251
+ } & MVT_ServerGroupingTableApi<TData> & Omit<Table<TData>, 'getAllColumns' | 'getAllFlatColumns' | 'getAllLeafColumns' | 'getBottomRows' | 'getCenterLeafColumns' | 'getCenterRows' | 'getColumn' | 'getExpandedRowModel' | 'getFlatHeaders' | 'getHeaderGroups' | 'getLeftLeafColumns' | 'getPaginationRowModel' | 'getPreFilteredRowModel' | 'getPrePaginationRowModel' | 'getRightLeafColumns' | 'getRowModel' | 'getSelectedRowModel' | 'getState' | 'getTopRows' | 'options'>;
224
252
  export type MVT_DefinedTableOptions<TData extends MVT_RowData> = {
225
253
  icons: MVT_Icons;
226
254
  localization: MVT_Localization;
@@ -242,6 +270,8 @@ export type MVT_TableState<TData extends MVT_RowData> = Prettify<{
242
270
  isFullScreen: boolean;
243
271
  isLoading: boolean;
244
272
  isSaving: boolean;
273
+ serverGroupingExpanded: MVT_ServerGroupingExpandedState;
274
+ serverGroupingSelectAll: MVT_ServerGroupingSelectAllState;
245
275
  showAlertBanner: boolean;
246
276
  showColumnFilters: boolean;
247
277
  showGlobalFilter: boolean;
@@ -250,7 +280,7 @@ export type MVT_TableState<TData extends MVT_RowData> = Prettify<{
250
280
  showSkeletons: boolean;
251
281
  showToolbarDropZone: boolean;
252
282
  } & TableState>;
253
- export type MVT_ColumnDef<TData extends MVT_RowData, TValue = unknown> = {
283
+ export type MVT_ColumnDef<TData extends MVT_RowData, TValue = unknown, TGroup = unknown> = {
254
284
  /**
255
285
  * Either an `accessorKey` or a combination of an `accessorFn` and `id` are required for a data column definition.
256
286
  * Specify a function here to point to the correct property in the data object.
@@ -449,6 +479,7 @@ export type MVT_ColumnDef<TData extends MVT_RowData, TValue = unknown> = {
449
479
  onSelectFilterMode: (filterMode: MVT_FilterOption) => void;
450
480
  table: MVT_TableInstance<TData>;
451
481
  }) => MVT_Node;
482
+ serverGrouping?: MVT_ColumnServerGroupingOptions<TGroup>;
452
483
  sortingFn?: MVT_SortingFn<TData>;
453
484
  visibleInShowHideMenu?: boolean;
454
485
  } & Omit<ColumnDef<TData, TValue>, 'accessorKey' | 'aggregatedCell' | 'aggregationFn' | 'cell' | 'columns' | 'filterFn' | 'footer' | 'header' | 'id' | 'sortingFn'>;
@@ -794,6 +825,8 @@ export type MVT_TableOptions<TData extends MVT_RowData> = {
794
825
  onHoveredColumnChange?: OnChangeFn<null | Partial<MVT_Column<TData>>>;
795
826
  onHoveredRowChange?: OnChangeFn<null | Partial<MVT_Row<TData>>>;
796
827
  onIsFullScreenChange?: OnChangeFn<boolean>;
828
+ onServerGroupingExpandedChange?: OnChangeFn<MVT_ServerGroupingExpandedState>;
829
+ onServerGroupingSelectAllChange?: OnChangeFn<MVT_ServerGroupingSelectAllState>;
797
830
  onShowAlertBannerChange?: OnChangeFn<boolean>;
798
831
  onShowColumnFiltersChange?: OnChangeFn<boolean>;
799
832
  onShowGlobalFilterChange?: OnChangeFn<boolean>;
@@ -880,6 +913,7 @@ export type MVT_TableOptions<TData extends MVT_RowData> = {
880
913
  }) => Partial<VirtualizerOptions<HTMLDivElement, HTMLTableRowElement>>) | Partial<VirtualizerOptions<HTMLDivElement, HTMLTableRowElement>>;
881
914
  selectAllMode?: 'all' | 'page';
882
915
  selectDisplayMode?: 'checkbox' | 'radio' | 'switch';
916
+ serverGrouping?: MVT_ServerGroupingOptions<TData, any, any, any>;
883
917
  /**
884
918
  * Manage state externally any way you want, then pass it back into MVT.
885
919
  */
@@ -0,0 +1,39 @@
1
+ import type { FunctionalComponent, VNodeChild } from 'vue';
2
+ /**
3
+ * Bridges a `renderX` option / scoped slot into a template.
4
+ *
5
+ * These callbacks replace a built-in section only when they actually return a
6
+ * node, so the template has to branch on the *result*. Resolving inside the
7
+ * `v-if` and replaying the cached node keeps the callback running exactly once
8
+ * per render, the way the equivalent render function did:
9
+ *
10
+ * ```vue
11
+ * <script setup lang="ts">
12
+ * const custom = createRenderable(() => table.options.renderThing?.({ table }))
13
+ * </script>
14
+ *
15
+ * <template>
16
+ * <MVT_RenderNode v-if="custom.has()" :node="custom.node" />
17
+ * <DefaultThing v-else />
18
+ * </template>
19
+ * ```
20
+ *
21
+ * `v-if` runs before the bindings beside it, so `node` always holds the value
22
+ * `has()` just resolved.
23
+ */
24
+ export declare const createRenderable: (resolve: () => VNodeChild) => {
25
+ /** Resolves and caches the node for this render. Call from a `v-if`. */
26
+ has: () => boolean;
27
+ /** The node cached by the last `has()` call. */
28
+ readonly node: VNodeChild;
29
+ };
30
+ /**
31
+ * Renders an already-resolved `VNodeChild` passed as a prop.
32
+ *
33
+ * The node has to arrive as a *prop*: a prop-less `<component :is="() => node">`
34
+ * would mount once and never update, because Vue has nothing to diff and skips
35
+ * the re-render.
36
+ */
37
+ export declare const MVT_RenderNode: FunctionalComponent<{
38
+ node?: VNodeChild;
39
+ }>;
@@ -1,6 +1,18 @@
1
+ import { type CSSProperties } from 'vue';
1
2
  import { type MantineTheme } from '@mantine-vue/core';
2
3
  import { type MantineShade } from '../types';
3
4
  export declare const parseCSSVarId: (id: string) => string;
5
+ /**
6
+ * Width/flex styles that bind a cell to its column's live size variables, so
7
+ * custom cells (server-grouping group rows, …) stay aligned with the root
8
+ * table while columns are resized or reordered.
9
+ */
10
+ export declare const getMVT_ColumnWidthStyles: ({ columnId, grow, layoutMode, minSize, }: {
11
+ columnId: string;
12
+ grow?: boolean | number;
13
+ layoutMode?: "grid" | "grid-no-grow" | "semantic";
14
+ minSize?: number;
15
+ }) => CSSProperties;
4
16
  export declare const getPrimaryShade: (theme: MantineTheme) => number;
5
17
  export declare const getPrimaryColor: (theme: MantineTheme, shade?: MantineShade) => string;
6
18
  export declare function dataVariable(name: string, value: boolean | number | string | undefined): {
package/locales/en.cjs CHANGED
@@ -2,12 +2,14 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  //#region src/locales/en.ts
3
3
  var MVT_Localization_EN = {
4
4
  actions: "Actions",
5
+ allMatchingRecordsSelected: "All records matching the current filters are selected",
5
6
  and: "and",
6
7
  cancel: "Cancel",
7
8
  changeFilterMode: "Change filter mode",
8
9
  changeSearchMode: "Change search mode",
9
10
  clearFilter: "Clear filter",
10
11
  clearSearch: "Clear search",
12
+ clearGrouping: "Clear grouping",
11
13
  clearSelection: "Clear selection",
12
14
  clearSort: "Clear sort",
13
15
  clickToCopy: "Click to copy",
@@ -18,6 +20,7 @@ var MVT_Localization_EN = {
18
20
  copiedToClipboard: "Copied to clipboard",
19
21
  dropToGroupBy: "Drop to group by {column}",
20
22
  edit: "Edit",
23
+ errorLoadingData: "Error loading data",
21
24
  expand: "Expand",
22
25
  expandAll: "Expand all",
23
26
  filterArrIncludes: "Includes",
@@ -50,13 +53,18 @@ var MVT_Localization_EN = {
50
53
  goToNextPage: "Go to next page",
51
54
  goToPreviousPage: "Go to previous page",
52
55
  grab: "Grab",
56
+ groupBy: "Group by",
53
57
  groupByColumn: "Group by {column}",
54
58
  groupedBy: "Grouped by ",
55
59
  hideAll: "Hide all",
56
60
  hideColumn: "Hide {column} column",
61
+ loading: "Loading…",
57
62
  max: "Max",
58
63
  min: "Min",
59
64
  move: "Move",
65
+ moveDown: "Move down",
66
+ moveUp: "Move up",
67
+ noGroupableColumns: "No groupable columns",
60
68
  noRecordsToDisplay: "No records to display",
61
69
  noResultsFound: "No results found",
62
70
  of: "of",
@@ -66,6 +74,7 @@ var MVT_Localization_EN = {
66
74
  pinToRight: "Pin to right",
67
75
  resetColumnSize: "Reset column size",
68
76
  resetOrder: "Reset order",
77
+ retry: "Retry",
69
78
  rowActions: "Row Actions",
70
79
  rowNumber: "#",
71
80
  rowNumbers: "Row Numbers",
@@ -73,7 +82,9 @@ var MVT_Localization_EN = {
73
82
  save: "Save",
74
83
  search: "Search",
75
84
  selectedCountOfRowCountRowsSelected: "{selectedCount} of {rowCount} row(s) selected",
85
+ selectedCountRowsSelected: "{selectedCount} row(s) selected",
76
86
  select: "Select",
87
+ selectAllMatching: "Select all matching records",
77
88
  showAll: "Show all",
78
89
  showAllColumns: "Show all columns",
79
90
  showHideColumns: "Show/Hide columns",
package/locales/en.mjs CHANGED
@@ -1,12 +1,14 @@
1
1
  //#region src/locales/en.ts
2
2
  var MVT_Localization_EN = {
3
3
  actions: "Actions",
4
+ allMatchingRecordsSelected: "All records matching the current filters are selected",
4
5
  and: "and",
5
6
  cancel: "Cancel",
6
7
  changeFilterMode: "Change filter mode",
7
8
  changeSearchMode: "Change search mode",
8
9
  clearFilter: "Clear filter",
9
10
  clearSearch: "Clear search",
11
+ clearGrouping: "Clear grouping",
10
12
  clearSelection: "Clear selection",
11
13
  clearSort: "Clear sort",
12
14
  clickToCopy: "Click to copy",
@@ -17,6 +19,7 @@ var MVT_Localization_EN = {
17
19
  copiedToClipboard: "Copied to clipboard",
18
20
  dropToGroupBy: "Drop to group by {column}",
19
21
  edit: "Edit",
22
+ errorLoadingData: "Error loading data",
20
23
  expand: "Expand",
21
24
  expandAll: "Expand all",
22
25
  filterArrIncludes: "Includes",
@@ -49,13 +52,18 @@ var MVT_Localization_EN = {
49
52
  goToNextPage: "Go to next page",
50
53
  goToPreviousPage: "Go to previous page",
51
54
  grab: "Grab",
55
+ groupBy: "Group by",
52
56
  groupByColumn: "Group by {column}",
53
57
  groupedBy: "Grouped by ",
54
58
  hideAll: "Hide all",
55
59
  hideColumn: "Hide {column} column",
60
+ loading: "Loading…",
56
61
  max: "Max",
57
62
  min: "Min",
58
63
  move: "Move",
64
+ moveDown: "Move down",
65
+ moveUp: "Move up",
66
+ noGroupableColumns: "No groupable columns",
59
67
  noRecordsToDisplay: "No records to display",
60
68
  noResultsFound: "No results found",
61
69
  of: "of",
@@ -65,6 +73,7 @@ var MVT_Localization_EN = {
65
73
  pinToRight: "Pin to right",
66
74
  resetColumnSize: "Reset column size",
67
75
  resetOrder: "Reset order",
76
+ retry: "Retry",
68
77
  rowActions: "Row Actions",
69
78
  rowNumber: "#",
70
79
  rowNumbers: "Row Numbers",
@@ -72,7 +81,9 @@ var MVT_Localization_EN = {
72
81
  save: "Save",
73
82
  search: "Search",
74
83
  selectedCountOfRowCountRowsSelected: "{selectedCount} of {rowCount} row(s) selected",
84
+ selectedCountRowsSelected: "{selectedCount} row(s) selected",
75
85
  select: "Select",
86
+ selectAllMatching: "Select all matching records",
76
87
  showAll: "Show all",
77
88
  showAllColumns: "Show all columns",
78
89
  showHideColumns: "Show/Hide columns",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mantine-vue/table",
3
- "version": "3.0.0",
3
+ "version": "3.2.0",
4
4
  "description": "A fully featured Vue 3 implementation of TanStack Vue Table",
5
5
  "keywords": [
6
6
  "data grid",
@@ -65,9 +65,9 @@
65
65
  "vue": "^3.5.0"
66
66
  },
67
67
  "peerDependencies": {
68
- "@mantine-vue/core": "3.0.0",
69
- "@mantine-vue/dates": "3.0.0",
70
- "@mantine-vue/hooks": "3.0.0",
68
+ "@mantine-vue/core": "3.2.0",
69
+ "@mantine-vue/dates": "3.2.0",
70
+ "@mantine-vue/hooks": "3.2.0",
71
71
  "@tabler/icons-vue": ">=3.0.0",
72
72
  "@tanstack/match-sorter-utils": ">=8.7",
73
73
  "@tanstack/vue-table": ">=8.20",
package/styles.css CHANGED
@@ -210,6 +210,66 @@
210
210
  ._paginator-container-alert-banner_1k7ch_33 {
211
211
  position: relative !important;
212
212
  }
213
+ ._group-row_u9zpp_1 {
214
+ background-color: var(--mantine-color-gray-0);
215
+ }
216
+ [data-mantine-color-scheme='dark'] ._group-row_u9zpp_1 {
217
+ background-color: var(--mantine-color-dark-6);
218
+ }
219
+ ._group-row_u9zpp_1 {
220
+ width: 100%;
221
+ }
222
+
223
+ /* grid layout modes (used when column resizing is enabled) */
224
+ ._row-grid_u9zpp_7 {
225
+ display: flex;
226
+ }
227
+
228
+ ._group-cell_u9zpp_11 {
229
+ white-space: nowrap;
230
+ }
231
+
232
+ ._aggregate-cell_u9zpp_15 {
233
+ font-weight: 600;
234
+ }
235
+
236
+ ._expand-spacer_u9zpp_19 {
237
+ display: inline-block;
238
+ width: calc(1.625rem * var(--mantine-scale));
239
+ }
240
+
241
+ ._aux-row_u9zpp_24 {
242
+ background-color: transparent;
243
+ }
244
+
245
+ ._aux-cell_u9zpp_28 {
246
+ padding-block: calc(0.375rem * var(--mantine-scale));
247
+ }
248
+
249
+ ._pagination_u9zpp_32 {
250
+ justify-content: flex-start;
251
+ }
252
+
253
+ ._pagesize_u9zpp_36 {
254
+ width: calc(5rem * var(--mantine-scale));
255
+ }
256
+
257
+ ._groupby-control_u9zpp_40 {
258
+ align-items: center;
259
+ flex-wrap: wrap;
260
+ }
261
+
262
+ ._groupby-active-row_u9zpp_45 {
263
+ display: flex;
264
+ align-items: center;
265
+ gap: calc(0.25rem * var(--mantine-scale));
266
+ padding: calc(0.125rem * var(--mantine-scale)) calc(0.625rem * var(--mantine-scale));
267
+ }
268
+
269
+ ._groupby-active-label_u9zpp_52 {
270
+ flex: 1;
271
+ min-width: calc(5rem * var(--mantine-scale));
272
+ }
213
273
  ._symbol_1b3vj_1 {
214
274
  font-size: var(--mantine-font-size-xl);
215
275
  text-align: center;
package/styles.layer.css CHANGED
@@ -211,6 +211,66 @@
211
211
  ._paginator-container-alert-banner_1k7ch_33 {
212
212
  position: relative !important;
213
213
  }
214
+ ._group-row_u9zpp_1 {
215
+ background-color: var(--mantine-color-gray-0);
216
+ }
217
+ [data-mantine-color-scheme='dark'] ._group-row_u9zpp_1 {
218
+ background-color: var(--mantine-color-dark-6);
219
+ }
220
+ ._group-row_u9zpp_1 {
221
+ width: 100%;
222
+ }
223
+
224
+ /* grid layout modes (used when column resizing is enabled) */
225
+ ._row-grid_u9zpp_7 {
226
+ display: flex;
227
+ }
228
+
229
+ ._group-cell_u9zpp_11 {
230
+ white-space: nowrap;
231
+ }
232
+
233
+ ._aggregate-cell_u9zpp_15 {
234
+ font-weight: 600;
235
+ }
236
+
237
+ ._expand-spacer_u9zpp_19 {
238
+ display: inline-block;
239
+ width: calc(1.625rem * var(--mantine-scale));
240
+ }
241
+
242
+ ._aux-row_u9zpp_24 {
243
+ background-color: transparent;
244
+ }
245
+
246
+ ._aux-cell_u9zpp_28 {
247
+ padding-block: calc(0.375rem * var(--mantine-scale));
248
+ }
249
+
250
+ ._pagination_u9zpp_32 {
251
+ justify-content: flex-start;
252
+ }
253
+
254
+ ._pagesize_u9zpp_36 {
255
+ width: calc(5rem * var(--mantine-scale));
256
+ }
257
+
258
+ ._groupby-control_u9zpp_40 {
259
+ align-items: center;
260
+ flex-wrap: wrap;
261
+ }
262
+
263
+ ._groupby-active-row_u9zpp_45 {
264
+ display: flex;
265
+ align-items: center;
266
+ gap: calc(0.25rem * var(--mantine-scale));
267
+ padding: calc(0.125rem * var(--mantine-scale)) calc(0.625rem * var(--mantine-scale));
268
+ }
269
+
270
+ ._groupby-active-label_u9zpp_52 {
271
+ flex: 1;
272
+ min-width: calc(5rem * var(--mantine-scale));
273
+ }
214
274
  ._symbol_1b3vj_1 {
215
275
  font-size: var(--mantine-font-size-xl);
216
276
  text-align: center;
@@ -1,18 +0,0 @@
1
- import { type PropType, type SlotsType } from 'vue';
2
- import { type MVT_RowData } from '../types';
3
- import { type MVT_TableSlots } from './MVT_TableSlots';
4
- export declare const MantineVueTable: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
5
- table: {
6
- type: PropType<object>;
7
- default: undefined;
8
- };
9
- }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
10
- [key: string]: any;
11
- }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
12
- table: {
13
- type: PropType<object>;
14
- default: undefined;
15
- };
16
- }>> & Readonly<{}>, {
17
- table: object;
18
- }, SlotsType<MVT_TableSlots<MVT_RowData>>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -1,64 +0,0 @@
1
- import { type PropType } from 'vue';
2
- import { type MVT_ColumnVirtualizer, type MVT_RowData, type MVT_TableInstance } from '../../types';
3
- export declare const MVT_TableBody: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
- columnVirtualizer: {
5
- type: PropType<MVT_ColumnVirtualizer>;
6
- default: undefined;
7
- };
8
- table: {
9
- type: PropType<MVT_TableInstance<MVT_RowData>>;
10
- required: true;
11
- };
12
- tableProps: {
13
- type: PropType<Record<string, any>>;
14
- required: true;
15
- };
16
- }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
17
- [key: string]: any;
18
- }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
19
- columnVirtualizer: {
20
- type: PropType<MVT_ColumnVirtualizer>;
21
- default: undefined;
22
- };
23
- table: {
24
- type: PropType<MVT_TableInstance<MVT_RowData>>;
25
- required: true;
26
- };
27
- tableProps: {
28
- type: PropType<Record<string, any>>;
29
- required: true;
30
- };
31
- }>> & Readonly<{}>, {
32
- columnVirtualizer: MVT_ColumnVirtualizer;
33
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
34
- export declare const Memo_MVT_TableBody: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
35
- columnVirtualizer: {
36
- type: PropType<MVT_ColumnVirtualizer>;
37
- default: undefined;
38
- };
39
- table: {
40
- type: PropType<MVT_TableInstance<MVT_RowData>>;
41
- required: true;
42
- };
43
- tableProps: {
44
- type: PropType<Record<string, any>>;
45
- required: true;
46
- };
47
- }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
48
- [key: string]: any;
49
- }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
50
- columnVirtualizer: {
51
- type: PropType<MVT_ColumnVirtualizer>;
52
- default: undefined;
53
- };
54
- table: {
55
- type: PropType<MVT_TableInstance<MVT_RowData>>;
56
- required: true;
57
- };
58
- tableProps: {
59
- type: PropType<Record<string, any>>;
60
- required: true;
61
- };
62
- }>> & Readonly<{}>, {
63
- columnVirtualizer: MVT_ColumnVirtualizer;
64
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;