@toolbox-web/grid-angular 1.5.1 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/toolbox-web-grid-angular-features-sticky-rows.mjs +58 -0
- package/fesm2022/toolbox-web-grid-angular-features-sticky-rows.mjs.map +1 -0
- package/fesm2022/toolbox-web-grid-angular.mjs +12 -7
- package/fesm2022/toolbox-web-grid-angular.mjs.map +1 -1
- package/package.json +5 -1
- package/types/toolbox-web-grid-angular-features-sticky-rows.d.ts +22 -0
- package/types/toolbox-web-grid-angular-features-sticky-rows.d.ts.map +1 -0
- package/types/toolbox-web-grid-angular.d.ts +1 -1
- package/types/toolbox-web-grid-angular.d.ts.map +1 -1
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import '@toolbox-web/grid/features/sticky-rows';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { inject, ElementRef, input, Directive } from '@angular/core';
|
|
4
|
+
import { registerFeatureClaim, unregisterFeatureClaim } from '@toolbox-web/grid-angular';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* `GridStickyRowsDirective` — owns `[stickyRows]` on `<tbw-grid>`.
|
|
8
|
+
* No event outputs. See `GridFilteringDirective` for the full rationale.
|
|
9
|
+
*
|
|
10
|
+
* @category Directive
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Owns the binding `[stickyRows]` on `<tbw-grid>` for the matching feature plugin.
|
|
14
|
+
* See `GridFilteringDirective` for the full rationale.
|
|
15
|
+
*
|
|
16
|
+
* @category Directive
|
|
17
|
+
*/
|
|
18
|
+
class GridStickyRowsDirective {
|
|
19
|
+
elementRef = inject((ElementRef));
|
|
20
|
+
stickyRows = input(...(ngDevMode ? [undefined, { debugName: "stickyRows" }] : /* istanbul ignore next */ []));
|
|
21
|
+
constructor() {
|
|
22
|
+
registerFeatureClaim(this.elementRef.nativeElement, 'stickyRows', () => this.stickyRows());
|
|
23
|
+
}
|
|
24
|
+
ngOnDestroy() {
|
|
25
|
+
unregisterFeatureClaim(this.elementRef.nativeElement, 'stickyRows');
|
|
26
|
+
}
|
|
27
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: GridStickyRowsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
28
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.5", type: GridStickyRowsDirective, isStandalone: true, selector: "tbw-grid[stickyRows]", inputs: { stickyRows: { classPropertyName: "stickyRows", publicName: "stickyRows", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
|
|
29
|
+
}
|
|
30
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: GridStickyRowsDirective, decorators: [{
|
|
31
|
+
type: Directive,
|
|
32
|
+
args: [{
|
|
33
|
+
selector: 'tbw-grid[stickyRows]',
|
|
34
|
+
standalone: true,
|
|
35
|
+
}]
|
|
36
|
+
}], ctorParameters: () => [], propDecorators: { stickyRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "stickyRows", required: false }] }] } });
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Sticky rows feature for @toolbox-web/grid-angular
|
|
40
|
+
*
|
|
41
|
+
* Import this module to enable the `stickyRows` input on the Grid directive.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```typescript
|
|
45
|
+
* import '@toolbox-web/grid-angular/features/sticky-rows';
|
|
46
|
+
*
|
|
47
|
+
* <tbw-grid [stickyRows]="{ isSticky: 'isSection' }" />
|
|
48
|
+
* ```
|
|
49
|
+
*
|
|
50
|
+
* @packageDocumentation
|
|
51
|
+
*/
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Generated bundle index. Do not edit.
|
|
55
|
+
*/
|
|
56
|
+
|
|
57
|
+
export { GridStickyRowsDirective };
|
|
58
|
+
//# sourceMappingURL=toolbox-web-grid-angular-features-sticky-rows.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbox-web-grid-angular-features-sticky-rows.mjs","sources":["../../../../libs/grid-angular/features/sticky-rows/src/grid-sticky-rows.directive.ts","../../../../libs/grid-angular/features/sticky-rows/src/index.ts","../../../../libs/grid-angular/features/sticky-rows/src/toolbox-web-grid-angular-features-sticky-rows.ts"],"sourcesContent":["/**\n * `GridStickyRowsDirective` — owns `[stickyRows]` on `<tbw-grid>`.\n * No event outputs. See `GridFilteringDirective` for the full rationale.\n *\n * @category Directive\n */\nimport { Directive, ElementRef, inject, input, OnDestroy } from '@angular/core';\nimport type { DataGridElement } from '@toolbox-web/grid';\nimport { registerFeatureClaim, unregisterFeatureClaim } from '@toolbox-web/grid-angular';\nimport type { StickyRowsConfig } from '@toolbox-web/grid/plugins/sticky-rows';\n\n/**\n * Owns the binding `[stickyRows]` on `<tbw-grid>` for the matching feature plugin.\n * See `GridFilteringDirective` for the full rationale.\n *\n * @category Directive\n */\n@Directive({\n selector: 'tbw-grid[stickyRows]',\n standalone: true,\n})\nexport class GridStickyRowsDirective implements OnDestroy {\n private readonly elementRef = inject(ElementRef<DataGridElement>);\n\n readonly stickyRows = input<StickyRowsConfig>();\n\n constructor() {\n registerFeatureClaim(this.elementRef.nativeElement, 'stickyRows', () => this.stickyRows());\n }\n\n ngOnDestroy(): void {\n unregisterFeatureClaim(this.elementRef.nativeElement, 'stickyRows');\n }\n}\n","/**\n * Sticky rows feature for @toolbox-web/grid-angular\n *\n * Import this module to enable the `stickyRows` input on the Grid directive.\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid-angular/features/sticky-rows';\n *\n * <tbw-grid [stickyRows]=\"{ isSticky: 'isSection' }\" />\n * ```\n *\n * @packageDocumentation\n */\n\nimport '@toolbox-web/grid/features/sticky-rows';\nexport { GridStickyRowsDirective } from './grid-sticky-rows.directive';\nexport type { _Augmentation as _StickyRowsAugmentation } from '@toolbox-web/grid/features/sticky-rows';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAA;;;;;AAKG;AAMH;;;;;AAKG;MAKU,uBAAuB,CAAA;AACjB,IAAA,UAAU,GAAG,MAAM,EAAC,UAA2B,EAAC;IAExD,UAAU,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,YAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAoB;AAE/C,IAAA,WAAA,GAAA;AACE,QAAA,oBAAoB,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;IAC5F;IAEA,WAAW,GAAA;QACT,sBAAsB,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,YAAY,CAAC;IACrE;uGAXW,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAvB,uBAAuB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,sBAAA,EAAA,MAAA,EAAA,EAAA,UAAA,EAAA,EAAA,iBAAA,EAAA,YAAA,EAAA,UAAA,EAAA,YAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAvB,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAJnC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,sBAAsB;AAChC,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;ACpBD;;;;;;;;;;;;;AAaG;;ACbH;;AAEG;;;;"}
|
|
@@ -1849,7 +1849,7 @@ class GridAdapter {
|
|
|
1849
1849
|
createEditor(element) {
|
|
1850
1850
|
const template = getAnyEditorTemplate(element);
|
|
1851
1851
|
// Find the parent grid element for FormArray context access
|
|
1852
|
-
const gridElement = element.closest('tbw-grid');
|
|
1852
|
+
const gridElement = element.closest('tbw-grid, [data-tbw-grid]');
|
|
1853
1853
|
if (!template) {
|
|
1854
1854
|
// No template registered - return undefined to let the grid use its default editor.
|
|
1855
1855
|
// This allows columns with only *tbwRenderer (no *tbwEditor) to still be editable
|
|
@@ -1940,7 +1940,7 @@ class GridAdapter {
|
|
|
1940
1940
|
* to {@link createDetailRenderer} (bridge installed by master-detail feature).
|
|
1941
1941
|
*/
|
|
1942
1942
|
parseDetailElement(detailElement) {
|
|
1943
|
-
const gridElement = detailElement.closest('tbw-grid');
|
|
1943
|
+
const gridElement = detailElement.closest('tbw-grid, [data-tbw-grid]');
|
|
1944
1944
|
if (!gridElement)
|
|
1945
1945
|
return undefined;
|
|
1946
1946
|
return getDetailRendererBridge()?.(gridElement, this);
|
|
@@ -1957,7 +1957,7 @@ class GridAdapter {
|
|
|
1957
1957
|
* to {@link createResponsiveCardRenderer} (bridge installed by responsive feature).
|
|
1958
1958
|
*/
|
|
1959
1959
|
parseResponsiveCardElement(cardElement) {
|
|
1960
|
-
const gridElement = cardElement.closest('tbw-grid');
|
|
1960
|
+
const gridElement = cardElement.closest('tbw-grid, [data-tbw-grid]');
|
|
1961
1961
|
if (!gridElement)
|
|
1962
1962
|
return undefined;
|
|
1963
1963
|
return getResponsiveCardRendererBridge()?.(gridElement, this);
|
|
@@ -1972,7 +1972,7 @@ class GridAdapter {
|
|
|
1972
1972
|
return undefined;
|
|
1973
1973
|
}
|
|
1974
1974
|
// Find the parent grid element for context
|
|
1975
|
-
const gridElement = element.closest('tbw-grid');
|
|
1975
|
+
const gridElement = element.closest('tbw-grid, [data-tbw-grid]');
|
|
1976
1976
|
return (container) => {
|
|
1977
1977
|
// Create the context for the template
|
|
1978
1978
|
const context = {
|
|
@@ -2376,7 +2376,7 @@ class GridAdapter {
|
|
|
2376
2376
|
*/
|
|
2377
2377
|
runEditorMountHooks(host) {
|
|
2378
2378
|
queueMicrotask(() => {
|
|
2379
|
-
const gridEl = host.closest('tbw-grid');
|
|
2379
|
+
const gridEl = host.closest('tbw-grid, [data-tbw-grid]');
|
|
2380
2380
|
if (!gridEl)
|
|
2381
2381
|
return;
|
|
2382
2382
|
this.editorMountTeardowns.set(host, notifyEditorMounted(host, gridEl));
|
|
@@ -2956,7 +2956,7 @@ class BaseGridEditor {
|
|
|
2956
2956
|
});
|
|
2957
2957
|
}
|
|
2958
2958
|
_initEditCloseListener() {
|
|
2959
|
-
const grid = this.elementRef.nativeElement.closest('tbw-grid');
|
|
2959
|
+
const grid = this.elementRef.nativeElement.closest('tbw-grid, [data-tbw-grid]');
|
|
2960
2960
|
if (!grid)
|
|
2961
2961
|
return;
|
|
2962
2962
|
let unsubBefore;
|
|
@@ -3687,7 +3687,7 @@ class BaseOverlayEditor extends BaseGridEditor {
|
|
|
3687
3687
|
}
|
|
3688
3688
|
/** Find the parent `<tbw-grid>` element for this editor. */
|
|
3689
3689
|
_getGridElement() {
|
|
3690
|
-
return this._elementRef.nativeElement.closest('tbw-grid') ?? null;
|
|
3690
|
+
return this._elementRef.nativeElement.closest('tbw-grid, [data-tbw-grid]') ?? null;
|
|
3691
3691
|
}
|
|
3692
3692
|
/**
|
|
3693
3693
|
* JS fallback positioning for browsers without CSS Anchor Positioning.
|
|
@@ -6275,6 +6275,11 @@ class Grid {
|
|
|
6275
6275
|
addPlugin('print', this.print());
|
|
6276
6276
|
addPlugin('pivot', this.pivot());
|
|
6277
6277
|
addPlugin('serverSide', this.serverSide());
|
|
6278
|
+
// `stickyRows` has no deprecated `Grid` input — `GridStickyRowsDirective`
|
|
6279
|
+
// is the only owner. Iterate it here so the directive's feature claim is
|
|
6280
|
+
// consulted; without this call the directive would set a claim that
|
|
6281
|
+
// nobody reads and `[stickyRows]` would silently do nothing.
|
|
6282
|
+
addPlugin('stickyRows', undefined);
|
|
6278
6283
|
addPlugin('tooltip', this.tooltip());
|
|
6279
6284
|
return plugins;
|
|
6280
6285
|
}
|