@toolbox-web/grid-angular 1.5.0 → 1.6.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 (78) hide show
  1. package/fesm2022/toolbox-web-grid-angular-features-clipboard.mjs +1 -1
  2. package/fesm2022/toolbox-web-grid-angular-features-clipboard.mjs.map +1 -1
  3. package/fesm2022/toolbox-web-grid-angular-features-column-virtualization.mjs +1 -1
  4. package/fesm2022/toolbox-web-grid-angular-features-column-virtualization.mjs.map +1 -1
  5. package/fesm2022/toolbox-web-grid-angular-features-context-menu.mjs +1 -1
  6. package/fesm2022/toolbox-web-grid-angular-features-context-menu.mjs.map +1 -1
  7. package/fesm2022/toolbox-web-grid-angular-features-editing.mjs +1 -1
  8. package/fesm2022/toolbox-web-grid-angular-features-editing.mjs.map +1 -1
  9. package/fesm2022/toolbox-web-grid-angular-features-export.mjs +1 -1
  10. package/fesm2022/toolbox-web-grid-angular-features-export.mjs.map +1 -1
  11. package/fesm2022/toolbox-web-grid-angular-features-grouping-columns.mjs +1 -1
  12. package/fesm2022/toolbox-web-grid-angular-features-grouping-columns.mjs.map +1 -1
  13. package/fesm2022/toolbox-web-grid-angular-features-grouping-rows.mjs +1 -1
  14. package/fesm2022/toolbox-web-grid-angular-features-grouping-rows.mjs.map +1 -1
  15. package/fesm2022/toolbox-web-grid-angular-features-master-detail.mjs +1 -2
  16. package/fesm2022/toolbox-web-grid-angular-features-master-detail.mjs.map +1 -1
  17. package/fesm2022/toolbox-web-grid-angular-features-multi-sort.mjs +1 -1
  18. package/fesm2022/toolbox-web-grid-angular-features-multi-sort.mjs.map +1 -1
  19. package/fesm2022/toolbox-web-grid-angular-features-pinned-columns.mjs +1 -1
  20. package/fesm2022/toolbox-web-grid-angular-features-pinned-columns.mjs.map +1 -1
  21. package/fesm2022/toolbox-web-grid-angular-features-pinned-rows.mjs +1 -1
  22. package/fesm2022/toolbox-web-grid-angular-features-pinned-rows.mjs.map +1 -1
  23. package/fesm2022/toolbox-web-grid-angular-features-pivot.mjs +1 -1
  24. package/fesm2022/toolbox-web-grid-angular-features-pivot.mjs.map +1 -1
  25. package/fesm2022/toolbox-web-grid-angular-features-print.mjs +1 -1
  26. package/fesm2022/toolbox-web-grid-angular-features-print.mjs.map +1 -1
  27. package/fesm2022/toolbox-web-grid-angular-features-reorder-columns.mjs +1 -1
  28. package/fesm2022/toolbox-web-grid-angular-features-reorder-columns.mjs.map +1 -1
  29. package/fesm2022/toolbox-web-grid-angular-features-reorder-rows.mjs +1 -1
  30. package/fesm2022/toolbox-web-grid-angular-features-reorder-rows.mjs.map +1 -1
  31. package/fesm2022/toolbox-web-grid-angular-features-responsive.mjs +1 -2
  32. package/fesm2022/toolbox-web-grid-angular-features-responsive.mjs.map +1 -1
  33. package/fesm2022/toolbox-web-grid-angular-features-row-drag-drop.mjs +1 -1
  34. package/fesm2022/toolbox-web-grid-angular-features-row-drag-drop.mjs.map +1 -1
  35. package/fesm2022/toolbox-web-grid-angular-features-selection.mjs +1 -1
  36. package/fesm2022/toolbox-web-grid-angular-features-selection.mjs.map +1 -1
  37. package/fesm2022/toolbox-web-grid-angular-features-server-side.mjs +1 -1
  38. package/fesm2022/toolbox-web-grid-angular-features-server-side.mjs.map +1 -1
  39. package/fesm2022/toolbox-web-grid-angular-features-sticky-rows.mjs +58 -0
  40. package/fesm2022/toolbox-web-grid-angular-features-sticky-rows.mjs.map +1 -0
  41. package/fesm2022/toolbox-web-grid-angular-features-tooltip.mjs +1 -1
  42. package/fesm2022/toolbox-web-grid-angular-features-tooltip.mjs.map +1 -1
  43. package/fesm2022/toolbox-web-grid-angular-features-tree.mjs +1 -1
  44. package/fesm2022/toolbox-web-grid-angular-features-tree.mjs.map +1 -1
  45. package/fesm2022/toolbox-web-grid-angular-features-undo-redo.mjs +1 -1
  46. package/fesm2022/toolbox-web-grid-angular-features-undo-redo.mjs.map +1 -1
  47. package/fesm2022/toolbox-web-grid-angular-features-visibility.mjs +1 -1
  48. package/fesm2022/toolbox-web-grid-angular-features-visibility.mjs.map +1 -1
  49. package/fesm2022/toolbox-web-grid-angular.mjs +29 -11
  50. package/fesm2022/toolbox-web-grid-angular.mjs.map +1 -1
  51. package/package.json +5 -1
  52. package/types/toolbox-web-grid-angular-features-clipboard.d.ts +1 -1
  53. package/types/toolbox-web-grid-angular-features-column-virtualization.d.ts +1 -1
  54. package/types/toolbox-web-grid-angular-features-context-menu.d.ts +1 -1
  55. package/types/toolbox-web-grid-angular-features-editing.d.ts +1 -1
  56. package/types/toolbox-web-grid-angular-features-export.d.ts +1 -1
  57. package/types/toolbox-web-grid-angular-features-grouping-columns.d.ts +1 -1
  58. package/types/toolbox-web-grid-angular-features-grouping-rows.d.ts +1 -1
  59. package/types/toolbox-web-grid-angular-features-master-detail.d.ts +1 -1
  60. package/types/toolbox-web-grid-angular-features-multi-sort.d.ts +1 -1
  61. package/types/toolbox-web-grid-angular-features-pinned-columns.d.ts +1 -1
  62. package/types/toolbox-web-grid-angular-features-pinned-rows.d.ts +1 -1
  63. package/types/toolbox-web-grid-angular-features-pivot.d.ts +1 -1
  64. package/types/toolbox-web-grid-angular-features-print.d.ts +1 -1
  65. package/types/toolbox-web-grid-angular-features-reorder-columns.d.ts +1 -1
  66. package/types/toolbox-web-grid-angular-features-reorder-rows.d.ts +1 -1
  67. package/types/toolbox-web-grid-angular-features-responsive.d.ts +1 -1
  68. package/types/toolbox-web-grid-angular-features-row-drag-drop.d.ts +1 -1
  69. package/types/toolbox-web-grid-angular-features-selection.d.ts +1 -1
  70. package/types/toolbox-web-grid-angular-features-server-side.d.ts +1 -1
  71. package/types/toolbox-web-grid-angular-features-sticky-rows.d.ts +22 -0
  72. package/types/toolbox-web-grid-angular-features-sticky-rows.d.ts.map +1 -0
  73. package/types/toolbox-web-grid-angular-features-tooltip.d.ts +1 -1
  74. package/types/toolbox-web-grid-angular-features-tree.d.ts +1 -1
  75. package/types/toolbox-web-grid-angular-features-undo-redo.d.ts +1 -1
  76. package/types/toolbox-web-grid-angular-features-visibility.d.ts +1 -1
  77. package/types/toolbox-web-grid-angular.d.ts +15 -2
  78. package/types/toolbox-web-grid-angular.d.ts.map +1 -1
@@ -11,7 +11,7 @@ import { registerFeatureClaim, claimEvent, unregisterFeatureClaim, unclaimEvent
11
11
  * @category Directive
12
12
  */
13
13
  /**
14
- * Owns the binding(s) `[print], [printStart], [printComplete]` on `<tbw-grid>` for the matching feature plugin. See {@link GridFilteringDirective} for the full rationale.
14
+ * Owns the binding(s) `[print], [printStart], [printComplete]` on `<tbw-grid>` for the matching feature plugin. See `GridFilteringDirective` for the full rationale.
15
15
  *
16
16
  * @category Directive
17
17
  */
@@ -1 +1 @@
1
- {"version":3,"file":"toolbox-web-grid-angular-features-print.mjs","sources":["../../../../libs/grid-angular/features/print/src/grid-print.directive.ts","../../../../libs/grid-angular/features/print/src/index.ts","../../../../libs/grid-angular/features/print/src/toolbox-web-grid-angular-features-print.ts"],"sourcesContent":["/**\n * `GridPrintDirective` — owns `[print]`, `(printStart)` and\n * `(printComplete)` on `<tbw-grid>`. See `GridFilteringDirective` for the\n * 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 { PrintCompleteDetail, PrintConfig, PrintStartDetail } from '@toolbox-web/grid/plugins/print';\n\n/**\n * Owns the binding(s) `[print], [printStart], [printComplete]` 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[print], tbw-grid[printStart], tbw-grid[printComplete]',\n standalone: true,\n})\nexport class GridPrintDirective implements OnInit, OnDestroy {\n private readonly elementRef = inject(ElementRef<DataGridElement>);\n\n readonly print = input<boolean | PrintConfig>();\n readonly printStart = output<PrintStartDetail>();\n readonly printComplete = output<PrintCompleteDetail>();\n\n private readonly listeners = new Map<string, (e: Event) => void>();\n\n constructor() {\n const grid = this.elementRef.nativeElement;\n registerFeatureClaim(grid, 'print', () => this.print());\n claimEvent(grid, 'print-start');\n claimEvent(grid, 'print-complete');\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<PrintStartDetail>('print-start', this.printStart);\n wire<PrintCompleteDetail>('print-complete', this.printComplete);\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, 'print');\n unclaimEvent(grid, 'print-start');\n unclaimEvent(grid, 'print-complete');\n }\n}\n","/**\n * Print feature for @toolbox-web/grid-angular\n *\n * Import this module to enable the `print` input on Grid directive.\n * Also exports `injectGridPrint()` for programmatic print control.\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid-angular/features/print';\n *\n * <tbw-grid [print]=\"true\" />\n * ```\n *\n * @example Using injectGridPrint\n * ```typescript\n * import { injectGridPrint } from '@toolbox-web/grid-angular/features/print';\n *\n * @Component({...})\n * export class MyComponent {\n * private gridPrint = injectGridPrint();\n *\n * printReport() {\n * this.gridPrint.print({ title: 'My Report' });\n * }\n * }\n * ```\n *\n * @packageDocumentation\n */\n\nimport { afterNextRender, DestroyRef, ElementRef, inject, signal, type Signal } from '@angular/core';\nimport type { DataGridElement } from '@toolbox-web/grid';\nimport '@toolbox-web/grid/features/print';\nimport { PrintPlugin, type PrintParams } from '@toolbox-web/grid/plugins/print';\nexport { GridPrintDirective } from './grid-print.directive';\nexport type { _Augmentation as _PrintAugmentation } from '@toolbox-web/grid/features/print';\n\n/**\n * Print methods returned from injectGridPrint.\n *\n * Uses lazy discovery - the grid is found on first method call, not during initialization.\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 * Signal indicating if grid is ready.\n */\n isReady: Signal<boolean>;\n}\n\n/**\n * Angular inject function for programmatic print control.\n *\n * Uses **lazy grid discovery** - the grid element is found when methods are called,\n * not during initialization.\n *\n * @example\n * ```typescript\n * import { Component } from '@angular/core';\n * import { Grid } from '@toolbox-web/grid-angular';\n * import '@toolbox-web/grid-angular/features/print';\n * import { injectGridPrint } from '@toolbox-web/grid-angular/features/print';\n *\n * @Component({\n * selector: 'app-my-grid',\n * imports: [Grid],\n * template: `\n * <button (click)=\"handlePrint()\" [disabled]=\"gridPrint.isPrinting()\">\n * {{ gridPrint.isPrinting() ? 'Printing...' : 'Print' }}\n * </button>\n * <tbw-grid [rows]=\"rows\" [print]=\"true\"></tbw-grid>\n * `\n * })\n * export class MyGridComponent {\n * gridPrint = injectGridPrint();\n *\n * async handlePrint() {\n * await this.gridPrint.print({ title: 'Employee Report', isolate: true });\n * console.log('Print dialog closed');\n * }\n * }\n * ```\n *\n * @param selector - Optional CSS selector to target a specific grid element.\n * Defaults to `'tbw-grid'` (first grid in the component). Use when the\n * component contains multiple grids, e.g. `'tbw-grid.primary'` or `'#my-grid'`.\n */\nexport function injectGridPrint(selector = 'tbw-grid'): PrintMethods {\n const elementRef = inject(ElementRef);\n const destroyRef = inject(DestroyRef);\n const isReady = signal(false);\n\n let cachedGrid: DataGridElement | null = null;\n let readyPromiseStarted = false;\n\n const getGrid = (): DataGridElement | null => {\n if (cachedGrid) return cachedGrid;\n\n const grid = elementRef.nativeElement.querySelector(selector) as DataGridElement | null;\n if (grid) {\n cachedGrid = grid;\n if (!readyPromiseStarted) {\n readyPromiseStarted = true;\n grid.ready?.().then(() => {\n if (grid.getPluginByName('print')) {\n isReady.set(true);\n } else {\n setTimeout(() => isReady.set(true), 0);\n }\n });\n }\n }\n return grid;\n };\n\n const getPlugin = (): PrintPlugin | undefined => {\n return getGrid()?.getPluginByName('print') as PrintPlugin | undefined;\n };\n\n // Eagerly discover the grid after the first render so isReady updates\n // without requiring a programmatic method call. Falls back to a\n // MutationObserver for lazy-rendered tabs, *ngIf, @defer, etc.\n afterNextRender(() => {\n if (getGrid()) return;\n\n const host = elementRef.nativeElement as HTMLElement;\n const observer = new MutationObserver(() => {\n if (getGrid()) observer.disconnect();\n });\n observer.observe(host, { childList: true, subtree: true });\n\n destroyRef.onDestroy(() => observer.disconnect());\n });\n\n return {\n isReady: isReady.asReadonly(),\n\n print: async (params?: PrintParams) => {\n const plugin = getPlugin();\n if (!plugin) {\n console.warn(\n `[tbw-grid:print] PrintPlugin not found.\\n\\n` +\n ` → Enable print on the grid:\\n` +\n ` <tbw-grid [print]=\"true\" />`,\n );\n return;\n }\n await plugin.print(params);\n },\n\n isPrinting: () => getPlugin()?.isPrinting() ?? false,\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAA;;;;;;AAMG;AAMH;;;;AAIG;MAKU,kBAAkB,CAAA;AACZ,IAAA,UAAU,GAAG,MAAM,EAAC,UAA2B,EAAC;IAExD,KAAK,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,OAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAyB;IACtC,UAAU,GAAG,MAAM,EAAoB;IACvC,aAAa,GAAG,MAAM,EAAuB;AAErC,IAAA,SAAS,GAAG,IAAI,GAAG,EAA8B;AAElE,IAAA,WAAA,GAAA;AACE,QAAA,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa;AAC1C,QAAA,oBAAoB,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;AACvD,QAAA,UAAU,CAAC,IAAI,EAAE,a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ources":["../../../../libs/grid-angular/features/print/src/grid-print.directive.ts","../../../../libs/grid-angular/features/print/src/index.ts","../../../../libs/grid-angular/features/print/src/toolbox-web-grid-angular-features-print.ts"],"sourcesContent":["/**\n * `GridPrintDirective` — owns `[print]`, `(printStart)` and\n * `(printComplete)` on `<tbw-grid>`. See `GridFilteringDirective` for the\n * 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 { PrintCompleteDetail, PrintConfig, PrintStartDetail } from '@toolbox-web/grid/plugins/print';\n\n/**\n * Owns the binding(s) `[print], [printStart], [printComplete]` on `<tbw-grid>` for the matching feature plugin. See `GridFilteringDirective` for the full rationale.\n *\n * @category Directive\n */\n@Directive({\n selector: 'tbw-grid[print], tbw-grid[printStart], tbw-grid[printComplete]',\n standalone: true,\n})\nexport class GridPrintDirective implements OnInit, OnDestroy {\n private readonly elementRef = inject(ElementRef<DataGridElement>);\n\n readonly print = input<boolean | PrintConfig>();\n readonly printStart = output<PrintStartDetail>();\n readonly printComplete = output<PrintCompleteDetail>();\n\n private readonly listeners = new Map<string, (e: Event) => void>();\n\n constructor() {\n const grid = this.elementRef.nativeElement;\n registerFeatureClaim(grid, 'print', () => this.print());\n claimEvent(grid, 'print-start');\n claimEvent(grid, 'print-complete');\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<PrintStartDetail>('print-start', this.printStart);\n wire<PrintCompleteDetail>('print-complete', this.printComplete);\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, 'print');\n unclaimEvent(grid, 'print-start');\n unclaimEvent(grid, 'print-complete');\n }\n}\n","/**\n * Print feature for @toolbox-web/grid-angular\n *\n * Import this module to enable the `print` input on Grid directive.\n * Also exports `injectGridPrint()` for programmatic print control.\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid-angular/features/print';\n *\n * <tbw-grid [print]=\"true\" />\n * ```\n *\n * @example Using injectGridPrint\n * ```typescript\n * import { injectGridPrint } from '@toolbox-web/grid-angular/features/print';\n *\n * @Component({...})\n * export class MyComponent {\n * private gridPrint = injectGridPrint();\n *\n * printReport() {\n * this.gridPrint.print({ title: 'My Report' });\n * }\n * }\n * ```\n *\n * @packageDocumentation\n */\n\nimport { afterNextRender, DestroyRef, ElementRef, inject, signal, type Signal } from '@angular/core';\nimport type { DataGridElement } from '@toolbox-web/grid';\nimport '@toolbox-web/grid/features/print';\nimport { PrintPlugin, type PrintParams } from '@toolbox-web/grid/plugins/print';\nexport { GridPrintDirective } from './grid-print.directive';\nexport type { _Augmentation as _PrintAugmentation } from '@toolbox-web/grid/features/print';\n\n/**\n * Print methods returned from injectGridPrint.\n *\n * Uses lazy discovery - the grid is found on first method call, not during initialization.\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 * Signal indicating if grid is ready.\n */\n isReady: Signal<boolean>;\n}\n\n/**\n * Angular inject function for programmatic print control.\n *\n * Uses **lazy grid discovery** - the grid element is found when methods are called,\n * not during initialization.\n *\n * @example\n * ```typescript\n * import { Component } from '@angular/core';\n * import { Grid } from '@toolbox-web/grid-angular';\n * import '@toolbox-web/grid-angular/features/print';\n * import { injectGridPrint } from '@toolbox-web/grid-angular/features/print';\n *\n * @Component({\n * selector: 'app-my-grid',\n * imports: [Grid],\n * template: `\n * <button (click)=\"handlePrint()\" [disabled]=\"gridPrint.isPrinting()\">\n * {{ gridPrint.isPrinting() ? 'Printing...' : 'Print' }}\n * </button>\n * <tbw-grid [rows]=\"rows\" [print]=\"true\"></tbw-grid>\n * `\n * })\n * export class MyGridComponent {\n * gridPrint = injectGridPrint();\n *\n * async handlePrint() {\n * await this.gridPrint.print({ title: 'Employee Report', isolate: true });\n * console.log('Print dialog closed');\n * }\n * }\n * ```\n *\n * @param selector - Optional CSS selector to target a specific grid element.\n * Defaults to `'tbw-grid'` (first grid in the component). Use when the\n * component contains multiple grids, e.g. `'tbw-grid.primary'` or `'#my-grid'`.\n */\nexport function injectGridPrint(selector = 'tbw-grid'): PrintMethods {\n const elementRef = inject(ElementRef);\n const destroyRef = inject(DestroyRef);\n const isReady = signal(false);\n\n let cachedGrid: DataGridElement | null = null;\n let readyPromiseStarted = false;\n\n const getGrid = (): DataGridElement | null => {\n if (cachedGrid) return cachedGrid;\n\n const grid = elementRef.nativeElement.querySelector(selector) as DataGridElement | null;\n if (grid) {\n cachedGrid = grid;\n if (!readyPromiseStarted) {\n readyPromiseStarted = true;\n grid.ready?.().then(() => {\n if (grid.getPluginByName('print')) {\n isReady.set(true);\n } else {\n setTimeout(() => isReady.set(true), 0);\n }\n });\n }\n }\n return grid;\n };\n\n const getPlugin = (): PrintPlugin | undefined => {\n return getGrid()?.getPluginByName('print') as PrintPlugin | undefined;\n };\n\n // Eagerly discover the grid after the first render so isReady updates\n // without requiring a programmatic method call. Falls back to a\n // MutationObserver for lazy-rendered tabs, *ngIf, @defer, etc.\n afterNextRender(() => {\n if (getGrid()) return;\n\n const host = elementRef.nativeElement as HTMLElement;\n const observer = new MutationObserver(() => {\n if (getGrid()) observer.disconnect();\n });\n observer.observe(host, { childList: true, subtree: true });\n\n destroyRef.onDestroy(() => observer.disconnect());\n });\n\n return {\n isReady: isReady.asReadonly(),\n\n print: async (params?: PrintParams) => {\n const plugin = getPlugin();\n if (!plugin) {\n console.warn(\n `[tbw-grid:print] PrintPlugin not found.\\n\\n` +\n ` → Enable print on the grid:\\n` +\n ` <tbw-grid [print]=\"true\" />`,\n );\n return;\n }\n await plugin.print(params);\n },\n\n isPrinting: () => getPlugin()?.isPrinting() ?? false,\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAA;;;;;;AAMG;AAMH;;;;AAIG;MAKU,kBAAkB,CAAA;AACZ,IAAA,UAAU,GAAG,MAAM,EAAC,UAA2B,EAAC;IAExD,KAAK,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,OAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAyB;IACtC,UAAU,GAAG,MAAM,EAAoB;IACvC,aAAa,GAAG,MAAM,EAAuB;AAErC,IAAA,SAAS,GAAG,IAAI,GAAG,EAA8B;AAElE,IAAA,WAAA,GAAA;AACE,QAAA,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa;AAC1C,QAAA,oBAAoB,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;AACvD,QAAA,UAAU,CAAC,IAAI,EAAE,aAAa,CAAC;AAC/B,QAAA,UAAU,CAAC,IAAI,EAAE,gBAAgB,CAAC;IACpC;IAEA,QAAQ,GAAA;AACN,QAAA,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa;AAC1C,QAAA,MAAM,IAAI,GAAG,CAAI,IAAY,EAAE,GAA6B,KAAU;AACpE,YAAA,MAAM,CAAC,GAAG,CAAC,CAAQ,KAAW,GAAG,CAAC,IAAI,CAAE,CAAoB,CAAC,MAAM,CAAC;AACpE,YAAA,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,CAAC,CAAC;YAC9B,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;AAC7B,QAAA,CAAC;AACD,QAAA,IA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AQ,CAAC,UAAU,EAAE;AACtC,QAAA,CAAC,CAAC;AACF,QAAA,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;QAE1D,UAAU,CAAC,SAAS,CAAC,MAAM,QAAQ,CAAC,UAAU,EAAE,CAAC;AACnD,IAAA,CAAC,CAAC;IAEF,OAAO;AACL,QAAA,OAAO,EAAE,OAAO,CAAC,UAAU,EAAE;AAE7B,QAAA,KAAK,EAAE,OAAO,MAAoB,KAAI;AACpC,YAAA,MAAM,MAAM,GAAG,SAAS,EAAE;YAC1B,IAAI,CAAC,MAAM,EAAE;gBACX,OAAO,CAAC,IAAI,CACV,CAAA,2CAAA,CAA6C;oBAC3C,CAAA,+BAAA,CAAiC;AACjC,oBAAA,CAAA,+BAAA,CAAiC,CACpC;gBACD;YACF;AACA,YAAA,MAAM,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC;QAC5B,CAAC;QAED,UAAU,EAAE,MAAM,SAAS,EAAE,EAAE,UAAU,EAAE,IAAI,KAAK;KACrD;AACH;;ACnKA;;AAEG;;;;"}
@@ -11,7 +11,7 @@ import { registerFeatureClaim, claimEvent, unregisterFeatureClaim, unclaimEvent
11
11
  * @category Directive
12
12
  */
13
13
  /**
14
- * Owns the binding(s) `[reorderColumns], [columnMove]` on `<tbw-grid>` for the matching feature plugin. See {@link GridFilteringDirective} for the full rationale.
14
+ * Owns the binding(s) `[reorderColumns], [columnMove]` on `<tbw-grid>` for the matching feature plugin. See `GridFilteringDirective` for the full rationale.
15
15
  *
16
16
  * @category Directive
17
17
  */
@@ -1 +1 @@
1
- {"version":3,"file":"toolbox-web-grid-angular-features-reorder-columns.mjs","sources":["../../../../libs/grid-angular/features/reorder-columns/src/grid-reorder-columns.directive.ts","../../../../libs/grid-angular/features/reorder-columns/src/index.ts","../../../../libs/grid-angular/features/reorder-columns/src/toolbox-web-grid-angular-features-reorder-columns.ts"],"sourcesContent":["/**\n * `GridReorderColumnsDirective` — owns `[reorderColumns]` and\n * `(columnMove)` on `<tbw-grid>`. See `GridFilteringDirective` for the\n * 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 { ColumnMoveDetail, ReorderConfig } from '@toolbox-web/grid/plugins/reorder-columns';\n\n/**\n * Owns the binding(s) `[reorderColumns], [columnMove]` 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[reorderColumns], tbw-grid[columnMove]',\n standalone: true,\n})\nexport class GridReorderColumnsDirective implements OnInit, OnDestroy {\n private readonly elementRef = inject(ElementRef<DataGridElement>);\n\n readonly reorderColumns = input<boolean | ReorderConfig>();\n readonly columnMove = output<ColumnMoveDetail>();\n\n private listener?: (e: Event) => void;\n\n constructor() {\n const grid = this.elementRef.nativeElement;\n registerFeatureClaim(grid, 'reorderColumns', () => this.reorderColumns());\n claimEvent(grid, 'column-move');\n }\n\n ngOnInit(): void {\n const grid = this.elementRef.nativeElement;\n this.listener = (e: Event): void => this.columnMove.emit((e as CustomEvent<ColumnMoveDetail>).detail);\n grid.addEventListener('column-move', this.listener);\n }\n\n ngOnDestroy(): void {\n const grid = this.elementRef.nativeElement;\n if (this.listener) {\n grid.removeEventListener('column-move', this.listener);\n this.listener = undefined;\n }\n unregisterFeatureClaim(grid, 'reorderColumns');\n unclaimEvent(grid, 'column-move');\n }\n}\n","/**\n * Column reorder feature for @toolbox-web/grid-angular\n *\n * Import this module to enable the `reorderColumns` input on Grid directive.\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid-angular/features/reorder-columns';\n *\n * <tbw-grid [reorderColumns]=\"true\" />\n * ```\n *\n * @packageDocumentation\n */\n\nimport '@toolbox-web/grid/features/reorder-columns';\nexport { GridReorderColumnsDirective } from './grid-reorder-columns.directive';\nexport type { _Augmentation as _ReorderColumnsAugmentation } from '@toolbox-web/grid/features/reorder-columns';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAA;;;;;;AAMG;AAMH;;;;AAIG;MAKU,2BAA2B,CAAA;AACrB,IAAA,UAAU,GAAG,MAAM,EAAC,UAA2B,EAAC;IAExD,cAAc,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,gBAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAA2B;IACjD,UAAU,GAAG,MAAM,EAAoB;AAExC,IAAA,QAAQ;AAEhB,IAAA,WAAA,GAAA;AACE,QAAA,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa;AAC1C,QAAA,oBAAoB,CAAC,IAAI,EAAE,gBAAgB,EAAE,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;AACzE,QAAA,UAAU,CAAC,IAAI,EAAE,aAAa,CAAC;IACjC;IAEA,QAAQ,GAAA;AACN,QAAA,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa;AAC1C,QAAA,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAQ,KAAW,IAAI,CAAC,UAAU,CAAC,IAAI,CAAE,CAAmC,CAAC,MAAM,CAAC;QACrG,IAAI,CAAC,gBAAgB,CAAC,aAAa,EAAE,IAAI,CAAC,QAAQ,CAAC;IACrD;IAEA,WAAW,GAAA;AACT,QAAA,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa;AAC1C,QAAA,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,IAAI,CAAC,mBAAmB,CAAC,aAAa,EAAE,IAAI,CAAC,QAAQ,CAAC;AACtD,YAAA,IAAI,CAAC,QAAQ,GAAG,SAAS;QAC3B;AACA,QAAA,sBAAsB,CAAC,IAAI,EAAE,gBAAgB,CAAC;AAC9C,QAAA,YAAY,CAAC,IAAI,EAAE,aAAa,CAAC;IACnC;uGA5BW,2BAA2B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAA3B,2BAA2B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,gDAAA,EAAA,MAAA,EAAA,EAAA,cAAA,EAAA,EAAA,iBAAA,EAAA,gBAAA,EAAA,UAAA,EAAA,gBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,UAAA,EAAA,YAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAA3B,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBAJvC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,gDAAgD;AAC1D,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;ACpBD;;;;;;;;;;;;;AAaG;;ACbH;;AAEG;;;;"}
1
+ {"version":3,"file":"toolbox-web-grid-angular-features-reorder-columns.mjs","sources":["../../../../libs/grid-angular/features/reorder-columns/src/grid-reorder-columns.directive.ts","../../../../libs/grid-angular/features/reorder-columns/src/index.ts","../../../../libs/grid-angular/features/reorder-columns/src/toolbox-web-grid-angular-features-reorder-columns.ts"],"sourcesContent":["/**\n * `GridReorderColumnsDirective` — owns `[reorderColumns]` and\n * `(columnMove)` on `<tbw-grid>`. See `GridFilteringDirective` for the\n * 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 { ColumnMoveDetail, ReorderConfig } from '@toolbox-web/grid/plugins/reorder-columns';\n\n/**\n * Owns the binding(s) `[reorderColumns], [columnMove]` on `<tbw-grid>` for the matching feature plugin. See `GridFilteringDirective` for the full rationale.\n *\n * @category Directive\n */\n@Directive({\n selector: 'tbw-grid[reorderColumns], tbw-grid[columnMove]',\n standalone: true,\n})\nexport class GridReorderColumnsDirective implements OnInit, OnDestroy {\n private readonly elementRef = inject(ElementRef<DataGridElement>);\n\n readonly reorderColumns = input<boolean | ReorderConfig>();\n readonly columnMove = output<ColumnMoveDetail>();\n\n private listener?: (e: Event) => void;\n\n constructor() {\n const grid = this.elementRef.nativeElement;\n registerFeatureClaim(grid, 'reorderColumns', () => this.reorderColumns());\n claimEvent(grid, 'column-move');\n }\n\n ngOnInit(): void {\n const grid = this.elementRef.nativeElement;\n this.listener = (e: Event): void => this.columnMove.emit((e as CustomEvent<ColumnMoveDetail>).detail);\n grid.addEventListener('column-move', this.listener);\n }\n\n ngOnDestroy(): void {\n const grid = this.elementRef.nativeElement;\n if (this.listener) {\n grid.removeEventListener('column-move', this.listener);\n this.listener = undefined;\n }\n unregisterFeatureClaim(grid, 'reorderColumns');\n unclaimEvent(grid, 'column-move');\n }\n}\n","/**\n * Column reorder feature for @toolbox-web/grid-angular\n *\n * Import this module to enable the `reorderColumns` input on Grid directive.\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid-angular/features/reorder-columns';\n *\n * <tbw-grid [reorderColumns]=\"true\" />\n * ```\n *\n * @packageDocumentation\n */\n\nimport '@toolbox-web/grid/features/reorder-columns';\nexport { GridReorderColumnsDirective } from './grid-reorder-columns.directive';\nexport type { _Augmentation as _ReorderColumnsAugmentation } from '@toolbox-web/grid/features/reorder-columns';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAA;;;;;;AAMG;AAMH;;;;AAIG;MAKU,2BAA2B,CAAA;AACrB,IAAA,UAAU,GAAG,MAAM,EAAC,UAA2B,EAAC;IAExD,cA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iBAAA,EAAA,gBAAA,EAAA,UAAA,EAAA,gBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,UAAA,EAAA,YAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAA3B,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBAJvC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,gDAAgD;AAC1D,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;ACpBD;;;;;;;;;;;;;AAaG;;ACbH;;AAEG;;;;"}
@@ -15,7 +15,7 @@ import { registerFeatureClaim, unregisterFeatureClaim } from '@toolbox-web/grid-
15
15
  * @category Directive
16
16
  */
17
17
  /**
18
- * Owns the binding(s) `[reorderRows]` on `<tbw-grid>` for the matching feature plugin. See {@link GridFilteringDirective} for the full rationale.
18
+ * Owns the binding(s) `[reorderRows]` on `<tbw-grid>` for the matching feature plugin. See `GridFilteringDirective` for the full rationale.
19
19
  *
20
20
  * @category Directive
21
21
  */
@@ -1 +1 @@
1
- {"version":3,"file":"toolbox-web-grid-angular-features-reorder-rows.mjs","sources":["../../../../libs/grid-angular/features/reorder-rows/src/grid-reorder-rows.directive.ts","../../../../libs/grid-angular/features/reorder-rows/src/index.ts","../../../../libs/grid-angular/features/reorder-rows/src/toolbox-web-grid-angular-features-reorder-rows.ts"],"sourcesContent":["/**\n * `GridReorderRowsDirective` — owns `[reorderRows]` on `<tbw-grid>`.\n *\n * `reorderRows` is a deprecated alias of `rowDragDrop`. This directive\n * claims the alias input only — it does NOT claim any row-drag-drop\n * events. The `GridRowDragDropDirective` owns all row-* events. This\n * keeps event ownership single-source and avoids duplicate listeners\n * when both directives are imported (which is harmless but wasteful).\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 { RowReorderConfig } from '@toolbox-web/grid/plugins/reorder-rows';\n\n/**\n * Owns the binding(s) `[reorderRows]` 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[reorderRows]',\n standalone: true,\n})\nexport class GridReorderRowsDirective implements OnDestroy {\n private readonly elementRef = inject(ElementRef<DataGridElement>);\n\n readonly reorderRows = input<boolean | RowReorderConfig>();\n\n constructor() {\n registerFeatureClaim(this.elementRef.nativeElement, 'reorderRows', () => this.reorderRows());\n }\n\n ngOnDestroy(): void {\n unregisterFeatureClaim(this.elementRef.nativeElement, 'reorderRows');\n }\n}\n","/**\n * Row reorder feature for @toolbox-web/grid-angular\n *\n * Import this module to enable the `reorderRows` input on Grid directive.\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid-angular/features/reorder-rows';\n *\n * <tbw-grid [reorderRows]=\"true\" />\n * ```\n *\n * @packageDocumentation\n */\n\nimport '@toolbox-web/grid/features/reorder-rows';\nexport { GridReorderRowsDirective } from './grid-reorder-rows.directive';\nexport type { _Augmentation as _ReorderRowsAugmentation } from '@toolbox-web/grid/features/reorder-rows';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAA;;;;;;;;;;AAUG;AAMH;;;;AAIG;MAKU,wBAAwB,CAAA;AAClB,IAAA,UAAU,GAAG,MAAM,EAAC,UAA2B,EAAC;IAExD,WAAW,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,aAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAA8B;AAE1D,IAAA,WAAA,GAAA;AACE,QAAA,oBAAoB,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;IAC9F;IAEA,WAAW,GAAA;QACT,sBAAsB,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,aAAa,CAAC;IACtE;uGAXW,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAxB,wBAAwB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,uBAAA,EAAA,MAAA,EAAA,EAAA,WAAA,EAAA,EAAA,iBAAA,EAAA,aAAA,EAAA,UAAA,EAAA,aAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAxB,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBAJpC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,uBAAuB;AACjC,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;ACxBD;;;;;;;;;;;;;AAaG;;ACbH;;AAEG;;;;"}
1
+ {"version":3,"file":"toolbox-web-grid-angular-features-reorder-rows.mjs","sources":["../../../../libs/grid-angular/features/reorder-rows/src/grid-reorder-rows.directive.ts","../../../../libs/grid-angular/features/reorder-rows/src/index.ts","../../../../libs/grid-angular/features/reorder-rows/src/toolbox-web-grid-angular-features-reorder-rows.ts"],"sourcesContent":["/**\n * `GridReorderRowsDirective` — owns `[reorderRows]` on `<tbw-grid>`.\n *\n * `reorderRows` is a deprecated alias of `rowDragDrop`. This directive\n * claims the alias input only — it does NOT claim any row-drag-drop\n * events. The `GridRowDragDropDirective` owns all row-* events. This\n * keeps event ownership single-source and avoids duplicate listeners\n * when both directives are imported (which is harmless but wasteful).\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 { RowReorderConfig } from '@toolbox-web/grid/plugins/reorder-rows';\n\n/**\n * Owns the binding(s) `[reorderRows]` on `<tbw-grid>` for the matching feature plugin. See `GridFilteringDirective` for the full rationale.\n *\n * @category Directive\n */\n@Directive({\n selector: 'tbw-grid[reorderRows]',\n standalone: true,\n})\nexport class GridReorderRowsDirective implements OnDestroy {\n private readonly elementRef = inject(ElementRef<DataGridElement>);\n\n readonly reorderRows = input<boolean | RowReorderConfig>();\n\n constructor() {\n registerFeatureClaim(this.elementRef.nativeElement, 'reorderRows', () => this.reorderRows());\n }\n\n ngOnDestroy(): void {\n unregisterFeatureClaim(this.elementRef.nativeElement, 'reorderRows');\n }\n}\n","/**\n * Row reorder feature for @toolbox-web/grid-angular\n *\n * Import this module to enable the `reorderRows` input on Grid directive.\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid-angular/features/reorder-rows';\n *\n * <tbw-grid [reorderRows]=\"true\" />\n * ```\n *\n * @packageDocumentation\n */\n\nimport '@toolbox-web/grid/features/reorder-rows';\nexport { GridReorderRowsDirective } from './grid-reorder-rows.directive';\nexport type { _Augmentation as _ReorderRowsAugmentation } from '@toolbox-web/grid/features/reorder-rows';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAA;;;;;;;;;;AAUG;AAMH;;;;AAIG;MAKU,wBAAwB,CAAA;AAClB,IAAA,UAAU,GAAG,MAAM,EAAC,UAA2B,EAAC;IAExD,WAAW,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,aAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAA8B;AAE1D,IAAA,WAAA,GAAA;AACE,QAAA,oBAAoB,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;IAC9F;IAEA,WAAW,GAAA;QACT,sBAAsB,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,aAAa,CAAC;IACtE;uGAXW,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAxB,wBAAwB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,uBAAA,EAAA,MAAA,EAAA,EAAA,WAAA,EAAA,EAAA,iBAAA,EAAA,aAAA,EAAA,UAAA,EAAA,aAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAxB,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBAJpC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,uBAAuB;AACjC,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;ACxBD;;;;;;;;;;;;;AAaG;;ACbH;;AAEG;;;;"}
@@ -10,7 +10,7 @@ import { inject, ElementRef, input, output, Directive } from '@angular/core';
10
10
  * @category Directive
11
11
  */
12
12
  /**
13
- * Owns the binding(s) `[responsive], [responsiveChange]` on `<tbw-grid>` for the matching feature plugin. See {@link GridFilteringDirective} for the full rationale.
13
+ * Owns the binding(s) `[responsive], [responsiveChange]` on `<tbw-grid>` for the matching feature plugin. See `GridFilteringDirective` for the full rationale.
14
14
  *
15
15
  * @category Directive
16
16
  */
@@ -111,7 +111,6 @@ registerTemplateBridge(({ grid, adapter }) => {
111
111
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
112
112
  const existingPlugin = grid.getPluginByName?.('responsive');
113
113
  if (!existingPlugin) {
114
- // eslint-disable-next-line no-console
115
114
  console.warn('[tbw-grid-angular] <tbw-grid-responsive-card> found but ResponsivePlugin is not configured.\n' +
116
115
  'Add the [responsive] input, set gridConfig.features.responsive, or include\n' +
117
116
  'ResponsivePlugin in gridConfig.plugins:\n\n' +
@@ -1 +1 @@
1
- {"version":3,"file":"toolbox-web-grid-angular-features-responsive.mjs","sources":["../../../../libs/grid-angular/features/responsive/src/grid-responsive.directive.ts","../../../../libs/grid-angular/features/responsive/src/index.ts","../../../../libs/grid-angular/features/responsive/src/toolbox-web-grid-angular-features-responsive.ts"],"sourcesContent":["/**\n * `GridResponsiveDirective` — owns `[responsive]` and `(responsiveChange)`\n * on `<tbw-grid>`. See `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 { ResponsiveChangeDetail, ResponsivePluginConfig } from '@toolbox-web/grid/plugins/responsive';\n\n/**\n * Owns the binding(s) `[responsive], [responsiveChange]` 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[responsive], tbw-grid[responsiveChange]',\n standalone: true,\n})\nexport class GridResponsiveDirective implements OnInit, OnDestroy {\n private readonly elementRef = inject(ElementRef<DataGridElement>);\n\n readonly responsive = input<boolean | ResponsivePluginConfig>();\n readonly responsiveChange = output<ResponsiveChangeDetail>();\n\n private listener?: (e: Event) => void;\n\n constructor() {\n const grid = this.elementRef.nativeElement;\n registerFeatureClaim(grid, 'responsive', () => this.responsive());\n claimEvent(grid, 'responsive-change');\n }\n\n ngOnInit(): void {\n const grid = this.elementRef.nativeElement;\n this.listener = (e: Event): void => this.responsiveChange.emit((e as CustomEvent<ResponsiveChangeDetail>).detail);\n grid.addEventListener('responsive-change', this.listener);\n }\n\n ngOnDestroy(): void {\n const grid = this.elementRef.nativeElement;\n if (this.listener) {\n grid.removeEventListener('responsive-change', this.listener);\n this.listener = undefined;\n }\n unregisterFeatureClaim(grid, 'responsive');\n unclaimEvent(grid, 'responsive-change');\n }\n}\n","/**\n * Responsive feature for @toolbox-web/grid-angular\n *\n * Import this module to enable the `[responsive]` input on the `Grid`\n * directive AND to wire `<tbw-grid-responsive-card>` Angular templates into\n * the ResponsivePlugin's `cardRenderer`.\n *\n * @example\n * ```typescript\n * // In your bootstrap (e.g. main.ts or app.component.ts):\n * import '@toolbox-web/grid-angular/features/responsive';\n * ```\n *\n * ```html\n * <tbw-grid [responsive]=\"{ breakpoint: 768 }\">\n * <tbw-grid-responsive-card>\n * <ng-template let-row>...</ng-template>\n * </tbw-grid-responsive-card>\n * </tbw-grid>\n * ```\n *\n * @packageDocumentation\n */\n\nimport {\n getResponsiveCardTemplate,\n registerResponsiveCardRendererBridge,\n registerTemplateBridge,\n type GridAdapter,\n type GridResponsiveCardContext,\n} from '@toolbox-web/grid-angular';\nimport '@toolbox-web/grid/features/responsive';\nexport { GridResponsiveDirective } from './grid-responsive.directive';\nexport type { _Augmentation as _ResponsiveAugmentation } from '@toolbox-web/grid/features/responsive';\n\n/**\n * Subset of `ResponsivePlugin` we touch from the bridge. Avoids importing\n * the plugin class itself.\n */\ninterface ResponsivePluginLike {\n setCardRenderer?: (renderer: (row: unknown, rowIndex: number) => HTMLElement) => void;\n}\n\n// Install the row renderer bridge on the adapter. This is what\n// `adapter.createResponsiveCardRenderer(grid)` and\n// `adapter.parseResponsiveCardElement(el)` delegate to. Without this import,\n// both methods return undefined.\nregisterResponsiveCardRendererBridge(<TRow = unknown>(gridElement: HTMLElement, adapter: GridAdapter) => {\n // Type inferred from `getResponsiveCardTemplate` (same package instance as\n // `adapter`), not from a local `import type { TemplateRef } from '@angular/core'`\n // — the latter resolves through Bun's `.bun/` cache during ng-packagr build\n // and produces a brand-incompatible TemplateRef vs the built adapter `.d.ts`.\n const template = getResponsiveCardTemplate(gridElement);\n if (!template) return undefined;\n\n return (row: TRow, rowIndex: number) => {\n const context: GridResponsiveCardContext<TRow> = { $implicit: row, row, index: rowIndex };\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-responsive-card> Angular templates into the ResponsivePlugin\n// once content templates are registered. Runs from `Grid.ngAfterContentInit`\n// via the template-bridge registry.\nregisterTemplateBridge(({ grid, adapter }) => {\n // Only act when the user actually placed a <tbw-grid-responsive-card> in light DOM.\n const cardElement = grid.querySelector('tbw-grid-responsive-card');\n if (!cardElement) return;\n\n // Build a card renderer from the Angular template.\n const cardRenderer = adapter.createResponsiveCardRenderer(grid);\n if (!cardRenderer) return;\n\n // The plugin must already have been attached (via [responsive] input,\n // gridConfig.features.responsive, 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?.('responsive') as ResponsivePluginLike | undefined;\n\n if (!existingPlugin) {\n // eslint-disable-next-line no-console\n console.warn(\n '[tbw-grid-angular] <tbw-grid-responsive-card> found but ResponsivePlugin is not configured.\\n' +\n 'Add the [responsive] input, set gridConfig.features.responsive, or include\\n' +\n 'ResponsivePlugin in gridConfig.plugins:\\n\\n' +\n ' <tbw-grid [responsive]=\"{ breakpoint: 600 }\">...</tbw-grid>\\n\\n' +\n 'or:\\n\\n' +\n ' gridConfig = { features: { responsive: { breakpoint: 600 } } };',\n );\n return;\n }\n\n existingPlugin.setCardRenderer?.(cardRenderer as (row: unknown, rowIndex: number) => HTMLElement);\n});\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAA;;;;;AAKG;AAMH;;;;AAIG;MAKU,uBAAuB,CAAA;AACjB,IAAA,UAAU,GAAG,MAAM,EAAC,UAA2B,EAAC;IAExD,UAAU,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,YAAA,EA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AAI,CAAC;AAC/D,IAAA,IAAI,CAAC,YAAY;QAAE;;;;;;IAOnB,MAAM,cAAc,GAAI,IAAY,CAAC,eAAe,GAAG,YAAY,CAAqC;IAExG,IAAI,CAAC,cAAc,EAAE;;QAEnB,OAAO,CAAC,IAAI,CACV,+FAA+F;YAC7F,8EAA8E;YAC9E,6CAA6C;YAC7C,mEAAmE;YACnE,SAAS;AACT,YAAA,mEAAmE,CACtE;QACD;IACF;AAEA,IAAA,cAAc,CAAC,eAAe,GAAG,YAA+D,CAAC;AACnG,CAAC,CAAC;;ACjGF;;AAEG;;;;"}
1
+ {"version":3,"file":"toolbox-web-grid-angular-features-responsive.mjs","sources":["../../../../libs/grid-angular/features/responsive/src/grid-responsive.directive.ts","../../../../libs/grid-angular/features/responsive/src/index.ts","../../../../libs/grid-angular/features/responsive/src/toolbox-web-grid-angular-features-responsive.ts"],"sourcesContent":["/**\n * `GridResponsiveDirective` — owns `[responsive]` and `(responsiveChange)`\n * on `<tbw-grid>`. See `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 { ResponsiveChangeDetail, ResponsivePluginConfig } from '@toolbox-web/grid/plugins/responsive';\n\n/**\n * Owns the binding(s) `[responsive], [responsiveChange]` on `<tbw-grid>` for the matching feature plugin. See `GridFilteringDirective` for the full rationale.\n *\n * @category Directive\n */\n@Directive({\n selector: 'tbw-grid[responsive], tbw-grid[responsiveChange]',\n standalone: true,\n})\nexport class GridResponsiveDirective implements OnInit, OnDestroy {\n private readonly elementRef = inject(ElementRef<DataGridElement>);\n\n readonly responsive = input<boolean | ResponsivePluginConfig>();\n readonly responsiveChange = output<ResponsiveChangeDetail>();\n\n private listener?: (e: Event) => void;\n\n constructor() {\n const grid = this.elementRef.nativeElement;\n registerFeatureClaim(grid, 'responsive', () => this.responsive());\n claimEvent(grid, 'responsive-change');\n }\n\n ngOnInit(): void {\n const grid = this.elementRef.nativeElement;\n this.listener = (e: Event): void => this.responsiveChange.emit((e as CustomEvent<ResponsiveChangeDetail>).detail);\n grid.addEventListener('responsive-change', this.listener);\n }\n\n ngOnDestroy(): void {\n const grid = this.elementRef.nativeElement;\n if (this.listener) {\n grid.removeEventListener('responsive-change', this.listener);\n this.listener = undefined;\n }\n unregisterFeatureClaim(grid, 'responsive');\n unclaimEvent(grid, 'responsive-change');\n }\n}\n","/**\n * Responsive feature for @toolbox-web/grid-angular\n *\n * Import this module to enable the `[responsive]` input on the `Grid`\n * directive AND to wire `<tbw-grid-responsive-card>` Angular templates into\n * the ResponsivePlugin's `cardRenderer`.\n *\n * @example\n * ```typescript\n * // In your bootstrap (e.g. main.ts or app.component.ts):\n * import '@toolbox-web/grid-angular/features/responsive';\n * ```\n *\n * ```html\n * <tbw-grid [responsive]=\"{ breakpoint: 768 }\">\n * <tbw-grid-responsive-card>\n * <ng-template let-row>...</ng-template>\n * </tbw-grid-responsive-card>\n * </tbw-grid>\n * ```\n *\n * @packageDocumentation\n */\n\nimport {\n getResponsiveCardTemplate,\n registerResponsiveCardRendererBridge,\n registerTemplateBridge,\n type GridAdapter,\n type GridResponsiveCardContext,\n} from '@toolbox-web/grid-angular';\nimport '@toolbox-web/grid/features/responsive';\nexport { GridResponsiveDirective } from './grid-responsive.directive';\nexport type { _Augmentation as _ResponsiveAugmentation } from '@toolbox-web/grid/features/responsive';\n\n/**\n * Subset of `ResponsivePlugin` we touch from the bridge. Avoids importing\n * the plugin class itself.\n */\ninterface ResponsivePluginLike {\n setCardRenderer?: (renderer: (row: unknown, rowIndex: number) => HTMLElement) => void;\n}\n\n// Install the row renderer bridge on the adapter. This is what\n// `adapter.createResponsiveCardRenderer(grid)` and\n// `adapter.parseResponsiveCardElement(el)` delegate to. Without this import,\n// both methods return undefined.\nregisterResponsiveCardRendererBridge(<TRow = unknown>(gridElement: HTMLElement, adapter: GridAdapter) => {\n // Type inferred from `getResponsiveCardTemplate` (same package instance as\n // `adapter`), not from a local `import type { TemplateRef } from '@angular/core'`\n // — the latter resolves through Bun's `.bun/` cache during ng-packagr build\n // and produces a brand-incompatible TemplateRef vs the built adapter `.d.ts`.\n const template = getResponsiveCardTemplate(gridElement);\n if (!template) return undefined;\n\n return (row: TRow, rowIndex: number) => {\n const context: GridResponsiveCardContext<TRow> = { $implicit: row, row, index: rowIndex };\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-responsive-card> Angular templates into the ResponsivePlugin\n// once content templates are registered. Runs from `Grid.ngAfterContentInit`\n// via the template-bridge registry.\nregisterTemplateBridge(({ grid, adapter }) => {\n // Only act when the user actually placed a <tbw-grid-responsive-card> in light DOM.\n const cardElement = grid.querySelector('tbw-grid-responsive-card');\n if (!cardElement) return;\n\n // Build a card renderer from the Angular template.\n const cardRenderer = adapter.createResponsiveCardRenderer(grid);\n if (!cardRenderer) return;\n\n // The plugin must already have been attached (via [responsive] input,\n // gridConfig.features.responsive, 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?.('responsive') as ResponsivePluginLike | undefined;\n\n if (!existingPlugin) {\n console.warn(\n '[tbw-grid-angular] <tbw-grid-responsive-card> found but ResponsivePlugin is not configured.\\n' +\n 'Add the [responsive] input, set gridConfig.features.responsive, or include\\n' +\n 'ResponsivePlugin in gridConfig.plugins:\\n\\n' +\n ' <tbw-grid [responsive]=\"{ breakpoint: 600 }\">...</tbw-grid>\\n\\n' +\n 'or:\\n\\n' +\n ' gridConfig = { features: { responsive: { breakpoint: 600 } } };',\n );\n return;\n }\n\n existingPlugin.setCardRenderer?.(cardRenderer as (row: unknown, rowIndex: number) => HTMLElement);\n});\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAA;;;;;AAKG;AAMH;;;;AAIG;MAKU,uBAAuB,CAAA;AACjB,IAAA,UAAU,GAAG,MAAM,EAAC,UAA2B,EAAC;IAExD,UAAU,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,YAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAoC;IACtD,gBAAgB,GAAG,MAAM,EAA0B;AAEpD,IAAA,QAAQ;AAEhB,IAAA,WAAA,GAAA;AACE,QAAA,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa;AAC1C,QAAA,oBAAoB,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;AACjE,QAAA,UAAU,CAAC,IAAI,EAAE,mBAAmB,CAAC;IACvC;IAEA,QAAQ,GAAA;AACN,QAAA,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa;AAC1C,QAAA,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAQ,KAAW,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAE,CAAyC,CAAC,MAAM,CAAC;QACjH,IAAI,CAAC,gBAAgB,CAAC,mBAAmB,EAAE,IAAI,CAAC,QAAQ,CAAC;IAC3D;IAEA,WAAW,GAAA;AACT,QAAA,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa;AAC1C,QAAA,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,IAAI,CAAC,mBAAmB,CAAC,mBAAmB,EAAE,IAAI,CAAC,QAAQ,CAAC;AAC5D,YAAA,IAAI,CAAC,QAAQ,GAAG,SAAS;QAC3B;AACA,QAAA,sBAAsB,CAAC,IAAI,EAAE,YAAY,CAAC;AAC1C,QAAA,YAAY,CAAC,I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AC,IAAI,CAAC,CAAC;AACtE,QAAA,OAAO,SAAS;AAClB,IAAA,CAAC;AACH,CAAC,CAAC;AAEF;AACA;AACA;AACA,sBAAsB,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAI;;IAE3C,MAAM,WAAW,GAAG,IAAI,CAAC,aAAa,CAAC,0BAA0B,CAAC;AAClE,IAAA,IAAI,CAAC,WAAW;QAAE;;IAGlB,MAAM,YAAY,GAAG,OAAO,CAAC,4BAA4B,CAAC,IAAI,CAAC;AAC/D,IAAA,IAAI,CAAC,YAAY;QAAE;;;;;;IAOnB,MAAM,cAAc,GAAI,IAAY,CAAC,eAAe,GAAG,YAAY,CAAqC;IAExG,IAAI,CAAC,cAAc,EAAE;QACnB,OAAO,CAAC,IAAI,CACV,+FAA+F;YAC7F,8EAA8E;YAC9E,6CAA6C;YAC7C,mEAAmE;YACnE,SAAS;AACT,YAAA,mEAAmE,CACtE;QACD;IACF;AAEA,IAAA,cAAc,CAAC,eAAe,GAAG,YAA+D,CAAC;AACnG,CAAC,CAAC;;AChGF;;AAEG;;;;"}
@@ -11,7 +11,7 @@ import { registerFeatureClaim, claimEvent, unregisterFeatureClaim, unclaimEvent
11
11
  * @category Directive
12
12
  */
13
13
  /**
14
- * Owns the binding(s) `[rowDragDrop], [rowMove], [rowDragStart], [rowDragEnd], [rowDrop], [rowTransfer]` on `<tbw-grid>` for the matching feature plugin. See {@link GridFilteringDirective} for the full rationale.
14
+ * Owns the binding(s) `[rowDragDrop], [rowMove], [rowDragStart], [rowDragEnd], [rowDrop], [rowTransfer]` on `<tbw-grid>` for the matching feature plugin. See `GridFilteringDirective` for the full rationale.
15
15
  *
16
16
  * @category Directive
17
17
  */
@@ -1 +1 @@
1
- {"version":3,"file":"toolbox-web-grid-angular-features-row-drag-drop.mjs","sources":["../../../../libs/grid-angular/features/row-drag-drop/src/grid-row-drag-drop.directive.ts","../../../../libs/grid-angular/features/row-drag-drop/src/index.ts","../../../../libs/grid-angular/features/row-drag-drop/src/toolbox-web-grid-angular-features-row-drag-drop.ts"],"sourcesContent":["/**\n * `GridRowDragDropDirective` — owns `[rowDragDrop]` and the row drag-drop\n * outputs on `<tbw-grid>`. See `GridFilteringDirective` for the full\n * 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 RowDragDropConfig,\n RowDragEndDetail,\n RowDragStartDetail,\n RowDropDetail,\n RowMoveDetail,\n RowTransferDetail,\n} from '@toolbox-web/grid/plugins/row-drag-drop';\n\n/**\n * Owns the binding(s) `[rowDragDrop], [rowMove], [rowDragStart], [rowDragEnd], [rowDrop], [rowTransfer]` on `<tbw-grid>` for the matching feature plugin. See {@link GridFilteringDirective} for the full rationale.\n *\n * @category Directive\n */\n@Directive({\n selector:\n 'tbw-grid[rowDragDrop], tbw-grid[rowMove], tbw-grid[rowDragStart], tbw-grid[rowDragEnd], tbw-grid[rowDrop], tbw-grid[rowTransfer]',\n standalone: true,\n})\nexport class GridRowDragDropDirective implements OnInit, OnDestroy {\n private readonly elementRef = inject(ElementRef<DataGridElement>);\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n readonly rowDragDrop = input<boolean | RowDragDropConfig<any>>();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n readonly rowMove = output<RowMoveDetail<any>>();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n readonly rowDragStart = output<RowDragStartDetail<any>>();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n readonly rowDragEnd = output<RowDragEndDetail<any>>();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n readonly rowDrop = output<RowDropDetail<any>>();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n readonly rowTransfer = output<RowTransferDetail<any>>();\n\n private readonly listeners = new Map<string, (e: Event) => void>();\n private static readonly EVENTS = ['row-move', 'row-drag-start', 'row-drag-end', 'row-drop', 'row-transfer'] as const;\n\n constructor() {\n const grid = this.elementRef.nativeElement;\n registerFeatureClaim(grid, 'rowDragDrop', () => this.rowDragDrop());\n for (const ev of GridRowDragDropDirective.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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\n wire<RowMoveDetail<any>>('row-move', this.rowMove);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n wire<RowDragStartDetail<any>>('row-drag-start', this.rowDragStart);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n wire<RowDragEndDetail<any>>('row-drag-end', this.rowDragEnd);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n wire<RowDropDetail<any>>('row-drop', this.rowDrop);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n wire<RowTransferDetail<any>>('row-transfer', this.rowTransfer);\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, 'rowDragDrop');\n for (const ev of GridRowDragDropDirective.EVENTS) unclaimEvent(grid, ev);\n }\n}\n","/**\n * Row drag & drop feature for @toolbox-web/grid-angular\n *\n * Import this module to enable the `rowDragDrop` input on Grid directive\n * along with the `(rowDragStart)`, `(rowDragEnd)`, `(rowDrop)`, and\n * `(rowTransfer)` outputs. Supports both intra-grid reorder and cross-grid\n * transfer.\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid-angular/features/row-drag-drop';\n *\n * <tbw-grid [rowDragDrop]=\"{ dropZone: 'employees' }\" />\n * ```\n *\n * @packageDocumentation\n */\n\nimport '@toolbox-web/grid/features/row-drag-drop';\nexport { GridRowDragDropDirective } from './grid-row-drag-drop.directive';\nexport type { _Augmentation as _RowDragDropAugmentation } from '@toolbox-web/grid/features/row-drag-drop';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAA;;;;;;AAMG;AAaH;;;;AAIG;MAMU,wBAAwB,CAAA;AAClB,IAAA,UAAU,GAAG,MAAM,EAAC,UAA2B,EAAC;;IAGxD,WAAW,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,aAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAoC;;IAEvD,OAAO,GAAG,MAAM,EAAsB;;IAEtC,YAAY,GAAG,MAAM,EAA2B;;IAEhD,UAAU,GAAG,MAAM,EAAyB;;IAE5C,OAAO,GAAG,MAAM,EAAsB;;IAEtC,WAAW,GAAG,MAAM,EAA0B;AAEtC,IAAA,SAAS,GAAG,IAAI,GAAG,EAA8B;AAC1D,IAAA,OAAgB,MAAM,GAAG,CAAC,UAAU,EAAE,gBAAgB,EAAE,cAAc,EAAE,UAAU,EAAE,cAAc,CAAU;AAEpH,IAAA,WAAA,GAAA;AACE,QAAA,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa;AAC1C,QAAA,oBAAoB,CAAC,IAAI,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;AACnE,QAAA,KAAK,MAAM,EAAE,IAAI,wBAAwB,CAAC,MAAM;AAAE,YAAA,UAAU,CAAC,IAAI,EAAE,EAAE,CAAC;IACxE;IAEA,QAAQ,GAAA;AACN,QAAA,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa;AAC1C,QAAA,MAAM,IAAI,GAAG,CAAI,IAAY,EAAE,GAA6B,KAAU;AACpE,YAAA,MAAM,CAAC,GAAG,CAAC,CAAQ,KAAW,GAAG,CAAC,IAAI,CAAE,CAAo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AA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,OAAA,EAAA,SAAA,EAAA,YAAA,EAAA,cAAA,EAAA,UAAA,EAAA,YAAA,EAAA,OAAA,EAAA,SAAA,EAAA,WAAA,EAAA,aAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAxB,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBALpC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EACN,kIAAkI;AACpI,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;AC5BD;;;;;;;;;;;;;;;;AAgBG;;AChBH;;AAEG;;;;"}
1
+ {"version":3,"file":"toolbox-web-grid-angular-features-row-drag-drop.mjs","sources":["../../../../libs/grid-angular/features/row-drag-drop/src/grid-row-drag-drop.directive.ts","../../../../libs/grid-angular/features/row-drag-drop/src/index.ts","../../../../libs/grid-angular/features/row-drag-drop/src/toolbox-web-grid-angular-features-row-drag-drop.ts"],"sourcesContent":["/**\n * `GridRowDragDropDirective` — owns `[rowDragDrop]` and the row drag-drop\n * outputs on `<tbw-grid>`. See `GridFilteringDirective` for the full\n * 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 RowDragDropConfig,\n RowDragEndDetail,\n RowDragStartDetail,\n RowDropDetail,\n RowMoveDetail,\n RowTransferDetail,\n} from '@toolbox-web/grid/plugins/row-drag-drop';\n\n/**\n * Owns the binding(s) `[rowDragDrop], [rowMove], [rowDragStart], [rowDragEnd], [rowDrop], [rowTransfer]` on `<tbw-grid>` for the matching feature plugin. See `GridFilteringDirective` for the full rationale.\n *\n * @category Directive\n */\n@Directive({\n selector:\n 'tbw-grid[rowDragDrop], tbw-grid[rowMove], tbw-grid[rowDragStart], tbw-grid[rowDragEnd], tbw-grid[rowDrop], tbw-grid[rowTransfer]',\n standalone: true,\n})\nexport class GridRowDragDropDirective implements OnInit, OnDestroy {\n private readonly elementRef = inject(ElementRef<DataGridElement>);\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n readonly rowDragDrop = input<boolean | RowDragDropConfig<any>>();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n readonly rowMove = output<RowMoveDetail<any>>();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n readonly rowDragStart = output<RowDragStartDetail<any>>();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n readonly rowDragEnd = output<RowDragEndDetail<any>>();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n readonly rowDrop = output<RowDropDetail<any>>();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n readonly rowTransfer = output<RowTransferDetail<any>>();\n\n private readonly listeners = new Map<string, (e: Event) => void>();\n private static readonly EVENTS = ['row-move', 'row-drag-start', 'row-drag-end', 'row-drop', 'row-transfer'] as const;\n\n constructor() {\n const grid = this.elementRef.nativeElement;\n registerFeatureClaim(grid, 'rowDragDrop', () => this.rowDragDrop());\n for (const ev of GridRowDragDropDirective.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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\n wire<RowMoveDetail<any>>('row-move', this.rowMove);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n wire<RowDragStartDetail<any>>('row-drag-start', this.rowDragStart);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n wire<RowDragEndDetail<any>>('row-drag-end', this.rowDragEnd);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n wire<RowDropDetail<any>>('row-drop', this.rowDrop);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n wire<RowTransferDetail<any>>('row-transfer', this.rowTransfer);\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, 'rowDragDrop');\n for (const ev of GridRowDragDropDirective.EVENTS) unclaimEvent(grid, ev);\n }\n}\n","/**\n * Row drag & drop feature for @toolbox-web/grid-angular\n *\n * Import this module to enable the `rowDragDrop` input on Grid directive\n * along with the `(rowDragStart)`, `(rowDragEnd)`, `(rowDrop)`, and\n * `(rowTransfer)` outputs. Supports both intra-grid reorder and cross-grid\n * transfer.\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid-angular/features/row-drag-drop';\n *\n * <tbw-grid [rowDragDrop]=\"{ dropZone: 'employees' }\" />\n * ```\n *\n * @packageDocumentation\n */\n\nimport '@toolbox-web/grid/features/row-drag-drop';\nexport { GridRowDragDropDirective } from './grid-row-drag-drop.directive';\nexport type { _Augmentation as _RowDragDropAugmentation } from '@toolbox-web/grid/features/row-drag-drop';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAA;;;;;;AAMG;AAaH;;;;AAIG;MAMU,wBAAwB,CAAA;AAClB,IAAA,UAAU,GAAG,MAAM,EAAC,UAA2B,EAAC;;IAGxD,WAAW,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,aAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAoC;;IAEvD,OAAO,GAAG,MAAM,EAAsB;;IAEtC,YAAY,GAAG,MAAM,EAA2B;;IAEhD,UAAU,GAAG,MAAM,EAAyB;;IAE5C,OAAO,GAAG,MAAM,EAAsB;;IAEtC,WAAW,GAAG,MAAM,EAA0B;AAEtC,IAAA,SAAS,GAAG,IAAI,GAAG,EAA8B;AAC1D,IAAA,OAAgB,MAAM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AAI,CAAC,mBAAmB,CAAC,IAAI,EAAE,CAAC,CAAC;AACzE,QAAA,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE;AACtB,QAAA,sBAAsB,CAAC,IAAI,EAAE,aAAa,CAAC;AAC3C,QAAA,KAAK,MAAM,EAAE,IAAI,wBAAwB,CAAC,MAAM;AAAE,YAAA,YAAY,CAAC,IAAI,EAAE,EAAE,CAAC;IAC1E;uGAlDW,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAxB,wBAAwB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,kIAAA,EAAA,MAAA,EAAA,EAAA,WAAA,EAAA,EAAA,iBAAA,EAAA,aAAA,EAAA,UAAA,EAAA,aAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,OAAA,EAAA,SAAA,EAAA,YAAA,EAAA,cAAA,EAAA,UAAA,EAAA,YAAA,EAAA,OAAA,EAAA,SAAA,EAAA,WAAA,EAAA,aAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAxB,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBALpC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EACN,kIAAkI;AACpI,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;AC5BD;;;;;;;;;;;;;;;;AAgBG;;AChBH;;AAEG;;;;"}
@@ -11,7 +11,7 @@ import { registerFeatureClaim, claimEvent, unregisterFeatureClaim, unclaimEvent
11
11
  * @category Directive
12
12
  */
13
13
  /**
14
- * Owns the binding(s) `[selection], [selectionChange]` on `<tbw-grid>` for the matching feature plugin. See {@link GridFilteringDirective} for the full rationale.
14
+ * Owns the binding(s) `[selection], [selectionChange]` on `<tbw-grid>` for the matching feature plugin. See `GridFilteringDirective` for the full rationale.
15
15
  *
16
16
  * @category Directive
17
17
  */
@@ -1 +1 @@
1
- {"version":3,"file":"toolbox-web-grid-angular-features-selection.mjs","sources":["../../../../libs/grid-angular/features/selection/src/grid-selection.directive.ts","../../../../libs/grid-angular/features/selection/src/index.ts","../../../../libs/grid-angular/features/selection/src/toolbox-web-grid-angular-features-selection.ts"],"sourcesContent":["/**\n * `GridSelectionDirective` — owns `[selection]` and `(selectionChange)` on\n * `<tbw-grid>`. See `GridFilteringDirective` for the full rationale and\n * lifecycle contract; the same patterns apply here.\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 { SelectionChangeDetail, SelectionConfig } from '@toolbox-web/grid/plugins/selection';\n\n/**\n * Owns the binding(s) `[selection], [selectionChange]` 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[selection], tbw-grid[selectionChange]',\n standalone: true,\n})\nexport class GridSelectionDirective implements OnInit, OnDestroy {\n private readonly elementRef = inject(ElementRef<DataGridElement>);\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n readonly selection = input<'cell' | 'row' | 'range' | SelectionConfig<any>>();\n readonly selectionChange = output<SelectionChangeDetail>();\n\n private listener?: (e: Event) => void;\n\n constructor() {\n const grid = this.elementRef.nativeElement;\n registerFeatureClaim(grid, 'selection', () => this.selection());\n claimEvent(grid, 'selection-change');\n }\n\n ngOnInit(): void {\n const grid = this.elementRef.nativeElement;\n this.listener = (e: Event) => this.selectionChange.emit((e as CustomEvent<SelectionChangeDetail>).detail);\n grid.addEventListener('selection-change', this.listener);\n }\n\n ngOnDestroy(): void {\n const grid = this.elementRef.nativeElement;\n if (this.listener) {\n grid.removeEventListener('selection-change', this.listener);\n this.listener = undefined;\n }\n unregisterFeatureClaim(grid, 'selection');\n unclaimEvent(grid, 'selection-change');\n }\n}\n","/**\n * Selection feature for @toolbox-web/grid-angular\n *\n * Import this module to enable the `selection` input on Grid directive.\n * Also exports `injectGridSelection()` for programmatic selection control.\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid-angular/features/selection';\n *\n * <tbw-grid [selection]=\"'range'\" />\n * ```\n *\n * @example Using injectGridSelection\n * ```typescript\n * import { injectGridSelection } from '@toolbox-web/grid-angular/features/selection';\n *\n * @Component({...})\n * export class MyComponent {\n * private selection = injectGridSelection<Employee>();\n *\n * selectAll() {\n * this.selection.selectAll();\n * }\n *\n * getSelected() {\n * return this.selection.getSelection();\n * }\n * }\n * ```\n *\n * @packageDocumentation\n */\n\nimport { afterNextRender, DestroyRef, ElementRef, inject, signal, type Signal } from '@angular/core';\nimport type { DataGridElement } from '@toolbox-web/grid';\nimport '@toolbox-web/grid/features/selection';\nimport {\n SelectionPlugin,\n type CellRange,\n type SelectionChangeDetail,\n type SelectionResult,\n} from '@toolbox-web/grid/plugins/selection';\nexport { GridSelectionDirective } from './grid-selection.directive';\nexport type { _Augmentation as _SelectionAugmentation } from '@toolbox-web/grid/features/selection';\n\n/**\n * Selection methods returned from injectGridSelection.\n *\n * Uses lazy discovery - the grid is found on first method call, not during initialization.\n * This ensures it works with lazy-rendered tabs, conditional rendering, etc.\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 (imperative, point-in-time snapshot).\n * For reactive selection state, use the `selection` signal instead.\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 * Reactive selection state. Updates automatically whenever the selection changes.\n * Null when no SelectionPlugin is active or no selection has been made yet.\n *\n * @example\n * ```typescript\n * readonly selection = injectGridSelection();\n *\n * // In template:\n * // {{ selection.selection()?.ranges?.length ?? 0 }} cells selected\n *\n * // In computed:\n * readonly hasSelection = computed(() => (this.selection.selection()?.ranges?.length ?? 0) > 0);\n * ```\n */\n selection: Signal<SelectionResult | null>;\n\n /**\n * Reactive selected row indices (sorted ascending). Updates automatically.\n * Convenience signal for row-mode selection — returns `[]` in cell/range modes\n * or when nothing is selected.\n *\n * **Prefer `selectedRows`** for getting actual row objects — it handles\n * index-to-object resolution correctly regardless of sorting/filtering.\n *\n * @example\n * ```typescript\n * readonly selection = injectGridSelection();\n *\n * // In template:\n * // {{ selection.selectedRowIndices().length }} rows selected\n * ```\n */\n selectedRowIndices: Signal<number[]>;\n\n /**\n * Reactive selected row objects. Updates automatically whenever the selection changes.\n * Works in all selection modes (row, cell, range) — returns the actual row objects\n * from the grid's processed (sorted/filtered) rows.\n *\n * This is the recommended way to get selected rows. Unlike manual index mapping,\n * it correctly resolves rows even when the grid is sorted or filtered.\n *\n * @example\n * ```typescript\n * readonly selection = injectGridSelection<Employee>();\n *\n * // In template:\n * // {{ selection.selectedRows().length }} rows selected\n *\n * // In computed:\n * readonly hasSelection = computed(() => this.selection.selectedRows().length > 0);\n * ```\n */\n selectedRows: Signal<TRow[]>;\n\n /**\n * Signal indicating if grid is ready.\n * The grid is discovered lazily, so this updates when first method call succeeds.\n */\n isReady: Signal<boolean>;\n}\n\n/**\n * Angular inject function for programmatic selection control.\n *\n * Uses **lazy grid discovery** - the grid element is found when methods are called,\n * not during initialization. This ensures it works reliably with:\n * - Lazy-rendered tabs\n * - Conditional rendering (*ngIf)\n * - Dynamic component loading\n *\n * @example\n * ```typescript\n * import { Component } from '@angular/core';\n * import { Grid } from '@toolbox-web/grid-angular';\n * import '@toolbox-web/grid-angular/features/selection';\n * import { injectGridSelection } from '@toolbox-web/grid-angular/features/selection';\n *\n * @Component({\n * selector: 'app-my-grid',\n * imports: [Grid],\n * template: `\n * <button (click)=\"handleSelectAll()\">Select All</button>\n * <tbw-grid [rows]=\"rows\" [selection]=\"'range'\"></tbw-grid>\n * `\n * })\n * export class MyGridComponent {\n * selection = injectGridSelection();\n *\n * handleSelectAll() {\n * this.selection.selectAll();\n * }\n *\n * getSelectedRows() {\n * const selection = this.selection.getSelection();\n * if (!selection) return [];\n * // Derive rows from selection.ranges as needed\n * }\n * }\n * ```\n *\n * @param selector - Optional CSS selector to target a specific grid element.\n * Defaults to `'tbw-grid'` (first grid in the component). Use when the\n * component contains multiple grids, e.g. `'tbw-grid.primary'` or `'#my-grid'`.\n */\nexport function injectGridSelection<TRow = unknown>(selector = 'tbw-grid'): SelectionMethods<TRow> {\n const elementRef = inject(ElementRef);\n const destroyRef = inject(DestroyRef);\n const isReady = signal(false);\n\n // Reactive selection state\n const selectionSignal = signal<SelectionResult | null>(null);\n const selectedRowIndicesSignal = signal<number[]>([]);\n const selectedRowsSignal = signal<TRow[]>([]);\n\n // Lazy discovery: cached grid reference\n let cachedGrid: DataGridElement<TRow> | null = null;\n let readyPromiseStarted = false;\n let listenerAttached = false;\n\n /**\n * Handle selection-change events from the grid.\n * Updates both reactive signals.\n */\n const onSelectionChange = (detail: unknown): void => {\n const selectionDetail = detail as SelectionChangeDetail;\n const plugin = getPlugin();\n if (plugin) {\n selectionSignal.set(plugin.getSelection());\n selectedRowIndicesSignal.set(selectionDetail.mode === 'row' ? plugin.getSelectedRowIndices() : []);\n selectedRowsSignal.set(plugin.getSelectedRows<TRow>());\n }\n };\n\n /**\n * Attach the selection-change event listener to the grid element.\n * Called once when the grid is first discovered.\n */\n const attachListener = (grid: DataGridElement<TRow>): void => {\n if (listenerAttached) return;\n listenerAttached = true;\n\n const unsub = grid.on('selection-change', onSelectionChange);\n\n destroyRef.onDestroy(() => {\n unsub();\n });\n };\n\n /**\n * Lazily find the grid element. Called on each method invocation.\n * Caches the reference once found and triggers ready() check.\n */\n const getGrid = (): DataGridElement<TRow> | null => {\n if (cachedGrid) return cachedGrid;\n\n const grid = elementRef.nativeElement.querySelector(selector) as DataGridElement<TRow> | null;\n if (grid) {\n cachedGrid = grid;\n attachListener(grid);\n // Start ready() check only once\n if (!readyPromiseStarted) {\n readyPromiseStarted = true;\n grid.ready?.().then(() => {\n if (grid.getPluginByName('selection')) {\n isReady.set(true);\n } else {\n setTimeout(() => isReady.set(true), 0);\n }\n });\n }\n }\n return grid;\n };\n\n const getPlugin = (): SelectionPlugin | undefined => {\n return getGrid()?.getPluginByName('selection') as SelectionPlugin | undefined;\n };\n\n /**\n * Sync reactive signals with the current plugin state.\n * Called once when the grid is first discovered and ready.\n */\n const syncSignals = (): void => {\n const plugin = getPlugin();\n if (plugin) {\n selectionSignal.set(plugin.getSelection());\n const mode = (plugin as any).config?.mode;\n selectedRowIndicesSignal.set(mode === 'row' ? plugin.getSelectedRowIndices() : []);\n selectedRowsSignal.set(plugin.getSelectedRows<TRow>());\n }\n };\n\n // Discover the grid after the first render so the selection-change\n // listener is attached without requiring a programmatic method call.\n // Uses a MutationObserver as fallback for lazy-rendered tabs, *ngIf,\n // @defer, etc. where the grid may not be in the DOM on first render.\n afterNextRender(() => {\n const grid = getGrid();\n if (grid) {\n grid.ready?.().then(() => {\n if (grid.getPluginByName('selection')) {\n syncSignals();\n } else {\n setTimeout(syncSignals, 0);\n }\n });\n return;\n }\n\n // Grid not in DOM yet — watch for it to appear.\n const host = elementRef.nativeElement as HTMLElement;\n const observer = new MutationObserver(() => {\n const discovered = getGrid();\n if (discovered) {\n observer.disconnect();\n discovered.ready?.().then(() => {\n if (discovered.getPluginByName('selection')) {\n syncSignals();\n } else {\n setTimeout(syncSignals, 0);\n }\n });\n }\n });\n observer.observe(host, { childList: true, subtree: true });\n\n destroyRef.onDestroy(() => observer.disconnect());\n });\n\n return {\n isReady: isReady.asReadonly(),\n selection: selectionSignal.asReadonly(),\n selectedRowIndices: selectedRowIndicesSignal.asReadonly(),\n selectedRows: selectedRowsSignal.asReadonly(),\n\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 ` <tbw-grid [selection]=\"'range'\" />`,\n );\n return;\n }\n const grid = getGrid();\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}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAA;;;;;;AAMG;AAMH;;;;AAIG;MAKU,sBAAsB,CAAA;AAChB,IAAA,UAAU,GAAG,MAAM,EAAC,UAA2B,EAAC;;IAGxD,SAAS,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,WAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAmD;IACpE,eAAe,GAAG,MAAM,EAAyB;AAElD,IAAA,QAAQ;AAEhB,IAAA,WAAA,GAAA;AACE,QAAA,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa;AAC1C,QAAA,oBAAoB,CAAC,IAAI,EAAE,WAAW,EAAE,MA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,GAAG,EAAE,QAAQ,GAAG,CAAC,EAAE,GAAG,EAAE,QAAQ,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;gBAChG;YACF;QACF,CAAC;QAED,cAAc,EAAE,MAAK;AACnB,YAAA,SAAS,EAAE,EAAE,cAAc,EAAE;QAC/B,CAAC;QAED,YAAY,EAAE,MAAK;AACjB,YAAA,OAAO,SAAS,EAAE,EAAE,YAAY,EAAE,IAAI,IAAI;QAC5C,CAAC;AAED,QAAA,cAAc,EAAE,CAAC,GAAW,EAAE,GAAW,KAAI;YAC3C,OAAO,SAAS,EAAE,EAAE,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,KAAK;QACvD,CAAC;AAED,QAAA,SAAS,EAAE,CAAC,MAAmB,KAAI;AACjC,YAAA,SAAS,EAAE,EAAE,SAAS,CAAC,MAAM,CAAC;QAChC,CAAC;KACF;AACH;;ACzWA;;AAEG;;;;"}
1
+ {"version":3,"file":"toolbox-web-grid-angular-features-selection.mjs","sources":["../../../../libs/grid-angular/features/selection/src/grid-selection.directive.ts","../../../../libs/grid-angular/features/selection/src/index.ts","../../../../libs/grid-angular/features/selection/src/toolbox-web-grid-angular-features-selection.ts"],"sourcesContent":["/**\n * `GridSelectionDirective` — owns `[selection]` and `(selectionChange)` on\n * `<tbw-grid>`. See `GridFilteringDirective` for the full rationale and\n * lifecycle contract; the same patterns apply here.\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 { SelectionChangeDetail, SelectionConfig } from '@toolbox-web/grid/plugins/selection';\n\n/**\n * Owns the binding(s) `[selection], [selectionChange]` on `<tbw-grid>` for the matching feature plugin. See `GridFilteringDirective` for the full rationale.\n *\n * @category Directive\n */\n@Directive({\n selector: 'tbw-grid[selection], tbw-grid[selectionChange]',\n standalone: true,\n})\nexport class GridSelectionDirective implements OnInit, OnDestroy {\n private readonly elementRef = inject(ElementRef<DataGridElement>);\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n readonly selection = input<'cell' | 'row' | 'range' | SelectionConfig<any>>();\n readonly selectionChange = output<SelectionChangeDetail>();\n\n private listener?: (e: Event) => void;\n\n constructor() {\n const grid = this.elementRef.nativeElement;\n registerFeatureClaim(grid, 'selection', () => this.selection());\n claimEvent(grid, 'selection-change');\n }\n\n ngOnInit(): void {\n const grid = this.elementRef.nativeElement;\n this.listener = (e: Event) => this.selectionChange.emit((e as CustomEvent<SelectionChangeDetail>).detail);\n grid.addEventListener('selection-change', this.listener);\n }\n\n ngOnDestroy(): void {\n const grid = this.elementRef.nativeElement;\n if (this.listener) {\n grid.removeEventListener('selection-change', this.listener);\n this.listener = undefined;\n }\n unregisterFeatureClaim(grid, 'selection');\n unclaimEvent(grid, 'selection-change');\n }\n}\n","/**\n * Selection feature for @toolbox-web/grid-angular\n *\n * Import this module to enable the `selection` input on Grid directive.\n * Also exports `injectGridSelection()` for programmatic selection control.\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid-angular/features/selection';\n *\n * <tbw-grid [selection]=\"'range'\" />\n * ```\n *\n * @example Using injectGridSelection\n * ```typescript\n * import { injectGridSelection } from '@toolbox-web/grid-angular/features/selection';\n *\n * @Component({...})\n * export class MyComponent {\n * private selection = injectGridSelection<Employee>();\n *\n * selectAll() {\n * this.selection.selectAll();\n * }\n *\n * getSelected() {\n * return this.selection.getSelection();\n * }\n * }\n * ```\n *\n * @packageDocumentation\n */\n\nimport { afterNextRender, DestroyRef, ElementRef, inject, signal, type Signal } from '@angular/core';\nimport type { DataGridElement } from '@toolbox-web/grid';\nimport '@toolbox-web/grid/features/selection';\nimport {\n SelectionPlugin,\n type CellRange,\n type SelectionChangeDetail,\n type SelectionResult,\n} from '@toolbox-web/grid/plugins/selection';\nexport { GridSelectionDirective } from './grid-selection.directive';\nexport type { _Augmentation as _SelectionAugmentation } from '@toolbox-web/grid/features/selection';\n\n/**\n * Selection methods returned from injectGridSelection.\n *\n * Uses lazy discovery - the grid is found on first method call, not during initialization.\n * This ensures it works with lazy-rendered tabs, conditional rendering, etc.\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 (imperative, point-in-time snapshot).\n * For reactive selection state, use the `selection` signal instead.\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 * Reactive selection state. Updates automatically whenever the selection changes.\n * Null when no SelectionPlugin is active or no selection has been made yet.\n *\n * @example\n * ```typescript\n * readonly selection = injectGridSelection();\n *\n * // In template:\n * // {{ selection.selection()?.ranges?.length ?? 0 }} cells selected\n *\n * // In computed:\n * readonly hasSelection = computed(() => (this.selection.selection()?.ranges?.length ?? 0) > 0);\n * ```\n */\n selection: Signal<SelectionResult | null>;\n\n /**\n * Reactive selected row indices (sorted ascending). Updates automatically.\n * Convenience signal for row-mode selection — returns `[]` in cell/range modes\n * or when nothing is selected.\n *\n * **Prefer `selectedRows`** for getting actual row objects — it handles\n * index-to-object resolution correctly regardless of sorting/filtering.\n *\n * @example\n * ```typescript\n * readonly selection = injectGridSelection();\n *\n * // In template:\n * // {{ selection.selectedRowIndices().length }} rows selected\n * ```\n */\n selectedRowIndices: Signal<number[]>;\n\n /**\n * Reactive selected row objects. Updates automatically whenever the selection changes.\n * Works in all selection modes (row, cell, range) — returns the actual row objects\n * from the grid's processed (sorted/filtered) rows.\n *\n * This is the recommended way to get selected rows. Unlike manual index mapping,\n * it correctly resolves rows even when the grid is sorted or filtered.\n *\n * @example\n * ```typescript\n * readonly selection = injectGridSelection<Employee>();\n *\n * // In template:\n * // {{ selection.selectedRows().length }} rows selected\n *\n * // In computed:\n * readonly hasSelection = computed(() => this.selection.selectedRows().length > 0);\n * ```\n */\n selectedRows: Signal<TRow[]>;\n\n /**\n * Signal indicating if grid is ready.\n * The grid is discovered lazily, so this updates when first method call succeeds.\n */\n isReady: Signal<boolean>;\n}\n\n/**\n * Angular inject function for programmatic selection control.\n *\n * Uses **lazy grid discovery** - the grid element is found when methods are called,\n * not during initialization. This ensures it works reliably with:\n * - Lazy-rendered tabs\n * - Conditional rendering (*ngIf)\n * - Dynamic component loading\n *\n * @example\n * ```typescript\n * import { Component } from '@angular/core';\n * import { Grid } from '@toolbox-web/grid-angular';\n * import '@toolbox-web/grid-angular/features/selection';\n * import { injectGridSelection } from '@toolbox-web/grid-angular/features/selection';\n *\n * @Component({\n * selector: 'app-my-grid',\n * imports: [Grid],\n * template: `\n * <button (click)=\"handleSelectAll()\">Select All</button>\n * <tbw-grid [rows]=\"rows\" [selection]=\"'range'\"></tbw-grid>\n * `\n * })\n * export class MyGridComponent {\n * selection = injectGridSelection();\n *\n * handleSelectAll() {\n * this.selection.selectAll();\n * }\n *\n * getSelectedRows() {\n * const selection = this.selection.getSelection();\n * if (!selection) return [];\n * // Derive rows from selection.ranges as needed\n * }\n * }\n * ```\n *\n * @param selector - Optional CSS selector to target a specific grid element.\n * Defaults to `'tbw-grid'` (first grid in the component). Use when the\n * component contains multiple grids, e.g. `'tbw-grid.primary'` or `'#my-grid'`.\n */\nexport function injectGridSelection<TRow = unknown>(selector = 'tbw-grid'): SelectionMethods<TRow> {\n const elementRef = inject(ElementRef);\n const destroyRef = inject(DestroyRef);\n const isReady = signal(false);\n\n // Reactive selection state\n const selectionSignal = signal<SelectionResult | null>(null);\n const selectedRowIndicesSignal = signal<number[]>([]);\n const selectedRowsSignal = signal<TRow[]>([]);\n\n // Lazy discovery: cached grid reference\n let cachedGrid: DataGridElement<TRow> | null = null;\n let readyPromiseStarted = false;\n let listenerAttached = false;\n\n /**\n * Handle selection-change events from the grid.\n * Updates both reactive signals.\n */\n const onSelectionChange = (detail: unknown): void => {\n const selectionDetail = detail as SelectionChangeDetail;\n const plugin = getPlugin();\n if (plugin) {\n selectionSignal.set(plugin.getSelection());\n selectedRowIndicesSignal.set(selectionDetail.mode === 'row' ? plugin.getSelectedRowIndices() : []);\n selectedRowsSignal.set(plugin.getSelectedRows<TRow>());\n }\n };\n\n /**\n * Attach the selection-change event listener to the grid element.\n * Called once when the grid is first discovered.\n */\n const attachListener = (grid: DataGridElement<TRow>): void => {\n if (listenerAttached) return;\n listenerAttached = true;\n\n const unsub = grid.on('selection-change', onSelectionChange);\n\n destroyRef.onDestroy(() => {\n unsub();\n });\n };\n\n /**\n * Lazily find the grid element. Called on each method invocation.\n * Caches the reference once found and triggers ready() check.\n */\n const getGrid = (): DataGridElement<TRow> | null => {\n if (cachedGrid) return cachedGrid;\n\n const grid = elementRef.nativeElement.querySelector(selector) as DataGridElement<TRow> | null;\n if (grid) {\n cachedGrid = grid;\n attachListener(grid);\n // Start ready() check only once\n if (!readyPromiseStarted) {\n readyPromiseStarted = true;\n grid.ready?.().then(() => {\n if (grid.getPluginByName('selection')) {\n isReady.set(true);\n } else {\n setTimeout(() => isReady.set(true), 0);\n }\n });\n }\n }\n return grid;\n };\n\n const getPlugin = (): SelectionPlugin | undefined => {\n return getGrid()?.getPluginByName('selection') as SelectionPlugin | undefined;\n };\n\n /**\n * Sync reactive signals with the current plugin state.\n * Called once when the grid is first discovered and ready.\n */\n const syncSignals = (): void => {\n const plugin = getPlugin();\n if (plugin) {\n selectionSignal.set(plugin.getSelection());\n const mode = (plugin as any).config?.mode;\n selectedRowIndicesSignal.set(mode === 'row' ? plugin.getSelectedRowIndices() : []);\n selectedRowsSignal.set(plugin.getSelectedRows<TRow>());\n }\n };\n\n // Discover the grid after the first render so the selection-change\n // listener is attached without requiring a programmatic method call.\n // Uses a MutationObserver as fallback for lazy-rendered tabs, *ngIf,\n // @defer, etc. where the grid may not be in the DOM on first render.\n afterNextRender(() => {\n const grid = getGrid();\n if (grid) {\n grid.ready?.().then(() => {\n if (grid.getPluginByName('selection')) {\n syncSignals();\n } else {\n setTimeout(syncSignals, 0);\n }\n });\n return;\n }\n\n // Grid not in DOM yet — watch for it to appear.\n const host = elementRef.nativeElement as HTMLElement;\n const observer = new MutationObserver(() => {\n const discovered = getGrid();\n if (discovered) {\n observer.disconnect();\n discovered.ready?.().then(() => {\n if (discovered.getPluginByName('selection')) {\n syncSignals();\n } else {\n setTimeout(syncSignals, 0);\n }\n });\n }\n });\n observer.observe(host, { childList: true, subtree: true });\n\n destroyRef.onDestroy(() => observer.disconnect());\n });\n\n return {\n isReady: isReady.asReadonly(),\n selection: selectionSignal.asReadonly(),\n selectedRowIndices: selectedRowIndicesSignal.asReadonly(),\n selectedRows: selectedRowsSignal.asReadonly(),\n\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 ` <tbw-grid [selection]=\"'range'\" />`,\n );\n return;\n }\n const grid = getGrid();\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);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,GAAG,CAAC,CAAC,CAAC;AACnD,gBAAA,MAAc,CAAC,QAAQ,GAAG,UAAU;AACpC,gBAAA,MAAc,CAAC,kBAAkB,IAAI;YACxC;AAAO,iBAAA,IAAI,IAAI,KAAK,OAAO,EAAE;gBAC3B,MAAM,QAAQ,GAAG,IAAI,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;gBACxC,MAAM,QAAQ,GAAI,IAAY,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;gBACrD,IAAI,QAAQ,GAAG,CAAC,IAAI,QAAQ,GAAG,CAAC,EAAE;AAChC,oBAAA,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,QAAQ,GAAG,CAAC,EAAE,GAAG,EAAE,QAAQ,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;gBAChG;YACF;QACF,CAAC;QAED,cAAc,EAAE,MAAK;AACnB,YAAA,SAAS,EAAE,EAAE,cAAc,EAAE;QAC/B,CAAC;QAED,YAAY,EAAE,MAAK;AACjB,YAAA,OAAO,SAAS,EAAE,EAAE,YAAY,EAAE,IAAI,IAAI;QAC5C,CAAC;AAED,QAAA,cAAc,EAAE,CAAC,GAAW,EAAE,GAAW,KAAI;YAC3C,OAAO,SAAS,EAAE,EAAE,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,KAAK;QACvD,CAAC;AAED,QAAA,SAAS,EAAE,CAAC,MAAmB,KAAI;AACjC,YAAA,SAAS,EAAE,EAAE,SAAS,CAAC,MAAM,CAAC;QAChC,CAAC;KACF;AACH;;ACzWA;;AAEG;;;;"}
@@ -10,7 +10,7 @@ import { registerFeatureClaim, unregisterFeatureClaim } from '@toolbox-web/grid-
10
10
  * @category Directive
11
11
  */
12
12
  /**
13
- * Owns the binding(s) `[serverSide]` on `<tbw-grid>` for the matching feature plugin. See {@link GridFilteringDirective} for the full rationale.
13
+ * Owns the binding(s) `[serverSide]` on `<tbw-grid>` for the matching feature plugin. See `GridFilteringDirective` for the full rationale.
14
14
  *
15
15
  * @category Directive
16
16
  */
@@ -1 +1 @@
1
- {"version":3,"file":"toolbox-web-grid-angular-features-server-side.mjs","sources":["../../../../libs/grid-angular/features/server-side/src/grid-server-side.directive.ts","../../../../libs/grid-angular/features/server-side/src/index.ts","../../../../libs/grid-angular/features/server-side/src/toolbox-web-grid-angular-features-server-side.ts"],"sourcesContent":["/**\n * `GridServerSideDirective` — owns `[serverSide]` on `<tbw-grid>`. No\n * event outputs. See `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';\nimport type { ServerSideConfig } from '@toolbox-web/grid/plugins/server-side';\n\n/**\n * Owns the binding(s) `[serverSide]` 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[serverSide]',\n standalone: true,\n})\nexport class GridServerSideDirective implements OnDestroy {\n private readonly elementRef = inject(ElementRef<DataGridElement>);\n\n readonly serverSide = input<ServerSideConfig>();\n\n constructor() {\n registerFeatureClaim(this.elementRef.nativeElement, 'serverSide', () => this.serverSide());\n }\n\n ngOnDestroy(): void {\n unregisterFeatureClaim(this.elementRef.nativeElement, 'serverSide');\n }\n}\n","/**\n * Server-side feature for @toolbox-web/grid-angular\n *\n * Import this module to enable the `serverSide` input on Grid directive.\n *\n * The grid's `ServerSideDataSource.getRows()` accepts either a `Promise` or an\n * RxJS-style `Observable` (any `Subscribable`) directly — Angular `HttpClient`\n * results work without any wrapper. Superseded requests are cancelled by the\n * grid via `unsubscribe()`, which is what causes `HttpClient` to abort the\n * underlying XHR.\n *\n * @example\n * ```typescript\n * import { Component, inject } from '@angular/core';\n * import { HttpClient } from '@angular/common/http';\n * import { map } from 'rxjs/operators';\n * import { Grid } from '@toolbox-web/grid-angular';\n * import '@toolbox-web/grid-angular/features/server-side';\n * import type { ServerSideDataSource } from '@toolbox-web/grid/plugins/server-side';\n *\n * @Component({\n * imports: [Grid],\n * template: `<tbw-grid [serverSide]=\"{ dataSource }\" />`,\n * })\n * class MyGrid {\n * private http = inject(HttpClient);\n * dataSource: ServerSideDataSource = {\n * getRows: (params) =>\n * this.http.get<{ items: unknown[]; total: number }>('/api/data', {\n * params: { offset: params.startNode, limit: params.endNode - params.startNode },\n * }).pipe(map((d) => ({ rows: d.items, totalNodeCount: d.total }))),\n * };\n * }\n * ```\n *\n * @packageDocumentation\n */\n\nimport '@toolbox-web/grid/features/server-side';\nexport { GridServerSideDirective } from './grid-server-side.directive';\nexport type { _Augmentation as _ServerSideAugmentation } from '@toolbox-web/grid/features/server-side';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAA;;;;;AAKG;AAMH;;;;AAIG;MAKU,uBAAuB,CAAA;AACjB,IAAA,UAAU,GAAG,MAAM,EAAC,UAA2B,EAAC;IAExD,UAAU,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,YAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAoB;AAE/C,IAAA,WAAA,GAAA;AACE,QAAA,oBAAoB,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;IAC5F;IAEA,WAAW,GAAA;QACT,sBAAsB,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,YAAY,CAAC;IACrE;uGAXW,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAvB,uBAAuB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,sBAAA,EAAA,MAAA,EAAA,EAAA,UAAA,EAAA,EAAA,iBAAA,EAAA,YAAA,EAAA,UAAA,EAAA,YAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAvB,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAJnC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,sBAAsB;AAChC,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;ACnBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCG;;ACpCH;;AAEG;;;;"}
1
+ {"version":3,"file":"toolbox-web-grid-angular-features-server-side.mjs","sources":["../../../../libs/grid-angular/features/server-side/src/grid-server-side.directive.ts","../../../../libs/grid-angular/features/server-side/src/index.ts","../../../../libs/grid-angular/features/server-side/src/toolbox-web-grid-angular-features-server-side.ts"],"sourcesContent":["/**\n * `GridServerSideDirective` — owns `[serverSide]` on `<tbw-grid>`. No\n * event outputs. See `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';\nimport type { ServerSideConfig } from '@toolbox-web/grid/plugins/server-side';\n\n/**\n * Owns the binding(s) `[serverSide]` on `<tbw-grid>` for the matching feature plugin. See `GridFilteringDirective` for the full rationale.\n *\n * @category Directive\n */\n@Directive({\n selector: 'tbw-grid[serverSide]',\n standalone: true,\n})\nexport class GridServerSideDirective implements OnDestroy {\n private readonly elementRef = inject(ElementRef<DataGridElement>);\n\n readonly serverSide = input<ServerSideConfig>();\n\n constructor() {\n registerFeatureClaim(this.elementRef.nativeElement, 'serverSide', () => this.serverSide());\n }\n\n ngOnDestroy(): void {\n unregisterFeatureClaim(this.elementRef.nativeElement, 'serverSide');\n }\n}\n","/**\n * Server-side feature for @toolbox-web/grid-angular\n *\n * Import this module to enable the `serverSide` input on Grid directive.\n *\n * The grid's `ServerSideDataSource.getRows()` accepts either a `Promise` or an\n * RxJS-style `Observable` (any `Subscribable`) directly — Angular `HttpClient`\n * results work without any wrapper. Superseded requests are cancelled by the\n * grid via `unsubscribe()`, which is what causes `HttpClient` to abort the\n * underlying XHR.\n *\n * @example\n * ```typescript\n * import { Component, inject } from '@angular/core';\n * import { HttpClient } from '@angular/common/http';\n * import { map } from 'rxjs/operators';\n * import { Grid } from '@toolbox-web/grid-angular';\n * import '@toolbox-web/grid-angular/features/server-side';\n * import type { ServerSideDataSource } from '@toolbox-web/grid/plugins/server-side';\n *\n * @Component({\n * imports: [Grid],\n * template: `<tbw-grid [serverSide]=\"{ dataSource }\" />`,\n * })\n * class MyGrid {\n * private http = inject(HttpClient);\n * dataSource: ServerSideDataSource = {\n * getRows: (params) =>\n * this.http.get<{ items: unknown[]; total: number }>('/api/data', {\n * params: { offset: params.startNode, limit: params.endNode - params.startNode },\n * }).pipe(map((d) => ({ rows: d.items, totalNodeCount: d.total }))),\n * };\n * }\n * ```\n *\n * @packageDocumentation\n */\n\nimport '@toolbox-web/grid/features/server-side';\nexport { GridServerSideDirective } from './grid-server-side.directive';\nexport type { _Augmentation as _ServerSideAugmentation } from '@toolbox-web/grid/features/server-side';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAA;;;;;AAKG;AAMH;;;;AAIG;MAKU,uBAAuB,CAAA;AACjB,IAAA,UAAU,GAAG,MAAM,EAAC,UAA2B,EAAC;IAExD,UAAU,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,YAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAoB;AAE/C,IAAA,WAAA,GAAA;AACE,QAAA,oBAAoB,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;IAC5F;IAEA,WAAW,GAAA;QACT,sBAAsB,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,YAAY,CAAC;IACrE;uGAXW,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAvB,uBAAuB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,sBAAA,EAAA,MAAA,EAAA,EAAA,UAAA,EAAA,EAAA,iBAAA,EAAA,YAAA,EAAA,UAAA,EAAA,YAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAvB,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAJnC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,sBAAsB;AAChC,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;ACnBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCG;;ACpCH;;AAEG;;;;"}
@@ -0,0 +1,58 @@
1
+ import '@toolbox-web/grid/features/sticky-rows';
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
+ * `GridStickyRowsDirective` — owns `[stickyRows]` on `<tbw-grid>`.
8
+ * No event outputs. See `GridFilteringDirective` for the full rationale.
9
+ *
10
+ * @category Directive
11
+ */
12
+ /**
13
+ * Owns the binding `[stickyRows]` on `<tbw-grid>` for the matching feature plugin.
14
+ * See `GridFilteringDirective` for the full rationale.
15
+ *
16
+ * @category Directive
17
+ */
18
+ class GridStickyRowsDirective {
19
+ elementRef = inject((ElementRef));
20
+ stickyRows = input(...(ngDevMode ? [undefined, { debugName: "stickyRows" }] : /* istanbul ignore next */ []));
21
+ constructor() {
22
+ registerFeatureClaim(this.elementRef.nativeElement, 'stickyRows', () => this.stickyRows());
23
+ }
24
+ ngOnDestroy() {
25
+ unregisterFeatureClaim(this.elementRef.nativeElement, 'stickyRows');
26
+ }
27
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: GridStickyRowsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
28
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.5", type: GridStickyRowsDirective, isStandalone: true, selector: "tbw-grid[stickyRows]", inputs: { stickyRows: { classPropertyName: "stickyRows", publicName: "stickyRows", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
29
+ }
30
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: GridStickyRowsDirective, decorators: [{
31
+ type: Directive,
32
+ args: [{
33
+ selector: 'tbw-grid[stickyRows]',
34
+ standalone: true,
35
+ }]
36
+ }], ctorParameters: () => [], propDecorators: { stickyRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "stickyRows", required: false }] }] } });
37
+
38
+ /**
39
+ * Sticky rows feature for @toolbox-web/grid-angular
40
+ *
41
+ * Import this module to enable the `stickyRows` input on the Grid directive.
42
+ *
43
+ * @example
44
+ * ```typescript
45
+ * import '@toolbox-web/grid-angular/features/sticky-rows';
46
+ *
47
+ * <tbw-grid [stickyRows]="{ isSticky: 'isSection' }" />
48
+ * ```
49
+ *
50
+ * @packageDocumentation
51
+ */
52
+
53
+ /**
54
+ * Generated bundle index. Do not edit.
55
+ */
56
+
57
+ export { GridStickyRowsDirective };
58
+ //# sourceMappingURL=toolbox-web-grid-angular-features-sticky-rows.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolbox-web-grid-angular-features-sticky-rows.mjs","sources":["../../../../libs/grid-angular/features/sticky-rows/src/grid-sticky-rows.directive.ts","../../../../libs/grid-angular/features/sticky-rows/src/index.ts","../../../../libs/grid-angular/features/sticky-rows/src/toolbox-web-grid-angular-features-sticky-rows.ts"],"sourcesContent":["/**\n * `GridStickyRowsDirective` — owns `[stickyRows]` on `<tbw-grid>`.\n * No event outputs. See `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';\nimport type { StickyRowsConfig } from '@toolbox-web/grid/plugins/sticky-rows';\n\n/**\n * Owns the binding `[stickyRows]` on `<tbw-grid>` for the matching feature plugin.\n * See `GridFilteringDirective` for the full rationale.\n *\n * @category Directive\n */\n@Directive({\n selector: 'tbw-grid[stickyRows]',\n standalone: true,\n})\nexport class GridStickyRowsDirective implements OnDestroy {\n private readonly elementRef = inject(ElementRef<DataGridElement>);\n\n readonly stickyRows = input<StickyRowsConfig>();\n\n constructor() {\n registerFeatureClaim(this.elementRef.nativeElement, 'stickyRows', () => this.stickyRows());\n }\n\n ngOnDestroy(): void {\n unregisterFeatureClaim(this.elementRef.nativeElement, 'stickyRows');\n }\n}\n","/**\n * Sticky rows feature for @toolbox-web/grid-angular\n *\n * Import this module to enable the `stickyRows` input on the Grid directive.\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid-angular/features/sticky-rows';\n *\n * <tbw-grid [stickyRows]=\"{ isSticky: 'isSection' }\" />\n * ```\n *\n * @packageDocumentation\n */\n\nimport '@toolbox-web/grid/features/sticky-rows';\nexport { GridStickyRowsDirective } from './grid-sticky-rows.directive';\nexport type { _Augmentation as _StickyRowsAugmentation } from '@toolbox-web/grid/features/sticky-rows';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAA;;;;;AAKG;AAMH;;;;;AAKG;MAKU,uBAAuB,CAAA;AACjB,IAAA,UAAU,GAAG,MAAM,EAAC,UAA2B,EAAC;IAExD,UAAU,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,YAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAoB;AAE/C,IAAA,WAAA,GAAA;AACE,QAAA,oBAAoB,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;IAC5F;IAEA,WAAW,GAAA;QACT,sBAAsB,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,YAAY,CAAC;IACrE;uGAXW,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAvB,uBAAuB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,sBAAA,EAAA,MAAA,EAAA,EAAA,UAAA,EAAA,EAAA,iBAAA,EAAA,YAAA,EAAA,UAAA,EAAA,YAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAvB,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAJnC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,sBAAsB;AAChC,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;ACpBD;;;;;;;;;;;;;AAaG;;ACbH;;AAEG;;;;"}
@@ -10,7 +10,7 @@ import { registerFeatureClaim, unregisterFeatureClaim } from '@toolbox-web/grid-
10
10
  * @category Directive
11
11
  */
12
12
  /**
13
- * Owns the binding(s) `[tooltip]` on `<tbw-grid>` for the matching feature plugin. See {@link GridFilteringDirective} for the full rationale.
13
+ * Owns the binding(s) `[tooltip]` on `<tbw-grid>` for the matching feature plugin. See `GridFilteringDirective` for the full rationale.
14
14
  *
15
15
  * @category Directive
16
16
  */
@@ -1 +1 @@
1
- {"version":3,"file":"toolbox-web-grid-angular-features-tooltip.mjs","sources":["../../../../libs/grid-angular/features/tooltip/src/grid-tooltip.directive.ts","../../../../libs/grid-angular/features/tooltip/src/index.ts","../../../../libs/grid-angular/features/tooltip/src/toolbox-web-grid-angular-features-tooltip.ts"],"sourcesContent":["/**\n * `GridTooltipDirective` — owns `[tooltip]` on `<tbw-grid>`. No event\n * outputs. See `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';\nimport type { TooltipConfig } from '@toolbox-web/grid/plugins/tooltip';\n\n/**\n * Owns the binding(s) `[tooltip]` 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[tooltip]',\n standalone: true,\n})\nexport class GridTooltipDirective implements OnDestroy {\n private readonly elementRef = inject(ElementRef<DataGridElement>);\n\n readonly tooltip = input<boolean | TooltipConfig>();\n\n constructor() {\n registerFeatureClaim(this.elementRef.nativeElement, 'tooltip', () => this.tooltip());\n }\n\n ngOnDestroy(): void {\n unregisterFeatureClaim(this.elementRef.nativeElement, 'tooltip');\n }\n}\n","/**\n * Tooltip feature for @toolbox-web/grid-angular\n *\n * Import this module to enable the `tooltip` input on Grid directive.\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid-angular/features/tooltip';\n *\n * <tbw-grid [tooltip]=\"true\" />\n * ```\n *\n * @packageDocumentation\n */\n\nimport '@toolbox-web/grid/features/tooltip';\nexport { GridTooltipDirective } from './grid-tooltip.directive';\nexport type { _Augmentation as _TooltipAugmentation } from '@toolbox-web/grid/features/tooltip';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAA;;;;;AAKG;AAMH;;;;AAIG;MAKU,oBAAoB,CAAA;AACd,IAAA,UAAU,GAAG,MAAM,EAAC,UAA2B,EAAC;IAExD,OAAO,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,SAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAA2B;AAEnD,IAAA,WAAA,GAAA;AACE,QAAA,oBAAoB,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;IACtF;IAEA,WAAW,GAAA;QACT,sBAAsB,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,SAAS,CAAC;IAClE;uGAXW,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAApB,oBAAoB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,mBAAA,EAAA,MAAA,EAAA,EAAA,OAAA,EAAA,EAAA,iBAAA,EAAA,SAAA,EAAA,UAAA,EAAA,SAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAApB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAJhC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,mBAAmB;AAC7B,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;ACnBD;;;;;;;;;;;;;AAaG;;ACbH;;AAEG;;;;"}
1
+ {"version":3,"file":"toolbox-web-grid-angular-features-tooltip.mjs","sources":["../../../../libs/grid-angular/features/tooltip/src/grid-tooltip.directive.ts","../../../../libs/grid-angular/features/tooltip/src/index.ts","../../../../libs/grid-angular/features/tooltip/src/toolbox-web-grid-angular-features-tooltip.ts"],"sourcesContent":["/**\n * `GridTooltipDirective` — owns `[tooltip]` on `<tbw-grid>`. No event\n * outputs. See `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';\nimport type { TooltipConfig } from '@toolbox-web/grid/plugins/tooltip';\n\n/**\n * Owns the binding(s) `[tooltip]` on `<tbw-grid>` for the matching feature plugin. See `GridFilteringDirective` for the full rationale.\n *\n * @category Directive\n */\n@Directive({\n selector: 'tbw-grid[tooltip]',\n standalone: true,\n})\nexport class GridTooltipDirective implements OnDestroy {\n private readonly elementRef = inject(ElementRef<DataGridElement>);\n\n readonly tooltip = input<boolean | TooltipConfig>();\n\n constructor() {\n registerFeatureClaim(this.elementRef.nativeElement, 'tooltip', () => this.tooltip());\n }\n\n ngOnDestroy(): void {\n unregisterFeatureClaim(this.elementRef.nativeElement, 'tooltip');\n }\n}\n","/**\n * Tooltip feature for @toolbox-web/grid-angular\n *\n * Import this module to enable the `tooltip` input on Grid directive.\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid-angular/features/tooltip';\n *\n * <tbw-grid [tooltip]=\"true\" />\n * ```\n *\n * @packageDocumentation\n */\n\nimport '@toolbox-web/grid/features/tooltip';\nexport { GridTooltipDirective } from './grid-tooltip.directive';\nexport type { _Augmentation as _TooltipAugmentation } from '@toolbox-web/grid/features/tooltip';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAA;;;;;AAKG;AAMH;;;;AAIG;MAKU,oBAAoB,CAAA;AACd,IAAA,UAAU,GAAG,MAAM,EAAC,UAA2B,EAAC;IAExD,OAAO,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,SAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAA2B;AAEnD,IAAA,WAAA,GAAA;AACE,QAAA,oBAAoB,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;IACtF;IAEA,WAAW,GAAA;QACT,sBAAsB,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,SAAS,CAAC;IAClE;uGAXW,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAApB,oBAAoB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,mBAAA,EAAA,MAAA,EAAA,EAAA,OAAA,EAAA,EAAA,iBAAA,EAAA,SAAA,EAAA,UAAA,EAAA,SAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAApB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAJhC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,mBAAmB;AAC7B,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;ACnBD;;;;;;;;;;;;;AAaG;;ACbH;;AAEG;;;;"}
@@ -10,7 +10,7 @@ import { registerFeatureClaim, claimEvent, unregisterFeatureClaim, unclaimEvent
10
10
  * @category Directive
11
11
  */
12
12
  /**
13
- * Owns the binding(s) `[tree], [treeExpand]` on `<tbw-grid>` for the matching feature plugin. See {@link GridFilteringDirective} for the full rationale.
13
+ * Owns the binding(s) `[tree], [treeExpand]` on `<tbw-grid>` for the matching feature plugin. See `GridFilteringDirective` for the full rationale.
14
14
  *
15
15
  * @category Directive
16
16
  */
@@ -1 +1 @@
1
- {"version":3,"file":"toolbox-web-grid-angular-features-tree.mjs","sources":["../../../../libs/grid-angular/features/tree/src/grid-tree.directive.ts","../../../../libs/grid-angular/features/tree/src/index.ts","../../../../libs/grid-angular/features/tree/src/toolbox-web-grid-angular-features-tree.ts"],"sourcesContent":["/**\n * `GridTreeDirective` — owns `[tree]` and `(treeExpand)` on `<tbw-grid>`.\n * See `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 { TreeConfig, TreeExpandDetail } from '@toolbox-web/grid/plugins/tree';\n\n/**\n * Owns the binding(s) `[tree], [treeExpand]` 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[tree], tbw-grid[treeExpand]',\n standalone: true,\n})\nexport class GridTreeDirective implements OnInit, OnDestroy {\n private readonly elementRef = inject(ElementRef<DataGridElement>);\n\n readonly tree = input<boolean | TreeConfig>();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n readonly treeExpand = output<TreeExpandDetail<any>>();\n\n private listener?: (e: Event) => void;\n\n constructor() {\n const grid = this.elementRef.nativeElement;\n registerFeatureClaim(grid, 'tree', () => this.tree());\n claimEvent(grid, 'tree-expand');\n }\n\n ngOnInit(): void {\n const grid = this.elementRef.nativeElement;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this.listener = (e: Event): void => this.treeExpand.emit((e as CustomEvent<TreeExpandDetail<any>>).detail);\n grid.addEventListener('tree-expand', this.listener);\n }\n\n ngOnDestroy(): void {\n const grid = this.elementRef.nativeElement;\n if (this.listener) {\n grid.removeEventListener('tree-expand', this.listener);\n this.listener = undefined;\n }\n unregisterFeatureClaim(grid, 'tree');\n unclaimEvent(grid, 'tree-expand');\n }\n}\n","/**\n * Tree feature for @toolbox-web/grid-angular\n *\n * Import this module to enable the `tree` input on Grid directive.\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid-angular/features/tree';\n *\n * <tbw-grid [tree]=\"{ childrenField: 'children' }\" />\n * ```\n *\n * @packageDocumentation\n */\n\nimport '@toolbox-web/grid/features/tree';\nexport { GridTreeDirective } from './grid-tree.directive';\nexport type { _Augmentation as _TreeAugmentation } from '@toolbox-web/grid/features/tree';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAA;;;;;AAKG;AAMH;;;;AAIG;MAKU,iBAAiB,CAAA;AACX,IAAA,UAAU,GAAG,MAAM,EAAC,UAA2B,EAAC;IAExD,IAAI,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,MAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAwB;;IAEpC,UAAU,GAAG,MAAM,EAAyB;AAE7C,IAAA,QAAQ;AAEhB,IAAA,WAAA,GAAA;AACE,QAAA,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa;AAC1C,QAAA,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;AACrD,QAAA,UAAU,CAAC,IAAI,EAAE,aAAa,CAAC;IACjC;IAEA,QAAQ,GAAA;AACN,QAAA,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa;;AAE1C,QAAA,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAQ,KAAW,IAAI,CAAC,UAAU,CAAC,IAAI,CAAE,CAAwC,CAAC,MAAM,CAAC;QAC1G,IAAI,CAAC,gBAAgB,CAAC,aAAa,EAAE,IAAI,CAAC,QAAQ,CAAC;IACrD;IAEA,WAAW,GAAA;AACT,QAAA,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa;AAC1C,QAAA,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,IAAI,CAAC,mBAAmB,CAAC,aAAa,EAAE,IAAI,CAAC,QAAQ,CAAC;AACtD,YAAA,IAAI,CAAC,QAAQ,GAAG,SAAS;QAC3B;AACA,QAAA,sBAAsB,CAAC,IAAI,EAAE,MAAM,CAAC;AACpC,QAAA,YAAY,CAAC,IAAI,EAAE,aAAa,CAAC;IACnC;uGA9BW,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAjB,iBAAiB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,sCAAA,EAAA,MAAA,EAAA,EAAA,IAAA,EAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,UAAA,EAAA,MAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,UAAA,EAAA,YAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAJ7B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,sCAAsC;AAChD,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;ACnBD;;;;;;;;;;;;;AAaG;;ACbH;;AAEG;;;;"}
1
+ {"version":3,"file":"toolbox-web-grid-angular-features-tree.mjs","sources":["../../../../libs/grid-angular/features/tree/src/grid-tree.directive.ts","../../../../libs/grid-angular/features/tree/src/index.ts","../../../../libs/grid-angular/features/tree/src/toolbox-web-grid-angular-features-tree.ts"],"sourcesContent":["/**\n * `GridTreeDirective` — owns `[tree]` and `(treeExpand)` on `<tbw-grid>`.\n * See `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 { TreeConfig, TreeExpandDetail } from '@toolbox-web/grid/plugins/tree';\n\n/**\n * Owns the binding(s) `[tree], [treeExpand]` on `<tbw-grid>` for the matching feature plugin. See `GridFilteringDirective` for the full rationale.\n *\n * @category Directive\n */\n@Directive({\n selector: 'tbw-grid[tree], tbw-grid[treeExpand]',\n standalone: true,\n})\nexport class GridTreeDirective implements OnInit, OnDestroy {\n private readonly elementRef = inject(ElementRef<DataGridElement>);\n\n readonly tree = input<boolean | TreeConfig>();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n readonly treeExpand = output<TreeExpandDetail<any>>();\n\n private listener?: (e: Event) => void;\n\n constructor() {\n const grid = this.elementRef.nativeElement;\n registerFeatureClaim(grid, 'tree', () => this.tree());\n claimEvent(grid, 'tree-expand');\n }\n\n ngOnInit(): void {\n const grid = this.elementRef.nativeElement;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this.listener = (e: Event): void => this.treeExpand.emit((e as CustomEvent<TreeExpandDetail<any>>).detail);\n grid.addEventListener('tree-expand', this.listener);\n }\n\n ngOnDestroy(): void {\n const grid = this.elementRef.nativeElement;\n if (this.listener) {\n grid.removeEventListener('tree-expand', this.listener);\n this.listener = undefined;\n }\n unregisterFeatureClaim(grid, 'tree');\n unclaimEvent(grid, 'tree-expand');\n }\n}\n","/**\n * Tree feature for @toolbox-web/grid-angular\n *\n * Import this module to enable the `tree` input on Grid directive.\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid-angular/features/tree';\n *\n * <tbw-grid [tree]=\"{ childrenField: 'children' }\" />\n * ```\n *\n * @packageDocumentation\n */\n\nimport '@toolbox-web/grid/features/tree';\nexport { GridTreeDirective } from './grid-tree.directive';\nexport type { _Augmentation as _TreeAugmentation } from '@toolbox-web/grid/features/tree';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],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SAAA,EAAA,CAAA;2FAAjB,iBAAiB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,sCAAA,EAAA,MAAA,EAAA,EAAA,IAAA,EAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,UAAA,EAAA,MAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,UAAA,EAAA,YAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAJ7B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,sCAAsC;AAChD,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;ACnBD;;;;;;;;;;;;;AAaG;;ACbH;;AAEG;;;;"}
@@ -10,7 +10,7 @@ import { registerFeatureClaim, claimEvent, unregisterFeatureClaim, unclaimEvent
10
10
  * @category Directive
11
11
  */
12
12
  /**
13
- * Owns the binding(s) `[undoRedo], [undo], [redo]` on `<tbw-grid>` for the matching feature plugin. See {@link GridFilteringDirective} for the full rationale.
13
+ * Owns the binding(s) `[undoRedo], [undo], [redo]` on `<tbw-grid>` for the matching feature plugin. See `GridFilteringDirective` for the full rationale.
14
14
  *
15
15
  * @category Directive
16
16
  */