@rxap/data-grid 16.0.0-dev.1 → 16.0.0-dev.3
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/CHANGELOG.md +195 -0
- package/README.md +7 -22
- package/esm2022/index.mjs +4 -4
- package/esm2022/lib/data-grid-cell-def.directive.mjs +7 -7
- package/esm2022/lib/data-grid-edit-cell-def.directive.mjs +8 -8
- package/esm2022/lib/data-grid-header-cell-def.directive.mjs +7 -7
- package/esm2022/lib/data-grid-row-def.directive.mjs +30 -15
- package/esm2022/lib/data-grid-value.pipe.mjs +22 -0
- package/esm2022/lib/data-grid.component.mjs +263 -0
- package/esm2022/lib/data-grid.module.mjs +40 -0
- package/esm2022/rxap-data-grid.mjs +1 -1
- package/fesm2022/rxap-data-grid.mjs +324 -80
- package/fesm2022/rxap-data-grid.mjs.map +1 -1
- package/index.d.ts +3 -3
- package/lib/data-grid-cell-def.directive.d.ts +1 -1
- package/lib/data-grid-edit-cell-def.directive.d.ts +3 -4
- package/lib/data-grid-header-cell-def.directive.d.ts +1 -1
- package/lib/data-grid-row-def.directive.d.ts +20 -2
- package/lib/data-grid-value.pipe.d.ts +8 -0
- package/lib/data-grid.component.d.ts +71 -0
- package/lib/data-grid.module.d.ts +11 -0
- package/package.json +60 -45
- package/LICENSE +0 -27
- package/collection.json +0 -10
- package/esm2022/lib/data-grid.component.module.mjs +0 -36
- package/esm2022/lib/readonly/data-grid-readonly.component.mjs +0 -35
- package/esm2022/lib/readonly/data-grid-readonly.component.module.mjs +0 -32
- package/lib/data-grid.component.module.d.ts +0 -10
- package/lib/readonly/data-grid-readonly.component.d.ts +0 -10
- package/lib/readonly/data-grid-readonly.component.module.d.ts +0 -10
- package/migration.json +0 -4
- package/src/schematics/ng-add/index.d.ts +0 -2
- package/src/schematics/ng-add/index.js +0 -8
- package/src/schematics/ng-add/index.js.map +0 -1
- package/src/schematics/ng-add/schema.json +0 -7
|
@@ -1,11 +1,28 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { TemplateRef, Directive, Inject, Input, ContentChild,
|
|
2
|
+
import { TemplateRef, Directive, Inject, Input, ContentChild, Pipe, isDevMode, EventEmitter, QueryList, Component, ChangeDetectionStrategy, ViewEncapsulation, Optional, ContentChildren, Output, NgModule } from '@angular/core';
|
|
3
|
+
import { getFromObject, clone, Required } from '@rxap/utilities';
|
|
4
|
+
import { map, filter, tap, shareReplay, take } from 'rxjs/operators';
|
|
3
5
|
import { __decorate, __metadata } from 'tslib';
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
6
|
+
import * as i1 from '@angular/router';
|
|
7
|
+
import { ActivationEnd } from '@angular/router';
|
|
8
|
+
import * as i2 from '@rxap/forms';
|
|
9
|
+
import { RxapFormsModule } from '@rxap/forms';
|
|
10
|
+
import { ToggleSubject } from '@rxap/rxjs';
|
|
11
|
+
import { EMPTY, BehaviorSubject, merge, of, debounceTime, combineLatest } from 'rxjs';
|
|
12
|
+
import * as i3 from '@angular/material/button';
|
|
13
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
14
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
15
|
+
import { GetFromObjectPipe, ReplacePipe, EscapeQuotationMarkPipe } from '@rxap/pipes';
|
|
16
|
+
import * as i4 from '@angular/material/progress-spinner';
|
|
17
|
+
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
18
|
+
import { FlexLayoutModule } from '@angular/flex-layout';
|
|
19
|
+
import * as i7 from '@angular/material/divider';
|
|
20
|
+
import { MatDividerModule } from '@angular/material/divider';
|
|
21
|
+
import { AsyncPipe, NgIf, NgFor, NgTemplateOutlet } from '@angular/common';
|
|
22
|
+
import * as i8 from '@angular/material/form-field';
|
|
23
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
24
|
+
import * as i5 from '@angular/flex-layout/flex';
|
|
25
|
+
import * as i6 from '@angular/flex-layout/extended';
|
|
9
26
|
|
|
10
27
|
class DataGridCellDefDirective {
|
|
11
28
|
static ngTemplateContextGuard(dir, ctx) {
|
|
@@ -14,13 +31,14 @@ class DataGridCellDefDirective {
|
|
|
14
31
|
constructor(template) {
|
|
15
32
|
this.template = template;
|
|
16
33
|
}
|
|
17
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.
|
|
18
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.
|
|
34
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DataGridCellDefDirective, deps: [{ token: TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
35
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: DataGridCellDefDirective, isStandalone: true, selector: "[rxapDataGridCellDef]", ngImport: i0 }); }
|
|
19
36
|
}
|
|
20
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
37
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DataGridCellDefDirective, decorators: [{
|
|
21
38
|
type: Directive,
|
|
22
39
|
args: [{
|
|
23
40
|
selector: '[rxapDataGridCellDef]',
|
|
41
|
+
standalone: true,
|
|
24
42
|
}]
|
|
25
43
|
}], ctorParameters: function () { return [{ type: i0.TemplateRef, decorators: [{
|
|
26
44
|
type: Inject,
|
|
@@ -34,13 +52,14 @@ class DataGridHeaderCellDefDirective {
|
|
|
34
52
|
constructor(template) {
|
|
35
53
|
this.template = template;
|
|
36
54
|
}
|
|
37
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.
|
|
38
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.
|
|
55
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DataGridHeaderCellDefDirective, deps: [{ token: TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
56
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: DataGridHeaderCellDefDirective, isStandalone: true, selector: "[rxapDataGridHeaderCellDef]", ngImport: i0 }); }
|
|
39
57
|
}
|
|
40
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
58
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DataGridHeaderCellDefDirective, decorators: [{
|
|
41
59
|
type: Directive,
|
|
42
60
|
args: [{
|
|
43
61
|
selector: '[rxapDataGridHeaderCellDef]',
|
|
62
|
+
standalone: true,
|
|
44
63
|
}]
|
|
45
64
|
}], ctorParameters: function () { return [{ type: i0.TemplateRef, decorators: [{
|
|
46
65
|
type: Inject,
|
|
@@ -54,13 +73,14 @@ class DataGridEditCellDefDirective {
|
|
|
54
73
|
constructor(template) {
|
|
55
74
|
this.template = template;
|
|
56
75
|
}
|
|
57
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.
|
|
58
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.
|
|
76
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DataGridEditCellDefDirective, deps: [{ token: TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
77
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: DataGridEditCellDefDirective, isStandalone: true, selector: "[rxapDataGridEditCellDef]", ngImport: i0 }); }
|
|
59
78
|
}
|
|
60
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
79
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DataGridEditCellDefDirective, decorators: [{
|
|
61
80
|
type: Directive,
|
|
62
81
|
args: [{
|
|
63
|
-
selector: '[rxapDataGridEditCellDef]'
|
|
82
|
+
selector: '[rxapDataGridEditCellDef]',
|
|
83
|
+
standalone: true,
|
|
64
84
|
}]
|
|
65
85
|
}], ctorParameters: function () { return [{ type: i0.TemplateRef, decorators: [{
|
|
66
86
|
type: Inject,
|
|
@@ -70,25 +90,43 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImpor
|
|
|
70
90
|
class DataGridRowDefDirective {
|
|
71
91
|
constructor() {
|
|
72
92
|
this.data = null;
|
|
93
|
+
/**
|
|
94
|
+
* true - the header and content cell are "rotated" by 90°. The header is above the content cell and both have a
|
|
95
|
+
* colspan
|
|
96
|
+
*
|
|
97
|
+
* **flip: false**
|
|
98
|
+
* Label | Value
|
|
99
|
+
* --- | ---
|
|
100
|
+
* Header | Content
|
|
101
|
+
*
|
|
102
|
+
* **flip: true**
|
|
103
|
+
* Label | Value
|
|
104
|
+
* --- | ---
|
|
105
|
+
* Header (colspan 2)
|
|
106
|
+
* Content (colspan 2)
|
|
107
|
+
*
|
|
108
|
+
*/
|
|
109
|
+
this.flip = false;
|
|
73
110
|
}
|
|
74
|
-
|
|
75
|
-
|
|
111
|
+
get isSubHeader() {
|
|
112
|
+
return !this.name;
|
|
113
|
+
}
|
|
114
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DataGridRowDefDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
115
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: DataGridRowDefDirective, isStandalone: true, selector: "[rxapDataGridRowDef]", inputs: { data: "data", name: ["rxapDataGridRowDef", "name"], flip: "flip" }, queries: [{ propertyName: "cell", first: true, predicate: DataGridCellDefDirective, descendants: true }, { propertyName: "headerCell", first: true, predicate: DataGridHeaderCellDefDirective, descendants: true }, { propertyName: "editCell", first: true, predicate: DataGridEditCellDefDirective, descendants: true }], ngImport: i0 }); }
|
|
76
116
|
}
|
|
77
|
-
|
|
78
|
-
Required,
|
|
79
|
-
__metadata("design:type", String)
|
|
80
|
-
], DataGridRowDefDirective.prototype, "name", void 0);
|
|
81
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: DataGridRowDefDirective, decorators: [{
|
|
117
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DataGridRowDefDirective, decorators: [{
|
|
82
118
|
type: Directive,
|
|
83
119
|
args: [{
|
|
84
|
-
|
|
85
|
-
|
|
120
|
+
selector: '[rxapDataGridRowDef]',
|
|
121
|
+
standalone: true,
|
|
86
122
|
}]
|
|
87
123
|
}], propDecorators: { data: [{
|
|
88
124
|
type: Input
|
|
89
125
|
}], name: [{
|
|
90
126
|
type: Input,
|
|
91
127
|
args: ['rxapDataGridRowDef']
|
|
128
|
+
}], flip: [{
|
|
129
|
+
type: Input
|
|
92
130
|
}], cell: [{
|
|
93
131
|
type: ContentChild,
|
|
94
132
|
args: [DataGridCellDefDirective]
|
|
@@ -100,84 +138,290 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImpor
|
|
|
100
138
|
args: [DataGridEditCellDefDirective]
|
|
101
139
|
}] } });
|
|
102
140
|
|
|
103
|
-
class
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: DataGridModule }); }
|
|
141
|
+
class DataGridValuePipe {
|
|
142
|
+
transform(data, path) {
|
|
143
|
+
if (!path) {
|
|
144
|
+
throw new Error('FATAL: The path is required! Ensure the data grid row has a defined name property!');
|
|
145
|
+
}
|
|
146
|
+
return data.pipe(map(source => getFromObject(source, path)));
|
|
147
|
+
}
|
|
148
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DataGridValuePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
149
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type: DataGridValuePipe, isStandalone: true, name: "dataGridValue" }); }
|
|
113
150
|
}
|
|
114
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
115
|
-
type:
|
|
151
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DataGridValuePipe, decorators: [{
|
|
152
|
+
type: Pipe,
|
|
116
153
|
args: [{
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
DataGridHeaderCellDefDirective,
|
|
120
|
-
DataGridCellDefDirective,
|
|
121
|
-
DataGridEditCellDefDirective
|
|
122
|
-
],
|
|
123
|
-
exports: [
|
|
124
|
-
DataGridRowDefDirective,
|
|
125
|
-
DataGridHeaderCellDefDirective,
|
|
126
|
-
DataGridCellDefDirective,
|
|
127
|
-
DataGridEditCellDefDirective
|
|
128
|
-
]
|
|
154
|
+
name: 'dataGridValue',
|
|
155
|
+
standalone: true,
|
|
129
156
|
}]
|
|
130
157
|
}] });
|
|
131
158
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
159
|
+
var DataGridMode;
|
|
160
|
+
(function (DataGridMode) {
|
|
161
|
+
/**
|
|
162
|
+
* The view cell template is used to display the property value
|
|
163
|
+
*/
|
|
164
|
+
DataGridMode["PLAIN"] = "plain";
|
|
165
|
+
/**
|
|
166
|
+
* The edit cell template is used to display the property value, but the form and all controls are marked as disabled
|
|
167
|
+
*/
|
|
168
|
+
DataGridMode["FORM"] = "form";
|
|
169
|
+
})(DataGridMode || (DataGridMode = {}));
|
|
170
|
+
function IsDataGridMode(value) {
|
|
171
|
+
return [DataGridMode.PLAIN, DataGridMode.FORM].includes(value);
|
|
172
|
+
}
|
|
173
|
+
class DataGridComponent {
|
|
174
|
+
constructor(cdr, router, formDirective) {
|
|
175
|
+
this.cdr = cdr;
|
|
176
|
+
this.router = router;
|
|
177
|
+
this.formDirective = formDirective;
|
|
178
|
+
this.isDevMode = isDevMode();
|
|
179
|
+
this.header = false;
|
|
180
|
+
this.viewer = this;
|
|
181
|
+
this.displayProperties = null;
|
|
182
|
+
this.editModeChange = new EventEmitter();
|
|
183
|
+
this.rows$ = EMPTY;
|
|
184
|
+
this.hasError$ = EMPTY;
|
|
185
|
+
this.dataLoading$ = EMPTY;
|
|
186
|
+
this.loading$ = new ToggleSubject();
|
|
187
|
+
this._editMode$ = new BehaviorSubject(false);
|
|
188
|
+
this._mode$ = new BehaviorSubject(DataGridMode.PLAIN);
|
|
189
|
+
this._routerEventSubscription = null;
|
|
190
|
+
this.isEditMode$ = this._editMode$.asObservable();
|
|
191
|
+
this.mode$ = this._mode$.asObservable();
|
|
192
|
+
this.isFormMode$ = this.mode$.pipe(map(mode => mode === DataGridMode.FORM));
|
|
193
|
+
this.isPlainMode$ = this.mode$.pipe(map(mode => mode === DataGridMode.PLAIN));
|
|
194
|
+
}
|
|
195
|
+
set mode(value) {
|
|
196
|
+
if (IsDataGridMode(value)) {
|
|
197
|
+
this._mode$.next(value);
|
|
198
|
+
}
|
|
199
|
+
else {
|
|
200
|
+
throw new Error(`The data grid mode only support 'plain' and 'form' - given '${value}'`);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
get isFormMode() {
|
|
204
|
+
return this._mode$.value === DataGridMode.FORM;
|
|
205
|
+
}
|
|
206
|
+
get hasAnyEditCells() {
|
|
207
|
+
return this.rows.some(row => !!row.editCell);
|
|
208
|
+
}
|
|
209
|
+
get isEditMode() {
|
|
210
|
+
return this._editMode$.value;
|
|
211
|
+
}
|
|
212
|
+
set editMode(value) {
|
|
213
|
+
this._editMode$.next(value);
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* @deprecated use the loading$ property instead
|
|
217
|
+
*/
|
|
218
|
+
get loading() {
|
|
219
|
+
return this.loading$.value;
|
|
220
|
+
}
|
|
221
|
+
ngAfterContentInit() {
|
|
222
|
+
this.rows$ = merge(of(this.rows), this.rows.changes);
|
|
223
|
+
}
|
|
224
|
+
logCurrentFormState() {
|
|
225
|
+
console.log(clone(this.formDirective?.form.value));
|
|
226
|
+
}
|
|
227
|
+
ngOnInit() {
|
|
228
|
+
// resets the edit mode if this component is used in a sibling router path
|
|
229
|
+
// if not reset the edit mode is president after the route changes
|
|
230
|
+
this._routerEventSubscription = this.router.events.pipe(filter(event => event instanceof ActivationEnd), tap(() => this.disableEditMode())).subscribe();
|
|
231
|
+
if (this.dataSource && this.data) {
|
|
232
|
+
throw new Error('You can not use both dataSource and data input');
|
|
233
|
+
}
|
|
234
|
+
let data$ = EMPTY;
|
|
235
|
+
if (this.dataSource) {
|
|
236
|
+
data$ = this.dataSource.connect(this.viewer);
|
|
237
|
+
}
|
|
238
|
+
if (this.data) {
|
|
239
|
+
data$ = of(this.data);
|
|
240
|
+
}
|
|
241
|
+
if (data$ === EMPTY && isDevMode()) {
|
|
242
|
+
console.warn('No data source or data input provided');
|
|
243
|
+
}
|
|
244
|
+
this.data$ = data$.pipe(debounceTime(100), tap(data => this.data = data), tap(data => {
|
|
245
|
+
if (this.formDirective) {
|
|
246
|
+
this.formDirective.form.patchValue(data, {
|
|
247
|
+
coerce: true,
|
|
248
|
+
strict: true,
|
|
249
|
+
});
|
|
250
|
+
if (this.isFormMode) {
|
|
251
|
+
this.formDirective.form.disable();
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}), shareReplay(1));
|
|
255
|
+
if (this.dataSource) {
|
|
256
|
+
this.hasError$ = this.dataSource.hasError$;
|
|
257
|
+
this.dataLoading$ = this.dataSource.loading$;
|
|
258
|
+
}
|
|
259
|
+
else {
|
|
260
|
+
this.hasError$ = of(false);
|
|
261
|
+
this.dataLoading$ = of(false);
|
|
262
|
+
}
|
|
263
|
+
if (this.formDirective && this.isFormMode) {
|
|
264
|
+
this.formDirective.form.disabledWhile(combineLatest([
|
|
265
|
+
this._editMode$,
|
|
266
|
+
this._mode$,
|
|
267
|
+
]).pipe(map(([editMode, mode]) => !editMode && mode === 'form')), { onlySelf: false });
|
|
268
|
+
}
|
|
135
269
|
}
|
|
136
|
-
|
|
137
|
-
|
|
270
|
+
ngOnDestroy() {
|
|
271
|
+
this.dataSource?.disconnect(this.viewer);
|
|
272
|
+
this._routerEventSubscription?.unsubscribe();
|
|
273
|
+
}
|
|
274
|
+
enableEditMode() {
|
|
275
|
+
if (!this.formDirective) {
|
|
276
|
+
if (isDevMode()) {
|
|
277
|
+
console.warn('Can not enable edit mode without a form directive');
|
|
278
|
+
}
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
this.editMode = true;
|
|
282
|
+
if (this.data) {
|
|
283
|
+
this.formDirective.form.patchValue(this.data, {
|
|
284
|
+
coerce: true,
|
|
285
|
+
strict: true,
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
disableEditMode() {
|
|
290
|
+
if (!this.formDirective) {
|
|
291
|
+
if (isDevMode()) {
|
|
292
|
+
console.warn('Can not enable edit mode without a form directive');
|
|
293
|
+
}
|
|
294
|
+
return;
|
|
295
|
+
}
|
|
296
|
+
this.editMode = false;
|
|
297
|
+
}
|
|
298
|
+
submit() {
|
|
299
|
+
if (!this.formDirective) {
|
|
300
|
+
if (isDevMode()) {
|
|
301
|
+
console.warn('Can not support without a form directive');
|
|
302
|
+
}
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
305
|
+
this.loading$.enable();
|
|
306
|
+
this.formDirective.form.markAllAsDirty();
|
|
307
|
+
this.formDirective.form.markAllAsTouched();
|
|
308
|
+
this.formDirective.cdr.markForCheck();
|
|
309
|
+
this.formDirective.rxapSubmit.pipe(take(1), tap(() => {
|
|
310
|
+
this.disableEditMode();
|
|
311
|
+
})).subscribe();
|
|
312
|
+
this.formDirective.invalidSubmit.pipe(take(1), tap(() => {
|
|
313
|
+
this.loading$.disable();
|
|
314
|
+
})).subscribe();
|
|
315
|
+
this.formDirective.submitError$.pipe(filter(Boolean), // if the error is undefined we do not want to disable the loading
|
|
316
|
+
take(1), tap(() => {
|
|
317
|
+
this.loading$.disable();
|
|
318
|
+
})).subscribe();
|
|
319
|
+
this.formDirective.submitSuccessful$.pipe(take(1), tap(() => {
|
|
320
|
+
this.loading$.disable();
|
|
321
|
+
this.refresh();
|
|
322
|
+
})).subscribe();
|
|
323
|
+
this.formDirective.onSubmit(new Event('submit'));
|
|
324
|
+
}
|
|
325
|
+
reset() {
|
|
326
|
+
if (this.formDirective && this.data) {
|
|
327
|
+
this.formDirective.form.patchValue(this.data, {
|
|
328
|
+
coerce: true,
|
|
329
|
+
strict: true,
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
refresh() {
|
|
334
|
+
if (this.dataSource) {
|
|
335
|
+
this.dataSource.refresh();
|
|
336
|
+
}
|
|
337
|
+
else if (isDevMode()) {
|
|
338
|
+
console.warn('can not refresh the data. data source is not defined');
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
cancel() {
|
|
342
|
+
this.reset();
|
|
343
|
+
this.disableEditMode();
|
|
344
|
+
}
|
|
345
|
+
retry() {
|
|
346
|
+
this.refresh();
|
|
347
|
+
}
|
|
348
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DataGridComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1.Router }, { token: i2.FormDirective, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
349
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: DataGridComponent, isStandalone: true, selector: "rxap-data-grid", inputs: { header: "header", dataSource: "dataSource", viewer: "viewer", data: "data", displayProperties: "displayProperties", mode: "mode" }, outputs: { editModeChange: "editModeChange" }, queries: [{ propertyName: "rows", predicate: DataGridRowDefDirective }], ngImport: i0, template: "<div *ngIf=\"(hasError$ | async)\" class=\"info-container\" fxLayout=\"column\" fxLayoutAlign=\"center center\"\n fxLayoutGap=\"32px\">\n <span i18n>Something has gone wrong!</span>\n <button (click)=\"retry()\" i18n mat-stroked-button>Retry</button>\n</div>\n<div *ngIf=\"(dataLoading$ | async)\" class=\"info-container\" fxLayout=\"column\" fxLayoutAlign=\"center center\"\n fxLayoutGap=\"32px\">\n <mat-spinner></mat-spinner>\n</div>\n<!-- if the dataSource input is used. It is possible the the hasError$ or loading$ property is === EMPTY. this would\nresults in an null as output. If the === false check is used this can result into the behavior that the data grid is\nnever shown. -->\n<!-- eslint-disable-next-line @angular-eslint/template/no-negated-async -->\n<table *ngIf=\"!(hasError$ | async) && !(dataLoading$ | async)\" class=\"data-grid\">\n <thead *ngIf=\"header\">\n <tr>\n <th i18n>Label</th>\n <th i18n>Value</th>\n </tr>\n </thead>\n <tbody>\n <ng-template [ngForOf]=\"rows$ | async\" let-first=\"first\" let-row ngFor>\n <ng-template [ngIf]=\"!displayProperties || row.isSubHeader || (row.name && displayProperties.includes(row.name))\">\n <ng-template [ngIfElse]=\"normal\" [ngIf]=\"row.flip\">\n <tr>\n <td class=\"divider\" colspan=\"2\">\n <mat-divider></mat-divider>\n </td>\n </tr>\n <tr [attr.data-name]=\"row.name + '-header'\">\n <ng-container\n *ngTemplateOutlet=\"\n row.headerCell?.template ?? defaultHeaderCell;\n context: { $implicit: row.name }\n \"\n >\n </ng-container>\n </tr>\n <tr [attr.data-name]=\"row.name + '-value'\">\n <ng-template [ngIfThen]=\"content\" [ngIf]=\"row.name\"></ng-template>\n </tr>\n <tr>\n <td class=\"divider\" colspan=\"2\">\n <mat-divider></mat-divider>\n </td>\n </tr>\n </ng-template>\n <ng-template #normal>\n <tr *ngIf=\"!first && row.isSubHeader\">\n <td class=\"divider\" colspan=\"2\">\n <mat-divider></mat-divider>\n </td>\n </tr>\n <tr [attr.data-name]=\"row.name\" [ngClass]=\"{ 'sub-header': row.isSubHeader }\">\n <ng-container\n *ngTemplateOutlet=\"\n row.headerCell?.template ?? defaultHeaderCell;\n context: { $implicit: row.name }\n \"\n >\n </ng-container>\n <ng-template [ngIfThen]=\"content\" [ngIf]=\"row.name\"></ng-template>\n </tr>\n </ng-template>\n </ng-template>\n <ng-template #content>\n <ng-template [ngIfElse]=\"readonlyCell\" [ngIfThen]=\"writeCell\" [ngIf]=\"row.editCell?.template\"></ng-template>\n <ng-template #writeCell>\n <ng-template #viewMode>\n <td [attr.colspan]=\"row.flip ? 2 : 1\" class=\"value\">\n <div>\n <ng-container\n *ngTemplateOutlet=\"\n row.cell?.template ?? defaultCell;\n context: { $implicit: data$ | dataGridValue: row.name | async, data: data$ | async }\n \"\n ></ng-container>\n </div>\n </td>\n </ng-template>\n <ng-template #editMode>\n <td [attr.colspan]=\"row.flip ? 2 : 1\" class=\"edit\">\n <div>\n <ng-container\n *ngTemplateOutlet=\"\n row.editCell?.template ?? row.cell?.template ?? defaultCell;\n context: { $implicit: data$ | dataGridValue: row.name | async, data: data$ | async }\n \"\n ></ng-container>\n </div>\n </td>\n </ng-template>\n <ng-template [ngIfElse]=\"viewMode\" [ngIfThen]=\"editMode\" [ngIf]=\"isEditMode || isFormMode\"></ng-template>\n </ng-template>\n <ng-template #readonlyCell>\n <td [attr.colspan]=\"row.flip ? 2 : 1\" class=\"value\">\n <div>\n <ng-container\n *ngTemplateOutlet=\"\n row.cell?.template ?? defaultCell;\n context: { $implicit: data$ | dataGridValue: row.name | async, data: data$ | async }\n \"\n ></ng-container>\n </div>\n </td>\n </ng-template>\n </ng-template>\n </ng-template>\n </tbody>\n <tfoot *ngIf=\"hasAnyEditCells\">\n <tr>\n <td colspan=\"2\">\n <ng-template [ngIfElse]=\"viewModeButton\" [ngIf]=\"isEditMode\">\n <div fxLayout=\"column\" fxLayoutGap=\"24px\">\n <div fxLayout=\"row\" fxLayoutAlign=\"start center\" fxLayoutGap=\"24px\">\n <button (click)=\"submit()\" [disabled]=\"loading$ | async\" class=\"control-button\" color=\"primary\"\n mat-raised-button type=\"button\">\n <span fxLayout=\"row\" fxLayoutAlign=\"center center\" fxLayoutGap=\"24px\">\n <span i18n>Save</span>\n <mat-spinner *ngIf=\"loading$ | async\" color=\"accent\" diameter=\"15\"></mat-spinner>\n </span>\n </button>\n <button (click)=\"reset()\" [disabled]=\"loading$ | async\" class=\"control-button\" mat-stroked-button\n type=\"button\">\n <ng-container i18n>Reset</ng-container>\n </button>\n <button (click)=\"cancel()\" [disabled]=\"loading$ | async\" class=\"control-button\" color=\"warn\"\n mat-stroked-button type=\"button\">\n <ng-container i18n>Cancel</ng-container>\n </button>\n <button (click)=\"logCurrentFormState()\" *ngIf=\"isDevMode\" class=\"control-button\" mat-button\n type=\"button\">Current Form State\n </button>\n </div>\n <ng-template rxapFormSubmitInvalid>\n <mat-error i18n>Ensure all formula fields are valid.</mat-error>\n </ng-template>\n\n <ng-template let-error rxapFormSubmitFailed>\n <mat-error>{{ error.message }}</mat-error>\n </ng-template>\n\n <ng-template rxapFormSubmitSuccessful>\n <span i18n>Submit successfully.</span>\n </ng-template>\n </div>\n </ng-template>\n <ng-template #viewModeButton>\n <button (click)=\"enableEditMode()\" class=\"control-button\" color=\"primary\" mat-raised-button type=\"button\">\n <span fxLayout=\"row\" fxLayoutAlign=\"center center\" fxLayoutGap=\"24px\">\n <span i18n>Edit</span>\n <mat-spinner *ngIf=\"loading$ | async\" color=\"accent\" diameter=\"15\"></mat-spinner>\n </span>\n </button>\n </ng-template>\n </td>\n </tr>\n </tfoot>\n</table>\n\n<ng-template #defaultCell let-value>\n <span>{{ value }}</span>\n</ng-template>\n<ng-template #defaultHeaderCell let-name>\n <th>{{ name }}</th>\n</ng-template>\n", styles: [".info-container{padding:64px}.rxap-data-grid table.data-grid{border:0}.rxap-data-grid table.data-grid thead{padding-bottom:16px}.rxap-data-grid table.data-grid thead tr th{border-spacing:32px 16px}.rxap-data-grid table.data-grid tfoot .control-button{margin-top:24px;min-width:128px}.rxap-data-grid table.data-grid th{text-align:right;padding-right:24px}.rxap-data-grid table.data-grid tbody tr>th.sub-header{padding-bottom:12px;padding-right:24px;text-align:right}.rxap-data-grid table.data-grid tbody tr>th:first-child{text-align:right;font-weight:bolder;padding-right:24px}.rxap-data-grid table.data-grid tbody td.divider{padding:4px 0}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "ngmodule", type: RxapFormsModule }, { kind: "directive", type: i2.FormSubmitFailedDirective, selector: "[rxapFormSubmitFailed]" }, { kind: "directive", type: i2.FormSubmitSuccessfulDirective, selector: "[rxapFormSubmitSuccessful]" }, { kind: "directive", type: i2.FormSubmitInvalidDirective, selector: "[rxapFormSubmitInvalid]" }, { kind: "pipe", type: DataGridValuePipe, name: "dataGridValue" }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i4.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "ngmodule", type: FlexLayoutModule }, { kind: "directive", type: i5.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i5.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { kind: "directive", type: i5.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i6.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }, { kind: "ngmodule", type: MatDividerModule }, { kind: "component", type: i7.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "directive", type: i8.MatError, selector: "mat-error, [matError]", inputs: ["id"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
138
350
|
}
|
|
139
|
-
__decorate([
|
|
140
|
-
Required,
|
|
141
|
-
__metadata("design:type", Object)
|
|
142
|
-
], DataGridReadonlyComponent.prototype, "data", void 0);
|
|
143
351
|
__decorate([
|
|
144
352
|
Required,
|
|
145
353
|
__metadata("design:type", QueryList)
|
|
146
|
-
],
|
|
147
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
354
|
+
], DataGridComponent.prototype, "rows", void 0);
|
|
355
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DataGridComponent, decorators: [{
|
|
148
356
|
type: Component,
|
|
149
|
-
args: [{ selector: 'rxap-data-grid
|
|
150
|
-
|
|
357
|
+
args: [{ selector: 'rxap-data-grid', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, standalone: true, imports: [
|
|
358
|
+
AsyncPipe,
|
|
359
|
+
NgIf,
|
|
360
|
+
NgFor,
|
|
361
|
+
MatButtonModule,
|
|
362
|
+
MatIconModule,
|
|
363
|
+
GetFromObjectPipe,
|
|
364
|
+
ReplacePipe,
|
|
365
|
+
EscapeQuotationMarkPipe,
|
|
366
|
+
RxapFormsModule,
|
|
367
|
+
DataGridValuePipe,
|
|
368
|
+
MatProgressSpinnerModule,
|
|
369
|
+
FlexLayoutModule,
|
|
370
|
+
MatDividerModule,
|
|
371
|
+
NgTemplateOutlet,
|
|
372
|
+
MatFormFieldModule,
|
|
373
|
+
], template: "<div *ngIf=\"(hasError$ | async)\" class=\"info-container\" fxLayout=\"column\" fxLayoutAlign=\"center center\"\n fxLayoutGap=\"32px\">\n <span i18n>Something has gone wrong!</span>\n <button (click)=\"retry()\" i18n mat-stroked-button>Retry</button>\n</div>\n<div *ngIf=\"(dataLoading$ | async)\" class=\"info-container\" fxLayout=\"column\" fxLayoutAlign=\"center center\"\n fxLayoutGap=\"32px\">\n <mat-spinner></mat-spinner>\n</div>\n<!-- if the dataSource input is used. It is possible the the hasError$ or loading$ property is === EMPTY. this would\nresults in an null as output. If the === false check is used this can result into the behavior that the data grid is\nnever shown. -->\n<!-- eslint-disable-next-line @angular-eslint/template/no-negated-async -->\n<table *ngIf=\"!(hasError$ | async) && !(dataLoading$ | async)\" class=\"data-grid\">\n <thead *ngIf=\"header\">\n <tr>\n <th i18n>Label</th>\n <th i18n>Value</th>\n </tr>\n </thead>\n <tbody>\n <ng-template [ngForOf]=\"rows$ | async\" let-first=\"first\" let-row ngFor>\n <ng-template [ngIf]=\"!displayProperties || row.isSubHeader || (row.name && displayProperties.includes(row.name))\">\n <ng-template [ngIfElse]=\"normal\" [ngIf]=\"row.flip\">\n <tr>\n <td class=\"divider\" colspan=\"2\">\n <mat-divider></mat-divider>\n </td>\n </tr>\n <tr [attr.data-name]=\"row.name + '-header'\">\n <ng-container\n *ngTemplateOutlet=\"\n row.headerCell?.template ?? defaultHeaderCell;\n context: { $implicit: row.name }\n \"\n >\n </ng-container>\n </tr>\n <tr [attr.data-name]=\"row.name + '-value'\">\n <ng-template [ngIfThen]=\"content\" [ngIf]=\"row.name\"></ng-template>\n </tr>\n <tr>\n <td class=\"divider\" colspan=\"2\">\n <mat-divider></mat-divider>\n </td>\n </tr>\n </ng-template>\n <ng-template #normal>\n <tr *ngIf=\"!first && row.isSubHeader\">\n <td class=\"divider\" colspan=\"2\">\n <mat-divider></mat-divider>\n </td>\n </tr>\n <tr [attr.data-name]=\"row.name\" [ngClass]=\"{ 'sub-header': row.isSubHeader }\">\n <ng-container\n *ngTemplateOutlet=\"\n row.headerCell?.template ?? defaultHeaderCell;\n context: { $implicit: row.name }\n \"\n >\n </ng-container>\n <ng-template [ngIfThen]=\"content\" [ngIf]=\"row.name\"></ng-template>\n </tr>\n </ng-template>\n </ng-template>\n <ng-template #content>\n <ng-template [ngIfElse]=\"readonlyCell\" [ngIfThen]=\"writeCell\" [ngIf]=\"row.editCell?.template\"></ng-template>\n <ng-template #writeCell>\n <ng-template #viewMode>\n <td [attr.colspan]=\"row.flip ? 2 : 1\" class=\"value\">\n <div>\n <ng-container\n *ngTemplateOutlet=\"\n row.cell?.template ?? defaultCell;\n context: { $implicit: data$ | dataGridValue: row.name | async, data: data$ | async }\n \"\n ></ng-container>\n </div>\n </td>\n </ng-template>\n <ng-template #editMode>\n <td [attr.colspan]=\"row.flip ? 2 : 1\" class=\"edit\">\n <div>\n <ng-container\n *ngTemplateOutlet=\"\n row.editCell?.template ?? row.cell?.template ?? defaultCell;\n context: { $implicit: data$ | dataGridValue: row.name | async, data: data$ | async }\n \"\n ></ng-container>\n </div>\n </td>\n </ng-template>\n <ng-template [ngIfElse]=\"viewMode\" [ngIfThen]=\"editMode\" [ngIf]=\"isEditMode || isFormMode\"></ng-template>\n </ng-template>\n <ng-template #readonlyCell>\n <td [attr.colspan]=\"row.flip ? 2 : 1\" class=\"value\">\n <div>\n <ng-container\n *ngTemplateOutlet=\"\n row.cell?.template ?? defaultCell;\n context: { $implicit: data$ | dataGridValue: row.name | async, data: data$ | async }\n \"\n ></ng-container>\n </div>\n </td>\n </ng-template>\n </ng-template>\n </ng-template>\n </tbody>\n <tfoot *ngIf=\"hasAnyEditCells\">\n <tr>\n <td colspan=\"2\">\n <ng-template [ngIfElse]=\"viewModeButton\" [ngIf]=\"isEditMode\">\n <div fxLayout=\"column\" fxLayoutGap=\"24px\">\n <div fxLayout=\"row\" fxLayoutAlign=\"start center\" fxLayoutGap=\"24px\">\n <button (click)=\"submit()\" [disabled]=\"loading$ | async\" class=\"control-button\" color=\"primary\"\n mat-raised-button type=\"button\">\n <span fxLayout=\"row\" fxLayoutAlign=\"center center\" fxLayoutGap=\"24px\">\n <span i18n>Save</span>\n <mat-spinner *ngIf=\"loading$ | async\" color=\"accent\" diameter=\"15\"></mat-spinner>\n </span>\n </button>\n <button (click)=\"reset()\" [disabled]=\"loading$ | async\" class=\"control-button\" mat-stroked-button\n type=\"button\">\n <ng-container i18n>Reset</ng-container>\n </button>\n <button (click)=\"cancel()\" [disabled]=\"loading$ | async\" class=\"control-button\" color=\"warn\"\n mat-stroked-button type=\"button\">\n <ng-container i18n>Cancel</ng-container>\n </button>\n <button (click)=\"logCurrentFormState()\" *ngIf=\"isDevMode\" class=\"control-button\" mat-button\n type=\"button\">Current Form State\n </button>\n </div>\n <ng-template rxapFormSubmitInvalid>\n <mat-error i18n>Ensure all formula fields are valid.</mat-error>\n </ng-template>\n\n <ng-template let-error rxapFormSubmitFailed>\n <mat-error>{{ error.message }}</mat-error>\n </ng-template>\n\n <ng-template rxapFormSubmitSuccessful>\n <span i18n>Submit successfully.</span>\n </ng-template>\n </div>\n </ng-template>\n <ng-template #viewModeButton>\n <button (click)=\"enableEditMode()\" class=\"control-button\" color=\"primary\" mat-raised-button type=\"button\">\n <span fxLayout=\"row\" fxLayoutAlign=\"center center\" fxLayoutGap=\"24px\">\n <span i18n>Edit</span>\n <mat-spinner *ngIf=\"loading$ | async\" color=\"accent\" diameter=\"15\"></mat-spinner>\n </span>\n </button>\n </ng-template>\n </td>\n </tr>\n </tfoot>\n</table>\n\n<ng-template #defaultCell let-value>\n <span>{{ value }}</span>\n</ng-template>\n<ng-template #defaultHeaderCell let-name>\n <th>{{ name }}</th>\n</ng-template>\n", styles: [".info-container{padding:64px}.rxap-data-grid table.data-grid{border:0}.rxap-data-grid table.data-grid thead{padding-bottom:16px}.rxap-data-grid table.data-grid thead tr th{border-spacing:32px 16px}.rxap-data-grid table.data-grid tfoot .control-button{margin-top:24px;min-width:128px}.rxap-data-grid table.data-grid th{text-align:right;padding-right:24px}.rxap-data-grid table.data-grid tbody tr>th.sub-header{padding-bottom:12px;padding-right:24px;text-align:right}.rxap-data-grid table.data-grid tbody tr>th:first-child{text-align:right;font-weight:bolder;padding-right:24px}.rxap-data-grid table.data-grid tbody td.divider{padding:4px 0}\n"] }]
|
|
374
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i1.Router }, { type: i2.FormDirective, decorators: [{
|
|
375
|
+
type: Optional
|
|
376
|
+
}] }]; }, propDecorators: { header: [{
|
|
377
|
+
type: Input
|
|
378
|
+
}], dataSource: [{
|
|
379
|
+
type: Input
|
|
380
|
+
}], viewer: [{
|
|
151
381
|
type: Input
|
|
152
382
|
}], data: [{
|
|
153
383
|
type: Input
|
|
384
|
+
}], displayProperties: [{
|
|
385
|
+
type: Input
|
|
154
386
|
}], rows: [{
|
|
155
387
|
type: ContentChildren,
|
|
156
388
|
args: [DataGridRowDefDirective]
|
|
389
|
+
}], editModeChange: [{
|
|
390
|
+
type: Output
|
|
391
|
+
}], mode: [{
|
|
392
|
+
type: Input
|
|
157
393
|
}] } });
|
|
158
394
|
|
|
159
|
-
class
|
|
160
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.
|
|
161
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
395
|
+
class DataGridModule {
|
|
396
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DataGridModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
397
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type: DataGridModule, imports: [DataGridComponent,
|
|
398
|
+
DataGridRowDefDirective,
|
|
399
|
+
DataGridHeaderCellDefDirective,
|
|
400
|
+
DataGridCellDefDirective,
|
|
401
|
+
DataGridEditCellDefDirective], exports: [DataGridComponent,
|
|
402
|
+
DataGridRowDefDirective,
|
|
403
|
+
DataGridHeaderCellDefDirective,
|
|
404
|
+
DataGridCellDefDirective,
|
|
405
|
+
DataGridEditCellDefDirective] }); }
|
|
406
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DataGridModule, imports: [DataGridComponent] }); }
|
|
166
407
|
}
|
|
167
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
408
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DataGridModule, decorators: [{
|
|
168
409
|
type: NgModule,
|
|
169
410
|
args: [{
|
|
170
|
-
exports: [
|
|
171
|
-
DataGridReadonlyComponent,
|
|
172
|
-
DataGridModule
|
|
173
|
-
],
|
|
174
411
|
imports: [
|
|
175
|
-
|
|
176
|
-
|
|
412
|
+
DataGridComponent,
|
|
413
|
+
DataGridRowDefDirective,
|
|
414
|
+
DataGridHeaderCellDefDirective,
|
|
415
|
+
DataGridCellDefDirective,
|
|
416
|
+
DataGridEditCellDefDirective,
|
|
417
|
+
],
|
|
418
|
+
exports: [
|
|
419
|
+
DataGridComponent,
|
|
420
|
+
DataGridRowDefDirective,
|
|
421
|
+
DataGridHeaderCellDefDirective,
|
|
422
|
+
DataGridCellDefDirective,
|
|
423
|
+
DataGridEditCellDefDirective,
|
|
177
424
|
],
|
|
178
|
-
declarations: [
|
|
179
|
-
DataGridReadonlyComponent
|
|
180
|
-
]
|
|
181
425
|
}]
|
|
182
426
|
}] });
|
|
183
427
|
|
|
@@ -185,5 +429,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImpor
|
|
|
185
429
|
* Generated bundle index. Do not edit.
|
|
186
430
|
*/
|
|
187
431
|
|
|
188
|
-
export { DataGridCellDefDirective, DataGridEditCellDefDirective, DataGridHeaderCellDefDirective,
|
|
432
|
+
export { DataGridCellDefDirective, DataGridComponent, DataGridEditCellDefDirective, DataGridHeaderCellDefDirective, DataGridMode, DataGridModule, DataGridRowDefDirective, DataGridValuePipe };
|
|
189
433
|
//# sourceMappingURL=rxap-data-grid.mjs.map
|