@toolbox-web/grid-angular 1.5.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/toolbox-web-grid-angular-features-clipboard.mjs +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-clipboard.mjs.map +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-column-virtualization.mjs +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-column-virtualization.mjs.map +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-context-menu.mjs +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-context-menu.mjs.map +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-editing.mjs +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-editing.mjs.map +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-export.mjs +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-export.mjs.map +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-grouping-columns.mjs +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-grouping-columns.mjs.map +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-grouping-rows.mjs +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-grouping-rows.mjs.map +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-master-detail.mjs +1 -2
- package/fesm2022/toolbox-web-grid-angular-features-master-detail.mjs.map +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-multi-sort.mjs +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-multi-sort.mjs.map +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-pinned-columns.mjs +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-pinned-columns.mjs.map +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-pinned-rows.mjs +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-pinned-rows.mjs.map +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-pivot.mjs +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-pivot.mjs.map +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-print.mjs +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-print.mjs.map +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-reorder-columns.mjs +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-reorder-columns.mjs.map +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-reorder-rows.mjs +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-reorder-rows.mjs.map +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-responsive.mjs +1 -2
- package/fesm2022/toolbox-web-grid-angular-features-responsive.mjs.map +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-row-drag-drop.mjs +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-row-drag-drop.mjs.map +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-selection.mjs +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-selection.mjs.map +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-server-side.mjs +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-server-side.mjs.map +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-tooltip.mjs +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-tooltip.mjs.map +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-tree.mjs +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-tree.mjs.map +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-undo-redo.mjs +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-undo-redo.mjs.map +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-visibility.mjs +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-visibility.mjs.map +1 -1
- package/fesm2022/toolbox-web-grid-angular.mjs +17 -4
- package/fesm2022/toolbox-web-grid-angular.mjs.map +1 -1
- package/package.json +1 -1
- package/types/toolbox-web-grid-angular-features-clipboard.d.ts +1 -1
- package/types/toolbox-web-grid-angular-features-column-virtualization.d.ts +1 -1
- package/types/toolbox-web-grid-angular-features-context-menu.d.ts +1 -1
- package/types/toolbox-web-grid-angular-features-editing.d.ts +1 -1
- package/types/toolbox-web-grid-angular-features-export.d.ts +1 -1
- package/types/toolbox-web-grid-angular-features-grouping-columns.d.ts +1 -1
- package/types/toolbox-web-grid-angular-features-grouping-rows.d.ts +1 -1
- package/types/toolbox-web-grid-angular-features-master-detail.d.ts +1 -1
- package/types/toolbox-web-grid-angular-features-multi-sort.d.ts +1 -1
- package/types/toolbox-web-grid-angular-features-pinned-columns.d.ts +1 -1
- package/types/toolbox-web-grid-angular-features-pinned-rows.d.ts +1 -1
- package/types/toolbox-web-grid-angular-features-pivot.d.ts +1 -1
- package/types/toolbox-web-grid-angular-features-print.d.ts +1 -1
- package/types/toolbox-web-grid-angular-features-reorder-columns.d.ts +1 -1
- package/types/toolbox-web-grid-angular-features-reorder-rows.d.ts +1 -1
- package/types/toolbox-web-grid-angular-features-responsive.d.ts +1 -1
- package/types/toolbox-web-grid-angular-features-row-drag-drop.d.ts +1 -1
- package/types/toolbox-web-grid-angular-features-selection.d.ts +1 -1
- package/types/toolbox-web-grid-angular-features-server-side.d.ts +1 -1
- package/types/toolbox-web-grid-angular-features-tooltip.d.ts +1 -1
- package/types/toolbox-web-grid-angular-features-tree.d.ts +1 -1
- package/types/toolbox-web-grid-angular-features-undo-redo.d.ts +1 -1
- package/types/toolbox-web-grid-angular-features-visibility.d.ts +1 -1
- package/types/toolbox-web-grid-angular.d.ts +14 -1
- package/types/toolbox-web-grid-angular.d.ts.map +1 -1
|
@@ -10,7 +10,7 @@ import { registerFeatureClaim, claimEvent, unregisterFeatureClaim, unclaimEvent
|
|
|
10
10
|
* @category Directive
|
|
11
11
|
*/
|
|
12
12
|
/**
|
|
13
|
-
* Owns the binding(s) `[clipboard], [copy], [paste]` on `<tbw-grid>` for the matching feature plugin. See
|
|
13
|
+
* Owns the binding(s) `[clipboard], [copy], [paste]` 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-clipboard.mjs","sources":["../../../../libs/grid-angular/features/clipboard/src/grid-clipboard.directive.ts","../../../../libs/grid-angular/features/clipboard/src/index.ts","../../../../libs/grid-angular/features/clipboard/src/toolbox-web-grid-angular-features-clipboard.ts"],"sourcesContent":["/**\n * `GridClipboardDirective` — owns `[clipboard]`, `(copy)`, `(paste)` on\n * `<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 { ClipboardConfig, CopyDetail, PasteDetail } from '@toolbox-web/grid/plugins/clipboard';\n\n/**\n * Owns the binding(s) `[clipboard], [copy], [paste]` on `<tbw-grid>` for the matching feature plugin. See
|
|
1
|
+
{"version":3,"file":"toolbox-web-grid-angular-features-clipboard.mjs","sources":["../../../../libs/grid-angular/features/clipboard/src/grid-clipboard.directive.ts","../../../../libs/grid-angular/features/clipboard/src/index.ts","../../../../libs/grid-angular/features/clipboard/src/toolbox-web-grid-angular-features-clipboard.ts"],"sourcesContent":["/**\n * `GridClipboardDirective` — owns `[clipboard]`, `(copy)`, `(paste)` on\n * `<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 { ClipboardConfig, CopyDetail, PasteDetail } from '@toolbox-web/grid/plugins/clipboard';\n\n/**\n * Owns the binding(s) `[clipboard], [copy], [paste]` 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[clipboard], tbw-grid[copy], tbw-grid[paste]',\n standalone: true,\n})\nexport class GridClipboardDirective implements OnInit, OnDestroy {\n private readonly elementRef = inject(ElementRef<DataGridElement>);\n\n readonly clipboard = input<boolean | ClipboardConfig>();\n readonly copy = output<CopyDetail>();\n readonly paste = output<PasteDetail>();\n\n private readonly listeners = new Map<string, (e: Event) => void>();\n\n constructor() {\n const grid = this.elementRef.nativeElement;\n registerFeatureClaim(grid, 'clipboard', () => this.clipboard());\n claimEvent(grid, 'copy');\n claimEvent(grid, 'paste');\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<CopyDetail>('copy', this.copy);\n wire<PasteDetail>('paste', this.paste);\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, 'clipboard');\n unclaimEvent(grid, 'copy');\n unclaimEvent(grid, 'paste');\n }\n}\n","/**\n * Clipboard feature for @toolbox-web/grid-angular\n *\n * Import this module to enable the `clipboard` input on Grid directive.\n * Requires selection feature to be enabled.\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid-angular/features/selection';\n * import '@toolbox-web/grid-angular/features/clipboard';\n *\n * <tbw-grid [selection]=\"'range'\" [clipboard]=\"true\" />\n * ```\n *\n * @packageDocumentation\n */\n\nimport '@toolbox-web/grid/features/clipboard';\nexport { GridClipboardDirective } from './grid-clipboard.directive';\nexport type { _Augmentation as _ClipboardAugmentation } from '@toolbox-web/grid/features/clipboard';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAA;;;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CAAC,CAAC,IAAI,IAAI,CAAC,SAAS;AAAE,YAAA,IAAI,CAAC,mBAAmB,CAAC,IAAI,EAAE,CAAC,CAAC;AACzE,QAAA,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE;AACtB,QAAA,sBAAsB,CAAC,IAAI,EAAE,WAAW,CAAC;AACzC,QAAA,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC;AAC1B,QAAA,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC;IAC7B;uGAlCW,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAtB,sBAAsB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,sDAAA,EAAA,MAAA,EAAA,EAAA,SAAA,EAAA,EAAA,iBAAA,EAAA,WAAA,EAAA,UAAA,EAAA,WAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,KAAA,EAAA,OAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAtB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAJlC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,sDAAsD;AAChE,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;ACnBD;;;;;;;;;;;;;;;AAeG;;ACfH;;AAEG;;;;"}
|
|
@@ -11,7 +11,7 @@ import { registerFeatureClaim, unregisterFeatureClaim } from '@toolbox-web/grid-
|
|
|
11
11
|
* @category Directive
|
|
12
12
|
*/
|
|
13
13
|
/**
|
|
14
|
-
* Owns the binding(s) `[columnVirtualization]` on `<tbw-grid>` for the matching feature plugin. See
|
|
14
|
+
* Owns the binding(s) `[columnVirtualization]` 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-column-virtualization.mjs","sources":["../../../../libs/grid-angular/features/column-virtualization/src/grid-column-virtualization.directive.ts","../../../../libs/grid-angular/features/column-virtualization/src/index.ts","../../../../libs/grid-angular/features/column-virtualization/src/toolbox-web-grid-angular-features-column-virtualization.ts"],"sourcesContent":["/**\n * `GridColumnVirtualizationDirective` — owns `[columnVirtualization]` on\n * `<tbw-grid>`. No event outputs. See `GridFilteringDirective` for the\n * full rationale.\n *\n * @category Directive\n */\nimport { Directive, ElementRef, inject, input, OnDestroy } from '@angular/core';\nimport type { DataGridElement } from '@toolbox-web/grid';\nimport { registerFeatureClaim, unregisterFeatureClaim } from '@toolbox-web/grid-angular';\nimport type { ColumnVirtualizationConfig } from '@toolbox-web/grid/plugins/column-virtualization';\n\n/**\n * Owns the binding(s) `[columnVirtualization]` on `<tbw-grid>` for the matching feature plugin. See
|
|
1
|
+
{"version":3,"file":"toolbox-web-grid-angular-features-column-virtualization.mjs","sources":["../../../../libs/grid-angular/features/column-virtualization/src/grid-column-virtualization.directive.ts","../../../../libs/grid-angular/features/column-virtualization/src/index.ts","../../../../libs/grid-angular/features/column-virtualization/src/toolbox-web-grid-angular-features-column-virtualization.ts"],"sourcesContent":["/**\n * `GridColumnVirtualizationDirective` — owns `[columnVirtualization]` on\n * `<tbw-grid>`. No event outputs. See `GridFilteringDirective` for the\n * full rationale.\n *\n * @category Directive\n */\nimport { Directive, ElementRef, inject, input, OnDestroy } from '@angular/core';\nimport type { DataGridElement } from '@toolbox-web/grid';\nimport { registerFeatureClaim, unregisterFeatureClaim } from '@toolbox-web/grid-angular';\nimport type { ColumnVirtualizationConfig } from '@toolbox-web/grid/plugins/column-virtualization';\n\n/**\n * Owns the binding(s) `[columnVirtualization]` 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[columnVirtualization]',\n standalone: true,\n})\nexport class GridColumnVirtualizationDirective implements OnDestroy {\n private readonly elementRef = inject(ElementRef<DataGridElement>);\n\n readonly columnVirtualization = input<boolean | ColumnVirtualizationConfig>();\n\n constructor() {\n registerFeatureClaim(this.elementRef.nativeElement, 'columnVirtualization', () => this.columnVirtualization());\n }\n\n ngOnDestroy(): void {\n unregisterFeatureClaim(this.elementRef.nativeElement, 'columnVirtualization');\n }\n}\n","/**\n * Column virtualization feature for @toolbox-web/grid-angular\n *\n * Import this module to enable the `columnVirtualization` input on Grid directive.\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid-angular/features/column-virtualization';\n *\n * <tbw-grid [columnVirtualization]=\"true\" />\n * ```\n *\n * @packageDocumentation\n */\n\nimport '@toolbox-web/grid/features/column-virtualization';\nexport { GridColumnVirtualizationDirective } from './grid-column-virtualization.directive';\nexport type { _Augmentation as _ColumnVirtualizationAugmentation } from '@toolbox-web/grid/features/column-virtualization';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAA;;;;;;AAMG;AAMH;;;;AAIG;MAKU,iCAAiC,CAAA;AAC3B,IAAA,UAAU,GAAG,MAAM,EAAC,UAA2B,EAAC;IAExD,oBAAoB,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,sBAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAwC;AAE7E,IAAA,WAAA,GAAA;AACE,QAAA,oBAAoB,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,sBAAsB,EAAE,MAAM,IAAI,CAAC,oBAAoB,EAAE,CAAC;IAChH;IAEA,WAAW,GAAA;QACT,sBAAsB,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,sBAAsB,CAAC;IAC/E;uGAXW,iCAAiC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAjC,iCAAiC,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,gCAAA,EAAA,MAAA,EAAA,EAAA,oBAAA,EAAA,EAAA,iBAAA,EAAA,sBAAA,EAAA,UAAA,EAAA,sBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAjC,iCAAiC,EAAA,UAAA,EAAA,CAAA;kBAJ7C,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,gCAAgC;AAC1C,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;ACpBD;;;;;;;;;;;;;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) `[contextMenu], [contextMenuOpen]` on `<tbw-grid>` for the matching feature plugin. See
|
|
13
|
+
* Owns the binding(s) `[contextMenu], [contextMenuOpen]` 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-context-menu.mjs","sources":["../../../../libs/grid-angular/features/context-menu/src/grid-context-menu.directive.ts","../../../../libs/grid-angular/features/context-menu/src/index.ts","../../../../libs/grid-angular/features/context-menu/src/toolbox-web-grid-angular-features-context-menu.ts"],"sourcesContent":["/**\n * `GridContextMenuDirective` — owns `[contextMenu]` and `(contextMenuOpen)`\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 { ContextMenuConfig, ContextMenuOpenDetail } from '@toolbox-web/grid/plugins/context-menu';\n\n/**\n * Owns the binding(s) `[contextMenu], [contextMenuOpen]` on `<tbw-grid>` for the matching feature plugin. See
|
|
1
|
+
{"version":3,"file":"toolbox-web-grid-angular-features-context-menu.mjs","sources":["../../../../libs/grid-angular/features/context-menu/src/grid-context-menu.directive.ts","../../../../libs/grid-angular/features/context-menu/src/index.ts","../../../../libs/grid-angular/features/context-menu/src/toolbox-web-grid-angular-features-context-menu.ts"],"sourcesContent":["/**\n * `GridContextMenuDirective` — owns `[contextMenu]` and `(contextMenuOpen)`\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 { ContextMenuConfig, ContextMenuOpenDetail } from '@toolbox-web/grid/plugins/context-menu';\n\n/**\n * Owns the binding(s) `[contextMenu], [contextMenuOpen]` 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[contextMenu], tbw-grid[contextMenuOpen]',\n standalone: true,\n})\nexport class GridContextMenuDirective implements OnInit, OnDestroy {\n private readonly elementRef = inject(ElementRef<DataGridElement>);\n\n readonly contextMenu = input<boolean | ContextMenuConfig>();\n readonly contextMenuOpen = output<ContextMenuOpenDetail>();\n\n private listener?: (e: Event) => void;\n\n constructor() {\n const grid = this.elementRef.nativeElement;\n registerFeatureClaim(grid, 'contextMenu', () => this.contextMenu());\n claimEvent(grid, 'context-menu-open');\n }\n\n ngOnInit(): void {\n const grid = this.elementRef.nativeElement;\n this.listener = (e: Event): void => this.contextMenuOpen.emit((e as CustomEvent<ContextMenuOpenDetail>).detail);\n grid.addEventListener('context-menu-open', this.listener);\n }\n\n ngOnDestroy(): void {\n const grid = this.elementRef.nativeElement;\n if (this.listener) {\n grid.removeEventListener('context-menu-open', this.listener);\n this.listener = undefined;\n }\n unregisterFeatureClaim(grid, 'contextMenu');\n unclaimEvent(grid, 'context-menu-open');\n }\n}\n","/**\n * Context menu feature for @toolbox-web/grid-angular\n *\n * Import this module to enable the `contextMenu` input on Grid directive.\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid-angular/features/context-menu';\n *\n * <tbw-grid [contextMenu]=\"true\" />\n * ```\n *\n * @packageDocumentation\n */\n\nimport '@toolbox-web/grid/features/context-menu';\nexport { GridContextMenuDirective } from './grid-context-menu.directive';\nexport type { _Augmentation as _ContextMenuAugmentation } from '@toolbox-web/grid/features/context-menu';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAA;;;;;AAKG;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,CAA+B;IAClD,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,aAAa,EAAE,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;AACnE,QAAA,UAAU,CAAC,IAAI,EAAE,mBAAmB,CAAC;IACvC;IAEA,QAAQ,GAAA;AACN,QAAA,MAAM,IAAI,GAAG,I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18,7 +18,7 @@ import { inject, ElementRef, input, output, Directive } from '@angular/core';
|
|
|
18
18
|
* @category Directive
|
|
19
19
|
*/
|
|
20
20
|
/**
|
|
21
|
-
* Owns the binding(s) `[editing], [cellCommit], [cellCancel], [rowCommit], [changedRowsReset], [editOpen], [beforeEditClose], [editClose], [dirtyChange]` on `<tbw-grid>` for the matching feature plugin. See
|
|
21
|
+
* Owns the binding(s) `[editing], [cellCommit], [cellCancel], [rowCommit], [changedRowsReset], [editOpen], [beforeEditClose], [editClose], [dirtyChange]` on `<tbw-grid>` for the matching feature plugin. See `GridFilteringDirective` for the full rationale.
|
|
22
22
|
*
|
|
23
23
|
* @category Directive
|
|
24
24
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolbox-web-grid-angular-features-editing.mjs","sources":["../../../../libs/grid-angular/features/editing/src/grid-editing.directive.ts","../../../../libs/grid-angular/features/editing/src/index.ts","../../../../libs/grid-angular/features/editing/src/toolbox-web-grid-angular-features-editing.ts"],"sourcesContent":["/**\n * `GridEditingDirective` — owns `[editing]` and the editing-specific\n * outputs on `<tbw-grid>`. The shared outputs `cellChange` and `dataChange`\n * stay on `Grid` because they are emitted by multiple sources, not just\n * the editing plugin. See `GridFilteringDirective` for full rationale.\n *\n * Output type compatibility note: this directive uses the Angular adapter\n * wrapper types `CellCommitEvent` / `RowCommitEvent` (re-exported from the\n * package barrel) to stay binary-compatible with apps migrating from the\n * deprecated bindings on `Grid`.\n *\n * @category Directive\n */\nimport { Directive, ElementRef, inject, input, OnDestroy, OnInit, output } from '@angular/core';\nimport type { DataGridElement } from '@toolbox-web/grid';\nimport {\n type CellCommitEvent,\n claimEvent,\n registerFeatureClaim,\n type RowCommitEvent,\n unclaimEvent,\n unregisterFeatureClaim,\n} from '@toolbox-web/grid-angular';\nimport type {\n BeforeEditCloseDetail,\n CellCancelDetail,\n ChangedRowsResetDetail,\n DirtyChangeDetail,\n EditCloseDetail,\n EditingConfig,\n EditOpenDetail,\n} from '@toolbox-web/grid/plugins/editing';\n\n/**\n * Owns the binding(s) `[editing], [cellCommit], [cellCancel], [rowCommit], [changedRowsReset], [editOpen], [beforeEditClose], [editClose], [dirtyChange]` 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[editing], tbw-grid[cellCommit], tbw-grid[cellCancel], tbw-grid[rowCommit], tbw-grid[changedRowsReset], tbw-grid[editOpen], tbw-grid[beforeEditClose], tbw-grid[editClose], tbw-grid[dirtyChange]',\n standalone: true,\n})\nexport class GridEditingDirective implements OnInit, OnDestroy {\n private readonly elementRef = inject(ElementRef<DataGridElement>);\n\n readonly editing = input<boolean | 'click' | 'dblclick' | 'manual' | EditingConfig>();\n readonly cellCommit = output<CellCommitEvent>();\n readonly cellCancel = output<CellCancelDetail>();\n readonly rowCommit = output<RowCommitEvent>();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n readonly changedRowsReset = output<ChangedRowsResetDetail<any>>();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n readonly editOpen = output<EditOpenDetail<any>>();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n readonly beforeEditClose = output<BeforeEditCloseDetail<any>>();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n readonly editClose = output<EditCloseDetail<any>>();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n readonly dirtyChange = output<DirtyChangeDetail<any>>();\n\n private readonly listeners = new Map<string, (e: Event) => void>();\n private static readonly EVENTS = [\n 'cell-commit',\n 'cell-cancel',\n 'row-commit',\n 'changed-rows-reset',\n 'edit-open',\n 'before-edit-close',\n 'edit-close',\n 'dirty-change',\n ] as const;\n\n constructor() {\n const grid = this.elementRef.nativeElement;\n registerFeatureClaim(grid, 'editing', () => this.editing());\n for (const ev of GridEditingDirective.EVENTS) claimEvent(grid, ev);\n }\n\n ngOnInit(): void {\n const grid = this.elementRef.nativeElement;\n const wire = <T>(name: string, out: { emit: (v: T) => void }): void => {\n const l = (e: Event): void => out.emit((e as CustomEvent<T>).detail);\n grid.addEventListener(name, l);\n this.listeners.set(name, l);\n };\n wire<CellCommitEvent>('cell-commit', this.cellCommit);\n wire<CellCancelDetail>('cell-cancel', this.cellCancel);\n wire<RowCommitEvent>('row-commit', this.rowCommit);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n wire<ChangedRowsResetDetail<any>>('changed-rows-reset', this.changedRowsReset);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n wire<EditOpenDetail<any>>('edit-open', this.editOpen);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n wire<BeforeEditCloseDetail<any>>('before-edit-close', this.beforeEditClose);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n wire<EditCloseDetail<any>>('edit-close', this.editClose);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n wire<DirtyChangeDetail<any>>('dirty-change', this.dirtyChange);\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, 'editing');\n for (const ev of GridEditingDirective.EVENTS) unclaimEvent(grid, ev);\n }\n}\n","/**\n * Editing feature for @toolbox-web/grid-angular\n *\n * Import this module to enable the `editing` input on Grid directive AND to\n * install the `before-edit-close` blur bridge that flushes pending input from\n * Angular editors that commit on `(blur)` before the cell DOM is torn down by\n * Tab / programmatic row exit.\n *\n * Without this import, Angular `(blur)`-committing editors silently lose\n * pending input on programmatic row exit.\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid-angular/features/editing';\n *\n * <tbw-grid [editing]=\"'dblclick'\" />\n * ```\n *\n * @packageDocumentation\n */\n\nimport { makeFlushFocusedInput, registerEditorMountHook } from '@toolbox-web/grid-angular';\nimport '@toolbox-web/grid/features/editing';\nexport { GridEditingDirective } from './grid-editing.directive';\nexport type { _Augmentation as _EditingAugmentation } from '@toolbox-web/grid/features/editing';\n\n// ---------------------------------------------------------------------------\n// Re-exports from `@toolbox-web/grid-angular` (main entry).\n//\n// These symbols still physically live in the main `@toolbox-web/grid-angular`\n// package today, but they are editing-specific and are re-exported here so\n// consumers can import them from the feature entry that owns the runtime\n// behaviour. The same symbols are marked `@deprecated` on the main entry.\n//\n// In v2.0.0 the source files will physically move into this secondary entry\n// and the deprecated re-exports on the main entry will be removed. Searching\n// for `@deprecated` in `libs/grid-angular/src/` enumerates everything that\n// needs to move at that point.\n// ---------------------------------------------------------------------------\nexport {\n BaseGridEditor,\n BaseGridEditorCVA,\n BaseOverlayEditor,\n getFormArrayContext,\n getLazyFormContext,\n GridColumnEditor,\n GridFormArray,\n GridLazyForm,\n TbwEditor,\n} from '@toolbox-web/grid-angular';\nexport type {\n FormArrayContext,\n GridEditorContext,\n LazyFormFactory,\n OverlayPosition,\n RowFormChangeEvent,\n StructuralEditorContext,\n} from '@toolbox-web/grid-angular';\n\n// Bridge the editing plugin's `before-edit-close` event to a synchronous\n// `.blur()` on the focused input/textarea/select inside the editor host.\n// Angular editors that commit on `(blur)` rely on the focused control firing\n// blur naturally, but Tab / programmatic row exit rebuilds the cell DOM\n// synchronously without giving the focused control a chance to blur first.\nregisterEditorMountHook(({ container, gridEl }) => {\n const flush = makeFlushFocusedInput(container);\n gridEl.addEventListener('before-edit-close', flush);\n return () => gridEl.removeEventListener('before-edit-close', flush);\n});\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;;;AAYG;AAqBH;;;;AAIG;MAMU,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,CAA6D;IAC5E,UAAU,GAAG,MAAM,EAAmB;IACtC,UAAU,GAAG,M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,UAAA,EAAA,eAAA,EAAA,iBAAA,EAAA,SAAA,EAAA,WAAA,EAAA,WAAA,EAAA,aAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAApB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBALhC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EACN,2MAA2M;AAC7M,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;AC1CD;;;;;;;;;;;;;;;;;;;AAmBG;AAwCH;AACA;AACA;AACA;AACA;AACA,uBAAuB,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,KAAI;AAChD,IAAA,MAAM,KAAK,GAAG,qBAAqB,CAAC,SAAS,CAAC;AAC9C,IAAA,MAAM,CAAC,gBAAgB,CAAC,mBAAmB,EAAE,KAAK,CAAC;IACnD,OAAO,MAAM,MAAM,CAAC,mBAAmB,CAAC,mBAAmB,EAAE,KAAK,CAAC;AACrE,CAAC,CAAC;;ACpEF;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"toolbox-web-grid-angular-features-editing.mjs","sources":["../../../../libs/grid-angular/features/editing/src/grid-editing.directive.ts","../../../../libs/grid-angular/features/editing/src/index.ts","../../../../libs/grid-angular/features/editing/src/toolbox-web-grid-angular-features-editing.ts"],"sourcesContent":["/**\n * `GridEditingDirective` — owns `[editing]` and the editing-specific\n * outputs on `<tbw-grid>`. The shared outputs `cellChange` and `dataChange`\n * stay on `Grid` because they are emitted by multiple sources, not just\n * the editing plugin. See `GridFilteringDirective` for full rationale.\n *\n * Output type compatibility note: this directive uses the Angular adapter\n * wrapper types `CellCommitEvent` / `RowCommitEvent` (re-exported from the\n * package barrel) to stay binary-compatible with apps migrating from the\n * deprecated bindings on `Grid`.\n *\n * @category Directive\n */\nimport { Directive, ElementRef, inject, input, OnDestroy, OnInit, output } from '@angular/core';\nimport type { DataGridElement } from '@toolbox-web/grid';\nimport {\n type CellCommitEvent,\n claimEvent,\n registerFeatureClaim,\n type RowCommitEvent,\n unclaimEvent,\n unregisterFeatureClaim,\n} from '@toolbox-web/grid-angular';\nimport type {\n BeforeEditCloseDetail,\n CellCancelDetail,\n ChangedRowsResetDetail,\n DirtyChangeDetail,\n EditCloseDetail,\n EditingConfig,\n EditOpenDetail,\n} from '@toolbox-web/grid/plugins/editing';\n\n/**\n * Owns the binding(s) `[editing], [cellCommit], [cellCancel], [rowCommit], [changedRowsReset], [editOpen], [beforeEditClose], [editClose], [dirtyChange]` 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[editing], tbw-grid[cellCommit], tbw-grid[cellCancel], tbw-grid[rowCommit], tbw-grid[changedRowsReset], tbw-grid[editOpen], tbw-grid[beforeEditClose], tbw-grid[editClose], tbw-grid[dirtyChange]',\n standalone: true,\n})\nexport class GridEditingDirective implements OnInit, OnDestroy {\n private readonly elementRef = inject(ElementRef<DataGridElement>);\n\n readonly editing = input<boolean | 'click' | 'dblclick' | 'manual' | EditingConfig>();\n readonly cellCommit = output<CellCommitEvent>();\n readonly cellCancel = output<CellCancelDetail>();\n readonly rowCommit = output<RowCommitEvent>();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n readonly changedRowsReset = output<ChangedRowsResetDetail<any>>();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n readonly editOpen = output<EditOpenDetail<any>>();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n readonly beforeEditClose = output<BeforeEditCloseDetail<any>>();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n readonly editClose = output<EditCloseDetail<any>>();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n readonly dirtyChange = output<DirtyChangeDetail<any>>();\n\n private readonly listeners = new Map<string, (e: Event) => void>();\n private static readonly EVENTS = [\n 'cell-commit',\n 'cell-cancel',\n 'row-commit',\n 'changed-rows-reset',\n 'edit-open',\n 'before-edit-close',\n 'edit-close',\n 'dirty-change',\n ] as const;\n\n constructor() {\n const grid = this.elementRef.nativeElement;\n registerFeatureClaim(grid, 'editing', () => this.editing());\n for (const ev of GridEditingDirective.EVENTS) claimEvent(grid, ev);\n }\n\n ngOnInit(): void {\n const grid = this.elementRef.nativeElement;\n const wire = <T>(name: string, out: { emit: (v: T) => void }): void => {\n const l = (e: Event): void => out.emit((e as CustomEvent<T>).detail);\n grid.addEventListener(name, l);\n this.listeners.set(name, l);\n };\n wire<CellCommitEvent>('cell-commit', this.cellCommit);\n wire<CellCancelDetail>('cell-cancel', this.cellCancel);\n wire<RowCommitEvent>('row-commit', this.rowCommit);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n wire<ChangedRowsResetDetail<any>>('changed-rows-reset', this.changedRowsReset);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n wire<EditOpenDetail<any>>('edit-open', this.editOpen);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n wire<BeforeEditCloseDetail<any>>('before-edit-close', this.beforeEditClose);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n wire<EditCloseDetail<any>>('edit-close', this.editClose);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n wire<DirtyChangeDetail<any>>('dirty-change', this.dirtyChange);\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, 'editing');\n for (const ev of GridEditingDirective.EVENTS) unclaimEvent(grid, ev);\n }\n}\n","/**\n * Editing feature for @toolbox-web/grid-angular\n *\n * Import this module to enable the `editing` input on Grid directive AND to\n * install the `before-edit-close` blur bridge that flushes pending input from\n * Angular editors that commit on `(blur)` before the cell DOM is torn down by\n * Tab / programmatic row exit.\n *\n * Without this import, Angular `(blur)`-committing editors silently lose\n * pending input on programmatic row exit.\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid-angular/features/editing';\n *\n * <tbw-grid [editing]=\"'dblclick'\" />\n * ```\n *\n * @packageDocumentation\n */\n\nimport { makeFlushFocusedInput, registerEditorMountHook } from '@toolbox-web/grid-angular';\nimport '@toolbox-web/grid/features/editing';\nexport { GridEditingDirective } from './grid-editing.directive';\nexport type { _Augmentation as _EditingAugmentation } from '@toolbox-web/grid/features/editing';\n\n// ---------------------------------------------------------------------------\n// Re-exports from `@toolbox-web/grid-angular` (main entry).\n//\n// These symbols still physically live in the main `@toolbox-web/grid-angular`\n// package today, but they are editing-specific and are re-exported here so\n// consumers can import them from the feature entry that owns the runtime\n// behaviour. The same symbols are marked `@deprecated` on the main entry.\n//\n// In v2.0.0 the source files will physically move into this secondary entry\n// and the deprecated re-exports on the main entry will be removed. Searching\n// for `@deprecated` in `libs/grid-angular/src/` enumerates everything that\n// needs to move at that point.\n// ---------------------------------------------------------------------------\nexport {\n BaseGridEditor,\n BaseGridEditorCVA,\n BaseOverlayEditor,\n getFormArrayContext,\n getLazyFormContext,\n GridColumnEditor,\n GridFormArray,\n GridLazyForm,\n TbwEditor,\n} from '@toolbox-web/grid-angular';\nexport type {\n FormArrayContext,\n GridEditorContext,\n LazyFormFactory,\n OverlayPosition,\n RowFormChangeEvent,\n StructuralEditorContext,\n} from '@toolbox-web/grid-angular';\n\n// Bridge the editing plugin's `before-edit-close` event to a synchronous\n// `.blur()` on the focused input/textarea/select inside the editor host.\n// Angular editors that commit on `(blur)` rely on the focused control firing\n// blur naturally, but Tab / programmatic row exit rebuilds the cell DOM\n// synchronously without giving the focused control a chance to blur first.\nregisterEditorMountHook(({ container, gridEl }) => {\n const flush = makeFlushFocusedInput(container);\n gridEl.addEventListener('before-edit-close', flush);\n return () => gridEl.removeEventListener('before-edit-close', flush);\n});\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;;;AAYG;AAqBH;;;;AAIG;MAMU,oBAAoB,CAAA;AACd,IAAA,UAAU,GAAG,MAAM,EAAC,UAA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,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,UAAA,EAAA,YAAA,EAAA,UAAA,EAAA,YAAA,EAAA,SAAA,EAAA,WAAA,EAAA,gBAAA,EAAA,kBAAA,EAAA,QAAA,EAAA,UAAA,EAAA,eAAA,EAAA,iBAAA,EAAA,SAAA,EAAA,WAAA,EAAA,WAAA,EAAA,aAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAApB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBALhC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EACN,2MAA2M;AAC7M,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;AC1CD;;;;;;;;;;;;;;;;;;;AAmBG;AAwCH;AACA;AACA;AACA;AACA;AACA,uBAAuB,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,KAAI;AAChD,IAAA,MAAM,KAAK,GAAG,qBAAqB,CAAC,SAAS,CAAC;AAC9C,IAAA,MAAM,CAAC,gBAAgB,CAAC,mBAAmB,EAAE,KAAK,CAAC;IACnD,OAAO,MAAM,MAAM,CAAC,mBAAmB,CAAC,mBAAmB,EAAE,KAAK,CAAC;AACrE,CAAC,CAAC;;ACpEF;;AAEG;;;;"}
|
|
@@ -15,7 +15,7 @@ import { registerFeatureClaim, claimEvent, unregisterFeatureClaim, unclaimEvent
|
|
|
15
15
|
* @category Directive
|
|
16
16
|
*/
|
|
17
17
|
/**
|
|
18
|
-
* Owns the binding(s) `[export], [exportComplete]` on `<tbw-grid>` for the matching feature plugin. See
|
|
18
|
+
* Owns the binding(s) `[export], [exportComplete]` 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-export.mjs","sources":["../../../../libs/grid-angular/features/export/src/grid-export.directive.ts","../../../../libs/grid-angular/features/export/src/index.ts","../../../../libs/grid-angular/features/export/src/toolbox-web-grid-angular-features-export.ts"],"sourcesContent":["/**\n * `GridExportDirective` — owns the `export` input (template alias of\n * `exportFeature`) and `(exportComplete)` on `<tbw-grid>`. See\n * `GridFilteringDirective` for the full rationale.\n *\n * The TypeScript field is `exportFeature` (with `alias: 'export'`) because\n * `export` is a reserved keyword. Templates use `[export]` / `(exportComplete)`\n * exactly as before.\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 { ExportCompleteDetail, ExportConfig } from '@toolbox-web/grid/plugins/export';\n\n/**\n * Owns the binding(s) `[export], [exportComplete]` 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[export], tbw-grid[exportComplete]',\n standalone: true,\n})\nexport class GridExportDirective implements OnInit, OnDestroy {\n private readonly elementRef = inject(ElementRef<DataGridElement>);\n\n readonly exportFeature = input<boolean | ExportConfig>(undefined, { alias: 'export' });\n readonly exportComplete = output<ExportCompleteDetail>();\n\n private listener?: (e: Event) => void;\n\n constructor() {\n const grid = this.elementRef.nativeElement;\n registerFeatureClaim(grid, 'export', () => this.exportFeature());\n claimEvent(grid, 'export-complete');\n }\n\n ngOnInit(): void {\n const grid = this.elementRef.nativeElement;\n this.listener = (e: Event): void => this.exportComplete.emit((e as CustomEvent<ExportCompleteDetail>).detail);\n grid.addEventListener('export-complete', this.listener);\n }\n\n ngOnDestroy(): void {\n const grid = this.elementRef.nativeElement;\n if (this.listener) {\n grid.removeEventListener('export-complete', this.listener);\n this.listener = undefined;\n }\n unregisterFeatureClaim(grid, 'export');\n unclaimEvent(grid, 'export-complete');\n }\n}\n","/**\n * Export feature for @toolbox-web/grid-angular\n *\n * Import this module to enable the `export` input on Grid directive.\n * Also exports `injectGridExport()` for programmatic export control.\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid-angular/features/export';\n *\n * <tbw-grid [export]=\"true\" />\n * <tbw-grid [export]=\"{ fileName: 'data.csv' }\" />\n * ```\n *\n * @example Using injectGridExport\n * ```typescript\n * import { injectGridExport } from '@toolbox-web/grid-angular/features/export';\n *\n * @Component({...})\n * export class MyComponent {\n * private gridExport = injectGridExport();\n *\n * exportData() {\n * this.gridExport.exportToCsv('employees.csv');\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/export';\nimport { ExportPlugin, type ExportFormat, type ExportParams } from '@toolbox-web/grid/plugins/export';\nexport { GridExportDirective } from './grid-export.directive';\nexport type { _Augmentation as _ExportAugmentation } from '@toolbox-web/grid/features/export';\n\n/**\n * Export methods returned from injectGridExport.\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 ExportMethods {\n /**\n * Export grid data to CSV file.\n * @param filename - Optional filename (defaults to 'export.csv')\n * @param params - Optional export parameters\n */\n exportToCsv: (filename?: string, params?: Partial<ExportParams>) => void;\n\n /**\n * Export grid data to Excel file (XML Spreadsheet format).\n * @param filename - Optional filename (defaults to 'export.xlsx')\n * @param params - Optional export parameters\n */\n exportToExcel: (filename?: string, params?: Partial<ExportParams>) => void;\n\n /**\n * Export grid data to JSON file.\n * @param filename - Optional filename (defaults to 'export.json')\n * @param params - Optional export parameters\n */\n exportToJson: (filename?: string, params?: Partial<ExportParams>) => void;\n\n /**\n * Check if an export is currently in progress.\n */\n isExporting: () => boolean;\n\n /**\n * Get information about the last export.\n */\n getLastExport: () => { format: ExportFormat; timestamp: Date } | null;\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 export 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/export';\n * import { injectGridExport } from '@toolbox-web/grid-angular/features/export';\n *\n * @Component({\n * selector: 'app-my-grid',\n * imports: [Grid],\n * template: `\n * <button (click)=\"handleExport()\">Export CSV</button>\n * <tbw-grid [rows]=\"rows\" [export]=\"true\"></tbw-grid>\n * `\n * })\n * export class MyGridComponent {\n * gridExport = injectGridExport();\n *\n * handleExport() {\n * this.gridExport.exportToCsv('employees.csv');\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 injectGridExport(selector = 'tbw-grid'): ExportMethods {\n const elementRef = inject(ElementRef);\n const destroyRef = inject(DestroyRef);\n const isReady = signal(false);\n\n // Lazy discovery: cached grid reference\n let cachedGrid: DataGridElement | null = null;\n let readyPromiseStarted = false;\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 | null => {\n if (cachedGrid) return cachedGrid;\n\n const grid = elementRef.nativeElement.querySelector(selector) as DataGridElement | null;\n if (grid) {\n cachedGrid = grid;\n // Start ready() check only once\n if (!readyPromiseStarted) {\n readyPromiseStarted = true;\n grid.ready?.().then(() => {\n if (grid.getPluginByName('export')) {\n isReady.set(true);\n } else {\n setTimeout(() => isReady.set(true), 0);\n }\n });\n }\n }\n return grid;\n };\n\n const getPlugin = (): ExportPlugin | undefined => {\n return getGrid()?.getPluginByName('export') as ExportPlugin | 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 exportToCsv: (filename?: string, params?: Partial<ExportParams>) => {\n const plugin = getPlugin();\n if (!plugin) {\n console.warn(\n `[tbw-grid:export] ExportPlugin not found.\\n\\n` +\n ` → Enable export on the grid:\\n` +\n ` <tbw-grid [export]=\"true\" />`,\n );\n return;\n }\n plugin.exportCsv({ ...params, fileName: filename ?? params?.fileName ?? 'export.csv' });\n },\n\n exportToExcel: (filename?: string, params?: Partial<ExportParams>) => {\n const plugin = getPlugin();\n if (!plugin) {\n console.warn(\n `[tbw-grid:export] ExportPlugin not found.\\n\\n` +\n ` → Enable export on the grid:\\n` +\n ` <tbw-grid [export]=\"true\" />`,\n );\n return;\n }\n plugin.exportExcel({ ...params, fileName: filename ?? params?.fileName ?? 'export.xlsx' });\n },\n\n exportToJson: (filename?: string, params?: Partial<ExportParams>) => {\n const plugin = getPlugin();\n if (!plugin) {\n console.warn(\n `[tbw-grid:export] ExportPlugin not found.\\n\\n` +\n ` → Enable export on the grid:\\n` +\n ` <tbw-grid [export]=\"true\" />`,\n );\n return;\n }\n plugin.exportJson({ ...params, fileName: filename ?? params?.fileName ?? 'export.json' });\n },\n\n isExporting: () => {\n return getPlugin()?.isExporting() ?? false;\n },\n\n getLastExport: () => {\n return getPlugin()?.getLastExport() ?? null;\n },\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAA;;;;;;;;;;AAUG;A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QACzF,CAAC;AAED,QAAA,aAAa,EAAE,CAAC,QAAiB,EAAE,MAA8B,KAAI;AACnE,YAAA,MAAM,MAAM,GAAG,SAAS,EAAE;YAC1B,IAAI,CAAC,MAAM,EAAE;gBACX,OAAO,CAAC,IAAI,CACV,CAAA,6CAAA,CAA+C;oBAC7C,CAAA,gCAAA,CAAkC;AAClC,oBAAA,CAAA,gCAAA,CAAkC,CACrC;gBACD;YACF;AACA,YAAA,MAAM,CAAC,WAAW,CAAC,EAAE,GAAG,MAAM,EAAE,QAAQ,EAAE,QAAQ,IAAI,MAAM,EAAE,QAAQ,IAAI,aAAa,EAAE,CAAC;QAC5F,CAAC;AAED,QAAA,YAAY,EAAE,CAAC,QAAiB,EAAE,MAA8B,KAAI;AAClE,YAAA,MAAM,MAAM,GAAG,SAAS,EAAE;YAC1B,IAAI,CAAC,MAAM,EAAE;gBACX,OAAO,CAAC,IAAI,CACV,CAAA,6CAAA,CAA+C;oBAC7C,CAAA,gCAAA,CAAkC;AAClC,oBAAA,CAAA,gCAAA,CAAkC,CACrC;gBACD;YACF;AACA,YAAA,MAAM,CAAC,UAAU,CAAC,EAAE,GAAG,MAAM,EAAE,QAAQ,EAAE,QAAQ,IAAI,MAAM,EAAE,QAAQ,IAAI,aAAa,EAAE,CAAC;QAC3F,CAAC;QAED,WAAW,EAAE,MAAK;AAChB,YAAA,OAAO,SAAS,EAAE,EAAE,WAAW,EAAE,IAAI,KAAK;QAC5C,CAAC;QAED,aAAa,EAAE,MAAK;AAClB,YAAA,OAAO,SAAS,EAAE,EAAE,aAAa,EAAE,IAAI,IAAI;QAC7C,CAAC;KACF;AACH;;AC/NA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"toolbox-web-grid-angular-features-export.mjs","sources":["../../../../libs/grid-angular/features/export/src/grid-export.directive.ts","../../../../libs/grid-angular/features/export/src/index.ts","../../../../libs/grid-angular/features/export/src/toolbox-web-grid-angular-features-export.ts"],"sourcesContent":["/**\n * `GridExportDirective` — owns the `export` input (template alias of\n * `exportFeature`) and `(exportComplete)` on `<tbw-grid>`. See\n * `GridFilteringDirective` for the full rationale.\n *\n * The TypeScript field is `exportFeature` (with `alias: 'export'`) because\n * `export` is a reserved keyword. Templates use `[export]` / `(exportComplete)`\n * exactly as before.\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 { ExportCompleteDetail, ExportConfig } from '@toolbox-web/grid/plugins/export';\n\n/**\n * Owns the binding(s) `[export], [exportComplete]` 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[export], tbw-grid[exportComplete]',\n standalone: true,\n})\nexport class GridExportDirective implements OnInit, OnDestroy {\n private readonly elementRef = inject(ElementRef<DataGridElement>);\n\n readonly exportFeature = input<boolean | ExportConfig>(undefined, { alias: 'export' });\n readonly exportComplete = output<ExportCompleteDetail>();\n\n private listener?: (e: Event) => void;\n\n constructor() {\n const grid = this.elementRef.nativeElement;\n registerFeatureClaim(grid, 'export', () => this.exportFeature());\n claimEvent(grid, 'export-complete');\n }\n\n ngOnInit(): void {\n const grid = this.elementRef.nativeElement;\n this.listener = (e: Event): void => this.exportComplete.emit((e as CustomEvent<ExportCompleteDetail>).detail);\n grid.addEventListener('export-complete', this.listener);\n }\n\n ngOnDestroy(): void {\n const grid = this.elementRef.nativeElement;\n if (this.listener) {\n grid.removeEventListener('export-complete', this.listener);\n this.listener = undefined;\n }\n unregisterFeatureClaim(grid, 'export');\n unclaimEvent(grid, 'export-complete');\n }\n}\n","/**\n * Export feature for @toolbox-web/grid-angular\n *\n * Import this module to enable the `export` input on Grid directive.\n * Also exports `injectGridExport()` for programmatic export control.\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid-angular/features/export';\n *\n * <tbw-grid [export]=\"true\" />\n * <tbw-grid [export]=\"{ fileName: 'data.csv' }\" />\n * ```\n *\n * @example Using injectGridExport\n * ```typescript\n * import { injectGridExport } from '@toolbox-web/grid-angular/features/export';\n *\n * @Component({...})\n * export class MyComponent {\n * private gridExport = injectGridExport();\n *\n * exportData() {\n * this.gridExport.exportToCsv('employees.csv');\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/export';\nimport { ExportPlugin, type ExportFormat, type ExportParams } from '@toolbox-web/grid/plugins/export';\nexport { GridExportDirective } from './grid-export.directive';\nexport type { _Augmentation as _ExportAugmentation } from '@toolbox-web/grid/features/export';\n\n/**\n * Export methods returned from injectGridExport.\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 ExportMethods {\n /**\n * Export grid data to CSV file.\n * @param filename - Optional filename (defaults to 'export.csv')\n * @param params - Optional export parameters\n */\n exportToCsv: (filename?: string, params?: Partial<ExportParams>) => void;\n\n /**\n * Export grid data to Excel file (XML Spreadsheet format).\n * @param filename - Optional filename (defaults to 'export.xlsx')\n * @param params - Optional export parameters\n */\n exportToExcel: (filename?: string, params?: Partial<ExportParams>) => void;\n\n /**\n * Export grid data to JSON file.\n * @param filename - Optional filename (defaults to 'export.json')\n * @param params - Optional export parameters\n */\n exportToJson: (filename?: string, params?: Partial<ExportParams>) => void;\n\n /**\n * Check if an export is currently in progress.\n */\n isExporting: () => boolean;\n\n /**\n * Get information about the last export.\n */\n getLastExport: () => { format: ExportFormat; timestamp: Date } | null;\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 export 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/export';\n * import { injectGridExport } from '@toolbox-web/grid-angular/features/export';\n *\n * @Component({\n * selector: 'app-my-grid',\n * imports: [Grid],\n * template: `\n * <button (click)=\"handleExport()\">Export CSV</button>\n * <tbw-grid [rows]=\"rows\" [export]=\"true\"></tbw-grid>\n * `\n * })\n * export class MyGridComponent {\n * gridExport = injectGridExport();\n *\n * handleExport() {\n * this.gridExport.exportToCsv('employees.csv');\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 injectGridExport(selector = 'tbw-grid'): ExportMethods {\n const elementRef = inject(ElementRef);\n const destroyRef = inject(DestroyRef);\n const isReady = signal(false);\n\n // Lazy discovery: cached grid reference\n let cachedGrid: DataGridElement | null = null;\n let readyPromiseStarted = false;\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 | null => {\n if (cachedGrid) return cachedGrid;\n\n const grid = elementRef.nativeElement.querySelector(selector) as DataGridElement | null;\n if (grid) {\n cachedGrid = grid;\n // Start ready() check only once\n if (!readyPromiseStarted) {\n readyPromiseStarted = true;\n grid.ready?.().then(() => {\n if (grid.getPluginByName('export')) {\n isReady.set(true);\n } else {\n setTimeout(() => isReady.set(true), 0);\n }\n });\n }\n }\n return grid;\n };\n\n const getPlugin = (): ExportPlugin | undefined => {\n return getGrid()?.getPluginByName('export') as ExportPlugin | 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 exportToCsv: (filename?: string, params?: Partial<ExportParams>) => {\n const plugin = getPlugin();\n if (!plugin) {\n console.warn(\n `[tbw-grid:export] ExportPlugin not found.\\n\\n` +\n ` → Enable export on the grid:\\n` +\n ` <tbw-grid [export]=\"true\" />`,\n );\n return;\n }\n plugin.exportCsv({ ...params, fileName: filename ?? params?.fileName ?? 'export.csv' });\n },\n\n exportToExcel: (filename?: string, params?: Partial<ExportParams>) => {\n const plugin = getPlugin();\n if (!plugin) {\n console.warn(\n `[tbw-grid:export] ExportPlugin not found.\\n\\n` +\n ` → Enable export on the grid:\\n` +\n ` <tbw-grid [export]=\"true\" />`,\n );\n return;\n }\n plugin.exportExcel({ ...params, fileName: filename ?? params?.fileName ?? 'export.xlsx' });\n },\n\n exportToJson: (filename?: string, params?: Partial<ExportParams>) => {\n const plugin = getPlugin();\n if (!plugin) {\n console.warn(\n `[tbw-grid:export] ExportPlugin not found.\\n\\n` +\n ` → Enable export on the grid:\\n` +\n ` <tbw-grid [export]=\"true\" />`,\n );\n return;\n }\n plugin.exportJson({ ...params, fileName: filename ?? params?.fileName ?? 'export.json' });\n },\n\n isExporting: () => {\n return getPlugin()?.isExporting() ?? false;\n },\n\n getLastExport: () => {\n return getPlugin()?.getLastExport() ?? null;\n },\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAA;;;;;;;;;;AAUG;AAMH;;;;AAIG;MAKU,mBAAmB,CAAA;AACb,IAAA,UAAU,GAAG,MAAM,EAAC,UAA2B,EAAC;IAExD,aAAa,GAAG,KAAK,CAAyB,SAAS,qFAAI,KAAK,EAAE,QAAQ,EAAA,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CAAC,IAAI,CACV,CAAA,6CAAA,CAA+C;oBAC7C,CAAA,gCAAA,CAAkC;AAClC,oBAAA,CAAA,gCAAA,CAAkC,CACrC;gBACD;YACF;AACA,YAAA,MAAM,CAAC,WAAW,CAAC,EAAE,GAAG,MAAM,EAAE,QAAQ,EAAE,QAAQ,IAAI,MAAM,EAAE,QAAQ,IAAI,aAAa,EAAE,CAAC;QAC5F,CAAC;AAED,QAAA,YAAY,EAAE,CAAC,QAAiB,EAAE,MAA8B,KAAI;AAClE,YAAA,MAAM,MAAM,GAAG,SAAS,EAAE;YAC1B,IAAI,CAAC,MAAM,EAAE;gBACX,OAAO,CAAC,IAAI,CACV,CAAA,6CAAA,CAA+C;oBAC7C,CAAA,gCAAA,CAAkC;AAClC,oBAAA,CAAA,gCAAA,CAAkC,CACrC;gBACD;YACF;AACA,YAAA,MAAM,CAAC,UAAU,CAAC,EAAE,GAAG,MAAM,EAAE,QAAQ,EAAE,QAAQ,IAAI,MAAM,EAAE,QAAQ,IAAI,aAAa,EAAE,CAAC;QAC3F,CAAC;QAED,WAAW,EAAE,MAAK;AAChB,YAAA,OAAO,SAAS,EAAE,EAAE,WAAW,EAAE,IAAI,KAAK;QAC5C,CAAC;QAED,aAAa,EAAE,MAAK;AAClB,YAAA,OAAO,SAAS,EAAE,EAAE,aAAa,EAAE,IAAI,IAAI;QAC7C,CAAC;KACF;AACH;;AC/NA;;AAEG;;;;"}
|
|
@@ -11,7 +11,7 @@ import { inject, ElementRef, input, Directive } from '@angular/core';
|
|
|
11
11
|
* @category Directive
|
|
12
12
|
*/
|
|
13
13
|
/**
|
|
14
|
-
* Owns the binding(s) `[groupingColumns]` on `<tbw-grid>` for the matching feature plugin. See
|
|
14
|
+
* Owns the binding(s) `[groupingColumns]` 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-grouping-columns.mjs","sources":["../../../../libs/grid-angular/features/grouping-columns/src/grid-grouping-columns.directive.ts","../../../../libs/grid-angular/features/grouping-columns/src/index.ts","../../../../libs/grid-angular/features/grouping-columns/src/toolbox-web-grid-angular-features-grouping-columns.ts"],"sourcesContent":["/**\n * `GridGroupingColumnsDirective` — owns `[groupingColumns]` on\n * `<tbw-grid>`. No event outputs. See `GridFilteringDirective` for the\n * full rationale.\n *\n * @category Directive\n */\nimport { Directive, ElementRef, inject, input, OnDestroy } from '@angular/core';\nimport type { DataGridElement } from '@toolbox-web/grid';\nimport { registerFeatureClaim, unregisterFeatureClaim } from '@toolbox-web/grid-angular';\nimport type { GroupingColumnsConfig } from '@toolbox-web/grid/plugins/grouping-columns';\n\n/**\n * Owns the binding(s) `[groupingColumns]` on `<tbw-grid>` for the matching feature plugin. See
|
|
1
|
+
{"version":3,"file":"toolbox-web-grid-angular-features-grouping-columns.mjs","sources":["../../../../libs/grid-angular/features/grouping-columns/src/grid-grouping-columns.directive.ts","../../../../libs/grid-angular/features/grouping-columns/src/index.ts","../../../../libs/grid-angular/features/grouping-columns/src/toolbox-web-grid-angular-features-grouping-columns.ts"],"sourcesContent":["/**\n * `GridGroupingColumnsDirective` — owns `[groupingColumns]` on\n * `<tbw-grid>`. No event outputs. See `GridFilteringDirective` for the\n * full rationale.\n *\n * @category Directive\n */\nimport { Directive, ElementRef, inject, input, OnDestroy } from '@angular/core';\nimport type { DataGridElement } from '@toolbox-web/grid';\nimport { registerFeatureClaim, unregisterFeatureClaim } from '@toolbox-web/grid-angular';\nimport type { GroupingColumnsConfig } from '@toolbox-web/grid/plugins/grouping-columns';\n\n/**\n * Owns the binding(s) `[groupingColumns]` on `<tbw-grid>` for the matching feature plugin. See `GridFilteringDirective` for the full rationale.\n *\n * @category Directive\n */\n@Directive({\n selector: 'tbw-grid[groupingColumns]',\n standalone: true,\n})\nexport class GridGroupingColumnsDirective implements OnDestroy {\n private readonly elementRef = inject(ElementRef<DataGridElement>);\n\n readonly groupingColumns = input<boolean | GroupingColumnsConfig>();\n\n constructor() {\n registerFeatureClaim(this.elementRef.nativeElement, 'groupingColumns', () => this.groupingColumns());\n }\n\n ngOnDestroy(): void {\n unregisterFeatureClaim(this.elementRef.nativeElement, 'groupingColumns');\n }\n}\n","/**\n * Column grouping feature for @toolbox-web/grid-angular\n *\n * Import this module to enable the `groupingColumns` input on Grid directive.\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid-angular/features/grouping-columns';\n *\n * <tbw-grid [groupingColumns]=\"{ columnGroups: [...] }\" />\n * ```\n *\n * @packageDocumentation\n */\n\nimport type { Type } from '@angular/core';\nimport { isComponentClass, registerFeatureConfigPreprocessor, type GridAdapter } from '@toolbox-web/grid-angular';\nimport '@toolbox-web/grid/features/grouping-columns';\nimport type { GroupHeaderRenderParams, GroupingColumnsConfig } from '@toolbox-web/grid/plugins/grouping-columns';\nexport { GridGroupingColumnsDirective } from './grid-grouping-columns.directive';\nexport type { _Augmentation as _GroupingColumnsAugmentation } from '@toolbox-web/grid/features/grouping-columns';\n\n/**\n * Build a group-header renderer function from an Angular component class.\n * The component should accept group header inputs (id, label, columns, firstIndex, isImplicit).\n */\nfunction buildGroupHeaderRenderer(\n adapter: GridAdapter,\n componentClass: Type<unknown>,\n): (params: GroupHeaderRenderParams) => HTMLElement {\n const mount = adapter.mountComponentRenderer<GroupHeaderRenderParams>(componentClass, (p) => ({\n id: p.id,\n label: p.label,\n columns: p.columns,\n firstIndex: p.firstIndex,\n isImplicit: p.isImplicit,\n }));\n return (params) => mount(params).hostElement;\n}\n\n// Bridge any Angular component classes embedded in the user-supplied config\n// (e.g. group-header renderers) to plain renderer functions before the core\n// plugin factory consumes the config. Without this, raw component classes\n// would be invoked without `new`, causing runtime errors.\nregisterFeatureConfigPreprocessor('groupingColumns', (config, adapter) => {\n if (!config || typeof config !== 'object') return config;\n const cfg = config as GroupingColumnsConfig;\n const processed = { ...cfg };\n let changed = false;\n\n // Bridge top-level groupHeaderRenderer component class\n if (cfg.groupHeaderRenderer && isComponentClass(cfg.groupHeaderRenderer)) {\n processed.groupHeaderRenderer = buildGroupHeaderRenderer(adapter, cfg.groupHeaderRenderer);\n changed = true;\n }\n\n // Bridge per-group renderer component classes inside columnGroups\n if (Array.isArray(cfg.columnGroups)) {\n let groupChanged = false;\n const mappedGroups = cfg.columnGroups.map((def) => {\n if (def.renderer && isComponentClass(def.renderer)) {\n groupChanged = true;\n return { ...def, renderer: buildGroupHeaderRenderer(adapter, def.renderer) };\n }\n return def;\n });\n if (groupChanged) {\n processed.columnGroups = mappedGroups;\n changed = true;\n }\n }\n\n return changed ? processed : cfg;\n});\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAA;;;;;;AAMG;AAMH;;;;AAIG;MAKU,4BAA4B,CAAA;AACtB,IAAA,UAAU,GAAG,MAAM,EAAC,UAA2B,EAAC;IAExD,eAAe,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,iBAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAmC;AAEnE,IAAA,WAAA,GAAA;AACE,QAAA,oBAAoB,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,iBAAiB,EAAE,MAAM,IAAI,CAAC,eAAe,EAAE,CAAC;IACtG;IAEA,WAAW,GAAA;QACT,sBAAsB,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,iBAAiB,CAAC;IAC1E;uGAXW,4BAA4B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAA5B,4BAA4B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,2BAAA,EAAA,MAAA,EAAA,EAAA,eAAA,EAAA,EAAA,iBAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,iBAAA,EAAA,QAAA,EAA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AAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE;QACnC,IAAI,YAAY,GAAG,KAAK;QACxB,MAAM,YAAY,GAAG,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,GAAG,KAAI;YAChD,IAAI,GAAG,CAAC,QAAQ,IAAI,gBAAgB,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;gBAClD,YAAY,GAAG,IAAI;AACnB,gBAAA,OAAO,EAAE,GAAG,GAAG,EAAE,QAAQ,EAAE,wBAAwB,CAAC,OAAO,EAAE,GAAG,CAAC,QAAQ,CAAC,EAAE;YAC9E;AACA,YAAA,OAAO,GAAG;AACZ,QAAA,CAAC,CAAC;QACF,IAAI,YAAY,EAAE;AAChB,YAAA,SAAS,CAAC,YAAY,GAAG,YAAY;YACrC,OAAO,GAAG,IAAI;QAChB;IACF;IAEA,OAAO,OAAO,GAAG,SAAS,GAAG,GAAG;AAClC,CAAC,CAAC;;ACzEF;;AAEG;;;;"}
|
|
@@ -11,7 +11,7 @@ import { inject, ElementRef, input, output, Directive } from '@angular/core';
|
|
|
11
11
|
* @category Directive
|
|
12
12
|
*/
|
|
13
13
|
/**
|
|
14
|
-
* Owns the binding(s) `[groupingRows], [groupToggle], [groupExpand], [groupCollapse]` on `<tbw-grid>` for the matching feature plugin. See
|
|
14
|
+
* Owns the binding(s) `[groupingRows], [groupToggle], [groupExpand], [groupCollapse]` 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-grouping-rows.mjs","sources":["../../../../libs/grid-angular/features/grouping-rows/src/grid-grouping-rows.directive.ts","../../../../libs/grid-angular/features/grouping-rows/src/index.ts","../../../../libs/grid-angular/features/grouping-rows/src/toolbox-web-grid-angular-features-grouping-rows.ts"],"sourcesContent":["/**\n * `GridGroupingRowsDirective` — owns `[groupingRows]` and the group\n * toggle/expand/collapse outputs on `<tbw-grid>`. See\n * `GridFilteringDirective` for the full rationale.\n *\n * @category Directive\n */\nimport { Directive, ElementRef, inject, input, OnDestroy, OnInit, output } from '@angular/core';\nimport type { DataGridElement } from '@toolbox-web/grid';\nimport { claimEvent, registerFeatureClaim, unclaimEvent, unregisterFeatureClaim } from '@toolbox-web/grid-angular';\nimport type {\n GroupCollapseDetail,\n GroupExpandDetail,\n GroupingRowsConfig,\n GroupToggleDetail,\n} from '@toolbox-web/grid/plugins/grouping-rows';\n\n/**\n * Owns the binding(s) `[groupingRows], [groupToggle], [groupExpand], [groupCollapse]` on `<tbw-grid>` for the matching feature plugin. See
|
|
1
|
+
{"version":3,"file":"toolbox-web-grid-angular-features-grouping-rows.mjs","sources":["../../../../libs/grid-angular/features/grouping-rows/src/grid-grouping-rows.directive.ts","../../../../libs/grid-angular/features/grouping-rows/src/index.ts","../../../../libs/grid-angular/features/grouping-rows/src/toolbox-web-grid-angular-features-grouping-rows.ts"],"sourcesContent":["/**\n * `GridGroupingRowsDirective` — owns `[groupingRows]` and the group\n * toggle/expand/collapse outputs on `<tbw-grid>`. See\n * `GridFilteringDirective` for the full rationale.\n *\n * @category Directive\n */\nimport { Directive, ElementRef, inject, input, OnDestroy, OnInit, output } from '@angular/core';\nimport type { DataGridElement } from '@toolbox-web/grid';\nimport { claimEvent, registerFeatureClaim, unclaimEvent, unregisterFeatureClaim } from '@toolbox-web/grid-angular';\nimport type {\n GroupCollapseDetail,\n GroupExpandDetail,\n GroupingRowsConfig,\n GroupToggleDetail,\n} from '@toolbox-web/grid/plugins/grouping-rows';\n\n/**\n * Owns the binding(s) `[groupingRows], [groupToggle], [groupExpand], [groupCollapse]` on `<tbw-grid>` for the matching feature plugin. See `GridFilteringDirective` for the full rationale.\n *\n * @category Directive\n */\n@Directive({\n selector: 'tbw-grid[groupingRows], tbw-grid[groupToggle], tbw-grid[groupExpand], tbw-grid[groupCollapse]',\n standalone: true,\n})\nexport class GridGroupingRowsDirective implements OnInit, OnDestroy {\n private readonly elementRef = inject(ElementRef<DataGridElement>);\n\n readonly groupingRows = input<GroupingRowsConfig>();\n readonly groupToggle = output<GroupToggleDetail>();\n readonly groupExpand = output<GroupExpandDetail>();\n readonly groupCollapse = output<GroupCollapseDetail>();\n\n private readonly listeners = new Map<string, (e: Event) => void>();\n private static readonly EVENTS = ['group-toggle', 'group-expand', 'group-collapse'] as const;\n\n constructor() {\n const grid = this.elementRef.nativeElement;\n registerFeatureClaim(grid, 'groupingRows', () => this.groupingRows());\n for (const ev of GridGroupingRowsDirective.EVENTS) claimEvent(grid, ev);\n }\n\n ngOnInit(): void {\n const grid = this.elementRef.nativeElement;\n const wire = <T>(name: string, out: { emit: (v: T) => void }): void => {\n const l = (e: Event): void => out.emit((e as CustomEvent<T>).detail);\n grid.addEventListener(name, l);\n this.listeners.set(name, l);\n };\n wire<GroupToggleDetail>('group-toggle', this.groupToggle);\n wire<GroupExpandDetail>('group-expand', this.groupExpand);\n wire<GroupCollapseDetail>('group-collapse', this.groupCollapse);\n }\n\n ngOnDestroy(): void {\n const grid = this.elementRef.nativeElement;\n for (const [name, l] of this.listeners) grid.removeEventListener(name, l);\n this.listeners.clear();\n unregisterFeatureClaim(grid, 'groupingRows');\n for (const ev of GridGroupingRowsDirective.EVENTS) unclaimEvent(grid, ev);\n }\n}\n","/**\n * Row grouping feature for @toolbox-web/grid-angular\n *\n * Import this module to enable the `groupingRows` input on Grid directive.\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid-angular/features/grouping-rows';\n *\n * <tbw-grid [groupingRows]=\"{ groupBy: ['department'] }\" />\n * ```\n *\n * @packageDocumentation\n */\n\nimport { isComponentClass, registerFeatureConfigPreprocessor } from '@toolbox-web/grid-angular';\nimport '@toolbox-web/grid/features/grouping-rows';\nimport type { GroupingRowsConfig, GroupRowRenderParams } from '@toolbox-web/grid/plugins/grouping-rows';\nexport { GridGroupingRowsDirective } from './grid-grouping-rows.directive';\nexport type { _Augmentation as _GroupingRowsAugmentation } from '@toolbox-web/grid/features/grouping-rows';\n\n// Bridge any Angular component classes embedded in the user-supplied config\n// (e.g. group-row renderer) to plain renderer functions before the core\n// plugin factory consumes the config.\nregisterFeatureConfigPreprocessor('groupingRows', (config, adapter) => {\n if (!config || typeof config !== 'object') return config;\n const cfg = config as GroupingRowsConfig;\n if (cfg.groupRowRenderer && isComponentClass(cfg.groupRowRenderer)) {\n const mount = adapter.mountComponentRenderer<GroupRowRenderParams>(cfg.groupRowRenderer, (p) => ({\n key: p.key,\n value: p.value,\n depth: p.depth,\n rows: p.rows,\n expanded: p.expanded,\n toggleExpand: p.toggleExpand,\n }));\n return { ...cfg, groupRowRenderer: (params: GroupRowRenderParams) => mount(params).hostElement };\n }\n return cfg;\n});\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAA;;;;;;AAMG;AAWH;;;;AAIG;MAKU,yBAAyB,CAAA;AACnB,IAAA,UAAU,GAAG,MAAM,EAAC,UAA2B,EAAC;IAExD,YAAY,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,cAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAsB;IAC1C,WAAW,GAAG,MAAM,EAAqB;IACzC,WAAW,GAAG,MAAM,EAAqB;IACzC,aAAa,GAAG,MAAM,EAAuB;AAErC,IAAA,SAAS,GAAG,IAAI,GAAG,EAA8B;IAC1D,OAAgB,MAAM,GAAG,CAAC,cAAc,EAAE,cAAc,EAAE,gBAAgB,CAAU;AAE5F,IAAA,WAAA,GAAA;AACE,QAAA,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa;AAC1C,QAAA,oBAAoB,CAAC,IAAI,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC;AACrE,QAAA,KAAK,MAAM,EAAE,IAAI,yBAAyB,CA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AW,EAAE;IAClG;AACA,IAAA,OAAO,GAAG;AACZ,CAAC,CAAC;;ACvCF;;AAEG;;;;"}
|
|
@@ -16,7 +16,7 @@ import { inject, ElementRef, input, output, Directive } from '@angular/core';
|
|
|
16
16
|
* @category Directive
|
|
17
17
|
*/
|
|
18
18
|
/**
|
|
19
|
-
* Owns the binding(s) `[masterDetail], [detailExpand]` on `<tbw-grid>` for the matching feature plugin. See
|
|
19
|
+
* Owns the binding(s) `[masterDetail], [detailExpand]` on `<tbw-grid>` for the matching feature plugin. See `GridFilteringDirective` for the full rationale.
|
|
20
20
|
*
|
|
21
21
|
* @category Directive
|
|
22
22
|
*/
|
|
@@ -114,7 +114,6 @@ registerTemplateBridge(({ grid }) => {
|
|
|
114
114
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
115
115
|
const existingPlugin = grid.getPluginByName?.('masterDetail');
|
|
116
116
|
if (!existingPlugin) {
|
|
117
|
-
// eslint-disable-next-line no-console
|
|
118
117
|
console.warn('[tbw-grid-angular] <tbw-grid-detail> found but MasterDetailPlugin is not configured.\n' +
|
|
119
118
|
'Add the [masterDetail] input, set gridConfig.features.masterDetail, or include\n' +
|
|
120
119
|
'MasterDetailPlugin in gridConfig.plugins:\n\n' +
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolbox-web-grid-angular-features-master-detail.mjs","sources":["../../../../libs/grid-angular/features/master-detail/src/grid-master-detail.directive.ts","../../../../libs/grid-angular/features/master-detail/src/index.ts","../../../../libs/grid-angular/features/master-detail/src/toolbox-web-grid-angular-features-master-detail.ts"],"sourcesContent":["/**\n * `GridMasterDetailDirective` — owns `[masterDetail]` and `(detailExpand)`\n * on `<tbw-grid>`. See `GridFilteringDirective` for the full rationale.\n *\n * Note: this directive is independent of the higher-level\n * `<tbw-grid-detail>` template element + `GridDetailView` wrapper, which\n * uses a different bridging mechanism (template registration). Apps using\n * the template form do not need this directive.\n *\n * @category Directive\n */\nimport { Directive, ElementRef, inject, input, OnDestroy, OnInit, output } from '@angular/core';\nimport type { DataGridElement } from '@toolbox-web/grid';\nimport { claimEvent, registerFeatureClaim, unclaimEvent, unregisterFeatureClaim } from '@toolbox-web/grid-angular';\nimport type { DetailExpandDetail, MasterDetailConfig } from '@toolbox-web/grid/plugins/master-detail';\n\n/**\n * Owns the binding(s) `[masterDetail], [detailExpand]` on `<tbw-grid>` for the matching feature plugin. See {@link GridFilteringDirective} for the full rationale.\n *\n * @category Directive\n */\n@Directive({\n selector: 'tbw-grid[masterDetail], tbw-grid[detailExpand]',\n standalone: true,\n})\nexport class GridMasterDetailDirective implements OnInit, OnDestroy {\n private readonly elementRef = inject(ElementRef<DataGridElement>);\n\n readonly masterDetail = input<MasterDetailConfig>();\n readonly detailExpand = output<DetailExpandDetail>();\n\n private listener?: (e: Event) => void;\n\n constructor() {\n const grid = this.elementRef.nativeElement;\n registerFeatureClaim(grid, 'masterDetail', () => this.masterDetail());\n claimEvent(grid, 'detail-expand');\n }\n\n ngOnInit(): void {\n const grid = this.elementRef.nativeElement;\n this.listener = (e: Event): void => this.detailExpand.emit((e as CustomEvent<DetailExpandDetail>).detail);\n grid.addEventListener('detail-expand', this.listener);\n }\n\n ngOnDestroy(): void {\n const grid = this.elementRef.nativeElement;\n if (this.listener) {\n grid.removeEventListener('detail-expand', this.listener);\n this.listener = undefined;\n }\n unregisterFeatureClaim(grid, 'masterDetail');\n unclaimEvent(grid, 'detail-expand');\n }\n}\n","/**\n * Master-detail feature for @toolbox-web/grid-angular\n *\n * Import this module to enable the `[masterDetail]` input on the `Grid`\n * directive AND to wire `<tbw-grid-detail>` Angular templates into the\n * MasterDetailPlugin's `detailRenderer`.\n *\n * @example\n * ```typescript\n * // In your bootstrap (e.g. main.ts or app.component.ts):\n * import '@toolbox-web/grid-angular/features/master-detail';\n * ```\n *\n * ```html\n * <tbw-grid [masterDetail]=\"{ showExpandColumn: true }\">\n * <tbw-grid-detail>\n * <ng-template let-row>...</ng-template>\n * </tbw-grid-detail>\n * </tbw-grid>\n * ```\n *\n * @packageDocumentation\n */\n\nimport {\n getDetailTemplate,\n registerDetailRendererBridge,\n registerTemplateBridge,\n type GridAdapter,\n type GridDetailContext,\n} from '@toolbox-web/grid-angular';\nimport '@toolbox-web/grid/features/master-detail';\nexport { GridMasterDetailDirective } from './grid-master-detail.directive';\nexport type { _Augmentation as _MasterDetailAugmentation } from '@toolbox-web/grid/features/master-detail';\n\n// ---------------------------------------------------------------------------\n// Re-exports from `@toolbox-web/grid-angular` (main entry).\n//\n// `GridDetailView` (and its `getDetailTemplate` helper / `GridDetailContext`\n// type) still physically live in the main entry today but are master-detail\n// specific. They are re-exported here so consumers can import them from the\n// feature entry that owns the runtime behaviour. The same symbols are\n// `@deprecated` on the main entry; in v2.0.0 the source will physically move\n// into this secondary entry and the deprecated re-exports on the main entry\n// will be removed.\n// ---------------------------------------------------------------------------\nexport { getDetailTemplate, GridDetailView } from '@toolbox-web/grid-angular';\nexport type { GridDetailContext } from '@toolbox-web/grid-angular';\n\n/**\n * Subset of `MasterDetailPlugin` we touch from the bridge. Avoids importing\n * the plugin class itself (would defeat tree-shaking and re-introduce the\n * coupling we just removed from the core directive).\n */\ninterface MasterDetailPluginLike {\n refreshDetailRenderer?: () => void;\n}\n\n// Install the row renderer bridge on the adapter. This is what\n// `adapter.createDetailRenderer(grid)` and `adapter.parseDetailElement(el)`\n// delegate to. Without this import, both methods return undefined.\nregisterDetailRendererBridge(<TRow = unknown>(gridElement: HTMLElement, adapter: GridAdapter) => {\n // Type inferred from `getDetailTemplate` (same package instance as `adapter`),\n // not from a local `import type { TemplateRef } from '@angular/core'` — the\n // latter resolves through Bun's `.bun/` cache during ng-packagr build and\n // produces a brand-incompatible TemplateRef vs the built adapter `.d.ts`.\n const template = getDetailTemplate(gridElement);\n if (!template) return undefined;\n\n return (row: TRow) => {\n const context: GridDetailContext<TRow> = { $implicit: row, row };\n const viewRef = adapter.createTrackedEmbeddedView(template, context);\n const container = document.createElement('div');\n viewRef.rootNodes.forEach((node: Node) => container.appendChild(node));\n return container;\n };\n});\n\n// Wire <tbw-grid-detail> Angular templates into the MasterDetailPlugin once\n// content templates are registered. The plugin's `parseLightDomDetail()`\n// already calls back into the adapter via `grid.__frameworkAdapter.parseDetailElement`\n// (which the `Grid` directive set in `ngOnInit`), so all we need to do here\n// is trigger a refresh once Angular's content templates are available.\nregisterTemplateBridge(({ grid }) => {\n // Only act when the user actually placed a <tbw-grid-detail> in light DOM.\n const detailElement = grid.querySelector('tbw-grid-detail');\n if (!detailElement) return;\n\n // The plugin must already have been attached (via [masterDetail] input,\n // gridConfig.features.masterDetail, or gridConfig.plugins). Use the runtime\n // lookup so we don't miss plugins instantiated from `gridConfig.features`,\n // which never appear in `gridConfig.plugins`.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const existingPlugin = (grid as any).getPluginByName?.('masterDetail') as MasterDetailPluginLike | undefined;\n\n if (!existingPlugin) {\n // eslint-disable-next-line no-console\n console.warn(\n '[tbw-grid-angular] <tbw-grid-detail> found but MasterDetailPlugin is not configured.\\n' +\n 'Add the [masterDetail] input, set gridConfig.features.masterDetail, or include\\n' +\n 'MasterDetailPlugin in gridConfig.plugins:\\n\\n' +\n ' <tbw-grid [masterDetail]=\"{ showExpandColumn: true }\">...</tbw-grid>\\n\\n' +\n 'or:\\n\\n' +\n ' gridConfig = { features: { masterDetail: { showExpandColumn: true } } };',\n );\n return;\n }\n\n existingPlugin.refreshDetailRenderer?.();\n});\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;AAUG;AAMH;;;;AAIG;MAKU,yBAAyB,CAAA;AACnB,IAAA,UAAU,GAAG,MAAM,EAAC,UAA2B,EAAC;IAExD,YAAY,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,cAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAsB;IAC1C,YAAY,GAAG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;YAC5E,SAAS;AACT,YAAA,4EAA4E,CAC/E;QACD;IACF;AAEA,IAAA,cAAc,CAAC,qBAAqB,IAAI;AAC1C,CAAC,CAAC;;AC7GF;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"toolbox-web-grid-angular-features-master-detail.mjs","sources":["../../../../libs/grid-angular/features/master-detail/src/grid-master-detail.directive.ts","../../../../libs/grid-angular/features/master-detail/src/index.ts","../../../../libs/grid-angular/features/master-detail/src/toolbox-web-grid-angular-features-master-detail.ts"],"sourcesContent":["/**\n * `GridMasterDetailDirective` — owns `[masterDetail]` and `(detailExpand)`\n * on `<tbw-grid>`. See `GridFilteringDirective` for the full rationale.\n *\n * Note: this directive is independent of the higher-level\n * `<tbw-grid-detail>` template element + `GridDetailView` wrapper, which\n * uses a different bridging mechanism (template registration). Apps using\n * the template form do not need this directive.\n *\n * @category Directive\n */\nimport { Directive, ElementRef, inject, input, OnDestroy, OnInit, output } from '@angular/core';\nimport type { DataGridElement } from '@toolbox-web/grid';\nimport { claimEvent, registerFeatureClaim, unclaimEvent, unregisterFeatureClaim } from '@toolbox-web/grid-angular';\nimport type { DetailExpandDetail, MasterDetailConfig } from '@toolbox-web/grid/plugins/master-detail';\n\n/**\n * Owns the binding(s) `[masterDetail], [detailExpand]` on `<tbw-grid>` for the matching feature plugin. See `GridFilteringDirective` for the full rationale.\n *\n * @category Directive\n */\n@Directive({\n selector: 'tbw-grid[masterDetail], tbw-grid[detailExpand]',\n standalone: true,\n})\nexport class GridMasterDetailDirective implements OnInit, OnDestroy {\n private readonly elementRef = inject(ElementRef<DataGridElement>);\n\n readonly masterDetail = input<MasterDetailConfig>();\n readonly detailExpand = output<DetailExpandDetail>();\n\n private listener?: (e: Event) => void;\n\n constructor() {\n const grid = this.elementRef.nativeElement;\n registerFeatureClaim(grid, 'masterDetail', () => this.masterDetail());\n claimEvent(grid, 'detail-expand');\n }\n\n ngOnInit(): void {\n const grid = this.elementRef.nativeElement;\n this.listener = (e: Event): void => this.detailExpand.emit((e as CustomEvent<DetailExpandDetail>).detail);\n grid.addEventListener('detail-expand', this.listener);\n }\n\n ngOnDestroy(): void {\n const grid = this.elementRef.nativeElement;\n if (this.listener) {\n grid.removeEventListener('detail-expand', this.listener);\n this.listener = undefined;\n }\n unregisterFeatureClaim(grid, 'masterDetail');\n unclaimEvent(grid, 'detail-expand');\n }\n}\n","/**\n * Master-detail feature for @toolbox-web/grid-angular\n *\n * Import this module to enable the `[masterDetail]` input on the `Grid`\n * directive AND to wire `<tbw-grid-detail>` Angular templates into the\n * MasterDetailPlugin's `detailRenderer`.\n *\n * @example\n * ```typescript\n * // In your bootstrap (e.g. main.ts or app.component.ts):\n * import '@toolbox-web/grid-angular/features/master-detail';\n * ```\n *\n * ```html\n * <tbw-grid [masterDetail]=\"{ showExpandColumn: true }\">\n * <tbw-grid-detail>\n * <ng-template let-row>...</ng-template>\n * </tbw-grid-detail>\n * </tbw-grid>\n * ```\n *\n * @packageDocumentation\n */\n\nimport {\n getDetailTemplate,\n registerDetailRendererBridge,\n registerTemplateBridge,\n type GridAdapter,\n type GridDetailContext,\n} from '@toolbox-web/grid-angular';\nimport '@toolbox-web/grid/features/master-detail';\nexport { GridMasterDetailDirective } from './grid-master-detail.directive';\nexport type { _Augmentation as _MasterDetailAugmentation } from '@toolbox-web/grid/features/master-detail';\n\n// ---------------------------------------------------------------------------\n// Re-exports from `@toolbox-web/grid-angular` (main entry).\n//\n// `GridDetailView` (and its `getDetailTemplate` helper / `GridDetailContext`\n// type) still physically live in the main entry today but are master-detail\n// specific. They are re-exported here so consumers can import them from the\n// feature entry that owns the runtime behaviour. The same symbols are\n// `@deprecated` on the main entry; in v2.0.0 the source will physically move\n// into this secondary entry and the deprecated re-exports on the main entry\n// will be removed.\n// ---------------------------------------------------------------------------\nexport { getDetailTemplate, GridDetailView } from '@toolbox-web/grid-angular';\nexport type { GridDetailContext } from '@toolbox-web/grid-angular';\n\n/**\n * Subset of `MasterDetailPlugin` we touch from the bridge. Avoids importing\n * the plugin class itself (would defeat tree-shaking and re-introduce the\n * coupling we just removed from the core directive).\n */\ninterface MasterDetailPluginLike {\n refreshDetailRenderer?: () => void;\n}\n\n// Install the row renderer bridge on the adapter. This is what\n// `adapter.createDetailRenderer(grid)` and `adapter.parseDetailElement(el)`\n// delegate to. Without this import, both methods return undefined.\nregisterDetailRendererBridge(<TRow = unknown>(gridElement: HTMLElement, adapter: GridAdapter) => {\n // Type inferred from `getDetailTemplate` (same package instance as `adapter`),\n // not from a local `import type { TemplateRef } from '@angular/core'` — the\n // latter resolves through Bun's `.bun/` cache during ng-packagr build and\n // produces a brand-incompatible TemplateRef vs the built adapter `.d.ts`.\n const template = getDetailTemplate(gridElement);\n if (!template) return undefined;\n\n return (row: TRow) => {\n const context: GridDetailContext<TRow> = { $implicit: row, row };\n const viewRef = adapter.createTrackedEmbeddedView(template, context);\n const container = document.createElement('div');\n viewRef.rootNodes.forEach((node: Node) => container.appendChild(node));\n return container;\n };\n});\n\n// Wire <tbw-grid-detail> Angular templates into the MasterDetailPlugin once\n// content templates are registered. The plugin's `parseLightDomDetail()`\n// already calls back into the adapter via `grid.__frameworkAdapter.parseDetailElement`\n// (which the `Grid` directive set in `ngOnInit`), so all we need to do here\n// is trigger a refresh once Angular's content templates are available.\nregisterTemplateBridge(({ grid }) => {\n // Only act when the user actually placed a <tbw-grid-detail> in light DOM.\n const detailElement = grid.querySelector('tbw-grid-detail');\n if (!detailElement) return;\n\n // The plugin must already have been attached (via [masterDetail] input,\n // gridConfig.features.masterDetail, or gridConfig.plugins). Use the runtime\n // lookup so we don't miss plugins instantiated from `gridConfig.features`,\n // which never appear in `gridConfig.plugins`.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const existingPlugin = (grid as any).getPluginByName?.('masterDetail') as MasterDetailPluginLike | undefined;\n\n if (!existingPlugin) {\n console.warn(\n '[tbw-grid-angular] <tbw-grid-detail> found but MasterDetailPlugin is not configured.\\n' +\n 'Add the [masterDetail] input, set gridConfig.features.masterDetail, or include\\n' +\n 'MasterDetailPlugin in gridConfig.plugins:\\n\\n' +\n ' <tbw-grid [masterDetail]=\"{ showExpandColumn: true }\">...</tbw-grid>\\n\\n' +\n 'or:\\n\\n' +\n ' gridConfig = { features: { masterDetail: { showExpandColumn: true } } };',\n );\n return;\n }\n\n existingPlugin.refreshDetailRenderer?.();\n});\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;AAUG;AAMH;;;;AAIG;MAKU,yBAAyB,CAAA;AACnB,IAAA,UAAU,GAAG,MAAM,EAAC,UAA2B,EAAC;IAExD,YAAY,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,cAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAsB;IAC1C,YAAY,GAAG,MAAM,EAAsB;AAE5C,IAAA,QAAQ;AAEhB,IAAA,WAAA,GAAA;AACE,QAAA,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa;AAC1C,QAAA,oBAAoB,CAAC,IAAI,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC;AACrE,QAAA,UAAU,CAAC,IAAI,EAAE,eAAe,CAAC;IACnC;IAEA,QAAQ,GAAA;AACN,QAAA,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa;AAC1C,QAAA,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAQ,KAAW,IAAI,CAAC,YAAY,CAAC,IAAI,CAAE,CAAqC,CAAC,MAAM,CAAC;QACzG,IAAI,CAAC,gBAAgB,CAAC,eAAe,EAAE,IAAI,CAAC,QAAQ,CAAC;IACvD;IAEA,WAAW,GAAA;AACT,QAAA,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa;AAC1C,QAAA,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,IAAI,CAAC,mBAAmB,CAA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,CAAC,KAAK,CAAC;AAC/C,QAAA,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,IAAU,KAAK,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;AACtE,QAAA,OAAO,SAAS;AAClB,IAAA,CAAC;AACH,CAAC,CAAC;AAEF;AACA;AACA;AACA;AACA;AACA,sBAAsB,CAAC,CAAC,EAAE,IAAI,EAAE,KAAI;;IAElC,MAAM,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC,iBAAiB,CAAC;AAC3D,IAAA,IAAI,CAAC,aAAa;QAAE;;;;;;IAOpB,MAAM,cAAc,GAAI,IAAY,CAAC,eAAe,GAAG,cAAc,CAAuC;IAE5G,IAAI,CAAC,cAAc,EAAE;QACnB,OAAO,CAAC,IAAI,CACV,wFAAwF;YACtF,kFAAkF;YAClF,+CAA+C;YAC/C,4EAA4E;YAC5E,SAAS;AACT,YAAA,4EAA4E,CAC/E;QACD;IACF;AAEA,IAAA,cAAc,CAAC,qBAAqB,IAAI;AAC1C,CAAC,CAAC;;AC5GF;;AAEG;;;;"}
|
|
@@ -12,7 +12,7 @@ import { registerFeatureClaim, unregisterFeatureClaim } from '@toolbox-web/grid-
|
|
|
12
12
|
* @category Directive
|
|
13
13
|
*/
|
|
14
14
|
/**
|
|
15
|
-
* Owns the binding(s) `[multiSort]` on `<tbw-grid>` for the matching feature plugin. See
|
|
15
|
+
* Owns the binding(s) `[multiSort]` on `<tbw-grid>` for the matching feature plugin. See `GridFilteringDirective` for the full rationale.
|
|
16
16
|
*
|
|
17
17
|
* @category Directive
|
|
18
18
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolbox-web-grid-angular-features-multi-sort.mjs","sources":["../../../../libs/grid-angular/features/multi-sort/src/grid-multi-sort.directive.ts","../../../../libs/grid-angular/features/multi-sort/src/index.ts","../../../../libs/grid-angular/features/multi-sort/src/toolbox-web-grid-angular-features-multi-sort.ts"],"sourcesContent":["/**\n * `GridMultiSortDirective` — owns the `[multiSort]` input on `<tbw-grid>`.\n * The `(sortChange)` output stays on `Grid` because single-column sort\n * (without this plugin) also emits it. See `GridFilteringDirective` for\n * the full rationale.\n *\n * @category Directive\n */\nimport { Directive, ElementRef, inject, input, OnDestroy } from '@angular/core';\nimport type { DataGridElement } from '@toolbox-web/grid';\nimport { registerFeatureClaim, unregisterFeatureClaim } from '@toolbox-web/grid-angular';\nimport type { MultiSortConfig } from '@toolbox-web/grid/plugins/multi-sort';\n\n/**\n * Owns the binding(s) `[multiSort]` on `<tbw-grid>` for the matching feature plugin. See
|
|
1
|
+
{"version":3,"file":"toolbox-web-grid-angular-features-multi-sort.mjs","sources":["../../../../libs/grid-angular/features/multi-sort/src/grid-multi-sort.directive.ts","../../../../libs/grid-angular/features/multi-sort/src/index.ts","../../../../libs/grid-angular/features/multi-sort/src/toolbox-web-grid-angular-features-multi-sort.ts"],"sourcesContent":["/**\n * `GridMultiSortDirective` — owns the `[multiSort]` input on `<tbw-grid>`.\n * The `(sortChange)` output stays on `Grid` because single-column sort\n * (without this plugin) also emits it. See `GridFilteringDirective` for\n * the full rationale.\n *\n * @category Directive\n */\nimport { Directive, ElementRef, inject, input, OnDestroy } from '@angular/core';\nimport type { DataGridElement } from '@toolbox-web/grid';\nimport { registerFeatureClaim, unregisterFeatureClaim } from '@toolbox-web/grid-angular';\nimport type { MultiSortConfig } from '@toolbox-web/grid/plugins/multi-sort';\n\n/**\n * Owns the binding(s) `[multiSort]` on `<tbw-grid>` for the matching feature plugin. See `GridFilteringDirective` for the full rationale.\n *\n * @category Directive\n */\n@Directive({\n selector: 'tbw-grid[multiSort]',\n standalone: true,\n})\nexport class GridMultiSortDirective implements OnDestroy {\n private readonly elementRef = inject(ElementRef<DataGridElement>);\n\n readonly multiSort = input<boolean | 'single' | 'multi' | MultiSortConfig>();\n\n constructor() {\n registerFeatureClaim(this.elementRef.nativeElement, 'multiSort', () => this.multiSort());\n }\n\n ngOnDestroy(): void {\n unregisterFeatureClaim(this.elementRef.nativeElement, 'multiSort');\n }\n}\n","/**\n * Multi-sort feature for @toolbox-web/grid-angular\n *\n * Import this module to enable the `multiSort` input on Grid directive.\n * Multi-sort allows sorting by multiple columns simultaneously.\n *\n * For basic single-column sorting, columns with `sortable: true` work without this plugin.\n * Use `[sortable]=\"false\"` on the grid to disable all sorting.\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid-angular/features/multi-sort';\n *\n * <tbw-grid [multiSort]=\"true\" />\n * <tbw-grid [multiSort]=\"'single'\" />\n * <tbw-grid [multiSort]=\"{ maxSortColumns: 3 }\" />\n * ```\n *\n * @packageDocumentation\n */\n\nimport '@toolbox-web/grid/features/multi-sort';\nexport { GridMultiSortDirective } from './grid-multi-sort.directive';\nexport type { _Augmentation as _MultiSortAugmentation } from '@toolbox-web/grid/features/multi-sort';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAA;;;;;;;AAOG;AAMH;;;;AAIG;MAKU,sBAAsB,CAAA;AAChB,IAAA,UAAU,GAAG,MAAM,EAAC,UAA2B,EAAC;IAExD,SAAS,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,WAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAkD;AAE5E,IAAA,WAAA,GAAA;AACE,QAAA,oBAAoB,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC;IAC1F;IAEA,WAAW,GAAA;QACT,sBAAsB,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,WAAW,CAAC;IACpE;uGAXW,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAtB,sBAAsB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,qBAAA,EAAA,MAAA,EAAA,EAAA,SAAA,EAAA,EAAA,iBAAA,EAAA,WAAA,EAAA,UAAA,EAAA,WAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAtB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAJlC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,qBAAqB;AAC/B,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;ACrBD;;;;;;;;;;;;;;;;;;;AAmBG;;ACnBH;;AAEG;;;;"}
|
|
@@ -11,7 +11,7 @@ import { registerFeatureClaim, unregisterFeatureClaim } from '@toolbox-web/grid-
|
|
|
11
11
|
* @category Directive
|
|
12
12
|
*/
|
|
13
13
|
/**
|
|
14
|
-
* Owns the binding(s) `[pinnedColumns]` on `<tbw-grid>` for the matching feature plugin. See
|
|
14
|
+
* Owns the binding(s) `[pinnedColumns]` 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-pinned-columns.mjs","sources":["../../../../libs/grid-angular/features/pinned-columns/src/grid-pinned-columns.directive.ts","../../../../libs/grid-angular/features/pinned-columns/src/index.ts","../../../../libs/grid-angular/features/pinned-columns/src/toolbox-web-grid-angular-features-pinned-columns.ts"],"sourcesContent":["/**\n * `GridPinnedColumnsDirective` — owns `[pinnedColumns]` on `<tbw-grid>`.\n * No event outputs (column pinning is configuration-only). See\n * `GridFilteringDirective` for the full rationale.\n *\n * @category Directive\n */\nimport { Directive, ElementRef, inject, input, OnDestroy } from '@angular/core';\nimport type { DataGridElement } from '@toolbox-web/grid';\nimport { registerFeatureClaim, unregisterFeatureClaim } from '@toolbox-web/grid-angular';\n\n/**\n * Owns the binding(s) `[pinnedColumns]` on `<tbw-grid>` for the matching feature plugin. See
|
|
1
|
+
{"version":3,"file":"toolbox-web-grid-angular-features-pinned-columns.mjs","sources":["../../../../libs/grid-angular/features/pinned-columns/src/grid-pinned-columns.directive.ts","../../../../libs/grid-angular/features/pinned-columns/src/index.ts","../../../../libs/grid-angular/features/pinned-columns/src/toolbox-web-grid-angular-features-pinned-columns.ts"],"sourcesContent":["/**\n * `GridPinnedColumnsDirective` — owns `[pinnedColumns]` on `<tbw-grid>`.\n * No event outputs (column pinning is configuration-only). See\n * `GridFilteringDirective` for the full rationale.\n *\n * @category Directive\n */\nimport { Directive, ElementRef, inject, input, OnDestroy } from '@angular/core';\nimport type { DataGridElement } from '@toolbox-web/grid';\nimport { registerFeatureClaim, unregisterFeatureClaim } from '@toolbox-web/grid-angular';\n\n/**\n * Owns the binding(s) `[pinnedColumns]` on `<tbw-grid>` for the matching feature plugin. See `GridFilteringDirective` for the full rationale.\n *\n * @category Directive\n */\n@Directive({\n selector: 'tbw-grid[pinnedColumns]',\n standalone: true,\n})\nexport class GridPinnedColumnsDirective implements OnDestroy {\n private readonly elementRef = inject(ElementRef<DataGridElement>);\n\n readonly pinnedColumns = input<boolean>();\n\n constructor() {\n registerFeatureClaim(this.elementRef.nativeElement, 'pinnedColumns', () => this.pinnedColumns());\n }\n\n ngOnDestroy(): void {\n unregisterFeatureClaim(this.elementRef.nativeElement, 'pinnedColumns');\n }\n}\n","/**\n * Pinned columns feature for @toolbox-web/grid-angular\n *\n * Import this module to enable the `pinnedColumns` input on Grid directive.\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid-angular/features/pinned-columns';\n *\n * <tbw-grid [pinnedColumns]=\"true\" [columns]=\"[\n * { field: 'id', pinned: 'left' },\n * { field: 'name' }\n * ]\" />\n * ```\n *\n * @packageDocumentation\n */\n\nimport '@toolbox-web/grid/features/pinned-columns';\nexport { GridPinnedColumnsDirective } from './grid-pinned-columns.directive';\nexport type { _Augmentation as _PinnedColumnsAugmentation } from '@toolbox-web/grid/features/pinned-columns';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAA;;;;;;AAMG;AAKH;;;;AAIG;MAKU,0BAA0B,CAAA;AACpB,IAAA,UAAU,GAAG,MAAM,EAAC,UAA2B,EAAC;IAExD,aAAa,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,eAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAW;AAEzC,IAAA,WAAA,GAAA;AACE,QAAA,oBAAoB,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,eAAe,EAAE,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;IAClG;IAEA,WAAW,GAAA;QACT,sBAAsB,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,eAAe,CAAC;IACxE;uGAXW,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAA1B,0BAA0B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,yBAAA,EAAA,MAAA,EAAA,EAAA,aAAA,EAAA,EAAA,iBAAA,EAAA,eAAA,EAAA,UAAA,EAAA,eAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAA1B,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBAJtC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,yBAAyB;AACnC,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;ACnBD;;;;;;;;;;;;;;;;AAgBG;;AChBH;;AAEG;;;;"}
|
|
@@ -10,7 +10,7 @@ import { inject, ElementRef, input, Directive } from '@angular/core';
|
|
|
10
10
|
* @category Directive
|
|
11
11
|
*/
|
|
12
12
|
/**
|
|
13
|
-
* Owns the binding(s) `[pinnedRows]` on `<tbw-grid>` for the matching feature plugin. See
|
|
13
|
+
* Owns the binding(s) `[pinnedRows]` 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-pinned-rows.mjs","sources":["../../../../libs/grid-angular/features/pinned-rows/src/grid-pinned-rows.directive.ts","../../../../libs/grid-angular/features/pinned-rows/src/index.ts","../../../../libs/grid-angular/features/pinned-rows/src/toolbox-web-grid-angular-features-pinned-rows.ts"],"sourcesContent":["/**\n * `GridPinnedRowsDirective` — owns `[pinnedRows]` 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 { PinnedRowsConfig } from '@toolbox-web/grid/plugins/pinned-rows';\n\n/**\n * Owns the binding(s) `[pinnedRows]` on `<tbw-grid>` for the matching feature plugin. See
|
|
1
|
+
{"version":3,"file":"toolbox-web-grid-angular-features-pinned-rows.mjs","sources":["../../../../libs/grid-angular/features/pinned-rows/src/grid-pinned-rows.directive.ts","../../../../libs/grid-angular/features/pinned-rows/src/index.ts","../../../../libs/grid-angular/features/pinned-rows/src/toolbox-web-grid-angular-features-pinned-rows.ts"],"sourcesContent":["/**\n * `GridPinnedRowsDirective` — owns `[pinnedRows]` 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 { PinnedRowsConfig } from '@toolbox-web/grid/plugins/pinned-rows';\n\n/**\n * Owns the binding(s) `[pinnedRows]` 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[pinnedRows]',\n standalone: true,\n})\nexport class GridPinnedRowsDirective implements OnDestroy {\n private readonly elementRef = inject(ElementRef<DataGridElement>);\n\n readonly pinnedRows = input<boolean | PinnedRowsConfig>();\n\n constructor() {\n registerFeatureClaim(this.elementRef.nativeElement, 'pinnedRows', () => this.pinnedRows());\n }\n\n ngOnDestroy(): void {\n unregisterFeatureClaim(this.elementRef.nativeElement, 'pinnedRows');\n }\n}\n","/**\n * Pinned rows feature for @toolbox-web/grid-angular\n *\n * Import this module to enable the `pinnedRows` input on Grid directive.\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid-angular/features/pinned-rows';\n *\n * <tbw-grid [pinnedRows]=\"{ bottom: [{ type: 'aggregation' }] }\" />\n * ```\n *\n * @packageDocumentation\n */\n\nimport type { Type } from '@angular/core';\nimport { isComponentClass, registerFeatureConfigPreprocessor, type GridAdapter } from '@toolbox-web/grid-angular';\nimport '@toolbox-web/grid/features/pinned-rows';\nimport type {\n PinnedRowsConfig,\n PinnedRowsContext,\n PinnedRowSlot,\n ZonedPanelRender,\n} from '@toolbox-web/grid/plugins/pinned-rows';\nexport { GridPinnedRowsDirective } from './grid-pinned-rows.directive';\nexport type { _Augmentation as _PinnedRowsAugmentation } from '@toolbox-web/grid/features/pinned-rows';\n\n/**\n * Build a pinned-rows panel renderer function from an Angular component class.\n * The component should accept inputs from PinnedRowsContext.\n */\nfunction buildPanelRenderer(\n adapter: GridAdapter,\n componentClass: Type<unknown>,\n): (ctx: PinnedRowsContext) => HTMLElement {\n const mount = adapter.mountComponentRenderer<PinnedRowsContext>(componentClass, (ctx) => ({\n totalRows: ctx.totalRows,\n filteredRows: ctx.filteredRows,\n selectedRows: ctx.selectedRows,\n columns: ctx.columns,\n rows: ctx.rows,\n grid: ctx.grid,\n }));\n return (ctx) => mount(ctx).hostElement;\n}\n\n/**\n * Bridge a single pinned-row slot. Aggregation slots (no `render`) pass through.\n * For panel slots, wrap any component-class `render` (or array entry's `render`)\n * with the Angular component renderer.\n */\nfunction bridgeSlot(adapter: GridAdapter, slot: PinnedRowSlot): PinnedRowSlot {\n if (!('render' in slot) || slot.render == null) return slot;\n\n if (Array.isArray(slot.render)) {\n const zoned: ZonedPanelRender[] = slot.render.map((entry) => {\n if (entry?.render == null) return entry;\n if (isComponentClass(entry.render)) {\n return { zone: entry.zone, render: buildPanelRenderer(adapter, entry.render as Type<unknown>) };\n }\n return entry;\n });\n return { ...slot, render: zoned };\n }\n\n if (isComponentClass(slot.render)) {\n return { ...slot, render: buildPanelRenderer(adapter, slot.render as Type<unknown>) };\n }\n return slot;\n}\n\n// Bridge any Angular component classes embedded in `customPanels` and `slots`\n// to plain renderer functions before the core plugin factory consumes the config.\nregisterFeatureConfigPreprocessor('pinnedRows', (config, adapter) => {\n if (!config || typeof config !== 'object') return config;\n const cfg = config as PinnedRowsConfig;\n let next: PinnedRowsConfig = cfg;\n\n // Legacy customPanels bridging.\n if (Array.isArray(cfg.customPanels)) {\n const hasComponentRender = cfg.customPanels.some((panel) => isComponentClass(panel.render));\n if (hasComponentRender) {\n next = {\n ...next,\n customPanels: cfg.customPanels.map((panel) => {\n if (!isComponentClass(panel.render)) return panel;\n return { ...panel, render: buildPanelRenderer(adapter, panel.render) };\n }),\n };\n }\n }\n\n // Slots[] bridging \\u2014 each PanelSlot.render may be a component class, or an\n // array of { zone?, render } where each render may be a component class.\n if (Array.isArray(cfg.slots)) {\n next = { ...next, slots: cfg.slots.map((slot) => bridgeSlot(adapter, slot)) };\n }\n\n return next;\n});\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAA;;;;;AAKG;AAMH;;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IAAA,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ;AAAE,QAAA,OAAO,MAAM;IACxD,MAAM,GAAG,GAAG,MAA0B;IACtC,IAAI,IAAI,GAAqB,GAAG;;IAGhC,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE;QACnC,MAAM,kBAAkB,GAAG,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,KAAK,KAAK,gBAAgB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC3F,IAAI,kBAAkB,EAAE;AACtB,YAAA,IAAI,GAAG;AACL,gBAAA,GAAG,IAAI;gBACP,YAAY,EAAE,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,KAAK,KAAI;AAC3C,oBAAA,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,MAAM,CAAC;AAAE,wBAAA,OAAO,KAAK;AACjD,oBAAA,OAAO,EAAE,GAAG,KAAK,EAAE,MAAM,EAAE,kBAAkB,CAAC,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE;AACxE,gBAAA,CAAC,CAAC;aACH;QACH;IACF;;;IAIA,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;QAC5B,IAAI,GAAG,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,EAAE;IAC/E;AAEA,IAAA,OAAO,IAAI;AACb,CAAC,CAAC;;ACnGF;;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) `[pivot]` on `<tbw-grid>` for the matching feature plugin. See
|
|
13
|
+
* Owns the binding(s) `[pivot]` 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-pivot.mjs","sources":["../../../../libs/grid-angular/features/pivot/src/grid-pivot.directive.ts","../../../../libs/grid-angular/features/pivot/src/index.ts","../../../../libs/grid-angular/features/pivot/src/toolbox-web-grid-angular-features-pivot.ts"],"sourcesContent":["/**\n * `GridPivotDirective` — owns `[pivot]` on `<tbw-grid>`. No event outputs.\n * 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 { PivotConfig } from '@toolbox-web/grid/plugins/pivot';\n\n/**\n * Owns the binding(s) `[pivot]` on `<tbw-grid>` for the matching feature plugin. See
|
|
1
|
+
{"version":3,"file":"toolbox-web-grid-angular-features-pivot.mjs","sources":["../../../../libs/grid-angular/features/pivot/src/grid-pivot.directive.ts","../../../../libs/grid-angular/features/pivot/src/index.ts","../../../../libs/grid-angular/features/pivot/src/toolbox-web-grid-angular-features-pivot.ts"],"sourcesContent":["/**\n * `GridPivotDirective` — owns `[pivot]` on `<tbw-grid>`. No event outputs.\n * 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 { PivotConfig } from '@toolbox-web/grid/plugins/pivot';\n\n/**\n * Owns the binding(s) `[pivot]` 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[pivot]',\n standalone: true,\n})\nexport class GridPivotDirective implements OnDestroy {\n private readonly elementRef = inject(ElementRef<DataGridElement>);\n\n readonly pivot = input<PivotConfig>();\n\n constructor() {\n registerFeatureClaim(this.elementRef.nativeElement, 'pivot', () => this.pivot());\n }\n\n ngOnDestroy(): void {\n unregisterFeatureClaim(this.elementRef.nativeElement, 'pivot');\n }\n}\n","/**\n * Pivot feature for @toolbox-web/grid-angular\n *\n * Import this module to enable the `pivot` input on Grid directive.\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid-angular/features/pivot';\n *\n * <tbw-grid [pivot]=\"{ rowFields: ['category'], valueField: 'sales' }\" />\n * ```\n *\n * @packageDocumentation\n */\n\nimport '@toolbox-web/grid/features/pivot';\nexport { GridPivotDirective } from './grid-pivot.directive';\nexport type { _Augmentation as _PivotAugmentation } from '@toolbox-web/grid/features/pivot';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAA;;;;;AAKG;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,CAAe;AAErC,IAAA,WAAA,GAAA;AACE,QAAA,oBAAoB,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;IAClF;IAEA,WAAW,GAAA;QACT,sBAAsB,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,OAAO,CAAC;IAChE;uGAXW,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAlB,kBAAkB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,EAAA,KAAA,EAAA,EAAA,iBAAA,EAAA,OAAA,EAAA,UAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAlB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAJ9B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,iBAAiB;AAC3B,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;ACnBD;;;;;;;;;;;;;AAaG;;ACbH;;AAEG;;;;"}
|