@rxap/schematic-angular 16.2.0-dev.2 → 16.2.0-dev.20
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 +146 -0
- package/README.md +1 -1
- package/package.json +11 -9
- package/src/lib/accordion-header.d.ts +5 -0
- package/src/lib/accordion-header.js +9 -3
- package/src/lib/accordion-header.js.map +1 -1
- package/src/lib/accordion-identifier.d.ts +4 -0
- package/src/lib/accordion-identifier.js.map +1 -1
- package/src/lib/accordion-item.d.ts +25 -17
- package/src/lib/accordion-item.js +72 -33
- package/src/lib/accordion-item.js.map +1 -1
- package/src/lib/accordion-itme-kinds.d.ts +8 -0
- package/src/lib/accordion-itme-kinds.js +16 -0
- package/src/lib/accordion-itme-kinds.js.map +1 -0
- package/src/lib/coerce-accordion-component.js +7 -3
- package/src/lib/coerce-accordion-component.js.map +1 -1
- package/src/lib/coerce-accordion-item-table-component.js +1 -1
- package/src/lib/coerce-accordion-item-table-component.js.map +1 -1
- package/src/lib/coerce-form-component.js +5 -2
- package/src/lib/coerce-form-component.js.map +1 -1
- package/src/lib/coerce-minimum-table-component.js +9 -3
- package/src/lib/coerce-minimum-table-component.js.map +1 -1
- package/src/lib/coerce-tree-table-component.js +16 -0
- package/src/lib/coerce-tree-table-component.js.map +1 -1
- package/src/lib/data-grid-item.d.ts +46 -11
- package/src/lib/data-grid-item.js +80 -5
- package/src/lib/data-grid-item.js.map +1 -1
- package/src/lib/data-grid-mode.d.ts +4 -0
- package/src/lib/data-grid-mode.js +9 -0
- package/src/lib/data-grid-mode.js.map +1 -0
- package/src/lib/data-grid-options.d.ts +12 -5
- package/src/lib/data-grid-options.js +43 -13
- package/src/lib/data-grid-options.js.map +1 -1
- package/src/lib/form/generate-form-template.d.ts +5 -0
- package/src/lib/form/generate-form-template.js +12 -0
- package/src/lib/form/generate-form-template.js.map +1 -0
- package/src/lib/form-component-control.d.ts +2 -6
- package/src/lib/form-component-control.js.map +1 -1
- package/src/lib/form-control.d.ts +136 -0
- package/src/lib/form-control.js +265 -0
- package/src/lib/form-control.js.map +1 -0
- package/src/lib/form-definition-control.d.ts +3 -57
- package/src/lib/form-definition-control.js +18 -144
- package/src/lib/form-definition-control.js.map +1 -1
- package/src/lib/load-handlebars-template.d.ts +4 -0
- package/src/lib/load-handlebars-template.js +28 -0
- package/src/lib/load-handlebars-template.js.map +1 -0
- package/src/lib/merge-with-column-list.js +3 -1
- package/src/lib/merge-with-column-list.js.map +1 -1
- package/src/lib/minimum-table-component-options.d.ts +12 -2
- package/src/lib/minimum-table-component-options.js +14 -17
- package/src/lib/minimum-table-component-options.js.map +1 -1
- package/src/lib/minimum-table-options.d.ts +1 -1
- package/src/lib/minimum-table-options.js +2 -2
- package/src/lib/minimum-table-options.js.map +1 -1
- package/src/lib/pipe-option.d.ts +11 -0
- package/src/lib/pipe-option.js +75 -0
- package/src/lib/pipe-option.js.map +1 -0
- package/src/lib/table/table-filter-column-rule.d.ts +13 -0
- package/src/lib/table/table-filter-column-rule.js +88 -0
- package/src/lib/table/table-filter-column-rule.js.map +1 -0
- package/src/lib/table-column.d.ts +19 -9
- package/src/lib/table-column.js +132 -113
- package/src/lib/table-column.js.map +1 -1
- package/src/lib/table-options.d.ts +1 -1
- package/src/lib/tree-table-options.d.ts +1 -1
- package/src/lib/use-pick-from-table-interface-as-form-type.d.ts +10 -0
- package/src/lib/use-pick-from-table-interface-as-form-type.js +32 -0
- package/src/lib/use-pick-from-table-interface-as-form-type.js.map +1 -0
- package/src/lib/value-option.d.ts +12 -0
- package/src/lib/value-option.js +66 -0
- package/src/lib/value-option.js.map +1 -0
- package/src/schema.json +2368 -0
- package/src/schematic-input.schema.json +607 -0
- package/src/schematics/accordion/accordion-component/files/component/__componentName__.component.html.hbs +25 -0
- package/src/schematics/accordion/accordion-component/index.d.ts +5 -2
- package/src/schematics/accordion/accordion-component/index.js +56 -122
- package/src/schematics/accordion/accordion-component/index.js.map +1 -1
- package/src/schematics/accordion/accordion-component/schema.d.ts +6 -0
- package/src/schematics/accordion/accordion-component/schema.json +314 -132
- package/src/schematics/accordion/accordion-component/template.schema.json +105 -0
- package/src/schematics/accordion/accordion-item-component/index.d.ts +9 -4
- package/src/schematics/accordion/accordion-item-component/index.js +112 -86
- package/src/schematics/accordion/accordion-item-component/index.js.map +1 -1
- package/src/schematics/accordion/accordion-item-component/schema.d.ts +2 -2
- package/src/schematics/accordion/accordion-item-component/schema.json +282 -70
- package/src/schematics/accordion/accordion-item-component/template.schema.json +32 -0
- package/src/schematics/accordion/item/accordion-item-data-grid-component/index.d.ts +1 -1
- package/src/schematics/accordion/item/accordion-item-data-grid-component/index.js +35 -51
- package/src/schematics/accordion/item/accordion-item-data-grid-component/index.js.map +1 -1
- package/src/schematics/accordion/item/accordion-item-data-grid-component/schema.d.ts +1 -1
- package/src/schematics/accordion/item/accordion-item-data-grid-component/schema.json +454 -85
- package/src/schematics/accordion/item/accordion-item-data-grid-component/template.schema.json +31 -0
- package/src/schematics/accordion/item/accordion-item-switch-component/index.d.ts +1 -1
- package/src/schematics/accordion/item/accordion-item-switch-component/index.js +16 -8
- package/src/schematics/accordion/item/accordion-item-switch-component/index.js.map +1 -1
- package/src/schematics/accordion/item/accordion-item-switch-component/schema.d.ts +1 -1
- package/src/schematics/accordion/item/accordion-item-switch-component/schema.json +322 -190
- package/src/schematics/accordion/item/accordion-item-switch-component/template.schema.json +81 -0
- package/src/schematics/accordion/item/accordion-item-table-component/index.d.ts +1 -1
- package/src/schematics/accordion/item/accordion-item-table-component/index.js +16 -19
- package/src/schematics/accordion/item/accordion-item-table-component/index.js.map +1 -1
- package/src/schematics/accordion/item/accordion-item-table-component/schema.d.ts +1 -1
- package/src/schematics/accordion/item/accordion-item-table-component/schema.json +615 -278
- package/src/schematics/accordion/item/accordion-item-table-component/template.schema.json +43 -0
- package/src/schematics/accordion/item/accordion-item-tree-table-component/index.d.ts +1 -1
- package/src/schematics/accordion/item/accordion-item-tree-table-component/index.js +48 -84
- package/src/schematics/accordion/item/accordion-item-tree-table-component/index.js.map +1 -1
- package/src/schematics/accordion/item/accordion-item-tree-table-component/schema.d.ts +1 -1
- package/src/schematics/accordion/item/accordion-item-tree-table-component/schema.json +591 -271
- package/src/schematics/accordion/item/accordion-item-tree-table-component/template.schema.json +43 -0
- package/src/schematics/accordion/templates/accordion-header.hbs +6 -0
- package/src/schematics/accordion/templates/data-grid-accordion-item.hbs +15 -0
- package/src/schematics/accordion/templates/default-accordion-item.hbs +15 -0
- package/src/schematics/accordion/templates/switch-accordion-item.hbs +21 -0
- package/src/schematics/accordion/templates/table-accordion-item.hbs +15 -0
- package/src/schematics/accordion/templates/tree-table-accordion-item.hbs +15 -0
- package/src/schematics/accordion-identifier.schema.json +25 -0
- package/src/schematics/accordion-item.schema.json +59 -0
- package/src/schematics/angular.schema.json +11 -11
- package/src/schematics/backend.schema.json +13 -0
- package/src/schematics/button.schema.json +30 -0
- package/src/schematics/data-grid-component/files/component/__componentName__.component.html.hbs +35 -0
- package/src/schematics/data-grid-component/index.d.ts +2 -4
- package/src/schematics/data-grid-component/index.js +83 -52
- package/src/schematics/data-grid-component/index.js.map +1 -1
- package/src/schematics/data-grid-component/schema.json +413 -141
- package/src/schematics/data-grid-component/template.schema.json +20 -0
- package/src/schematics/data-grid-component/templates/default-data-grid-item.hbs +3 -0
- package/src/schematics/data-grid-component/templates/link-data-grid-item.hbs +8 -0
- package/src/schematics/data-grid-item.schema.json +50 -0
- package/src/schematics/data-grid.schema.json +66 -0
- package/src/schematics/dialog-component/schema.json +141 -65
- package/src/schematics/dialog-component/template.schema.json +62 -0
- package/src/schematics/form/control/input-form-control/index.d.ts +2 -2
- package/src/schematics/form/control/input-form-control/index.js +4 -27
- 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 -3
- package/src/schematics/form/control/input-form-control/schema.json +182 -105
- package/src/schematics/form/control/input-form-control/template.schema.json +20 -0
- package/src/schematics/form/control/select-form-control/index.d.ts +4 -2
- package/src/schematics/form/control/select-form-control/index.js +132 -96
- 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 +194 -86
- package/src/schematics/form/control/select-form-control/template.schema.json +20 -0
- package/src/schematics/form/control/table-select-form-control/index.d.ts +9 -5
- package/src/schematics/form/control/table-select-form-control/index.js +199 -143
- 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 -4
- package/src/schematics/form/control/table-select-form-control/schema.json +245 -100
- package/src/schematics/form/control/table-select-form-control/template.schema.json +83 -0
- package/src/schematics/form/form-component/files/component/{__componentName__.component.html.template → __componentName__.component.html.hbs} +3 -3
- package/src/schematics/form/form-component/index.d.ts +2 -0
- package/src/schematics/form/form-component/index.js +22 -7
- package/src/schematics/form/form-component/index.js.map +1 -1
- package/src/schematics/form/form-component/schema.d.ts +3 -1
- package/src/schematics/form/form-component/schema.json +275 -150
- package/src/schematics/form/form-component/template.schema.json +20 -0
- package/src/schematics/form/form-control/index.d.ts +3 -1
- package/src/schematics/form/form-control/index.js +19 -8
- package/src/schematics/form/form-control/index.js.map +1 -1
- package/src/schematics/form/form-control/schema.json +203 -75
- package/src/schematics/form/form-control/template.schema.json +34 -0
- package/src/schematics/form/form-definition/index.js +14 -1
- package/src/schematics/form/form-definition/index.js.map +1 -1
- package/src/schematics/form/form-definition/schema.json +210 -127
- package/src/schematics/form/form-definition/template.schema.json +30 -0
- package/src/schematics/form/templates/checkbox-form-control.hbs +9 -0
- package/src/schematics/form/templates/default-form-control.hbs +2 -0
- package/src/schematics/form/templates/input-form-control.hbs +9 -0
- package/src/schematics/form/templates/mat-form-field.hbs +31 -0
- package/src/schematics/form/templates/slide-toggle-form-control.hbs +8 -0
- package/src/schematics/form/templates/table-select-form-control.hbs +18 -0
- package/src/schematics/form-component.schema.json +45 -0
- package/src/schematics/form-control.schema.json +68 -0
- package/src/schematics/form-definition.schema.json +22 -0
- package/src/schematics/form-field.schema.json +24 -0
- package/src/schematics/general.schema.json +1 -4
- package/src/schematics/header-button.schema.json +42 -0
- package/src/schematics/input-form-control.schema.json +55 -0
- package/src/schematics/minimum-table.schema.json +60 -0
- package/src/schematics/pipe.schema.json +38 -0
- package/src/schematics/property.schema.json +31 -0
- package/src/schematics/select-form-control.schema.json +64 -0
- package/src/schematics/table/action/dialog-table-action/schema.json +209 -125
- package/src/schematics/table/action/dialog-table-action/template.schema.json +58 -0
- package/src/schematics/table/action/form-table-action/schema.json +383 -153
- package/src/schematics/table/action/form-table-action/template.schema.json +75 -0
- package/src/schematics/table/action/navigation-table-action/schema.json +187 -80
- package/src/schematics/table/action/navigation-table-action/template.schema.json +28 -0
- package/src/schematics/table/action/open-api-table-action/schema.json +206 -97
- package/src/schematics/table/action/open-api-table-action/template.schema.json +56 -0
- package/src/schematics/table/action/operation-table-action/schema.json +174 -84
- package/src/schematics/table/action/operation-table-action/template.schema.json +14 -0
- package/src/schematics/table/header-button/form-table-header-button/schema.json +272 -114
- package/src/schematics/table/header-button/form-table-header-button/template.schema.json +51 -0
- package/src/schematics/table/header-button/navigation-table-header-button/schema.json +167 -71
- package/src/schematics/table/header-button/navigation-table-header-button/template.schema.json +28 -0
- package/src/schematics/table/table-action/schema.json +165 -78
- package/src/schematics/table/table-action/template.schema.json +30 -0
- package/src/schematics/table/table-component/files/component/__componentName__.component.html.hbs +241 -0
- package/src/schematics/table/table-component/index.d.ts +1 -3
- package/src/schematics/table/table-component/index.js +14 -120
- package/src/schematics/table/table-component/index.js.map +1 -1
- package/src/schematics/table/table-component/schema.json +524 -277
- package/src/schematics/table/table-component/template.schema.json +20 -0
- package/src/schematics/table/table-header-button/schema.json +146 -64
- package/src/schematics/table/table-header-button/template.schema.json +30 -0
- package/src/schematics/table/templates/boolean-table-column.hbs +10 -0
- package/src/schematics/table/templates/component-table-column.hbs +12 -0
- package/src/schematics/table/templates/copy-to-clipboard-table-column.hbs +10 -0
- package/src/schematics/table/templates/date-table-column.hbs +11 -0
- package/src/schematics/table/templates/default-table-column.hbs +8 -0
- package/src/schematics/table/templates/icon-table-column.hbs +10 -0
- package/src/schematics/table/templates/link-table-column.hbs +10 -0
- package/src/schematics/table/tree-table-component/files/component/__componentName__.component.html.hbs +255 -0
- package/src/schematics/table/tree-table-component/index.d.ts +3 -0
- package/src/schematics/table/tree-table-component/index.js +28 -7
- package/src/schematics/table/tree-table-component/index.js.map +1 -1
- package/src/schematics/table/tree-table-component/schema.json +514 -260
- package/src/schematics/table/tree-table-component/template.schema.json +20 -0
- package/src/schematics/table-action.schema.json +61 -0
- package/src/schematics/table-column.schema.json +75 -0
- package/src/schematics/table.schema.json +57 -0
- package/src/schematics/templates/pipe.hbs +4 -0
- package/src/schematics/tree-component/schema.json +115 -70
- package/src/schematics/tree-component/template.schema.json +36 -0
- package/src/schematics/tree-table.schema.json +40 -0
- package/src/schematics/type.schema.json +35 -0
- package/src/schematics/upstream.schema.json +56 -0
- package/src/schematics/value.schema.json +26 -0
- package/src/template.schema.json +173 -0
- package/src/lib/accordion-itme-types.d.ts +0 -8
- package/src/lib/accordion-itme-types.js +0 -16
- package/src/lib/accordion-itme-types.js.map +0 -1
- package/src/schematics/accordion/accordion-component/files/component/__componentName__.component.html.template +0 -94
- package/src/schematics/accordion/accordion-component/files/header-component/accordion-header.component.html.template +0 -10
- package/src/schematics/data-grid-component/files/form/__componentName__.component.html.template +0 -42
- package/src/schematics/data-grid-component/files/plain/__componentName__.component.html.template +0 -25
- package/src/schematics/table/table-component/files/component/__componentName__.component.html.template +0 -299
- package/src/schematics/table/tree-table-component/files/component/__componentName__.component.html.template +0 -213
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-component-control.js","sourceRoot":"","sources":["../../../../../../packages/schematic/angular/src/lib/form-component-control.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"form-component-control.js","sourceRoot":"","sources":["../../../../../../packages/schematic/angular/src/lib/form-component-control.ts"],"names":[],"mappings":";;;AAEA,uEAImC;AAanC,SAAgB,6BAA6B,CAC3C,OAA6B;IAE7B,MAAM,iBAAiB,GAAG,IAAA,wDAA8B,EAAC,OAAO,CAAC,CAAC;IAClE,OAAO,MAAM,CAAC,MAAM,mBACf,iBAAiB,EACpB,CAAC;AACL,CAAC;AAPD,sEAOC;AAED,SAAgB,iCAAiC,CAC/C,WAAyC;;IAEzC,OAAO,MAAM,CAAC,MAAM,CAAC,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,GAAG,CAAC,6BAA6B,CAAC,mCAAI,EAAE,CAAC,CAAC;AAC9E,CAAC;AAJD,8EAIC"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { DataProperty, NormalizedDataProperty, NormalizedTypeImport, NormalizedUpstreamOptions, TypeImport, UpstreamOptions } from '@rxap/ts-morph';
|
|
2
|
+
import { ControlOption, Normalized } from '@rxap/utilities';
|
|
3
|
+
import Handlebars from 'handlebars';
|
|
4
|
+
import { BackendTypes } from './backend-types';
|
|
5
|
+
import { NormalizedTableColumn, TableColumn } from './table-column';
|
|
6
|
+
export declare enum FormControlKinds {
|
|
7
|
+
DEFAULT = "default",
|
|
8
|
+
INPUT = "input",
|
|
9
|
+
SELECT = "select",
|
|
10
|
+
CHECKBOX = "checkbox",
|
|
11
|
+
SLIDE_TOGGLE = "slide-toggle",
|
|
12
|
+
TABLE_SELECT = "table-select"
|
|
13
|
+
}
|
|
14
|
+
export interface BaseFormControl extends DataProperty {
|
|
15
|
+
state?: string;
|
|
16
|
+
isRequired?: boolean;
|
|
17
|
+
isReadonly?: boolean;
|
|
18
|
+
isDisabled?: boolean;
|
|
19
|
+
validatorList?: string[];
|
|
20
|
+
importList?: TypeImport[];
|
|
21
|
+
kind: FormControlKinds;
|
|
22
|
+
template?: string;
|
|
23
|
+
label?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface NormalizedBaseFormControl extends Readonly<Normalized<BaseFormControl> & NormalizedDataProperty> {
|
|
26
|
+
type: NormalizedTypeImport;
|
|
27
|
+
importList: NormalizedTypeImport[];
|
|
28
|
+
handlebars: Handlebars.TemplateDelegate<{
|
|
29
|
+
control: NormalizedBaseFormControl;
|
|
30
|
+
}>;
|
|
31
|
+
}
|
|
32
|
+
export declare function NormalizeBaseFormControl(control: BaseFormControl): NormalizedBaseFormControl;
|
|
33
|
+
export interface FormFieldButton {
|
|
34
|
+
svgIcon?: string;
|
|
35
|
+
icon?: string;
|
|
36
|
+
directiveList?: TypeImport[];
|
|
37
|
+
importList?: TypeImport[];
|
|
38
|
+
}
|
|
39
|
+
export interface FormField {
|
|
40
|
+
label?: string;
|
|
41
|
+
prefixButton?: FormFieldButton;
|
|
42
|
+
suffixButton?: FormFieldButton;
|
|
43
|
+
directiveList?: TypeImport[];
|
|
44
|
+
hasClearButton?: boolean;
|
|
45
|
+
}
|
|
46
|
+
export type NormalizedFormField = Readonly<Normalized<FormField>>;
|
|
47
|
+
export interface NormalizedFormFieldButton extends Readonly<Normalized<FormFieldButton>> {
|
|
48
|
+
directiveList: NormalizedTypeImport[];
|
|
49
|
+
importList: NormalizedTypeImport[];
|
|
50
|
+
}
|
|
51
|
+
export declare function NormalizeFormFieldButton(button?: FormFieldButton | null): NormalizedFormFieldButton | null;
|
|
52
|
+
export declare function NormalizeFormField(formField: FormField, importList?: TypeImport[], defaultFormField?: Partial<FormField>): NormalizedFormField;
|
|
53
|
+
export interface FormFieldFormControl extends BaseFormControl {
|
|
54
|
+
formField?: FormField;
|
|
55
|
+
}
|
|
56
|
+
export interface NormalizedFormFieldFormControl extends Readonly<Normalized<Omit<FormFieldFormControl, 'type' | 'importList'>>>, NormalizedBaseFormControl {
|
|
57
|
+
formField: NormalizedFormField;
|
|
58
|
+
}
|
|
59
|
+
export declare function IsFormFieldFormControl(control: BaseFormControl): control is FormFieldFormControl;
|
|
60
|
+
export declare function IsNormalizedFormFieldFormControl(control: NormalizedBaseFormControl): control is NormalizedFormFieldFormControl;
|
|
61
|
+
export interface InputFormControl extends BaseFormControl, FormFieldFormControl {
|
|
62
|
+
inputType?: string;
|
|
63
|
+
placeholder?: string;
|
|
64
|
+
formField?: FormField;
|
|
65
|
+
}
|
|
66
|
+
export interface NormalizedInputFormControl extends Omit<Readonly<Normalized<InputFormControl>>, 'type' | 'importList' | 'formField'>, NormalizedBaseFormControl, NormalizedFormFieldFormControl {
|
|
67
|
+
kind: FormControlKinds.INPUT;
|
|
68
|
+
}
|
|
69
|
+
export declare function IsNormalizedInputFormControlOptions(template: NormalizedBaseFormControl): template is NormalizedInputFormControl;
|
|
70
|
+
export declare function NormalizeInputFormControl(control: InputFormControl): NormalizedInputFormControl;
|
|
71
|
+
export interface SelectFormControl extends BaseFormControl, FormFieldFormControl {
|
|
72
|
+
options?: ControlOption[];
|
|
73
|
+
backend?: BackendTypes;
|
|
74
|
+
multiple?: boolean;
|
|
75
|
+
formField?: FormField;
|
|
76
|
+
}
|
|
77
|
+
export interface NormalizedSelectFormControl extends Readonly<Normalized<Omit<SelectFormControl, 'options' | 'type' | 'importList' | 'formField'>>>, NormalizedBaseFormControl, NormalizedFormFieldFormControl {
|
|
78
|
+
kind: FormControlKinds.SELECT;
|
|
79
|
+
options: ReadonlyArray<ControlOption> | null;
|
|
80
|
+
backend: BackendTypes;
|
|
81
|
+
}
|
|
82
|
+
export declare function IsNormalizedSelectFormControl(template: NormalizedBaseFormControl): template is NormalizedSelectFormControl;
|
|
83
|
+
export declare function NormalizeSelectFormControl(control: SelectFormControl): NormalizedSelectFormControl;
|
|
84
|
+
export interface CheckboxFormControl extends BaseFormControl {
|
|
85
|
+
labelPosition?: 'before' | 'after';
|
|
86
|
+
}
|
|
87
|
+
export interface NormalizedCheckboxFormControl extends Readonly<Normalized<Omit<CheckboxFormControl, 'type' | 'importList'>>>, NormalizedBaseFormControl {
|
|
88
|
+
kind: FormControlKinds.CHECKBOX;
|
|
89
|
+
}
|
|
90
|
+
export declare function IsNormalizedCheckboxFormControl(template: NormalizedBaseFormControl): template is NormalizedCheckboxFormControl;
|
|
91
|
+
export declare function NormalizeCheckboxFormControl(control: CheckboxFormControl): NormalizedCheckboxFormControl;
|
|
92
|
+
export interface SlideToggleFormControl extends BaseFormControl {
|
|
93
|
+
labelPosition?: 'before' | 'after';
|
|
94
|
+
}
|
|
95
|
+
export interface NormalizedSlideToggleFormControl extends Readonly<Normalized<Omit<SlideToggleFormControl, 'type' | 'importList'>>>, NormalizedBaseFormControl {
|
|
96
|
+
kind: FormControlKinds.CHECKBOX;
|
|
97
|
+
}
|
|
98
|
+
export declare function IsNormalizedSlideToggleFormControl(template: NormalizedBaseFormControl): template is NormalizedSlideToggleFormControl;
|
|
99
|
+
export declare function NormalizeSlideToggleFormControl(control: SlideToggleFormControl): NormalizedSlideToggleFormControl;
|
|
100
|
+
export type TableSelectColumn = Pick<TableColumn, 'name' | 'title' | 'hasFilter' | 'kind' | 'propertyPath'> & DataProperty;
|
|
101
|
+
export type NormalizedTableSelectColumn = Pick<NormalizedTableColumn, 'name' | 'title' | 'hasFilter' | 'kind' | 'propertyPath'> & NormalizedDataProperty;
|
|
102
|
+
export declare function NormalizeTableSelectColumn(column: TableSelectColumn): NormalizedTableSelectColumn;
|
|
103
|
+
export interface TableSelectToFunction {
|
|
104
|
+
property: DataProperty;
|
|
105
|
+
}
|
|
106
|
+
export interface NormalizedTableSelectToFunction extends Readonly<Normalized<TableSelectToFunction>> {
|
|
107
|
+
property: NormalizedDataProperty;
|
|
108
|
+
}
|
|
109
|
+
export declare function NormalizeTableSelectToFunction(toFunction: TableSelectToFunction | null | undefined, columnList: TableSelectColumn[], defaultType?: string): NormalizedTableSelectToFunction;
|
|
110
|
+
export interface TableSelectFormControl extends BaseFormControl, FormFieldFormControl {
|
|
111
|
+
backend?: BackendTypes;
|
|
112
|
+
formField?: FormField;
|
|
113
|
+
title?: string;
|
|
114
|
+
propertyList?: DataProperty[];
|
|
115
|
+
columnList?: TableSelectColumn[];
|
|
116
|
+
toDisplay?: TableSelectToFunction;
|
|
117
|
+
toValue?: TableSelectToFunction;
|
|
118
|
+
upstream?: UpstreamOptions;
|
|
119
|
+
resolver?: {
|
|
120
|
+
upstream?: UpstreamOptions;
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
export interface NormalizedTableSelectFormControl extends Readonly<Normalized<Omit<TableSelectFormControl, 'type' | 'importList' | 'columnList' | 'propertyList' | 'formField'>>>, NormalizedBaseFormControl, NormalizedFormFieldFormControl {
|
|
124
|
+
kind: FormControlKinds.TABLE_SELECT;
|
|
125
|
+
backend: BackendTypes;
|
|
126
|
+
columnList: NormalizedTableSelectColumn[];
|
|
127
|
+
propertyList: Array<NormalizedDataProperty>;
|
|
128
|
+
toDisplay: NormalizedTableSelectToFunction;
|
|
129
|
+
toValue: NormalizedTableSelectToFunction;
|
|
130
|
+
upstream: NormalizedUpstreamOptions | null;
|
|
131
|
+
resolver: {
|
|
132
|
+
upstream: NormalizedUpstreamOptions | null;
|
|
133
|
+
} | null;
|
|
134
|
+
}
|
|
135
|
+
export declare function IsNormalizedTableSelectFormControl(template: NormalizedBaseFormControl): template is NormalizedTableSelectFormControl;
|
|
136
|
+
export declare function NormalizeTableSelectFormControl(control: TableSelectFormControl): NormalizedTableSelectFormControl;
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NormalizeTableSelectFormControl = exports.IsNormalizedTableSelectFormControl = exports.NormalizeTableSelectToFunction = exports.NormalizeTableSelectColumn = exports.NormalizeSlideToggleFormControl = exports.IsNormalizedSlideToggleFormControl = exports.NormalizeCheckboxFormControl = exports.IsNormalizedCheckboxFormControl = exports.NormalizeSelectFormControl = exports.IsNormalizedSelectFormControl = exports.NormalizeInputFormControl = exports.IsNormalizedInputFormControlOptions = exports.IsNormalizedFormFieldFormControl = exports.IsFormFieldFormControl = exports.NormalizeFormField = exports.NormalizeFormFieldButton = exports.NormalizeBaseFormControl = exports.FormControlKinds = void 0;
|
|
4
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
+
const ts_morph_1 = require("@rxap/ts-morph");
|
|
6
|
+
const utilities_1 = require("@rxap/utilities");
|
|
7
|
+
const path_1 = require("path");
|
|
8
|
+
const backend_types_1 = require("./backend-types");
|
|
9
|
+
const load_handlebars_template_1 = require("./load-handlebars-template");
|
|
10
|
+
const table_column_1 = require("./table-column");
|
|
11
|
+
// region BaseFormControlOptions
|
|
12
|
+
var FormControlKinds;
|
|
13
|
+
(function (FormControlKinds) {
|
|
14
|
+
FormControlKinds["DEFAULT"] = "default";
|
|
15
|
+
FormControlKinds["INPUT"] = "input";
|
|
16
|
+
FormControlKinds["SELECT"] = "select";
|
|
17
|
+
FormControlKinds["CHECKBOX"] = "checkbox";
|
|
18
|
+
FormControlKinds["SLIDE_TOGGLE"] = "slide-toggle";
|
|
19
|
+
FormControlKinds["TABLE_SELECT"] = "table-select";
|
|
20
|
+
})(FormControlKinds || (exports.FormControlKinds = FormControlKinds = {}));
|
|
21
|
+
function NormalizeBaseFormControl(control) {
|
|
22
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
23
|
+
if (!control.name) {
|
|
24
|
+
throw new schematics_1.SchematicsException('The control name is required');
|
|
25
|
+
}
|
|
26
|
+
const state = (_a = control.state) !== null && _a !== void 0 ? _a : null;
|
|
27
|
+
const isRequired = (_b = control.isRequired) !== null && _b !== void 0 ? _b : false;
|
|
28
|
+
const validatorList = (_c = control.validatorList) !== null && _c !== void 0 ? _c : [];
|
|
29
|
+
const importList = ((_d = control.importList) !== null && _d !== void 0 ? _d : []);
|
|
30
|
+
const isReadonly = (_e = control.isReadonly) !== null && _e !== void 0 ? _e : false;
|
|
31
|
+
const isDisabled = (_f = control.isDisabled) !== null && _f !== void 0 ? _f : false;
|
|
32
|
+
const kind = (_g = control.kind) !== null && _g !== void 0 ? _g : FormControlKinds.DEFAULT;
|
|
33
|
+
const template = (_h = control.template) !== null && _h !== void 0 ? _h : kind + '-form-control.hbs';
|
|
34
|
+
return Object.freeze(Object.assign(Object.assign({}, (0, ts_morph_1.NormalizeDataProperty)(control)), { isRequired,
|
|
35
|
+
state,
|
|
36
|
+
isReadonly,
|
|
37
|
+
isDisabled,
|
|
38
|
+
validatorList, importList: (0, ts_morph_1.NormalizeTypeImportList)(importList), kind,
|
|
39
|
+
template, handlebars: (0, load_handlebars_template_1.LoadHandlebarsTemplate)(template, (0, path_1.join)(__dirname, '..', 'schematics', 'form', 'templates')), label: (_j = control.label) !== null && _j !== void 0 ? _j : null }));
|
|
40
|
+
}
|
|
41
|
+
exports.NormalizeBaseFormControl = NormalizeBaseFormControl;
|
|
42
|
+
function NormalizeFormFieldButton(button) {
|
|
43
|
+
var _a, _b, _c;
|
|
44
|
+
if ((!button || Object.keys(button).length === 0)) {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
const importList = (_a = button.importList) !== null && _a !== void 0 ? _a : [];
|
|
48
|
+
(0, utilities_1.CoerceArrayItems)(importList, [
|
|
49
|
+
{
|
|
50
|
+
name: 'MatIconModule',
|
|
51
|
+
moduleSpecifier: '@angular/material/icon',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: 'MatButtonModule',
|
|
55
|
+
moduleSpecifier: '@angular/material/button',
|
|
56
|
+
}
|
|
57
|
+
], (a, b) => a.name === b.name);
|
|
58
|
+
return Object.freeze({
|
|
59
|
+
svgIcon: (_b = button.svgIcon) !== null && _b !== void 0 ? _b : null,
|
|
60
|
+
icon: (_c = button.icon) !== null && _c !== void 0 ? _c : null,
|
|
61
|
+
directiveList: (0, ts_morph_1.NormalizeTypeImportList)(button.directiveList),
|
|
62
|
+
importList: (0, ts_morph_1.NormalizeTypeImportList)(importList),
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
exports.NormalizeFormFieldButton = NormalizeFormFieldButton;
|
|
66
|
+
function NormalizeFormField(formField, importList = [], defaultFormField = {}) {
|
|
67
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
68
|
+
defaultFormField = (0, utilities_1.DeleteEmptyProperties)(defaultFormField);
|
|
69
|
+
const directiveList = (_a = defaultFormField.directiveList) !== null && _a !== void 0 ? _a : [];
|
|
70
|
+
(0, utilities_1.CoerceArrayItems)(directiveList, (_b = defaultFormField.directiveList) !== null && _b !== void 0 ? _b : [], (a, b) => a.name === b.name);
|
|
71
|
+
const normalizedFormField = {
|
|
72
|
+
label: (_d = (_c = defaultFormField.label) !== null && _c !== void 0 ? _c : formField.label) !== null && _d !== void 0 ? _d : null,
|
|
73
|
+
prefixButton: NormalizeFormFieldButton((_e = formField.prefixButton) !== null && _e !== void 0 ? _e : defaultFormField.prefixButton),
|
|
74
|
+
suffixButton: NormalizeFormFieldButton((_f = formField.suffixButton) !== null && _f !== void 0 ? _f : defaultFormField.suffixButton),
|
|
75
|
+
hasClearButton: (_h = (_g = formField.hasClearButton) !== null && _g !== void 0 ? _g : defaultFormField.hasClearButton) !== null && _h !== void 0 ? _h : true,
|
|
76
|
+
directiveList: (0, ts_morph_1.NormalizeTypeImportList)(directiveList),
|
|
77
|
+
};
|
|
78
|
+
if (normalizedFormField.hasClearButton) {
|
|
79
|
+
(_j = normalizedFormField.suffixButton) !== null && _j !== void 0 ? _j : (normalizedFormField.suffixButton = NormalizeFormFieldButton({
|
|
80
|
+
icon: 'clear',
|
|
81
|
+
directiveList: [
|
|
82
|
+
{
|
|
83
|
+
name: 'rxapInputClearButton',
|
|
84
|
+
namedImport: 'InputClearButtonDirective',
|
|
85
|
+
moduleSpecifier: '@rxap/material-form-system',
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
}));
|
|
89
|
+
}
|
|
90
|
+
(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);
|
|
91
|
+
(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);
|
|
92
|
+
(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);
|
|
93
|
+
(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);
|
|
94
|
+
return Object.freeze(normalizedFormField);
|
|
95
|
+
}
|
|
96
|
+
exports.NormalizeFormField = NormalizeFormField;
|
|
97
|
+
function IsFormFieldFormControl(control) {
|
|
98
|
+
return control.formField !== undefined;
|
|
99
|
+
}
|
|
100
|
+
exports.IsFormFieldFormControl = IsFormFieldFormControl;
|
|
101
|
+
function IsNormalizedFormFieldFormControl(control) {
|
|
102
|
+
return control.formField !== undefined;
|
|
103
|
+
}
|
|
104
|
+
exports.IsNormalizedFormFieldFormControl = IsNormalizedFormFieldFormControl;
|
|
105
|
+
function IsNormalizedInputFormControlOptions(template) {
|
|
106
|
+
return template.kind === FormControlKinds.INPUT;
|
|
107
|
+
}
|
|
108
|
+
exports.IsNormalizedInputFormControlOptions = IsNormalizedInputFormControlOptions;
|
|
109
|
+
function NormalizeInputFormControl(control) {
|
|
110
|
+
var _a, _b, _c, _d, _e;
|
|
111
|
+
const type = (0, ts_morph_1.NormalizeTypeImport)(control.type);
|
|
112
|
+
const validatorList = (_a = control.validatorList) !== null && _a !== void 0 ? _a : [];
|
|
113
|
+
const importList = (_b = control.importList) !== null && _b !== void 0 ? _b : [];
|
|
114
|
+
importList.push({
|
|
115
|
+
name: 'MatInputModule',
|
|
116
|
+
moduleSpecifier: '@angular/material/input',
|
|
117
|
+
});
|
|
118
|
+
const inputType = (_c = control.inputType) !== null && _c !== void 0 ? _c : 'text';
|
|
119
|
+
switch (inputType) {
|
|
120
|
+
case 'checkbox':
|
|
121
|
+
type.name = 'boolean';
|
|
122
|
+
break;
|
|
123
|
+
case 'text':
|
|
124
|
+
case 'password':
|
|
125
|
+
case 'color':
|
|
126
|
+
type.name = 'string';
|
|
127
|
+
break;
|
|
128
|
+
case 'email':
|
|
129
|
+
type.name = 'string';
|
|
130
|
+
(0, utilities_1.CoerceArrayItems)(validatorList, ['IsEmail()']);
|
|
131
|
+
break;
|
|
132
|
+
case 'tel':
|
|
133
|
+
type.name = 'string';
|
|
134
|
+
(0, utilities_1.CoerceArrayItems)(validatorList, ['IsTel()']);
|
|
135
|
+
break;
|
|
136
|
+
case 'url':
|
|
137
|
+
type.name = 'string';
|
|
138
|
+
(0, utilities_1.CoerceArrayItems)(validatorList, ['IsUrl()']);
|
|
139
|
+
break;
|
|
140
|
+
case 'number':
|
|
141
|
+
type.name = 'number';
|
|
142
|
+
break;
|
|
143
|
+
case 'date':
|
|
144
|
+
case 'time':
|
|
145
|
+
case 'datetime-local':
|
|
146
|
+
type.name = 'Date';
|
|
147
|
+
(0, utilities_1.CoerceArrayItems)(validatorList, ['IsDate()']);
|
|
148
|
+
break;
|
|
149
|
+
case 'file':
|
|
150
|
+
case 'hidden':
|
|
151
|
+
case 'image':
|
|
152
|
+
case 'month':
|
|
153
|
+
case 'radio':
|
|
154
|
+
case 'reset':
|
|
155
|
+
case 'button':
|
|
156
|
+
case 'search':
|
|
157
|
+
case 'submit':
|
|
158
|
+
case 'week':
|
|
159
|
+
case 'range':
|
|
160
|
+
throw new Error(`The input type "${inputType}" is not yet supported`);
|
|
161
|
+
}
|
|
162
|
+
const formField = NormalizeFormField((_d = control.formField) !== null && _d !== void 0 ? _d : {}, importList, { label: control.label });
|
|
163
|
+
// TODO : auto add validators
|
|
164
|
+
return Object.freeze(Object.assign(Object.assign({}, NormalizeBaseFormControl(control)), { type,
|
|
165
|
+
validatorList, importList: (0, ts_morph_1.NormalizeTypeImportList)(importList), kind: FormControlKinds.INPUT, inputType, placeholder: (_e = control.placeholder) !== null && _e !== void 0 ? _e : null, formField }));
|
|
166
|
+
}
|
|
167
|
+
exports.NormalizeInputFormControl = NormalizeInputFormControl;
|
|
168
|
+
function IsNormalizedSelectFormControl(template) {
|
|
169
|
+
return template.kind === FormControlKinds.SELECT;
|
|
170
|
+
}
|
|
171
|
+
exports.IsNormalizedSelectFormControl = IsNormalizedSelectFormControl;
|
|
172
|
+
function NormalizeSelectFormControl(control) {
|
|
173
|
+
var _a, _b, _c, _d;
|
|
174
|
+
const importList = (_a = control.importList) !== null && _a !== void 0 ? _a : [];
|
|
175
|
+
importList.push({
|
|
176
|
+
name: 'MatSelectModule',
|
|
177
|
+
moduleSpecifier: '@angular/material/select',
|
|
178
|
+
});
|
|
179
|
+
const formField = NormalizeFormField((_b = control.formField) !== null && _b !== void 0 ? _b : {}, importList, { label: control.label });
|
|
180
|
+
return Object.freeze(Object.assign(Object.assign({}, NormalizeBaseFormControl(control)), { importList: (0, ts_morph_1.NormalizeTypeImportList)(importList), kind: FormControlKinds.SELECT, formField, options: control.options && control.options.length ? Object.freeze(control.options) : null, backend: (_c = control.backend) !== null && _c !== void 0 ? _c : backend_types_1.BackendTypes.NONE, multiple: (_d = control.multiple) !== null && _d !== void 0 ? _d : false }));
|
|
181
|
+
}
|
|
182
|
+
exports.NormalizeSelectFormControl = NormalizeSelectFormControl;
|
|
183
|
+
function IsNormalizedCheckboxFormControl(template) {
|
|
184
|
+
return template.kind === FormControlKinds.CHECKBOX;
|
|
185
|
+
}
|
|
186
|
+
exports.IsNormalizedCheckboxFormControl = IsNormalizedCheckboxFormControl;
|
|
187
|
+
function NormalizeCheckboxFormControl(control) {
|
|
188
|
+
var _a, _b;
|
|
189
|
+
const importList = (_a = control.importList) !== null && _a !== void 0 ? _a : [];
|
|
190
|
+
importList.push({
|
|
191
|
+
name: 'MatCheckboxModule',
|
|
192
|
+
moduleSpecifier: '@angular/material/checkbox',
|
|
193
|
+
});
|
|
194
|
+
return Object.freeze(Object.assign(Object.assign({}, NormalizeBaseFormControl(control)), { importList: (0, ts_morph_1.NormalizeTypeImportList)(importList), kind: FormControlKinds.CHECKBOX, labelPosition: (_b = control.labelPosition) !== null && _b !== void 0 ? _b : 'after' }));
|
|
195
|
+
}
|
|
196
|
+
exports.NormalizeCheckboxFormControl = NormalizeCheckboxFormControl;
|
|
197
|
+
function IsNormalizedSlideToggleFormControl(template) {
|
|
198
|
+
return template.kind === FormControlKinds.CHECKBOX;
|
|
199
|
+
}
|
|
200
|
+
exports.IsNormalizedSlideToggleFormControl = IsNormalizedSlideToggleFormControl;
|
|
201
|
+
function NormalizeSlideToggleFormControl(control) {
|
|
202
|
+
var _a;
|
|
203
|
+
return Object.freeze(Object.assign(Object.assign({}, NormalizeBaseFormControl(control)), { kind: FormControlKinds.CHECKBOX, labelPosition: (_a = control.labelPosition) !== null && _a !== void 0 ? _a : 'after' }));
|
|
204
|
+
}
|
|
205
|
+
exports.NormalizeSlideToggleFormControl = NormalizeSlideToggleFormControl;
|
|
206
|
+
function NormalizeTableSelectColumn(column) {
|
|
207
|
+
var _a, _b, _c, _d;
|
|
208
|
+
const { name, propertyPath } = (0, table_column_1.TableColumnNameToPropertyPath)(column.name, column.propertyPath);
|
|
209
|
+
const kind = (_a = column.kind) !== null && _a !== void 0 ? _a : table_column_1.TableColumnKind.DEFAULT;
|
|
210
|
+
const type = (0, table_column_1.GuessColumnTypeType)(kind, (_b = column.type) !== null && _b !== void 0 ? _b : 'unknown');
|
|
211
|
+
return Object.freeze(Object.assign(Object.assign({}, (0, ts_morph_1.NormalizeDataProperty)(Object.assign(Object.assign({}, column), { name,
|
|
212
|
+
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,
|
|
213
|
+
propertyPath }));
|
|
214
|
+
}
|
|
215
|
+
exports.NormalizeTableSelectColumn = NormalizeTableSelectColumn;
|
|
216
|
+
function NormalizeTableSelectToFunction(toFunction, columnList, defaultType = 'unknown') {
|
|
217
|
+
if (!toFunction || Object.keys(toFunction).length === 0) {
|
|
218
|
+
return Object.freeze({
|
|
219
|
+
property: (0, ts_morph_1.NormalizeDataProperty)(columnList[0].name, defaultType),
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
return Object.freeze({
|
|
223
|
+
property: (0, ts_morph_1.NormalizeDataProperty)(toFunction.property, defaultType),
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
exports.NormalizeTableSelectToFunction = NormalizeTableSelectToFunction;
|
|
227
|
+
function IsNormalizedTableSelectFormControl(template) {
|
|
228
|
+
return template.kind === FormControlKinds.TABLE_SELECT;
|
|
229
|
+
}
|
|
230
|
+
exports.IsNormalizedTableSelectFormControl = IsNormalizedTableSelectFormControl;
|
|
231
|
+
function NormalizeTableSelectFormControl(control) {
|
|
232
|
+
var _a, _b, _c, _d, _e, _f;
|
|
233
|
+
const importList = (_a = control.importList) !== null && _a !== void 0 ? _a : [];
|
|
234
|
+
importList.push({
|
|
235
|
+
name: 'TableSelectControlModule',
|
|
236
|
+
moduleSpecifier: '@digitaix/eurogard-table-select',
|
|
237
|
+
});
|
|
238
|
+
if (!((_b = control.columnList) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
239
|
+
throw new Error('The column list must not be empty');
|
|
240
|
+
}
|
|
241
|
+
const propertyList = (0, ts_morph_1.NormalizeDataPropertyList)(control.propertyList);
|
|
242
|
+
const toDisplay = NormalizeTableSelectToFunction(control.toDisplay, control.columnList, 'string');
|
|
243
|
+
const toValue = NormalizeTableSelectToFunction(control.toValue, control.columnList);
|
|
244
|
+
(0, utilities_1.CoerceArrayItems)(propertyList, [toDisplay.property, toValue.property], (a, b) => a.name === b.name);
|
|
245
|
+
const formField = NormalizeFormField((_c = control.formField) !== null && _c !== void 0 ? _c : {}, importList, {
|
|
246
|
+
label: control.label,
|
|
247
|
+
directiveList: [
|
|
248
|
+
{
|
|
249
|
+
name: 'eurogardTableSelectControl',
|
|
250
|
+
namedImport: 'TableSelectControlModule',
|
|
251
|
+
moduleSpecifier: '@digitaix/eurogard-table-select',
|
|
252
|
+
},
|
|
253
|
+
]
|
|
254
|
+
});
|
|
255
|
+
const columnList = control.columnList.map(NormalizeTableSelectColumn);
|
|
256
|
+
(0, utilities_1.CoerceArrayItems)(propertyList, columnList, (a, b) => a.name === b.name);
|
|
257
|
+
(_d = control.type) !== null && _d !== void 0 ? _d : (control.type = toValue.property.type);
|
|
258
|
+
return Object.freeze(Object.assign(Object.assign({}, NormalizeBaseFormControl(control)), { resolver: control.resolver ? { upstream: (0, ts_morph_1.NormalizeUpstreamOptions)(control.resolver.upstream) } : null, importList: (0, ts_morph_1.NormalizeTypeImportList)(importList), kind: FormControlKinds.TABLE_SELECT, formField, backend: (_e = control.backend) !== null && _e !== void 0 ? _e : backend_types_1.BackendTypes.NONE, title: (_f = control.title) !== null && _f !== void 0 ? _f : null, columnList,
|
|
259
|
+
toDisplay,
|
|
260
|
+
toValue,
|
|
261
|
+
propertyList, upstream: (0, ts_morph_1.NormalizeUpstreamOptions)(control.upstream) }));
|
|
262
|
+
}
|
|
263
|
+
exports.NormalizeTableSelectFormControl = NormalizeTableSelectFormControl;
|
|
264
|
+
// endregion
|
|
265
|
+
//# sourceMappingURL=form-control.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-control.js","sourceRoot":"","sources":["../../../../../../packages/schematic/angular/src/lib/form-control.ts"],"names":[],"mappings":";;;AAAA,2DAAiE;AACjE,6CAYwB;AACxB,+CAOyB;AAEzB,+BAA4B;AAC5B,mDAA+C;AAC/C,yEAAoE;AACpE,iDAMwB;A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
|
|
8
|
-
SELECT = "select"
|
|
9
|
-
}
|
|
10
|
-
export interface BaseFormControlTemplate {
|
|
11
|
-
name: FormControlTemplateType;
|
|
12
|
-
}
|
|
13
|
-
export interface MinimalNormalizedFormDefinitionControl {
|
|
14
|
-
type: TypeImport;
|
|
15
|
-
validatorList: string[];
|
|
16
|
-
importList: TypeImport[];
|
|
17
|
-
}
|
|
18
|
-
export interface InputFormControlTemplate extends BaseFormControlTemplate {
|
|
19
|
-
type?: string;
|
|
20
|
-
placeholder?: string;
|
|
21
|
-
label?: string;
|
|
22
|
-
}
|
|
23
|
-
export interface NormalizedInputFormControlTemplate extends Readonly<Normalized<InputFormControlTemplate>>, BaseFormControlTemplate {
|
|
24
|
-
name: FormControlTemplateType.INPUT;
|
|
25
|
-
}
|
|
26
|
-
export declare function IsNormalizedInputFormControlTemplate(template: BaseFormControlTemplate): template is NormalizedInputFormControlTemplate;
|
|
27
|
-
export declare function NormalizeInputFormControlTemplate(template: InputFormControlTemplate, normalizedControl: MinimalNormalizedFormDefinitionControl): NormalizedInputFormControlTemplate;
|
|
28
|
-
export interface SelectFormControlTemplate extends BaseFormControlTemplate {
|
|
29
|
-
label?: string;
|
|
30
|
-
options?: ControlOption[];
|
|
31
|
-
backend?: BackendTypes;
|
|
32
|
-
}
|
|
33
|
-
export interface NormalizedSelectFormControlTemplate extends Readonly<Normalized<Omit<SelectFormControlTemplate, 'options'>>>, BaseFormControlTemplate {
|
|
34
|
-
name: FormControlTemplateType.SELECT;
|
|
35
|
-
options: ReadonlyArray<ControlOption> | null;
|
|
36
|
-
backend: BackendTypes;
|
|
37
|
-
}
|
|
38
|
-
export declare function IsNormalizedSelectFormControlTemplate(template: BaseFormControlTemplate): template is NormalizedSelectFormControlTemplate;
|
|
39
|
-
export declare function NormalizeSelectFormControlTemplate(template: SelectFormControlTemplate, normalizedControl: MinimalNormalizedFormDefinitionControl): NormalizedSelectFormControlTemplate;
|
|
40
|
-
export interface FormDefinitionControl {
|
|
41
|
-
name: string;
|
|
42
|
-
type?: string | TypeImport;
|
|
43
|
-
isArray?: boolean;
|
|
44
|
-
state?: string;
|
|
45
|
-
isRequired?: boolean;
|
|
46
|
-
isReadonly?: boolean;
|
|
47
|
-
isDisabled?: boolean;
|
|
48
|
-
validatorList?: string[];
|
|
49
|
-
importList?: TypeImport[];
|
|
50
|
-
template?: BaseFormControlTemplate;
|
|
51
|
-
}
|
|
52
|
-
export interface NormalizedFormDefinitionControl extends Readonly<Normalized<FormDefinitionControl>> {
|
|
53
|
-
type: NormalizedTypeImport;
|
|
54
|
-
template: BaseFormControlTemplate;
|
|
55
|
-
importList: NormalizedTypeImport[];
|
|
56
|
-
}
|
|
57
|
-
export declare function NormalizeFormControlTemplate(minimalNormalizedControl: MinimalNormalizedFormDefinitionControl, template?: BaseFormControlTemplate): BaseFormControlTemplate;
|
|
1
|
+
import { BaseFormControl, NormalizedBaseFormControl } from './form-control';
|
|
2
|
+
export type FormDefinitionControl = BaseFormControl;
|
|
3
|
+
export type NormalizedFormDefinitionControl = NormalizedBaseFormControl;
|
|
58
4
|
export declare function NormalizeFormDefinitionControl(control: FormDefinitionControl): NormalizedFormDefinitionControl;
|
|
59
5
|
export declare function NormalizeFormDefinitionControlList(controlList?: Array<FormDefinitionControl>): ReadonlyArray<NormalizedFormDefinitionControl>;
|