@toolbox-web/grid-vue 0.7.1 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/features/clipboard.d.ts +0 -19
- package/features/clipboard.d.ts.map +1 -1
- package/features/clipboard.js +1 -3
- package/features/clipboard.js.map +1 -1
- package/features/column-virtualization.d.ts +0 -19
- package/features/column-virtualization.d.ts.map +1 -1
- package/features/column-virtualization.js +1 -3
- package/features/column-virtualization.js.map +1 -1
- package/features/context-menu.d.ts +0 -19
- package/features/context-menu.d.ts.map +1 -1
- package/features/context-menu.js +1 -3
- package/features/context-menu.js.map +1 -1
- package/features/editing.d.ts +0 -19
- package/features/editing.d.ts.map +1 -1
- package/features/editing.js +1 -3
- package/features/editing.js.map +1 -1
- package/features/export.d.ts.map +1 -1
- package/features/export.js +18 -20
- package/features/export.js.map +1 -1
- package/features/filtering.js +4 -4
- package/features/grouping-columns.d.ts +0 -23
- package/features/grouping-columns.d.ts.map +1 -1
- package/features/grouping-columns.js +1 -3
- package/features/grouping-columns.js.map +1 -1
- package/features/grouping-rows.d.ts +0 -22
- package/features/grouping-rows.d.ts.map +1 -1
- package/features/grouping-rows.js +1 -3
- package/features/grouping-rows.js.map +1 -1
- package/features/index.js +20 -21
- package/features/index.js.map +1 -1
- package/features/master-detail.d.ts +0 -22
- package/features/master-detail.d.ts.map +1 -1
- package/features/master-detail.js +1 -3
- package/features/master-detail.js.map +1 -1
- package/features/multi-sort.d.ts +0 -19
- package/features/multi-sort.d.ts.map +1 -1
- package/features/multi-sort.js +1 -4
- package/features/multi-sort.js.map +1 -1
- package/features/pinned-columns.d.ts +0 -22
- package/features/pinned-columns.d.ts.map +1 -1
- package/features/pinned-columns.js +1 -3
- package/features/pinned-columns.js.map +1 -1
- package/features/pinned-rows.d.ts +0 -21
- package/features/pinned-rows.d.ts.map +1 -1
- package/features/pinned-rows.js +1 -3
- package/features/pinned-rows.js.map +1 -1
- package/features/pivot.d.ts +0 -23
- package/features/pivot.d.ts.map +1 -1
- package/features/pivot.js +1 -3
- package/features/pivot.js.map +1 -1
- package/features/print.d.ts.map +1 -1
- package/features/print.js +9 -11
- package/features/print.js.map +1 -1
- package/features/reorder-columns.d.ts +1 -0
- package/features/reorder-columns.d.ts.map +1 -0
- package/features/reorder-columns.js +2 -0
- package/features/reorder-columns.js.map +1 -0
- package/features/reorder-rows.d.ts +1 -0
- package/features/reorder-rows.d.ts.map +1 -0
- package/features/reorder-rows.js +2 -0
- package/features/reorder-rows.js.map +1 -0
- package/features/reorder.d.ts +3 -17
- package/features/reorder.d.ts.map +1 -1
- package/features/reorder.js +1 -3
- package/features/reorder.js.map +1 -1
- package/features/responsive.d.ts +0 -23
- package/features/responsive.d.ts.map +1 -1
- package/features/responsive.js +1 -3
- package/features/responsive.js.map +1 -1
- package/features/row-reorder.d.ts +3 -17
- package/features/row-reorder.d.ts.map +1 -1
- package/features/row-reorder.js +1 -3
- package/features/row-reorder.js.map +1 -1
- package/features/selection.d.ts.map +1 -1
- package/features/selection.js +20 -22
- package/features/selection.js.map +1 -1
- package/features/server-side.d.ts +0 -21
- package/features/server-side.d.ts.map +1 -1
- package/features/server-side.js +1 -3
- package/features/server-side.js.map +1 -1
- package/features/tree.d.ts +0 -22
- package/features/tree.d.ts.map +1 -1
- package/features/tree.js +1 -3
- package/features/tree.js.map +1 -1
- package/features/undo-redo.d.ts.map +1 -1
- package/features/undo-redo.js +10 -12
- package/features/undo-redo.js.map +1 -1
- package/features/visibility.d.ts +0 -19
- package/features/visibility.d.ts.map +1 -1
- package/features/visibility.js +1 -3
- package/features/visibility.js.map +1 -1
- package/index.js +86 -72
- package/index.js.map +1 -1
- package/lib/TbwGrid.vue.d.ts +5 -1
- package/lib/TbwGrid.vue.d.ts.map +1 -1
- package/lib/feature-props.d.ts +12 -4
- package/lib/feature-props.d.ts.map +1 -1
- package/lib/feature-registry.d.ts +6 -51
- package/lib/feature-registry.d.ts.map +1 -1
- package/package.json +1 -1
- package/chunks/feature-registry-BgEOysSJ.js +0 -38
- package/chunks/feature-registry-BgEOysSJ.js.map +0 -1
package/features/pivot.d.ts
CHANGED
|
@@ -1,24 +1 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pivot feature for @toolbox-web/grid-vue
|
|
3
|
-
*
|
|
4
|
-
* Import this module to enable the `pivot` prop on TbwGrid.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* ```vue
|
|
8
|
-
* <script setup>
|
|
9
|
-
* import '@toolbox-web/grid-vue/features/pivot';
|
|
10
|
-
* </script>
|
|
11
|
-
*
|
|
12
|
-
* <template>
|
|
13
|
-
* <TbwGrid :pivot="{
|
|
14
|
-
* rowFields: ['category'],
|
|
15
|
-
* columnFields: ['year'],
|
|
16
|
-
* valueField: 'sales',
|
|
17
|
-
* }" />
|
|
18
|
-
* </template>
|
|
19
|
-
* ```
|
|
20
|
-
*
|
|
21
|
-
* @packageDocumentation
|
|
22
|
-
*/
|
|
23
|
-
export {};
|
|
24
1
|
//# sourceMappingURL=pivot.d.ts.map
|
package/features/pivot.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pivot.d.ts","sourceRoot":"","sources":["../../../../libs/grid-vue/src/features/pivot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG"}
|
|
1
|
+
{"version":3,"file":"pivot.d.ts","sourceRoot":"","sources":["../../../../libs/grid-vue/src/features/pivot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,kCAAkC,CAAC"}
|
package/features/pivot.js
CHANGED
package/features/pivot.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pivot.js","sources":[
|
|
1
|
+
{"version":3,"file":"pivot.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/features/print.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"print.d.ts","sourceRoot":"","sources":["../../../../libs/grid-vue/src/features/print.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAGH,OAAO,
|
|
1
|
+
{"version":3,"file":"print.d.ts","sourceRoot":"","sources":["../../../../libs/grid-vue/src/features/print.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAGH,OAAO,EAAoB,KAAK,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAKrF,OAAO,kCAAkC,CAAC;AAE1C;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;;;OAIG;IACH,KAAK,EAAE,CAAC,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAE/C;;OAEG;IACH,UAAU,EAAE,MAAM,OAAO,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,YAAY,IAAI,YAAY,CAsB3C"}
|
package/features/print.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
g
|
|
6
|
-
function d() {
|
|
7
|
-
const r = o(p, u(null)), n = () => r.value?.getPluginByName("print");
|
|
1
|
+
import { inject as e, ref as o } from "vue";
|
|
2
|
+
import { G as g } from "../chunks/use-grid-B59B6XdD.js";
|
|
3
|
+
import "@toolbox-web/grid/features/print";
|
|
4
|
+
function s() {
|
|
5
|
+
const t = e(g, o(null)), n = () => t.value?.getPluginByName("print");
|
|
8
6
|
return {
|
|
9
7
|
print: async (i) => {
|
|
10
|
-
const
|
|
11
|
-
if (!
|
|
8
|
+
const r = n();
|
|
9
|
+
if (!r) {
|
|
12
10
|
console.warn(
|
|
13
11
|
`[tbw-grid:print] PrintPlugin not found.
|
|
14
12
|
|
|
@@ -17,12 +15,12 @@ function d() {
|
|
|
17
15
|
);
|
|
18
16
|
return;
|
|
19
17
|
}
|
|
20
|
-
await
|
|
18
|
+
await r.print(i);
|
|
21
19
|
},
|
|
22
20
|
isPrinting: () => n()?.isPrinting() ?? !1
|
|
23
21
|
};
|
|
24
22
|
}
|
|
25
23
|
export {
|
|
26
|
-
|
|
24
|
+
s as useGridPrint
|
|
27
25
|
};
|
|
28
26
|
//# sourceMappingURL=print.js.map
|
package/features/print.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"print.js","sources":["../../../../libs/grid-vue/src/features/print.ts"],"sourcesContent":["/**\n * Print feature for @toolbox-web/grid-vue\n *\n * Import this module to enable the `print` prop on TbwGrid.\n * Also exports `useGridPrint()` composable for programmatic print control.\n *\n * @example\n * ```vue\n * <script setup>\n * import '@toolbox-web/grid-vue/features/print';\n * </script>\n *\n * <template>\n * <TbwGrid print />\n * </template>\n * ```\n *\n * @example Using the composable\n * ```vue\n * <script setup>\n * import { useGridPrint } from '@toolbox-web/grid-vue/features/print';\n *\n * const { print, isPrinting } = useGridPrint();\n * </script>\n *\n * <template>\n * <button @click=\"print\" :disabled=\"isPrinting()\">Print Grid</button>\n * </template>\n * ```\n *\n * @packageDocumentation\n */\n\nimport type { DataGridElement } from '@toolbox-web/grid';\nimport { PrintPlugin, type PrintParams } from '@toolbox-web/grid/plugins/print';\nimport { inject, ref } from 'vue';\nimport {
|
|
1
|
+
{"version":3,"file":"print.js","sources":["../../../../libs/grid-vue/src/features/print.ts"],"sourcesContent":["/**\n * Print feature for @toolbox-web/grid-vue\n *\n * Import this module to enable the `print` prop on TbwGrid.\n * Also exports `useGridPrint()` composable for programmatic print control.\n *\n * @example\n * ```vue\n * <script setup>\n * import '@toolbox-web/grid-vue/features/print';\n * </script>\n *\n * <template>\n * <TbwGrid print />\n * </template>\n * ```\n *\n * @example Using the composable\n * ```vue\n * <script setup>\n * import { useGridPrint } from '@toolbox-web/grid-vue/features/print';\n *\n * const { print, isPrinting } = useGridPrint();\n * </script>\n *\n * <template>\n * <button @click=\"print\" :disabled=\"isPrinting()\">Print Grid</button>\n * </template>\n * ```\n *\n * @packageDocumentation\n */\n\nimport type { DataGridElement } from '@toolbox-web/grid';\nimport { type PrintPlugin, type PrintParams } from '@toolbox-web/grid/plugins/print';\nimport { inject, ref } from 'vue';\nimport { GRID_ELEMENT_KEY } from '../lib/use-grid';\n\n// Delegate to core feature registration\nimport '@toolbox-web/grid/features/print';\n\n/**\n * Print methods returned from useGridPrint.\n */\nexport interface PrintMethods {\n /**\n * Print the grid.\n * Opens browser print dialog after preparing the grid for printing.\n * @param params - Optional print parameters\n */\n print: (params?: PrintParams) => Promise<void>;\n\n /**\n * Check if a print operation is currently in progress.\n */\n isPrinting: () => boolean;\n}\n\n/**\n * Composable for programmatic print control.\n *\n * Must be used within a component that contains a TbwGrid with print enabled.\n *\n * @example\n * ```vue\n * <script setup>\n * import { useGridPrint } from '@toolbox-web/grid-vue/features/print';\n *\n * const { print, isPrinting } = useGridPrint();\n *\n * async function handlePrint() {\n * await print({ title: 'My Report', isolate: true });\n * console.log('Print completed');\n * }\n * </script>\n *\n * <template>\n * <button @click=\"handlePrint\" :disabled=\"isPrinting()\">\n * {{ isPrinting() ? 'Printing...' : 'Print' }}\n * </button>\n * </template>\n * ```\n */\nexport function useGridPrint(): PrintMethods {\n const gridElement = inject(GRID_ELEMENT_KEY, ref(null));\n\n const getPlugin = (): PrintPlugin | undefined => {\n const grid = gridElement.value as DataGridElement | null;\n return grid?.getPluginByName('print');\n };\n\n return {\n print: async (params?: PrintParams) => {\n const plugin = getPlugin();\n if (!plugin) {\n console.warn(\n `[tbw-grid:print] PrintPlugin not found.\\n\\n` + ` → Enable print on the grid:\\n` + ` <TbwGrid print />`,\n );\n return;\n }\n await plugin.print(params);\n },\n\n isPrinting: () => getPlugin()?.isPrinting() ?? false,\n };\n}\n"],"names":["useGridPrint","gridElement","inject","GRID_ELEMENT_KEY","ref","getPlugin","params","plugin"],"mappings":";;;AAmFO,SAASA,IAA6B;AAC3C,QAAMC,IAAcC,EAAOC,GAAkBC,EAAI,IAAI,CAAC,GAEhDC,IAAY,MACHJ,EAAY,OACZ,gBAAgB,OAAO;AAGtC,SAAO;AAAA,IACL,OAAO,OAAOK,MAAyB;AACrC,YAAMC,IAASF,EAAA;AACf,UAAI,CAACE,GAAQ;AACX,gBAAQ;AAAA,UACN;AAAA;AAAA;AAAA;AAAA,QAAA;AAEF;AAAA,MACF;AACA,YAAMA,EAAO,MAAMD,CAAM;AAAA,IAC3B;AAAA,IAEA,YAAY,MAAMD,KAAa,gBAAgB;AAAA,EAAA;AAEnD;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=reorder-columns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reorder-columns.d.ts","sourceRoot":"","sources":["../../../../libs/grid-vue/src/features/reorder-columns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,4CAA4C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reorder-columns.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=reorder-rows.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reorder-rows.d.ts","sourceRoot":"","sources":["../../../../libs/grid-vue/src/features/reorder-rows.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,yCAAyC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reorder-rows.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/features/reorder.d.ts
CHANGED
|
@@ -1,20 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* Import this module to enable the `reorder` prop on TbwGrid.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* ```vue
|
|
8
|
-
* <script setup>
|
|
9
|
-
* import '@toolbox-web/grid-vue/features/reorder';
|
|
10
|
-
* </script>
|
|
11
|
-
*
|
|
12
|
-
* <template>
|
|
13
|
-
* <TbwGrid reorder />
|
|
14
|
-
* </template>
|
|
15
|
-
* ```
|
|
16
|
-
*
|
|
17
|
-
* @packageDocumentation
|
|
2
|
+
* @deprecated Import from `@toolbox-web/grid-vue/features/reorder-columns` instead.
|
|
3
|
+
* This re-export will be removed in v2.0.
|
|
18
4
|
*/
|
|
19
|
-
export {};
|
|
5
|
+
export {} from './reorder-columns';
|
|
20
6
|
//# sourceMappingURL=reorder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reorder.d.ts","sourceRoot":"","sources":["../../../../libs/grid-vue/src/features/reorder.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"reorder.d.ts","sourceRoot":"","sources":["../../../../libs/grid-vue/src/features/reorder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,MAAM,mBAAmB,CAAC"}
|
package/features/reorder.js
CHANGED
package/features/reorder.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reorder.js","sources":[
|
|
1
|
+
{"version":3,"file":"reorder.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/features/responsive.d.ts
CHANGED
|
@@ -1,24 +1 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Responsive feature for @toolbox-web/grid-vue
|
|
3
|
-
*
|
|
4
|
-
* Import this module to enable the `responsive` prop on TbwGrid.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* ```vue
|
|
8
|
-
* <script setup>
|
|
9
|
-
* import '@toolbox-web/grid-vue/features/responsive';
|
|
10
|
-
* import { h } from 'vue';
|
|
11
|
-
* </script>
|
|
12
|
-
*
|
|
13
|
-
* <template>
|
|
14
|
-
* <TbwGrid :responsive="{
|
|
15
|
-
* breakpoint: 768,
|
|
16
|
-
* cardRenderer: (row) => h(EmployeeCard, { employee: row }),
|
|
17
|
-
* }" />
|
|
18
|
-
* </template>
|
|
19
|
-
* ```
|
|
20
|
-
*
|
|
21
|
-
* @packageDocumentation
|
|
22
|
-
*/
|
|
23
|
-
export {};
|
|
24
1
|
//# sourceMappingURL=responsive.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"responsive.d.ts","sourceRoot":"","sources":["../../../../libs/grid-vue/src/features/responsive.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG"}
|
|
1
|
+
{"version":3,"file":"responsive.d.ts","sourceRoot":"","sources":["../../../../libs/grid-vue/src/features/responsive.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,uCAAuC,CAAC"}
|
package/features/responsive.js
CHANGED
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { r as i } from "../chunks/feature-registry-BgEOysSJ.js";
|
|
3
|
-
i("responsive", (r) => r === !0 ? new e() : new e(r ?? void 0));
|
|
1
|
+
import "@toolbox-web/grid/features/responsive";
|
|
4
2
|
//# sourceMappingURL=responsive.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"responsive.js","sources":[
|
|
1
|
+
{"version":3,"file":"responsive.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,20 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* Import this module to enable the `rowReorder` prop on TbwGrid.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* ```vue
|
|
8
|
-
* <script setup>
|
|
9
|
-
* import '@toolbox-web/grid-vue/features/row-reorder';
|
|
10
|
-
* </script>
|
|
11
|
-
*
|
|
12
|
-
* <template>
|
|
13
|
-
* <TbwGrid rowReorder />
|
|
14
|
-
* </template>
|
|
15
|
-
* ```
|
|
16
|
-
*
|
|
17
|
-
* @packageDocumentation
|
|
2
|
+
* @deprecated Import from `@toolbox-web/grid-vue/features/reorder-rows` instead.
|
|
3
|
+
* This re-export will be removed in v2.0.
|
|
18
4
|
*/
|
|
19
|
-
export {};
|
|
5
|
+
export {} from './reorder-rows';
|
|
20
6
|
//# sourceMappingURL=row-reorder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"row-reorder.d.ts","sourceRoot":"","sources":["../../../../libs/grid-vue/src/features/row-reorder.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"row-reorder.d.ts","sourceRoot":"","sources":["../../../../libs/grid-vue/src/features/row-reorder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,MAAM,gBAAgB,CAAC"}
|
package/features/row-reorder.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"row-reorder.js","sources":[
|
|
1
|
+
{"version":3,"file":"row-reorder.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selection.d.ts","sourceRoot":"","sources":["../../../../libs/grid-vue/src/features/selection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAGH,OAAO,
|
|
1
|
+
{"version":3,"file":"selection.d.ts","sourceRoot":"","sources":["../../../../libs/grid-vue/src/features/selection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAGH,OAAO,EAAwB,KAAK,SAAS,EAAE,KAAK,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAKjH,OAAO,sCAAsC,CAAC;AAE9C;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB,CAAC,IAAI,GAAG,OAAO;IAC9C;;OAEG;IACH,SAAS,EAAE,MAAM,IAAI,CAAC;IAEtB;;OAEG;IACH,cAAc,EAAE,MAAM,IAAI,CAAC;IAE3B;;;OAGG;IACH,YAAY,EAAE,MAAM,eAAe,GAAG,IAAI,CAAC;IAE3C;;OAEG;IACH,cAAc,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;IAEtD;;OAEG;IACH,SAAS,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,IAAI,CAAC;IAEzC;;;;;;;;OAQG;IACH,eAAe,EAAE,MAAM,IAAI,EAAE,CAAC;CAC/B;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,GAAG,OAAO,KAAK,gBAAgB,CAAC,IAAI,CAAC,CA0DzE"}
|
package/features/selection.js
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
function R() {
|
|
7
|
-
const t = u(a, g(null)), n = () => t.value?.getPluginByName("selection");
|
|
1
|
+
import { inject as s, ref as g } from "vue";
|
|
2
|
+
import { G as u } from "../chunks/use-grid-B59B6XdD.js";
|
|
3
|
+
import "@toolbox-web/grid/features/selection";
|
|
4
|
+
function w() {
|
|
5
|
+
const c = s(u, g(null)), t = () => c.value?.getPluginByName("selection");
|
|
8
6
|
return {
|
|
9
7
|
selectAll: () => {
|
|
10
|
-
const e =
|
|
8
|
+
const e = t();
|
|
11
9
|
if (!e) {
|
|
12
10
|
console.warn(
|
|
13
11
|
`[tbw-grid:selection] SelectionPlugin not found.
|
|
@@ -17,28 +15,28 @@ function R() {
|
|
|
17
15
|
);
|
|
18
16
|
return;
|
|
19
17
|
}
|
|
20
|
-
const
|
|
21
|
-
if (
|
|
22
|
-
const l =
|
|
23
|
-
for (let
|
|
24
|
-
e.selected =
|
|
25
|
-
} else if (
|
|
26
|
-
const l =
|
|
27
|
-
l > 0 &&
|
|
18
|
+
const n = c.value, i = e.config?.mode;
|
|
19
|
+
if (i === "row") {
|
|
20
|
+
const l = n?.rows?.length ?? 0, o = /* @__PURE__ */ new Set();
|
|
21
|
+
for (let r = 0; r < l; r++) o.add(r);
|
|
22
|
+
e.selected = o, e.requestAfterRender?.();
|
|
23
|
+
} else if (i === "range") {
|
|
24
|
+
const l = n?.rows?.length ?? 0, o = n?._columns?.length ?? 0;
|
|
25
|
+
l > 0 && o > 0 && e.setRanges([{ from: { row: 0, col: 0 }, to: { row: l - 1, col: o - 1 } }]);
|
|
28
26
|
}
|
|
29
27
|
},
|
|
30
28
|
clearSelection: () => {
|
|
31
|
-
|
|
29
|
+
t()?.clearSelection();
|
|
32
30
|
},
|
|
33
|
-
getSelection: () =>
|
|
34
|
-
isCellSelected: (e,
|
|
31
|
+
getSelection: () => t()?.getSelection() ?? null,
|
|
32
|
+
isCellSelected: (e, n) => t()?.isCellSelected(e, n) ?? !1,
|
|
35
33
|
setRanges: (e) => {
|
|
36
|
-
|
|
34
|
+
t()?.setRanges(e);
|
|
37
35
|
},
|
|
38
|
-
getSelectedRows: () =>
|
|
36
|
+
getSelectedRows: () => t()?.getSelectedRows() ?? []
|
|
39
37
|
};
|
|
40
38
|
}
|
|
41
39
|
export {
|
|
42
|
-
|
|
40
|
+
w as useGridSelection
|
|
43
41
|
};
|
|
44
42
|
//# sourceMappingURL=selection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selection.js","sources":["../../../../libs/grid-vue/src/features/selection.ts"],"sourcesContent":["/**\n * Selection feature for @toolbox-web/grid-vue\n *\n * Import this module to enable the `selection` prop on TbwGrid.\n * Also exports `useGridSelection()` composable for programmatic selection control.\n *\n * @example\n * ```vue\n * <script setup>\n * import '@toolbox-web/grid-vue/features/selection';\n * </script>\n *\n * <template>\n * <TbwGrid selection=\"range\" />\n * </template>\n * ```\n *\n * @example Using the composable\n * ```vue\n * <script setup>\n * import { useGridSelection } from '@toolbox-web/grid-vue/features/selection';\n *\n * const { selectAll, clearSelection, getSelection } = useGridSelection();\n *\n * function handleSelectAll() {\n * selectAll();\n * }\n * </script>\n * ```\n *\n * @packageDocumentation\n */\n\nimport type { DataGridElement } from '@toolbox-web/grid';\nimport { SelectionPlugin, type CellRange, type SelectionResult } from '@toolbox-web/grid/plugins/selection';\nimport { inject, ref } from 'vue';\nimport {
|
|
1
|
+
{"version":3,"file":"selection.js","sources":["../../../../libs/grid-vue/src/features/selection.ts"],"sourcesContent":["/**\n * Selection feature for @toolbox-web/grid-vue\n *\n * Import this module to enable the `selection` prop on TbwGrid.\n * Also exports `useGridSelection()` composable for programmatic selection control.\n *\n * @example\n * ```vue\n * <script setup>\n * import '@toolbox-web/grid-vue/features/selection';\n * </script>\n *\n * <template>\n * <TbwGrid selection=\"range\" />\n * </template>\n * ```\n *\n * @example Using the composable\n * ```vue\n * <script setup>\n * import { useGridSelection } from '@toolbox-web/grid-vue/features/selection';\n *\n * const { selectAll, clearSelection, getSelection } = useGridSelection();\n *\n * function handleSelectAll() {\n * selectAll();\n * }\n * </script>\n * ```\n *\n * @packageDocumentation\n */\n\nimport type { DataGridElement } from '@toolbox-web/grid';\nimport { type SelectionPlugin, type CellRange, type SelectionResult } from '@toolbox-web/grid/plugins/selection';\nimport { inject, ref } from 'vue';\nimport { GRID_ELEMENT_KEY } from '../lib/use-grid';\n\n// Delegate to core feature registration\nimport '@toolbox-web/grid/features/selection';\n\n/**\n * Selection methods returned from useGridSelection.\n *\n * Uses the injected grid element from TbwGrid's provide/inject.\n * Methods work immediately when grid is available.\n */\nexport interface SelectionMethods<TRow = unknown> {\n /**\n * Select all rows (row mode) or all cells (range mode).\n */\n selectAll: () => void;\n\n /**\n * Clear all selection.\n */\n clearSelection: () => void;\n\n /**\n * Get the current selection state.\n * Use this to derive selected rows, indices, etc.\n */\n getSelection: () => SelectionResult | null;\n\n /**\n * Check if a specific cell is selected.\n */\n isCellSelected: (row: number, col: number) => boolean;\n\n /**\n * Set selection ranges programmatically.\n */\n setRanges: (ranges: CellRange[]) => void;\n\n /**\n * Get actual row objects for the current selection.\n * Works in all selection modes (row, cell, range) — resolves indices\n * against the grid's processed (sorted/filtered) rows.\n *\n * This is the recommended way to get selected rows. Unlike manual\n * index mapping, it correctly resolves rows even when the grid is\n * sorted or filtered.\n */\n getSelectedRows: () => TRow[];\n}\n\n/**\n * Composable for programmatic selection control.\n *\n * Must be used within a component that contains a TbwGrid with the selection feature enabled.\n * Uses Vue's provide/inject, so it works reliably regardless of when the grid renders.\n *\n * @example\n * ```vue\n * <script setup>\n * import { useGridSelection } from '@toolbox-web/grid-vue/features/selection';\n *\n * const { selectAll, clearSelection, getSelection } = useGridSelection();\n *\n * function exportSelected() {\n * const selection = getSelection();\n * if (!selection) return;\n * // Derive rows from selection.ranges and grid.rows\n * }\n * </script>\n * ```\n */\nexport function useGridSelection<TRow = unknown>(): SelectionMethods<TRow> {\n const gridElement = inject(GRID_ELEMENT_KEY, ref(null));\n\n const getPlugin = (): SelectionPlugin | undefined => {\n const grid = gridElement.value as DataGridElement<TRow> | null;\n return grid?.getPluginByName('selection');\n };\n\n return {\n selectAll: () => {\n const plugin = getPlugin();\n if (!plugin) {\n console.warn(\n `[tbw-grid:selection] SelectionPlugin not found.\\n\\n` +\n ` → Enable selection on the grid:\\n` +\n ` <TbwGrid selection=\"range\" />`,\n );\n return;\n }\n const grid = gridElement.value as DataGridElement<TRow> | null;\n // Cast to any to access protected config\n const mode = (plugin as any).config?.mode;\n\n if (mode === 'row') {\n const rowCount = grid?.rows?.length ?? 0;\n const allIndices = new Set<number>();\n for (let i = 0; i < rowCount; i++) allIndices.add(i);\n (plugin as any).selected = allIndices;\n (plugin as any).requestAfterRender?.();\n } else if (mode === 'range') {\n const rowCount = grid?.rows?.length ?? 0;\n const colCount = (grid as any)?._columns?.length ?? 0;\n if (rowCount > 0 && colCount > 0) {\n plugin.setRanges([{ from: { row: 0, col: 0 }, to: { row: rowCount - 1, col: colCount - 1 } }]);\n }\n }\n },\n\n clearSelection: () => {\n getPlugin()?.clearSelection();\n },\n\n getSelection: () => {\n return getPlugin()?.getSelection() ?? null;\n },\n\n isCellSelected: (row: number, col: number) => {\n return getPlugin()?.isCellSelected(row, col) ?? false;\n },\n\n setRanges: (ranges: CellRange[]) => {\n getPlugin()?.setRanges(ranges);\n },\n\n getSelectedRows: (): TRow[] => {\n return getPlugin()?.getSelectedRows<TRow>() ?? [];\n },\n };\n}\n"],"names":["useGridSelection","gridElement","inject","GRID_ELEMENT_KEY","ref","getPlugin","plugin","grid","mode","rowCount","allIndices","i","colCount","row","col","ranges"],"mappings":";;;AA2GO,SAASA,IAA2D;AACzE,QAAMC,IAAcC,EAAOC,GAAkBC,EAAI,IAAI,CAAC,GAEhDC,IAAY,MACHJ,EAAY,OACZ,gBAAgB,WAAW;AAG1C,SAAO;AAAA,IACL,WAAW,MAAM;AACf,YAAMK,IAASD,EAAA;AACf,UAAI,CAACC,GAAQ;AACX,gBAAQ;AAAA,UACN;AAAA;AAAA;AAAA;AAAA,QAAA;AAIF;AAAA,MACF;AACA,YAAMC,IAAON,EAAY,OAEnBO,IAAQF,EAAe,QAAQ;AAErC,UAAIE,MAAS,OAAO;AAClB,cAAMC,IAAWF,GAAM,MAAM,UAAU,GACjCG,wBAAiB,IAAA;AACvB,iBAASC,IAAI,GAAGA,IAAIF,GAAUE,IAAK,CAAAD,EAAW,IAAIC,CAAC;AAClD,QAAAL,EAAe,WAAWI,GAC1BJ,EAAe,qBAAA;AAAA,MAClB,WAAWE,MAAS,SAAS;AAC3B,cAAMC,IAAWF,GAAM,MAAM,UAAU,GACjCK,IAAYL,GAAc,UAAU,UAAU;AACpD,QAAIE,IAAW,KAAKG,IAAW,KAC7BN,EAAO,UAAU,CAAC,EAAE,MAAM,EAAE,KAAK,GAAG,KAAK,EAAA,GAAK,IAAI,EAAE,KAAKG,IAAW,GAAG,KAAKG,IAAW,EAAA,EAAE,CAAG,CAAC;AAAA,MAEjG;AAAA,IACF;AAAA,IAEA,gBAAgB,MAAM;AACpB,MAAAP,EAAA,GAAa,eAAA;AAAA,IACf;AAAA,IAEA,cAAc,MACLA,EAAA,GAAa,aAAA,KAAkB;AAAA,IAGxC,gBAAgB,CAACQ,GAAaC,MACrBT,EAAA,GAAa,eAAeQ,GAAKC,CAAG,KAAK;AAAA,IAGlD,WAAW,CAACC,MAAwB;AAClC,MAAAV,EAAA,GAAa,UAAUU,CAAM;AAAA,IAC/B;AAAA,IAEA,iBAAiB,MACRV,EAAA,GAAa,gBAAA,KAA2B,CAAA;AAAA,EACjD;AAEJ;"}
|
|
@@ -1,22 +1 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Server-side feature for @toolbox-web/grid-vue
|
|
3
|
-
*
|
|
4
|
-
* Import this module to enable the `serverSide` prop on TbwGrid.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* ```vue
|
|
8
|
-
* <script setup>
|
|
9
|
-
* import '@toolbox-web/grid-vue/features/server-side';
|
|
10
|
-
* </script>
|
|
11
|
-
*
|
|
12
|
-
* <template>
|
|
13
|
-
* <TbwGrid :serverSide="{
|
|
14
|
-
* dataSource: async (params) => fetchData(params),
|
|
15
|
-
* }" />
|
|
16
|
-
* </template>
|
|
17
|
-
* ```
|
|
18
|
-
*
|
|
19
|
-
* @packageDocumentation
|
|
20
|
-
*/
|
|
21
|
-
export {};
|
|
22
1
|
//# sourceMappingURL=server-side.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-side.d.ts","sourceRoot":"","sources":["../../../../libs/grid-vue/src/features/server-side.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG"}
|
|
1
|
+
{"version":3,"file":"server-side.d.ts","sourceRoot":"","sources":["../../../../libs/grid-vue/src/features/server-side.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,wCAAwC,CAAC"}
|
package/features/server-side.js
CHANGED
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { r as i } from "../chunks/feature-registry-BgEOysSJ.js";
|
|
3
|
-
i("serverSide", (r) => new e(r ?? void 0));
|
|
1
|
+
import "@toolbox-web/grid/features/server-side";
|
|
4
2
|
//# sourceMappingURL=server-side.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-side.js","sources":[
|
|
1
|
+
{"version":3,"file":"server-side.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/features/tree.d.ts
CHANGED
|
@@ -1,23 +1 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tree view feature for @toolbox-web/grid-vue
|
|
3
|
-
*
|
|
4
|
-
* Import this module to enable the `tree` prop on TbwGrid.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* ```vue
|
|
8
|
-
* <script setup>
|
|
9
|
-
* import '@toolbox-web/grid-vue/features/tree';
|
|
10
|
-
* </script>
|
|
11
|
-
*
|
|
12
|
-
* <template>
|
|
13
|
-
* <TbwGrid :tree="{
|
|
14
|
-
* childrenField: 'children',
|
|
15
|
-
* defaultExpanded: true,
|
|
16
|
-
* }" />
|
|
17
|
-
* </template>
|
|
18
|
-
* ```
|
|
19
|
-
*
|
|
20
|
-
* @packageDocumentation
|
|
21
|
-
*/
|
|
22
|
-
export {};
|
|
23
1
|
//# sourceMappingURL=tree.d.ts.map
|
package/features/tree.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree.d.ts","sourceRoot":"","sources":["../../../../libs/grid-vue/src/features/tree.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG"}
|
|
1
|
+
{"version":3,"file":"tree.d.ts","sourceRoot":"","sources":["../../../../libs/grid-vue/src/features/tree.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,iCAAiC,CAAC"}
|
package/features/tree.js
CHANGED
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { r as t } from "../chunks/feature-registry-BgEOysSJ.js";
|
|
3
|
-
t("tree", (r) => r === !0 ? new e() : new e(r ?? void 0));
|
|
1
|
+
import "@toolbox-web/grid/features/tree";
|
|
4
2
|
//# sourceMappingURL=tree.js.map
|
package/features/tree.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree.js","sources":[
|
|
1
|
+
{"version":3,"file":"tree.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"undo-redo.d.ts","sourceRoot":"","sources":["../../../../libs/grid-vue/src/features/undo-redo.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAGH,OAAO,
|
|
1
|
+
{"version":3,"file":"undo-redo.d.ts","sourceRoot":"","sources":["../../../../libs/grid-vue/src/features/undo-redo.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAGH,OAAO,EAAuB,KAAK,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAK/F,OAAO,sCAAsC,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,IAAI,EAAE,MAAM,cAAc,GAAG,IAAI,CAAC;IAElC;;;OAGG;IACH,IAAI,EAAE,MAAM,cAAc,GAAG,IAAI,CAAC;IAElC;;OAEG;IACH,OAAO,EAAE,MAAM,OAAO,CAAC;IAEvB;;OAEG;IACH,OAAO,EAAE,MAAM,OAAO,CAAC;IAEvB;;OAEG;IACH,YAAY,EAAE,MAAM,IAAI,CAAC;IAEzB;;OAEG;IACH,YAAY,EAAE,MAAM,cAAc,EAAE,CAAC;IAErC;;OAEG;IACH,YAAY,EAAE,MAAM,cAAc,EAAE,CAAC;IAErC;;;OAGG;IACH,UAAU,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAE5F;;;;OAIG;IACH,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAE7B;;;;;OAKG;IACH,cAAc,EAAE,MAAM,IAAI,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,eAAe,IAAI,eAAe,CA+FjD"}
|
package/features/undo-redo.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
function w() {
|
|
7
|
-
const d = l(a, c(null)), o = () => d.value?.getPluginByName("undoRedo");
|
|
1
|
+
import { inject as u, ref as l } from "vue";
|
|
2
|
+
import { G as c } from "../chunks/use-grid-B59B6XdD.js";
|
|
3
|
+
import "@toolbox-web/grid/features/undo-redo";
|
|
4
|
+
function s() {
|
|
5
|
+
const e = u(c, l(null)), o = () => e.value?.getPluginByName("undoRedo");
|
|
8
6
|
return {
|
|
9
7
|
undo: () => {
|
|
10
8
|
const n = o();
|
|
@@ -41,9 +39,9 @@ function w() {
|
|
|
41
39
|
},
|
|
42
40
|
getUndoStack: () => o()?.getUndoStack() ?? [],
|
|
43
41
|
getRedoStack: () => o()?.getRedoStack() ?? [],
|
|
44
|
-
recordEdit: (n, i,
|
|
45
|
-
const
|
|
46
|
-
if (!
|
|
42
|
+
recordEdit: (n, i, r, t) => {
|
|
43
|
+
const d = o();
|
|
44
|
+
if (!d) {
|
|
47
45
|
console.warn(
|
|
48
46
|
`[tbw-grid:undoRedo] UndoRedoPlugin not found.
|
|
49
47
|
|
|
@@ -52,7 +50,7 @@ function w() {
|
|
|
52
50
|
);
|
|
53
51
|
return;
|
|
54
52
|
}
|
|
55
|
-
|
|
53
|
+
d.recordEdit(n, i, r, t);
|
|
56
54
|
},
|
|
57
55
|
beginTransaction: () => {
|
|
58
56
|
const n = o();
|
|
@@ -83,6 +81,6 @@ function w() {
|
|
|
83
81
|
};
|
|
84
82
|
}
|
|
85
83
|
export {
|
|
86
|
-
|
|
84
|
+
s as useGridUndoRedo
|
|
87
85
|
};
|
|
88
86
|
//# sourceMappingURL=undo-redo.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"undo-redo.js","sources":["../../../../libs/grid-vue/src/features/undo-redo.ts"],"sourcesContent":["/**\n * Undo/Redo feature for @toolbox-web/grid-vue\n *\n * Import this module to enable the `undoRedo` prop on TbwGrid.\n * Also exports `useGridUndoRedo()` composable for programmatic undo/redo control.\n *\n * @example\n * ```vue\n * <script setup>\n * import '@toolbox-web/grid-vue/features/undo-redo';\n * </script>\n *\n * <template>\n * <TbwGrid editing=\"dblclick\" undoRedo />\n * </template>\n * ```\n *\n * @example Using the composable\n * ```vue\n * <script setup>\n * import { useGridUndoRedo } from '@toolbox-web/grid-vue/features/undo-redo';\n *\n * const { undo, redo, canUndo, canRedo } = useGridUndoRedo();\n * </script>\n *\n * <template>\n * <button @click=\"undo\" :disabled=\"!canUndo()\">Undo</button>\n * <button @click=\"redo\" :disabled=\"!canRedo()\">Redo</button>\n * </template>\n * ```\n *\n * @packageDocumentation\n */\n\nimport type { DataGridElement } from '@toolbox-web/grid';\nimport { UndoRedoPlugin, type UndoRedoAction } from '@toolbox-web/grid/plugins/undo-redo';\nimport { inject, ref } from 'vue';\nimport {
|
|
1
|
+
{"version":3,"file":"undo-redo.js","sources":["../../../../libs/grid-vue/src/features/undo-redo.ts"],"sourcesContent":["/**\n * Undo/Redo feature for @toolbox-web/grid-vue\n *\n * Import this module to enable the `undoRedo` prop on TbwGrid.\n * Also exports `useGridUndoRedo()` composable for programmatic undo/redo control.\n *\n * @example\n * ```vue\n * <script setup>\n * import '@toolbox-web/grid-vue/features/undo-redo';\n * </script>\n *\n * <template>\n * <TbwGrid editing=\"dblclick\" undoRedo />\n * </template>\n * ```\n *\n * @example Using the composable\n * ```vue\n * <script setup>\n * import { useGridUndoRedo } from '@toolbox-web/grid-vue/features/undo-redo';\n *\n * const { undo, redo, canUndo, canRedo } = useGridUndoRedo();\n * </script>\n *\n * <template>\n * <button @click=\"undo\" :disabled=\"!canUndo()\">Undo</button>\n * <button @click=\"redo\" :disabled=\"!canRedo()\">Redo</button>\n * </template>\n * ```\n *\n * @packageDocumentation\n */\n\nimport type { DataGridElement } from '@toolbox-web/grid';\nimport { type UndoRedoPlugin, type UndoRedoAction } from '@toolbox-web/grid/plugins/undo-redo';\nimport { inject, ref } from 'vue';\nimport { GRID_ELEMENT_KEY } from '../lib/use-grid';\n\n// Delegate to core feature registration\nimport '@toolbox-web/grid/features/undo-redo';\n\n/**\n * Undo/Redo methods returned from useGridUndoRedo.\n */\nexport interface UndoRedoMethods {\n /**\n * Undo the last edit action.\n * @returns The undone action (or compound action), or null if nothing to undo\n */\n undo: () => UndoRedoAction | null;\n\n /**\n * Redo the last undone action.\n * @returns The redone action (or compound action), or null if nothing to redo\n */\n redo: () => UndoRedoAction | null;\n\n /**\n * Check if there are any actions that can be undone.\n */\n canUndo: () => boolean;\n\n /**\n * Check if there are any actions that can be redone.\n */\n canRedo: () => boolean;\n\n /**\n * Clear all undo/redo history.\n */\n clearHistory: () => void;\n\n /**\n * Get a copy of the current undo stack.\n */\n getUndoStack: () => UndoRedoAction[];\n\n /**\n * Get a copy of the current redo stack.\n */\n getRedoStack: () => UndoRedoAction[];\n\n /**\n * Manually record an edit action.\n * If a transaction is active, the action is buffered; otherwise it's pushed to the undo stack.\n */\n recordEdit: (rowIndex: number, field: string, oldValue: unknown, newValue: unknown) => void;\n\n /**\n * Begin a transaction. All edits recorded until `endTransaction()` are grouped\n * into a single compound action for undo/redo.\n * @throws If a transaction is already active\n */\n beginTransaction: () => void;\n\n /**\n * End the active transaction and push the compound action to the undo stack.\n * If only one edit was recorded, it's pushed as a plain EditAction.\n * If no edits were recorded, the transaction is discarded.\n * @throws If no transaction is active\n */\n endTransaction: () => void;\n}\n\n/**\n * Composable for programmatic undo/redo control.\n *\n * Must be used within a component that contains a TbwGrid with undoRedo and editing enabled.\n *\n * @example\n * ```vue\n * <script setup>\n * import { useGridUndoRedo } from '@toolbox-web/grid-vue/features/undo-redo';\n *\n * const { undo, redo, canUndo, canRedo, clearHistory } = useGridUndoRedo();\n * </script>\n *\n * <template>\n * <div class=\"toolbar\">\n * <button @click=\"undo\" :disabled=\"!canUndo()\">Undo</button>\n * <button @click=\"redo\" :disabled=\"!canRedo()\">Redo</button>\n * <button @click=\"clearHistory\">Clear History</button>\n * </div>\n * </template>\n * ```\n */\nexport function useGridUndoRedo(): UndoRedoMethods {\n const gridElement = inject(GRID_ELEMENT_KEY, ref(null));\n\n const getPlugin = (): UndoRedoPlugin | undefined => {\n const grid = gridElement.value as DataGridElement | null;\n return grid?.getPluginByName('undoRedo');\n };\n\n return {\n undo: () => {\n const plugin = getPlugin();\n if (!plugin) {\n console.warn(\n `[tbw-grid:undoRedo] UndoRedoPlugin not found.\\n\\n` +\n ` → Enable undo/redo on the grid:\\n` +\n ` <TbwGrid editing=\"dblclick\" undoRedo />`,\n );\n return null;\n }\n return plugin.undo();\n },\n\n redo: () => {\n const plugin = getPlugin();\n if (!plugin) {\n console.warn(\n `[tbw-grid:undoRedo] UndoRedoPlugin not found.\\n\\n` +\n ` → Enable undo/redo on the grid:\\n` +\n ` <TbwGrid editing=\"dblclick\" undoRedo />`,\n );\n return null;\n }\n return plugin.redo();\n },\n\n canUndo: () => getPlugin()?.canUndo() ?? false,\n\n canRedo: () => getPlugin()?.canRedo() ?? false,\n\n clearHistory: () => {\n const plugin = getPlugin();\n if (!plugin) {\n console.warn(\n `[tbw-grid:undoRedo] UndoRedoPlugin not found.\\n\\n` +\n ` → Enable undo/redo on the grid:\\n` +\n ` <TbwGrid editing=\"dblclick\" undoRedo />`,\n );\n return;\n }\n plugin.clearHistory();\n },\n\n getUndoStack: () => getPlugin()?.getUndoStack() ?? [],\n\n getRedoStack: () => getPlugin()?.getRedoStack() ?? [],\n\n recordEdit: (rowIndex: number, field: string, oldValue: unknown, newValue: unknown) => {\n const plugin = getPlugin();\n if (!plugin) {\n console.warn(\n `[tbw-grid:undoRedo] UndoRedoPlugin not found.\\n\\n` +\n ` → Enable undo/redo on the grid:\\n` +\n ` <TbwGrid editing=\"dblclick\" undoRedo />`,\n );\n return;\n }\n plugin.recordEdit(rowIndex, field, oldValue, newValue);\n },\n\n beginTransaction: () => {\n const plugin = getPlugin();\n if (!plugin) {\n console.warn(\n `[tbw-grid:undoRedo] UndoRedoPlugin not found.\\n\\n` +\n ` → Enable undo/redo on the grid:\\n` +\n ` <TbwGrid editing=\"dblclick\" undoRedo />`,\n );\n return;\n }\n plugin.beginTransaction();\n },\n\n endTransaction: () => {\n const plugin = getPlugin();\n if (!plugin) {\n console.warn(\n `[tbw-grid:undoRedo] UndoRedoPlugin not found.\\n\\n` +\n ` → Enable undo/redo on the grid:\\n` +\n ` <TbwGrid editing=\"dblclick\" undoRedo />`,\n );\n return;\n }\n plugin.endTransaction();\n },\n };\n}\n"],"names":["useGridUndoRedo","gridElement","inject","GRID_ELEMENT_KEY","ref","getPlugin","plugin","rowIndex","field","oldValue","newValue"],"mappings":";;;AA+HO,SAASA,IAAmC;AACjD,QAAMC,IAAcC,EAAOC,GAAkBC,EAAI,IAAI,CAAC,GAEhDC,IAAY,MACHJ,EAAY,OACZ,gBAAgB,UAAU;AAGzC,SAAO;AAAA,IACL,MAAM,MAAM;AACV,YAAMK,IAASD,EAAA;AACf,aAAKC,IAQEA,EAAO,KAAA,KAPZ,QAAQ;AAAA,QACN;AAAA;AAAA;AAAA;AAAA,MAAA,GAIK;AAAA,IAGX;AAAA,IAEA,MAAM,MAAM;AACV,YAAMA,IAASD,EAAA;AACf,aAAKC,IAQEA,EAAO,KAAA,KAPZ,QAAQ;AAAA,QACN;AAAA;AAAA;AAAA;AAAA,MAAA,GAIK;AAAA,IAGX;AAAA,IAEA,SAAS,MAAMD,KAAa,aAAa;AAAA,IAEzC,SAAS,MAAMA,KAAa,aAAa;AAAA,IAEzC,cAAc,MAAM;AAClB,YAAMC,IAASD,EAAA;AACf,UAAI,CAACC,GAAQ;AACX,gBAAQ;AAAA,UACN;AAAA;AAAA;AAAA;AAAA,QAAA;AAIF;AAAA,MACF;AACA,MAAAA,EAAO,aAAA;AAAA,IACT;AAAA,IAEA,cAAc,MAAMD,KAAa,aAAA,KAAkB,CAAA;AAAA,IAEnD,cAAc,MAAMA,KAAa,aAAA,KAAkB,CAAA;AAAA,IAEnD,YAAY,CAACE,GAAkBC,GAAeC,GAAmBC,MAAsB;AACrF,YAAMJ,IAASD,EAAA;AACf,UAAI,CAACC,GAAQ;AACX,gBAAQ;AAAA,UACN;AAAA;AAAA;AAAA;AAAA,QAAA;AAIF;AAAA,MACF;AACA,MAAAA,EAAO,WAAWC,GAAUC,GAAOC,GAAUC,CAAQ;AAAA,IACvD;AAAA,IAEA,kBAAkB,MAAM;AACtB,YAAMJ,IAASD,EAAA;AACf,UAAI,CAACC,GAAQ;AACX,gBAAQ;AAAA,UACN;AAAA;AAAA;AAAA;AAAA,QAAA;AAIF;AAAA,MACF;AACA,MAAAA,EAAO,iBAAA;AAAA,IACT;AAAA,IAEA,gBAAgB,MAAM;AACpB,YAAMA,IAASD,EAAA;AACf,UAAI,CAACC,GAAQ;AACX,gBAAQ;AAAA,UACN;AAAA;AAAA;AAAA;AAAA,QAAA;AAIF;AAAA,MACF;AACA,MAAAA,EAAO,eAAA;AAAA,IACT;AAAA,EAAA;AAEJ;"}
|
package/features/visibility.d.ts
CHANGED
|
@@ -1,20 +1 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Column visibility feature for @toolbox-web/grid-vue
|
|
3
|
-
*
|
|
4
|
-
* Import this module to enable the `visibility` prop on TbwGrid.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* ```vue
|
|
8
|
-
* <script setup>
|
|
9
|
-
* import '@toolbox-web/grid-vue/features/visibility';
|
|
10
|
-
* </script>
|
|
11
|
-
*
|
|
12
|
-
* <template>
|
|
13
|
-
* <TbwGrid visibility />
|
|
14
|
-
* </template>
|
|
15
|
-
* ```
|
|
16
|
-
*
|
|
17
|
-
* @packageDocumentation
|
|
18
|
-
*/
|
|
19
|
-
export {};
|
|
20
1
|
//# sourceMappingURL=visibility.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visibility.d.ts","sourceRoot":"","sources":["../../../../libs/grid-vue/src/features/visibility.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG"}
|
|
1
|
+
{"version":3,"file":"visibility.d.ts","sourceRoot":"","sources":["../../../../libs/grid-vue/src/features/visibility.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,uCAAuC,CAAC"}
|
package/features/visibility.js
CHANGED
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { r as e } from "../chunks/feature-registry-BgEOysSJ.js";
|
|
3
|
-
e("visibility", (i) => i === !0 ? new r() : new r(i ?? void 0));
|
|
1
|
+
import "@toolbox-web/grid/features/visibility";
|
|
4
2
|
//# sourceMappingURL=visibility.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visibility.js","sources":[
|
|
1
|
+
{"version":3,"file":"visibility.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|