@rxap/schematic-angular 16.2.0-dev.20 → 16.2.0-dev.21
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 +13 -0
- package/README.md +1 -1
- package/collection.json +10 -0
- package/package.json +4 -4
- package/src/lib/coerce-form-component.js +15 -3
- package/src/lib/coerce-form-component.js.map +1 -1
- package/src/lib/data-grid-item.d.ts +3 -3
- package/src/lib/data-grid-item.js +2 -2
- package/src/lib/data-grid-item.js.map +1 -1
- package/src/lib/form/abstract-control.d.ts +29 -0
- package/src/lib/form/abstract-control.js +37 -0
- package/src/lib/form/abstract-control.js.map +1 -0
- package/src/lib/form/array/base-form-array.d.ts +18 -0
- package/src/lib/form/array/base-form-array.js +40 -0
- package/src/lib/form/array/base-form-array.js.map +1 -0
- package/src/lib/form/array/form-array-kind.d.ts +3 -0
- package/src/lib/form/array/form-array-kind.js +8 -0
- package/src/lib/form/array/form-array-kind.js.map +1 -0
- package/src/lib/form/array/form-array.d.ts +12 -0
- package/src/lib/form/array/form-array.js +18 -0
- package/src/lib/form/array/form-array.js.map +1 -0
- package/src/lib/form/coerce-control-component-imports.d.ts +3 -0
- package/src/lib/form/coerce-control-component-imports.js +18 -0
- package/src/lib/form/coerce-control-component-imports.js.map +1 -0
- package/src/lib/form/control/base-form-control.d.ts +14 -0
- package/src/lib/form/control/base-form-control.js +19 -0
- package/src/lib/form/control/base-form-control.js.map +1 -0
- package/src/lib/form/control/checkbox-form-control.d.ts +11 -0
- package/src/lib/form/control/checkbox-form-control.js +23 -0
- package/src/lib/form/control/checkbox-form-control.js.map +1 -0
- package/src/lib/form/control/form-control-kind.d.ts +8 -0
- package/src/lib/form/control/form-control-kind.js +13 -0
- package/src/lib/form/control/form-control-kind.js.map +1 -0
- package/src/lib/form/control/form-control.d.ts +18 -0
- package/src/lib/form/control/form-control.js +40 -0
- package/src/lib/form/control/form-control.js.map +1 -0
- package/src/lib/form/control/form-field-form-control.d.ts +33 -0
- package/src/lib/form/control/form-field-form-control.js +76 -0
- package/src/lib/form/control/form-field-form-control.js.map +1 -0
- package/src/lib/form/control/input-form-control.d.ts +14 -0
- package/src/lib/form/control/input-form-control.js +71 -0
- package/src/lib/form/control/input-form-control.js.map +1 -0
- package/src/lib/form/control/select-form-control.d.ts +18 -0
- package/src/lib/form/control/select-form-control.js +29 -0
- package/src/lib/form/control/select-form-control.js.map +1 -0
- package/src/lib/form/control/slide-toggle-form-control.d.ts +11 -0
- package/src/lib/form/control/slide-toggle-form-control.js +23 -0
- package/src/lib/form/control/slide-toggle-form-control.js.map +1 -0
- package/src/lib/form/control/table-select-form-control.d.ts +43 -0
- package/src/lib/form/control/table-select-form-control.js +69 -0
- package/src/lib/form/control/table-select-form-control.js.map +1 -0
- package/src/lib/form/control.d.ts +8 -0
- package/src/lib/form/control.js +38 -0
- package/src/lib/form/control.js.map +1 -0
- package/src/lib/form/generate-form-template.d.ts +2 -2
- package/src/lib/form/group/base-form-group.d.ts +17 -0
- package/src/lib/form/group/base-form-group.js +20 -0
- package/src/lib/form/group/base-form-group.js.map +1 -0
- package/src/lib/form/group/form-group-kind.d.ts +3 -0
- package/src/lib/form/group/form-group-kind.js +8 -0
- package/src/lib/form/group/form-group-kind.js.map +1 -0
- package/src/lib/form/group/form-group.d.ts +12 -0
- package/src/lib/form/group/form-group.js +18 -0
- package/src/lib/form/group/form-group.js.map +1 -0
- package/src/lib/table-column.d.ts +4 -3
- package/src/lib/table-column.js +5 -4
- package/src/lib/table-column.js.map +1 -1
- package/src/schema.json +1673 -1415
- package/src/schematic-input.schema.json +90 -156
- package/src/schematics/abstract-control.schema.json +78 -0
- package/src/schematics/accordion/accordion-component/schema.json +127 -127
- package/src/schematics/accordion/accordion-item-component/schema.json +18 -18
- package/src/schematics/accordion/item/accordion-item-data-grid-component/schema.json +602 -81
- package/src/schematics/accordion/item/accordion-item-switch-component/schema.json +76 -76
- package/src/schematics/accordion/item/accordion-item-table-component/schema.json +486 -111
- package/src/schematics/accordion/item/accordion-item-tree-table-component/schema.json +458 -83
- package/src/schematics/base-form-array.schema.json +45 -0
- package/src/schematics/base-form-control.schema.json +27 -0
- package/src/schematics/base-form-group.schema.json +42 -0
- package/src/schematics/checkbox-form-control.schema.json +30 -0
- package/src/schematics/control.schema.json +26 -0
- package/src/schematics/data-grid-component/index.js +4 -0
- package/src/schematics/data-grid-component/index.js.map +1 -1
- package/src/schematics/data-grid-component/schema.json +602 -81
- package/src/schematics/data-grid-item.schema.json +3 -3
- package/src/schematics/form/control/input-form-control/index.d.ts +1 -1
- package/src/schematics/form/control/input-form-control/index.js +4 -4
- package/src/schematics/form/control/input-form-control/index.js.map +1 -1
- package/src/schematics/form/control/input-form-control/schema.d.ts +2 -2
- package/src/schematics/form/control/input-form-control/schema.json +256 -86
- package/src/schematics/form/control/input-form-control/template.schema.json +16 -3
- package/src/schematics/form/control/select-form-control/index.d.ts +2 -2
- package/src/schematics/form/control/select-form-control/index.js +21 -14
- package/src/schematics/form/control/select-form-control/index.js.map +1 -1
- package/src/schematics/form/control/select-form-control/schema.d.ts +2 -3
- package/src/schematics/form/control/select-form-control/schema.json +249 -90
- package/src/schematics/form/control/select-form-control/template.schema.json +16 -3
- package/src/schematics/form/control/table-select-form-control/index.d.ts +3 -9
- package/src/schematics/form/control/table-select-form-control/index.js +24 -18
- package/src/schematics/form/control/table-select-form-control/index.js.map +1 -1
- package/src/schematics/form/control/table-select-form-control/schema.d.ts +2 -3
- package/src/schematics/form/control/table-select-form-control/schema.json +325 -123
- package/src/schematics/form/control/table-select-form-control/template.schema.json +16 -60
- package/src/schematics/form/form-array/index.d.ts +9 -0
- package/src/schematics/form/form-array/index.js +54 -0
- package/src/schematics/form/form-array/index.js.map +1 -0
- package/src/schematics/form/form-array/schema.d.ts +4 -0
- package/src/schematics/form/form-array/schema.json +823 -0
- package/src/schematics/form/form-array/template.schema.json +33 -0
- package/src/schematics/form/form-component/files/component/__componentName__.component.html.hbs +4 -1
- package/src/schematics/form/form-component/index.d.ts +2 -4
- package/src/schematics/form/form-component/index.js +8 -24
- package/src/schematics/form/form-component/index.js.map +1 -1
- package/src/schematics/form/form-component/schema.d.ts +2 -2
- package/src/schematics/form/form-component/schema.json +666 -86
- package/src/schematics/form/form-control/index.d.ts +3 -5
- package/src/schematics/form/form-control/index.js +8 -20
- package/src/schematics/form/form-control/index.js.map +1 -1
- package/src/schematics/form/form-control/schema.d.ts +2 -4
- package/src/schematics/form/form-control/schema.json +519 -62
- package/src/schematics/form/form-control/template.schema.json +1 -2
- package/src/schematics/form/form-definition/index.d.ts +2 -2
- package/src/schematics/form/form-definition/index.js +28 -15
- package/src/schematics/form/form-definition/index.js.map +1 -1
- package/src/schematics/form/form-definition/schema.d.ts +2 -2
- package/src/schematics/form/form-definition/schema.json +664 -60
- package/src/schematics/form/form-group/index.d.ts +9 -0
- package/src/schematics/form/form-group/index.js +54 -0
- package/src/schematics/form/form-group/index.js.map +1 -0
- package/src/schematics/form/form-group/schema.d.ts +4 -0
- package/src/schematics/form/form-group/schema.json +823 -0
- package/src/schematics/form/form-group/template.schema.json +33 -0
- package/src/schematics/form/templates/checkbox-form-control.hbs +1 -1
- package/src/schematics/form/templates/default-form-array.hbs +27 -0
- package/src/schematics/form/templates/default-form-group.hbs +13 -0
- package/src/schematics/form/templates/input-form-control.hbs +7 -7
- package/src/schematics/form/templates/select-form-control.hbs +5 -0
- package/src/schematics/form/templates/table-select-form-control.hbs +16 -16
- package/src/schematics/form-array.schema.json +40 -0
- package/src/schematics/form-control.schema.json +64 -55
- package/src/schematics/form-definition.schema.json +3 -3
- package/src/schematics/form-group.schema.json +40 -0
- package/src/schematics/input-form-control.schema.json +10 -6
- package/src/schematics/select-form-control.schema.json +8 -4
- package/src/schematics/slide-toggle-form-control.schema.json +30 -0
- package/src/schematics/table/action/dialog-table-action/schema.json +20 -20
- package/src/schematics/table/action/form-table-action/index.d.ts +2 -2
- package/src/schematics/table/action/form-table-action/index.js +3 -4
- package/src/schematics/table/action/form-table-action/index.js.map +1 -1
- package/src/schematics/table/action/form-table-action/schema.d.ts +2 -2
- package/src/schematics/table/action/form-table-action/schema.json +667 -87
- package/src/schematics/table/action/navigation-table-action/schema.json +20 -20
- package/src/schematics/table/action/open-api-table-action/schema.json +20 -20
- package/src/schematics/table/action/operation-table-action/schema.json +20 -20
- package/src/schematics/table/header-button/form-table-header-button/index.d.ts +2 -2
- package/src/schematics/table/header-button/form-table-header-button/index.js +2 -2
- package/src/schematics/table/header-button/form-table-header-button/index.js.map +1 -1
- package/src/schematics/table/header-button/form-table-header-button/schema.d.ts +2 -2
- package/src/schematics/table/header-button/form-table-header-button/schema.json +735 -81
- package/src/schematics/table/header-button/form-table-header-button/template.schema.json +4 -22
- package/src/schematics/table/header-button/navigation-table-header-button/schema.json +20 -20
- package/src/schematics/table/table-action/schema.json +47 -47
- package/src/schematics/table/table-component/index.d.ts +2 -2
- package/src/schematics/table/table-component/schema.json +470 -95
- package/src/schematics/table/table-header-button/schema.json +40 -40
- package/src/schematics/table/tree-table-component/files/component/__componentName__.component.html.hbs +1 -1
- package/src/schematics/table/tree-table-component/schema.json +453 -78
- package/src/schematics/table-select-form-control.schema.json +96 -0
- package/src/schematics/textarea-form-control.schema.json +32 -0
- package/src/template.schema.json +39 -0
- package/src/lib/form-component-control.d.ts +0 -8
- package/src/lib/form-component-control.js +0 -15
- package/src/lib/form-component-control.js.map +0 -1
- package/src/lib/form-control.d.ts +0 -136
- package/src/lib/form-control.js +0 -265
- package/src/lib/form-control.js.map +0 -1
- package/src/lib/form-definition-control.d.ts +0 -5
- package/src/lib/form-definition-control.js +0 -30
- package/src/lib/form-definition-control.js.map +0 -1
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { NormalizedTypeImport, TypeImport } from '@rxap/ts-morph';
|
|
2
|
+
import { Normalized } from '@rxap/utilities';
|
|
3
|
+
import { BaseFormControl, NormalizedBaseFormControl } from './base-form-control';
|
|
4
|
+
import { FormControl, NormalizedFormControl } from './form-control';
|
|
5
|
+
export interface FormFieldButton {
|
|
6
|
+
svgIcon?: string;
|
|
7
|
+
icon?: string;
|
|
8
|
+
directiveList?: TypeImport[];
|
|
9
|
+
importList?: TypeImport[];
|
|
10
|
+
}
|
|
11
|
+
export interface FormField {
|
|
12
|
+
label?: string;
|
|
13
|
+
prefixButton?: FormFieldButton;
|
|
14
|
+
suffixButton?: FormFieldButton;
|
|
15
|
+
directiveList?: TypeImport[];
|
|
16
|
+
hasClearButton?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export type NormalizedFormField = Readonly<Normalized<FormField>>;
|
|
19
|
+
export interface NormalizedFormFieldButton extends Readonly<Normalized<FormFieldButton>> {
|
|
20
|
+
directiveList: NormalizedTypeImport[];
|
|
21
|
+
importList: NormalizedTypeImport[];
|
|
22
|
+
}
|
|
23
|
+
export declare function NormalizeFormFieldButton(button?: FormFieldButton | null): NormalizedFormFieldButton | null;
|
|
24
|
+
export declare function NormalizeFormField(formField: FormField, importList?: TypeImport[], defaultFormField?: Partial<FormField>): NormalizedFormField;
|
|
25
|
+
export interface FormFieldFormControl extends BaseFormControl {
|
|
26
|
+
formField?: FormField;
|
|
27
|
+
}
|
|
28
|
+
export interface NormalizedFormFieldFormControl extends Readonly<Normalized<Omit<FormFieldFormControl, 'type' | 'importList' | 'role' | 'kind'>>>, NormalizedBaseFormControl {
|
|
29
|
+
formField: NormalizedFormField;
|
|
30
|
+
}
|
|
31
|
+
export declare function IsFormFieldFormControl(control: FormControl): control is FormFieldFormControl;
|
|
32
|
+
export declare function IsNormalizedFormFieldFormControl(control: NormalizedFormControl): control is NormalizedFormFieldFormControl;
|
|
33
|
+
export declare function NormalizeFormFieldFormControl(control: FormFieldFormControl, importList?: TypeImport[], validatorList?: string[], defaultType?: TypeImport | string, defaultIsArray?: boolean, defaultFormField?: Partial<FormField>): NormalizedFormFieldFormControl;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NormalizeFormFieldFormControl = exports.IsNormalizedFormFieldFormControl = exports.IsFormFieldFormControl = exports.NormalizeFormField = exports.NormalizeFormFieldButton = void 0;
|
|
4
|
+
const ts_morph_1 = require("@rxap/ts-morph");
|
|
5
|
+
const utilities_1 = require("@rxap/utilities");
|
|
6
|
+
const base_form_control_1 = require("./base-form-control");
|
|
7
|
+
function NormalizeFormFieldButton(button) {
|
|
8
|
+
var _a, _b, _c;
|
|
9
|
+
if ((!button || Object.keys(button).length === 0)) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
const importList = (_a = button.importList) !== null && _a !== void 0 ? _a : [];
|
|
13
|
+
(0, utilities_1.CoerceArrayItems)(importList, [
|
|
14
|
+
{
|
|
15
|
+
name: 'MatIconModule',
|
|
16
|
+
moduleSpecifier: '@angular/material/icon',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: 'MatButtonModule',
|
|
20
|
+
moduleSpecifier: '@angular/material/button',
|
|
21
|
+
},
|
|
22
|
+
], (a, b) => a.name === b.name);
|
|
23
|
+
return Object.freeze({
|
|
24
|
+
svgIcon: (_b = button.svgIcon) !== null && _b !== void 0 ? _b : null,
|
|
25
|
+
icon: (_c = button.icon) !== null && _c !== void 0 ? _c : null,
|
|
26
|
+
directiveList: (0, ts_morph_1.NormalizeTypeImportList)(button.directiveList),
|
|
27
|
+
importList: (0, ts_morph_1.NormalizeTypeImportList)(importList),
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
exports.NormalizeFormFieldButton = NormalizeFormFieldButton;
|
|
31
|
+
function NormalizeFormField(formField, importList = [], defaultFormField = {}) {
|
|
32
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
33
|
+
defaultFormField = (0, utilities_1.DeleteEmptyProperties)(defaultFormField);
|
|
34
|
+
const directiveList = (_a = defaultFormField.directiveList) !== null && _a !== void 0 ? _a : [];
|
|
35
|
+
(0, utilities_1.CoerceArrayItems)(directiveList, (_b = defaultFormField.directiveList) !== null && _b !== void 0 ? _b : [], (a, b) => a.name === b.name);
|
|
36
|
+
const normalizedFormField = {
|
|
37
|
+
label: (_d = (_c = defaultFormField.label) !== null && _c !== void 0 ? _c : formField.label) !== null && _d !== void 0 ? _d : null,
|
|
38
|
+
prefixButton: NormalizeFormFieldButton((_e = formField.prefixButton) !== null && _e !== void 0 ? _e : defaultFormField.prefixButton),
|
|
39
|
+
suffixButton: NormalizeFormFieldButton((_f = formField.suffixButton) !== null && _f !== void 0 ? _f : defaultFormField.suffixButton),
|
|
40
|
+
hasClearButton: (_h = (_g = formField.hasClearButton) !== null && _g !== void 0 ? _g : defaultFormField.hasClearButton) !== null && _h !== void 0 ? _h : true,
|
|
41
|
+
directiveList: (0, ts_morph_1.NormalizeTypeImportList)(directiveList),
|
|
42
|
+
};
|
|
43
|
+
if (normalizedFormField.hasClearButton) {
|
|
44
|
+
(_j = normalizedFormField.suffixButton) !== null && _j !== void 0 ? _j : (normalizedFormField.suffixButton = NormalizeFormFieldButton({
|
|
45
|
+
icon: 'clear',
|
|
46
|
+
directiveList: [
|
|
47
|
+
{
|
|
48
|
+
name: 'rxapInputClearButton',
|
|
49
|
+
namedImport: 'InputClearButtonDirective',
|
|
50
|
+
moduleSpecifier: '@rxap/material-form-system',
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
}));
|
|
54
|
+
}
|
|
55
|
+
(0, utilities_1.CoerceArrayItems)(importList, (_l = (_k = normalizedFormField.prefixButton) === null || _k === void 0 ? void 0 : _k.importList) !== null && _l !== void 0 ? _l : [], (a, b) => a.name === b.name && a.namedImport === b.namedImport);
|
|
56
|
+
(0, utilities_1.CoerceArrayItems)(importList, (_o = (_m = normalizedFormField.suffixButton) === null || _m === void 0 ? void 0 : _m.importList) !== null && _o !== void 0 ? _o : [], (a, b) => a.name === b.name && a.namedImport === b.namedImport);
|
|
57
|
+
(0, utilities_1.CoerceArrayItems)(importList, (_q = (_p = normalizedFormField.prefixButton) === null || _p === void 0 ? void 0 : _p.directiveList) !== null && _q !== void 0 ? _q : [], (a, b) => a.name === b.name && a.namedImport === b.namedImport);
|
|
58
|
+
(0, utilities_1.CoerceArrayItems)(importList, (_s = (_r = normalizedFormField.suffixButton) === null || _r === void 0 ? void 0 : _r.directiveList) !== null && _s !== void 0 ? _s : [], (a, b) => a.name === b.name && a.namedImport === b.namedImport);
|
|
59
|
+
return Object.freeze(normalizedFormField);
|
|
60
|
+
}
|
|
61
|
+
exports.NormalizeFormField = NormalizeFormField;
|
|
62
|
+
function IsFormFieldFormControl(control) {
|
|
63
|
+
return control.formField !== undefined;
|
|
64
|
+
}
|
|
65
|
+
exports.IsFormFieldFormControl = IsFormFieldFormControl;
|
|
66
|
+
function IsNormalizedFormFieldFormControl(control) {
|
|
67
|
+
return control.formField !== undefined;
|
|
68
|
+
}
|
|
69
|
+
exports.IsNormalizedFormFieldFormControl = IsNormalizedFormFieldFormControl;
|
|
70
|
+
function NormalizeFormFieldFormControl(control, importList = [], validatorList = [], defaultType = 'unknown', defaultIsArray = false, defaultFormField = { label: control.label }) {
|
|
71
|
+
var _a;
|
|
72
|
+
const formField = NormalizeFormField((_a = control.formField) !== null && _a !== void 0 ? _a : {}, importList, defaultFormField);
|
|
73
|
+
return Object.freeze(Object.assign(Object.assign({}, (0, base_form_control_1.NormalizeBaseFormControl)(control, importList, validatorList, defaultType, defaultIsArray)), { formField }));
|
|
74
|
+
}
|
|
75
|
+
exports.NormalizeFormFieldFormControl = NormalizeFormFieldFormControl;
|
|
76
|
+
//# sourceMappingURL=form-field-form-control.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-field-form-control.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/angular/src/lib/form/control/form-field-form-control.ts"],"names":[],"mappings":";;;AAAA,6CAIwB;AACxB,+CAIyB;AACzB,2DAI6B;AA4B7B,SAAgB,wBAAwB,CAC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|
1
|
+
import { Normalized } from '@rxap/utilities';
|
|
2
|
+
import { NormalizedBaseFormControl } from './base-form-control';
|
|
3
|
+
import { FormControlKinds } from './form-control-kind';
|
|
4
|
+
import { FormField, FormFieldFormControl, NormalizedFormFieldFormControl } from './form-field-form-control';
|
|
5
|
+
export interface InputFormControl extends FormFieldFormControl {
|
|
6
|
+
inputType?: string;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
formField?: FormField;
|
|
9
|
+
}
|
|
10
|
+
export interface NormalizedInputFormControl extends Omit<Readonly<Normalized<InputFormControl>>, 'type' | 'importList' | 'formField' | 'role'>, NormalizedFormFieldFormControl {
|
|
11
|
+
kind: FormControlKinds.INPUT;
|
|
12
|
+
}
|
|
13
|
+
export declare function IsNormalizedInputFormControlOptions(template: NormalizedBaseFormControl): template is NormalizedInputFormControl;
|
|
14
|
+
export declare function NormalizeInputFormControl(control: InputFormControl): NormalizedInputFormControl;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NormalizeInputFormControl = exports.IsNormalizedInputFormControlOptions = void 0;
|
|
4
|
+
const ts_morph_1 = require("@rxap/ts-morph");
|
|
5
|
+
const utilities_1 = require("@rxap/utilities");
|
|
6
|
+
const form_control_kind_1 = require("./form-control-kind");
|
|
7
|
+
const form_field_form_control_1 = require("./form-field-form-control");
|
|
8
|
+
function IsNormalizedInputFormControlOptions(template) {
|
|
9
|
+
return template.kind === form_control_kind_1.FormControlKinds.INPUT;
|
|
10
|
+
}
|
|
11
|
+
exports.IsNormalizedInputFormControlOptions = IsNormalizedInputFormControlOptions;
|
|
12
|
+
function NormalizeInputFormControl(control) {
|
|
13
|
+
var _a, _b, _c, _d;
|
|
14
|
+
const type = (0, ts_morph_1.NormalizeTypeImport)(control.type);
|
|
15
|
+
const validatorList = (_a = control.validatorList) !== null && _a !== void 0 ? _a : [];
|
|
16
|
+
const importList = (_b = control.importList) !== null && _b !== void 0 ? _b : [];
|
|
17
|
+
(0, utilities_1.CoerceArrayItems)(importList, [
|
|
18
|
+
{
|
|
19
|
+
name: 'MatInputModule',
|
|
20
|
+
moduleSpecifier: '@angular/material/input',
|
|
21
|
+
}
|
|
22
|
+
], (a, b) => a.name === b.name);
|
|
23
|
+
const inputType = (_c = control.inputType) !== null && _c !== void 0 ? _c : 'text';
|
|
24
|
+
switch (inputType) {
|
|
25
|
+
case 'checkbox':
|
|
26
|
+
type.name = 'boolean';
|
|
27
|
+
break;
|
|
28
|
+
case 'text':
|
|
29
|
+
case 'password':
|
|
30
|
+
case 'color':
|
|
31
|
+
type.name = 'string';
|
|
32
|
+
break;
|
|
33
|
+
case 'email':
|
|
34
|
+
type.name = 'string';
|
|
35
|
+
(0, utilities_1.CoerceArrayItems)(validatorList, ['IsEmail()']);
|
|
36
|
+
break;
|
|
37
|
+
case 'tel':
|
|
38
|
+
type.name = 'string';
|
|
39
|
+
(0, utilities_1.CoerceArrayItems)(validatorList, ['IsTel()']);
|
|
40
|
+
break;
|
|
41
|
+
case 'url':
|
|
42
|
+
type.name = 'string';
|
|
43
|
+
(0, utilities_1.CoerceArrayItems)(validatorList, ['IsUrl()']);
|
|
44
|
+
break;
|
|
45
|
+
case 'number':
|
|
46
|
+
type.name = 'number';
|
|
47
|
+
break;
|
|
48
|
+
case 'date':
|
|
49
|
+
case 'time':
|
|
50
|
+
case 'datetime-local':
|
|
51
|
+
type.name = 'Date';
|
|
52
|
+
(0, utilities_1.CoerceArrayItems)(validatorList, ['IsDate()']);
|
|
53
|
+
break;
|
|
54
|
+
case 'file':
|
|
55
|
+
case 'hidden':
|
|
56
|
+
case 'image':
|
|
57
|
+
case 'month':
|
|
58
|
+
case 'radio':
|
|
59
|
+
case 'reset':
|
|
60
|
+
case 'button':
|
|
61
|
+
case 'search':
|
|
62
|
+
case 'submit':
|
|
63
|
+
case 'week':
|
|
64
|
+
case 'range':
|
|
65
|
+
throw new Error(`The input type "${inputType}" is not yet supported`);
|
|
66
|
+
}
|
|
67
|
+
// TODO : auto add validators
|
|
68
|
+
return Object.freeze(Object.assign(Object.assign({}, (0, form_field_form_control_1.NormalizeFormFieldFormControl)(control, importList, validatorList, type, false)), { validatorList, kind: form_control_kind_1.FormControlKinds.INPUT, inputType, placeholder: (_d = control.placeholder) !== null && _d !== void 0 ? _d : null }));
|
|
69
|
+
}
|
|
70
|
+
exports.NormalizeInputFormControl = NormalizeInputFormControl;
|
|
71
|
+
//# sourceMappingURL=input-form-control.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-form-control.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/angular/src/lib/form/control/input-form-control.ts"],"names":[],"mappings":";;;AAAA,6CAAqD;AACrD,+CAGyB;AAGzB,2DAAuD;AACvD,uEAKmC;AAcnC,SAAgB,mCAAmC,CAAC,QAAmC;IACrF,OAAO,QAAQ,CAAC,IAAI,KAAK,oCAAgB,CAAC,KAAK,CAAC;AAClD,CAAC;AAFD,kFAEC;AAED,SAAgB,yBAAyB,CACvC,OAAyB;;IAEzB,MAAM,IAAI,GAAG,IAAA,8BAAmB,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,MAAM,aAAa,GAAG,MAAA,OAAO,CAAC,aAAa,mCAAI,EAAE,CAAC;IAClD,MAAM,UAAU,GAAG,MAAA,OAAO,CAAC,UAAU,mCAAI,EAAE,CAAC;IAC5C,IAAA,4BAAgB,EAAC,UAAU,EAAE;QAC3B;YACE,IAAI,EAAE,gBAAgB;YACtB,eAAe,EAAE,yBAAyB;SAC3C;KACF,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC;IAChC,MAAM,SAAS,GAAW,MAAA,OAAO,CAAC,SAAS,mCAAI,MAAM,CAAC;IACtD,QAAQ,SAAS,EAAE;QACjB,KAAK,UAAU;YACb,IAAI,CAAC,IA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AAO,EAAE,UAAU,EAAE,aAAa,EAAE,IAAI,EAAE,KAAK,CAAC,KACjF,aAAa,EACb,IAAI,EAAE,oCAAgB,CAAC,KAAK,EAC5B,SAAS,EACT,WAAW,EAAE,MAAA,OAAO,CAAC,WAAW,mCAAI,IAAI,IACxC,CAAC;AACL,CAAC;AAhED,8DAgEC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ControlOption, Normalized } from '@rxap/utilities';
|
|
2
|
+
import { BackendTypes } from '../../backend-types';
|
|
3
|
+
import { NormalizedBaseFormControl } from './base-form-control';
|
|
4
|
+
import { FormControlKinds } from './form-control-kind';
|
|
5
|
+
import { FormField, FormFieldFormControl, NormalizedFormFieldFormControl } from './form-field-form-control';
|
|
6
|
+
export interface SelectFormControl extends FormFieldFormControl {
|
|
7
|
+
optionList?: ControlOption[];
|
|
8
|
+
backend?: BackendTypes;
|
|
9
|
+
multiple?: boolean;
|
|
10
|
+
formField?: FormField;
|
|
11
|
+
}
|
|
12
|
+
export interface NormalizedSelectFormControl extends Readonly<Normalized<Omit<SelectFormControl, 'optionList' | 'type' | 'importList' | 'formField' | 'role'>>>, NormalizedFormFieldFormControl {
|
|
13
|
+
kind: FormControlKinds.SELECT;
|
|
14
|
+
optionList: ReadonlyArray<ControlOption> | null;
|
|
15
|
+
backend: BackendTypes;
|
|
16
|
+
}
|
|
17
|
+
export declare function IsNormalizedSelectFormControl(template: NormalizedBaseFormControl): template is NormalizedSelectFormControl;
|
|
18
|
+
export declare function NormalizeSelectFormControl(control: SelectFormControl): NormalizedSelectFormControl;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NormalizeSelectFormControl = exports.IsNormalizedSelectFormControl = void 0;
|
|
4
|
+
const utilities_1 = require("@rxap/utilities");
|
|
5
|
+
const backend_types_1 = require("../../backend-types");
|
|
6
|
+
const form_control_kind_1 = require("./form-control-kind");
|
|
7
|
+
const form_field_form_control_1 = require("./form-field-form-control");
|
|
8
|
+
function IsNormalizedSelectFormControl(template) {
|
|
9
|
+
return template.kind === form_control_kind_1.FormControlKinds.SELECT;
|
|
10
|
+
}
|
|
11
|
+
exports.IsNormalizedSelectFormControl = IsNormalizedSelectFormControl;
|
|
12
|
+
function NormalizeSelectFormControl(control) {
|
|
13
|
+
var _a, _b, _c;
|
|
14
|
+
const importList = (_a = control.importList) !== null && _a !== void 0 ? _a : [];
|
|
15
|
+
(0, utilities_1.CoerceArrayItems)(importList, [
|
|
16
|
+
{
|
|
17
|
+
name: 'MatSelectModule',
|
|
18
|
+
moduleSpecifier: '@angular/material/select',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'InputSelectOptionsDirective',
|
|
22
|
+
moduleSpecifier: '@rxap/form-system',
|
|
23
|
+
}
|
|
24
|
+
], (a, b) => a.name === b.name);
|
|
25
|
+
const multiple = (_b = control.multiple) !== null && _b !== void 0 ? _b : false;
|
|
26
|
+
return Object.freeze(Object.assign(Object.assign({}, (0, form_field_form_control_1.NormalizeFormFieldFormControl)(control, importList, undefined, undefined, multiple)), { kind: form_control_kind_1.FormControlKinds.SELECT, optionList: control.optionList && control.optionList.length ? Object.freeze(control.optionList) : null, backend: (_c = control.backend) !== null && _c !== void 0 ? _c : backend_types_1.BackendTypes.NONE, multiple }));
|
|
27
|
+
}
|
|
28
|
+
exports.NormalizeSelectFormControl = NormalizeSelectFormControl;
|
|
29
|
+
//# sourceMappingURL=select-form-control.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select-form-control.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/angular/src/lib/form/control/select-form-control.ts"],"names":[],"mappings":";;;AAAA,+CAIyB;AACzB,uDAAmD;AAGnD,2DAAuD;AACvD,uEAKmC;AAiBnC,SAAgB,6BAA6B,CAAC,QAAmC;IAC/E,OAAO,QAAQ,CAAC,IAAI,KAAK,oCAAgB,CAAC,MAAM,CAAC;AACnD,CAAC;AAFD,sEAEC;AAED,SAAgB,0BAA0B,CACxC,OAA0B;;IAE1B,MAAM,UAAU,GAAG,MAAA,OAAO,CAAC,UAAU,mCAAI,EAAE,CAAC;IAC5C,IAAA,4BAAgB,EAAC,UAAU,EAAE;QAC3B;YACE,IAAI,EAAE,iBAAiB;YACvB,eAAe,EAAE,0BAA0B;SAC5C;QACD;YACE,IAAI,EAAE,6BAA6B;YACnC,eAAe,EAAE,mBAAmB;SACrC;KACF,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC;IAChC,MAAM,QAAQ,GAAG,MAAA,OAAO,CAAC,QAAQ,mCAAI,KAAK,CAAC;IAC3C,OAAO,MAAM,CAAC,MAAM,iCACf,IAAA,uDAA6B,EAAC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAC,KACrF,IAAI,EAAE,oCAAgB,CAAC,MAAM,EAC7B,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,EACtG,OAAO,EAAE,MAAA,OAAO,CAAC,OAAO,mCAAI,4BAAY,CAAC,IAAI,EAC7C,QAAQ,IACR,CAAC;AACL,CAAC;AAtBD,gEAsBC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Normalized } from '@rxap/utilities';
|
|
2
|
+
import { BaseFormControl, NormalizedBaseFormControl } from './base-form-control';
|
|
3
|
+
import { FormControlKinds } from './form-control-kind';
|
|
4
|
+
export interface SlideToggleFormControl extends BaseFormControl {
|
|
5
|
+
labelPosition?: 'before' | 'after';
|
|
6
|
+
}
|
|
7
|
+
export interface NormalizedSlideToggleFormControl extends Readonly<Normalized<Omit<SlideToggleFormControl, 'type' | 'importList' | 'role'>>>, NormalizedBaseFormControl {
|
|
8
|
+
kind: FormControlKinds.CHECKBOX;
|
|
9
|
+
}
|
|
10
|
+
export declare function IsNormalizedSlideToggleFormControl(template: NormalizedBaseFormControl): template is NormalizedSlideToggleFormControl;
|
|
11
|
+
export declare function NormalizeSlideToggleFormControl(control: SlideToggleFormControl): NormalizedSlideToggleFormControl;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NormalizeSlideToggleFormControl = exports.IsNormalizedSlideToggleFormControl = void 0;
|
|
4
|
+
const utilities_1 = require("@rxap/utilities");
|
|
5
|
+
const base_form_control_1 = require("./base-form-control");
|
|
6
|
+
const form_control_kind_1 = require("./form-control-kind");
|
|
7
|
+
function IsNormalizedSlideToggleFormControl(template) {
|
|
8
|
+
return template.kind === form_control_kind_1.FormControlKinds.CHECKBOX;
|
|
9
|
+
}
|
|
10
|
+
exports.IsNormalizedSlideToggleFormControl = IsNormalizedSlideToggleFormControl;
|
|
11
|
+
function NormalizeSlideToggleFormControl(control) {
|
|
12
|
+
var _a, _b;
|
|
13
|
+
const importList = (_a = control.importList) !== null && _a !== void 0 ? _a : [];
|
|
14
|
+
(0, utilities_1.CoerceArrayItems)(importList, [
|
|
15
|
+
{
|
|
16
|
+
name: 'MatSlideToggleModule',
|
|
17
|
+
moduleSpecifier: '@angular/material/slide-toggle',
|
|
18
|
+
},
|
|
19
|
+
], (a, b) => a.name === b.name);
|
|
20
|
+
return Object.freeze(Object.assign(Object.assign({}, (0, base_form_control_1.NormalizeBaseFormControl)(control, importList, undefined, 'boolean', false)), { kind: form_control_kind_1.FormControlKinds.CHECKBOX, labelPosition: (_b = control.labelPosition) !== null && _b !== void 0 ? _b : 'after' }));
|
|
21
|
+
}
|
|
22
|
+
exports.NormalizeSlideToggleFormControl = NormalizeSlideToggleFormControl;
|
|
23
|
+
//# sourceMappingURL=slide-toggle-form-control.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slide-toggle-form-control.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/angular/src/lib/form/control/slide-toggle-form-control.ts"],"names":[],"mappings":";;;AAAA,+CAGyB;AACzB,2DAI6B;AAE7B,2DAAuD;AAWvD,SAAgB,kCAAkC,CAAC,QAAmC;IACpF,OAAO,QAAQ,CAAC,IAAI,KAAK,oCAAgB,CAAC,QAAQ,CAAC;AACrD,CAAC;AAFD,gFAEC;AAED,SAAgB,+BAA+B,CAC7C,OAA+B;;IAE/B,MAAM,UAAU,GAAG,MAAA,OAAO,CAAC,UAAU,mCAAI,EAAE,CAAC;IAC5C,IAAA,4BAAgB,EAAC,UAAU,EAAE;QAC3B;YACE,IAAI,EAAE,sBAAsB;YAC5B,eAAe,EAAE,gCAAgC;SAClD;KACF,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC;IAChC,OAAO,MAAM,CAAC,MAAM,iCACf,IAAA,4CAAwB,EAAC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC,KAC7E,IAAI,EAAE,oCAAgB,CAAC,QAAQ,EAC/B,aAAa,EAAE,MAAA,OAAO,CAAC,aAAa,mCAAI,OAAO,IAC/C,CAAC;AACL,CAAC;AAfD,0EAeC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { DataProperty, NormalizedDataProperty, NormalizedUpstreamOptions, UpstreamOptions } from '@rxap/ts-morph';
|
|
2
|
+
import { Normalized } from '@rxap/utilities';
|
|
3
|
+
import { BackendTypes } from '../../backend-types';
|
|
4
|
+
import { NormalizedTableColumn, TableColumn } from '../../table-column';
|
|
5
|
+
import { NormalizedBaseFormControl } from './base-form-control';
|
|
6
|
+
import { FormControlKinds } from './form-control-kind';
|
|
7
|
+
import { FormFieldFormControl, NormalizedFormFieldFormControl } from './form-field-form-control';
|
|
8
|
+
export type TableSelectColumn = Pick<TableColumn, 'name' | 'title' | 'hasFilter' | 'kind' | 'propertyPath'> & DataProperty;
|
|
9
|
+
export type NormalizedTableSelectColumn = Pick<NormalizedTableColumn, 'name' | 'title' | 'hasFilter' | 'kind' | 'propertyPath'> & NormalizedDataProperty;
|
|
10
|
+
export declare function NormalizeTableSelectColumn(column: TableSelectColumn): NormalizedTableSelectColumn;
|
|
11
|
+
export interface TableSelectToFunction {
|
|
12
|
+
property: DataProperty;
|
|
13
|
+
}
|
|
14
|
+
export interface NormalizedTableSelectToFunction extends Readonly<Normalized<TableSelectToFunction>> {
|
|
15
|
+
property: NormalizedDataProperty;
|
|
16
|
+
}
|
|
17
|
+
export declare function NormalizeTableSelectToFunction(toFunction: TableSelectToFunction | null | undefined, columnList: TableSelectColumn[], defaultType?: string): NormalizedTableSelectToFunction;
|
|
18
|
+
export interface TableSelectFormControl extends FormFieldFormControl {
|
|
19
|
+
backend?: BackendTypes;
|
|
20
|
+
title?: string;
|
|
21
|
+
propertyList?: DataProperty[];
|
|
22
|
+
columnList?: TableSelectColumn[];
|
|
23
|
+
toDisplay?: TableSelectToFunction;
|
|
24
|
+
toValue?: TableSelectToFunction;
|
|
25
|
+
upstream?: UpstreamOptions;
|
|
26
|
+
resolver?: {
|
|
27
|
+
upstream?: UpstreamOptions;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export interface NormalizedTableSelectFormControl extends Readonly<Normalized<Omit<TableSelectFormControl, 'type' | 'importList' | 'columnList' | 'propertyList' | 'formField' | 'role'>>>, NormalizedFormFieldFormControl {
|
|
31
|
+
kind: FormControlKinds.TABLE_SELECT;
|
|
32
|
+
backend: BackendTypes;
|
|
33
|
+
columnList: NormalizedTableSelectColumn[];
|
|
34
|
+
propertyList: Array<NormalizedDataProperty>;
|
|
35
|
+
toDisplay: NormalizedTableSelectToFunction;
|
|
36
|
+
toValue: NormalizedTableSelectToFunction;
|
|
37
|
+
upstream: NormalizedUpstreamOptions | null;
|
|
38
|
+
resolver: {
|
|
39
|
+
upstream: NormalizedUpstreamOptions | null;
|
|
40
|
+
} | null;
|
|
41
|
+
}
|
|
42
|
+
export declare function IsNormalizedTableSelectFormControl(template: NormalizedBaseFormControl): template is NormalizedTableSelectFormControl;
|
|
43
|
+
export declare function NormalizeTableSelectFormControl(control: TableSelectFormControl): NormalizedTableSelectFormControl;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NormalizeTableSelectFormControl = exports.IsNormalizedTableSelectFormControl = exports.NormalizeTableSelectToFunction = exports.NormalizeTableSelectColumn = void 0;
|
|
4
|
+
const ts_morph_1 = require("@rxap/ts-morph");
|
|
5
|
+
const utilities_1 = require("@rxap/utilities");
|
|
6
|
+
const backend_types_1 = require("../../backend-types");
|
|
7
|
+
const table_column_1 = require("../../table-column");
|
|
8
|
+
const form_control_kind_1 = require("./form-control-kind");
|
|
9
|
+
const form_field_form_control_1 = require("./form-field-form-control");
|
|
10
|
+
function NormalizeTableSelectColumn(column) {
|
|
11
|
+
var _a, _b, _c, _d;
|
|
12
|
+
const { name, propertyPath, } = (0, table_column_1.TableColumnNameToPropertyPath)(column.name, column.propertyPath);
|
|
13
|
+
const kind = (_a = column.kind) !== null && _a !== void 0 ? _a : table_column_1.TableColumnKind.DEFAULT;
|
|
14
|
+
const type = (0, table_column_1.GuessColumnTypeType)(kind, (_b = column.type) !== null && _b !== void 0 ? _b : 'unknown');
|
|
15
|
+
return Object.freeze(Object.assign(Object.assign({}, (0, ts_morph_1.NormalizeDataProperty)(Object.assign(Object.assign({}, column), { name,
|
|
16
|
+
type }))), { title: (_c = column.title) !== null && _c !== void 0 ? _c : (0, utilities_1.dasherize)(name).split('-').map(part => (0, utilities_1.capitalize)(part)).join(' '), hasFilter: (_d = column.hasFilter) !== null && _d !== void 0 ? _d : false, kind,
|
|
17
|
+
propertyPath }));
|
|
18
|
+
}
|
|
19
|
+
exports.NormalizeTableSelectColumn = NormalizeTableSelectColumn;
|
|
20
|
+
function NormalizeTableSelectToFunction(toFunction, columnList, defaultType = 'unknown') {
|
|
21
|
+
if (!toFunction || Object.keys(toFunction).length === 0) {
|
|
22
|
+
return Object.freeze({
|
|
23
|
+
property: (0, ts_morph_1.NormalizeDataProperty)(columnList[0].name, defaultType),
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
return Object.freeze({
|
|
27
|
+
property: (0, ts_morph_1.NormalizeDataProperty)(toFunction.property, defaultType),
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
exports.NormalizeTableSelectToFunction = NormalizeTableSelectToFunction;
|
|
31
|
+
function IsNormalizedTableSelectFormControl(template) {
|
|
32
|
+
return template.kind === form_control_kind_1.FormControlKinds.TABLE_SELECT;
|
|
33
|
+
}
|
|
34
|
+
exports.IsNormalizedTableSelectFormControl = IsNormalizedTableSelectFormControl;
|
|
35
|
+
function NormalizeTableSelectFormControl(control) {
|
|
36
|
+
var _a, _b, _c, _d, _e;
|
|
37
|
+
const importList = (_a = control.importList) !== null && _a !== void 0 ? _a : [];
|
|
38
|
+
(0, utilities_1.CoerceArrayItems)(importList, [
|
|
39
|
+
{
|
|
40
|
+
name: 'TableSelectControlModule',
|
|
41
|
+
moduleSpecifier: '@digitaix/eurogard-table-select',
|
|
42
|
+
}
|
|
43
|
+
], (a, b) => a.name === b.name);
|
|
44
|
+
if (!((_b = control.columnList) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
45
|
+
throw new Error('The column list must not be empty');
|
|
46
|
+
}
|
|
47
|
+
const propertyList = (0, ts_morph_1.NormalizeDataPropertyList)(control.propertyList);
|
|
48
|
+
const toDisplay = NormalizeTableSelectToFunction(control.toDisplay, control.columnList, 'string');
|
|
49
|
+
const toValue = NormalizeTableSelectToFunction(control.toValue, control.columnList);
|
|
50
|
+
(0, utilities_1.CoerceArrayItems)(propertyList, [toDisplay.property, toValue.property], (a, b) => a.name === b.name);
|
|
51
|
+
const columnList = control.columnList.map(NormalizeTableSelectColumn);
|
|
52
|
+
(0, utilities_1.CoerceArrayItems)(propertyList, columnList, (a, b) => a.name === b.name);
|
|
53
|
+
(_c = control.type) !== null && _c !== void 0 ? _c : (control.type = toValue.property.type);
|
|
54
|
+
return Object.freeze(Object.assign(Object.assign({}, (0, form_field_form_control_1.NormalizeFormFieldFormControl)(control, importList, undefined, undefined, false, {
|
|
55
|
+
label: control.label,
|
|
56
|
+
directiveList: [
|
|
57
|
+
{
|
|
58
|
+
name: 'eurogardTableSelectControl',
|
|
59
|
+
namedImport: 'TableSelectControlModule',
|
|
60
|
+
moduleSpecifier: '@digitaix/eurogard-table-select',
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
})), { resolver: control.resolver ? { upstream: (0, ts_morph_1.NormalizeUpstreamOptions)(control.resolver.upstream) } : null, kind: form_control_kind_1.FormControlKinds.TABLE_SELECT, backend: (_d = control.backend) !== null && _d !== void 0 ? _d : backend_types_1.BackendTypes.NONE, title: (_e = control.title) !== null && _e !== void 0 ? _e : null, columnList,
|
|
64
|
+
toDisplay,
|
|
65
|
+
toValue,
|
|
66
|
+
propertyList, upstream: (0, ts_morph_1.NormalizeUpstreamOptions)(control.upstream) }));
|
|
67
|
+
}
|
|
68
|
+
exports.NormalizeTableSelectFormControl = NormalizeTableSelectFormControl;
|
|
69
|
+
//# sourceMappingURL=table-select-form-control.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-select-form-control.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/angular/src/lib/form/control/table-select-form-control.ts"],"names":[],"mappings":";;;AAAA,6CAQwB;AACxB,+CAKyB;AACzB,uDAAmD;AACnD,qDAM4B;AAG5B,2DAAuD;AACvD,uEAImC;AAOnC,SAAgB,0BAA0B,CACxC,MAAyB;;IAEzB,MAAM,EACJ,IAAI,EACJ,YAAY,GACb,GAAG,IA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I,oCAAZ,OAAO,CAAC,IAAI,GAAK,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAC;IACvC,OAAO,MAAM,CAAC,MAAM,iCACf,IAAA,uDAA6B,EAAC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE;QACjF,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,aAAa,EAAE;YACb;gBACE,IAAI,EAAE,4BAA4B;gBAClC,WAAW,EAAE,0BAA0B;gBACvC,eAAe,EAAE,iCAAiC;aACnD;SACF;KACF,CAAC,KACF,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,IAAA,mCAAwB,EAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EACrG,IAAI,EAAE,oCAAgB,CAAC,YAAY,EACnC,OAAO,EAAE,MAAA,OAAO,CAAC,OAAO,mCAAI,4BAAY,CAAC,IAAI,EAC7C,KAAK,EAAE,MAAA,OAAO,CAAC,KAAK,mCAAI,IAAI,EAC5B,UAAU;QACV,SAAS;QACT,OAAO;QACP,YAAY,EACZ,QAAQ,EAAE,IAAA,mCAAwB,EAAC,OAAO,CAAC,QAAQ,CAAC,IACpD,CAAC;AACL,CAAC;AAzCD,0EAyCC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DtoClassProperty } from '@rxap/schematics-ts-morph';
|
|
2
|
+
import { AbstractControl, NormalizedAbstractControl } from './abstract-control';
|
|
3
|
+
import { FormControl, NormalizedFormControl } from './control/form-control';
|
|
4
|
+
export type Control = AbstractControl | FormControl;
|
|
5
|
+
export type NormalizedControl = NormalizedAbstractControl | NormalizedFormControl;
|
|
6
|
+
export declare function NormalizeControl(control: Control): NormalizedControl;
|
|
7
|
+
export declare function NormalizeControlList(controlList?: Control[]): NormalizedControl[];
|
|
8
|
+
export declare function ControlToDtoClassProperty(control: NormalizedControl): DtoClassProperty;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ControlToDtoClassProperty = exports.NormalizeControlList = exports.NormalizeControl = void 0;
|
|
4
|
+
const abstract_control_1 = require("./abstract-control");
|
|
5
|
+
const form_array_1 = require("./array/form-array");
|
|
6
|
+
const form_control_1 = require("./control/form-control");
|
|
7
|
+
const form_group_1 = require("./group/form-group");
|
|
8
|
+
function NormalizeControl(control) {
|
|
9
|
+
var _a;
|
|
10
|
+
(_a = control.role) !== null && _a !== void 0 ? _a : (control.role = abstract_control_1.AbstractControlRolls.CONTROL);
|
|
11
|
+
if ((0, form_control_1.IsFormControl)(control)) {
|
|
12
|
+
return (0, form_control_1.NormalizeFormControl)(control);
|
|
13
|
+
}
|
|
14
|
+
if ((0, form_group_1.IsFormGroup)(control)) {
|
|
15
|
+
return (0, form_group_1.NormalizeFormGroup)(control);
|
|
16
|
+
}
|
|
17
|
+
if ((0, form_array_1.IsFormArray)(control)) {
|
|
18
|
+
return (0, form_array_1.NormalizeFormArray)(control);
|
|
19
|
+
}
|
|
20
|
+
throw new Error(`Unknown control role: '${control.role}'`);
|
|
21
|
+
}
|
|
22
|
+
exports.NormalizeControl = NormalizeControl;
|
|
23
|
+
function NormalizeControlList(controlList) {
|
|
24
|
+
var _a;
|
|
25
|
+
return (_a = controlList === null || controlList === void 0 ? void 0 : controlList.map(NormalizeControl)) !== null && _a !== void 0 ? _a : [];
|
|
26
|
+
}
|
|
27
|
+
exports.NormalizeControlList = NormalizeControlList;
|
|
28
|
+
function ControlToDtoClassProperty(control) {
|
|
29
|
+
return {
|
|
30
|
+
name: control.name,
|
|
31
|
+
type: control.type,
|
|
32
|
+
isOptional: !control.isRequired,
|
|
33
|
+
isArray: control.isArray,
|
|
34
|
+
source: control.source,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
exports.ControlToDtoClassProperty = ControlToDtoClassProperty;
|
|
38
|
+
//# sourceMappingURL=control.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/angular/src/lib/form/control.ts"],"names":[],"mappings":";;;AACA,yDAI4B;AAC5B,mDAG4B;AAC5B,yDAKgC;AAChC,mDAG4B;AAM5B,SAAgB,gBAAgB,CAAC,OAAgB;;IAC/C,MAAA,OAAO,CAAC,IAAI,oCAAZ,OAAO,CAAC,IAAI,GAAK,uCAAoB,CAAC,OAAO,EAAC;IAC9C,IAAI,IAAA,4BAAa,EAAC,OAAO,CAAC,EAAE;QAC1B,OAAO,IAAA,mCAAoB,EAAC,OAAO,CAAC,CAAC;KACtC;IACD,IAAI,IAAA,wBAAW,EAAC,OAAO,CAAC,EAAE;QACxB,OAAO,IAAA,+BAAkB,EAAC,OAAO,CAAC,CAAC;KACpC;IACD,IAAI,IAAA,wBAAW,EAAC,OAAO,CAAC,EAAE;QACxB,OAAO,IAAA,+BAAkB,EAAC,OAAO,CAAC,CAAC;KACpC;IACD,MAAM,IAAI,KAAK,CAAC,0BAA0B,OAAO,CAAC,IAAI,GAAG,CAAC,CAAC;AAC7D,CAAC;AAZD,4CAYC;AAED,SAAgB,oBAAoB,CAAC,WAAuB;;IAC1D,OAAO,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,GAAG,CAAC,gBAAgB,CAAC,mCAAI,EAAE,CAAC;AAClD,CAAC;AAFD,oDAEC;AAED,SAAgB,yBAAyB,CACvC,OAA0B;IAE1B,OAAO;QACL,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,UAAU,EAAE,CAAC,OAAO,CAAC,UAAU;QAC/B,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,MAAM,EAAE,OAAO,CAAC,MAAM;KACvB,CAAC;AACJ,CAAC;AAVD,8DAUC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NormalizedControl } from './control';
|
|
2
2
|
export interface GenerateFormTemplateOptions {
|
|
3
|
-
controlList: ReadonlyArray<
|
|
3
|
+
controlList: ReadonlyArray<NormalizedControl>;
|
|
4
4
|
}
|
|
5
5
|
export declare function GenerateFormTemplate(options: GenerateFormTemplateOptions): string;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { TypeImport } from '@rxap/ts-morph';
|
|
2
|
+
import { Normalized } from '@rxap/utilities';
|
|
3
|
+
import { AbstractControl, AbstractControlRolls, NormalizedAbstractControl } from '../abstract-control';
|
|
4
|
+
import { Control, NormalizedControl } from '../control';
|
|
5
|
+
import { FormGroupKind } from './form-group-kind';
|
|
6
|
+
export interface BaseFormGroup extends AbstractControl {
|
|
7
|
+
controlList?: Control[];
|
|
8
|
+
kind?: FormGroupKind;
|
|
9
|
+
role: AbstractControlRolls.GROUP;
|
|
10
|
+
legend?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface NormalizedBaseFormGroup extends Readonly<Normalized<Omit<BaseFormGroup, 'role' | 'type' | 'importList' | 'controlList'>>>, NormalizedAbstractControl {
|
|
13
|
+
controlList: ReadonlyArray<NormalizedControl>;
|
|
14
|
+
kind: FormGroupKind.DEFAULT;
|
|
15
|
+
role: AbstractControlRolls.GROUP;
|
|
16
|
+
}
|
|
17
|
+
export declare function NormalizeBaseFormGroup(group: BaseFormGroup, importList?: TypeImport[], validatorList?: string[], defaultType?: TypeImport | string, defaultIsArray?: boolean): NormalizedBaseFormGroup;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NormalizeBaseFormGroup = void 0;
|
|
4
|
+
const utilities_1 = require("@rxap/utilities");
|
|
5
|
+
const abstract_control_1 = require("../abstract-control");
|
|
6
|
+
const control_1 = require("../control");
|
|
7
|
+
const form_group_kind_1 = require("./form-group-kind");
|
|
8
|
+
function NormalizeBaseFormGroup(group, importList = [], validatorList = [], defaultType = 'unknown', defaultIsArray = false) {
|
|
9
|
+
var _a, _b;
|
|
10
|
+
(0, utilities_1.CoerceArrayItems)(importList, [
|
|
11
|
+
{
|
|
12
|
+
name: 'ReactiveFormsModule',
|
|
13
|
+
moduleSpecifier: '@angular/forms',
|
|
14
|
+
}
|
|
15
|
+
], (a, b) => a.name === b.name);
|
|
16
|
+
const kind = (_a = group.kind) !== null && _a !== void 0 ? _a : form_group_kind_1.FormGroupKind.DEFAULT;
|
|
17
|
+
return Object.assign(Object.assign({}, (0, abstract_control_1.NormalizeAbstractControl)(group, kind, importList, validatorList, defaultType, defaultIsArray)), { role: abstract_control_1.AbstractControlRolls.GROUP, controlList: (0, control_1.NormalizeControlList)(group.controlList), legend: (_b = group.legend) !== null && _b !== void 0 ? _b : null });
|
|
18
|
+
}
|
|
19
|
+
exports.NormalizeBaseFormGroup = NormalizeBaseFormGroup;
|
|
20
|
+
//# sourceMappingURL=base-form-group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-form-group.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/angular/src/lib/form/group/base-form-group.ts"],"names":[],"mappings":";;;AACA,+CAGyB;AACzB,0DAK6B;AAC7B,wCAIoB;AACpB,uDAAkD;AAelD,SAAgB,sBAAsB,CACpC,KAAoB,EACpB,aAA2B,EAAE,EAC7B,gBAA0B,EAAE,EAC5B,cAAmC,SAAS,EAC5C,cAAc,GAAG,KAAK;;IAEtB,IAAA,4BAAgB,EAAC,UAAU,EAAE;QAC3B;YACE,IAAI,EAAE,qBAAqB;YAC3B,eAAe,EAAE,gBAAgB;SAClC;KACF,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC;IAChC,MAAM,IAAI,GAAG,MAAA,KAAK,CAAC,IAAI,mCAAI,+BAAa,CAAC,OAAO,CAAC;IACjD,uCACK,IAAA,2CAAwB,EAAC,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,cAAc,CAAC,KAChG,IAAI,EAAE,uCAAoB,CAAC,KAAK,EAChC,WAAW,EAAE,IAAA,8BAAoB,EAAC,KAAK,CAAC,WAAW,CAAC,EACpD,MAAM,EAAE,MAAA,KAAK,CAAC,MAAM,mCAAI,IAAI,IAC5B;AACJ,CAAC;AApBD,wDAoBC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FormGroupKind = void 0;
|
|
4
|
+
var FormGroupKind;
|
|
5
|
+
(function (FormGroupKind) {
|
|
6
|
+
FormGroupKind["DEFAULT"] = "default";
|
|
7
|
+
})(FormGroupKind || (exports.FormGroupKind = FormGroupKind = {}));
|
|
8
|
+
//# sourceMappingURL=form-group-kind.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-group-kind.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/angular/src/lib/form/group/form-group-kind.ts"],"names":[],"mappings":";;;AAAA,IAAY,aAEX;AAFD,WAAY,aAAa;IACvB,oCAAmB,CAAA;AACrB,CAAC,EAFW,aAAa,6BAAb,aAAa,QAExB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AbstractControlRolls } from '../abstract-control';
|
|
2
|
+
import { Control, NormalizedControl } from '../control';
|
|
3
|
+
import { BaseFormGroup, NormalizedBaseFormGroup } from './base-form-group';
|
|
4
|
+
export type FormGroup = {
|
|
5
|
+
role: AbstractControlRolls.GROUP;
|
|
6
|
+
} & (BaseFormGroup);
|
|
7
|
+
export type NormalizedFormGroup = {
|
|
8
|
+
role: AbstractControlRolls.GROUP;
|
|
9
|
+
} & (NormalizedBaseFormGroup);
|
|
10
|
+
export declare function NormalizeFormGroup(group: FormGroup): NormalizedFormGroup;
|
|
11
|
+
export declare function IsFormGroup(control: Control): control is FormGroup;
|
|
12
|
+
export declare function IsNormalizedFormGroup(control: NormalizedControl): control is NormalizedFormGroup;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IsNormalizedFormGroup = exports.IsFormGroup = exports.NormalizeFormGroup = void 0;
|
|
4
|
+
const abstract_control_1 = require("../abstract-control");
|
|
5
|
+
const base_form_group_1 = require("./base-form-group");
|
|
6
|
+
function NormalizeFormGroup(group) {
|
|
7
|
+
return (0, base_form_group_1.NormalizeBaseFormGroup)(group);
|
|
8
|
+
}
|
|
9
|
+
exports.NormalizeFormGroup = NormalizeFormGroup;
|
|
10
|
+
function IsFormGroup(control) {
|
|
11
|
+
return control.role === abstract_control_1.AbstractControlRolls.GROUP;
|
|
12
|
+
}
|
|
13
|
+
exports.IsFormGroup = IsFormGroup;
|
|
14
|
+
function IsNormalizedFormGroup(control) {
|
|
15
|
+
return control.role === abstract_control_1.AbstractControlRolls.GROUP;
|
|
16
|
+
}
|
|
17
|
+
exports.IsNormalizedFormGroup = IsNormalizedFormGroup;
|
|
18
|
+
//# sourceMappingURL=form-group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-group.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/angular/src/lib/form/group/form-group.ts"],"names":[],"mappings":";;;AAAA,0DAA2D;AAK3D,uDAI2B;AAM3B,SAAgB,kBAAkB,CAChC,KAAgB;IAEhB,OAAO,IAAA,wCAAsB,EAAC,KAAK,CAAC,CAAC;AACvC,CAAC;AAJD,gDAIC;AAED,SAAgB,WAAW,CAAC,OAAgB;IAC1C,OAAO,OAAO,CAAC,IAAI,KAAK,uCAAoB,CAAC,KAAK,CAAC;AACrD,CAAC;AAFD,kCAEC;AAED,SAAgB,qBAAqB,CAAC,OAA0B;IAC9D,OAAO,OAAO,CAAC,IAAI,KAAK,uCAAoB,CAAC,KAAK,CAAC;AACrD,CAAC;AAFD,sDAEC"}
|