@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,9 +1,9 @@
1
1
  /**
2
2
  * Feature Registry for @toolbox-web/grid-vue
3
3
  *
4
- * This module provides a synchronous registry for plugin factories.
5
- * Features are registered via side-effect imports, enabling tree-shaking
6
- * while maintaining the clean prop-based API.
4
+ * Delegates to the core registry at `@toolbox-web/grid/features/registry`.
5
+ * This module re-exports core functions so existing feature modules continue
6
+ * to work without changing their import paths.
7
7
  *
8
8
  * @example
9
9
  * ```typescript
@@ -15,55 +15,10 @@
15
15
  * <TbwGrid :selection="'range'" :filtering="{ debounceMs: 200 }" />
16
16
  * ```
17
17
  */
18
+ export { clearFeatureRegistry, createPluginFromFeature, getFeatureFactory, getRegisteredFeatures, isFeatureRegistered, registerFeature } from '@toolbox-web/grid/features/registry';
19
+ export type { PluginFactory } from '@toolbox-web/grid/features/registry';
18
20
  /**
19
21
  * Feature names supported by the TbwGrid component.
20
22
  */
21
- export type FeatureName = 'selection' | 'editing' | 'clipboard' | 'contextMenu' | 'multiSort' | 'sorting' | 'filtering' | 'reorder' | 'visibility' | 'pinnedColumns' | 'groupingColumns' | 'columnVirtualization' | 'rowReorder' | 'groupingRows' | 'pinnedRows' | 'tree' | 'masterDetail' | 'responsive' | 'undoRedo' | 'export' | 'print' | 'pivot' | 'serverSide';
22
- /**
23
- * Plugin factory function type.
24
- * Takes configuration and returns a plugin instance.
25
- */
26
- export type PluginFactory<TConfig = unknown> = (config: TConfig) => unknown;
27
- /**
28
- * Register a feature's plugin factory.
29
- * Called by side-effect feature imports.
30
- *
31
- * @param name - The feature name (matches the prop name on TbwGrid)
32
- * @param factory - Function that creates the plugin instance
33
- *
34
- * @example
35
- * ```ts
36
- * // features/selection.ts
37
- * import { SelectionPlugin } from '@toolbox-web/grid/plugins/selection';
38
- * import { registerFeature } from '../lib/feature-registry';
39
- *
40
- * registerFeature('selection', (config) => new SelectionPlugin(config));
41
- * ```
42
- */
43
- export declare function registerFeature<TConfig = unknown>(name: FeatureName, factory: PluginFactory<TConfig>): void;
44
- /**
45
- * Check if a feature is registered.
46
- */
47
- export declare function isFeatureRegistered(name: FeatureName): boolean;
48
- /**
49
- * Get all registered feature names.
50
- */
51
- export declare function getRegisteredFeatures(): FeatureName[];
52
- /**
53
- * Get the factory for a feature, if registered.
54
- */
55
- export declare function getFeatureFactory(name: FeatureName): PluginFactory | undefined;
56
- /**
57
- * Create a plugin from a feature prop.
58
- * Returns undefined if the feature is not registered (with a console warning).
59
- *
60
- * @param name - Feature name
61
- * @param config - Configuration value from the prop
62
- */
63
- export declare function createPluginFromFeature(name: FeatureName, config: unknown): unknown | undefined;
64
- /**
65
- * Clear the feature registry.
66
- * @internal - for testing only
67
- */
68
- export declare function clearFeatureRegistry(): void;
23
+ export type FeatureName = 'selection' | 'editing' | 'clipboard' | 'contextMenu' | 'multiSort' | 'sorting' | 'filtering' | 'reorderColumns' | 'reorder' | 'visibility' | 'pinnedColumns' | 'groupingColumns' | 'columnVirtualization' | 'reorderRows' | 'rowReorder' | 'groupingRows' | 'pinnedRows' | 'tree' | 'masterDetail' | 'responsive' | 'undoRedo' | 'export' | 'print' | 'pivot' | 'serverSide';
69
24
  //# sourceMappingURL=feature-registry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"feature-registry.d.ts","sourceRoot":"","sources":["../../../../libs/grid-vue/src/lib/feature-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH;;GAEG;AACH,MAAM,MAAM,WAAW,GACnB,WAAW,GACX,SAAS,GACT,WAAW,GACX,aAAa,GACb,WAAW,GACX,SAAS,GACT,WAAW,GACX,SAAS,GACT,YAAY,GACZ,eAAe,GACf,iBAAiB,GACjB,sBAAsB,GACtB,YAAY,GACZ,cAAc,GACd,YAAY,GACZ,MAAM,GACN,cAAc,GACd,YAAY,GACZ,UAAU,GACV,QAAQ,GACR,OAAO,GACP,OAAO,GACP,YAAY,CAAC;AAEjB;;;GAGG;AACH,MAAM,MAAM,aAAa,CAAC,OAAO,GAAG,OAAO,IAAI,CAAC,MAAM,EAAE,OAAO,KAAK,OAAO,CAAC;AAuB5E;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,eAAe,CAAC,OAAO,GAAG,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,CAAC,OAAO,CAAC,GAAG,IAAI,CAK3G;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAE9D;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,WAAW,EAAE,CAErD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,WAAW,GAAG,aAAa,GAAG,SAAS,CAE9E;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,CAgB/F;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAG3C"}
1
+ {"version":3,"file":"feature-registry.d.ts","sourceRoot":"","sources":["../../../../libs/grid-vue/src/lib/feature-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EACL,oBAAoB,EAAE,uBAAuB,EAAE,iBAAiB,EAChE,qBAAqB,EAAE,mBAAmB,EAAE,eAAe,EAC5D,MAAM,qCAAqC,CAAC;AAE7C,YAAY,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAEzE;;GAEG;AACH,MAAM,MAAM,WAAW,GACnB,WAAW,GACX,SAAS,GACT,WAAW,GACX,aAAa,GACb,WAAW,GACX,SAAS,GACT,WAAW,GACX,gBAAgB,GAChB,SAAS,GACT,YAAY,GACZ,eAAe,GACf,iBAAiB,GACjB,sBAAsB,GACtB,aAAa,GACb,YAAY,GACZ,cAAc,GACd,YAAY,GACZ,MAAM,GACN,cAAc,GACd,YAAY,GACZ,UAAU,GACV,QAAQ,GACR,OAAO,GACP,OAAO,GACP,YAAY,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toolbox-web/grid-vue",
3
- "version": "0.7.1",
3
+ "version": "0.8.0",
4
4
  "description": "Vue 3 adapter for @toolbox-web/grid data grid component",
5
5
  "type": "module",
6
6
  "main": "./index.js",
@@ -1,38 +0,0 @@
1
- const r = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set();
2
- function n(e, t) {
3
- r.set(e, {
4
- factory: t,
5
- name: e
6
- });
7
- }
8
- function o(e) {
9
- return r.has(e);
10
- }
11
- function u() {
12
- return Array.from(r.keys());
13
- }
14
- function i(e) {
15
- return r.get(e)?.factory;
16
- }
17
- function c(e, t) {
18
- const s = r.get(e);
19
- if (!s) {
20
- a.has(e) || (a.add(e), console.warn(
21
- `[TbwGrid] Feature "${e}" is not registered. Import '@toolbox-web/grid-vue/features/${e}' to enable it.`
22
- ));
23
- return;
24
- }
25
- return s.factory(t);
26
- }
27
- function f() {
28
- r.clear(), a.clear();
29
- }
30
- export {
31
- f as a,
32
- u as b,
33
- c,
34
- i as g,
35
- o as i,
36
- n as r
37
- };
38
- //# sourceMappingURL=feature-registry-BgEOysSJ.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"feature-registry-BgEOysSJ.js","sources":["../../../../libs/grid-vue/src/lib/feature-registry.ts"],"sourcesContent":["/**\n * Feature Registry for @toolbox-web/grid-vue\n *\n * This module provides a synchronous registry for plugin factories.\n * Features are registered via side-effect imports, enabling tree-shaking\n * while maintaining the clean prop-based API.\n *\n * @example\n * ```typescript\n * // Import features you need (side-effect imports)\n * import '@toolbox-web/grid-vue/features/selection';\n * import '@toolbox-web/grid-vue/features/filtering';\n *\n * // Props work automatically - no async loading, no HTTP requests\n * <TbwGrid :selection=\"'range'\" :filtering=\"{ debounceMs: 200 }\" />\n * ```\n */\n\n/**\n * Feature names supported by the TbwGrid component.\n */\nexport type FeatureName =\n | 'selection'\n | 'editing'\n | 'clipboard'\n | 'contextMenu'\n | 'multiSort'\n | 'sorting' // @deprecated - use 'multiSort' instead\n | 'filtering'\n | 'reorder'\n | 'visibility'\n | 'pinnedColumns'\n | 'groupingColumns'\n | 'columnVirtualization'\n | 'rowReorder'\n | 'groupingRows'\n | 'pinnedRows'\n | 'tree'\n | 'masterDetail'\n | 'responsive'\n | 'undoRedo'\n | 'export'\n | 'print'\n | 'pivot'\n | 'serverSide';\n\n/**\n * Plugin factory function type.\n * Takes configuration and returns a plugin instance.\n */\nexport type PluginFactory<TConfig = unknown> = (config: TConfig) => unknown;\n\n/**\n * Registry entry containing the factory and metadata.\n */\ninterface RegistryEntry {\n factory: PluginFactory;\n /** Feature name for debugging */\n name: string;\n}\n\n/**\n * Central registry mapping feature names to their plugin factories.\n * Populated by side-effect feature imports.\n */\nconst featureRegistry = new Map<FeatureName, RegistryEntry>();\n\n/**\n * Set of features that have been used without being registered.\n * Used to show helpful warnings only once per feature.\n */\nconst warnedFeatures = new Set<string>();\n\n/**\n * Register a feature's plugin factory.\n * Called by side-effect feature imports.\n *\n * @param name - The feature name (matches the prop name on TbwGrid)\n * @param factory - Function that creates the plugin instance\n *\n * @example\n * ```ts\n * // features/selection.ts\n * import { SelectionPlugin } from '@toolbox-web/grid/plugins/selection';\n * import { registerFeature } from '../lib/feature-registry';\n *\n * registerFeature('selection', (config) => new SelectionPlugin(config));\n * ```\n */\nexport function registerFeature<TConfig = unknown>(name: FeatureName, factory: PluginFactory<TConfig>): void {\n featureRegistry.set(name, {\n factory: factory as PluginFactory,\n name,\n });\n}\n\n/**\n * Check if a feature is registered.\n */\nexport function isFeatureRegistered(name: FeatureName): boolean {\n return featureRegistry.has(name);\n}\n\n/**\n * Get all registered feature names.\n */\nexport function getRegisteredFeatures(): FeatureName[] {\n return Array.from(featureRegistry.keys());\n}\n\n/**\n * Get the factory for a feature, if registered.\n */\nexport function getFeatureFactory(name: FeatureName): PluginFactory | undefined {\n return featureRegistry.get(name)?.factory;\n}\n\n/**\n * Create a plugin from a feature prop.\n * Returns undefined if the feature is not registered (with a console warning).\n *\n * @param name - Feature name\n * @param config - Configuration value from the prop\n */\nexport function createPluginFromFeature(name: FeatureName, config: unknown): unknown | undefined {\n const entry = featureRegistry.get(name);\n\n if (!entry) {\n // Only warn once per feature\n if (!warnedFeatures.has(name)) {\n warnedFeatures.add(name);\n console.warn(\n `[TbwGrid] Feature \"${name}\" is not registered. ` +\n `Import '@toolbox-web/grid-vue/features/${name}' to enable it.`,\n );\n }\n return undefined;\n }\n\n return entry.factory(config);\n}\n\n/**\n * Clear the feature registry.\n * @internal - for testing only\n */\nexport function clearFeatureRegistry(): void {\n featureRegistry.clear();\n warnedFeatures.clear();\n}\n"],"names":["featureRegistry","warnedFeatures","registerFeature","name","factory","isFeatureRegistered","getRegisteredFeatures","getFeatureFactory","createPluginFromFeature","config","entry","clearFeatureRegistry"],"mappings":"AAiEA,MAAMA,wBAAsB,IAAA,GAMtBC,wBAAqB,IAAA;AAkBpB,SAASC,EAAmCC,GAAmBC,GAAuC;AAC3G,EAAAJ,EAAgB,IAAIG,GAAM;AAAA,IACxB,SAAAC;AAAA,IACA,MAAAD;AAAA,EAAA,CACD;AACH;AAKO,SAASE,EAAoBF,GAA4B;AAC9D,SAAOH,EAAgB,IAAIG,CAAI;AACjC;AAKO,SAASG,IAAuC;AACrD,SAAO,MAAM,KAAKN,EAAgB,KAAA,CAAM;AAC1C;AAKO,SAASO,EAAkBJ,GAA8C;AAC9E,SAAOH,EAAgB,IAAIG,CAAI,GAAG;AACpC;AASO,SAASK,EAAwBL,GAAmBM,GAAsC;AAC/F,QAAMC,IAAQV,EAAgB,IAAIG,CAAI;AAEtC,MAAI,CAACO,GAAO;AAEV,IAAKT,EAAe,IAAIE,CAAI,MAC1BF,EAAe,IAAIE,CAAI,GACvB,QAAQ;AAAA,MACN,sBAAsBA,CAAI,+DACkBA,CAAI;AAAA,IAAA;AAGpD;AAAA,EACF;AAEA,SAAOO,EAAM,QAAQD,CAAM;AAC7B;AAMO,SAASE,IAA6B;AAC3C,EAAAX,EAAgB,MAAA,GAChBC,EAAe,MAAA;AACjB;"}