@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.
Files changed (102) hide show
  1. package/features/clipboard.d.ts +0 -19
  2. package/features/clipboard.d.ts.map +1 -1
  3. package/features/clipboard.js +1 -3
  4. package/features/clipboard.js.map +1 -1
  5. package/features/column-virtualization.d.ts +0 -19
  6. package/features/column-virtualization.d.ts.map +1 -1
  7. package/features/column-virtualization.js +1 -3
  8. package/features/column-virtualization.js.map +1 -1
  9. package/features/context-menu.d.ts +0 -19
  10. package/features/context-menu.d.ts.map +1 -1
  11. package/features/context-menu.js +1 -3
  12. package/features/context-menu.js.map +1 -1
  13. package/features/editing.d.ts +0 -19
  14. package/features/editing.d.ts.map +1 -1
  15. package/features/editing.js +1 -3
  16. package/features/editing.js.map +1 -1
  17. package/features/export.d.ts.map +1 -1
  18. package/features/export.js +18 -20
  19. package/features/export.js.map +1 -1
  20. package/features/filtering.js +4 -4
  21. package/features/grouping-columns.d.ts +0 -23
  22. package/features/grouping-columns.d.ts.map +1 -1
  23. package/features/grouping-columns.js +1 -3
  24. package/features/grouping-columns.js.map +1 -1
  25. package/features/grouping-rows.d.ts +0 -22
  26. package/features/grouping-rows.d.ts.map +1 -1
  27. package/features/grouping-rows.js +1 -3
  28. package/features/grouping-rows.js.map +1 -1
  29. package/features/index.js +20 -21
  30. package/features/index.js.map +1 -1
  31. package/features/master-detail.d.ts +0 -22
  32. package/features/master-detail.d.ts.map +1 -1
  33. package/features/master-detail.js +1 -3
  34. package/features/master-detail.js.map +1 -1
  35. package/features/multi-sort.d.ts +0 -19
  36. package/features/multi-sort.d.ts.map +1 -1
  37. package/features/multi-sort.js +1 -4
  38. package/features/multi-sort.js.map +1 -1
  39. package/features/pinned-columns.d.ts +0 -22
  40. package/features/pinned-columns.d.ts.map +1 -1
  41. package/features/pinned-columns.js +1 -3
  42. package/features/pinned-columns.js.map +1 -1
  43. package/features/pinned-rows.d.ts +0 -21
  44. package/features/pinned-rows.d.ts.map +1 -1
  45. package/features/pinned-rows.js +1 -3
  46. package/features/pinned-rows.js.map +1 -1
  47. package/features/pivot.d.ts +0 -23
  48. package/features/pivot.d.ts.map +1 -1
  49. package/features/pivot.js +1 -3
  50. package/features/pivot.js.map +1 -1
  51. package/features/print.d.ts.map +1 -1
  52. package/features/print.js +9 -11
  53. package/features/print.js.map +1 -1
  54. package/features/reorder-columns.d.ts +1 -0
  55. package/features/reorder-columns.d.ts.map +1 -0
  56. package/features/reorder-columns.js +2 -0
  57. package/features/reorder-columns.js.map +1 -0
  58. package/features/reorder-rows.d.ts +1 -0
  59. package/features/reorder-rows.d.ts.map +1 -0
  60. package/features/reorder-rows.js +2 -0
  61. package/features/reorder-rows.js.map +1 -0
  62. package/features/reorder.d.ts +3 -17
  63. package/features/reorder.d.ts.map +1 -1
  64. package/features/reorder.js +1 -3
  65. package/features/reorder.js.map +1 -1
  66. package/features/responsive.d.ts +0 -23
  67. package/features/responsive.d.ts.map +1 -1
  68. package/features/responsive.js +1 -3
  69. package/features/responsive.js.map +1 -1
  70. package/features/row-reorder.d.ts +3 -17
  71. package/features/row-reorder.d.ts.map +1 -1
  72. package/features/row-reorder.js +1 -3
  73. package/features/row-reorder.js.map +1 -1
  74. package/features/selection.d.ts.map +1 -1
  75. package/features/selection.js +20 -22
  76. package/features/selection.js.map +1 -1
  77. package/features/server-side.d.ts +0 -21
  78. package/features/server-side.d.ts.map +1 -1
  79. package/features/server-side.js +1 -3
  80. package/features/server-side.js.map +1 -1
  81. package/features/tree.d.ts +0 -22
  82. package/features/tree.d.ts.map +1 -1
  83. package/features/tree.js +1 -3
  84. package/features/tree.js.map +1 -1
  85. package/features/undo-redo.d.ts.map +1 -1
  86. package/features/undo-redo.js +10 -12
  87. package/features/undo-redo.js.map +1 -1
  88. package/features/visibility.d.ts +0 -19
  89. package/features/visibility.d.ts.map +1 -1
  90. package/features/visibility.js +1 -3
  91. package/features/visibility.js.map +1 -1
  92. package/index.js +86 -72
  93. package/index.js.map +1 -1
  94. package/lib/TbwGrid.vue.d.ts +5 -1
  95. package/lib/TbwGrid.vue.d.ts.map +1 -1
  96. package/lib/feature-props.d.ts +12 -4
  97. package/lib/feature-props.d.ts.map +1 -1
  98. package/lib/feature-registry.d.ts +6 -51
  99. package/lib/feature-registry.d.ts.map +1 -1
  100. package/package.json +1 -1
  101. package/chunks/feature-registry-BgEOysSJ.js +0 -38
  102. package/chunks/feature-registry-BgEOysSJ.js.map +0 -1
@@ -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
@@ -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
@@ -1,4 +1,2 @@
1
- import { PivotPlugin as i } from "@toolbox-web/grid/plugins/pivot";
2
- import { r as o } from "../chunks/feature-registry-BgEOysSJ.js";
3
- o("pivot", (r) => new i(r ?? void 0));
1
+ import "@toolbox-web/grid/features/pivot";
4
2
  //# sourceMappingURL=pivot.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pivot.js","sources":["../../../../libs/grid-vue/src/features/pivot.ts"],"sourcesContent":["/**\n * Pivot feature for @toolbox-web/grid-vue\n *\n * Import this module to enable the `pivot` prop on TbwGrid.\n *\n * @example\n * ```vue\n * <script setup>\n * import '@toolbox-web/grid-vue/features/pivot';\n * </script>\n *\n * <template>\n * <TbwGrid :pivot=\"{\n * rowFields: ['category'],\n * columnFields: ['year'],\n * valueField: 'sales',\n * }\" />\n * </template>\n * ```\n *\n * @packageDocumentation\n */\n\nimport { PivotPlugin } from '@toolbox-web/grid/plugins/pivot';\nimport { registerFeature } from '../lib/feature-registry';\n\nregisterFeature('pivot', (config) => {\n return new PivotPlugin(config ?? undefined);\n});\n"],"names":["registerFeature","config","PivotPlugin"],"mappings":";;AA0BAA,EAAgB,SAAS,CAACC,MACjB,IAAIC,EAAYD,KAAU,MAAS,CAC3C;"}
1
+ {"version":3,"file":"pivot.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -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,EAAe,KAAK,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAYhF;;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"}
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 { PrintPlugin as e } from "@toolbox-web/grid/plugins/print";
2
- import { inject as o, ref as u } from "vue";
3
- import { r as g } from "../chunks/feature-registry-BgEOysSJ.js";
4
- import { G as p } from "../chunks/use-grid-B59B6XdD.js";
5
- g("print", (r) => r === !0 ? new e() : new e(r ?? void 0));
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 t = n();
11
- if (!t) {
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 t.print(i);
18
+ await r.print(i);
21
19
  },
22
20
  isPrinting: () => n()?.isPrinting() ?? !1
23
21
  };
24
22
  }
25
23
  export {
26
- d as useGridPrint
24
+ s as useGridPrint
27
25
  };
28
26
  //# sourceMappingURL=print.js.map
@@ -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 { registerFeature } from '../lib/feature-registry';\nimport { GRID_ELEMENT_KEY } from '../lib/use-grid';\n\nregisterFeature('print', (config) => {\n if (config === true) {\n return new PrintPlugin();\n }\n return new PrintPlugin(config ?? undefined);\n});\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":["registerFeature","config","PrintPlugin","useGridPrint","gridElement","inject","GRID_ELEMENT_KEY","ref","getPlugin","params","plugin"],"mappings":";;;;AAuCAA,EAAgB,SAAS,CAACC,MACpBA,MAAW,KACN,IAAIC,EAAA,IAEN,IAAIA,EAAYD,KAAU,MAAS,CAC3C;AA4CM,SAASE,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;"}
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,2 @@
1
+ import "@toolbox-web/grid/features/reorder-columns";
2
+ //# sourceMappingURL=reorder-columns.js.map
@@ -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,2 @@
1
+ import "@toolbox-web/grid/features/reorder-rows";
2
+ //# sourceMappingURL=reorder-rows.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reorder-rows.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,20 +1,6 @@
1
1
  /**
2
- * Column reorder feature for @toolbox-web/grid-vue
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;;;;;;;;;;;;;;;;;GAiBG"}
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"}
@@ -1,4 +1,2 @@
1
- import { ReorderPlugin as e } from "@toolbox-web/grid/plugins/reorder";
2
- import { r as t } from "../chunks/feature-registry-BgEOysSJ.js";
3
- t("reorder", (r) => r === !0 ? new e() : new e(r ?? void 0));
1
+
4
2
  //# sourceMappingURL=reorder.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"reorder.js","sources":["../../../../libs/grid-vue/src/features/reorder.ts"],"sourcesContent":["/**\n * Column reorder feature for @toolbox-web/grid-vue\n *\n * Import this module to enable the `reorder` prop on TbwGrid.\n *\n * @example\n * ```vue\n * <script setup>\n * import '@toolbox-web/grid-vue/features/reorder';\n * </script>\n *\n * <template>\n * <TbwGrid reorder />\n * </template>\n * ```\n *\n * @packageDocumentation\n */\n\nimport { ReorderPlugin } from '@toolbox-web/grid/plugins/reorder';\nimport { registerFeature } from '../lib/feature-registry';\n\nregisterFeature('reorder', (config) => {\n if (config === true) {\n return new ReorderPlugin();\n }\n return new ReorderPlugin(config ?? undefined);\n});\n"],"names":["registerFeature","config","ReorderPlugin"],"mappings":";;AAsBAA,EAAgB,WAAW,CAACC,MACtBA,MAAW,KACN,IAAIC,EAAA,IAEN,IAAIA,EAAcD,KAAU,MAAS,CAC7C;"}
1
+ {"version":3,"file":"reorder.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -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"}
@@ -1,4 +1,2 @@
1
- import { ResponsivePlugin as e } from "@toolbox-web/grid/plugins/responsive";
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":["../../../../libs/grid-vue/src/features/responsive.ts"],"sourcesContent":["/**\n * Responsive feature for @toolbox-web/grid-vue\n *\n * Import this module to enable the `responsive` prop on TbwGrid.\n *\n * @example\n * ```vue\n * <script setup>\n * import '@toolbox-web/grid-vue/features/responsive';\n * import { h } from 'vue';\n * </script>\n *\n * <template>\n * <TbwGrid :responsive=\"{\n * breakpoint: 768,\n * cardRenderer: (row) => h(EmployeeCard, { employee: row }),\n * }\" />\n * </template>\n * ```\n *\n * @packageDocumentation\n */\n\nimport { ResponsivePlugin } from '@toolbox-web/grid/plugins/responsive';\nimport { registerFeature } from '../lib/feature-registry';\n\nregisterFeature('responsive', (config) => {\n if (config === true) {\n return new ResponsivePlugin();\n }\n return new ResponsivePlugin(config ?? undefined);\n});\n"],"names":["registerFeature","config","ResponsivePlugin"],"mappings":";;AA0BAA,EAAgB,cAAc,CAACC,MACzBA,MAAW,KACN,IAAIC,EAAA,IAEN,IAAIA,EAAiBD,KAAU,MAAS,CAChD;"}
1
+ {"version":3,"file":"responsive.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,20 +1,6 @@
1
1
  /**
2
- * Row reorder feature for @toolbox-web/grid-vue
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;;;;;;;;;;;;;;;;;GAiBG"}
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"}
@@ -1,4 +1,2 @@
1
- import { RowReorderPlugin as e } from "@toolbox-web/grid/plugins/row-reorder";
2
- import { r as o } from "../chunks/feature-registry-BgEOysSJ.js";
3
- o("rowReorder", (r) => r === !0 ? new e() : new e(r ?? void 0));
1
+
4
2
  //# sourceMappingURL=row-reorder.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"row-reorder.js","sources":["../../../../libs/grid-vue/src/features/row-reorder.ts"],"sourcesContent":["/**\n * Row reorder feature for @toolbox-web/grid-vue\n *\n * Import this module to enable the `rowReorder` prop on TbwGrid.\n *\n * @example\n * ```vue\n * <script setup>\n * import '@toolbox-web/grid-vue/features/row-reorder';\n * </script>\n *\n * <template>\n * <TbwGrid rowReorder />\n * </template>\n * ```\n *\n * @packageDocumentation\n */\n\nimport { RowReorderPlugin } from '@toolbox-web/grid/plugins/row-reorder';\nimport { registerFeature } from '../lib/feature-registry';\n\nregisterFeature('rowReorder', (config) => {\n if (config === true) {\n return new RowReorderPlugin();\n }\n return new RowReorderPlugin(config ?? undefined);\n});\n"],"names":["registerFeature","config","RowReorderPlugin"],"mappings":";;AAsBAA,EAAgB,cAAc,CAACC,MACzBA,MAAW,KACN,IAAIC,EAAA,IAEN,IAAIA,EAAiBD,KAAU,MAAS,CAChD;"}
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,EAAmB,KAAK,SAAS,EAAE,KAAK,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAc5G;;;;;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"}
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"}
@@ -1,13 +1,11 @@
1
- import { SelectionPlugin as c } from "@toolbox-web/grid/plugins/selection";
2
- import { inject as u, ref as g } from "vue";
3
- import { r as d } from "../chunks/feature-registry-BgEOysSJ.js";
4
- import { G as a } from "../chunks/use-grid-B59B6XdD.js";
5
- d("selection", (t) => t === "cell" || t === "row" || t === "range" ? new c({ mode: t }) : new c(t ?? void 0));
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 = n();
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 o = t.value, s = e.config?.mode;
21
- if (s === "row") {
22
- const l = o?.rows?.length ?? 0, r = /* @__PURE__ */ new Set();
23
- for (let i = 0; i < l; i++) r.add(i);
24
- e.selected = r, e.requestAfterRender?.();
25
- } else if (s === "range") {
26
- const l = o?.rows?.length ?? 0, r = o?._columns?.length ?? 0;
27
- l > 0 && r > 0 && e.setRanges([{ from: { row: 0, col: 0 }, to: { row: l - 1, col: r - 1 } }]);
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
- n()?.clearSelection();
29
+ t()?.clearSelection();
32
30
  },
33
- getSelection: () => n()?.getSelection() ?? null,
34
- isCellSelected: (e, o) => n()?.isCellSelected(e, o) ?? !1,
31
+ getSelection: () => t()?.getSelection() ?? null,
32
+ isCellSelected: (e, n) => t()?.isCellSelected(e, n) ?? !1,
35
33
  setRanges: (e) => {
36
- n()?.setRanges(e);
34
+ t()?.setRanges(e);
37
35
  },
38
- getSelectedRows: () => n()?.getSelectedRows() ?? []
36
+ getSelectedRows: () => t()?.getSelectedRows() ?? []
39
37
  };
40
38
  }
41
39
  export {
42
- R as useGridSelection
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 { registerFeature } from '../lib/feature-registry';\nimport { GRID_ELEMENT_KEY } from '../lib/use-grid';\n\nregisterFeature('selection', (config) => {\n // Handle shorthand: 'cell', 'row', 'range'\n if (config === 'cell' || config === 'row' || config === 'range') {\n return new SelectionPlugin({ mode: config });\n }\n // Full config object\n return new SelectionPlugin(config ?? undefined);\n});\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":["registerFeature","config","SelectionPlugin","useGridSelection","gridElement","inject","GRID_ELEMENT_KEY","ref","getPlugin","plugin","grid","mode","rowCount","allIndices","colCount","row","col","ranges"],"mappings":";;;;AAuCAA,EAAgB,aAAa,CAACC,MAExBA,MAAW,UAAUA,MAAW,SAASA,MAAW,UAC/C,IAAIC,EAAgB,EAAE,MAAMD,GAAQ,IAGtC,IAAIC,EAAgBD,KAAU,MAAS,CAC/C;AAoEM,SAASE,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,iBAAS,IAAI,GAAG,IAAID,GAAU,IAAK,CAAAC,EAAW,IAAI,CAAC;AAClD,QAAAJ,EAAe,WAAWI,GAC1BJ,EAAe,qBAAA;AAAA,MAClB,WAAWE,MAAS,SAAS;AAC3B,cAAMC,IAAWF,GAAM,MAAM,UAAU,GACjCI,IAAYJ,GAAc,UAAU,UAAU;AACpD,QAAIE,IAAW,KAAKE,IAAW,KAC7BL,EAAO,UAAU,CAAC,EAAE,MAAM,EAAE,KAAK,GAAG,KAAK,EAAA,GAAK,IAAI,EAAE,KAAKG,IAAW,GAAG,KAAKE,IAAW,EAAA,EAAE,CAAG,CAAC;AAAA,MAEjG;AAAA,IACF;AAAA,IAEA,gBAAgB,MAAM;AACpB,MAAAN,EAAA,GAAa,eAAA;AAAA,IACf;AAAA,IAEA,cAAc,MACLA,EAAA,GAAa,aAAA,KAAkB;AAAA,IAGxC,gBAAgB,CAACO,GAAaC,MACrBR,EAAA,GAAa,eAAeO,GAAKC,CAAG,KAAK;AAAA,IAGlD,WAAW,CAACC,MAAwB;AAClC,MAAAT,EAAA,GAAa,UAAUS,CAAM;AAAA,IAC/B;AAAA,IAEA,iBAAiB,MACRT,EAAA,GAAa,gBAAA,KAA2B,CAAA;AAAA,EACjD;AAEJ;"}
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"}
@@ -1,4 +1,2 @@
1
- import { ServerSidePlugin as e } from "@toolbox-web/grid/plugins/server-side";
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":["../../../../libs/grid-vue/src/features/server-side.ts"],"sourcesContent":["/**\n * Server-side feature for @toolbox-web/grid-vue\n *\n * Import this module to enable the `serverSide` prop on TbwGrid.\n *\n * @example\n * ```vue\n * <script setup>\n * import '@toolbox-web/grid-vue/features/server-side';\n * </script>\n *\n * <template>\n * <TbwGrid :serverSide=\"{\n * dataSource: async (params) => fetchData(params),\n * }\" />\n * </template>\n * ```\n *\n * @packageDocumentation\n */\n\nimport { ServerSidePlugin } from '@toolbox-web/grid/plugins/server-side';\nimport { registerFeature } from '../lib/feature-registry';\n\nregisterFeature('serverSide', (config) => {\n return new ServerSidePlugin(config ?? undefined);\n});\n"],"names":["registerFeature","config","ServerSidePlugin"],"mappings":";;AAwBAA,EAAgB,cAAc,CAACC,MACtB,IAAIC,EAAiBD,KAAU,MAAS,CAChD;"}
1
+ {"version":3,"file":"server-side.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -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
@@ -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 { TreePlugin as e } from "@toolbox-web/grid/plugins/tree";
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
@@ -1 +1 @@
1
- {"version":3,"file":"tree.js","sources":["../../../../libs/grid-vue/src/features/tree.ts"],"sourcesContent":["/**\n * Tree view feature for @toolbox-web/grid-vue\n *\n * Import this module to enable the `tree` prop on TbwGrid.\n *\n * @example\n * ```vue\n * <script setup>\n * import '@toolbox-web/grid-vue/features/tree';\n * </script>\n *\n * <template>\n * <TbwGrid :tree=\"{\n * childrenField: 'children',\n * defaultExpanded: true,\n * }\" />\n * </template>\n * ```\n *\n * @packageDocumentation\n */\n\nimport { TreePlugin } from '@toolbox-web/grid/plugins/tree';\nimport { registerFeature } from '../lib/feature-registry';\n\nregisterFeature('tree', (config) => {\n if (config === true) {\n return new TreePlugin();\n }\n return new TreePlugin(config ?? undefined);\n});\n"],"names":["registerFeature","config","TreePlugin"],"mappings":";;AAyBAA,EAAgB,QAAQ,CAACC,MACnBA,MAAW,KACN,IAAIC,EAAA,IAEN,IAAIA,EAAWD,KAAU,MAAS,CAC1C;"}
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,EAAkB,KAAK,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAY1F;;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"}
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"}
@@ -1,10 +1,8 @@
1
- import { UndoRedoPlugin as r } from "@toolbox-web/grid/plugins/undo-redo";
2
- import { inject as l, ref as c } from "vue";
3
- import { r as g } from "../chunks/feature-registry-BgEOysSJ.js";
4
- import { G as a } from "../chunks/use-grid-B59B6XdD.js";
5
- g("undoRedo", (d) => d === !0 ? new r() : new r(d ?? void 0));
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, t, u) => {
45
- const e = o();
46
- if (!e) {
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
- e.recordEdit(n, i, t, u);
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
- w as useGridUndoRedo
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 { registerFeature } from '../lib/feature-registry';\nimport { GRID_ELEMENT_KEY } from '../lib/use-grid';\n\nregisterFeature('undoRedo', (config) => {\n if (config === true) {\n return new UndoRedoPlugin();\n }\n return new UndoRedoPlugin(config ?? undefined);\n});\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":["registerFeature","config","UndoRedoPlugin","useGridUndoRedo","gridElement","inject","GRID_ELEMENT_KEY","ref","getPlugin","plugin","rowIndex","field","oldValue","newValue"],"mappings":";;;;AAwCAA,EAAgB,YAAY,CAACC,MACvBA,MAAW,KACN,IAAIC,EAAA,IAEN,IAAIA,EAAeD,KAAU,MAAS,CAC9C;AAuFM,SAASE,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;"}
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;"}
@@ -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"}
@@ -1,4 +1,2 @@
1
- import { VisibilityPlugin as r } from "@toolbox-web/grid/plugins/visibility";
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":["../../../../libs/grid-vue/src/features/visibility.ts"],"sourcesContent":["/**\n * Column visibility feature for @toolbox-web/grid-vue\n *\n * Import this module to enable the `visibility` prop on TbwGrid.\n *\n * @example\n * ```vue\n * <script setup>\n * import '@toolbox-web/grid-vue/features/visibility';\n * </script>\n *\n * <template>\n * <TbwGrid visibility />\n * </template>\n * ```\n *\n * @packageDocumentation\n */\n\nimport { VisibilityPlugin } from '@toolbox-web/grid/plugins/visibility';\nimport { registerFeature } from '../lib/feature-registry';\n\nregisterFeature('visibility', (config) => {\n if (config === true) {\n return new VisibilityPlugin();\n }\n return new VisibilityPlugin(config ?? undefined);\n});\n"],"names":["registerFeature","config","VisibilityPlugin"],"mappings":";;AAsBAA,EAAgB,cAAc,CAACC,MACzBA,MAAW,KACN,IAAIC,EAAA,IAEN,IAAIA,EAAiBD,KAAU,MAAS,CAChD;"}
1
+ {"version":3,"file":"visibility.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}