@jsonforms/angular-material 3.2.1 → 3.3.0-alpha.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/lib/esm2022/library/controls/date.renderer.mjs +112 -14
- package/lib/esm2022/library/module.mjs +5 -3
- package/lib/esm2022/library/other/master-detail/master.mjs +3 -1
- package/lib/esm2022/library/other/table.renderer.mjs +21 -13
- package/lib/esm2022/library/util/date-format.mjs +27 -0
- package/lib/esm2022/library/util/dayjs-date-adapter.mjs +100 -0
- package/lib/fesm2022/jsonforms-angular-material.mjs +253 -27
- package/lib/fesm2022/jsonforms-angular-material.mjs.map +1 -1
- package/lib/library/controls/date.renderer.d.ts +15 -3
- package/lib/library/controls/date.renderer.d.ts.map +1 -1
- package/lib/library/module.d.ts +1 -1
- package/lib/library/module.d.ts.map +1 -1
- package/lib/library/other/master-detail/master.d.ts.map +1 -1
- package/lib/library/other/table.renderer.d.ts +10 -2
- package/lib/library/other/table.renderer.d.ts.map +1 -1
- package/lib/library/util/date-format.d.ts +17 -0
- package/lib/library/util/date-format.d.ts.map +1 -0
- package/lib/library/util/dayjs-date-adapter.d.ts +28 -0
- package/lib/library/util/dayjs-date-adapter.d.ts.map +1 -0
- package/lib/package.json +4 -3
- package/package.json +10 -8
- package/src/library/controls/date.renderer.ts +106 -8
- package/src/library/module.ts +2 -1
- package/src/library/other/master-detail/master.ts +1 -0
- package/src/library/other/table.renderer.ts +14 -10
- package/src/library/util/date-format.ts +24 -0
- package/src/library/util/dayjs-date-adapter.ts +101 -0
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/*
|
|
2
|
+
The MIT License
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2017-2019 EclipseSource Munich
|
|
5
|
+
https://github.com/eclipsesource/jsonforms
|
|
6
|
+
|
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
in the Software without restriction, including without limitation the rights
|
|
10
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
furnished to do so, subject to the following conditions:
|
|
13
|
+
|
|
14
|
+
The above copyright notice and this permission notice shall be included in
|
|
15
|
+
all copies or substantial portions of the Software.
|
|
16
|
+
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
23
|
+
THE SOFTWARE.
|
|
24
|
+
*/
|
|
25
|
+
import { Injectable } from '@angular/core';
|
|
26
|
+
import { NativeDateAdapter } from '@angular/material/core';
|
|
27
|
+
import { defaultDateFormat } from '@jsonforms/core';
|
|
28
|
+
import dayjs from 'dayjs';
|
|
29
|
+
import customParsing from 'dayjs/plugin/customParseFormat';
|
|
30
|
+
import * as i0 from "@angular/core";
|
|
31
|
+
// allows to parse date strings with custom format
|
|
32
|
+
dayjs.extend(customParsing);
|
|
33
|
+
/**
|
|
34
|
+
* date adapter for dayjs to parse and format dates
|
|
35
|
+
*/
|
|
36
|
+
export class DayJsDateAdapter extends NativeDateAdapter {
|
|
37
|
+
saveFormat = defaultDateFormat;
|
|
38
|
+
setSaveFormat(format) {
|
|
39
|
+
this.saveFormat = format;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* parses a given data prop string in the save-format into a date object
|
|
43
|
+
* @param value date string to be parsed
|
|
44
|
+
* @returns date object or null if parsing failed
|
|
45
|
+
*/
|
|
46
|
+
parseSaveFormat(value) {
|
|
47
|
+
return this.parse(value, this.saveFormat);
|
|
48
|
+
}
|
|
49
|
+
parse(value, format) {
|
|
50
|
+
if (!value) {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
const date = dayjs(value, format);
|
|
54
|
+
if (date.isValid()) {
|
|
55
|
+
return date.toDate();
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
toSaveFormat(value) {
|
|
62
|
+
if (!value) {
|
|
63
|
+
return undefined;
|
|
64
|
+
}
|
|
65
|
+
const date = dayjs(value);
|
|
66
|
+
if (date.isValid()) {
|
|
67
|
+
return date.format(this.saveFormat);
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
return undefined;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* transforms the date to a string representation for display
|
|
75
|
+
* @param date date to be formatted
|
|
76
|
+
* @param displayFormat format to be used for formatting the date e.g. YYYY-MM-DD
|
|
77
|
+
* @returns string representation of the date
|
|
78
|
+
*/
|
|
79
|
+
format(date, displayFormat) {
|
|
80
|
+
return dayjs(date).format(displayFormat);
|
|
81
|
+
}
|
|
82
|
+
deserialize(value) {
|
|
83
|
+
if (!value) {
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
const date = dayjs(value);
|
|
87
|
+
if (date.isValid()) {
|
|
88
|
+
return date.toDate();
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DayJsDateAdapter, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
95
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DayJsDateAdapter });
|
|
96
|
+
}
|
|
97
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DayJsDateAdapter, decorators: [{
|
|
98
|
+
type: Injectable
|
|
99
|
+
}] });
|
|
100
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGF5anMtZGF0ZS1hZGFwdGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2xpYnJhcnkvdXRpbC9kYXlqcy1kYXRlLWFkYXB0ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0VBdUJFO0FBRUYsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUMzQyxPQUFPLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQUMzRCxPQUFPLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQUNwRCxPQUFPLEtBQUssTUFBTSxPQUFPLENBQUM7QUFDMUIsT0FBTyxhQUFhLE1BQU0sZ0NBQWdDLENBQUM7O0FBRTNELGtEQUFrRDtBQUNsRCxLQUFLLENBQUMsTUFBTSxDQUFDLGFBQWEsQ0FBQyxDQUFDO0FBRTVCOztHQUVHO0FBRUgsTUFBTSxPQUFPLGdCQUFpQixTQUFRLGlCQUFpQjtJQUNyRCxVQUFVLEdBQVcsaUJBQWlCLENBQUM7SUFFdkMsYUFBYSxDQUFDLE1BQWM7UUFDMUIsSUFBSSxDQUFDLFVBQVUsR0FBRyxNQUFNLENBQUM7SUFDM0IsQ0FBQztJQUVEOzs7O09BSUc7SUFDSCxlQUFlLENBQUMsS0FBYTtRQUMzQixPQUFPLElBQUksQ0FBQyxLQUF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sdWUpIHtcbiAgICAgIHJldHVybiBudWxsO1xuICAgIH1cbiAgICBjb25zdCBkYXRlID0gZGF5anModmFsdWUpO1xuICAgIGlmIChkYXRlLmlzVmFsaWQoKSkge1xuICAgICAgcmV0dXJuIGRhdGUudG9EYXRlKCk7XG4gICAgfSBlbHNlIHtcbiAgICAgIHJldHVybiBudWxsO1xuICAgIH1cbiAgfVxufVxuIl19
|
|
@@ -26,7 +26,7 @@ import { MatInputModule } from '@angular/material/input';
|
|
|
26
26
|
import * as i4$4 from '@angular/material/list';
|
|
27
27
|
import { MatListModule } from '@angular/material/list';
|
|
28
28
|
import * as i6 from '@angular/material/core';
|
|
29
|
-
import { MatNativeDateModule } from '@angular/material/core';
|
|
29
|
+
import { NativeDateAdapter, MAT_DATE_FORMATS, DateAdapter, MatNativeDateModule } from '@angular/material/core';
|
|
30
30
|
import { MatSelectModule } from '@angular/material/select';
|
|
31
31
|
import * as i3$1 from '@angular/material/sidenav';
|
|
32
32
|
import { MatSidenavModule } from '@angular/material/sidenav';
|
|
@@ -40,11 +40,13 @@ import * as i3$3 from '@angular/material/tabs';
|
|
|
40
40
|
import { MatTabsModule } from '@angular/material/tabs';
|
|
41
41
|
import { MatToolbarModule } from '@angular/material/toolbar';
|
|
42
42
|
import * as i0 from '@angular/core';
|
|
43
|
-
import { Component, ChangeDetectionStrategy, Input, Pipe, NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
|
43
|
+
import { Component, ChangeDetectionStrategy, Input, Injectable, ViewEncapsulation, Inject, Pipe, NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
|
44
44
|
import * as i1 from '@jsonforms/angular';
|
|
45
45
|
import { JsonFormsControl, JsonFormsBaseRenderer, JsonFormsArrayControl, JsonFormsControlWithDetail, JsonFormsAbstractControl, JsonFormsModule } from '@jsonforms/angular';
|
|
46
|
-
import { composeWithUi, Actions, rankWith, isEnumControl, isBooleanControl, isDateControl, isNumberControl, or, isIntegerControl, isRangeControl, isMultiLineControl, isStringControl, and, optionIs, mapStateToLabelProps, uiTypeIs, decode, mapDispatchToArrayControlProps, findUISchema, setReadonly, getFirstPrimitiveProp, createDefaultValue, mapStateToArrayControlProps, Generate, isObjectControl,
|
|
46
|
+
import { composeWithUi, Actions, rankWith, isEnumControl, isBooleanControl, defaultDateFormat, isDateControl, isNumberControl, or, isIntegerControl, isRangeControl, isMultiLineControl, isStringControl, and, optionIs, mapStateToLabelProps, uiTypeIs, decode, mapDispatchToArrayControlProps, findUISchema, setReadonly, getFirstPrimitiveProp, createDefaultValue, mapStateToArrayControlProps, Generate, isObjectControl, encode, deriveTypes, isObjectArrayControl, isPrimitiveArrayControl, Paths, mapStateToLayoutProps, isVisible, getAjv, deriveLabelForUISchemaElement, defaultJsonFormsI18nState, categorizationHasCategory, mapStateToArrayLayoutProps, unsetReadonly, isObjectArrayWithNesting } from '@jsonforms/core';
|
|
47
47
|
import { startWith, map } from 'rxjs/operators';
|
|
48
|
+
import dayjs from 'dayjs';
|
|
49
|
+
import customParsing from 'dayjs/plugin/customParseFormat';
|
|
48
50
|
import merge from 'lodash/merge';
|
|
49
51
|
import some from 'lodash/some';
|
|
50
52
|
import get from 'lodash/get';
|
|
@@ -287,6 +289,125 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
287
289
|
}], ctorParameters: function () { return [{ type: i1.JsonFormsAngularService }, { type: i0.ChangeDetectorRef }]; } });
|
|
288
290
|
const booleanControlTester = rankWith(2, isBooleanControl);
|
|
289
291
|
|
|
292
|
+
class MyFormat {
|
|
293
|
+
displayFormat = 'M/D/YYYY';
|
|
294
|
+
setDisplayFormat(displayFormat) {
|
|
295
|
+
this.displayFormat = displayFormat;
|
|
296
|
+
}
|
|
297
|
+
get display() {
|
|
298
|
+
return {
|
|
299
|
+
monthYearLabel: 'YYYY-MM',
|
|
300
|
+
dateA11yLabel: 'YYYY-MM-DD',
|
|
301
|
+
monthYearA11yLabel: 'YYYY-MM',
|
|
302
|
+
dateInput: this.displayFormat,
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
get parse() {
|
|
306
|
+
return {
|
|
307
|
+
dateInput: this.displayFormat,
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MyFormat, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
311
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MyFormat });
|
|
312
|
+
}
|
|
313
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MyFormat, decorators: [{
|
|
314
|
+
type: Injectable
|
|
315
|
+
}] });
|
|
316
|
+
|
|
317
|
+
/*
|
|
318
|
+
The MIT License
|
|
319
|
+
|
|
320
|
+
Copyright (c) 2017-2019 EclipseSource Munich
|
|
321
|
+
https://github.com/eclipsesource/jsonforms
|
|
322
|
+
|
|
323
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
324
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
325
|
+
in the Software without restriction, including without limitation the rights
|
|
326
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
327
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
328
|
+
furnished to do so, subject to the following conditions:
|
|
329
|
+
|
|
330
|
+
The above copyright notice and this permission notice shall be included in
|
|
331
|
+
all copies or substantial portions of the Software.
|
|
332
|
+
|
|
333
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
334
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
335
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
336
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
337
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
338
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
339
|
+
THE SOFTWARE.
|
|
340
|
+
*/
|
|
341
|
+
// allows to parse date strings with custom format
|
|
342
|
+
dayjs.extend(customParsing);
|
|
343
|
+
/**
|
|
344
|
+
* date adapter for dayjs to parse and format dates
|
|
345
|
+
*/
|
|
346
|
+
class DayJsDateAdapter extends NativeDateAdapter {
|
|
347
|
+
saveFormat = defaultDateFormat;
|
|
348
|
+
setSaveFormat(format) {
|
|
349
|
+
this.saveFormat = format;
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* parses a given data prop string in the save-format into a date object
|
|
353
|
+
* @param value date string to be parsed
|
|
354
|
+
* @returns date object or null if parsing failed
|
|
355
|
+
*/
|
|
356
|
+
parseSaveFormat(value) {
|
|
357
|
+
return this.parse(value, this.saveFormat);
|
|
358
|
+
}
|
|
359
|
+
parse(value, format) {
|
|
360
|
+
if (!value) {
|
|
361
|
+
return null;
|
|
362
|
+
}
|
|
363
|
+
const date = dayjs(value, format);
|
|
364
|
+
if (date.isValid()) {
|
|
365
|
+
return date.toDate();
|
|
366
|
+
}
|
|
367
|
+
else {
|
|
368
|
+
return null;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
toSaveFormat(value) {
|
|
372
|
+
if (!value) {
|
|
373
|
+
return undefined;
|
|
374
|
+
}
|
|
375
|
+
const date = dayjs(value);
|
|
376
|
+
if (date.isValid()) {
|
|
377
|
+
return date.format(this.saveFormat);
|
|
378
|
+
}
|
|
379
|
+
else {
|
|
380
|
+
return undefined;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* transforms the date to a string representation for display
|
|
385
|
+
* @param date date to be formatted
|
|
386
|
+
* @param displayFormat format to be used for formatting the date e.g. YYYY-MM-DD
|
|
387
|
+
* @returns string representation of the date
|
|
388
|
+
*/
|
|
389
|
+
format(date, displayFormat) {
|
|
390
|
+
return dayjs(date).format(displayFormat);
|
|
391
|
+
}
|
|
392
|
+
deserialize(value) {
|
|
393
|
+
if (!value) {
|
|
394
|
+
return null;
|
|
395
|
+
}
|
|
396
|
+
const date = dayjs(value);
|
|
397
|
+
if (date.isValid()) {
|
|
398
|
+
return date.toDate();
|
|
399
|
+
}
|
|
400
|
+
else {
|
|
401
|
+
return null;
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DayJsDateAdapter, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
405
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DayJsDateAdapter });
|
|
406
|
+
}
|
|
407
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DayJsDateAdapter, decorators: [{
|
|
408
|
+
type: Injectable
|
|
409
|
+
}] });
|
|
410
|
+
|
|
290
411
|
/*
|
|
291
412
|
The MIT License
|
|
292
413
|
|
|
@@ -312,14 +433,77 @@ const booleanControlTester = rankWith(2, isBooleanControl);
|
|
|
312
433
|
THE SOFTWARE.
|
|
313
434
|
*/
|
|
314
435
|
class DateControlRenderer extends JsonFormsControl {
|
|
436
|
+
dateFormat;
|
|
437
|
+
dateAdapter;
|
|
315
438
|
focused = false;
|
|
316
|
-
|
|
439
|
+
views = [];
|
|
440
|
+
startView = '';
|
|
441
|
+
panelClass = '';
|
|
442
|
+
constructor(jsonformsService, dateFormat, dateAdapter) {
|
|
317
443
|
super(jsonformsService);
|
|
444
|
+
this.dateFormat = dateFormat;
|
|
445
|
+
this.dateAdapter = dateAdapter;
|
|
318
446
|
}
|
|
319
|
-
getEventValue = (event) =>
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
447
|
+
getEventValue = (event) => {
|
|
448
|
+
const value = event.value ? event.value : event;
|
|
449
|
+
return this.dateAdapter.toSaveFormat(value);
|
|
450
|
+
};
|
|
451
|
+
mapToProps(state) {
|
|
452
|
+
const props = super.mapToProps(state);
|
|
453
|
+
const saveFormat = this.uischema?.options?.dateSaveFormat
|
|
454
|
+
? this.uischema.options.dateSaveFormat
|
|
455
|
+
: defaultDateFormat;
|
|
456
|
+
this.views = this.uischema?.options?.views
|
|
457
|
+
? this.uischema.options.views
|
|
458
|
+
: ['year', 'month', 'day'];
|
|
459
|
+
this.setViewProperties();
|
|
460
|
+
const dateFormat = this.uischema?.options?.dateFormat;
|
|
461
|
+
if (dateFormat) {
|
|
462
|
+
this.dateFormat.setDisplayFormat(dateFormat);
|
|
463
|
+
}
|
|
464
|
+
this.dateAdapter.setSaveFormat(saveFormat);
|
|
465
|
+
if (this.jsonFormsService.getLocale()) {
|
|
466
|
+
this.dateAdapter.setLocale(this.jsonFormsService.getLocale());
|
|
467
|
+
}
|
|
468
|
+
const date = this.dateAdapter.parseSaveFormat(props.data);
|
|
469
|
+
return { ...props, data: date };
|
|
470
|
+
}
|
|
471
|
+
yearSelected($event, datepicker) {
|
|
472
|
+
if (!this.views.includes('day') && !this.views.includes('month')) {
|
|
473
|
+
this.onChange($event);
|
|
474
|
+
datepicker.close();
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
monthSelected($event, datepicker) {
|
|
478
|
+
if (!this.views.includes('day')) {
|
|
479
|
+
this.onChange($event);
|
|
480
|
+
datepicker.close();
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
setViewProperties() {
|
|
484
|
+
if (!this.views.includes('day')) {
|
|
485
|
+
this.startView = 'multi-year';
|
|
486
|
+
this.panelClass = 'no-panel-navigation';
|
|
487
|
+
}
|
|
488
|
+
else {
|
|
489
|
+
this.startView = 'month';
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DateControlRenderer, deps: [{ token: i1.JsonFormsAngularService }, { token: MAT_DATE_FORMATS }, { token: DateAdapter }], target: i0.ɵɵFactoryTarget.Component });
|
|
493
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DateControlRenderer, selector: "DateControlRenderer", providers: [
|
|
494
|
+
{
|
|
495
|
+
provide: DateAdapter,
|
|
496
|
+
useClass: DayJsDateAdapter,
|
|
497
|
+
},
|
|
498
|
+
{
|
|
499
|
+
provide: MAT_DATE_FORMATS,
|
|
500
|
+
useClass: MyFormat,
|
|
501
|
+
},
|
|
502
|
+
], usesInheritance: true, ngImport: i0, template: `
|
|
503
|
+
<mat-form-field
|
|
504
|
+
class="date-control-renderer"
|
|
505
|
+
[ngStyle]="{ display: hidden ? 'none' : '' }"
|
|
506
|
+
>
|
|
323
507
|
<mat-label>{{ label }}</mat-label>
|
|
324
508
|
<input
|
|
325
509
|
matInput
|
|
@@ -334,18 +518,27 @@ class DateControlRenderer extends JsonFormsControl {
|
|
|
334
518
|
matSuffix
|
|
335
519
|
[for]="datepicker"
|
|
336
520
|
></mat-datepicker-toggle>
|
|
337
|
-
<mat-datepicker
|
|
521
|
+
<mat-datepicker
|
|
522
|
+
#datepicker
|
|
523
|
+
(monthSelected)="monthSelected($event, datepicker)"
|
|
524
|
+
(yearSelected)="yearSelected($event, datepicker)"
|
|
525
|
+
[startView]="startView"
|
|
526
|
+
[panelClass]="panelClass"
|
|
527
|
+
></mat-datepicker>
|
|
338
528
|
<mat-hint *ngIf="shouldShowUnfocusedDescription() || focused">{{
|
|
339
529
|
description
|
|
340
530
|
}}</mat-hint>
|
|
341
531
|
<mat-error>{{ error }}</mat-error>
|
|
342
532
|
</mat-form-field>
|
|
343
|
-
`, isInline: true, styles: ["
|
|
533
|
+
`, isInline: true, styles: ["DateControlRenderer{display:flex;flex-direction:row}.date-control-renderer{flex:1 1 auto}.no-panel-navigation .mat-calendar-period-button{pointer-events:none}.no-panel-navigation .mat-calendar-arrow{display:none}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i5$1.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i5$1.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i5$1.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "directive", type: i5.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
344
534
|
}
|
|
345
535
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DateControlRenderer, decorators: [{
|
|
346
536
|
type: Component,
|
|
347
537
|
args: [{ selector: 'DateControlRenderer', template: `
|
|
348
|
-
<mat-form-field
|
|
538
|
+
<mat-form-field
|
|
539
|
+
class="date-control-renderer"
|
|
540
|
+
[ngStyle]="{ display: hidden ? 'none' : '' }"
|
|
541
|
+
>
|
|
349
542
|
<mat-label>{{ label }}</mat-label>
|
|
350
543
|
<input
|
|
351
544
|
matInput
|
|
@@ -360,14 +553,35 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
360
553
|
matSuffix
|
|
361
554
|
[for]="datepicker"
|
|
362
555
|
></mat-datepicker-toggle>
|
|
363
|
-
<mat-datepicker
|
|
556
|
+
<mat-datepicker
|
|
557
|
+
#datepicker
|
|
558
|
+
(monthSelected)="monthSelected($event, datepicker)"
|
|
559
|
+
(yearSelected)="yearSelected($event, datepicker)"
|
|
560
|
+
[startView]="startView"
|
|
561
|
+
[panelClass]="panelClass"
|
|
562
|
+
></mat-datepicker>
|
|
364
563
|
<mat-hint *ngIf="shouldShowUnfocusedDescription() || focused">{{
|
|
365
564
|
description
|
|
366
565
|
}}</mat-hint>
|
|
367
566
|
<mat-error>{{ error }}</mat-error>
|
|
368
567
|
</mat-form-field>
|
|
369
|
-
`, changeDetection: ChangeDetectionStrategy.OnPush,
|
|
370
|
-
|
|
568
|
+
`, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
569
|
+
{
|
|
570
|
+
provide: DateAdapter,
|
|
571
|
+
useClass: DayJsDateAdapter,
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
provide: MAT_DATE_FORMATS,
|
|
575
|
+
useClass: MyFormat,
|
|
576
|
+
},
|
|
577
|
+
], styles: ["DateControlRenderer{display:flex;flex-direction:row}.date-control-renderer{flex:1 1 auto}.no-panel-navigation .mat-calendar-period-button{pointer-events:none}.no-panel-navigation .mat-calendar-arrow{display:none}\n"] }]
|
|
578
|
+
}], ctorParameters: function () { return [{ type: i1.JsonFormsAngularService }, { type: MyFormat, decorators: [{
|
|
579
|
+
type: Inject,
|
|
580
|
+
args: [MAT_DATE_FORMATS]
|
|
581
|
+
}] }, { type: DayJsDateAdapter, decorators: [{
|
|
582
|
+
type: Inject,
|
|
583
|
+
args: [DateAdapter]
|
|
584
|
+
}] }]; } });
|
|
371
585
|
const DateControlRendererTester = rankWith(2, isDateControl);
|
|
372
586
|
|
|
373
587
|
/*
|
|
@@ -1110,6 +1324,7 @@ class MasterListComponent extends JsonFormsArrayControl {
|
|
|
1110
1324
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: MasterListComponent, selector: "jsonforms-list-with-detail-master", usesInheritance: true, ngImport: i0, template: `
|
|
1111
1325
|
<mat-sidenav-container
|
|
1112
1326
|
[ngStyle]="{ display: hidden ? 'none' : '' }"
|
|
1327
|
+
autosize="true"
|
|
1113
1328
|
class="container"
|
|
1114
1329
|
>
|
|
1115
1330
|
<mat-sidenav mode="side" opened>
|
|
@@ -1164,6 +1379,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1164
1379
|
args: [{ selector: 'jsonforms-list-with-detail-master', template: `
|
|
1165
1380
|
<mat-sidenav-container
|
|
1166
1381
|
[ngStyle]="{ display: hidden ? 'none' : '' }"
|
|
1382
|
+
autosize="true"
|
|
1167
1383
|
class="container"
|
|
1168
1384
|
>
|
|
1169
1385
|
<mat-sidenav mode="side" opened>
|
|
@@ -1338,14 +1554,6 @@ class TableRenderer extends JsonFormsArrayControl {
|
|
|
1338
1554
|
}
|
|
1339
1555
|
this.translations = props.translations;
|
|
1340
1556
|
}
|
|
1341
|
-
getProps(index, props) {
|
|
1342
|
-
const rowPath = Paths.compose(props.path, `${index}`);
|
|
1343
|
-
return {
|
|
1344
|
-
schema: props.schema,
|
|
1345
|
-
uischema: props.uischema,
|
|
1346
|
-
path: rowPath,
|
|
1347
|
-
};
|
|
1348
|
-
}
|
|
1349
1557
|
remove(index) {
|
|
1350
1558
|
this.removeItems(this.propsPath, [index])();
|
|
1351
1559
|
}
|
|
@@ -1488,7 +1696,7 @@ class TableRenderer extends JsonFormsArrayControl {
|
|
|
1488
1696
|
<th mat-header-cell *matHeaderCellDef>{{ item.header }}</th>
|
|
1489
1697
|
<td mat-cell *matCellDef="let index = index">
|
|
1490
1698
|
<jsonforms-outlet
|
|
1491
|
-
[renderProps]="
|
|
1699
|
+
[renderProps]="index | getProps : item.props"
|
|
1492
1700
|
></jsonforms-outlet>
|
|
1493
1701
|
</td>
|
|
1494
1702
|
</ng-container>
|
|
@@ -1496,7 +1704,7 @@ class TableRenderer extends JsonFormsArrayControl {
|
|
|
1496
1704
|
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
|
1497
1705
|
<tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
|
|
1498
1706
|
</table>
|
|
1499
|
-
`, isInline: true, styles: ["table{width:100%}\n", ".cdk-column-action{width:15%}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.JsonFormsOutlet, selector: "jsonforms-outlet", inputs: ["renderProps"] }, { kind: "component", type: i5$2.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i6$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i5$3.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i5$3.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i5$3.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i5$3.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { kind: "directive", type: i5$3.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i5$3.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i5$3.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i5$3.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i5$3.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i5$3.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "directive", type: i6$2.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }] });
|
|
1707
|
+
`, isInline: true, styles: ["table{width:100%}\n", ".cdk-column-action{width:15%}\n"], dependencies: [{ kind: "directive", type: i0.forwardRef(function () { return i2.NgForOf; }), selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i0.forwardRef(function () { return i2.NgIf; }), selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i0.forwardRef(function () { return i1.JsonFormsOutlet; }), selector: "jsonforms-outlet", inputs: ["renderProps"] }, { kind: "component", type: i0.forwardRef(function () { return i5$2.MatButton; }), selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i0.forwardRef(function () { return i6$1.MatIcon; }), selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i0.forwardRef(function () { return i5$3.MatTable; }), selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i0.forwardRef(function () { return i5$3.MatHeaderCellDef; }), selector: "[matHeaderCellDef]" }, { kind: "directive", type: i0.forwardRef(function () { return i5$3.MatHeaderRowDef; }), selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i0.forwardRef(function () { return i5$3.MatColumnDef; }), selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { kind: "directive", type: i0.forwardRef(function () { return i5$3.MatCellDef; }), selector: "[matCellDef]" }, { kind: "directive", type: i0.forwardRef(function () { return i5$3.MatRowDef; }), selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i0.forwardRef(function () { return i5$3.MatHeaderCell; }), selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i0.forwardRef(function () { return i5$3.MatCell; }), selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i0.forwardRef(function () { return i5$3.MatHeaderRow; }), selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i0.forwardRef(function () { return i5$3.MatRow; }), selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "directive", type: i0.forwardRef(function () { return i6$2.MatTooltip; }), selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "pipe", type: i0.forwardRef(function () { return GetProps; }), name: "getProps" }] });
|
|
1500
1708
|
}
|
|
1501
1709
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TableRenderer, decorators: [{
|
|
1502
1710
|
type: Component,
|
|
@@ -1576,7 +1784,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1576
1784
|
<th mat-header-cell *matHeaderCellDef>{{ item.header }}</th>
|
|
1577
1785
|
<td mat-cell *matCellDef="let index = index">
|
|
1578
1786
|
<jsonforms-outlet
|
|
1579
|
-
[renderProps]="
|
|
1787
|
+
[renderProps]="index | getProps : item.props"
|
|
1580
1788
|
></jsonforms-outlet>
|
|
1581
1789
|
</td>
|
|
1582
1790
|
</ng-container>
|
|
@@ -1592,6 +1800,22 @@ const controlWithoutLabel = (scope) => ({
|
|
|
1592
1800
|
scope: scope,
|
|
1593
1801
|
label: false,
|
|
1594
1802
|
});
|
|
1803
|
+
class GetProps {
|
|
1804
|
+
transform(index, props) {
|
|
1805
|
+
const rowPath = Paths.compose(props.path, `${index}`);
|
|
1806
|
+
return {
|
|
1807
|
+
schema: props.schema,
|
|
1808
|
+
uischema: props.uischema,
|
|
1809
|
+
path: rowPath,
|
|
1810
|
+
};
|
|
1811
|
+
}
|
|
1812
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GetProps, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
1813
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: GetProps, name: "getProps" });
|
|
1814
|
+
}
|
|
1815
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GetProps, decorators: [{
|
|
1816
|
+
type: Pipe,
|
|
1817
|
+
args: [{ name: 'getProps' }]
|
|
1818
|
+
}] });
|
|
1595
1819
|
|
|
1596
1820
|
/*
|
|
1597
1821
|
The MIT License
|
|
@@ -2282,7 +2506,8 @@ class JsonFormsAngularMaterialModule {
|
|
|
2282
2506
|
AutocompleteControlRenderer,
|
|
2283
2507
|
TableRenderer,
|
|
2284
2508
|
ArrayLayoutRenderer,
|
|
2285
|
-
LayoutChildrenRenderPropsPipe
|
|
2509
|
+
LayoutChildrenRenderPropsPipe,
|
|
2510
|
+
GetProps], imports: [CommonModule,
|
|
2286
2511
|
JsonFormsModule,
|
|
2287
2512
|
MatFormFieldModule,
|
|
2288
2513
|
MatCheckboxModule,
|
|
@@ -2408,6 +2633,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
2408
2633
|
TableRenderer,
|
|
2409
2634
|
ArrayLayoutRenderer,
|
|
2410
2635
|
LayoutChildrenRenderPropsPipe,
|
|
2636
|
+
GetProps,
|
|
2411
2637
|
],
|
|
2412
2638
|
exports: [
|
|
2413
2639
|
CommonModule,
|
|
@@ -2560,5 +2786,5 @@ const angularMaterialRenderers = [
|
|
|
2560
2786
|
* Generated bundle index. Do not edit.
|
|
2561
2787
|
*/
|
|
2562
2788
|
|
|
2563
|
-
export { AutocompleteControlRenderer, BooleanControlRenderer, CategorizationTabLayoutRenderer, DateControlRenderer, DateControlRendererTester, GroupLayoutRenderer, HorizontalLayoutRenderer, JsonFormsAngularMaterialModule, JsonFormsDetailComponent, LabelRenderer, LabelRendererTester, LayoutChildrenRenderPropsPipe, LayoutRenderer, MasterListComponent, NumberControlRenderer, NumberControlRendererTester, ObjectControlRenderer, ObjectControlRendererTester, RangeControlRenderer, RangeControlRendererTester, TableRenderer, TableRendererTester, TextAreaRenderer, TextAreaRendererTester, TextControlRenderer, TextControlRendererTester, ToggleControlRenderer, ToggleControlRendererTester, VerticalLayoutRenderer, angularMaterialRenderers, booleanControlTester, categorizationTester, controlWithoutLabel, enumControlTester, groupLayoutTester, horizontalLayoutTester, masterDetailTester, removeSchemaKeywords, verticalLayoutTester };
|
|
2789
|
+
export { AutocompleteControlRenderer, BooleanControlRenderer, CategorizationTabLayoutRenderer, DateControlRenderer, DateControlRendererTester, GetProps, GroupLayoutRenderer, HorizontalLayoutRenderer, JsonFormsAngularMaterialModule, JsonFormsDetailComponent, LabelRenderer, LabelRendererTester, LayoutChildrenRenderPropsPipe, LayoutRenderer, MasterListComponent, NumberControlRenderer, NumberControlRendererTester, ObjectControlRenderer, ObjectControlRendererTester, RangeControlRenderer, RangeControlRendererTester, TableRenderer, TableRendererTester, TextAreaRenderer, TextAreaRendererTester, TextControlRenderer, TextControlRendererTester, ToggleControlRenderer, ToggleControlRendererTester, VerticalLayoutRenderer, angularMaterialRenderers, booleanControlTester, categorizationTester, controlWithoutLabel, enumControlTester, groupLayoutTester, horizontalLayoutTester, masterDetailTester, removeSchemaKeywords, verticalLayoutTester };
|
|
2564
2790
|
//# sourceMappingURL=jsonforms-angular-material.mjs.map
|