@rxap/schematic-angular 16.0.1-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/GETSTARTED.md +0 -0
- package/GUIDES.md +0 -0
- package/README.md +21 -0
- package/collection.json +109 -0
- package/package.json +70 -0
- package/src/index.d.ts +0 -0
- package/src/index.js +2 -0
- package/src/index.js.map +1 -0
- package/src/lib/accordion-item.d.ts +10 -0
- package/src/lib/accordion-item.js +36 -0
- package/src/lib/accordion-item.js.map +1 -0
- package/src/lib/accordion-itme-types.d.ts +7 -0
- package/src/lib/accordion-itme-types.js +15 -0
- package/src/lib/accordion-itme-types.js.map +1 -0
- package/src/lib/angular-options.d.ts +20 -0
- package/src/lib/angular-options.js +57 -0
- package/src/lib/angular-options.js.map +1 -0
- package/src/lib/assert-table-component-exists.d.ts +8 -0
- package/src/lib/assert-table-component-exists.js +18 -0
- package/src/lib/assert-table-component-exists.js.map +1 -0
- package/src/lib/backend-types.d.ts +5 -0
- package/src/lib/backend-types.js +10 -0
- package/src/lib/backend-types.js.map +1 -0
- package/src/lib/data-grid-item.d.ts +9 -0
- package/src/lib/data-grid-item.js +31 -0
- package/src/lib/data-grid-item.js.map +1 -0
- package/src/lib/data-grid-options.d.ts +18 -0
- package/src/lib/data-grid-options.js +25 -0
- package/src/lib/data-grid-options.js.map +1 -0
- package/src/lib/dialog-action.d.ts +9 -0
- package/src/lib/dialog-action.js +33 -0
- package/src/lib/dialog-action.js.map +1 -0
- package/src/lib/existing-method.d.ts +5 -0
- package/src/lib/existing-method.js +11 -0
- package/src/lib/existing-method.js.map +1 -0
- package/src/lib/form-component-control.d.ts +13 -0
- package/src/lib/form-component-control.js +46 -0
- package/src/lib/form-component-control.js.map +1 -0
- package/src/lib/form-definition-control.d.ts +15 -0
- package/src/lib/form-definition-control.js +59 -0
- package/src/lib/form-definition-control.js.map +1 -0
- package/src/lib/minimum-table-component-options.d.ts +17 -0
- package/src/lib/minimum-table-component-options.js +343 -0
- package/src/lib/minimum-table-component-options.js.map +1 -0
- package/src/lib/minimum-table-options.d.ts +18 -0
- package/src/lib/minimum-table-options.js +27 -0
- package/src/lib/minimum-table-options.js.map +1 -0
- package/src/lib/table-action.d.ts +11 -0
- package/src/lib/table-action.js +93 -0
- package/src/lib/table-action.js.map +1 -0
- package/src/lib/table-column.d.ts +18 -0
- package/src/lib/table-column.js +73 -0
- package/src/lib/table-column.js.map +1 -0
- package/src/lib/table-header-button.d.ts +9 -0
- package/src/lib/table-header-button.js +58 -0
- package/src/lib/table-header-button.js.map +1 -0
- package/src/lib/table-options.d.ts +15 -0
- package/src/lib/table-options.js +16 -0
- package/src/lib/table-options.js.map +1 -0
- package/src/lib/table-row-action.d.ts +14 -0
- package/src/lib/table-row-action.js +21 -0
- package/src/lib/table-row-action.js.map +1 -0
- package/src/lib/to-title.d.ts +1 -0
- package/src/lib/to-title.js +12 -0
- package/src/lib/to-title.js.map +1 -0
- package/src/lib/tree-table-options.d.ts +15 -0
- package/src/lib/tree-table-options.js +15 -0
- package/src/lib/tree-table-options.js.map +1 -0
- package/src/schematics/accordion/accordion-component/files/component/__componentName__.component.html.template +30 -0
- package/src/schematics/accordion/accordion-component/files/component/__componentName__.component.ts.template +54 -0
- package/src/schematics/accordion/accordion-component/files/header-component/accordion-header.component.html.template +5 -0
- package/src/schematics/accordion/accordion-component/files/header-component/accordion-header.component.ts.template +14 -0
- package/src/schematics/accordion/accordion-component/index.d.ts +8 -0
- package/src/schematics/accordion/accordion-component/index.js +350 -0
- package/src/schematics/accordion/accordion-component/index.js.map +1 -0
- package/src/schematics/accordion/accordion-component/schema.d.ts +7 -0
- package/src/schematics/accordion/accordion-component/schema.json +90 -0
- package/src/schematics/accordion/accordion-item-component/files/component/__componentName__.component.html.template +7 -0
- package/src/schematics/accordion/accordion-item-component/files/component/__componentName__.component.ts.template +32 -0
- package/src/schematics/accordion/accordion-item-component/index.d.ts +21 -0
- package/src/schematics/accordion/accordion-item-component/index.js +319 -0
- package/src/schematics/accordion/accordion-item-component/index.js.map +1 -0
- package/src/schematics/accordion/accordion-item-component/schema.d.ts +9 -0
- package/src/schematics/accordion/accordion-item-component/schema.json +73 -0
- package/src/schematics/accordion/item/accordion-item-data-grid-component/files/data-grid/__componentName__.component.html.template +1 -0
- package/src/schematics/accordion/item/accordion-item-data-grid-component/files/data-grid/__componentName__.component.ts.template +14 -0
- package/src/schematics/accordion/item/accordion-item-data-grid-component/files/data-grid-collection/__componentName__.component.html.template +10 -0
- package/src/schematics/accordion/item/accordion-item-data-grid-component/files/data-grid-collection/__componentName__.component.ts.template +32 -0
- package/src/schematics/accordion/item/accordion-item-data-grid-component/index.d.ts +10 -0
- package/src/schematics/accordion/item/accordion-item-data-grid-component/index.js +211 -0
- package/src/schematics/accordion/item/accordion-item-data-grid-component/index.js.map +1 -0
- package/src/schematics/accordion/item/accordion-item-data-grid-component/schema.d.ts +7 -0
- package/src/schematics/accordion/item/accordion-item-data-grid-component/schema.json +122 -0
- package/src/schematics/accordion/item/accordion-item-table-component/files/component/__componentName__.component.html.template +1 -0
- package/src/schematics/accordion/item/accordion-item-table-component/files/component/__componentName__.component.ts.template +35 -0
- package/src/schematics/accordion/item/accordion-item-table-component/index.d.ts +7 -0
- package/src/schematics/accordion/item/accordion-item-table-component/index.js +108 -0
- package/src/schematics/accordion/item/accordion-item-table-component/index.js.map +1 -0
- package/src/schematics/accordion/item/accordion-item-table-component/schema.d.ts +7 -0
- package/src/schematics/accordion/item/accordion-item-table-component/schema.json +248 -0
- package/src/schematics/accordion/item/accordion-item-tree-table-component/files/component/__componentName__.component.html.template +1 -0
- package/src/schematics/accordion/item/accordion-item-tree-table-component/files/component/__componentName__.component.ts.template +34 -0
- package/src/schematics/accordion/item/accordion-item-tree-table-component/index.d.ts +7 -0
- package/src/schematics/accordion/item/accordion-item-tree-table-component/index.js +182 -0
- package/src/schematics/accordion/item/accordion-item-tree-table-component/index.js.map +1 -0
- package/src/schematics/accordion/item/accordion-item-tree-table-component/schema.d.ts +7 -0
- package/src/schematics/accordion/item/accordion-item-tree-table-component/schema.json +257 -0
- package/src/schematics/data-grid-component/files/form/__componentName__.component.html.template +42 -0
- package/src/schematics/data-grid-component/files/form/__componentName__.component.ts.template +43 -0
- package/src/schematics/data-grid-component/files/plain/__componentName__.component.html.template +25 -0
- package/src/schematics/data-grid-component/files/plain/__componentName__.component.ts.template +36 -0
- package/src/schematics/data-grid-component/index.d.ts +16 -0
- package/src/schematics/data-grid-component/index.js +320 -0
- package/src/schematics/data-grid-component/index.js.map +1 -0
- package/src/schematics/data-grid-component/schema.d.ts +4 -0
- package/src/schematics/data-grid-component/schema.json +112 -0
- package/src/schematics/dialog-component/files/component/__componentName__.component.html.template +23 -0
- package/src/schematics/dialog-component/index.d.ts +2 -0
- package/src/schematics/dialog-component/index.js +43 -0
- package/src/schematics/dialog-component/index.js.map +1 -0
- package/src/schematics/dialog-component/schema.d.ts +9 -0
- package/src/schematics/dialog-component/schema.json +71 -0
- package/src/schematics/form/control/input-form-control/index.d.ts +7 -0
- package/src/schematics/form/control/input-form-control/index.js +40 -0
- package/src/schematics/form/control/input-form-control/index.js.map +1 -0
- package/src/schematics/form/control/input-form-control/schema.d.ts +5 -0
- package/src/schematics/form/control/input-form-control/schema.json +115 -0
- package/src/schematics/form/control/select-form-control/index.d.ts +6 -0
- package/src/schematics/form/control/select-form-control/index.js +124 -0
- package/src/schematics/form/control/select-form-control/index.js.map +1 -0
- package/src/schematics/form/control/select-form-control/schema.d.ts +6 -0
- package/src/schematics/form/control/select-form-control/schema.json +101 -0
- package/src/schematics/form/control/table-select-form-control/index.d.ts +12 -0
- package/src/schematics/form/control/table-select-form-control/index.js +183 -0
- package/src/schematics/form/control/table-select-form-control/index.js.map +1 -0
- package/src/schematics/form/control/table-select-form-control/schema.d.ts +7 -0
- package/src/schematics/form/control/table-select-form-control/schema.json +105 -0
- package/src/schematics/form/form-component/files/component/__componentName__.component.html.template +12 -0
- package/src/schematics/form/form-component/files/component/__componentName__.component.ts.template +52 -0
- package/src/schematics/form/form-component/files/window/open-__name__-form-window.method.ts.template +29 -0
- package/src/schematics/form/form-component/index.d.ts +16 -0
- package/src/schematics/form/form-component/index.js +149 -0
- package/src/schematics/form/form-component/index.js.map +1 -0
- package/src/schematics/form/form-component/schema.d.ts +8 -0
- package/src/schematics/form/form-component/schema.json +107 -0
- package/src/schematics/form/form-control/index.d.ts +9 -0
- package/src/schematics/form/form-control/index.js +54 -0
- package/src/schematics/form/form-control/index.js.map +1 -0
- package/src/schematics/form/form-control/schema.d.ts +6 -0
- package/src/schematics/form/form-control/schema.json +91 -0
- package/src/schematics/form/form-definition/index.d.ts +10 -0
- package/src/schematics/form/form-definition/index.js +43 -0
- package/src/schematics/form/form-definition/index.js.map +1 -0
- package/src/schematics/form/form-definition/schema.d.ts +6 -0
- package/src/schematics/form/form-definition/schema.json +97 -0
- package/src/schematics/table/action/dialog-table-action/index.d.ts +8 -0
- package/src/schematics/table/action/dialog-table-action/index.js +99 -0
- package/src/schematics/table/action/dialog-table-action/index.js.map +1 -0
- package/src/schematics/table/action/dialog-table-action/schema.d.ts +8 -0
- package/src/schematics/table/action/dialog-table-action/schema.json +133 -0
- package/src/schematics/table/action/form-table-action/index.d.ts +9 -0
- package/src/schematics/table/action/form-table-action/index.js +146 -0
- package/src/schematics/table/action/form-table-action/index.js.map +1 -0
- package/src/schematics/table/action/form-table-action/schema.d.ts +4 -0
- package/src/schematics/table/action/form-table-action/schema.json +94 -0
- package/src/schematics/table/action/navigation-table-action/index.d.ts +7 -0
- package/src/schematics/table/action/navigation-table-action/index.js +46 -0
- package/src/schematics/table/action/navigation-table-action/index.js.map +1 -0
- package/src/schematics/table/action/navigation-table-action/schema.d.ts +5 -0
- package/src/schematics/table/action/navigation-table-action/schema.json +85 -0
- package/src/schematics/table/action/operation-table-action/index.d.ts +11 -0
- package/src/schematics/table/action/operation-table-action/index.js +87 -0
- package/src/schematics/table/action/operation-table-action/index.js.map +1 -0
- package/src/schematics/table/action/operation-table-action/schema.d.ts +4 -0
- package/src/schematics/table/action/operation-table-action/schema.json +93 -0
- package/src/schematics/table/table-action/index.d.ts +7 -0
- package/src/schematics/table/table-action/index.js +46 -0
- package/src/schematics/table/table-action/index.js.map +1 -0
- package/src/schematics/table/table-action/schema.d.ts +7 -0
- package/src/schematics/table/table-action/schema.json +81 -0
- package/src/schematics/table/table-component/files/component/__componentName__.component.html.template +311 -0
- package/src/schematics/table/table-component/files/component/__componentName__.component.ts.template +100 -0
- package/src/schematics/table/table-component/index.d.ts +17 -0
- package/src/schematics/table/table-component/index.js +329 -0
- package/src/schematics/table/table-component/index.js.map +1 -0
- package/src/schematics/table/table-component/schema.d.ts +4 -0
- package/src/schematics/table/table-component/schema.json +230 -0
- package/src/schematics/table/tree-table-component/files/component/__componentName__.component.html.template +201 -0
- package/src/schematics/table/tree-table-component/files/component/__componentName__.component.ts.template +102 -0
- package/src/schematics/table/tree-table-component/index.d.ts +9 -0
- package/src/schematics/table/tree-table-component/index.js +314 -0
- package/src/schematics/table/tree-table-component/index.js.map +1 -0
- package/src/schematics/table/tree-table-component/schema.d.ts +4 -0
- package/src/schematics/table/tree-table-component/schema.json +239 -0
- package/src/schematics/tree-component/index.d.ts +10 -0
- package/src/schematics/tree-component/index.js +33 -0
- package/src/schematics/tree-component/index.js.map +1 -0
- package/src/schematics/tree-component/schema.d.ts +6 -0
- package/src/schematics/tree-component/schema.json +75 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/schematic/angular/src/schematics/form/control/input-form-control/index.ts"],"names":[],"mappings":";;;AACA,2DAAmD;AACnD,qDAG4B;AAE5B,qEAAsE;AACtE,qEAA8D;AAE9D,SAAgB,cAAc,CAAC,IAAY;IACzC,QAAQ,IAAI,EAAE;QACZ,KAAK,SAAS;YACZ,OAAO,UAAU,CAAC;QACpB,KAAK,QAAQ;YACX,OAAO,QAAQ,CAAC;QAClB,KAAK,MAAM;YACT,OAAO,MAAM,CAAC;QAChB,KAAK,QAAQ,CAAC;QACd;YACE,OAAO,MAAM,CAAC;KACjB;AACH,CAAC;AAZD,wCAYC;AAKD,SAAgB,gCAAgC,CAC9C,OAAgC;IAEhC,MAAM,iBAAiB,GAAG,IAAA,0CAA2B,EAAC,OAAO,CAAC,CAAC;IAC/D,MAAM,EAAE,IAAI,EAAE,GAAG,iBAAiB,CAAC;IACnC,MAAM,SAAS,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;IACvC,OAAO,MAAM,CAAC,IAAI,iCACb,iBAAiB,KACpB,SAAS,IACT,CAAC;AACL,CAAC;AAVD,4EAUC;AAED,SAAS,YAAY,CAAC,OAA0C;IAC9D,IAAA,qCAAmB,EAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC;AACrD,CAAC;AAED,mBAAyB,OAAgC;IACvD,MAAM,iBAAiB,GAAG,gCAAgC,CAAC,OAAO,CAAC,CAAC;IACpE,YAAY,CAAC,iBAAiB,CAAC,CAAC;IAChC,OAAO,GAAG,EAAE;QACV,OAAO,IAAA,kBAAK,EAAC,CAAE,IAAA,uCAAgB,EAAC,cAAc,EAAE,iBAAiB,CAAC,CAAE,CAAC,CAAC;IACxE,CAAC,CAAC;AACJ,CAAC;AAND,4BAMC"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"$id": "input-form-control",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"properties": {
|
|
6
|
+
"name": {
|
|
7
|
+
"type": "string",
|
|
8
|
+
"description": "The name of form control",
|
|
9
|
+
"x-prompt": "Enter the name of the form control?"
|
|
10
|
+
},
|
|
11
|
+
"formName": {
|
|
12
|
+
"alias": "form",
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "The name of the form where the form control should be added",
|
|
15
|
+
"x-prompt": "Enter the name of the form where the form control should be added"
|
|
16
|
+
},
|
|
17
|
+
"project": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"description": "The project where the form control should be added",
|
|
20
|
+
"x-prompt": "Enter project name where the form control should be added"
|
|
21
|
+
},
|
|
22
|
+
"backend": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"description": "The backend that should be used to handel data",
|
|
25
|
+
"enum": [
|
|
26
|
+
"none",
|
|
27
|
+
"local",
|
|
28
|
+
"nestjs"
|
|
29
|
+
],
|
|
30
|
+
"default": "none"
|
|
31
|
+
},
|
|
32
|
+
"feature": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"description": "The feature where the form control should be added",
|
|
35
|
+
"x-prompt": "Enter feature name where the form control should be added"
|
|
36
|
+
},
|
|
37
|
+
"shared": {
|
|
38
|
+
"type": "boolean",
|
|
39
|
+
"description": "Whether the form is shared across applications",
|
|
40
|
+
"default": false
|
|
41
|
+
},
|
|
42
|
+
"directory": {
|
|
43
|
+
"type": "string",
|
|
44
|
+
"description": "A path suffix added to the base path"
|
|
45
|
+
},
|
|
46
|
+
"nestModule": {
|
|
47
|
+
"type": "string",
|
|
48
|
+
"description": "Name of the nest module where the controller is created"
|
|
49
|
+
},
|
|
50
|
+
"controllerName": {
|
|
51
|
+
"type": "string",
|
|
52
|
+
"description": "Name of the nest controller"
|
|
53
|
+
},
|
|
54
|
+
"type": {
|
|
55
|
+
"type": "string",
|
|
56
|
+
"description": "The data type of the form control"
|
|
57
|
+
},
|
|
58
|
+
"validatorList": {
|
|
59
|
+
"alias": "validator",
|
|
60
|
+
"type": "array",
|
|
61
|
+
"items": {
|
|
62
|
+
"type": "string"
|
|
63
|
+
},
|
|
64
|
+
"description": "List of validators to be added to the form control"
|
|
65
|
+
},
|
|
66
|
+
"isRequired": {
|
|
67
|
+
"alias": "required",
|
|
68
|
+
"type": "boolean",
|
|
69
|
+
"description": "Whether the form control value is required"
|
|
70
|
+
},
|
|
71
|
+
"state": {
|
|
72
|
+
"type": "string",
|
|
73
|
+
"description": "The initial state of the form control"
|
|
74
|
+
},
|
|
75
|
+
"isArray": {
|
|
76
|
+
"alias": "array",
|
|
77
|
+
"type": "boolean",
|
|
78
|
+
"description": "Whether the form control is an array"
|
|
79
|
+
},
|
|
80
|
+
"inputType": {
|
|
81
|
+
"type": "string",
|
|
82
|
+
"description": "The type of the input control",
|
|
83
|
+
"enum": [
|
|
84
|
+
"checkbox",
|
|
85
|
+
"color",
|
|
86
|
+
"date",
|
|
87
|
+
"datetime-local",
|
|
88
|
+
"email",
|
|
89
|
+
"file",
|
|
90
|
+
"image",
|
|
91
|
+
"month",
|
|
92
|
+
"number",
|
|
93
|
+
"password",
|
|
94
|
+
"radio",
|
|
95
|
+
"range",
|
|
96
|
+
"search",
|
|
97
|
+
"tel",
|
|
98
|
+
"text",
|
|
99
|
+
"time",
|
|
100
|
+
"url",
|
|
101
|
+
"week"
|
|
102
|
+
]
|
|
103
|
+
},
|
|
104
|
+
"context": {
|
|
105
|
+
"type": "string",
|
|
106
|
+
"description": "The context use to generate proper names for class, files, etc"
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
"required": [
|
|
110
|
+
"name",
|
|
111
|
+
"formName",
|
|
112
|
+
"project",
|
|
113
|
+
"feature"
|
|
114
|
+
]
|
|
115
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Normalized } from '@rxap/utilities';
|
|
2
|
+
import { NormalizedFormControlOptions } from '../../form-control';
|
|
3
|
+
import { SelectFormControlOptions } from './schema';
|
|
4
|
+
export type NormalizedSelectFormControlOptions = Readonly<Normalized<SelectFormControlOptions> & NormalizedFormControlOptions>;
|
|
5
|
+
export declare function NormalizeSelectFormControlOptions(options: SelectFormControlOptions): NormalizedSelectFormControlOptions;
|
|
6
|
+
export default function (options: SelectFormControlOptions): () => import("@angular-devkit/schematics").Rule;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NormalizeSelectFormControlOptions = void 0;
|
|
4
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
+
const schematics_ts_morph_1 = require("@rxap/schematics-ts-morph");
|
|
6
|
+
const schematics_utilities_1 = require("@rxap/schematics-utilities");
|
|
7
|
+
const path_1 = require("path");
|
|
8
|
+
const ts_morph_1 = require("ts-morph");
|
|
9
|
+
const angular_options_1 = require("../../../../lib/angular-options");
|
|
10
|
+
const form_control_1 = require("../../form-control");
|
|
11
|
+
function NormalizeSelectFormControlOptions(options) {
|
|
12
|
+
var _a, _b;
|
|
13
|
+
const normalizedOptions = (0, form_control_1.NormalizeFormControlOptions)(options);
|
|
14
|
+
let { isArray } = normalizedOptions;
|
|
15
|
+
const multiple = (_a = options.multiple) !== null && _a !== void 0 ? _a : false;
|
|
16
|
+
isArray = multiple ? true : isArray;
|
|
17
|
+
return Object.seal(Object.assign(Object.assign({}, normalizedOptions), { isArray,
|
|
18
|
+
multiple, staticDataSource: (_b = options.staticDataSource) !== null && _b !== void 0 ? _b : false }));
|
|
19
|
+
}
|
|
20
|
+
exports.NormalizeSelectFormControlOptions = NormalizeSelectFormControlOptions;
|
|
21
|
+
function printOptions(options) {
|
|
22
|
+
(0, angular_options_1.PrintAngularOptions)('select-form-control', options);
|
|
23
|
+
}
|
|
24
|
+
function default_1(options) {
|
|
25
|
+
const normalizedOptions = NormalizeSelectFormControlOptions(options);
|
|
26
|
+
const { name, project, feature, directory, formName, type, isArray, state, isRequired, validatorList, staticDataSource, nestModule, controllerName, context, scope, } = normalizedOptions;
|
|
27
|
+
printOptions(normalizedOptions);
|
|
28
|
+
const optionsOperationName = ['get', name, 'options'].join('-');
|
|
29
|
+
const optionsOperationPath = ['options', name].join('/');
|
|
30
|
+
const optionsOperationId = (0, schematics_ts_morph_1.buildOperationId)(normalizedOptions, optionsOperationName, (0, schematics_ts_morph_1.BuildNestControllerName)({
|
|
31
|
+
controllerName,
|
|
32
|
+
nestModule,
|
|
33
|
+
}));
|
|
34
|
+
const optionsDataSourceName = (0, schematics_utilities_1.classify)([name, 'options', 'data-source'].join('-'));
|
|
35
|
+
const optionsDataSourceImportPath = `./data-sources/${(0, schematics_utilities_1.dasherize)(name)}-options.data-source`;
|
|
36
|
+
const optionsDataSourceDirectory = (0, path_1.join)(directory !== null && directory !== void 0 ? directory : '', 'data-sources');
|
|
37
|
+
return () => {
|
|
38
|
+
return (0, schematics_1.chain)([
|
|
39
|
+
(0, schematics_utilities_1.ExecuteSchematic)('form-control', normalizedOptions),
|
|
40
|
+
() => staticDataSource
|
|
41
|
+
? (0, schematics_1.chain)([
|
|
42
|
+
(0, schematics_ts_morph_1.CoerceOptionsDataSourceRule)({
|
|
43
|
+
project,
|
|
44
|
+
feature,
|
|
45
|
+
directory: optionsDataSourceDirectory,
|
|
46
|
+
name: [name, 'options'].join('-'),
|
|
47
|
+
}),
|
|
48
|
+
(0, schematics_ts_morph_1.CoerceFormProviderRule)({
|
|
49
|
+
project,
|
|
50
|
+
feature,
|
|
51
|
+
directory,
|
|
52
|
+
providerObject: optionsDataSourceName,
|
|
53
|
+
importStructures: [
|
|
54
|
+
{
|
|
55
|
+
namedImports: [optionsDataSourceName],
|
|
56
|
+
moduleSpecifier: optionsDataSourceImportPath,
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
}),
|
|
60
|
+
])
|
|
61
|
+
: (0, schematics_ts_morph_1.CoerceOptionsOperationRule)({
|
|
62
|
+
project,
|
|
63
|
+
feature,
|
|
64
|
+
nestModule,
|
|
65
|
+
controllerName,
|
|
66
|
+
operationName: optionsOperationName,
|
|
67
|
+
path: optionsOperationPath,
|
|
68
|
+
control: normalizedOptions,
|
|
69
|
+
context,
|
|
70
|
+
}),
|
|
71
|
+
(0, schematics_ts_morph_1.CoerceFormDefinitionControl)({
|
|
72
|
+
project,
|
|
73
|
+
feature,
|
|
74
|
+
directory,
|
|
75
|
+
formName,
|
|
76
|
+
name,
|
|
77
|
+
type,
|
|
78
|
+
isArray,
|
|
79
|
+
state,
|
|
80
|
+
isRequired,
|
|
81
|
+
validatorList,
|
|
82
|
+
coerceFormControl: (sourceFile, classDeclaration, control) => {
|
|
83
|
+
const { propertyDeclaration, decoratorDeclaration, } = (0, schematics_ts_morph_1.CoerceFormControl)(sourceFile, classDeclaration, control);
|
|
84
|
+
if (staticDataSource) {
|
|
85
|
+
(0, schematics_ts_morph_1.CoerceDecorator)(propertyDeclaration, 'UseOptionsDataSource').set({
|
|
86
|
+
arguments: [optionsDataSourceName],
|
|
87
|
+
});
|
|
88
|
+
(0, schematics_ts_morph_1.CoerceImports)(sourceFile, {
|
|
89
|
+
namedImports: [optionsDataSourceName],
|
|
90
|
+
moduleSpecifier: optionsDataSourceImportPath,
|
|
91
|
+
});
|
|
92
|
+
(0, schematics_ts_morph_1.CoerceImports)(sourceFile, {
|
|
93
|
+
namedImports: ['UseOptionsDataSource'],
|
|
94
|
+
moduleSpecifier: '@rxap/form-system',
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
(0, schematics_ts_morph_1.CoerceDecorator)(propertyDeclaration, 'UseOptionsMethod').set({
|
|
99
|
+
arguments: [
|
|
100
|
+
(0, schematics_ts_morph_1.OperationIdToClassName)(optionsOperationId),
|
|
101
|
+
ts_morph_1.Writers.object({ withoutParameters: 'true' }),
|
|
102
|
+
],
|
|
103
|
+
});
|
|
104
|
+
(0, schematics_ts_morph_1.CoerceImports)(sourceFile, {
|
|
105
|
+
namedImports: [(0, schematics_ts_morph_1.OperationIdToClassName)(optionsOperationId)],
|
|
106
|
+
moduleSpecifier: (0, schematics_ts_morph_1.OperationIdToClassImportPath)(optionsOperationId, scope),
|
|
107
|
+
});
|
|
108
|
+
(0, schematics_ts_morph_1.CoerceImports)(sourceFile, {
|
|
109
|
+
namedImports: ['UseOptionsMethod'],
|
|
110
|
+
moduleSpecifier: '@rxap/form-system',
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
return {
|
|
114
|
+
propertyDeclaration,
|
|
115
|
+
decoratorDeclaration,
|
|
116
|
+
};
|
|
117
|
+
},
|
|
118
|
+
}),
|
|
119
|
+
(0, schematics_ts_morph_1.EnforceUseFormControlOrderRule)(normalizedOptions),
|
|
120
|
+
]);
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
exports.default = default_1;
|
|
124
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/schematic/angular/src/schematics/form/control/select-form-control/index.ts"],"names":[],"mappings":";;;AAAA,2DAAmD;AACnD,mEAcmC;AACnC,qEAIoC;AAEpC,+BAA4B;AAC5B,uCAIkB;AAClB,qEAAsE;AACtE,qDAG4B;AAK5B,SAAgB,iCAAiC,CAC/C,OAAiC;;IAEjC,MAAM,iBAAiB,GAAG,IAAA,0CAA2B,EAAC,OAAO,CAAC,CAAC;IAC/D,IAAI,EAAE,OAAO,EAAE,GAAG,iBAAiB,CAAC;IACpC,MAAM,QAAQ,GAAG,MAAA,OAAO,CAAC,QAAQ,mCAAI,KAAK,CAAC;IAC3C,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC;IACpC,OAAO,MAAM,CAAC,IAAI,iCACb,iBAAiB,KACpB,OAAO;QACP,QAAQ,EACR,gBAAgB,EAAE,MAAA,OAAO,CAAC,gBAAgB,mCAAI,KAAK,IACnD,CAAC;AACL,CAAC;AAbD,8EAaC;AAED,SAAS,YAAY,CAAC,OAA2C;IAC/D,IAAA,qCAAmB,EAAC,qBAAqB,EAAE,OAAO,CAAC,CAAC;AACtD,CAAC;AAED,mBAAyB,OAAiC;IACxD,MAAM,iBAAiB,GAAG,iCAAiC,CAAC,OAAO,CAAC,CAAC;IACrE,MAAM,EACJ,IAAI,EACJ,OAAO,EACP,OAAO,EACP,SAAS,EACT,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,KAAK,EACL,UAAU,EACV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CAC1C,kBAAO,CAAC,MAAM,CAAC,EAAE,iBAAiB,EAAE,MAAM,EAAE,CAAC;6BAC9C;yBACF,CAAC,CAAC;wBACH,IAAA,mCAAa,EAAC,UAAU,EAAE;4BACxB,YAAY,EAAE,CAAE,IAAA,4CAAsB,EAAC,kBAAkB,CAAC,CAAE;4BAC5D,eAAe,EAAE,IAAA,kDAA4B,EAAC,kBAAkB,EAAE,KAAK,CAAC;yBACzE,CAAC,CAAC;wBACH,IAAA,mCAAa,EAAC,UAAU,EAAE;4BACxB,YAAY,EAAE,CAAE,kBAAkB,CAAE;4BACpC,eAAe,EAAE,mBAAmB;yBACrC,CAAC,CAAC;qBACJ;oBAED,OAAO;wBACL,mBAAmB;wBACnB,oBAAoB;qBACrB,CAAC;gBACJ,CAAC;aACF,CAAC;YACF,IAAA,oDAA8B,EAAC,iBAAiB,CAAC;SAClD,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAtID,4BAsIC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"$id": "select-form-control",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"properties": {
|
|
6
|
+
"name": {
|
|
7
|
+
"type": "string",
|
|
8
|
+
"description": "The name of form control",
|
|
9
|
+
"x-prompt": "Enter the name of the form control?"
|
|
10
|
+
},
|
|
11
|
+
"formName": {
|
|
12
|
+
"alias": "form",
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "The name of the form where the form control should be added",
|
|
15
|
+
"x-prompt": "Enter the name of the form where the form control should be added"
|
|
16
|
+
},
|
|
17
|
+
"project": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"description": "The project where the form control should be added",
|
|
20
|
+
"x-prompt": "Enter project name where the form control should be added"
|
|
21
|
+
},
|
|
22
|
+
"backend": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"description": "The backend that should be used to handel data",
|
|
25
|
+
"enum": [
|
|
26
|
+
"none",
|
|
27
|
+
"local",
|
|
28
|
+
"nestjs"
|
|
29
|
+
],
|
|
30
|
+
"default": "none"
|
|
31
|
+
},
|
|
32
|
+
"feature": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"description": "The feature where the form control should be added",
|
|
35
|
+
"x-prompt": "Enter feature name where the form control should be added"
|
|
36
|
+
},
|
|
37
|
+
"shared": {
|
|
38
|
+
"type": "boolean",
|
|
39
|
+
"description": "Whether the form is shared across applications",
|
|
40
|
+
"default": false
|
|
41
|
+
},
|
|
42
|
+
"directory": {
|
|
43
|
+
"type": "string",
|
|
44
|
+
"description": "A path suffix added to the base path"
|
|
45
|
+
},
|
|
46
|
+
"nestModule": {
|
|
47
|
+
"type": "string",
|
|
48
|
+
"description": "Name of the nest module where the controller is created"
|
|
49
|
+
},
|
|
50
|
+
"controllerName": {
|
|
51
|
+
"type": "string",
|
|
52
|
+
"description": "Name of the nest controller"
|
|
53
|
+
},
|
|
54
|
+
"type": {
|
|
55
|
+
"type": "string",
|
|
56
|
+
"description": "The data type of the form control"
|
|
57
|
+
},
|
|
58
|
+
"validatorList": {
|
|
59
|
+
"alias": "validator",
|
|
60
|
+
"type": "array",
|
|
61
|
+
"items": {
|
|
62
|
+
"type": "string"
|
|
63
|
+
},
|
|
64
|
+
"description": "List of validators to be added to the form control"
|
|
65
|
+
},
|
|
66
|
+
"isRequired": {
|
|
67
|
+
"alias": "required",
|
|
68
|
+
"type": "boolean",
|
|
69
|
+
"description": "Whether the form control value is required"
|
|
70
|
+
},
|
|
71
|
+
"state": {
|
|
72
|
+
"type": "string",
|
|
73
|
+
"description": "The initial state of the form control"
|
|
74
|
+
},
|
|
75
|
+
"isArray": {
|
|
76
|
+
"alias": "array",
|
|
77
|
+
"type": "boolean",
|
|
78
|
+
"description": "Whether the form control is an array"
|
|
79
|
+
},
|
|
80
|
+
"staticDataSource": {
|
|
81
|
+
"alias": "static",
|
|
82
|
+
"type": "boolean",
|
|
83
|
+
"description": "Whether the options data source is static"
|
|
84
|
+
},
|
|
85
|
+
"multiple": {
|
|
86
|
+
"alias": "multi",
|
|
87
|
+
"type": "boolean",
|
|
88
|
+
"description": "Whether the select form control is multiple mode"
|
|
89
|
+
},
|
|
90
|
+
"context": {
|
|
91
|
+
"type": "string",
|
|
92
|
+
"description": "The context use to generate proper names for class, files, etc"
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
"required": [
|
|
96
|
+
"name",
|
|
97
|
+
"formName",
|
|
98
|
+
"project",
|
|
99
|
+
"feature"
|
|
100
|
+
]
|
|
101
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Normalized } from '@rxap/utilities';
|
|
2
|
+
import { WriterFunction } from 'ts-morph';
|
|
3
|
+
import { NormalizedTableColumn } from '../../../../lib/table-column';
|
|
4
|
+
import { NormalizedFormControlOptions } from '../../form-control';
|
|
5
|
+
import { TableSelectFormControlOptions } from './schema';
|
|
6
|
+
export interface NormalizedTableSelectFormControlOptions extends Omit<Readonly<Normalized<TableSelectFormControlOptions> & NormalizedFormControlOptions>, 'columnList'> {
|
|
7
|
+
columnList: NormalizedTableColumn[];
|
|
8
|
+
}
|
|
9
|
+
export declare function NormalizeTableSelectFormControlOptions(options: TableSelectFormControlOptions): NormalizedTableSelectFormControlOptions;
|
|
10
|
+
export declare function TableColumnToTableSelectColumn(options: NormalizedTableColumn): WriterFunction;
|
|
11
|
+
export declare function TableColumnListToTableSelectColumnMap(columnList: Array<NormalizedTableColumn>): WriterFunction;
|
|
12
|
+
export default function (options: TableSelectFormControlOptions): () => import("@angular-devkit/schematics").Rule;
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TableColumnListToTableSelectColumnMap = exports.TableColumnToTableSelectColumn = exports.NormalizeTableSelectFormControlOptions = void 0;
|
|
4
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
+
const schematics_ts_morph_1 = require("@rxap/schematics-ts-morph");
|
|
6
|
+
const schematics_utilities_1 = require("@rxap/schematics-utilities");
|
|
7
|
+
const utilities_1 = require("@rxap/utilities");
|
|
8
|
+
const path_1 = require("path");
|
|
9
|
+
const ts_morph_1 = require("ts-morph");
|
|
10
|
+
const angular_options_1 = require("../../../../lib/angular-options");
|
|
11
|
+
const table_column_1 = require("../../../../lib/table-column");
|
|
12
|
+
const table_component_1 = require("../../../table/table-component");
|
|
13
|
+
const form_control_1 = require("../../form-control");
|
|
14
|
+
function NormalizeTableSelectFormControlOptions(options) {
|
|
15
|
+
var _a;
|
|
16
|
+
const normalizedOptions = (0, form_control_1.NormalizeFormControlOptions)(options);
|
|
17
|
+
let { isArray } = normalizedOptions;
|
|
18
|
+
const multiple = (_a = options.multiple) !== null && _a !== void 0 ? _a : false;
|
|
19
|
+
isArray = multiple ? true : isArray;
|
|
20
|
+
const columnList = (0, table_column_1.NormalizeTableColumnList)(options.columnList);
|
|
21
|
+
return Object.seal(Object.assign(Object.assign({}, normalizedOptions), { isArray,
|
|
22
|
+
multiple,
|
|
23
|
+
columnList }));
|
|
24
|
+
}
|
|
25
|
+
exports.NormalizeTableSelectFormControlOptions = NormalizeTableSelectFormControlOptions;
|
|
26
|
+
function TableColumnToTableSelectColumn(options) {
|
|
27
|
+
const { type, name, title, hasFilter, } = options;
|
|
28
|
+
const properties = {};
|
|
29
|
+
properties['label'] = `$localize\`${title !== null && title !== void 0 ? title : (0, schematics_utilities_1.capitalize)(name)}\``;
|
|
30
|
+
if (hasFilter) {
|
|
31
|
+
properties['filter'] = 'true';
|
|
32
|
+
}
|
|
33
|
+
properties['type'] = (w) => w.quote(type);
|
|
34
|
+
return ts_morph_1.Writers.object(properties);
|
|
35
|
+
}
|
|
36
|
+
exports.TableColumnToTableSelectColumn = TableColumnToTableSelectColumn;
|
|
37
|
+
function TableColumnListToTableSelectColumnMap(columnList) {
|
|
38
|
+
return ts_morph_1.Writers.object(columnList.reduce((properties, column) => (Object.assign(Object.assign({}, properties), { [column.name]: TableColumnToTableSelectColumn(column) })), {}));
|
|
39
|
+
}
|
|
40
|
+
exports.TableColumnListToTableSelectColumnMap = TableColumnListToTableSelectColumnMap;
|
|
41
|
+
function printOptions(options) {
|
|
42
|
+
(0, angular_options_1.PrintAngularOptions)('table-select-form-control', options);
|
|
43
|
+
}
|
|
44
|
+
function default_1(options) {
|
|
45
|
+
const normalizedOptions = NormalizeTableSelectFormControlOptions(options);
|
|
46
|
+
const { name, project, feature, directory, formName, type, isArray, state, isRequired, validatorList, nestModule, controllerName, columnList, shared, context, scope, } = normalizedOptions;
|
|
47
|
+
printOptions(normalizedOptions);
|
|
48
|
+
const optionsOperationName = ['get', name, 'option', 'page'].join('-');
|
|
49
|
+
const optionsOperationPath = ['options', name, 'page'].join('/');
|
|
50
|
+
const optionsOperationId = (0, schematics_ts_morph_1.buildOperationId)(normalizedOptions, optionsOperationName, (0, schematics_ts_morph_1.BuildNestControllerName)({
|
|
51
|
+
controllerName,
|
|
52
|
+
nestModule,
|
|
53
|
+
}));
|
|
54
|
+
const resolveValueOperationName = ['resolve', name, 'option', 'value'].join('-');
|
|
55
|
+
const resolveValueOperationPath = ['options', name, 'resolve', ':value'].join('/');
|
|
56
|
+
const resolveValueOperationId = (0, schematics_ts_morph_1.buildOperationId)(normalizedOptions, resolveValueOperationName, (0, schematics_ts_morph_1.BuildNestControllerName)({
|
|
57
|
+
controllerName,
|
|
58
|
+
nestModule,
|
|
59
|
+
}));
|
|
60
|
+
const tableDataSourceName = (0, schematics_utilities_1.classify)([name, 'select-table', 'data-source'].join('-'));
|
|
61
|
+
const tableDataSourceImportPath = `./data-sources/${(0, schematics_utilities_1.dasherize)(name)}-select-table.data-source`;
|
|
62
|
+
const tableDataSourceDirectory = (0, path_1.join)(directory !== null && directory !== void 0 ? directory : '', 'data-sources');
|
|
63
|
+
const resolveValueMethodName = (0, schematics_utilities_1.classify)([(0, schematics_utilities_1.dasherize)(name), 'table-select', 'value', 'resolver', 'method'].join('-'));
|
|
64
|
+
const resolveValueMethodImportPath = `./methods/${(0, schematics_utilities_1.dasherize)(name)}-table-select-value-resolver.method`;
|
|
65
|
+
const resolveValueMethodDirectory = (0, path_1.join)(directory !== null && directory !== void 0 ? directory : '', 'methods');
|
|
66
|
+
const tableResponseDtoName = (0, utilities_1.joinWithDash)([context, name, 'table-select']);
|
|
67
|
+
return () => {
|
|
68
|
+
return (0, schematics_1.chain)([
|
|
69
|
+
(0, schematics_utilities_1.ExecuteSchematic)('form-control', normalizedOptions),
|
|
70
|
+
(0, schematics_ts_morph_1.CoerceTableSelectOperationRule)({
|
|
71
|
+
project,
|
|
72
|
+
feature,
|
|
73
|
+
nestModule,
|
|
74
|
+
controllerName,
|
|
75
|
+
columnList: columnList.map(table_component_1.TableColumnToGetPageOperationColumn),
|
|
76
|
+
operationName: optionsOperationName,
|
|
77
|
+
path: optionsOperationPath,
|
|
78
|
+
skipCoerceTableSuffix: true,
|
|
79
|
+
responseDtoName: tableResponseDtoName,
|
|
80
|
+
context,
|
|
81
|
+
}),
|
|
82
|
+
(0, schematics_ts_morph_1.CoerceTableSelectValueResolveOperationRule)({
|
|
83
|
+
project,
|
|
84
|
+
feature,
|
|
85
|
+
nestModule,
|
|
86
|
+
controllerName,
|
|
87
|
+
operationName: resolveValueOperationName,
|
|
88
|
+
path: resolveValueOperationPath,
|
|
89
|
+
responseDtoName: tableResponseDtoName,
|
|
90
|
+
context,
|
|
91
|
+
}),
|
|
92
|
+
(0, schematics_ts_morph_1.CoerceFormProviderRule)({
|
|
93
|
+
project,
|
|
94
|
+
feature,
|
|
95
|
+
directory,
|
|
96
|
+
providerObject: tableDataSourceName,
|
|
97
|
+
importStructures: [
|
|
98
|
+
{
|
|
99
|
+
namedImports: [tableDataSourceName],
|
|
100
|
+
moduleSpecifier: tableDataSourceImportPath,
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
}),
|
|
104
|
+
(0, schematics_ts_morph_1.CoerceFormProviderRule)({
|
|
105
|
+
project,
|
|
106
|
+
feature,
|
|
107
|
+
directory,
|
|
108
|
+
providerObject: resolveValueMethodName,
|
|
109
|
+
importStructures: [
|
|
110
|
+
{
|
|
111
|
+
namedImports: [resolveValueMethodName],
|
|
112
|
+
moduleSpecifier: resolveValueMethodImportPath,
|
|
113
|
+
},
|
|
114
|
+
],
|
|
115
|
+
}),
|
|
116
|
+
(0, schematics_ts_morph_1.CoerceTableDataSourceRule)({
|
|
117
|
+
scope,
|
|
118
|
+
project,
|
|
119
|
+
feature,
|
|
120
|
+
directory: tableDataSourceDirectory,
|
|
121
|
+
shared,
|
|
122
|
+
name: [name, 'select-table'].join('-'),
|
|
123
|
+
operationId: optionsOperationId,
|
|
124
|
+
}),
|
|
125
|
+
(0, schematics_ts_morph_1.CoerceTableSelectResolveValueMethodRule)({
|
|
126
|
+
scope,
|
|
127
|
+
project,
|
|
128
|
+
feature,
|
|
129
|
+
directory: resolveValueMethodDirectory,
|
|
130
|
+
shared,
|
|
131
|
+
name: [name, 'table-select', 'value', 'resolver'].join('-'),
|
|
132
|
+
operationId: resolveValueOperationId,
|
|
133
|
+
}),
|
|
134
|
+
(0, schematics_ts_morph_1.CoerceFormDefinitionControl)({
|
|
135
|
+
project,
|
|
136
|
+
feature,
|
|
137
|
+
directory,
|
|
138
|
+
formName,
|
|
139
|
+
name,
|
|
140
|
+
type,
|
|
141
|
+
isArray,
|
|
142
|
+
state,
|
|
143
|
+
isRequired,
|
|
144
|
+
validatorList,
|
|
145
|
+
coerceFormControl: (sourceFile, classDeclaration, control) => {
|
|
146
|
+
const { propertyDeclaration, decoratorDeclaration, } = (0, schematics_ts_morph_1.CoerceFormControl)(sourceFile, classDeclaration, control);
|
|
147
|
+
(0, schematics_ts_morph_1.CoerceDecorator)(propertyDeclaration, 'UseTableSelectDataSource').set({
|
|
148
|
+
arguments: [tableDataSourceName],
|
|
149
|
+
});
|
|
150
|
+
(0, schematics_ts_morph_1.CoerceImports)(sourceFile, {
|
|
151
|
+
namedImports: [tableDataSourceName],
|
|
152
|
+
moduleSpecifier: tableDataSourceImportPath,
|
|
153
|
+
});
|
|
154
|
+
(0, schematics_ts_morph_1.CoerceDecorator)(propertyDeclaration, 'UseTableSelectMethod').set({
|
|
155
|
+
arguments: [resolveValueMethodName],
|
|
156
|
+
});
|
|
157
|
+
(0, schematics_ts_morph_1.CoerceImports)(sourceFile, {
|
|
158
|
+
namedImports: [resolveValueMethodName],
|
|
159
|
+
moduleSpecifier: resolveValueMethodImportPath,
|
|
160
|
+
});
|
|
161
|
+
(0, schematics_ts_morph_1.CoerceDecorator)(propertyDeclaration, 'UseTableSelectColumns').set({
|
|
162
|
+
arguments: [TableColumnListToTableSelectColumnMap(columnList)],
|
|
163
|
+
});
|
|
164
|
+
(0, schematics_ts_morph_1.CoerceImports)(sourceFile, {
|
|
165
|
+
namedImports: [
|
|
166
|
+
'UseTableSelectDataSource',
|
|
167
|
+
'UseTableSelectColumns',
|
|
168
|
+
'UseTableSelectMethod',
|
|
169
|
+
],
|
|
170
|
+
moduleSpecifier: '@rxap/ngx-material-table-select',
|
|
171
|
+
});
|
|
172
|
+
return {
|
|
173
|
+
propertyDeclaration,
|
|
174
|
+
decoratorDeclaration,
|
|
175
|
+
};
|
|
176
|
+
},
|
|
177
|
+
}),
|
|
178
|
+
(0, schematics_ts_morph_1.EnforceUseFormControlOrderRule)(normalizedOptions),
|
|
179
|
+
]);
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
exports.default = default_1;
|
|
183
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/schematic/angular/src/schematics/form/control/table-select-form-control/index.ts"],"names":[],"mappings":";;;AAAA,2DAAmD;AACnD,mEAcmC;AACnC,qEAKoC;AACpC,+CAGyB;AACzB,+BAA4B;AAC5B,uCAKkB;AAClB,qEAAsE;AACtE,+DAGsC;AACtC,oEAAqF;AACrF,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|
|
2
|
+
import { TableColumn } from '../../../table/table-component/schema';
|
|
3
|
+
|
|
4
|
+
export interface TableSelectFormControlOptions extends FormControlOptions {
|
|
5
|
+
multiple?: boolean;
|
|
6
|
+
columnList: Array<TableColumn | string>;
|
|
7
|
+
}
|