@toolbox-web/grid-angular 0.19.2 → 1.0.0-alpha
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/README.md +28 -27
- package/fesm2022/toolbox-web-grid-angular-features-clipboard.mjs.map +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.map +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-editing.mjs.map +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-export.mjs +14 -3
- package/fesm2022/toolbox-web-grid-angular-features-export.mjs.map +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-filtering.mjs +18 -3
- package/fesm2022/toolbox-web-grid-angular-features-filtering.mjs.map +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.map +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-master-detail.mjs.map +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.map +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-pinned-rows.mjs.map +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-pivot.mjs.map +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-print.mjs +14 -3
- package/fesm2022/toolbox-web-grid-angular-features-print.mjs.map +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.map +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-responsive.mjs.map +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-selection.mjs +32 -6
- package/fesm2022/toolbox-web-grid-angular-features-selection.mjs.map +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-server-side.mjs.map +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-tooltip.mjs.map +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-tree.mjs.map +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-undo-redo.mjs +30 -5
- package/fesm2022/toolbox-web-grid-angular-features-undo-redo.mjs.map +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-visibility.mjs.map +1 -1
- package/fesm2022/toolbox-web-grid-angular.mjs +89 -161
- package/fesm2022/toolbox-web-grid-angular.mjs.map +1 -1
- package/package.json +1 -13
- package/types/toolbox-web-grid-angular-features-clipboard.d.ts +1 -2
- package/types/toolbox-web-grid-angular-features-column-virtualization.d.ts +1 -2
- package/types/toolbox-web-grid-angular-features-context-menu.d.ts +1 -2
- package/types/toolbox-web-grid-angular-features-editing.d.ts +1 -2
- package/types/toolbox-web-grid-angular-features-export.d.ts +6 -1
- package/types/toolbox-web-grid-angular-features-export.d.ts.map +1 -1
- package/types/toolbox-web-grid-angular-features-filtering.d.ts +6 -1
- package/types/toolbox-web-grid-angular-features-filtering.d.ts.map +1 -1
- package/types/toolbox-web-grid-angular-features-grouping-columns.d.ts +1 -2
- package/types/toolbox-web-grid-angular-features-grouping-rows.d.ts +1 -2
- package/types/toolbox-web-grid-angular-features-master-detail.d.ts +1 -2
- package/types/toolbox-web-grid-angular-features-multi-sort.d.ts +1 -2
- package/types/toolbox-web-grid-angular-features-pinned-columns.d.ts +1 -2
- package/types/toolbox-web-grid-angular-features-pinned-rows.d.ts +1 -2
- package/types/toolbox-web-grid-angular-features-pivot.d.ts +1 -2
- package/types/toolbox-web-grid-angular-features-print.d.ts +6 -1
- package/types/toolbox-web-grid-angular-features-print.d.ts.map +1 -1
- package/types/toolbox-web-grid-angular-features-reorder-columns.d.ts +1 -2
- package/types/toolbox-web-grid-angular-features-reorder-rows.d.ts +1 -2
- package/types/toolbox-web-grid-angular-features-responsive.d.ts +1 -2
- package/types/toolbox-web-grid-angular-features-selection.d.ts +6 -1
- package/types/toolbox-web-grid-angular-features-selection.d.ts.map +1 -1
- package/types/toolbox-web-grid-angular-features-server-side.d.ts +1 -2
- package/types/toolbox-web-grid-angular-features-tooltip.d.ts +1 -2
- package/types/toolbox-web-grid-angular-features-tree.d.ts +1 -2
- package/types/toolbox-web-grid-angular-features-undo-redo.d.ts +6 -1
- package/types/toolbox-web-grid-angular-features-undo-redo.d.ts.map +1 -1
- package/types/toolbox-web-grid-angular-features-visibility.d.ts +1 -2
- package/types/toolbox-web-grid-angular.d.ts +84 -167
- package/types/toolbox-web-grid-angular.d.ts.map +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-reorder.mjs +0 -11
- package/fesm2022/toolbox-web-grid-angular-features-reorder.mjs.map +0 -1
- package/fesm2022/toolbox-web-grid-angular-features-row-reorder.mjs +0 -11
- package/fesm2022/toolbox-web-grid-angular-features-row-reorder.mjs.map +0 -1
- package/fesm2022/toolbox-web-grid-angular-features-sorting.mjs +0 -25
- package/fesm2022/toolbox-web-grid-angular-features-sorting.mjs.map +0 -1
- package/types/toolbox-web-grid-angular-features-reorder.d.ts +0 -3
- package/types/toolbox-web-grid-angular-features-reorder.d.ts.map +0 -1
- package/types/toolbox-web-grid-angular-features-row-reorder.d.ts +0 -3
- package/types/toolbox-web-grid-angular-features-row-reorder.d.ts.map +0 -1
- package/types/toolbox-web-grid-angular-features-sorting.d.ts +0 -3
- package/types/toolbox-web-grid-angular-features-sorting.d.ts.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, ElementRef, contentChild, TemplateRef, effect, Directive, input, DestroyRef, InjectionToken, Injectable, makeEnvironmentProviders,
|
|
2
|
+
import { inject, ElementRef, contentChild, TemplateRef, effect, Directive, input, DestroyRef, InjectionToken, Injectable, makeEnvironmentProviders, createComponent, signal, afterNextRender, computed, output, EnvironmentInjector, ApplicationRef, ViewContainerRef } from '@angular/core';
|
|
3
3
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
4
|
import { FormGroup } from '@angular/forms';
|
|
5
5
|
import { startWith, debounceTime } from 'rxjs/operators';
|
|
@@ -256,6 +256,17 @@ function getDetailConfig(gridElement) {
|
|
|
256
256
|
* })
|
|
257
257
|
* ```
|
|
258
258
|
*
|
|
259
|
+
* @example
|
|
260
|
+
* ```html
|
|
261
|
+
* <tbw-grid [rows]="rows" [gridConfig]="config">
|
|
262
|
+
* <tbw-grid-detail [showExpandColumn]="true" animation="slide">
|
|
263
|
+
* <ng-template let-row>
|
|
264
|
+
* <app-detail-panel [employee]="row" />
|
|
265
|
+
* </ng-template>
|
|
266
|
+
* </tbw-grid-detail>
|
|
267
|
+
* </tbw-grid>
|
|
268
|
+
* ```
|
|
269
|
+
*
|
|
259
270
|
* @category Directive
|
|
260
271
|
*/
|
|
261
272
|
class GridDetailView {
|
|
@@ -351,6 +362,13 @@ function getFormArrayContext(gridElement) {
|
|
|
351
362
|
* - Supports row-level validation state aggregation
|
|
352
363
|
* - Automatically syncs FormArray changes to the grid
|
|
353
364
|
*
|
|
365
|
+
* @example
|
|
366
|
+
* ```html
|
|
367
|
+
* <form [formGroup]="form">
|
|
368
|
+
* <tbw-grid [formArray]="form.controls.rows" [columns]="columns" />
|
|
369
|
+
* </form>
|
|
370
|
+
* ```
|
|
371
|
+
*
|
|
354
372
|
* @category Directive
|
|
355
373
|
*/
|
|
356
374
|
class GridFormArray {
|
|
@@ -911,6 +929,17 @@ function getToolPanelElements(gridElement) {
|
|
|
911
929
|
* })
|
|
912
930
|
* ```
|
|
913
931
|
*
|
|
932
|
+
* @example
|
|
933
|
+
* ```html
|
|
934
|
+
* <tbw-grid [rows]="rows">
|
|
935
|
+
* <tbw-grid-tool-panel id="quick-filters" title="Quick Filters" icon="\uD83D\uDD0D">
|
|
936
|
+
* <ng-template let-grid>
|
|
937
|
+
* <app-quick-filters [grid]="grid" />
|
|
938
|
+
* </ng-template>
|
|
939
|
+
* </tbw-grid-tool-panel>
|
|
940
|
+
* </tbw-grid>
|
|
941
|
+
* ```
|
|
942
|
+
*
|
|
914
943
|
* @category Directive
|
|
915
944
|
*/
|
|
916
945
|
class GridToolPanel {
|
|
@@ -1040,6 +1069,13 @@ function getStructuralEditorTemplate(columnElement) {
|
|
|
1040
1069
|
* })
|
|
1041
1070
|
* ```
|
|
1042
1071
|
*
|
|
1072
|
+
* @example
|
|
1073
|
+
* ```html
|
|
1074
|
+
* <tbw-grid-column field="status">
|
|
1075
|
+
* <app-status-badge *tbwRenderer="let value; row as row" [value]="value" />
|
|
1076
|
+
* </tbw-grid-column>
|
|
1077
|
+
* ```
|
|
1078
|
+
*
|
|
1043
1079
|
* @category Directive
|
|
1044
1080
|
*/
|
|
1045
1081
|
class TbwRenderer {
|
|
@@ -1129,6 +1165,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImpor
|
|
|
1129
1165
|
* })
|
|
1130
1166
|
* ```
|
|
1131
1167
|
*
|
|
1168
|
+
* @example
|
|
1169
|
+
* ```html
|
|
1170
|
+
* <tbw-grid-column field="status" editable>
|
|
1171
|
+
* <app-status-editor *tbwEditor="let value" [value]="value" />
|
|
1172
|
+
* </tbw-grid-column>
|
|
1173
|
+
* ```
|
|
1174
|
+
*
|
|
1132
1175
|
* @category Directive
|
|
1133
1176
|
*/
|
|
1134
1177
|
class TbwEditor {
|
|
@@ -1741,14 +1784,9 @@ class GridAdapter {
|
|
|
1741
1784
|
return undefined;
|
|
1742
1785
|
}
|
|
1743
1786
|
return (ctx) => {
|
|
1744
|
-
// Create simple callback functions
|
|
1787
|
+
// Create simple callback functions
|
|
1745
1788
|
const onCommit = (value) => ctx.commit(value);
|
|
1746
1789
|
const onCancel = () => ctx.cancel();
|
|
1747
|
-
// Create EventEmitters for backwards compatibility (deprecated)
|
|
1748
|
-
const commitEmitter = new EventEmitter();
|
|
1749
|
-
const cancelEmitter = new EventEmitter();
|
|
1750
|
-
commitEmitter.subscribe((value) => ctx.commit(value));
|
|
1751
|
-
cancelEmitter.subscribe(() => ctx.cancel());
|
|
1752
1790
|
// Try to get the FormControl from the FormArrayContext
|
|
1753
1791
|
let control;
|
|
1754
1792
|
if (gridElement) {
|
|
@@ -1772,16 +1810,12 @@ class GridAdapter {
|
|
|
1772
1810
|
field: ctx.field,
|
|
1773
1811
|
column: ctx.column,
|
|
1774
1812
|
rowId: ctx.rowId ?? '',
|
|
1775
|
-
// Preferred: simple callback functions
|
|
1776
1813
|
onCommit,
|
|
1777
1814
|
onCancel,
|
|
1778
1815
|
updateRow: ctx.updateRow,
|
|
1779
1816
|
onValueChange: ctx.onValueChange,
|
|
1780
1817
|
// FormControl from FormArray (if available)
|
|
1781
1818
|
control,
|
|
1782
|
-
// Deprecated: EventEmitters (for backwards compatibility)
|
|
1783
|
-
commit: commitEmitter,
|
|
1784
|
-
cancel: cancelEmitter,
|
|
1785
1819
|
};
|
|
1786
1820
|
// Create embedded view from template
|
|
1787
1821
|
const viewRef = this.viewContainerRef.createEmbeddedView(template, context);
|
|
@@ -2424,11 +2458,6 @@ class GridAdapter {
|
|
|
2424
2458
|
this.editorComponentRefs = [];
|
|
2425
2459
|
}
|
|
2426
2460
|
}
|
|
2427
|
-
/**
|
|
2428
|
-
* @deprecated Use `GridAdapter` instead. This alias will be removed in v2.
|
|
2429
|
-
* @see {@link GridAdapter}
|
|
2430
|
-
*/
|
|
2431
|
-
const AngularGridAdapter = GridAdapter;
|
|
2432
2461
|
|
|
2433
2462
|
/**
|
|
2434
2463
|
* Icon configuration registry for Angular applications.
|
|
@@ -2608,9 +2637,12 @@ function provideGridIcons(icons) {
|
|
|
2608
2637
|
* }
|
|
2609
2638
|
* ```
|
|
2610
2639
|
*
|
|
2640
|
+
* @param selector - Optional CSS selector to target a specific grid element.
|
|
2641
|
+
* Defaults to `'tbw-grid'` (first grid in the component). Use when the
|
|
2642
|
+
* component contains multiple grids, e.g. `'tbw-grid.primary'` or `'#my-grid'`.
|
|
2611
2643
|
* @returns Object with grid access methods and state signals
|
|
2612
2644
|
*/
|
|
2613
|
-
function injectGrid() {
|
|
2645
|
+
function injectGrid(selector = 'tbw-grid') {
|
|
2614
2646
|
const elementRef = inject(ElementRef);
|
|
2615
2647
|
// Reactive signals
|
|
2616
2648
|
const isReady = signal(false, ...(ngDevMode ? [{ debugName: "isReady" }] : /* istanbul ignore next */ []));
|
|
@@ -2618,7 +2650,7 @@ function injectGrid() {
|
|
|
2618
2650
|
const element = signal(null, ...(ngDevMode ? [{ debugName: "element" }] : /* istanbul ignore next */ []));
|
|
2619
2651
|
// Initialize after render
|
|
2620
2652
|
afterNextRender(() => {
|
|
2621
|
-
const gridElement = elementRef.nativeElement.querySelector(
|
|
2653
|
+
const gridElement = elementRef.nativeElement.querySelector(selector);
|
|
2622
2654
|
if (!gridElement) {
|
|
2623
2655
|
console.warn('[injectGrid] No tbw-grid element found in component');
|
|
2624
2656
|
return;
|
|
@@ -2669,92 +2701,6 @@ function injectGrid() {
|
|
|
2669
2701
|
const unregisterStyles = (id) => {
|
|
2670
2702
|
element()?.unregisterStyles?.(id);
|
|
2671
2703
|
};
|
|
2672
|
-
// ═══════════════════════════════════════════════════════════════════
|
|
2673
|
-
// SELECTION CONVENIENCE METHODS
|
|
2674
|
-
// ═══════════════════════════════════════════════════════════════════
|
|
2675
|
-
const selectAll = () => {
|
|
2676
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2677
|
-
const gridElement = element();
|
|
2678
|
-
const plugin = gridElement?.getPluginByName?.('selection');
|
|
2679
|
-
if (!plugin) {
|
|
2680
|
-
console.warn('[injectGrid] selectAll requires SelectionPlugin');
|
|
2681
|
-
return;
|
|
2682
|
-
}
|
|
2683
|
-
// Row mode: select all row indices
|
|
2684
|
-
if (plugin.config?.mode === 'row') {
|
|
2685
|
-
const rows = gridElement?.rows ?? [];
|
|
2686
|
-
const allIndices = new Set(rows.map((_, i) => i));
|
|
2687
|
-
plugin.selected = allIndices;
|
|
2688
|
-
plugin.requestAfterRender?.();
|
|
2689
|
-
}
|
|
2690
|
-
};
|
|
2691
|
-
const clearSelection = () => {
|
|
2692
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2693
|
-
const gridElement = element();
|
|
2694
|
-
const plugin = gridElement?.getPluginByName?.('selection');
|
|
2695
|
-
if (!plugin)
|
|
2696
|
-
return;
|
|
2697
|
-
const mode = plugin.config?.mode;
|
|
2698
|
-
if (mode === 'row') {
|
|
2699
|
-
plugin.selected = new Set();
|
|
2700
|
-
}
|
|
2701
|
-
else if (mode === 'range' || mode === 'cell') {
|
|
2702
|
-
plugin.ranges = [];
|
|
2703
|
-
}
|
|
2704
|
-
plugin.requestAfterRender?.();
|
|
2705
|
-
};
|
|
2706
|
-
const getSelectedIndices = () => {
|
|
2707
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2708
|
-
const gridElement = element();
|
|
2709
|
-
const plugin = gridElement?.getPluginByName?.('selection');
|
|
2710
|
-
if (!plugin)
|
|
2711
|
-
return new Set();
|
|
2712
|
-
if (plugin.config?.mode === 'row') {
|
|
2713
|
-
return new Set(plugin.selected ?? []);
|
|
2714
|
-
}
|
|
2715
|
-
// Range/cell mode: extract unique row indices from ranges
|
|
2716
|
-
const ranges = plugin.ranges ?? [];
|
|
2717
|
-
const indices = new Set();
|
|
2718
|
-
for (const range of ranges) {
|
|
2719
|
-
for (let r = range.startRow; r <= range.endRow; r++) {
|
|
2720
|
-
indices.add(r);
|
|
2721
|
-
}
|
|
2722
|
-
}
|
|
2723
|
-
return indices;
|
|
2724
|
-
};
|
|
2725
|
-
const getSelectedRows = () => {
|
|
2726
|
-
const gridElement = element();
|
|
2727
|
-
if (!gridElement)
|
|
2728
|
-
return [];
|
|
2729
|
-
const rows = gridElement.rows ?? [];
|
|
2730
|
-
const indices = getSelectedIndices();
|
|
2731
|
-
return Array.from(indices)
|
|
2732
|
-
.filter((i) => i >= 0 && i < rows.length)
|
|
2733
|
-
.map((i) => rows[i]);
|
|
2734
|
-
};
|
|
2735
|
-
// ═══════════════════════════════════════════════════════════════════
|
|
2736
|
-
// EXPORT CONVENIENCE METHODS
|
|
2737
|
-
// ═══════════════════════════════════════════════════════════════════
|
|
2738
|
-
const exportToCsv = (filename) => {
|
|
2739
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2740
|
-
const gridElement = element();
|
|
2741
|
-
const plugin = gridElement?.getPluginByName?.('export');
|
|
2742
|
-
if (!plugin) {
|
|
2743
|
-
console.warn('[injectGrid] exportToCsv requires ExportPlugin');
|
|
2744
|
-
return;
|
|
2745
|
-
}
|
|
2746
|
-
plugin.exportToCsv?.(filename);
|
|
2747
|
-
};
|
|
2748
|
-
const exportToJson = (filename) => {
|
|
2749
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2750
|
-
const gridElement = element();
|
|
2751
|
-
const plugin = gridElement?.getPluginByName?.('export');
|
|
2752
|
-
if (!plugin) {
|
|
2753
|
-
console.warn('[injectGrid] exportToJson requires ExportPlugin');
|
|
2754
|
-
return;
|
|
2755
|
-
}
|
|
2756
|
-
plugin.exportToJson?.(filename);
|
|
2757
|
-
};
|
|
2758
2704
|
return {
|
|
2759
2705
|
element,
|
|
2760
2706
|
isReady,
|
|
@@ -2765,12 +2711,6 @@ function injectGrid() {
|
|
|
2765
2711
|
toggleGroup,
|
|
2766
2712
|
registerStyles,
|
|
2767
2713
|
unregisterStyles,
|
|
2768
|
-
selectAll,
|
|
2769
|
-
clearSelection,
|
|
2770
|
-
getSelectedIndices,
|
|
2771
|
-
getSelectedRows,
|
|
2772
|
-
exportToCsv,
|
|
2773
|
-
exportToJson,
|
|
2774
2714
|
};
|
|
2775
2715
|
}
|
|
2776
2716
|
|
|
@@ -3471,6 +3411,31 @@ let anchorCounter = 0;
|
|
|
3471
3411
|
* }
|
|
3472
3412
|
* ```
|
|
3473
3413
|
*
|
|
3414
|
+
* @example
|
|
3415
|
+
* ```typescript
|
|
3416
|
+
* @Component({
|
|
3417
|
+
* template: `
|
|
3418
|
+
* <input #inlineInput readonly [value]="currentValue()"
|
|
3419
|
+
* (click)="onInlineClick()" (keydown)="onInlineKeydown($event)" />
|
|
3420
|
+
* <div #panel style="width: 280px">
|
|
3421
|
+
* <!-- overlay content -->
|
|
3422
|
+
* </div>
|
|
3423
|
+
* `
|
|
3424
|
+
* })
|
|
3425
|
+
* export class MyEditor extends BaseOverlayEditor<MyRow, string> {
|
|
3426
|
+
* panelRef = viewChild.required<ElementRef<HTMLElement>>('panel');
|
|
3427
|
+
* inputRef = viewChild.required<ElementRef<HTMLInputElement>>('inlineInput');
|
|
3428
|
+
*
|
|
3429
|
+
* constructor() {
|
|
3430
|
+
* super();
|
|
3431
|
+
* effect(() => this.initOverlay(this.panelRef().nativeElement));
|
|
3432
|
+
* }
|
|
3433
|
+
*
|
|
3434
|
+
* protected getInlineInput() { return this.inputRef()?.nativeElement ?? null; }
|
|
3435
|
+
* protected onOverlayOutsideClick() { this.hideOverlay(); }
|
|
3436
|
+
* }
|
|
3437
|
+
* ```
|
|
3438
|
+
*
|
|
3474
3439
|
* @typeParam TRow - The row data type
|
|
3475
3440
|
* @typeParam TValue - The cell value type
|
|
3476
3441
|
*/
|
|
@@ -4035,6 +4000,11 @@ function getLazyFormContext(gridElement) {
|
|
|
4035
4000
|
* | 500 | 10,000 controls | ~20 controls |
|
|
4036
4001
|
* | 1000 | 20,000 controls | ~20 controls |
|
|
4037
4002
|
*
|
|
4003
|
+
* @example
|
|
4004
|
+
* ```html
|
|
4005
|
+
* <tbw-grid [rows]="employees()" [lazyForm]="createRowForm" [gridConfig]="gridConfig" />
|
|
4006
|
+
* ```
|
|
4007
|
+
*
|
|
4038
4008
|
* @see GridFormArray For small datasets with full upfront validation
|
|
4039
4009
|
* @category Directive
|
|
4040
4010
|
*/
|
|
@@ -4518,15 +4488,8 @@ class Grid {
|
|
|
4518
4488
|
// Effect to process gridConfig and apply to grid
|
|
4519
4489
|
// This merges feature input plugins with the user's config plugins
|
|
4520
4490
|
effect(() => {
|
|
4521
|
-
const deprecatedAngularConfig = this.angularConfig();
|
|
4522
4491
|
const userGridConfig = this.gridConfig();
|
|
4523
|
-
|
|
4524
|
-
if (deprecatedAngularConfig && !userGridConfig) {
|
|
4525
|
-
console.warn('[tbw-grid] The [angularConfig] input is deprecated. Use [gridConfig] instead. ' +
|
|
4526
|
-
'The gridConfig input now accepts GridConfig directly.');
|
|
4527
|
-
}
|
|
4528
|
-
// Use gridConfig preferentially, fall back to deprecated angularConfig
|
|
4529
|
-
const angularCfg = userGridConfig ?? deprecatedAngularConfig;
|
|
4492
|
+
const angularCfg = userGridConfig;
|
|
4530
4493
|
if (!this.adapter)
|
|
4531
4494
|
return;
|
|
4532
4495
|
// Create plugins from feature inputs
|
|
@@ -4805,22 +4768,6 @@ class Grid {
|
|
|
4805
4768
|
*/
|
|
4806
4769
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4807
4770
|
gridConfig = input(...(ngDevMode ? [undefined, { debugName: "gridConfig" }] : /* istanbul ignore next */ []));
|
|
4808
|
-
/**
|
|
4809
|
-
* @deprecated Use `gridConfig` instead. This input will be removed in v2.
|
|
4810
|
-
*
|
|
4811
|
-
* The `angularConfig` name was inconsistent with React and Vue adapters, which both use `gridConfig`.
|
|
4812
|
-
* The `gridConfig` input now accepts `GridConfig` directly.
|
|
4813
|
-
*
|
|
4814
|
-
* ```html
|
|
4815
|
-
* <!-- Before -->
|
|
4816
|
-
* <tbw-grid [angularConfig]="config" />
|
|
4817
|
-
*
|
|
4818
|
-
* <!-- After -->
|
|
4819
|
-
* <tbw-grid [gridConfig]="config" />
|
|
4820
|
-
* ```
|
|
4821
|
-
*/
|
|
4822
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4823
|
-
angularConfig = input(...(ngDevMode ? [undefined, { debugName: "angularConfig" }] : /* istanbul ignore next */ []));
|
|
4824
4771
|
// ═══════════════════════════════════════════════════════════════════════════
|
|
4825
4772
|
// FEATURE INPUTS - Declarative plugin configuration
|
|
4826
4773
|
// ═══════════════════════════════════════════════════════════════════════════
|
|
@@ -4918,17 +4865,6 @@ class Grid {
|
|
|
4918
4865
|
* ```
|
|
4919
4866
|
*/
|
|
4920
4867
|
multiSort = input(...(ngDevMode ? [undefined, { debugName: "multiSort" }] : /* istanbul ignore next */ []));
|
|
4921
|
-
/**
|
|
4922
|
-
* @deprecated Use `[multiSort]` instead. Will be removed in v2.
|
|
4923
|
-
*
|
|
4924
|
-
* Enable column sorting. This is an alias for `[multiSort]`.
|
|
4925
|
-
*
|
|
4926
|
-
* **Requires feature import:**
|
|
4927
|
-
* ```typescript
|
|
4928
|
-
* import '@toolbox-web/grid-angular/features/multi-sort';
|
|
4929
|
-
* ```
|
|
4930
|
-
*/
|
|
4931
|
-
sorting = input(...(ngDevMode ? [undefined, { debugName: "sorting" }] : /* istanbul ignore next */ []));
|
|
4932
4868
|
/**
|
|
4933
4869
|
* Enable column filtering.
|
|
4934
4870
|
*
|
|
@@ -4959,10 +4895,6 @@ class Grid {
|
|
|
4959
4895
|
* ```
|
|
4960
4896
|
*/
|
|
4961
4897
|
reorderColumns = input(...(ngDevMode ? [undefined, { debugName: "reorderColumns" }] : /* istanbul ignore next */ []));
|
|
4962
|
-
/**
|
|
4963
|
-
* @deprecated Use `reorderColumns` instead. Will be removed in v2.
|
|
4964
|
-
*/
|
|
4965
|
-
reorder = input(...(ngDevMode ? [undefined, { debugName: "reorder" }] : /* istanbul ignore next */ []));
|
|
4966
4898
|
/**
|
|
4967
4899
|
* Enable column visibility toggle panel.
|
|
4968
4900
|
*
|
|
@@ -5038,10 +4970,6 @@ class Grid {
|
|
|
5038
4970
|
* ```
|
|
5039
4971
|
*/
|
|
5040
4972
|
reorderRows = input(...(ngDevMode ? [undefined, { debugName: "reorderRows" }] : /* istanbul ignore next */ []));
|
|
5041
|
-
/**
|
|
5042
|
-
* @deprecated Use `reorderRows` instead. Will be removed in v2.0.
|
|
5043
|
-
*/
|
|
5044
|
-
rowReorder = input(...(ngDevMode ? [undefined, { debugName: "rowReorder" }] : /* istanbul ignore next */ []));
|
|
5045
4973
|
/**
|
|
5046
4974
|
* Enable row grouping by field values.
|
|
5047
4975
|
*
|
|
@@ -5515,10 +5443,10 @@ class Grid {
|
|
|
5515
5443
|
addPlugin('editing', this.editing());
|
|
5516
5444
|
addPlugin('clipboard', this.clipboard());
|
|
5517
5445
|
addPlugin('contextMenu', this.contextMenu());
|
|
5518
|
-
// multiSort is the primary input
|
|
5519
|
-
addPlugin('multiSort', this.multiSort()
|
|
5446
|
+
// multiSort is the primary input
|
|
5447
|
+
addPlugin('multiSort', this.multiSort());
|
|
5520
5448
|
addPlugin('filtering', this.filtering());
|
|
5521
|
-
addPlugin('reorderColumns', this.reorderColumns()
|
|
5449
|
+
addPlugin('reorderColumns', this.reorderColumns());
|
|
5522
5450
|
addPlugin('visibility', this.visibility());
|
|
5523
5451
|
addPlugin('pinnedColumns', this.pinnedColumns());
|
|
5524
5452
|
// Pre-process groupingColumns config to bridge Angular component classes
|
|
@@ -5530,7 +5458,7 @@ class Grid {
|
|
|
5530
5458
|
addPlugin('groupingColumns', gcConfig);
|
|
5531
5459
|
}
|
|
5532
5460
|
addPlugin('columnVirtualization', this.columnVirtualization());
|
|
5533
|
-
addPlugin('reorderRows', this.reorderRows()
|
|
5461
|
+
addPlugin('reorderRows', this.reorderRows());
|
|
5534
5462
|
// Pre-process groupingRows config to bridge Angular component classes
|
|
5535
5463
|
const grConfig = this.groupingRows();
|
|
5536
5464
|
if (grConfig && typeof grConfig === 'object' && this.adapter) {
|
|
@@ -5692,12 +5620,12 @@ class Grid {
|
|
|
5692
5620
|
}
|
|
5693
5621
|
}
|
|
5694
5622
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: Grid, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
5695
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.5", type: Grid, isStandalone: true, selector: "tbw-grid", inputs: { customStyles: { classPropertyName: "customStyles", publicName: "customStyles", isSignal: true, isRequired: false, transformFunction: null }, sortable: { classPropertyName: "sortable", publicName: "sortable", isSignal: true, isRequired: false, transformFunction: null }, filterable: { classPropertyName: "filterable", publicName: "filterable", isSignal: true, isRequired: false, transformFunction: null }, selectable: { classPropertyName: "selectable", publicName: "selectable", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, fitMode: { classPropertyName: "fitMode", publicName: "fitMode", isSignal: true, isRequired: false, transformFunction: null }, gridConfig: { classPropertyName: "gridConfig", publicName: "gridConfig", isSignal: true, isRequired: false, transformFunction: null },
|
|
5623
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.5", type: Grid, isStandalone: true, selector: "tbw-grid", inputs: { customStyles: { classPropertyName: "customStyles", publicName: "customStyles", isSignal: true, isRequired: false, transformFunction: null }, sortable: { classPropertyName: "sortable", publicName: "sortable", isSignal: true, isRequired: false, transformFunction: null }, filterable: { classPropertyName: "filterable", publicName: "filterable", isSignal: true, isRequired: false, transformFunction: null }, selectable: { classPropertyName: "selectable", publicName: "selectable", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, fitMode: { classPropertyName: "fitMode", publicName: "fitMode", isSignal: true, isRequired: false, transformFunction: null }, gridConfig: { classPropertyName: "gridConfig", publicName: "gridConfig", isSignal: true, isRequired: false, transformFunction: null }, selection: { classPropertyName: "selection", publicName: "selection", isSignal: true, isRequired: false, transformFunction: null }, editing: { classPropertyName: "editing", publicName: "editing", isSignal: true, isRequired: false, transformFunction: null }, clipboard: { classPropertyName: "clipboard", publicName: "clipboard", isSignal: true, isRequired: false, transformFunction: null }, contextMenu: { classPropertyName: "contextMenu", publicName: "contextMenu", isSignal: true, isRequired: false, transformFunction: null }, multiSort: { classPropertyName: "multiSort", publicName: "multiSort", isSignal: true, isRequired: false, transformFunction: null }, filtering: { classPropertyName: "filtering", publicName: "filtering", isSignal: true, isRequired: false, transformFunction: null }, reorderColumns: { classPropertyName: "reorderColumns", publicName: "reorderColumns", isSignal: true, isRequired: false, transformFunction: null }, visibility: { classPropertyName: "visibility", publicName: "visibility", isSignal: true, isRequired: false, transformFunction: null }, pinnedColumns: { classPropertyName: "pinnedColumns", publicName: "pinnedColumns", isSignal: true, isRequired: false, transformFunction: null }, groupingColumns: { classPropertyName: "groupingColumns", publicName: "groupingColumns", isSignal: true, isRequired: false, transformFunction: null }, columnVirtualization: { classPropertyName: "columnVirtualization", publicName: "columnVirtualization", isSignal: true, isRequired: false, transformFunction: null }, reorderRows: { classPropertyName: "reorderRows", publicName: "reorderRows", isSignal: true, isRequired: false, transformFunction: null }, groupingRows: { classPropertyName: "groupingRows", publicName: "groupingRows", isSignal: true, isRequired: false, transformFunction: null }, pinnedRows: { classPropertyName: "pinnedRows", publicName: "pinnedRows", isSignal: true, isRequired: false, transformFunction: null }, tree: { classPropertyName: "tree", publicName: "tree", isSignal: true, isRequired: false, transformFunction: null }, masterDetail: { classPropertyName: "masterDetail", publicName: "masterDetail", isSignal: true, isRequired: false, transformFunction: null }, responsive: { classPropertyName: "responsive", publicName: "responsive", isSignal: true, isRequired: false, transformFunction: null }, undoRedo: { classPropertyName: "undoRedo", publicName: "undoRedo", isSignal: true, isRequired: false, transformFunction: null }, exportFeature: { classPropertyName: "exportFeature", publicName: "export", isSignal: true, isRequired: false, transformFunction: null }, print: { classPropertyName: "print", publicName: "print", isSignal: true, isRequired: false, transformFunction: null }, pivot: { classPropertyName: "pivot", publicName: "pivot", isSignal: true, isRequired: false, transformFunction: null }, serverSide: { classPropertyName: "serverSide", publicName: "serverSide", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { cellClick: "cellClick", rowClick: "rowClick", cellActivate: "cellActivate", cellChange: "cellChange", cellCommit: "cellCommit", rowCommit: "rowCommit", changedRowsReset: "changedRowsReset", sortChange: "sortChange", filterChange: "filterChange", columnResize: "columnResize", columnMove: "columnMove", columnVisibility: "columnVisibility", columnStateChange: "columnStateChange", selectionChange: "selectionChange", rowMove: "rowMove", groupToggle: "groupToggle", treeExpand: "treeExpand", detailExpand: "detailExpand", responsiveChange: "responsiveChange", copy: "copy", paste: "paste", undoRedoAction: "undoRedoAction", exportComplete: "exportComplete", printStart: "printStart", printComplete: "printComplete" }, ngImport: i0 });
|
|
5696
5624
|
}
|
|
5697
5625
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: Grid, decorators: [{
|
|
5698
5626
|
type: Directive,
|
|
5699
5627
|
args: [{ selector: 'tbw-grid' }]
|
|
5700
|
-
}], ctorParameters: () => [], propDecorators: { customStyles: [{ type: i0.Input, args: [{ isSignal: true, alias: "customStyles", required: false }] }], sortable: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortable", required: false }] }], filterable: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterable", required: false }] }], selectable: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectable", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], rows: [{ type: i0.Input, args: [{ isSignal: true, alias: "rows", required: false }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], fitMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "fitMode", required: false }] }], gridConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "gridConfig", required: false }] }],
|
|
5628
|
+
}], ctorParameters: () => [], propDecorators: { customStyles: [{ type: i0.Input, args: [{ isSignal: true, alias: "customStyles", required: false }] }], sortable: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortable", required: false }] }], filterable: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterable", required: false }] }], selectable: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectable", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], rows: [{ type: i0.Input, args: [{ isSignal: true, alias: "rows", required: false }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], fitMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "fitMode", required: false }] }], gridConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "gridConfig", required: false }] }], selection: [{ type: i0.Input, args: [{ isSignal: true, alias: "selection", required: false }] }], editing: [{ type: i0.Input, args: [{ isSignal: true, alias: "editing", required: false }] }], clipboard: [{ type: i0.Input, args: [{ isSignal: true, alias: "clipboard", required: false }] }], contextMenu: [{ type: i0.Input, args: [{ isSignal: true, alias: "contextMenu", required: false }] }], multiSort: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiSort", required: false }] }], filtering: [{ type: i0.Input, args: [{ isSignal: true, alias: "filtering", required: false }] }], reorderColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "reorderColumns", required: false }] }], visibility: [{ type: i0.Input, args: [{ isSignal: true, alias: "visibility", required: false }] }], pinnedColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "pinnedColumns", required: false }] }], groupingColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupingColumns", required: false }] }], columnVirtualization: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnVirtualization", required: false }] }], reorderRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "reorderRows", required: false }] }], groupingRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupingRows", required: false }] }], pinnedRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "pinnedRows", required: false }] }], tree: [{ type: i0.Input, args: [{ isSignal: true, alias: "tree", required: false }] }], masterDetail: [{ type: i0.Input, args: [{ isSignal: true, alias: "masterDetail", required: false }] }], responsive: [{ type: i0.Input, args: [{ isSignal: true, alias: "responsive", required: false }] }], undoRedo: [{ type: i0.Input, args: [{ isSignal: true, alias: "undoRedo", required: false }] }], exportFeature: [{ type: i0.Input, args: [{ isSignal: true, alias: "export", required: false }] }], print: [{ type: i0.Input, args: [{ isSignal: true, alias: "print", required: false }] }], pivot: [{ type: i0.Input, args: [{ isSignal: true, alias: "pivot", required: false }] }], serverSide: [{ type: i0.Input, args: [{ isSignal: true, alias: "serverSide", required: false }] }], tooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip", required: false }] }], cellClick: [{ type: i0.Output, args: ["cellClick"] }], rowClick: [{ type: i0.Output, args: ["rowClick"] }], cellActivate: [{ type: i0.Output, args: ["cellActivate"] }], cellChange: [{ type: i0.Output, args: ["cellChange"] }], cellCommit: [{ type: i0.Output, args: ["cellCommit"] }], rowCommit: [{ type: i0.Output, args: ["rowCommit"] }], changedRowsReset: [{ type: i0.Output, args: ["changedRowsReset"] }], sortChange: [{ type: i0.Output, args: ["sortChange"] }], filterChange: [{ type: i0.Output, args: ["filterChange"] }], columnResize: [{ type: i0.Output, args: ["columnResize"] }], columnMove: [{ type: i0.Output, args: ["columnMove"] }], columnVisibility: [{ type: i0.Output, args: ["columnVisibility"] }], columnStateChange: [{ type: i0.Output, args: ["columnStateChange"] }], selectionChange: [{ type: i0.Output, args: ["selectionChange"] }], rowMove: [{ type: i0.Output, args: ["rowMove"] }], groupToggle: [{ type: i0.Output, args: ["groupToggle"] }], treeExpand: [{ type: i0.Output, args: ["treeExpand"] }], detailExpand: [{ type: i0.Output, args: ["detailExpand"] }], responsiveChange: [{ type: i0.Output, args: ["responsiveChange"] }], copy: [{ type: i0.Output, args: ["copy"] }], paste: [{ type: i0.Output, args: ["paste"] }], undoRedoAction: [{ type: i0.Output, args: ["undoRedoAction"] }], exportComplete: [{ type: i0.Output, args: ["exportComplete"] }], printStart: [{ type: i0.Output, args: ["printStart"] }], printComplete: [{ type: i0.Output, args: ["printComplete"] }] } });
|
|
5701
5629
|
|
|
5702
5630
|
/**
|
|
5703
5631
|
* @packageDocumentation
|
|
@@ -5705,11 +5633,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImpor
|
|
|
5705
5633
|
*
|
|
5706
5634
|
* Provides directives for seamless Angular integration with the grid component.
|
|
5707
5635
|
*/
|
|
5708
|
-
// Primary export
|
|
5636
|
+
// Primary export
|
|
5709
5637
|
|
|
5710
5638
|
/**
|
|
5711
5639
|
* Generated bundle index. Do not edit.
|
|
5712
5640
|
*/
|
|
5713
5641
|
|
|
5714
|
-
export {
|
|
5642
|
+
export { BaseFilterPanel, BaseGridEditor, BaseGridEditorCVA, BaseOverlayEditor, GRID_ICONS, GRID_TYPE_DEFAULTS, Grid, GridAdapter, GridColumnEditor, GridColumnView, GridDetailView, GridFormArray, GridIconRegistry, GridLazyForm, GridResponsiveCard, GridToolPanel, GridTypeRegistry, TbwEditor, TbwGridColumn, TbwGridHeader, TbwGridToolButtons, TbwRenderer, getFormArrayContext, getLazyFormContext, injectGrid, isComponentClass, provideGridIcons, provideGridTypeDefaults };
|
|
5715
5643
|
//# sourceMappingURL=toolbox-web-grid-angular.mjs.map
|