@toolbox-web/grid-angular 1.3.1 → 1.4.1

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/README.md +146 -54
  2. package/fesm2022/toolbox-web-grid-angular-features-clipboard.mjs +58 -0
  3. package/fesm2022/toolbox-web-grid-angular-features-clipboard.mjs.map +1 -1
  4. package/fesm2022/toolbox-web-grid-angular-features-column-virtualization.mjs +37 -0
  5. package/fesm2022/toolbox-web-grid-angular-features-column-virtualization.mjs.map +1 -1
  6. package/fesm2022/toolbox-web-grid-angular-features-context-menu.mjs +51 -0
  7. package/fesm2022/toolbox-web-grid-angular-features-context-menu.mjs.map +1 -1
  8. package/fesm2022/toolbox-web-grid-angular-features-editing.mjs +115 -1
  9. package/fesm2022/toolbox-web-grid-angular-features-editing.mjs.map +1 -1
  10. package/fesm2022/toolbox-web-grid-angular-features-export.mjs +55 -2
  11. package/fesm2022/toolbox-web-grid-angular-features-export.mjs.map +1 -1
  12. package/fesm2022/toolbox-web-grid-angular-features-filtering.mjs +159 -5
  13. package/fesm2022/toolbox-web-grid-angular-features-filtering.mjs.map +1 -1
  14. package/fesm2022/toolbox-web-grid-angular-features-grouping-columns.mjs +83 -0
  15. package/fesm2022/toolbox-web-grid-angular-features-grouping-columns.mjs.map +1 -1
  16. package/fesm2022/toolbox-web-grid-angular-features-grouping-rows.mjs +82 -0
  17. package/fesm2022/toolbox-web-grid-angular-features-grouping-rows.mjs.map +1 -1
  18. package/fesm2022/toolbox-web-grid-angular-features-master-detail.mjs +115 -2
  19. package/fesm2022/toolbox-web-grid-angular-features-master-detail.mjs.map +1 -1
  20. package/fesm2022/toolbox-web-grid-angular-features-multi-sort.mjs +38 -0
  21. package/fesm2022/toolbox-web-grid-angular-features-multi-sort.mjs.map +1 -1
  22. package/fesm2022/toolbox-web-grid-angular-features-pinned-columns.mjs +37 -0
  23. package/fesm2022/toolbox-web-grid-angular-features-pinned-columns.mjs.map +1 -1
  24. package/fesm2022/toolbox-web-grid-angular-features-pinned-rows.mjs +103 -0
  25. package/fesm2022/toolbox-web-grid-angular-features-pinned-rows.mjs.map +1 -1
  26. package/fesm2022/toolbox-web-grid-angular-features-pivot.mjs +36 -0
  27. package/fesm2022/toolbox-web-grid-angular-features-pivot.mjs.map +1 -1
  28. package/fesm2022/toolbox-web-grid-angular-features-print.mjs +58 -2
  29. package/fesm2022/toolbox-web-grid-angular-features-print.mjs.map +1 -1
  30. package/fesm2022/toolbox-web-grid-angular-features-reorder-columns.mjs +52 -0
  31. package/fesm2022/toolbox-web-grid-angular-features-reorder-columns.mjs.map +1 -1
  32. package/fesm2022/toolbox-web-grid-angular-features-reorder-rows.mjs +41 -0
  33. package/fesm2022/toolbox-web-grid-angular-features-reorder-rows.mjs.map +1 -1
  34. package/fesm2022/toolbox-web-grid-angular-features-responsive.mjs +112 -2
  35. package/fesm2022/toolbox-web-grid-angular-features-responsive.mjs.map +1 -1
  36. package/fesm2022/toolbox-web-grid-angular-features-row-drag-drop.mjs +77 -0
  37. package/fesm2022/toolbox-web-grid-angular-features-row-drag-drop.mjs.map +1 -1
  38. package/fesm2022/toolbox-web-grid-angular-features-selection.mjs +52 -2
  39. package/fesm2022/toolbox-web-grid-angular-features-selection.mjs.map +1 -1
  40. package/fesm2022/toolbox-web-grid-angular-features-server-side.mjs +36 -0
  41. package/fesm2022/toolbox-web-grid-angular-features-server-side.mjs.map +1 -1
  42. package/fesm2022/toolbox-web-grid-angular-features-tooltip.mjs +36 -0
  43. package/fesm2022/toolbox-web-grid-angular-features-tooltip.mjs.map +1 -1
  44. package/fesm2022/toolbox-web-grid-angular-features-tree.mjs +53 -0
  45. package/fesm2022/toolbox-web-grid-angular-features-tree.mjs.map +1 -1
  46. package/fesm2022/toolbox-web-grid-angular-features-undo-redo.mjs +57 -2
  47. package/fesm2022/toolbox-web-grid-angular-features-undo-redo.mjs.map +1 -1
  48. package/fesm2022/toolbox-web-grid-angular-features-visibility.mjs +53 -0
  49. package/fesm2022/toolbox-web-grid-angular-features-visibility.mjs.map +1 -1
  50. package/fesm2022/toolbox-web-grid-angular.mjs +1274 -727
  51. package/fesm2022/toolbox-web-grid-angular.mjs.map +1 -1
  52. package/package.json +1 -1
  53. package/types/toolbox-web-grid-angular-features-clipboard.d.ts +23 -0
  54. package/types/toolbox-web-grid-angular-features-clipboard.d.ts.map +1 -1
  55. package/types/toolbox-web-grid-angular-features-column-virtualization.d.ts +19 -0
  56. package/types/toolbox-web-grid-angular-features-column-virtualization.d.ts.map +1 -1
  57. package/types/toolbox-web-grid-angular-features-context-menu.d.ts +22 -0
  58. package/types/toolbox-web-grid-angular-features-context-menu.d.ts.map +1 -1
  59. package/types/toolbox-web-grid-angular-features-editing.d.ts +32 -0
  60. package/types/toolbox-web-grid-angular-features-editing.d.ts.map +1 -1
  61. package/types/toolbox-web-grid-angular-features-export.d.ts +21 -3
  62. package/types/toolbox-web-grid-angular-features-export.d.ts.map +1 -1
  63. package/types/toolbox-web-grid-angular-features-filtering.d.ts +67 -6
  64. package/types/toolbox-web-grid-angular-features-filtering.d.ts.map +1 -1
  65. package/types/toolbox-web-grid-angular-features-grouping-columns.d.ts +19 -0
  66. package/types/toolbox-web-grid-angular-features-grouping-columns.d.ts.map +1 -1
  67. package/types/toolbox-web-grid-angular-features-grouping-rows.d.ts +25 -0
  68. package/types/toolbox-web-grid-angular-features-grouping-rows.d.ts.map +1 -1
  69. package/types/toolbox-web-grid-angular-features-master-detail.d.ts +23 -0
  70. package/types/toolbox-web-grid-angular-features-master-detail.d.ts.map +1 -1
  71. package/types/toolbox-web-grid-angular-features-multi-sort.d.ts +19 -0
  72. package/types/toolbox-web-grid-angular-features-multi-sort.d.ts.map +1 -1
  73. package/types/toolbox-web-grid-angular-features-pinned-columns.d.ts +18 -0
  74. package/types/toolbox-web-grid-angular-features-pinned-columns.d.ts.map +1 -1
  75. package/types/toolbox-web-grid-angular-features-pinned-rows.d.ts +19 -0
  76. package/types/toolbox-web-grid-angular-features-pinned-rows.d.ts.map +1 -1
  77. package/types/toolbox-web-grid-angular-features-pivot.d.ts +19 -0
  78. package/types/toolbox-web-grid-angular-features-pivot.d.ts.map +1 -1
  79. package/types/toolbox-web-grid-angular-features-print.d.ts +22 -3
  80. package/types/toolbox-web-grid-angular-features-print.d.ts.map +1 -1
  81. package/types/toolbox-web-grid-angular-features-reorder-columns.d.ts +22 -0
  82. package/types/toolbox-web-grid-angular-features-reorder-columns.d.ts.map +1 -1
  83. package/types/toolbox-web-grid-angular-features-reorder-rows.d.ts +19 -0
  84. package/types/toolbox-web-grid-angular-features-reorder-rows.d.ts.map +1 -1
  85. package/types/toolbox-web-grid-angular-features-responsive.d.ts +22 -0
  86. package/types/toolbox-web-grid-angular-features-responsive.d.ts.map +1 -1
  87. package/types/toolbox-web-grid-angular-features-row-drag-drop.d.ts +27 -0
  88. package/types/toolbox-web-grid-angular-features-row-drag-drop.d.ts.map +1 -1
  89. package/types/toolbox-web-grid-angular-features-selection.d.ts +21 -3
  90. package/types/toolbox-web-grid-angular-features-selection.d.ts.map +1 -1
  91. package/types/toolbox-web-grid-angular-features-server-side.d.ts +19 -0
  92. package/types/toolbox-web-grid-angular-features-server-side.d.ts.map +1 -1
  93. package/types/toolbox-web-grid-angular-features-tooltip.d.ts +19 -0
  94. package/types/toolbox-web-grid-angular-features-tooltip.d.ts.map +1 -1
  95. package/types/toolbox-web-grid-angular-features-tree.d.ts +22 -0
  96. package/types/toolbox-web-grid-angular-features-tree.d.ts.map +1 -1
  97. package/types/toolbox-web-grid-angular-features-undo-redo.d.ts +22 -3
  98. package/types/toolbox-web-grid-angular-features-undo-redo.d.ts.map +1 -1
  99. package/types/toolbox-web-grid-angular-features-visibility.d.ts +22 -0
  100. package/types/toolbox-web-grid-angular-features-visibility.d.ts.map +1 -1
  101. package/types/toolbox-web-grid-angular.d.ts +939 -128
  102. package/types/toolbox-web-grid-angular.d.ts.map +1 -1
@@ -1,4 +1,39 @@
1
+ import { registerFeatureClaim, unregisterFeatureClaim, registerFeatureConfigPreprocessor, isComponentClass } from '@toolbox-web/grid-angular';
1
2
  import '@toolbox-web/grid/features/grouping-columns';
3
+ import * as i0 from '@angular/core';
4
+ import { inject, ElementRef, input, Directive } from '@angular/core';
5
+
6
+ /**
7
+ * `GridGroupingColumnsDirective` — owns `[groupingColumns]` on
8
+ * `<tbw-grid>`. No event outputs. See `GridFilteringDirective` for the
9
+ * full rationale.
10
+ *
11
+ * @category Directive
12
+ */
13
+ /**
14
+ * Owns the binding(s) `[groupingColumns]` on `<tbw-grid>` for the matching feature plugin. See {@link GridFilteringDirective} for the full rationale.
15
+ *
16
+ * @category Directive
17
+ */
18
+ class GridGroupingColumnsDirective {
19
+ elementRef = inject((ElementRef));
20
+ groupingColumns = input(...(ngDevMode ? [undefined, { debugName: "groupingColumns" }] : /* istanbul ignore next */ []));
21
+ constructor() {
22
+ registerFeatureClaim(this.elementRef.nativeElement, 'groupingColumns', () => this.groupingColumns());
23
+ }
24
+ ngOnDestroy() {
25
+ unregisterFeatureClaim(this.elementRef.nativeElement, 'groupingColumns');
26
+ }
27
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: GridGroupingColumnsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
28
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.5", type: GridGroupingColumnsDirective, isStandalone: true, selector: "tbw-grid[groupingColumns]", inputs: { groupingColumns: { classPropertyName: "groupingColumns", publicName: "groupingColumns", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
29
+ }
30
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: GridGroupingColumnsDirective, decorators: [{
31
+ type: Directive,
32
+ args: [{
33
+ selector: 'tbw-grid[groupingColumns]',
34
+ standalone: true,
35
+ }]
36
+ }], ctorParameters: () => [], propDecorators: { groupingColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupingColumns", required: false }] }] } });
2
37
 
3
38
  /**
4
39
  * Column grouping feature for @toolbox-web/grid-angular
@@ -14,8 +49,56 @@ import '@toolbox-web/grid/features/grouping-columns';
14
49
  *
15
50
  * @packageDocumentation
16
51
  */
52
+ /**
53
+ * Build a group-header renderer function from an Angular component class.
54
+ * The component should accept group header inputs (id, label, columns, firstIndex, isImplicit).
55
+ */
56
+ function buildGroupHeaderRenderer(adapter, componentClass) {
57
+ const mount = adapter.mountComponentRenderer(componentClass, (p) => ({
58
+ id: p.id,
59
+ label: p.label,
60
+ columns: p.columns,
61
+ firstIndex: p.firstIndex,
62
+ isImplicit: p.isImplicit,
63
+ }));
64
+ return (params) => mount(params).hostElement;
65
+ }
66
+ // Bridge any Angular component classes embedded in the user-supplied config
67
+ // (e.g. group-header renderers) to plain renderer functions before the core
68
+ // plugin factory consumes the config. Without this, raw component classes
69
+ // would be invoked without `new`, causing runtime errors.
70
+ registerFeatureConfigPreprocessor('groupingColumns', (config, adapter) => {
71
+ if (!config || typeof config !== 'object')
72
+ return config;
73
+ const cfg = config;
74
+ const processed = { ...cfg };
75
+ let changed = false;
76
+ // Bridge top-level groupHeaderRenderer component class
77
+ if (cfg.groupHeaderRenderer && isComponentClass(cfg.groupHeaderRenderer)) {
78
+ processed.groupHeaderRenderer = buildGroupHeaderRenderer(adapter, cfg.groupHeaderRenderer);
79
+ changed = true;
80
+ }
81
+ // Bridge per-group renderer component classes inside columnGroups
82
+ if (Array.isArray(cfg.columnGroups)) {
83
+ let groupChanged = false;
84
+ const mappedGroups = cfg.columnGroups.map((def) => {
85
+ if (def.renderer && isComponentClass(def.renderer)) {
86
+ groupChanged = true;
87
+ return { ...def, renderer: buildGroupHeaderRenderer(adapter, def.renderer) };
88
+ }
89
+ return def;
90
+ });
91
+ if (groupChanged) {
92
+ processed.columnGroups = mappedGroups;
93
+ changed = true;
94
+ }
95
+ }
96
+ return changed ? processed : cfg;
97
+ });
17
98
 
18
99
  /**
19
100
  * Generated bundle index. Do not edit.
20
101
  */
102
+
103
+ export { GridGroupingColumnsDirective };
21
104
  //# sourceMappingURL=toolbox-web-grid-angular-features-grouping-columns.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"toolbox-web-grid-angular-features-grouping-columns.mjs","sources":["../../../../libs/grid-angular/features/grouping-columns/src/index.ts","../../../../libs/grid-angular/features/grouping-columns/src/toolbox-web-grid-angular-features-grouping-columns.ts"],"sourcesContent":["/**\n * Column grouping feature for @toolbox-web/grid-angular\n *\n * Import this module to enable the `groupingColumns` input on Grid directive.\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid-angular/features/grouping-columns';\n *\n * <tbw-grid [groupingColumns]=\"{ columnGroups: [...] }\" />\n * ```\n *\n * @packageDocumentation\n */\n\nimport '@toolbox-web/grid/features/grouping-columns';\nexport type { _Augmentation as _GroupingColumnsAugmentation } from '@toolbox-web/grid/features/grouping-columns';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;AAaG;;ACbH;;AAEG"}
1
+ {"version":3,"file":"toolbox-web-grid-angular-features-grouping-columns.mjs","sources":["../../../../libs/grid-angular/features/grouping-columns/src/grid-grouping-columns.directive.ts","../../../../libs/grid-angular/features/grouping-columns/src/index.ts","../../../../libs/grid-angular/features/grouping-columns/src/toolbox-web-grid-angular-features-grouping-columns.ts"],"sourcesContent":["/**\n * `GridGroupingColumnsDirective` — owns `[groupingColumns]` on\n * `<tbw-grid>`. No event outputs. See `GridFilteringDirective` for the\n * full rationale.\n *\n * @category Directive\n */\nimport { Directive, ElementRef, inject, input, OnDestroy } from '@angular/core';\nimport type { DataGridElement } from '@toolbox-web/grid';\nimport { registerFeatureClaim, unregisterFeatureClaim } from '@toolbox-web/grid-angular';\nimport type { GroupingColumnsConfig } from '@toolbox-web/grid/plugins/grouping-columns';\n\n/**\n * Owns the binding(s) `[groupingColumns]` on `<tbw-grid>` for the matching feature plugin. See {@link GridFilteringDirective} for the full rationale.\n *\n * @category Directive\n */\n@Directive({\n selector: 'tbw-grid[groupingColumns]',\n standalone: true,\n})\nexport class GridGroupingColumnsDirective implements OnDestroy {\n private readonly elementRef = inject(ElementRef<DataGridElement>);\n\n readonly groupingColumns = input<boolean | GroupingColumnsConfig>();\n\n constructor() {\n registerFeatureClaim(this.elementRef.nativeElement, 'groupingColumns', () => this.groupingColumns());\n }\n\n ngOnDestroy(): void {\n unregisterFeatureClaim(this.elementRef.nativeElement, 'groupingColumns');\n }\n}\n","/**\n * Column grouping feature for @toolbox-web/grid-angular\n *\n * Import this module to enable the `groupingColumns` input on Grid directive.\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid-angular/features/grouping-columns';\n *\n * <tbw-grid [groupingColumns]=\"{ columnGroups: [...] }\" />\n * ```\n *\n * @packageDocumentation\n */\n\nimport type { Type } from '@angular/core';\nimport { isComponentClass, registerFeatureConfigPreprocessor, type GridAdapter } from '@toolbox-web/grid-angular';\nimport '@toolbox-web/grid/features/grouping-columns';\nimport type { GroupHeaderRenderParams, GroupingColumnsConfig } from '@toolbox-web/grid/plugins/grouping-columns';\nexport { GridGroupingColumnsDirective } from './grid-grouping-columns.directive';\nexport type { _Augmentation as _GroupingColumnsAugmentation } from '@toolbox-web/grid/features/grouping-columns';\n\n/**\n * Build a group-header renderer function from an Angular component class.\n * The component should accept group header inputs (id, label, columns, firstIndex, isImplicit).\n */\nfunction buildGroupHeaderRenderer(\n adapter: GridAdapter,\n componentClass: Type<unknown>,\n): (params: GroupHeaderRenderParams) => HTMLElement {\n const mount = adapter.mountComponentRenderer<GroupHeaderRenderParams>(componentClass, (p) => ({\n id: p.id,\n label: p.label,\n columns: p.columns,\n firstIndex: p.firstIndex,\n isImplicit: p.isImplicit,\n }));\n return (params) => mount(params).hostElement;\n}\n\n// Bridge any Angular component classes embedded in the user-supplied config\n// (e.g. group-header renderers) to plain renderer functions before the core\n// plugin factory consumes the config. Without this, raw component classes\n// would be invoked without `new`, causing runtime errors.\nregisterFeatureConfigPreprocessor('groupingColumns', (config, adapter) => {\n if (!config || typeof config !== 'object') return config;\n const cfg = config as GroupingColumnsConfig;\n const processed = { ...cfg };\n let changed = false;\n\n // Bridge top-level groupHeaderRenderer component class\n if (cfg.groupHeaderRenderer && isComponentClass(cfg.groupHeaderRenderer)) {\n processed.groupHeaderRenderer = buildGroupHeaderRenderer(adapter, cfg.groupHeaderRenderer);\n changed = true;\n }\n\n // Bridge per-group renderer component classes inside columnGroups\n if (Array.isArray(cfg.columnGroups)) {\n let groupChanged = false;\n const mappedGroups = cfg.columnGroups.map((def) => {\n if (def.renderer && isComponentClass(def.renderer)) {\n groupChanged = true;\n return { ...def, renderer: buildGroupHeaderRenderer(adapter, def.renderer) };\n }\n return def;\n });\n if (groupChanged) {\n processed.columnGroups = mappedGroups;\n changed = true;\n }\n }\n\n return changed ? processed : cfg;\n});\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAA;;;;;;AAMG;AAMH;;;;AAIG;MAKU,4BAA4B,CAAA;AACtB,IAAA,UAAU,GAAG,MAAM,EAAC,UAA2B,EAAC;IAExD,eAAe,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,iBAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAmC;AAEnE,IAAA,WAAA,GAAA;AACE,QAAA,oBAAoB,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,iBAAiB,EAAE,MAAM,IAAI,CAAC,eAAe,EAAE,CAAC;IACtG;IAEA,WAAW,GAAA;QACT,sBAAsB,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,iBAAiB,CAAC;IAC1E;uGAXW,4BAA4B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAA5B,4BAA4B,EAAA,YAAA,EA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,CAAC,EAAE;QACxE,SAAS,CAAC,mBAAmB,GAAG,wBAAwB,CAAC,OAAO,EAAE,GAAG,CAAC,mBAAmB,CAAC;QAC1F,OAAO,GAAG,IAAI;IAChB;;IAGA,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE;QACnC,IAAI,YAAY,GAAG,KAAK;QACxB,MAAM,YAAY,GAAG,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,GAAG,KAAI;YAChD,IAAI,GAAG,CAAC,QAAQ,IAAI,gBAAgB,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;gBAClD,YAAY,GAAG,IAAI;AACnB,gBAAA,OAAO,EAAE,GAAG,GAAG,EAAE,QAAQ,EAAE,wBAAwB,CAAC,OAAO,EAAE,GAAG,CAAC,QAAQ,CAAC,EAAE;YAC9E;AACA,YAAA,OAAO,GAAG;AACZ,QAAA,CAAC,CAAC;QACF,IAAI,YAAY,EAAE;AAChB,YAAA,SAAS,CAAC,YAAY,GAAG,YAAY;YACrC,OAAO,GAAG,IAAI;QAChB;IACF;IAEA,OAAO,OAAO,GAAG,SAAS,GAAG,GAAG;AAClC,CAAC,CAAC;;ACzEF;;AAEG;;;;"}
@@ -1,4 +1,64 @@
1
+ import { registerFeatureClaim, claimEvent, unregisterFeatureClaim, unclaimEvent, registerFeatureConfigPreprocessor, isComponentClass } from '@toolbox-web/grid-angular';
1
2
  import '@toolbox-web/grid/features/grouping-rows';
3
+ import * as i0 from '@angular/core';
4
+ import { inject, ElementRef, input, output, Directive } from '@angular/core';
5
+
6
+ /**
7
+ * `GridGroupingRowsDirective` — owns `[groupingRows]` and the group
8
+ * toggle/expand/collapse outputs on `<tbw-grid>`. See
9
+ * `GridFilteringDirective` for the full rationale.
10
+ *
11
+ * @category Directive
12
+ */
13
+ /**
14
+ * Owns the binding(s) `[groupingRows], [groupToggle], [groupExpand], [groupCollapse]` on `<tbw-grid>` for the matching feature plugin. See {@link GridFilteringDirective} for the full rationale.
15
+ *
16
+ * @category Directive
17
+ */
18
+ class GridGroupingRowsDirective {
19
+ elementRef = inject((ElementRef));
20
+ groupingRows = input(...(ngDevMode ? [undefined, { debugName: "groupingRows" }] : /* istanbul ignore next */ []));
21
+ groupToggle = output();
22
+ groupExpand = output();
23
+ groupCollapse = output();
24
+ listeners = new Map();
25
+ static EVENTS = ['group-toggle', 'group-expand', 'group-collapse'];
26
+ constructor() {
27
+ const grid = this.elementRef.nativeElement;
28
+ registerFeatureClaim(grid, 'groupingRows', () => this.groupingRows());
29
+ for (const ev of GridGroupingRowsDirective.EVENTS)
30
+ claimEvent(grid, ev);
31
+ }
32
+ ngOnInit() {
33
+ const grid = this.elementRef.nativeElement;
34
+ const wire = (name, out) => {
35
+ const l = (e) => out.emit(e.detail);
36
+ grid.addEventListener(name, l);
37
+ this.listeners.set(name, l);
38
+ };
39
+ wire('group-toggle', this.groupToggle);
40
+ wire('group-expand', this.groupExpand);
41
+ wire('group-collapse', this.groupCollapse);
42
+ }
43
+ ngOnDestroy() {
44
+ const grid = this.elementRef.nativeElement;
45
+ for (const [name, l] of this.listeners)
46
+ grid.removeEventListener(name, l);
47
+ this.listeners.clear();
48
+ unregisterFeatureClaim(grid, 'groupingRows');
49
+ for (const ev of GridGroupingRowsDirective.EVENTS)
50
+ unclaimEvent(grid, ev);
51
+ }
52
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: GridGroupingRowsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
53
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.5", type: GridGroupingRowsDirective, isStandalone: true, selector: "tbw-grid[groupingRows], tbw-grid[groupToggle], tbw-grid[groupExpand], tbw-grid[groupCollapse]", inputs: { groupingRows: { classPropertyName: "groupingRows", publicName: "groupingRows", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { groupToggle: "groupToggle", groupExpand: "groupExpand", groupCollapse: "groupCollapse" }, ngImport: i0 });
54
+ }
55
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: GridGroupingRowsDirective, decorators: [{
56
+ type: Directive,
57
+ args: [{
58
+ selector: 'tbw-grid[groupingRows], tbw-grid[groupToggle], tbw-grid[groupExpand], tbw-grid[groupCollapse]',
59
+ standalone: true,
60
+ }]
61
+ }], ctorParameters: () => [], propDecorators: { groupingRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupingRows", required: false }] }], groupToggle: [{ type: i0.Output, args: ["groupToggle"] }], groupExpand: [{ type: i0.Output, args: ["groupExpand"] }], groupCollapse: [{ type: i0.Output, args: ["groupCollapse"] }] } });
2
62
 
3
63
  /**
4
64
  * Row grouping feature for @toolbox-web/grid-angular
@@ -14,8 +74,30 @@ import '@toolbox-web/grid/features/grouping-rows';
14
74
  *
15
75
  * @packageDocumentation
16
76
  */
77
+ // Bridge any Angular component classes embedded in the user-supplied config
78
+ // (e.g. group-row renderer) to plain renderer functions before the core
79
+ // plugin factory consumes the config.
80
+ registerFeatureConfigPreprocessor('groupingRows', (config, adapter) => {
81
+ if (!config || typeof config !== 'object')
82
+ return config;
83
+ const cfg = config;
84
+ if (cfg.groupRowRenderer && isComponentClass(cfg.groupRowRenderer)) {
85
+ const mount = adapter.mountComponentRenderer(cfg.groupRowRenderer, (p) => ({
86
+ key: p.key,
87
+ value: p.value,
88
+ depth: p.depth,
89
+ rows: p.rows,
90
+ expanded: p.expanded,
91
+ toggleExpand: p.toggleExpand,
92
+ }));
93
+ return { ...cfg, groupRowRenderer: (params) => mount(params).hostElement };
94
+ }
95
+ return cfg;
96
+ });
17
97
 
18
98
  /**
19
99
  * Generated bundle index. Do not edit.
20
100
  */
101
+
102
+ export { GridGroupingRowsDirective };
21
103
  //# sourceMappingURL=toolbox-web-grid-angular-features-grouping-rows.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"toolbox-web-grid-angular-features-grouping-rows.mjs","sources":["../../../../libs/grid-angular/features/grouping-rows/src/index.ts","../../../../libs/grid-angular/features/grouping-rows/src/toolbox-web-grid-angular-features-grouping-rows.ts"],"sourcesContent":["/**\n * Row grouping feature for @toolbox-web/grid-angular\n *\n * Import this module to enable the `groupingRows` input on Grid directive.\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid-angular/features/grouping-rows';\n *\n * <tbw-grid [groupingRows]=\"{ groupBy: ['department'] }\" />\n * ```\n *\n * @packageDocumentation\n */\n\nimport '@toolbox-web/grid/features/grouping-rows';\nexport type { _Augmentation as _GroupingRowsAugmentation } from '@toolbox-web/grid/features/grouping-rows';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;AAaG;;ACbH;;AAEG"}
1
+ {"version":3,"file":"toolbox-web-grid-angular-features-grouping-rows.mjs","sources":["../../../../libs/grid-angular/features/grouping-rows/src/grid-grouping-rows.directive.ts","../../../../libs/grid-angular/features/grouping-rows/src/index.ts","../../../../libs/grid-angular/features/grouping-rows/src/toolbox-web-grid-angular-features-grouping-rows.ts"],"sourcesContent":["/**\n * `GridGroupingRowsDirective` — owns `[groupingRows]` and the group\n * toggle/expand/collapse outputs on `<tbw-grid>`. See\n * `GridFilteringDirective` for the full rationale.\n *\n * @category Directive\n */\nimport { Directive, ElementRef, inject, input, OnDestroy, OnInit, output } from '@angular/core';\nimport type { DataGridElement } from '@toolbox-web/grid';\nimport { claimEvent, registerFeatureClaim, unclaimEvent, unregisterFeatureClaim } from '@toolbox-web/grid-angular';\nimport type {\n GroupCollapseDetail,\n GroupExpandDetail,\n GroupingRowsConfig,\n GroupToggleDetail,\n} from '@toolbox-web/grid/plugins/grouping-rows';\n\n/**\n * Owns the binding(s) `[groupingRows], [groupToggle], [groupExpand], [groupCollapse]` on `<tbw-grid>` for the matching feature plugin. See {@link GridFilteringDirective} for the full rationale.\n *\n * @category Directive\n */\n@Directive({\n selector: 'tbw-grid[groupingRows], tbw-grid[groupToggle], tbw-grid[groupExpand], tbw-grid[groupCollapse]',\n standalone: true,\n})\nexport class GridGroupingRowsDirective implements OnInit, OnDestroy {\n private readonly elementRef = inject(ElementRef<DataGridElement>);\n\n readonly groupingRows = input<GroupingRowsConfig>();\n readonly groupToggle = output<GroupToggleDetail>();\n readonly groupExpand = output<GroupExpandDetail>();\n readonly groupCollapse = output<GroupCollapseDetail>();\n\n private readonly listeners = new Map<string, (e: Event) => void>();\n private static readonly EVENTS = ['group-toggle', 'group-expand', 'group-collapse'] as const;\n\n constructor() {\n const grid = this.elementRef.nativeElement;\n registerFeatureClaim(grid, 'groupingRows', () => this.groupingRows());\n for (const ev of GridGroupingRowsDirective.EVENTS) claimEvent(grid, ev);\n }\n\n ngOnInit(): void {\n const grid = this.elementRef.nativeElement;\n const wire = <T>(name: string, out: { emit: (v: T) => void }): void => {\n const l = (e: Event): void => out.emit((e as CustomEvent<T>).detail);\n grid.addEventListener(name, l);\n this.listeners.set(name, l);\n };\n wire<GroupToggleDetail>('group-toggle', this.groupToggle);\n wire<GroupExpandDetail>('group-expand', this.groupExpand);\n wire<GroupCollapseDetail>('group-collapse', this.groupCollapse);\n }\n\n ngOnDestroy(): void {\n const grid = this.elementRef.nativeElement;\n for (const [name, l] of this.listeners) grid.removeEventListener(name, l);\n this.listeners.clear();\n unregisterFeatureClaim(grid, 'groupingRows');\n for (const ev of GridGroupingRowsDirective.EVENTS) unclaimEvent(grid, ev);\n }\n}\n","/**\n * Row grouping feature for @toolbox-web/grid-angular\n *\n * Import this module to enable the `groupingRows` input on Grid directive.\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid-angular/features/grouping-rows';\n *\n * <tbw-grid [groupingRows]=\"{ groupBy: ['department'] }\" />\n * ```\n *\n * @packageDocumentation\n */\n\nimport { isComponentClass, registerFeatureConfigPreprocessor } from '@toolbox-web/grid-angular';\nimport '@toolbox-web/grid/features/grouping-rows';\nimport type { GroupingRowsConfig, GroupRowRenderParams } from '@toolbox-web/grid/plugins/grouping-rows';\nexport { GridGroupingRowsDirective } from './grid-grouping-rows.directive';\nexport type { _Augmentation as _GroupingRowsAugmentation } from '@toolbox-web/grid/features/grouping-rows';\n\n// Bridge any Angular component classes embedded in the user-supplied config\n// (e.g. group-row renderer) to plain renderer functions before the core\n// plugin factory consumes the config.\nregisterFeatureConfigPreprocessor('groupingRows', (config, adapter) => {\n if (!config || typeof config !== 'object') return config;\n const cfg = config as GroupingRowsConfig;\n if (cfg.groupRowRenderer && isComponentClass(cfg.groupRowRenderer)) {\n const mount = adapter.mountComponentRenderer<GroupRowRenderParams>(cfg.groupRowRenderer, (p) => ({\n key: p.key,\n value: p.value,\n depth: p.depth,\n rows: p.rows,\n expanded: p.expanded,\n toggleExpand: p.toggleExpand,\n }));\n return { ...cfg, groupRowRenderer: (params: GroupRowRenderParams) => mount(params).hostElement };\n }\n return cfg;\n});\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAA;;;;;;AAMG;AAWH;;;;AAIG;MAKU,yBAAyB,CAAA;AACnB,IAAA,UAAU,GAAG,MAAM,EAAC,UAA2B,EAAC;IAExD,YAAY,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,cAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAsB;IAC1C,WAAW,GAAG,MAAM,EAAqB;IACzC,WAAW,GAAG,MAAM,EAAqB;IACzC,aAAa,GAAG,MAAM,EAAuB;AAErC,IAAA,SAAS,GAAG,IAAI,GAAG,EAA8B;IAC1D,OAAgB,MAAM,GAAG,CAAC,cAAc,EAAE,cAAc,EAAE,gBAAgB,CAAU;AAE5F,IAAA,WAAA,GAAA;AACE,QAAA,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa;AAC1C,QAAA,oBAAoB,CAAC,IAAI,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC,YAAY,EAAE,CA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AAC,MAA4B,KAAK,KAAK,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE;IAClG;AACA,IAAA,OAAO,GAAG;AACZ,CAAC,CAAC;;ACvCF;;AAEG;;;;"}
@@ -1,21 +1,134 @@
1
+ import { registerFeatureClaim, claimEvent, unregisterFeatureClaim, unclaimEvent, registerDetailRendererBridge, getDetailTemplate, registerTemplateBridge } from '@toolbox-web/grid-angular';
2
+ export { GridDetailView, getDetailTemplate } from '@toolbox-web/grid-angular';
1
3
  import '@toolbox-web/grid/features/master-detail';
4
+ import * as i0 from '@angular/core';
5
+ import { inject, ElementRef, input, output, Directive } from '@angular/core';
6
+
7
+ /**
8
+ * `GridMasterDetailDirective` — owns `[masterDetail]` and `(detailExpand)`
9
+ * on `<tbw-grid>`. See `GridFilteringDirective` for the full rationale.
10
+ *
11
+ * Note: this directive is independent of the higher-level
12
+ * `<tbw-grid-detail>` template element + `GridDetailView` wrapper, which
13
+ * uses a different bridging mechanism (template registration). Apps using
14
+ * the template form do not need this directive.
15
+ *
16
+ * @category Directive
17
+ */
18
+ /**
19
+ * Owns the binding(s) `[masterDetail], [detailExpand]` on `<tbw-grid>` for the matching feature plugin. See {@link GridFilteringDirective} for the full rationale.
20
+ *
21
+ * @category Directive
22
+ */
23
+ class GridMasterDetailDirective {
24
+ elementRef = inject((ElementRef));
25
+ masterDetail = input(...(ngDevMode ? [undefined, { debugName: "masterDetail" }] : /* istanbul ignore next */ []));
26
+ detailExpand = output();
27
+ listener;
28
+ constructor() {
29
+ const grid = this.elementRef.nativeElement;
30
+ registerFeatureClaim(grid, 'masterDetail', () => this.masterDetail());
31
+ claimEvent(grid, 'detail-expand');
32
+ }
33
+ ngOnInit() {
34
+ const grid = this.elementRef.nativeElement;
35
+ this.listener = (e) => this.detailExpand.emit(e.detail);
36
+ grid.addEventListener('detail-expand', this.listener);
37
+ }
38
+ ngOnDestroy() {
39
+ const grid = this.elementRef.nativeElement;
40
+ if (this.listener) {
41
+ grid.removeEventListener('detail-expand', this.listener);
42
+ this.listener = undefined;
43
+ }
44
+ unregisterFeatureClaim(grid, 'masterDetail');
45
+ unclaimEvent(grid, 'detail-expand');
46
+ }
47
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: GridMasterDetailDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
48
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.5", type: GridMasterDetailDirective, isStandalone: true, selector: "tbw-grid[masterDetail], tbw-grid[detailExpand]", inputs: { masterDetail: { classPropertyName: "masterDetail", publicName: "masterDetail", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { detailExpand: "detailExpand" }, ngImport: i0 });
49
+ }
50
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: GridMasterDetailDirective, decorators: [{
51
+ type: Directive,
52
+ args: [{
53
+ selector: 'tbw-grid[masterDetail], tbw-grid[detailExpand]',
54
+ standalone: true,
55
+ }]
56
+ }], ctorParameters: () => [], propDecorators: { masterDetail: [{ type: i0.Input, args: [{ isSignal: true, alias: "masterDetail", required: false }] }], detailExpand: [{ type: i0.Output, args: ["detailExpand"] }] } });
2
57
 
3
58
  /**
4
59
  * Master-detail feature for @toolbox-web/grid-angular
5
60
  *
6
- * Import this module to enable the `masterDetail` input on Grid directive.
61
+ * Import this module to enable the `[masterDetail]` input on the `Grid`
62
+ * directive AND to wire `<tbw-grid-detail>` Angular templates into the
63
+ * MasterDetailPlugin's `detailRenderer`.
7
64
  *
8
65
  * @example
9
66
  * ```typescript
67
+ * // In your bootstrap (e.g. main.ts or app.component.ts):
10
68
  * import '@toolbox-web/grid-angular/features/master-detail';
69
+ * ```
11
70
  *
12
- * <tbw-grid [masterDetail]="{ detailRenderer: myRenderer }" />
71
+ * ```html
72
+ * <tbw-grid [masterDetail]="{ showExpandColumn: true }">
73
+ * <tbw-grid-detail>
74
+ * <ng-template let-row>...</ng-template>
75
+ * </tbw-grid-detail>
76
+ * </tbw-grid>
13
77
  * ```
14
78
  *
15
79
  * @packageDocumentation
16
80
  */
81
+ // Install the row renderer bridge on the adapter. This is what
82
+ // `adapter.createDetailRenderer(grid)` and `adapter.parseDetailElement(el)`
83
+ // delegate to. Without this import, both methods return undefined.
84
+ registerDetailRendererBridge((gridElement, adapter) => {
85
+ // Type inferred from `getDetailTemplate` (same package instance as `adapter`),
86
+ // not from a local `import type { TemplateRef } from '@angular/core'` — the
87
+ // latter resolves through Bun's `.bun/` cache during ng-packagr build and
88
+ // produces a brand-incompatible TemplateRef vs the built adapter `.d.ts`.
89
+ const template = getDetailTemplate(gridElement);
90
+ if (!template)
91
+ return undefined;
92
+ return (row) => {
93
+ const context = { $implicit: row, row };
94
+ const viewRef = adapter.createTrackedEmbeddedView(template, context);
95
+ const container = document.createElement('div');
96
+ viewRef.rootNodes.forEach((node) => container.appendChild(node));
97
+ return container;
98
+ };
99
+ });
100
+ // Wire <tbw-grid-detail> Angular templates into the MasterDetailPlugin once
101
+ // content templates are registered. The plugin's `parseLightDomDetail()`
102
+ // already calls back into the adapter via `grid.__frameworkAdapter.parseDetailElement`
103
+ // (which the `Grid` directive set in `ngOnInit`), so all we need to do here
104
+ // is trigger a refresh once Angular's content templates are available.
105
+ registerTemplateBridge(({ grid }) => {
106
+ // Only act when the user actually placed a <tbw-grid-detail> in light DOM.
107
+ const detailElement = grid.querySelector('tbw-grid-detail');
108
+ if (!detailElement)
109
+ return;
110
+ // The plugin must already have been attached (via [masterDetail] input,
111
+ // gridConfig.features.masterDetail, or gridConfig.plugins). Use the runtime
112
+ // lookup so we don't miss plugins instantiated from `gridConfig.features`,
113
+ // which never appear in `gridConfig.plugins`.
114
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
115
+ const existingPlugin = grid.getPluginByName?.('masterDetail');
116
+ if (!existingPlugin) {
117
+ // eslint-disable-next-line no-console
118
+ console.warn('[tbw-grid-angular] <tbw-grid-detail> found but MasterDetailPlugin is not configured.\n' +
119
+ 'Add the [masterDetail] input, set gridConfig.features.masterDetail, or include\n' +
120
+ 'MasterDetailPlugin in gridConfig.plugins:\n\n' +
121
+ ' <tbw-grid [masterDetail]="{ showExpandColumn: true }">...</tbw-grid>\n\n' +
122
+ 'or:\n\n' +
123
+ ' gridConfig = { features: { masterDetail: { showExpandColumn: true } } };');
124
+ return;
125
+ }
126
+ existingPlugin.refreshDetailRenderer?.();
127
+ });
17
128
 
18
129
  /**
19
130
  * Generated bundle index. Do not edit.
20
131
  */
132
+
133
+ export { GridMasterDetailDirective };
21
134
  //# sourceMappingURL=toolbox-web-grid-angular-features-master-detail.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"toolbox-web-grid-angular-features-master-detail.mjs","sources":["../../../../libs/grid-angular/features/master-detail/src/index.ts","../../../../libs/grid-angular/features/master-detail/src/toolbox-web-grid-angular-features-master-detail.ts"],"sourcesContent":["/**\n * Master-detail feature for @toolbox-web/grid-angular\n *\n * Import this module to enable the `masterDetail` input on Grid directive.\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid-angular/features/master-detail';\n *\n * <tbw-grid [masterDetail]=\"{ detailRenderer: myRenderer }\" />\n * ```\n *\n * @packageDocumentation\n */\n\nimport '@toolbox-web/grid/features/master-detail';\nexport type { _Augmentation as _MasterDetailAugmentation } from '@toolbox-web/grid/features/master-detail';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;AAaG;;ACbH;;AAEG"}
1
+ {"version":3,"file":"toolbox-web-grid-angular-features-master-detail.mjs","sources":["../../../../libs/grid-angular/features/master-detail/src/grid-master-detail.directive.ts","../../../../libs/grid-angular/features/master-detail/src/index.ts","../../../../libs/grid-angular/features/master-detail/src/toolbox-web-grid-angular-features-master-detail.ts"],"sourcesContent":["/**\n * `GridMasterDetailDirective` — owns `[masterDetail]` and `(detailExpand)`\n * on `<tbw-grid>`. See `GridFilteringDirective` for the full rationale.\n *\n * Note: this directive is independent of the higher-level\n * `<tbw-grid-detail>` template element + `GridDetailView` wrapper, which\n * uses a different bridging mechanism (template registration). Apps using\n * the template form do not need this directive.\n *\n * @category Directive\n */\nimport { Directive, ElementRef, inject, input, OnDestroy, OnInit, output } from '@angular/core';\nimport type { DataGridElement } from '@toolbox-web/grid';\nimport { claimEvent, registerFeatureClaim, unclaimEvent, unregisterFeatureClaim } from '@toolbox-web/grid-angular';\nimport type { DetailExpandDetail, MasterDetailConfig } from '@toolbox-web/grid/plugins/master-detail';\n\n/**\n * Owns the binding(s) `[masterDetail], [detailExpand]` on `<tbw-grid>` for the matching feature plugin. See {@link GridFilteringDirective} for the full rationale.\n *\n * @category Directive\n */\n@Directive({\n selector: 'tbw-grid[masterDetail], tbw-grid[detailExpand]',\n standalone: true,\n})\nexport class GridMasterDetailDirective implements OnInit, OnDestroy {\n private readonly elementRef = inject(ElementRef<DataGridElement>);\n\n readonly masterDetail = input<MasterDetailConfig>();\n readonly detailExpand = output<DetailExpandDetail>();\n\n private listener?: (e: Event) => void;\n\n constructor() {\n const grid = this.elementRef.nativeElement;\n registerFeatureClaim(grid, 'masterDetail', () => this.masterDetail());\n claimEvent(grid, 'detail-expand');\n }\n\n ngOnInit(): void {\n const grid = this.elementRef.nativeElement;\n this.listener = (e: Event): void => this.detailExpand.emit((e as CustomEvent<DetailExpandDetail>).detail);\n grid.addEventListener('detail-expand', this.listener);\n }\n\n ngOnDestroy(): void {\n const grid = this.elementRef.nativeElement;\n if (this.listener) {\n grid.removeEventListener('detail-expand', this.listener);\n this.listener = undefined;\n }\n unregisterFeatureClaim(grid, 'masterDetail');\n unclaimEvent(grid, 'detail-expand');\n }\n}\n","/**\n * Master-detail feature for @toolbox-web/grid-angular\n *\n * Import this module to enable the `[masterDetail]` input on the `Grid`\n * directive AND to wire `<tbw-grid-detail>` Angular templates into the\n * MasterDetailPlugin's `detailRenderer`.\n *\n * @example\n * ```typescript\n * // In your bootstrap (e.g. main.ts or app.component.ts):\n * import '@toolbox-web/grid-angular/features/master-detail';\n * ```\n *\n * ```html\n * <tbw-grid [masterDetail]=\"{ showExpandColumn: true }\">\n * <tbw-grid-detail>\n * <ng-template let-row>...</ng-template>\n * </tbw-grid-detail>\n * </tbw-grid>\n * ```\n *\n * @packageDocumentation\n */\n\nimport {\n getDetailTemplate,\n registerDetailRendererBridge,\n registerTemplateBridge,\n type GridAdapter,\n type GridDetailContext,\n} from '@toolbox-web/grid-angular';\nimport '@toolbox-web/grid/features/master-detail';\nexport { GridMasterDetailDirective } from './grid-master-detail.directive';\nexport type { _Augmentation as _MasterDetailAugmentation } from '@toolbox-web/grid/features/master-detail';\n\n// ---------------------------------------------------------------------------\n// Re-exports from `@toolbox-web/grid-angular` (main entry).\n//\n// `GridDetailView` (and its `getDetailTemplate` helper / `GridDetailContext`\n// type) still physically live in the main entry today but are master-detail\n// specific. They are re-exported here so consumers can import them from the\n// feature entry that owns the runtime behaviour. The same symbols are\n// `@deprecated` on the main entry; in v2.0.0 the source will physically move\n// into this secondary entry and the deprecated re-exports on the main entry\n// will be removed.\n// ---------------------------------------------------------------------------\nexport { getDetailTemplate, GridDetailView } from '@toolbox-web/grid-angular';\nexport type { GridDetailContext } from '@toolbox-web/grid-angular';\n\n/**\n * Subset of `MasterDetailPlugin` we touch from the bridge. Avoids importing\n * the plugin class itself (would defeat tree-shaking and re-introduce the\n * coupling we just removed from the core directive).\n */\ninterface MasterDetailPluginLike {\n refreshDetailRenderer?: () => void;\n}\n\n// Install the row renderer bridge on the adapter. This is what\n// `adapter.createDetailRenderer(grid)` and `adapter.parseDetailElement(el)`\n// delegate to. Without this import, both methods return undefined.\nregisterDetailRendererBridge(<TRow = unknown>(gridElement: HTMLElement, adapter: GridAdapter) => {\n // Type inferred from `getDetailTemplate` (same package instance as `adapter`),\n // not from a local `import type { TemplateRef } from '@angular/core'` — the\n // latter resolves through Bun's `.bun/` cache during ng-packagr build and\n // produces a brand-incompatible TemplateRef vs the built adapter `.d.ts`.\n const template = getDetailTemplate(gridElement);\n if (!template) return undefined;\n\n return (row: TRow) => {\n const context: GridDetailContext<TRow> = { $implicit: row, row };\n const viewRef = adapter.createTrackedEmbeddedView(template, context);\n const container = document.createElement('div');\n viewRef.rootNodes.forEach((node: Node) => container.appendChild(node));\n return container;\n };\n});\n\n// Wire <tbw-grid-detail> Angular templates into the MasterDetailPlugin once\n// content templates are registered. The plugin's `parseLightDomDetail()`\n// already calls back into the adapter via `grid.__frameworkAdapter.parseDetailElement`\n// (which the `Grid` directive set in `ngOnInit`), so all we need to do here\n// is trigger a refresh once Angular's content templates are available.\nregisterTemplateBridge(({ grid }) => {\n // Only act when the user actually placed a <tbw-grid-detail> in light DOM.\n const detailElement = grid.querySelector('tbw-grid-detail');\n if (!detailElement) return;\n\n // The plugin must already have been attached (via [masterDetail] input,\n // gridConfig.features.masterDetail, or gridConfig.plugins). Use the runtime\n // lookup so we don't miss plugins instantiated from `gridConfig.features`,\n // which never appear in `gridConfig.plugins`.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const existingPlugin = (grid as any).getPluginByName?.('masterDetail') as MasterDetailPluginLike | undefined;\n\n if (!existingPlugin) {\n // eslint-disable-next-line no-console\n console.warn(\n '[tbw-grid-angular] <tbw-grid-detail> found but MasterDetailPlugin is not configured.\\n' +\n 'Add the [masterDetail] input, set gridConfig.features.masterDetail, or include\\n' +\n 'MasterDetailPlugin in gridConfig.plugins:\\n\\n' +\n ' <tbw-grid [masterDetail]=\"{ showExpandColumn: true }\">...</tbw-grid>\\n\\n' +\n 'or:\\n\\n' +\n ' gridConfig = { features: { masterDetail: { showExpandColumn: true } } };',\n );\n return;\n }\n\n existingPlugin.refreshDetailRenderer?.();\n});\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;AAUG;AAMH;;;;AAIG;MAKU,yBAAyB,CAAA;AACnB,IAAA,UAAU,GAAG,MAAM,EAAC,U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,GAAI,IAAY,CAAC,eAAe,GAAG,cAAc,CAAuC;IAE5G,IAAI,CAAC,cAAc,EAAE;;QAEnB,OAAO,CAAC,IAAI,CACV,wFAAwF;YACtF,kFAAkF;YAClF,+CAA+C;YAC/C,4EAA4E;YAC5E,SAAS;AACT,YAAA,4EAA4E,CAC/E;QACD;IACF;AAEA,IAAA,cAAc,CAAC,qBAAqB,IAAI;AAC1C,CAAC,CAAC;;AC7GF;;AAEG;;;;"}
@@ -1,4 +1,40 @@
1
1
  import '@toolbox-web/grid/features/multi-sort';
2
+ import * as i0 from '@angular/core';
3
+ import { inject, ElementRef, input, Directive } from '@angular/core';
4
+ import { registerFeatureClaim, unregisterFeatureClaim } from '@toolbox-web/grid-angular';
5
+
6
+ /**
7
+ * `GridMultiSortDirective` — owns the `[multiSort]` input on `<tbw-grid>`.
8
+ * The `(sortChange)` output stays on `Grid` because single-column sort
9
+ * (without this plugin) also emits it. See `GridFilteringDirective` for
10
+ * the full rationale.
11
+ *
12
+ * @category Directive
13
+ */
14
+ /**
15
+ * Owns the binding(s) `[multiSort]` on `<tbw-grid>` for the matching feature plugin. See {@link GridFilteringDirective} for the full rationale.
16
+ *
17
+ * @category Directive
18
+ */
19
+ class GridMultiSortDirective {
20
+ elementRef = inject((ElementRef));
21
+ multiSort = input(...(ngDevMode ? [undefined, { debugName: "multiSort" }] : /* istanbul ignore next */ []));
22
+ constructor() {
23
+ registerFeatureClaim(this.elementRef.nativeElement, 'multiSort', () => this.multiSort());
24
+ }
25
+ ngOnDestroy() {
26
+ unregisterFeatureClaim(this.elementRef.nativeElement, 'multiSort');
27
+ }
28
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: GridMultiSortDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
29
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.5", type: GridMultiSortDirective, isStandalone: true, selector: "tbw-grid[multiSort]", inputs: { multiSort: { classPropertyName: "multiSort", publicName: "multiSort", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
30
+ }
31
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: GridMultiSortDirective, decorators: [{
32
+ type: Directive,
33
+ args: [{
34
+ selector: 'tbw-grid[multiSort]',
35
+ standalone: true,
36
+ }]
37
+ }], ctorParameters: () => [], propDecorators: { multiSort: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiSort", required: false }] }] } });
2
38
 
3
39
  /**
4
40
  * Multi-sort feature for @toolbox-web/grid-angular
@@ -24,4 +60,6 @@ import '@toolbox-web/grid/features/multi-sort';
24
60
  /**
25
61
  * Generated bundle index. Do not edit.
26
62
  */
63
+
64
+ export { GridMultiSortDirective };
27
65
  //# sourceMappingURL=toolbox-web-grid-angular-features-multi-sort.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"toolbox-web-grid-angular-features-multi-sort.mjs","sources":["../../../../libs/grid-angular/features/multi-sort/src/index.ts","../../../../libs/grid-angular/features/multi-sort/src/toolbox-web-grid-angular-features-multi-sort.ts"],"sourcesContent":["/**\n * Multi-sort feature for @toolbox-web/grid-angular\n *\n * Import this module to enable the `multiSort` input on Grid directive.\n * Multi-sort allows sorting by multiple columns simultaneously.\n *\n * For basic single-column sorting, columns with `sortable: true` work without this plugin.\n * Use `[sortable]=\"false\"` on the grid to disable all sorting.\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid-angular/features/multi-sort';\n *\n * <tbw-grid [multiSort]=\"true\" />\n * <tbw-grid [multiSort]=\"'single'\" />\n * <tbw-grid [multiSort]=\"{ maxSortColumns: 3 }\" />\n * ```\n *\n * @packageDocumentation\n */\n\nimport '@toolbox-web/grid/features/multi-sort';\nexport type { _Augmentation as _MultiSortAugmentation } from '@toolbox-web/grid/features/multi-sort';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;;;;;;AAmBG;;ACnBH;;AAEG"}
1
+ {"version":3,"file":"toolbox-web-grid-angular-features-multi-sort.mjs","sources":["../../../../libs/grid-angular/features/multi-sort/src/grid-multi-sort.directive.ts","../../../../libs/grid-angular/features/multi-sort/src/index.ts","../../../../libs/grid-angular/features/multi-sort/src/toolbox-web-grid-angular-features-multi-sort.ts"],"sourcesContent":["/**\n * `GridMultiSortDirective` — owns the `[multiSort]` input on `<tbw-grid>`.\n * The `(sortChange)` output stays on `Grid` because single-column sort\n * (without this plugin) also emits it. See `GridFilteringDirective` for\n * the full rationale.\n *\n * @category Directive\n */\nimport { Directive, ElementRef, inject, input, OnDestroy } from '@angular/core';\nimport type { DataGridElement } from '@toolbox-web/grid';\nimport { registerFeatureClaim, unregisterFeatureClaim } from '@toolbox-web/grid-angular';\nimport type { MultiSortConfig } from '@toolbox-web/grid/plugins/multi-sort';\n\n/**\n * Owns the binding(s) `[multiSort]` on `<tbw-grid>` for the matching feature plugin. See {@link GridFilteringDirective} for the full rationale.\n *\n * @category Directive\n */\n@Directive({\n selector: 'tbw-grid[multiSort]',\n standalone: true,\n})\nexport class GridMultiSortDirective implements OnDestroy {\n private readonly elementRef = inject(ElementRef<DataGridElement>);\n\n readonly multiSort = input<boolean | 'single' | 'multi' | MultiSortConfig>();\n\n constructor() {\n registerFeatureClaim(this.elementRef.nativeElement, 'multiSort', () => this.multiSort());\n }\n\n ngOnDestroy(): void {\n unregisterFeatureClaim(this.elementRef.nativeElement, 'multiSort');\n }\n}\n","/**\n * Multi-sort feature for @toolbox-web/grid-angular\n *\n * Import this module to enable the `multiSort` input on Grid directive.\n * Multi-sort allows sorting by multiple columns simultaneously.\n *\n * For basic single-column sorting, columns with `sortable: true` work without this plugin.\n * Use `[sortable]=\"false\"` on the grid to disable all sorting.\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid-angular/features/multi-sort';\n *\n * <tbw-grid [multiSort]=\"true\" />\n * <tbw-grid [multiSort]=\"'single'\" />\n * <tbw-grid [multiSort]=\"{ maxSortColumns: 3 }\" />\n * ```\n *\n * @packageDocumentation\n */\n\nimport '@toolbox-web/grid/features/multi-sort';\nexport { GridMultiSortDirective } from './grid-multi-sort.directive';\nexport type { _Augmentation as _MultiSortAugmentation } from '@toolbox-web/grid/features/multi-sort';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAA;;;;;;;AAOG;AAMH;;;;AAIG;MAKU,sBAAsB,CAAA;AAChB,IAAA,UAAU,GAAG,MAAM,EAAC,UAA2B,EAAC;IAExD,SAAS,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,WAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAkD;AAE5E,IAAA,WAAA,GAAA;AACE,QAAA,oBAAoB,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC;IAC1F;IAEA,WAAW,GAAA;QACT,sBAAsB,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,WAAW,CAAC;IACpE;uGAXW,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAtB,sBAAsB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,qBAAA,EAAA,MAAA,EAAA,EAAA,SAAA,EAAA,EAAA,iBAAA,EAAA,WAAA,EAAA,UAAA,EAAA,WAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAtB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAJlC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,qBAAqB;AAC/B,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;ACrBD;;;;;;;;;;;;;;;;;;;AAmBG;;ACnBH;;AAEG;;;;"}
@@ -1,4 +1,39 @@
1
1
  import '@toolbox-web/grid/features/pinned-columns';
2
+ import * as i0 from '@angular/core';
3
+ import { inject, ElementRef, input, Directive } from '@angular/core';
4
+ import { registerFeatureClaim, unregisterFeatureClaim } from '@toolbox-web/grid-angular';
5
+
6
+ /**
7
+ * `GridPinnedColumnsDirective` — owns `[pinnedColumns]` on `<tbw-grid>`.
8
+ * No event outputs (column pinning is configuration-only). See
9
+ * `GridFilteringDirective` for the full rationale.
10
+ *
11
+ * @category Directive
12
+ */
13
+ /**
14
+ * Owns the binding(s) `[pinnedColumns]` on `<tbw-grid>` for the matching feature plugin. See {@link GridFilteringDirective} for the full rationale.
15
+ *
16
+ * @category Directive
17
+ */
18
+ class GridPinnedColumnsDirective {
19
+ elementRef = inject((ElementRef));
20
+ pinnedColumns = input(...(ngDevMode ? [undefined, { debugName: "pinnedColumns" }] : /* istanbul ignore next */ []));
21
+ constructor() {
22
+ registerFeatureClaim(this.elementRef.nativeElement, 'pinnedColumns', () => this.pinnedColumns());
23
+ }
24
+ ngOnDestroy() {
25
+ unregisterFeatureClaim(this.elementRef.nativeElement, 'pinnedColumns');
26
+ }
27
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: GridPinnedColumnsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
28
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.5", type: GridPinnedColumnsDirective, isStandalone: true, selector: "tbw-grid[pinnedColumns]", inputs: { pinnedColumns: { classPropertyName: "pinnedColumns", publicName: "pinnedColumns", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
29
+ }
30
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: GridPinnedColumnsDirective, decorators: [{
31
+ type: Directive,
32
+ args: [{
33
+ selector: 'tbw-grid[pinnedColumns]',
34
+ standalone: true,
35
+ }]
36
+ }], ctorParameters: () => [], propDecorators: { pinnedColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "pinnedColumns", required: false }] }] } });
2
37
 
3
38
  /**
4
39
  * Pinned columns feature for @toolbox-web/grid-angular
@@ -21,4 +56,6 @@ import '@toolbox-web/grid/features/pinned-columns';
21
56
  /**
22
57
  * Generated bundle index. Do not edit.
23
58
  */
59
+
60
+ export { GridPinnedColumnsDirective };
24
61
  //# sourceMappingURL=toolbox-web-grid-angular-features-pinned-columns.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"toolbox-web-grid-angular-features-pinned-columns.mjs","sources":["../../../../libs/grid-angular/features/pinned-columns/src/index.ts","../../../../libs/grid-angular/features/pinned-columns/src/toolbox-web-grid-angular-features-pinned-columns.ts"],"sourcesContent":["/**\n * Pinned columns feature for @toolbox-web/grid-angular\n *\n * Import this module to enable the `pinnedColumns` input on Grid directive.\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid-angular/features/pinned-columns';\n *\n * <tbw-grid [pinnedColumns]=\"true\" [columns]=\"[\n * { field: 'id', pinned: 'left' },\n * { field: 'name' }\n * ]\" />\n * ```\n *\n * @packageDocumentation\n */\n\nimport '@toolbox-web/grid/features/pinned-columns';\nexport type { _Augmentation as _PinnedColumnsAugmentation } from '@toolbox-web/grid/features/pinned-columns';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;;;AAgBG;;AChBH;;AAEG"}
1
+ {"version":3,"file":"toolbox-web-grid-angular-features-pinned-columns.mjs","sources":["../../../../libs/grid-angular/features/pinned-columns/src/grid-pinned-columns.directive.ts","../../../../libs/grid-angular/features/pinned-columns/src/index.ts","../../../../libs/grid-angular/features/pinned-columns/src/toolbox-web-grid-angular-features-pinned-columns.ts"],"sourcesContent":["/**\n * `GridPinnedColumnsDirective` — owns `[pinnedColumns]` on `<tbw-grid>`.\n * No event outputs (column pinning is configuration-only). See\n * `GridFilteringDirective` for the full rationale.\n *\n * @category Directive\n */\nimport { Directive, ElementRef, inject, input, OnDestroy } from '@angular/core';\nimport type { DataGridElement } from '@toolbox-web/grid';\nimport { registerFeatureClaim, unregisterFeatureClaim } from '@toolbox-web/grid-angular';\n\n/**\n * Owns the binding(s) `[pinnedColumns]` on `<tbw-grid>` for the matching feature plugin. See {@link GridFilteringDirective} for the full rationale.\n *\n * @category Directive\n */\n@Directive({\n selector: 'tbw-grid[pinnedColumns]',\n standalone: true,\n})\nexport class GridPinnedColumnsDirective implements OnDestroy {\n private readonly elementRef = inject(ElementRef<DataGridElement>);\n\n readonly pinnedColumns = input<boolean>();\n\n constructor() {\n registerFeatureClaim(this.elementRef.nativeElement, 'pinnedColumns', () => this.pinnedColumns());\n }\n\n ngOnDestroy(): void {\n unregisterFeatureClaim(this.elementRef.nativeElement, 'pinnedColumns');\n }\n}\n","/**\n * Pinned columns feature for @toolbox-web/grid-angular\n *\n * Import this module to enable the `pinnedColumns` input on Grid directive.\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid-angular/features/pinned-columns';\n *\n * <tbw-grid [pinnedColumns]=\"true\" [columns]=\"[\n * { field: 'id', pinned: 'left' },\n * { field: 'name' }\n * ]\" />\n * ```\n *\n * @packageDocumentation\n */\n\nimport '@toolbox-web/grid/features/pinned-columns';\nexport { GridPinnedColumnsDirective } from './grid-pinned-columns.directive';\nexport type { _Augmentation as _PinnedColumnsAugmentation } from '@toolbox-web/grid/features/pinned-columns';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAA;;;;;;AAMG;AAKH;;;;AAIG;MAKU,0BAA0B,CAAA;AACpB,IAAA,UAAU,GAAG,MAAM,EAAC,UAA2B,EAAC;IAExD,aAAa,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,eAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAW;AAEzC,IAAA,WAAA,GAAA;AACE,QAAA,oBAAoB,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,eAAe,EAAE,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;IAClG;IAEA,WAAW,GAAA;QACT,sBAAsB,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,eAAe,CAAC;IACxE;uGAXW,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAA1B,0BAA0B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,yBAAA,EAAA,MAAA,EAAA,EAAA,aAAA,EAAA,EAAA,iBAAA,EAAA,eAAA,EAAA,UAAA,EAAA,eAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAA1B,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBAJtC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,yBAAyB;AACnC,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;ACnBD;;;;;;;;;;;;;;;;AAgBG;;AChBH;;AAEG;;;;"}