@toolbox-web/grid-angular 0.3.1 → 0.5.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/README.md +296 -16
- package/index.d.ts +5 -0
- package/index.d.ts.map +1 -1
- package/index.js +544 -196
- package/lib/angular-grid-adapter.d.ts +8 -0
- package/lib/angular-grid-adapter.d.ts.map +1 -1
- package/lib/base-grid-editor.d.ts +145 -0
- package/lib/base-grid-editor.d.ts.map +1 -0
- package/lib/directives/grid-column-editor.directive.d.ts +17 -0
- package/lib/directives/grid-column-editor.directive.d.ts.map +1 -1
- package/lib/directives/grid-form-array.directive.d.ts +141 -0
- package/lib/directives/grid-form-array.directive.d.ts.map +1 -0
- package/lib/directives/grid-responsive-card.directive.d.ts +92 -0
- package/lib/directives/grid-responsive-card.directive.d.ts.map +1 -0
- package/lib/directives/grid.directive.d.ts +6 -0
- package/lib/directives/grid.directive.d.ts.map +1 -1
- package/lib/directives/index.d.ts +3 -0
- package/lib/directives/index.d.ts.map +1 -1
- package/lib/directives/structural-directives.d.ts +10 -0
- package/lib/directives/structural-directives.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -149,6 +149,14 @@ export declare class AngularGridAdapter implements FrameworkAdapter {
|
|
|
149
149
|
* without manual configuration in the Grid directive.
|
|
150
150
|
*/
|
|
151
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;
|
|
152
160
|
/**
|
|
153
161
|
* Creates a tool panel renderer from a light DOM element.
|
|
154
162
|
* The renderer creates an Angular template-based panel content.
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;IAa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S,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;IA2B3E;;;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"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { AbstractControl } from '@angular/forms';
|
|
2
|
+
import { ColumnConfig } from '../../../../dist/libs/grid/index.d.ts';
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,4 +1,5 @@
|
|
|
1
1
|
import { EventEmitter, TemplateRef } from '@angular/core';
|
|
2
|
+
import { AbstractControl } from '@angular/forms';
|
|
2
3
|
/**
|
|
3
4
|
* Context object passed to the cell editor template.
|
|
4
5
|
* Contains the cell value, row data, column configuration, and commit/cancel functions.
|
|
@@ -22,6 +23,22 @@ export interface GridEditorContext<TValue = unknown, TRow = unknown> {
|
|
|
22
23
|
* Use with Angular event binding: `(cancel)="onCancel()"`
|
|
23
24
|
*/
|
|
24
25
|
onCancel: () => void;
|
|
26
|
+
/**
|
|
27
|
+
* The FormControl for this cell, if the grid is bound to a FormArray with FormGroups.
|
|
28
|
+
*
|
|
29
|
+
* This allows custom editors to bind directly to the control for validation display:
|
|
30
|
+
* ```html
|
|
31
|
+
* <input *tbwEditor="let value; control as ctrl"
|
|
32
|
+
* [formControl]="ctrl"
|
|
33
|
+
* [class.is-invalid]="ctrl?.invalid && ctrl?.touched" />
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* Returns `undefined` if:
|
|
37
|
+
* - The grid is not bound to a FormArray
|
|
38
|
+
* - The FormArray doesn't contain FormGroups
|
|
39
|
+
* - The field doesn't exist in the FormGroup
|
|
40
|
+
*/
|
|
41
|
+
control?: AbstractControl;
|
|
25
42
|
/**
|
|
26
43
|
* @deprecated Use `onCommit` callback function instead. Will be removed in v2.0.
|
|
27
44
|
* EventEmitter for commit - requires `.emit()` call.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grid-column-editor.directive.d.ts","sourceRoot":"","sources":["../../../../../libs/grid-angular/src/lib/directives/grid-column-editor.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+C,YAAY,EAAU,WAAW,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"grid-column-editor.directive.d.ts","sourceRoot":"","sources":["../../../../../libs/grid-angular/src/lib/directives/grid-column-editor.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+C,YAAY,EAAU,WAAW,EAAE,MAAM,eAAe,CAAC;AAC/G,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD;;;GAGG;AACH,MAAM,WAAW,iBAAiB,CAAC,MAAM,GAAG,OAAO,EAAE,IAAI,GAAG,OAAO;IACjE,qCAAqC;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,wCAAwC;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,+BAA+B;IAC/B,GAAG,EAAE,IAAI,CAAC;IACV,+BAA+B;IAC/B,MAAM,EAAE,OAAO,CAAC;IAChB;;;OAGG;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC;;;OAGG;IACH,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B;;;OAGG;IACH,MAAM,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAC7B;;;OAGG;IACH,MAAM,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;CAC5B;AAKD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,WAAW,GAAG,WAAW,CAAC,iBAAiB,CAAC,GAAG,SAAS,CAElG;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,qBACa,gBAAgB;IAC3B,OAAO,CAAC,UAAU,CAAmC;IAErD;;OAEG;IACH,QAAQ,+DAAgD;IAExD,0DAA0D;IAC1D,OAAO,CAAC,kBAAkB,CAMvB;IAEH;;;OAGG;IACH,MAAM,CAAC,sBAAsB,CAAC,GAAG,EAAE,gBAAgB,EAAE,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,iBAAiB;CAG7F"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { OnDestroy, OnInit } from '@angular/core';
|
|
2
|
+
import { AbstractControl, FormArray, FormGroup } from '@angular/forms';
|
|
3
|
+
/**
|
|
4
|
+
* Context provided to the grid containing form-related information.
|
|
5
|
+
* This can be accessed by other directives to get form controls.
|
|
6
|
+
*/
|
|
7
|
+
export interface FormArrayContext {
|
|
8
|
+
/** Get the row data at a specific index */
|
|
9
|
+
getRow<T = unknown>(rowIndex: number): T | null;
|
|
10
|
+
/** Update a field value at a specific row */
|
|
11
|
+
updateField(rowIndex: number, field: string, value: unknown): void;
|
|
12
|
+
/** Get the current form value (all rows) */
|
|
13
|
+
getValue<T = unknown>(): T[];
|
|
14
|
+
/**
|
|
15
|
+
* Get the FormControl for a specific cell.
|
|
16
|
+
* Only available when using FormArray with FormGroup rows.
|
|
17
|
+
*
|
|
18
|
+
* @param rowIndex - The row index
|
|
19
|
+
* @param field - The field name
|
|
20
|
+
* @returns The AbstractControl for the cell, or undefined if not available
|
|
21
|
+
*/
|
|
22
|
+
getControl(rowIndex: number, field: string): AbstractControl | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Whether the grid is backed by a FormArray of FormGroups.
|
|
25
|
+
* When true, `getControl()` will return cell-level controls.
|
|
26
|
+
*/
|
|
27
|
+
hasFormGroups: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Get the FormGroup for a specific row.
|
|
30
|
+
* Only available when using FormArray with FormGroup rows.
|
|
31
|
+
*
|
|
32
|
+
* @param rowIndex - The row index
|
|
33
|
+
* @returns The FormGroup for the row, or undefined if not available
|
|
34
|
+
*/
|
|
35
|
+
getRowFormGroup(rowIndex: number): FormGroup | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* Check if a row is valid (all controls in the FormGroup are valid).
|
|
38
|
+
* Returns true if not using FormArray or if the row doesn't exist.
|
|
39
|
+
*
|
|
40
|
+
* @param rowIndex - The row index
|
|
41
|
+
* @returns true if the row is valid, false if any control is invalid
|
|
42
|
+
*/
|
|
43
|
+
isRowValid(rowIndex: number): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Check if a row has been touched (any control in the FormGroup is touched).
|
|
46
|
+
* Returns false if not using FormArray or if the row doesn't exist.
|
|
47
|
+
*
|
|
48
|
+
* @param rowIndex - The row index
|
|
49
|
+
* @returns true if any control in the row is touched
|
|
50
|
+
*/
|
|
51
|
+
isRowTouched(rowIndex: number): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Check if a row is dirty (any control in the FormGroup is dirty).
|
|
54
|
+
* Returns false if not using FormArray or if the row doesn't exist.
|
|
55
|
+
*
|
|
56
|
+
* @param rowIndex - The row index
|
|
57
|
+
* @returns true if any control in the row is dirty
|
|
58
|
+
*/
|
|
59
|
+
isRowDirty(rowIndex: number): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Get validation errors for a specific row.
|
|
62
|
+
* Aggregates errors from all controls in the FormGroup.
|
|
63
|
+
*
|
|
64
|
+
* @param rowIndex - The row index
|
|
65
|
+
* @returns Object with field names as keys and their errors, or null if no errors
|
|
66
|
+
*/
|
|
67
|
+
getRowErrors(rowIndex: number): Record<string, unknown> | null;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Gets the FormArrayContext from a grid element, if present.
|
|
71
|
+
* @internal
|
|
72
|
+
*/
|
|
73
|
+
export declare function getFormArrayContext(gridElement: HTMLElement): FormArrayContext | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* Directive that binds a FormArray directly to the grid.
|
|
76
|
+
*
|
|
77
|
+
* This is the recommended way to integrate tbw-grid with Angular Reactive Forms.
|
|
78
|
+
* Use a FormArray of FormGroups for row-level validation and cell-level control access.
|
|
79
|
+
*
|
|
80
|
+
* ## Usage
|
|
81
|
+
*
|
|
82
|
+
* ```typescript
|
|
83
|
+
* import { Component, inject } from '@angular/core';
|
|
84
|
+
* import { FormBuilder, ReactiveFormsModule } from '@angular/forms';
|
|
85
|
+
* import { Grid, GridFormArray } from '@toolbox-web/grid-angular';
|
|
86
|
+
*
|
|
87
|
+
* @Component({
|
|
88
|
+
* imports: [Grid, GridFormArray, ReactiveFormsModule],
|
|
89
|
+
* template: \`
|
|
90
|
+
* <form [formGroup]="form">
|
|
91
|
+
* <tbw-grid [formArray]="form.controls.rows" [columns]="columns" />
|
|
92
|
+
* </form>
|
|
93
|
+
* \`
|
|
94
|
+
* })
|
|
95
|
+
* export class MyComponent {
|
|
96
|
+
* private fb = inject(FormBuilder);
|
|
97
|
+
*
|
|
98
|
+
* form = this.fb.group({
|
|
99
|
+
* rows: this.fb.array([
|
|
100
|
+
* this.fb.group({ name: 'Alice', age: 30 }),
|
|
101
|
+
* this.fb.group({ name: 'Bob', age: 25 }),
|
|
102
|
+
* ])
|
|
103
|
+
* });
|
|
104
|
+
*
|
|
105
|
+
* columns = [
|
|
106
|
+
* { field: 'name', header: 'Name', editable: true },
|
|
107
|
+
* { field: 'age', header: 'Age', editable: true }
|
|
108
|
+
* ];
|
|
109
|
+
* }
|
|
110
|
+
* ```
|
|
111
|
+
*
|
|
112
|
+
* ## How It Works
|
|
113
|
+
*
|
|
114
|
+
* - **FormArray → Grid**: The grid displays the FormArray's value as rows
|
|
115
|
+
* - **Grid → FormArray**: When a cell is edited, the corresponding FormControl is updated
|
|
116
|
+
* - FormArrayContext is available for accessing cell-level controls
|
|
117
|
+
*
|
|
118
|
+
* ## Features
|
|
119
|
+
*
|
|
120
|
+
* - Works naturally with FormArray inside a FormGroup
|
|
121
|
+
* - Provides cell-level FormControl access for validation
|
|
122
|
+
* - Supports row-level validation state aggregation
|
|
123
|
+
* - Automatically syncs FormArray changes to the grid
|
|
124
|
+
*/
|
|
125
|
+
export declare class GridFormArray implements OnInit, OnDestroy {
|
|
126
|
+
#private;
|
|
127
|
+
private elementRef;
|
|
128
|
+
private cellCommitListener;
|
|
129
|
+
private touchListener;
|
|
130
|
+
/**
|
|
131
|
+
* The FormArray to bind to the grid.
|
|
132
|
+
*/
|
|
133
|
+
readonly formArray: import('@angular/core').InputSignal<FormArray<any>>;
|
|
134
|
+
/**
|
|
135
|
+
* Effect that syncs the FormArray value to the grid rows.
|
|
136
|
+
*/
|
|
137
|
+
private syncFormArrayToGrid;
|
|
138
|
+
ngOnInit(): void;
|
|
139
|
+
ngOnDestroy(): void;
|
|
140
|
+
}
|
|
141
|
+
//# sourceMappingURL=grid-form-array.directive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grid-form-array.directive.d.ts","sourceRoot":"","sources":["../../../../../libs/grid-angular/src/lib/directives/grid-form-array.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgD,SAAS,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAChG,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAGv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EG;IACH,QAAQ,CAAC,SAAS,sDAA+B;IAEjD;;OAEG;IACH,OAAO,CAAC,mBAAmB,CAOxB;IAEH,QAAQ,IAAI,IAAI;IA0BhB,WAAW,IAAI,IAAI;CAgIpB"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { TemplateRef } from '@angular/core';
|
|
2
|
+
/**
|
|
3
|
+
* Context object passed to the responsive card template.
|
|
4
|
+
*
|
|
5
|
+
* @template TRow - The type of row data
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```html
|
|
9
|
+
* <tbw-grid-responsive-card>
|
|
10
|
+
* <ng-template let-row let-index="index">
|
|
11
|
+
* <div class="card-content">
|
|
12
|
+
* <span>{{ row.name }}</span>
|
|
13
|
+
* <span>Row #{{ index }}</span>
|
|
14
|
+
* </div>
|
|
15
|
+
* </ng-template>
|
|
16
|
+
* </tbw-grid-responsive-card>
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export interface GridResponsiveCardContext<TRow = unknown> {
|
|
20
|
+
/**
|
|
21
|
+
* The row data (available as `let-row` or `let-myVar`).
|
|
22
|
+
*/
|
|
23
|
+
$implicit: TRow;
|
|
24
|
+
/**
|
|
25
|
+
* The row data (explicit access via `let-row="row"`).
|
|
26
|
+
*/
|
|
27
|
+
row: TRow;
|
|
28
|
+
/**
|
|
29
|
+
* The row index (zero-based).
|
|
30
|
+
*/
|
|
31
|
+
index: number;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Registry to store responsive card templates by grid element.
|
|
35
|
+
* Used by AngularGridAdapter to create card renderers.
|
|
36
|
+
*/
|
|
37
|
+
export declare const responsiveCardTemplateRegistry: Map<HTMLElement, TemplateRef<GridResponsiveCardContext<unknown>>>;
|
|
38
|
+
/**
|
|
39
|
+
* Retrieves the responsive card template for a grid element.
|
|
40
|
+
*
|
|
41
|
+
* @param gridElement - The grid element to look up
|
|
42
|
+
* @returns The template reference or undefined if not found
|
|
43
|
+
*/
|
|
44
|
+
export declare function getResponsiveCardTemplate(gridElement: HTMLElement): TemplateRef<GridResponsiveCardContext> | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* Directive for providing custom Angular templates for responsive card layout.
|
|
47
|
+
*
|
|
48
|
+
* Use this directive to define how each row should render when the grid
|
|
49
|
+
* is in responsive/mobile mode. The template receives the row data and index.
|
|
50
|
+
*
|
|
51
|
+
* ## Usage
|
|
52
|
+
*
|
|
53
|
+
* ```html
|
|
54
|
+
* <tbw-grid [rows]="employees">
|
|
55
|
+
* <tbw-grid-responsive-card>
|
|
56
|
+
* <ng-template let-employee let-idx="index">
|
|
57
|
+
* <div class="employee-card">
|
|
58
|
+
* <img [src]="employee.avatar" alt="">
|
|
59
|
+
* <div class="info">
|
|
60
|
+
* <strong>{{ employee.name }}</strong>
|
|
61
|
+
* <span>{{ employee.department }}</span>
|
|
62
|
+
* </div>
|
|
63
|
+
* </div>
|
|
64
|
+
* </ng-template>
|
|
65
|
+
* </tbw-grid-responsive-card>
|
|
66
|
+
* </tbw-grid>
|
|
67
|
+
* ```
|
|
68
|
+
*
|
|
69
|
+
* ## Important Notes
|
|
70
|
+
*
|
|
71
|
+
* - The ResponsivePlugin must be added to your grid config
|
|
72
|
+
* - The Grid directive will automatically configure the plugin's cardRenderer
|
|
73
|
+
* - Template context provides `$implicit` (row), `row`, and `index`
|
|
74
|
+
*
|
|
75
|
+
* @see ResponsivePlugin
|
|
76
|
+
*/
|
|
77
|
+
export declare class GridResponsiveCard<TRow = unknown> {
|
|
78
|
+
private elementRef;
|
|
79
|
+
/**
|
|
80
|
+
* The ng-template containing the card content.
|
|
81
|
+
*/
|
|
82
|
+
template: import('@angular/core').Signal<TemplateRef<any> | undefined>;
|
|
83
|
+
/**
|
|
84
|
+
* Effect that registers the template when it becomes available.
|
|
85
|
+
*/
|
|
86
|
+
private onTemplateReceived;
|
|
87
|
+
/**
|
|
88
|
+
* Type guard for template context inference.
|
|
89
|
+
*/
|
|
90
|
+
static ngTemplateContextGuard<T>(_directive: GridResponsiveCard<T>, context: unknown): context is GridResponsiveCardContext<T>;
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=grid-responsive-card.directive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grid-responsive-card.directive.d.ts","sourceRoot":"","sources":["../../../../../libs/grid-angular/src/lib/directives/grid-responsive-card.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuD,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjG;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,yBAAyB,CAAC,IAAI,GAAG,OAAO;IACvD;;OAEG;IACH,SAAS,EAAE,IAAI,CAAC;IAEhB;;OAEG;IACH,GAAG,EAAE,IAAI,CAAC;IAEV;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,eAAO,MAAM,8BAA8B,mEAAiE,CAAC;AAE7G;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,WAAW,EAAE,WAAW,GACvB,WAAW,CAAC,yBAAyB,CAAC,GAAG,SAAS,CAKpD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,qBAGa,kBAAkB,CAAC,IAAI,GAAG,OAAO;IAC5C,OAAO,CAAC,UAAU,CAAmC;IAErD;;OAEG;IACH,QAAQ,+DAA8D;IAEtE;;OAEG;IACH,OAAO,CAAC,kBAAkB,CAQvB;IAEH;;OAEG;IACH,MAAM,CAAC,sBAAsB,CAAC,CAAC,EAC7B,UAAU,EAAE,kBAAkB,CAAC,CAAC,CAAC,EACjC,OAAO,EAAE,OAAO,GACf,OAAO,IAAI,yBAAyB,CAAC,CAAC,CAAC;CAG3C"}
|
|
@@ -171,6 +171,12 @@ export declare class Grid implements OnInit, AfterContentInit, OnDestroy {
|
|
|
171
171
|
* - If plugin doesn't exist but <tbw-grid-detail> is present: create and add the plugin
|
|
172
172
|
*/
|
|
173
173
|
private configureMasterDetail;
|
|
174
|
+
/**
|
|
175
|
+
* Configures the ResponsivePlugin with Angular template-based card renderer.
|
|
176
|
+
* - If plugin exists: updates its cardRenderer configuration
|
|
177
|
+
* - If plugin doesn't exist but <tbw-grid-responsive-card> is present: logs a warning
|
|
178
|
+
*/
|
|
179
|
+
private configureResponsiveCard;
|
|
174
180
|
ngOnDestroy(): void;
|
|
175
181
|
}
|
|
176
182
|
//# sourceMappingURL=grid.directive.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grid.directive.d.ts","sourceRoot":"","sources":["../../../../../libs/grid-angular/src/lib/directives/grid.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAQhB,SAAS,EACT,MAAM,EAGP,MAAM,eAAe,CAAC;AAGvB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAGlE;;GAEG;AACH,MAAM,WAAW,eAAe,CAAC,IAAI,GAAG,OAAO,EAAE,MAAM,GAAG,OAAO;IAC/D,0BAA0B;IAC1B,GAAG,EAAE,IAAI,CAAC;IACV,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,+BAA+B;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,sCAAsC;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,gDAAgD;IAChD,WAAW,EAAE,IAAI,EAAE,CAAC;IACpB,iDAAiD;IACjD,iBAAiB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC/B,yDAAyD;IACzD,eAAe,EAAE,OAAO,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,cAAc,CAAC,IAAI,GAAG,OAAO;IAC5C,0BAA0B;IAC1B,GAAG,EAAE,IAAI,CAAC;IACV,sCAAsC;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,gDAAgD;IAChD,WAAW,EAAE,IAAI,EAAE,CAAC;IACpB,iDAAiD;IACjD,iBAAiB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC/B,yDAAyD;IACzD,eAAe,EAAE,OAAO,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,qBACa,IAAK,YAAW,MAAM,EAAE,gBAAgB,EAAE,SAAS;IAC9D,OAAO,CAAC,UAAU,CAAmC;IACrD,OAAO,CAAC,QAAQ,CAA+B;IAC/C,OAAO,CAAC,MAAM,CAA0B;IACxC,OAAO,CAAC,gBAAgB,CAA4B;IAEpD,OAAO,CAAC,OAAO,CAAmC;IAClD,OAAO,CAAC,kBAAkB,CAAqC;;IAgB/D,OAAO,CAAC,iBAAiB,CAAqC;IAE9D;;;;;;;;;;;;;;;;OAgBG;IACH,YAAY,0DAAmB;IAE/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkCG;IAEH,aAAa,0EAAmC;IAEhD;;;;;;;;;;;;;;OAcG;IACH,UAAU,8EAA6B;IAEvC;;;;;;;;OAQG;IACH,SAAS,oEAA4B;IAErC,QAAQ,IAAI,IAAI;IAyBhB,kBAAkB,IAAI,IAAI;
|
|
1
|
+
{"version":3,"file":"grid.directive.d.ts","sourceRoot":"","sources":["../../../../../libs/grid-angular/src/lib/directives/grid.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAQhB,SAAS,EACT,MAAM,EAGP,MAAM,eAAe,CAAC;AAGvB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAGlE;;GAEG;AACH,MAAM,WAAW,eAAe,CAAC,IAAI,GAAG,OAAO,EAAE,MAAM,GAAG,OAAO;IAC/D,0BAA0B;IAC1B,GAAG,EAAE,IAAI,CAAC;IACV,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,+BAA+B;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,sCAAsC;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,gDAAgD;IAChD,WAAW,EAAE,IAAI,EAAE,CAAC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9 @@
|
|
|
1
1
|
export { GridColumnEditor } from './grid-column-editor.directive';
|
|
2
2
|
export { GridColumnView } from './grid-column-view.directive';
|
|
3
3
|
export { GridDetailView } from './grid-detail-view.directive';
|
|
4
|
+
export { getFormArrayContext, GridFormArray } from './grid-form-array.directive';
|
|
5
|
+
export type { FormArrayContext } from './grid-form-array.directive';
|
|
6
|
+
export { GridResponsiveCard } from './grid-responsive-card.directive';
|
|
4
7
|
export { GridToolPanel } from './grid-tool-panel.directive';
|
|
5
8
|
export { Grid } from './grid.directive';
|
|
6
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../libs/grid-angular/src/lib/directives/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../libs/grid-angular/src/lib/directives/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACjF,YAAY,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { OnDestroy, TemplateRef } from '@angular/core';
|
|
2
|
+
import { AbstractControl } from '@angular/forms';
|
|
2
3
|
/**
|
|
3
4
|
* Context type for structural directives with `any` defaults.
|
|
4
5
|
* This provides better ergonomics in templates without requiring explicit type annotations.
|
|
@@ -38,6 +39,15 @@ export interface StructuralEditorContext<TValue = any, TRow = any> {
|
|
|
38
39
|
* Callback function to cancel editing.
|
|
39
40
|
*/
|
|
40
41
|
onCancel: () => void;
|
|
42
|
+
/**
|
|
43
|
+
* The FormControl for this cell, if the grid is bound to a FormArray with FormGroups.
|
|
44
|
+
*
|
|
45
|
+
* Returns `undefined` if:
|
|
46
|
+
* - The grid is not bound to a FormArray
|
|
47
|
+
* - The FormArray doesn't contain FormGroups
|
|
48
|
+
* - The field doesn't exist in the FormGroup
|
|
49
|
+
*/
|
|
50
|
+
control?: AbstractControl;
|
|
41
51
|
}
|
|
42
52
|
/**
|
|
43
53
|
* Gets the view template registered by the structural directive for a given column element.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"structural-directives.d.ts","sourceRoot":"","sources":["../../../../../libs/grid-angular/src/lib/directives/structural-directives.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyC,SAAS,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"structural-directives.d.ts","sourceRoot":"","sources":["../../../../../libs/grid-angular/src/lib/directives/structural-directives.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyC,SAAS,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC9F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAItD;;;;;GAKG;AAEH,MAAM,WAAW,qBAAqB,CAAC,MAAM,GAAG,GAAG,EAAE,IAAI,GAAG,GAAG;IAC7D,qCAAqC;IACrC,SAAS,EAAE,MAAM,CAAC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;;GA2CG;AACH,qBACa,SAAU,YAAW,SAAS;IACzC,OAAO,CAAC,QAAQ,CAAgD;IAChE,OAAO,CAAC,UAAU,CAAmC;IACrD,OAAO,CAAC,aAAa,CAA4B;;IAQjD,OAAO,CAAC,gBAAgB;IAaxB,WAAW,IAAI,IAAI;IAMnB;;;OAGG;IACH,MAAM,CAAC,sBAAsB,CAAC,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,uBAAuB;CAG5F"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toolbox-web/grid-angular",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Angular adapter for @toolbox-web/grid data grid component",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -48,6 +48,6 @@
|
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"@angular/core": ">=17.0.0",
|
|
51
|
-
"@toolbox-web/grid": ">=0.
|
|
51
|
+
"@toolbox-web/grid": ">=1.0.0"
|
|
52
52
|
}
|
|
53
53
|
}
|