@toolbox-web/grid-angular 0.7.0 → 0.7.2
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 +30 -0
- package/fesm2022/toolbox-web-grid-angular-features-clipboard.mjs.map +1 -0
- package/fesm2022/toolbox-web-grid-angular-features-column-virtualization.mjs +28 -0
- package/fesm2022/toolbox-web-grid-angular-features-column-virtualization.mjs.map +1 -0
- package/fesm2022/toolbox-web-grid-angular-features-context-menu.mjs +28 -0
- package/fesm2022/toolbox-web-grid-angular-features-context-menu.mjs.map +1 -0
- package/fesm2022/toolbox-web-grid-angular-features-editing.mjs +33 -0
- package/fesm2022/toolbox-web-grid-angular-features-editing.mjs.map +1 -0
- package/fesm2022/toolbox-web-grid-angular-features-export.mjs +29 -0
- package/fesm2022/toolbox-web-grid-angular-features-export.mjs.map +1 -0
- package/fesm2022/toolbox-web-grid-angular-features-filtering.mjs +29 -0
- package/fesm2022/toolbox-web-grid-angular-features-filtering.mjs.map +1 -0
- package/fesm2022/toolbox-web-grid-angular-features-grouping-columns.mjs +28 -0
- package/fesm2022/toolbox-web-grid-angular-features-grouping-columns.mjs.map +1 -0
- package/fesm2022/toolbox-web-grid-angular-features-grouping-rows.mjs +25 -0
- package/fesm2022/toolbox-web-grid-angular-features-grouping-rows.mjs.map +1 -0
- package/fesm2022/toolbox-web-grid-angular-features-master-detail.mjs +25 -0
- package/fesm2022/toolbox-web-grid-angular-features-master-detail.mjs.map +1 -0
- package/fesm2022/toolbox-web-grid-angular-features-multi-sort.mjs +40 -0
- package/fesm2022/toolbox-web-grid-angular-features-multi-sort.mjs.map +1 -0
- package/{features/pinned-columns.d.ts → fesm2022/toolbox-web-grid-angular-features-pinned-columns.mjs} +11 -2
- package/fesm2022/toolbox-web-grid-angular-features-pinned-columns.mjs.map +1 -0
- package/fesm2022/toolbox-web-grid-angular-features-pinned-rows.mjs +28 -0
- package/fesm2022/toolbox-web-grid-angular-features-pinned-rows.mjs.map +1 -0
- package/fesm2022/toolbox-web-grid-angular-features-pivot.mjs +25 -0
- package/fesm2022/toolbox-web-grid-angular-features-pivot.mjs.map +1 -0
- package/fesm2022/toolbox-web-grid-angular-features-print.mjs +28 -0
- package/fesm2022/toolbox-web-grid-angular-features-print.mjs.map +1 -0
- package/fesm2022/toolbox-web-grid-angular-features-reorder.mjs +28 -0
- package/fesm2022/toolbox-web-grid-angular-features-reorder.mjs.map +1 -0
- package/fesm2022/toolbox-web-grid-angular-features-responsive.mjs +28 -0
- package/fesm2022/toolbox-web-grid-angular-features-responsive.mjs.map +1 -0
- package/fesm2022/toolbox-web-grid-angular-features-row-reorder.mjs +28 -0
- package/fesm2022/toolbox-web-grid-angular-features-row-reorder.mjs.map +1 -0
- package/fesm2022/toolbox-web-grid-angular-features-selection.mjs +30 -0
- package/fesm2022/toolbox-web-grid-angular-features-selection.mjs.map +1 -0
- package/fesm2022/toolbox-web-grid-angular-features-server-side.mjs +25 -0
- package/fesm2022/toolbox-web-grid-angular-features-server-side.mjs.map +1 -0
- package/fesm2022/toolbox-web-grid-angular-features-sorting.mjs +25 -0
- package/fesm2022/toolbox-web-grid-angular-features-sorting.mjs.map +1 -0
- package/fesm2022/toolbox-web-grid-angular-features-tree.mjs +28 -0
- package/fesm2022/toolbox-web-grid-angular-features-tree.mjs.map +1 -0
- package/fesm2022/toolbox-web-grid-angular-features-undo-redo.mjs +30 -0
- package/fesm2022/toolbox-web-grid-angular-features-undo-redo.mjs.map +1 -0
- package/fesm2022/toolbox-web-grid-angular-features-visibility.mjs +28 -0
- package/fesm2022/toolbox-web-grid-angular-features-visibility.mjs.map +1 -0
- package/fesm2022/toolbox-web-grid-angular.mjs +3189 -0
- package/fesm2022/toolbox-web-grid-angular.mjs.map +1 -0
- package/package.json +109 -35
- package/types/toolbox-web-grid-angular-features-clipboard.d.ts +3 -0
- package/types/toolbox-web-grid-angular-features-clipboard.d.ts.map +1 -0
- package/types/toolbox-web-grid-angular-features-column-virtualization.d.ts +3 -0
- package/types/toolbox-web-grid-angular-features-column-virtualization.d.ts.map +1 -0
- package/types/toolbox-web-grid-angular-features-context-menu.d.ts +3 -0
- package/types/toolbox-web-grid-angular-features-context-menu.d.ts.map +1 -0
- package/types/toolbox-web-grid-angular-features-editing.d.ts +3 -0
- package/types/toolbox-web-grid-angular-features-editing.d.ts.map +1 -0
- package/types/toolbox-web-grid-angular-features-export.d.ts +3 -0
- package/types/toolbox-web-grid-angular-features-export.d.ts.map +1 -0
- package/types/toolbox-web-grid-angular-features-filtering.d.ts +3 -0
- package/types/toolbox-web-grid-angular-features-filtering.d.ts.map +1 -0
- package/types/toolbox-web-grid-angular-features-grouping-columns.d.ts +3 -0
- package/types/toolbox-web-grid-angular-features-grouping-columns.d.ts.map +1 -0
- package/types/toolbox-web-grid-angular-features-grouping-rows.d.ts +3 -0
- package/types/toolbox-web-grid-angular-features-grouping-rows.d.ts.map +1 -0
- package/types/toolbox-web-grid-angular-features-master-detail.d.ts +3 -0
- package/types/toolbox-web-grid-angular-features-master-detail.d.ts.map +1 -0
- package/types/toolbox-web-grid-angular-features-multi-sort.d.ts +3 -0
- package/types/toolbox-web-grid-angular-features-multi-sort.d.ts.map +1 -0
- package/types/toolbox-web-grid-angular-features-pinned-columns.d.ts +3 -0
- package/types/toolbox-web-grid-angular-features-pinned-columns.d.ts.map +1 -0
- package/types/toolbox-web-grid-angular-features-pinned-rows.d.ts +3 -0
- package/types/toolbox-web-grid-angular-features-pinned-rows.d.ts.map +1 -0
- package/types/toolbox-web-grid-angular-features-pivot.d.ts +3 -0
- package/types/toolbox-web-grid-angular-features-pivot.d.ts.map +1 -0
- package/types/toolbox-web-grid-angular-features-print.d.ts +3 -0
- package/types/toolbox-web-grid-angular-features-print.d.ts.map +1 -0
- package/types/toolbox-web-grid-angular-features-reorder.d.ts +3 -0
- package/types/toolbox-web-grid-angular-features-reorder.d.ts.map +1 -0
- package/types/toolbox-web-grid-angular-features-responsive.d.ts +3 -0
- package/types/toolbox-web-grid-angular-features-responsive.d.ts.map +1 -0
- package/types/toolbox-web-grid-angular-features-row-reorder.d.ts +3 -0
- package/types/toolbox-web-grid-angular-features-row-reorder.d.ts.map +1 -0
- package/types/toolbox-web-grid-angular-features-selection.d.ts +3 -0
- package/types/toolbox-web-grid-angular-features-selection.d.ts.map +1 -0
- package/types/toolbox-web-grid-angular-features-server-side.d.ts +3 -0
- package/types/toolbox-web-grid-angular-features-server-side.d.ts.map +1 -0
- package/types/toolbox-web-grid-angular-features-sorting.d.ts +3 -0
- package/types/toolbox-web-grid-angular-features-sorting.d.ts.map +1 -0
- package/types/toolbox-web-grid-angular-features-tree.d.ts +3 -0
- package/types/toolbox-web-grid-angular-features-tree.d.ts.map +1 -0
- package/types/toolbox-web-grid-angular-features-undo-redo.d.ts +3 -0
- package/types/toolbox-web-grid-angular-features-undo-redo.d.ts.map +1 -0
- package/types/toolbox-web-grid-angular-features-visibility.d.ts +3 -0
- package/types/toolbox-web-grid-angular-features-visibility.d.ts.map +1 -0
- package/types/toolbox-web-grid-angular.d.ts +2325 -0
- package/types/toolbox-web-grid-angular.d.ts.map +1 -0
- package/feature-registry-C-cKloXB.js +0 -45
- package/features/clipboard.d.ts +0 -18
- package/features/clipboard.d.ts.map +0 -1
- package/features/clipboard.js +0 -3
- package/features/column-virtualization.d.ts +0 -16
- package/features/column-virtualization.d.ts.map +0 -1
- package/features/column-virtualization.js +0 -3
- package/features/context-menu.d.ts +0 -16
- package/features/context-menu.d.ts.map +0 -1
- package/features/context-menu.js +0 -3
- package/features/editing.d.ts +0 -16
- package/features/editing.d.ts.map +0 -1
- package/features/editing.js +0 -3
- package/features/export.d.ts +0 -17
- package/features/export.d.ts.map +0 -1
- package/features/export.js +0 -3
- package/features/filtering.d.ts +0 -17
- package/features/filtering.d.ts.map +0 -1
- package/features/filtering.js +0 -3
- package/features/grouping-columns.d.ts +0 -16
- package/features/grouping-columns.d.ts.map +0 -1
- package/features/grouping-columns.js +0 -3
- package/features/grouping-rows.d.ts +0 -16
- package/features/grouping-rows.d.ts.map +0 -1
- package/features/grouping-rows.js +0 -3
- package/features/index.d.ts +0 -1
- package/features/index.d.ts.map +0 -1
- package/features/index.js +0 -22
- package/features/master-detail.d.ts +0 -16
- package/features/master-detail.d.ts.map +0 -1
- package/features/master-detail.js +0 -3
- package/features/multi-sort.d.ts +0 -22
- package/features/multi-sort.d.ts.map +0 -1
- package/features/pinned-columns.d.ts.map +0 -1
- package/features/pinned-columns.js +0 -3
- package/features/pinned-rows.d.ts +0 -16
- package/features/pinned-rows.d.ts.map +0 -1
- package/features/pinned-rows.js +0 -3
- package/features/pivot.d.ts +0 -16
- package/features/pivot.d.ts.map +0 -1
- package/features/pivot.js +0 -3
- package/features/print.d.ts +0 -16
- package/features/print.d.ts.map +0 -1
- package/features/print.js +0 -3
- package/features/reorder.d.ts +0 -16
- package/features/reorder.d.ts.map +0 -1
- package/features/reorder.js +0 -3
- package/features/responsive.d.ts +0 -16
- package/features/responsive.d.ts.map +0 -1
- package/features/responsive.js +0 -3
- package/features/row-reorder.d.ts +0 -16
- package/features/row-reorder.d.ts.map +0 -1
- package/features/row-reorder.js +0 -3
- package/features/selection.d.ts +0 -16
- package/features/selection.d.ts.map +0 -1
- package/features/selection.js +0 -3
- package/features/server-side.d.ts +0 -16
- package/features/server-side.d.ts.map +0 -1
- package/features/server-side.js +0 -3
- package/features/sorting.d.ts +0 -1
- package/features/sorting.d.ts.map +0 -1
- package/features/sorting.js +0 -1
- package/features/tree.d.ts +0 -16
- package/features/tree.d.ts.map +0 -1
- package/features/tree.js +0 -3
- package/features/undo-redo.d.ts +0 -18
- package/features/undo-redo.d.ts.map +0 -1
- package/features/undo-redo.js +0 -3
- package/features/visibility.d.ts +0 -16
- package/features/visibility.d.ts.map +0 -1
- package/features/visibility.js +0 -3
- package/index.d.ts +0 -34
- package/index.d.ts.map +0 -1
- package/index.js +0 -1916
- package/lib/angular-column-config.d.ts +0 -140
- package/lib/angular-column-config.d.ts.map +0 -1
- package/lib/angular-grid-adapter.d.ts +0 -220
- package/lib/angular-grid-adapter.d.ts.map +0 -1
- package/lib/base-grid-editor.d.ts +0 -145
- package/lib/base-grid-editor.d.ts.map +0 -1
- package/lib/component-registry.d.ts +0 -63
- package/lib/component-registry.d.ts.map +0 -1
- package/lib/directives/grid-column-editor.directive.d.ts +0 -113
- package/lib/directives/grid-column-editor.directive.d.ts.map +0 -1
- package/lib/directives/grid-column-view.directive.d.ts +0 -69
- package/lib/directives/grid-column-view.directive.d.ts.map +0 -1
- package/lib/directives/grid-detail-view.directive.d.ts +0 -75
- package/lib/directives/grid-detail-view.directive.d.ts.map +0 -1
- package/lib/directives/grid-form-array.directive.d.ts +0 -141
- package/lib/directives/grid-form-array.directive.d.ts.map +0 -1
- package/lib/directives/grid-responsive-card.directive.d.ts +0 -92
- package/lib/directives/grid-responsive-card.directive.d.ts.map +0 -1
- package/lib/directives/grid-tool-panel.directive.d.ts +0 -91
- package/lib/directives/grid-tool-panel.directive.d.ts.map +0 -1
- package/lib/directives/grid.directive.d.ts +0 -808
- package/lib/directives/grid.directive.d.ts.map +0 -1
- package/lib/directives/index.d.ts +0 -9
- package/lib/directives/index.d.ts.map +0 -1
- package/lib/directives/structural-directives.d.ts +0 -174
- package/lib/directives/structural-directives.d.ts.map +0 -1
- package/lib/feature-registry.d.ts +0 -72
- package/lib/feature-registry.d.ts.map +0 -1
- package/lib/grid-type-registry.d.ts +0 -110
- package/lib/grid-type-registry.d.ts.map +0 -1
- package/lib/inject-grid.d.ts +0 -109
- package/lib/inject-grid.d.ts.map +0 -1
- package/lib/interfaces/grid-cell-editor.d.ts +0 -85
- package/lib/interfaces/grid-cell-editor.d.ts.map +0 -1
- package/lib/interfaces/grid-cell-renderer.d.ts +0 -63
- package/lib/interfaces/grid-cell-renderer.d.ts.map +0 -1
- package/lib/interfaces/index.d.ts +0 -5
- package/lib/interfaces/index.d.ts.map +0 -1
- package/multi-sort-DPbW58yz.js +0 -3
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
import { Type } from '@angular/core';
|
|
2
|
-
import { ColumnConfig, GridConfig } from '@toolbox-web/grid';
|
|
3
|
-
/**
|
|
4
|
-
* Interface for Angular renderer components.
|
|
5
|
-
*
|
|
6
|
-
* Renderer components receive the cell value, row data, and column config as inputs.
|
|
7
|
-
* Use Angular signal inputs for reactive updates.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```typescript
|
|
11
|
-
* import { Component, input } from '@angular/core';
|
|
12
|
-
* import type { AngularCellRenderer } from '@toolbox-web/grid-angular';
|
|
13
|
-
*
|
|
14
|
-
* @Component({
|
|
15
|
-
* selector: 'app-status-badge',
|
|
16
|
-
* template: `<span [class]="'badge-' + value()">{{ value() }}</span>`
|
|
17
|
-
* })
|
|
18
|
-
* export class StatusBadgeComponent implements AngularCellRenderer<Employee, string> {
|
|
19
|
-
* value = input.required<string>();
|
|
20
|
-
* row = input.required<Employee>();
|
|
21
|
-
* column = input<unknown>();
|
|
22
|
-
* }
|
|
23
|
-
* ```
|
|
24
|
-
*/
|
|
25
|
-
export interface AngularCellRenderer<TRow = unknown, TValue = unknown> {
|
|
26
|
-
/** The cell value - use `input<TValue>()` or `input.required<TValue>()` */
|
|
27
|
-
value: {
|
|
28
|
-
(): TValue | undefined;
|
|
29
|
-
};
|
|
30
|
-
/** The full row data - use `input<TRow>()` or `input.required<TRow>()` */
|
|
31
|
-
row: {
|
|
32
|
-
(): TRow | undefined;
|
|
33
|
-
};
|
|
34
|
-
/** The column configuration (optional) - use `input<unknown>()` */
|
|
35
|
-
column?: {
|
|
36
|
-
(): unknown;
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Interface for Angular editor components.
|
|
41
|
-
*
|
|
42
|
-
* Editor components receive the cell value, row data, and column config as inputs,
|
|
43
|
-
* plus must emit `commit` and `cancel` outputs.
|
|
44
|
-
*
|
|
45
|
-
* @example
|
|
46
|
-
* ```typescript
|
|
47
|
-
* import { Component, input, output } from '@angular/core';
|
|
48
|
-
* import type { AngularCellEditor } from '@toolbox-web/grid-angular';
|
|
49
|
-
*
|
|
50
|
-
* @Component({
|
|
51
|
-
* selector: 'app-status-editor',
|
|
52
|
-
* template: `
|
|
53
|
-
* <select [value]="value()" (change)="commit.emit($any($event.target).value)">
|
|
54
|
-
* <option value="active">Active</option>
|
|
55
|
-
* <option value="inactive">Inactive</option>
|
|
56
|
-
* </select>
|
|
57
|
-
* `
|
|
58
|
-
* })
|
|
59
|
-
* export class StatusEditorComponent implements AngularCellEditor<Employee, string> {
|
|
60
|
-
* value = input.required<string>();
|
|
61
|
-
* row = input.required<Employee>();
|
|
62
|
-
* column = input<unknown>();
|
|
63
|
-
* commit = output<string>();
|
|
64
|
-
* cancel = output<void>();
|
|
65
|
-
* }
|
|
66
|
-
* ```
|
|
67
|
-
*/
|
|
68
|
-
export interface AngularCellEditor<TRow = unknown, TValue = unknown> extends AngularCellRenderer<TRow, TValue> {
|
|
69
|
-
/** Emit to commit the new value - use `output<TValue>()` */
|
|
70
|
-
commit: {
|
|
71
|
-
emit(value: TValue): void;
|
|
72
|
-
subscribe?(fn: (value: TValue) => void): {
|
|
73
|
-
unsubscribe(): void;
|
|
74
|
-
};
|
|
75
|
-
};
|
|
76
|
-
/** Emit to cancel editing - use `output<void>()` */
|
|
77
|
-
cancel: {
|
|
78
|
-
emit(): void;
|
|
79
|
-
subscribe?(fn: () => void): {
|
|
80
|
-
unsubscribe(): void;
|
|
81
|
-
};
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Angular-specific column configuration.
|
|
86
|
-
*
|
|
87
|
-
* Extends the base ColumnConfig to allow Angular component classes
|
|
88
|
-
* to be used directly as renderers and editors.
|
|
89
|
-
*
|
|
90
|
-
* @example
|
|
91
|
-
* ```typescript
|
|
92
|
-
* import type { AngularColumnConfig } from '@toolbox-web/grid-angular';
|
|
93
|
-
* import { StatusBadgeComponent, StatusEditorComponent } from './components';
|
|
94
|
-
*
|
|
95
|
-
* const columns: AngularColumnConfig<Employee>[] = [
|
|
96
|
-
* { field: 'name', header: 'Name' },
|
|
97
|
-
* {
|
|
98
|
-
* field: 'status',
|
|
99
|
-
* header: 'Status',
|
|
100
|
-
* editable: true,
|
|
101
|
-
* renderer: StatusBadgeComponent,
|
|
102
|
-
* editor: StatusEditorComponent,
|
|
103
|
-
* },
|
|
104
|
-
* ];
|
|
105
|
-
* ```
|
|
106
|
-
*/
|
|
107
|
-
export interface AngularColumnConfig<TRow = unknown> extends Omit<ColumnConfig<TRow>, 'renderer' | 'editor'> {
|
|
108
|
-
/**
|
|
109
|
-
* Cell renderer - can be:
|
|
110
|
-
* - A function `(ctx) => HTMLElement | string`
|
|
111
|
-
* - An Angular component class implementing AngularCellRenderer
|
|
112
|
-
*/
|
|
113
|
-
renderer?: ColumnConfig<TRow>['renderer'] | Type<AngularCellRenderer<TRow, unknown>>;
|
|
114
|
-
/**
|
|
115
|
-
* Cell editor - can be:
|
|
116
|
-
* - A function `(ctx) => HTMLElement`
|
|
117
|
-
* - An Angular component class implementing AngularCellEditor
|
|
118
|
-
*/
|
|
119
|
-
editor?: ColumnConfig<TRow>['editor'] | Type<AngularCellEditor<TRow, unknown>>;
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* Angular-specific grid configuration.
|
|
123
|
-
*
|
|
124
|
-
* Extends the base GridConfig to use AngularColumnConfig.
|
|
125
|
-
*/
|
|
126
|
-
export interface AngularGridConfig<TRow = unknown> extends Omit<GridConfig<TRow>, 'columns'> {
|
|
127
|
-
columns?: AngularColumnConfig<TRow>[];
|
|
128
|
-
}
|
|
129
|
-
/**
|
|
130
|
-
* Type guard to check if a value is an Angular component class.
|
|
131
|
-
*
|
|
132
|
-
* Detects Angular components by checking for internal Angular markers:
|
|
133
|
-
* - ɵcmp (component definition)
|
|
134
|
-
* - ɵfac (factory function)
|
|
135
|
-
*
|
|
136
|
-
* Also checks if it's an ES6 class (vs function) by inspecting the
|
|
137
|
-
* string representation.
|
|
138
|
-
*/
|
|
139
|
-
export declare function isComponentClass(value: unknown): value is Type<unknown>;
|
|
140
|
-
//# sourceMappingURL=angular-column-config.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"angular-column-config.d.ts","sourceRoot":"","sources":["../../../../libs/grid-angular/src/lib/angular-column-config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAElE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,WAAW,mBAAmB,CAAC,IAAI,GAAG,OAAO,EAAE,MAAM,GAAG,OAAO;IACnE,2EAA2E;IAC3E,KAAK,EAAE;QAAE,IAAI,MAAM,GAAG,SAAS,CAAA;KAAE,CAAC;IAClC,0EAA0E;IAC1E,GAAG,EAAE;QAAE,IAAI,IAAI,GAAG,SAAS,CAAA;KAAE,CAAC;IAC9B,mEAAmE;IACnE,MAAM,CAAC,EAAE;QAAE,IAAI,OAAO,CAAA;KAAE,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,WAAW,iBAAiB,CAAC,IAAI,GAAG,OAAO,EAAE,MAAM,GAAG,OAAO,CAAE,SAAQ,mBAAmB,CAAC,IAAI,EAAE,MAAM,CAAC;IAC5G,4DAA4D;IAC5D,MAAM,EAAE;QAAE,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,GAAG;YAAE,WAAW,IAAI,IAAI,CAAA;SAAE,CAAA;KAAE,CAAC;IACxG,oDAAoD;IACpD,MAAM,EAAE;QAAE,IAAI,IAAI,IAAI,CAAC;QAAC,SAAS,CAAC,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG;YAAE,WAAW,IAAI,IAAI,CAAA;SAAE,CAAA;KAAE,CAAC;CAC/E;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,WAAW,mBAAmB,CAAC,IAAI,GAAG,OAAO,CAAE,SAAQ,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,UAAU,GAAG,QAAQ,CAAC;IAC1G;;;;OAIG;IACH,QAAQ,CAAC,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,mBAAmB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;IAErF;;;;OAIG;IACH,MAAM,CAAC,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,iBAAiB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;CAChF;AAED;;;;GAIG;AACH,MAAM,WAAW,iBAAiB,CAAC,IAAI,GAAG,OAAO,CAAE,SAAQ,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC;IAC1F,OAAO,CAAC,EAAE,mBAAmB,CAAC,IAAI,CAAC,EAAE,CAAC;CACvC;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,IAAI,CAAC,OAAO,CAAC,CAcvE"}
|
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
import { ApplicationRef, EnvironmentInjector, ViewContainerRef } from '@angular/core';
|
|
2
|
-
import { ColumnConfig, ColumnEditorSpec, ColumnViewRenderer, FrameworkAdapter, GridConfig, TypeDefault } from '@toolbox-web/grid';
|
|
3
|
-
import { AngularColumnConfig, AngularGridConfig } from './angular-column-config';
|
|
4
|
-
/**
|
|
5
|
-
* Framework adapter that enables zero-boilerplate integration of Angular components
|
|
6
|
-
* with the grid's light DOM configuration API.
|
|
7
|
-
*
|
|
8
|
-
* ## Usage
|
|
9
|
-
*
|
|
10
|
-
* **One-time setup in your app:**
|
|
11
|
-
* ```typescript
|
|
12
|
-
* import { Component, inject, EnvironmentInjector, ApplicationRef, ViewContainerRef } from '@angular/core';
|
|
13
|
-
* import { GridElement } from '@toolbox-web/grid';
|
|
14
|
-
* import { AngularGridAdapter } from '@toolbox-web/grid-angular';
|
|
15
|
-
*
|
|
16
|
-
* @Component({
|
|
17
|
-
* selector: 'app-root',
|
|
18
|
-
* // ...
|
|
19
|
-
* })
|
|
20
|
-
* export class AppComponent {
|
|
21
|
-
* constructor() {
|
|
22
|
-
* const injector = inject(EnvironmentInjector);
|
|
23
|
-
* const appRef = inject(ApplicationRef);
|
|
24
|
-
* const viewContainerRef = inject(ViewContainerRef);
|
|
25
|
-
* GridElement.registerAdapter(new AngularGridAdapter(injector, appRef, viewContainerRef));
|
|
26
|
-
* }
|
|
27
|
-
* }
|
|
28
|
-
* ```
|
|
29
|
-
*
|
|
30
|
-
* **Declarative configuration in templates (structural directive - recommended):**
|
|
31
|
-
* ```html
|
|
32
|
-
* <tbw-grid>
|
|
33
|
-
* <tbw-grid-column field="status">
|
|
34
|
-
* <app-status-badge *tbwRenderer="let value; row as row" [value]="value" />
|
|
35
|
-
* <app-status-editor *tbwEditor="let value" [value]="value" />
|
|
36
|
-
* </tbw-grid-column>
|
|
37
|
-
* </tbw-grid>
|
|
38
|
-
* ```
|
|
39
|
-
*
|
|
40
|
-
* **Declarative configuration in templates (nested directive - legacy):**
|
|
41
|
-
* ```html
|
|
42
|
-
* <tbw-grid>
|
|
43
|
-
* <tbw-grid-column field="status">
|
|
44
|
-
* <tbw-grid-column-view>
|
|
45
|
-
* <ng-template let-value let-row="row">
|
|
46
|
-
* <app-status-badge [value]="value" [row]="row" />
|
|
47
|
-
* </ng-template>
|
|
48
|
-
* </tbw-grid-column-view>
|
|
49
|
-
* <tbw-grid-column-editor>
|
|
50
|
-
* <ng-template let-value let-onCommit="onCommit" let-onCancel="onCancel">
|
|
51
|
-
* <app-status-select [value]="value" (commit)="onCommit($event)" (cancel)="onCancel()" />
|
|
52
|
-
* </ng-template>
|
|
53
|
-
* </tbw-grid-column-editor>
|
|
54
|
-
* </tbw-grid-column>
|
|
55
|
-
* </tbw-grid>
|
|
56
|
-
* ```
|
|
57
|
-
*
|
|
58
|
-
* The adapter automatically:
|
|
59
|
-
* - Detects Angular templates registered by directives (both structural and nested)
|
|
60
|
-
* - Creates embedded views with cell context (value, row, column)
|
|
61
|
-
* - Handles editor callbacks (onCommit/onCancel)
|
|
62
|
-
* - Manages view lifecycle and change detection
|
|
63
|
-
*/
|
|
64
|
-
export declare class AngularGridAdapter implements FrameworkAdapter {
|
|
65
|
-
private injector;
|
|
66
|
-
private appRef;
|
|
67
|
-
private viewContainerRef;
|
|
68
|
-
private viewRefs;
|
|
69
|
-
private componentRefs;
|
|
70
|
-
private typeRegistry;
|
|
71
|
-
constructor(injector: EnvironmentInjector, appRef: ApplicationRef, viewContainerRef: ViewContainerRef);
|
|
72
|
-
/**
|
|
73
|
-
* Processes an Angular grid configuration, converting component class references
|
|
74
|
-
* to actual renderer/editor functions.
|
|
75
|
-
*
|
|
76
|
-
* Call this method on your gridConfig before passing it to the grid.
|
|
77
|
-
*
|
|
78
|
-
* @example
|
|
79
|
-
* ```typescript
|
|
80
|
-
* import { AngularGridAdapter, type AngularGridConfig } from '@toolbox-web/grid-angular';
|
|
81
|
-
*
|
|
82
|
-
* const config: AngularGridConfig<Employee> = {
|
|
83
|
-
* columns: [
|
|
84
|
-
* { field: 'status', renderer: StatusBadgeComponent, editor: StatusEditorComponent },
|
|
85
|
-
* ],
|
|
86
|
-
* };
|
|
87
|
-
*
|
|
88
|
-
* // In component
|
|
89
|
-
* constructor() {
|
|
90
|
-
* const adapter = inject(AngularGridAdapter); // or create new instance
|
|
91
|
-
* this.processedConfig = adapter.processGridConfig(config);
|
|
92
|
-
* }
|
|
93
|
-
* ```
|
|
94
|
-
*
|
|
95
|
-
* @param config - Angular grid configuration with possible component class references
|
|
96
|
-
* @returns Processed GridConfig with actual renderer/editor functions
|
|
97
|
-
*/
|
|
98
|
-
processGridConfig<TRow = unknown>(config: AngularGridConfig<TRow>): GridConfig<TRow>;
|
|
99
|
-
/**
|
|
100
|
-
* Processes a single column configuration, converting component class references
|
|
101
|
-
* to actual renderer/editor functions.
|
|
102
|
-
*
|
|
103
|
-
* @param column - Angular column configuration
|
|
104
|
-
* @returns Processed ColumnConfig
|
|
105
|
-
*/
|
|
106
|
-
processColumn<TRow = unknown>(column: AngularColumnConfig<TRow>): ColumnConfig<TRow>;
|
|
107
|
-
/**
|
|
108
|
-
* Determines if this adapter can handle the given element.
|
|
109
|
-
* Checks if a template is registered for this element (structural or nested).
|
|
110
|
-
*/
|
|
111
|
-
canHandle(element: HTMLElement): boolean;
|
|
112
|
-
/**
|
|
113
|
-
* Creates a view renderer function that creates an embedded view
|
|
114
|
-
* from the registered template and returns its DOM element.
|
|
115
|
-
*
|
|
116
|
-
* Returns undefined if no template is registered for this element,
|
|
117
|
-
* allowing the grid to use its default rendering.
|
|
118
|
-
*/
|
|
119
|
-
createRenderer<TRow = unknown, TValue = unknown>(element: HTMLElement): ColumnViewRenderer<TRow, TValue>;
|
|
120
|
-
/**
|
|
121
|
-
* Creates an editor spec that creates an embedded view.
|
|
122
|
-
*
|
|
123
|
-
* **Auto-wiring**: The adapter automatically listens for `commit` and `cancel`
|
|
124
|
-
* CustomEvents on the rendered component. If the component emits these events,
|
|
125
|
-
* the adapter will call the grid's commit/cancel functions automatically.
|
|
126
|
-
*
|
|
127
|
-
* This means templates can be simplified from:
|
|
128
|
-
* ```html
|
|
129
|
-
* <app-editor *tbwEditor="let value; onCommit as onCommit"
|
|
130
|
-
* [value]="value" (commit)="onCommit($event)" />
|
|
131
|
-
* ```
|
|
132
|
-
* To just:
|
|
133
|
-
* ```html
|
|
134
|
-
* <app-editor *tbwEditor="let value" [value]="value" />
|
|
135
|
-
* ```
|
|
136
|
-
* As long as the component emits `(commit)` with the new value.
|
|
137
|
-
*/
|
|
138
|
-
createEditor<TRow = unknown, TValue = unknown>(element: HTMLElement): ColumnEditorSpec<TRow, TValue>;
|
|
139
|
-
/**
|
|
140
|
-
* Creates a detail renderer function for MasterDetailPlugin.
|
|
141
|
-
* Renders Angular templates for expandable detail rows.
|
|
142
|
-
*/
|
|
143
|
-
createDetailRenderer<TRow = unknown>(gridElement: HTMLElement): ((row: TRow) => HTMLElement) | undefined;
|
|
144
|
-
/**
|
|
145
|
-
* Framework adapter hook called by MasterDetailPlugin during attach().
|
|
146
|
-
* Parses the <tbw-grid-detail> element and returns an Angular template-based renderer.
|
|
147
|
-
*
|
|
148
|
-
* This enables MasterDetailPlugin to automatically use Angular templates
|
|
149
|
-
* without manual configuration in the Grid directive.
|
|
150
|
-
*/
|
|
151
|
-
parseDetailElement<TRow = unknown>(detailElement: Element): ((row: TRow, rowIndex: number) => HTMLElement | string) | undefined;
|
|
152
|
-
/**
|
|
153
|
-
* Creates a responsive card renderer function for ResponsivePlugin.
|
|
154
|
-
* Renders Angular templates for card layout in responsive mode.
|
|
155
|
-
*
|
|
156
|
-
* @param gridElement - The grid element to look up the template for
|
|
157
|
-
* @returns A card renderer function or undefined if no template is found
|
|
158
|
-
*/
|
|
159
|
-
createResponsiveCardRenderer<TRow = unknown>(gridElement: HTMLElement): ((row: TRow, rowIndex: number) => HTMLElement) | undefined;
|
|
160
|
-
/**
|
|
161
|
-
* Creates a tool panel renderer from a light DOM element.
|
|
162
|
-
* The renderer creates an Angular template-based panel content.
|
|
163
|
-
*/
|
|
164
|
-
createToolPanelRenderer(element: HTMLElement): ((container: HTMLElement) => void | (() => void)) | undefined;
|
|
165
|
-
/**
|
|
166
|
-
* Gets type-level defaults from the application's GridTypeRegistry.
|
|
167
|
-
*
|
|
168
|
-
* This enables application-wide type defaults configured via `provideGridTypeDefaults()`.
|
|
169
|
-
* The returned TypeDefault contains renderer/editor functions that instantiate
|
|
170
|
-
* Angular components dynamically.
|
|
171
|
-
*
|
|
172
|
-
* @example
|
|
173
|
-
* ```typescript
|
|
174
|
-
* // app.config.ts
|
|
175
|
-
* export const appConfig: ApplicationConfig = {
|
|
176
|
-
* providers: [
|
|
177
|
-
* provideGridTypeDefaults({
|
|
178
|
-
* country: {
|
|
179
|
-
* renderer: CountryCellComponent,
|
|
180
|
-
* editor: CountryEditorComponent
|
|
181
|
-
* }
|
|
182
|
-
* })
|
|
183
|
-
* ]
|
|
184
|
-
* };
|
|
185
|
-
*
|
|
186
|
-
* // Any grid with type: 'country' columns will use these components
|
|
187
|
-
* gridConfig = {
|
|
188
|
-
* columns: [{ field: 'country', type: 'country' }]
|
|
189
|
-
* };
|
|
190
|
-
* ```
|
|
191
|
-
*/
|
|
192
|
-
getTypeDefault<TRow = unknown>(type: string): TypeDefault<TRow> | undefined;
|
|
193
|
-
/**
|
|
194
|
-
* Creates a renderer function from an Angular component class.
|
|
195
|
-
* @internal
|
|
196
|
-
*/
|
|
197
|
-
private createComponentRenderer;
|
|
198
|
-
/**
|
|
199
|
-
* Creates an editor function from an Angular component class.
|
|
200
|
-
* @internal
|
|
201
|
-
*/
|
|
202
|
-
private createComponentEditor;
|
|
203
|
-
/**
|
|
204
|
-
* Subscribes to an Angular output on a component instance.
|
|
205
|
-
* Works with both EventEmitter and OutputEmitterRef (signal outputs).
|
|
206
|
-
* @internal
|
|
207
|
-
*/
|
|
208
|
-
private subscribeToOutput;
|
|
209
|
-
/**
|
|
210
|
-
* Sets component inputs using Angular's setInput API.
|
|
211
|
-
* @internal
|
|
212
|
-
*/
|
|
213
|
-
private setComponentInputs;
|
|
214
|
-
/**
|
|
215
|
-
* Clean up all view references and component references.
|
|
216
|
-
* Call this when your app/component is destroyed.
|
|
217
|
-
*/
|
|
218
|
-
destroy(): void;
|
|
219
|
-
}
|
|
220
|
-
//# sourceMappingURL=angular-grid-adapter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"angular-grid-adapter.d.ts","sourceRoot":"","sources":["../../../../libs/grid-angular/src/lib/angular-grid-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EAId,mBAAmB,EAInB,gBAAgB,EACjB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAEV,YAAY,EAEZ,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,UAAU,EACV,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAoB,KAAK,mBAAmB,EAAE,KAAK,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAmC7G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AACH,qBAAa,kBAAmB,YAAW,gBAAgB;IAMvD,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,gBAAgB;IAP1B,OAAO,CAAC,QAAQ,CAAkC;IAClD,OAAO,CAAC,aAAa,CAA+B;IACpD,OAAO,CAAC,YAAY,CAAiC;gBAG3C,QAAQ,EAAE,mBAAmB,EAC7B,MAAM,EAAE,cAAc,EACtB,gBAAgB,EAAE,gBAAgB;IAc5C;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,iBAAiB,CAAC,IAAI,GAAG,OAAO,EAAE,MAAM,EAAE,iBAAiB,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,IAAI,CAAC;IAapF;;;;;;OAMG;IACH,aAAa,CAAC,IAAI,GAAG,OAAO,EAAE,MAAM,EAAE,mBAAmB,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,IAAI,CAAC;IAgBpF;;;OAGG;IACH,SAAS,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO;IAIxC;;;;;;OAMG;IACH,cAAc,CAAC,IAAI,GAAG,OAAO,EAAE,MAAM,GAAG,OAAO,EAAE,OAAO,EAAE,WAAW,GAAG,kBAAkB,CAAC,IAAI,EAAE,MAAM,CAAC;IA+BxG;;;;;;;;;;;;;;;;;OAiBG;IACH,YAAY,CAAC,IAAI,GAAG,OAAO,EAAE,MAAM,GAAG,OAAO,EAAE,OAAO,EAAE,WAAW,GAAG,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC;IAmFpG;;;OAGG;IACH,oBAAoB,CAAC,IAAI,GAAG,OAAO,EAAE,WAAW,EAAE,WAAW,GAAG,CAAC,CAAC,GAAG,EAAE,IAAI,KAAK,WAAW,CAAC,GAAG,SAAS;IA4BxG;;;;;;OAMG;IACH,kBAAkB,CAAC,IAAI,GAAG,OAAO,EAC/B,aAAa,EAAE,OAAO,GACrB,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,KAAK,WAAW,GAAG,MAAM,CAAC,GAAG,SAAS;IA4BtE;;;;;;OAMG;IACH,4BAA4B,CAAC,IAAI,GAAG,OAAO,EACzC,WAAW,EAAE,WAAW,GACvB,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,KAAK,WAAW,CAAC,GAAG,SAAS;IA6B7D;;;OAGG;IACH,uBAAuB,CAAC,OAAO,EAAE,WAAW,GAAG,CAAC,CAAC,SAAS,EAAE,WAAW,KAAK,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC,GAAG,SAAS;IAsC5G;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,cAAc,CAAC,IAAI,GAAG,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC,GAAG,SAAS;IA4B3E;;;OAGG;IACH,OAAO,CAAC,uBAAuB;IAgC/B;;;OAGG;IACH,OAAO,CAAC,qBAAqB;IA+C7B;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IAczB;;;OAGG;IACH,OAAO,CAAC,kBAAkB;IAU1B;;;OAGG;IACH,OAAO,IAAI,IAAI;CAMhB"}
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import { AbstractControl } from '@angular/forms';
|
|
2
|
-
import { ColumnConfig } from '@toolbox-web/grid';
|
|
3
|
-
/**
|
|
4
|
-
* Base class for grid cell editors.
|
|
5
|
-
*
|
|
6
|
-
* Provides common functionality for Angular cell editors:
|
|
7
|
-
* - Automatic value resolution from FormControl or value input
|
|
8
|
-
* - Common inputs (value, row, column, control)
|
|
9
|
-
* - Common outputs (commit, cancel)
|
|
10
|
-
* - Validation state helpers
|
|
11
|
-
*
|
|
12
|
-
* ## Usage
|
|
13
|
-
*
|
|
14
|
-
* ```typescript
|
|
15
|
-
* import { Component } from '@angular/core';
|
|
16
|
-
* import { BaseGridEditor } from '@toolbox-web/grid-angular';
|
|
17
|
-
*
|
|
18
|
-
* @Component({
|
|
19
|
-
* selector: 'app-my-editor',
|
|
20
|
-
* template: \`
|
|
21
|
-
* <input
|
|
22
|
-
* [value]="currentValue()"
|
|
23
|
-
* [class.is-invalid]="isInvalid()"
|
|
24
|
-
* (input)="commitValue($event.target.value)"
|
|
25
|
-
* (keydown.escape)="cancelEdit()"
|
|
26
|
-
* />
|
|
27
|
-
* @if (hasErrors()) {
|
|
28
|
-
* <div class="error">{{ firstErrorMessage() }}</div>
|
|
29
|
-
* }
|
|
30
|
-
* \`
|
|
31
|
-
* })
|
|
32
|
-
* export class MyEditorComponent extends BaseGridEditor<MyRow, string> {
|
|
33
|
-
* // Override to customize error messages
|
|
34
|
-
* protected override getErrorMessage(errorKey: string): string {
|
|
35
|
-
* if (errorKey === 'required') return 'This field is required';
|
|
36
|
-
* if (errorKey === 'minlength') return 'Too short';
|
|
37
|
-
* return super.getErrorMessage(errorKey);
|
|
38
|
-
* }
|
|
39
|
-
* }
|
|
40
|
-
* ```
|
|
41
|
-
*
|
|
42
|
-
* ## Template Syntax
|
|
43
|
-
*
|
|
44
|
-
* When using the base class, you only need to pass the control:
|
|
45
|
-
*
|
|
46
|
-
* ```html
|
|
47
|
-
* <tbw-grid-column field="name">
|
|
48
|
-
* <app-my-editor *tbwEditor="let _; control as control" [control]="control" />
|
|
49
|
-
* </tbw-grid-column>
|
|
50
|
-
* ```
|
|
51
|
-
*
|
|
52
|
-
* Or without FormArray binding (fallback to value):
|
|
53
|
-
*
|
|
54
|
-
* ```html
|
|
55
|
-
* <tbw-grid-column field="name">
|
|
56
|
-
* <app-my-editor *tbwEditor="let value" [value]="value" />
|
|
57
|
-
* </tbw-grid-column>
|
|
58
|
-
* ```
|
|
59
|
-
*
|
|
60
|
-
* @typeParam TRow - The row data type
|
|
61
|
-
* @typeParam TValue - The cell value type
|
|
62
|
-
*/
|
|
63
|
-
export declare abstract class BaseGridEditor<TRow = unknown, TValue = unknown> {
|
|
64
|
-
private readonly elementRef;
|
|
65
|
-
/**
|
|
66
|
-
* The cell value. Used when FormControl is not available.
|
|
67
|
-
* When a FormControl is provided, value is derived from control.value instead.
|
|
68
|
-
*/
|
|
69
|
-
readonly value: import('@angular/core').InputSignal<TValue | undefined>;
|
|
70
|
-
/**
|
|
71
|
-
* The full row data object.
|
|
72
|
-
*/
|
|
73
|
-
readonly row: import('@angular/core').InputSignal<TRow | undefined>;
|
|
74
|
-
/**
|
|
75
|
-
* The column configuration.
|
|
76
|
-
*/
|
|
77
|
-
readonly column: import('@angular/core').InputSignal<ColumnConfig<TRow> | undefined>;
|
|
78
|
-
/**
|
|
79
|
-
* The FormControl for this cell, if the grid is bound to a FormArray.
|
|
80
|
-
* When provided, the editor uses control.value instead of the value input.
|
|
81
|
-
*/
|
|
82
|
-
readonly control: import('@angular/core').InputSignal<AbstractControl<any, any, any> | undefined>;
|
|
83
|
-
/**
|
|
84
|
-
* Emits when the user commits a new value.
|
|
85
|
-
*/
|
|
86
|
-
readonly commit: import('@angular/core').OutputEmitterRef<TValue>;
|
|
87
|
-
/**
|
|
88
|
-
* Emits when the user cancels editing.
|
|
89
|
-
*/
|
|
90
|
-
readonly cancel: import('@angular/core').OutputEmitterRef<void>;
|
|
91
|
-
/**
|
|
92
|
-
* The current value, derived from FormControl if available, otherwise from value input.
|
|
93
|
-
* This is the recommended way to get the current value in your editor template.
|
|
94
|
-
*/
|
|
95
|
-
readonly currentValue: import('@angular/core').Signal<TValue | undefined>;
|
|
96
|
-
/**
|
|
97
|
-
* Whether the control is invalid (has validation errors).
|
|
98
|
-
* Returns false if no FormControl is available.
|
|
99
|
-
*/
|
|
100
|
-
readonly isInvalid: import('@angular/core').Signal<boolean>;
|
|
101
|
-
/**
|
|
102
|
-
* Whether the control is dirty (has been modified).
|
|
103
|
-
* Returns false if no FormControl is available.
|
|
104
|
-
*/
|
|
105
|
-
readonly isDirty: import('@angular/core').Signal<boolean>;
|
|
106
|
-
/**
|
|
107
|
-
* Whether the control has been touched.
|
|
108
|
-
* Returns false if no FormControl is available.
|
|
109
|
-
*/
|
|
110
|
-
readonly isTouched: import('@angular/core').Signal<boolean>;
|
|
111
|
-
/**
|
|
112
|
-
* Whether the control has any validation errors.
|
|
113
|
-
*/
|
|
114
|
-
readonly hasErrors: import('@angular/core').Signal<boolean>;
|
|
115
|
-
/**
|
|
116
|
-
* The first error message from the control's validation errors.
|
|
117
|
-
* Returns an empty string if no errors.
|
|
118
|
-
*/
|
|
119
|
-
readonly firstErrorMessage: import('@angular/core').Signal<string>;
|
|
120
|
-
/**
|
|
121
|
-
* All error messages from the control's validation errors.
|
|
122
|
-
*/
|
|
123
|
-
readonly allErrorMessages: import('@angular/core').Signal<string[]>;
|
|
124
|
-
/**
|
|
125
|
-
* Commit a new value. Emits the commit output AND dispatches a DOM event.
|
|
126
|
-
* The DOM event enables the grid's auto-wiring to catch the commit.
|
|
127
|
-
* Call this when the user confirms their edit.
|
|
128
|
-
*/
|
|
129
|
-
commitValue(newValue: TValue): void;
|
|
130
|
-
/**
|
|
131
|
-
* Cancel editing. Emits the cancel output AND dispatches a DOM event.
|
|
132
|
-
* Call this when the user cancels (e.g., presses Escape).
|
|
133
|
-
*/
|
|
134
|
-
cancelEdit(): void;
|
|
135
|
-
/**
|
|
136
|
-
* Get a human-readable error message for a validation error.
|
|
137
|
-
* Override this method to customize error messages for your editor.
|
|
138
|
-
*
|
|
139
|
-
* @param errorKey - The validation error key (e.g., 'required', 'minlength')
|
|
140
|
-
* @param errorValue - The error value (e.g., { requiredLength: 5, actualLength: 3 })
|
|
141
|
-
* @returns A human-readable error message
|
|
142
|
-
*/
|
|
143
|
-
protected getErrorMessage(errorKey: string, errorValue?: unknown): string;
|
|
144
|
-
}
|
|
145
|
-
//# sourceMappingURL=base-grid-editor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base-grid-editor.d.ts","sourceRoot":"","sources":["../../../../libs/grid-angular/src/lib/base-grid-editor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AACH,8BACsB,cAAc,CAAC,IAAI,GAAG,OAAO,EAAE,MAAM,GAAG,OAAO;IACnE,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAsB;IAMjD;;;OAGG;IACH,QAAQ,CAAC,KAAK,0DAAmB;IAEjC;;OAEG;IACH,QAAQ,CAAC,GAAG,wDAAiB;IAE7B;;OAEG;IACH,QAAQ,CAAC,MAAM,sEAA+B;IAE9C;;;OAGG;IACH,QAAQ,CAAC,OAAO,kFAA4B;IAM5C;;OAEG;IACH,QAAQ,CAAC,MAAM,mDAAoB;IAEnC;;OAEG;IACH,QAAQ,CAAC,MAAM,iDAAkB;IAMjC;;;OAGG;IACH,QAAQ,CAAC,YAAY,qDAMlB;IAEH;;;OAGG;IACH,QAAQ,CAAC,SAAS,0CAEf;IAEH;;;OAGG;IACH,QAAQ,CAAC,OAAO,0CAEb;IAEH;;;OAGG;IACH,QAAQ,CAAC,SAAS,0CAEf;IAEH;;OAEG;IACH,QAAQ,CAAC,SAAS,0CAGf;IAEH;;;OAGG;IACH,QAAQ,CAAC,iBAAiB,yCAMvB;IAEH;;OAEG;IACH,QAAQ,CAAC,gBAAgB,2CAKtB;IAMH;;;;OAIG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IASnC;;;OAGG;IACH,UAAU,IAAI,IAAI;IAQlB;;;;;;;OAOG;IACH,SAAS,CAAC,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,MAAM;CA4B1E"}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { Type } from '@angular/core';
|
|
2
|
-
/**
|
|
3
|
-
* Register an Angular component as a grid cell renderer.
|
|
4
|
-
* Call this at module level (outside the class) to register on import.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* ```typescript
|
|
8
|
-
* import { Component, input } from '@angular/core';
|
|
9
|
-
* import { registerGridRenderer, GridCellRenderer } from '@toolbox-web/grid-angular';
|
|
10
|
-
*
|
|
11
|
-
* @Component({
|
|
12
|
-
* selector: 'app-status-badge',
|
|
13
|
-
* template: `<span [class]="'status-' + value()">{{ value() }}</span>`,
|
|
14
|
-
* })
|
|
15
|
-
* export class StatusBadgeComponent implements GridCellRenderer<string> {
|
|
16
|
-
* value = input.required<string>();
|
|
17
|
-
* row = input<unknown>();
|
|
18
|
-
* }
|
|
19
|
-
*
|
|
20
|
-
* // Register at module level - runs when file is imported
|
|
21
|
-
* registerGridRenderer('app-status-badge', StatusBadgeComponent);
|
|
22
|
-
* ```
|
|
23
|
-
*/
|
|
24
|
-
export declare function registerGridRenderer(tagName: string, componentType: Type<unknown>): void;
|
|
25
|
-
/**
|
|
26
|
-
* Register an Angular component as a grid cell editor.
|
|
27
|
-
* Call this at module level (outside the class) to register on import.
|
|
28
|
-
*
|
|
29
|
-
* @example
|
|
30
|
-
* ```typescript
|
|
31
|
-
* import { Component, input, output } from '@angular/core';
|
|
32
|
-
* import { registerGridEditor, GridCellEditor } from '@toolbox-web/grid-angular';
|
|
33
|
-
*
|
|
34
|
-
* @Component({
|
|
35
|
-
* selector: 'app-status-select',
|
|
36
|
-
* template: `<select [value]="value()" (change)="onChange($event)">...</select>`,
|
|
37
|
-
* })
|
|
38
|
-
* export class StatusSelectComponent implements GridCellEditor<string> {
|
|
39
|
-
* value = input.required<string>();
|
|
40
|
-
* commit = output<string>();
|
|
41
|
-
* cancel = output<void>();
|
|
42
|
-
*
|
|
43
|
-
* onChange(e: Event) {
|
|
44
|
-
* this.commit.emit((e.target as HTMLSelectElement).value);
|
|
45
|
-
* }
|
|
46
|
-
* }
|
|
47
|
-
*
|
|
48
|
-
* // Register at module level - runs when file is imported
|
|
49
|
-
* registerGridEditor('app-status-select', StatusSelectComponent);
|
|
50
|
-
* ```
|
|
51
|
-
*/
|
|
52
|
-
export declare function registerGridEditor(tagName: string, componentType: Type<unknown>): void;
|
|
53
|
-
/**
|
|
54
|
-
* Get a registered component by tag name.
|
|
55
|
-
* Used internally by AngularGridAdapter.
|
|
56
|
-
*/
|
|
57
|
-
export declare function getRegisteredComponent(tagName: string): Type<unknown> | undefined;
|
|
58
|
-
/**
|
|
59
|
-
* Get all registered components.
|
|
60
|
-
* Used internally by AngularGridAdapter.
|
|
61
|
-
*/
|
|
62
|
-
export declare function getAllRegisteredComponents(): Map<string, Type<unknown>>;
|
|
63
|
-
//# sourceMappingURL=component-registry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component-registry.d.ts","sourceRoot":"","sources":["../../../../libs/grid-angular/src/lib/component-registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAmCrC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAExF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAEtF;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,SAAS,CAEjF;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,IAAI,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAEvE"}
|