@rxap/schematic-angular 16.2.0-dev.20 → 16.2.0-dev.22

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.
Files changed (189) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +1 -1
  3. package/collection.json +15 -0
  4. package/package.json +7 -7
  5. package/src/lib/coerce-form-component.js +15 -3
  6. package/src/lib/coerce-form-component.js.map +1 -1
  7. package/src/lib/data-grid-item.d.ts +3 -3
  8. package/src/lib/data-grid-item.js +2 -2
  9. package/src/lib/data-grid-item.js.map +1 -1
  10. package/src/lib/form/abstract-control.d.ts +29 -0
  11. package/src/lib/form/abstract-control.js +37 -0
  12. package/src/lib/form/abstract-control.js.map +1 -0
  13. package/src/lib/form/array/base-form-array.d.ts +18 -0
  14. package/src/lib/form/array/base-form-array.js +40 -0
  15. package/src/lib/form/array/base-form-array.js.map +1 -0
  16. package/src/lib/form/array/form-array-kind.d.ts +3 -0
  17. package/src/lib/form/array/form-array-kind.js +8 -0
  18. package/src/lib/form/array/form-array-kind.js.map +1 -0
  19. package/src/lib/form/array/form-array.d.ts +12 -0
  20. package/src/lib/form/array/form-array.js +18 -0
  21. package/src/lib/form/array/form-array.js.map +1 -0
  22. package/src/lib/form/coerce-control-component-imports.d.ts +3 -0
  23. package/src/lib/form/coerce-control-component-imports.js +18 -0
  24. package/src/lib/form/coerce-control-component-imports.js.map +1 -0
  25. package/src/lib/form/control/autocomplete-table-select-form-control.d.ts +6 -0
  26. package/src/lib/form/control/autocomplete-table-select-form-control.js +34 -0
  27. package/src/lib/form/control/autocomplete-table-select-form-control.js.map +1 -0
  28. package/src/lib/form/control/base-form-control.d.ts +14 -0
  29. package/src/lib/form/control/base-form-control.js +19 -0
  30. package/src/lib/form/control/base-form-control.js.map +1 -0
  31. package/src/lib/form/control/checkbox-form-control.d.ts +11 -0
  32. package/src/lib/form/control/checkbox-form-control.js +23 -0
  33. package/src/lib/form/control/checkbox-form-control.js.map +1 -0
  34. package/src/lib/form/control/form-control-kind.d.ts +9 -0
  35. package/src/lib/form/control/form-control-kind.js +14 -0
  36. package/src/lib/form/control/form-control-kind.js.map +1 -0
  37. package/src/lib/form/control/form-control.d.ts +18 -0
  38. package/src/lib/form/control/form-control.js +43 -0
  39. package/src/lib/form/control/form-control.js.map +1 -0
  40. package/src/lib/form/control/form-field-form-control.d.ts +33 -0
  41. package/src/lib/form/control/form-field-form-control.js +76 -0
  42. package/src/lib/form/control/form-field-form-control.js.map +1 -0
  43. package/src/lib/form/control/input-form-control.d.ts +14 -0
  44. package/src/lib/form/control/input-form-control.js +71 -0
  45. package/src/lib/form/control/input-form-control.js.map +1 -0
  46. package/src/lib/form/control/select-form-control.d.ts +18 -0
  47. package/src/lib/form/control/select-form-control.js +29 -0
  48. package/src/lib/form/control/select-form-control.js.map +1 -0
  49. package/src/lib/form/control/slide-toggle-form-control.d.ts +11 -0
  50. package/src/lib/form/control/slide-toggle-form-control.js +23 -0
  51. package/src/lib/form/control/slide-toggle-form-control.js.map +1 -0
  52. package/src/lib/form/control/table-select-form-control.d.ts +43 -0
  53. package/src/lib/form/control/table-select-form-control.js +69 -0
  54. package/src/lib/form/control/table-select-form-control.js.map +1 -0
  55. package/src/lib/form/control.d.ts +8 -0
  56. package/src/lib/form/control.js +38 -0
  57. package/src/lib/form/control.js.map +1 -0
  58. package/src/lib/form/generate-form-template.d.ts +2 -2
  59. package/src/lib/form/group/base-form-group.d.ts +17 -0
  60. package/src/lib/form/group/base-form-group.js +20 -0
  61. package/src/lib/form/group/base-form-group.js.map +1 -0
  62. package/src/lib/form/group/form-group-kind.d.ts +3 -0
  63. package/src/lib/form/group/form-group-kind.js +8 -0
  64. package/src/lib/form/group/form-group-kind.js.map +1 -0
  65. package/src/lib/form/group/form-group.d.ts +12 -0
  66. package/src/lib/form/group/form-group.js +18 -0
  67. package/src/lib/form/group/form-group.js.map +1 -0
  68. package/src/lib/table-column.d.ts +4 -3
  69. package/src/lib/table-column.js +5 -4
  70. package/src/lib/table-column.js.map +1 -1
  71. package/src/schema.json +1691 -1311
  72. package/src/schematic-input.schema.json +109 -156
  73. package/src/schematics/abstract-control.schema.json +78 -0
  74. package/src/schematics/accordion/accordion-component/schema.json +127 -127
  75. package/src/schematics/accordion/accordion-item-component/schema.json +18 -18
  76. package/src/schematics/accordion/item/accordion-item-data-grid-component/schema.json +685 -81
  77. package/src/schematics/accordion/item/accordion-item-switch-component/schema.json +76 -76
  78. package/src/schematics/accordion/item/accordion-item-table-component/schema.json +555 -97
  79. package/src/schematics/accordion/item/accordion-item-tree-table-component/schema.json +537 -79
  80. package/src/schematics/autocomplete-table-select-form-control.schema.json +96 -0
  81. package/src/schematics/base-form-array.schema.json +45 -0
  82. package/src/schematics/base-form-control.schema.json +27 -0
  83. package/src/schematics/base-form-group.schema.json +42 -0
  84. package/src/schematics/checkbox-form-control.schema.json +30 -0
  85. package/src/schematics/control.schema.json +26 -0
  86. package/src/schematics/data-grid-component/index.js +4 -0
  87. package/src/schematics/data-grid-component/index.js.map +1 -1
  88. package/src/schematics/data-grid-component/schema.json +685 -81
  89. package/src/schematics/data-grid-item.schema.json +3 -3
  90. package/src/schematics/form/control/autocomplete-table-select-form-control/index.d.ts +10 -0
  91. package/src/schematics/form/control/autocomplete-table-select-form-control/index.js +247 -0
  92. package/src/schematics/form/control/autocomplete-table-select-form-control/index.js.map +1 -0
  93. package/src/schematics/form/control/autocomplete-table-select-form-control/schema.d.ts +4 -0
  94. package/src/schematics/form/control/autocomplete-table-select-form-control/schema.json +453 -0
  95. package/src/schematics/form/control/autocomplete-table-select-form-control/template.schema.json +39 -0
  96. package/src/schematics/form/control/input-form-control/index.d.ts +1 -1
  97. package/src/schematics/form/control/input-form-control/index.js +4 -4
  98. package/src/schematics/form/control/input-form-control/index.js.map +1 -1
  99. package/src/schematics/form/control/input-form-control/schema.d.ts +2 -2
  100. package/src/schematics/form/control/input-form-control/schema.json +256 -86
  101. package/src/schematics/form/control/input-form-control/template.schema.json +16 -3
  102. package/src/schematics/form/control/select-form-control/index.d.ts +2 -2
  103. package/src/schematics/form/control/select-form-control/index.js +21 -14
  104. package/src/schematics/form/control/select-form-control/index.js.map +1 -1
  105. package/src/schematics/form/control/select-form-control/schema.d.ts +2 -3
  106. package/src/schematics/form/control/select-form-control/schema.json +249 -90
  107. package/src/schematics/form/control/select-form-control/template.schema.json +16 -3
  108. package/src/schematics/form/control/table-select-form-control/index.d.ts +3 -9
  109. package/src/schematics/form/control/table-select-form-control/index.js +24 -18
  110. package/src/schematics/form/control/table-select-form-control/index.js.map +1 -1
  111. package/src/schematics/form/control/table-select-form-control/schema.d.ts +2 -3
  112. package/src/schematics/form/control/table-select-form-control/schema.json +325 -123
  113. package/src/schematics/form/control/table-select-form-control/template.schema.json +16 -60
  114. package/src/schematics/form/form-array/index.d.ts +9 -0
  115. package/src/schematics/form/form-array/index.js +54 -0
  116. package/src/schematics/form/form-array/index.js.map +1 -0
  117. package/src/schematics/form/form-array/schema.d.ts +4 -0
  118. package/src/schematics/form/form-array/schema.json +906 -0
  119. package/src/schematics/form/form-array/template.schema.json +33 -0
  120. package/src/schematics/form/form-component/files/component/__componentName__.component.html.hbs +4 -1
  121. package/src/schematics/form/form-component/index.d.ts +2 -4
  122. package/src/schematics/form/form-component/index.js +8 -24
  123. package/src/schematics/form/form-component/index.js.map +1 -1
  124. package/src/schematics/form/form-component/schema.d.ts +2 -2
  125. package/src/schematics/form/form-component/schema.json +749 -86
  126. package/src/schematics/form/form-control/index.d.ts +3 -5
  127. package/src/schematics/form/form-control/index.js +8 -20
  128. package/src/schematics/form/form-control/index.js.map +1 -1
  129. package/src/schematics/form/form-control/schema.d.ts +2 -4
  130. package/src/schematics/form/form-control/schema.json +599 -59
  131. package/src/schematics/form/form-control/template.schema.json +1 -2
  132. package/src/schematics/form/form-definition/index.d.ts +2 -2
  133. package/src/schematics/form/form-definition/index.js +28 -15
  134. package/src/schematics/form/form-definition/index.js.map +1 -1
  135. package/src/schematics/form/form-definition/schema.d.ts +2 -2
  136. package/src/schematics/form/form-definition/schema.json +743 -56
  137. package/src/schematics/form/form-group/index.d.ts +9 -0
  138. package/src/schematics/form/form-group/index.js +54 -0
  139. package/src/schematics/form/form-group/index.js.map +1 -0
  140. package/src/schematics/form/form-group/schema.d.ts +4 -0
  141. package/src/schematics/form/form-group/schema.json +906 -0
  142. package/src/schematics/form/form-group/template.schema.json +33 -0
  143. package/src/schematics/form/templates/checkbox-form-control.hbs +1 -1
  144. package/src/schematics/form/templates/default-form-array.hbs +27 -0
  145. package/src/schematics/form/templates/default-form-group.hbs +13 -0
  146. package/src/schematics/form/templates/input-form-control.hbs +7 -7
  147. package/src/schematics/form/templates/select-form-control.hbs +5 -0
  148. package/src/schematics/form/templates/table-select-form-control.hbs +16 -16
  149. package/src/schematics/form-array.schema.json +40 -0
  150. package/src/schematics/form-control.schema.json +69 -54
  151. package/src/schematics/form-definition.schema.json +3 -3
  152. package/src/schematics/form-group.schema.json +40 -0
  153. package/src/schematics/input-form-control.schema.json +10 -6
  154. package/src/schematics/select-form-control.schema.json +8 -4
  155. package/src/schematics/slide-toggle-form-control.schema.json +30 -0
  156. package/src/schematics/table/action/dialog-table-action/schema.json +20 -20
  157. package/src/schematics/table/action/form-table-action/index.d.ts +2 -2
  158. package/src/schematics/table/action/form-table-action/index.js +3 -4
  159. package/src/schematics/table/action/form-table-action/index.js.map +1 -1
  160. package/src/schematics/table/action/form-table-action/schema.d.ts +2 -2
  161. package/src/schematics/table/action/form-table-action/schema.json +750 -87
  162. package/src/schematics/table/action/navigation-table-action/schema.json +20 -20
  163. package/src/schematics/table/action/open-api-table-action/schema.json +20 -20
  164. package/src/schematics/table/action/operation-table-action/schema.json +20 -20
  165. package/src/schematics/table/header-button/form-table-header-button/index.d.ts +2 -2
  166. package/src/schematics/table/header-button/form-table-header-button/index.js +2 -2
  167. package/src/schematics/table/header-button/form-table-header-button/index.js.map +1 -1
  168. package/src/schematics/table/header-button/form-table-header-button/schema.d.ts +2 -2
  169. package/src/schematics/table/header-button/form-table-header-button/schema.json +818 -81
  170. package/src/schematics/table/header-button/form-table-header-button/template.schema.json +4 -22
  171. package/src/schematics/table/header-button/navigation-table-header-button/schema.json +20 -20
  172. package/src/schematics/table/table-action/schema.json +47 -47
  173. package/src/schematics/table/table-component/index.d.ts +2 -2
  174. package/src/schematics/table/table-component/schema.json +537 -79
  175. package/src/schematics/table/table-header-button/schema.json +40 -40
  176. package/src/schematics/table/tree-table-component/files/component/__componentName__.component.html.hbs +1 -1
  177. package/src/schematics/table/tree-table-component/schema.json +521 -63
  178. package/src/schematics/table-select-form-control.schema.json +96 -0
  179. package/src/schematics/textarea-form-control.schema.json +32 -0
  180. package/src/template.schema.json +45 -0
  181. package/src/lib/form-component-control.d.ts +0 -8
  182. package/src/lib/form-component-control.js +0 -15
  183. package/src/lib/form-component-control.js.map +0 -1
  184. package/src/lib/form-control.d.ts +0 -136
  185. package/src/lib/form-control.js +0 -265
  186. package/src/lib/form-control.js.map +0 -1
  187. package/src/lib/form-definition-control.d.ts +0 -5
  188. package/src/lib/form-definition-control.js +0 -30
  189. package/src/lib/form-definition-control.js.map +0 -1
@@ -3,133 +3,255 @@
3
3
  "$id": "table-select-form-control-schematic",
4
4
  "allOf": [
5
5
  {
6
- "$ref": "#/definitions/formControl"
6
+ "$ref": "#/definitions/angular"
7
+ },
8
+ {
9
+ "$ref": "#/definitions/tableSelectFormControl"
7
10
  },
8
11
  {
9
12
  "type": "object",
10
13
  "properties": {
11
- "columnList": {
12
- "alias": "column",
13
- "type": "array",
14
- "items": {
15
- "description": "table column name",
16
- "type": "object",
17
- "properties": {
18
- "name": {
19
- "type": "string",
20
- "description": "table column name"
21
- },
22
- "title": {
23
- "type": "string",
24
- "description": "table column label"
25
- },
26
- "hasFilter": {
27
- "type": "boolean",
28
- "description": "Whether the column has a filter"
29
- },
30
- "kind": {
31
- "type": "string",
32
- "description": "The kind of data in the column"
14
+ "formName": {
15
+ "alias": "form",
16
+ "type": "string",
17
+ "description": "The name of the form where the form control should be added"
18
+ }
19
+ },
20
+ "required": [
21
+ "formName"
22
+ ]
23
+ }
24
+ ],
25
+ "definitions": {
26
+ "abstractControl": {
27
+ "allOf": [
28
+ {
29
+ "$ref": "#/definitions/property"
30
+ },
31
+ {
32
+ "type": "object",
33
+ "properties": {
34
+ "name": {
35
+ "type": "string",
36
+ "description": "The name of the control"
37
+ },
38
+ "isArray": {
39
+ "type": "boolean",
40
+ "description": "Whether the control value is an array",
41
+ "default": false
42
+ },
43
+ "state": {
44
+ "type": "string",
45
+ "description": "The initial state of the control"
46
+ },
47
+ "isRequired": {
48
+ "type": "boolean",
49
+ "description": "Whether the control value is required",
50
+ "default": false
51
+ },
52
+ "isReadonly": {
53
+ "type": "boolean",
54
+ "description": "Whether the control value is readonly",
55
+ "default": false
56
+ },
57
+ "isDisabled": {
58
+ "type": "boolean",
59
+ "description": "Whether the control value is disabled",
60
+ "default": false
61
+ },
62
+ "validatorList": {
63
+ "type": "array",
64
+ "items": {
65
+ "type": "string"
33
66
  }
67
+ },
68
+ "kind": {
69
+ "type": "string",
70
+ "description": "The kind of the control",
71
+ "default": "default"
72
+ },
73
+ "importList": {
74
+ "type": "array",
75
+ "items": {
76
+ "$ref": "#/definitions/type"
77
+ }
78
+ },
79
+ "template": {
80
+ "type": "string",
81
+ "description": "The template of the control"
82
+ },
83
+ "role": {
84
+ "type": "string",
85
+ "description": "The role of the control",
86
+ "enum": [
87
+ "control",
88
+ "group",
89
+ "array"
90
+ ],
91
+ "default": "control"
34
92
  }
35
93
  },
36
- "description": "List of table column names"
37
- },
38
- "title": {
39
- "type": "string",
40
- "description": "The title of the table select window"
94
+ "additionalProperties": true
95
+ }
96
+ ]
97
+ },
98
+ "angular": {
99
+ "allOf": [
100
+ {
101
+ "$ref": "#/definitions/general"
41
102
  },
42
- "toDisplay": {
103
+ {
43
104
  "type": "object",
44
105
  "properties": {
45
- "property": {
46
- "$ref": "#/definitions/property"
106
+ "componentName": {
107
+ "type": "string"
108
+ },
109
+ "name": {
110
+ "type": "string"
111
+ },
112
+ "context": {
113
+ "type": "string",
114
+ "description": "The context use to generate proper names for class, files, etc"
115
+ },
116
+ "nestModule": {
117
+ "type": "string",
118
+ "description": "The module name for the table nest operations"
119
+ },
120
+ "controllerName": {
121
+ "type": "string"
122
+ },
123
+ "backend": {
124
+ "$ref": "#/definitions/backend"
125
+ },
126
+ "directory": {
127
+ "type": "string",
128
+ "description": "A directory name or absolute path where the files should be generated. Relative to the project and feature base path if a feature is defined"
129
+ },
130
+ "shared": {
131
+ "type": "boolean",
132
+ "description": "Whether the generated code is used across the project",
133
+ "default": false
134
+ },
135
+ "scope": {
136
+ "type": "string"
137
+ },
138
+ "prefix": {
139
+ "type": "string"
140
+ },
141
+ "openApi": {
142
+ "type": "object",
143
+ "additionalProperties": true
47
144
  }
48
145
  }
146
+ }
147
+ ]
148
+ },
149
+ "backend": {
150
+ "type": "string",
151
+ "description": "The backend that should be used to handel data",
152
+ "enum": [
153
+ "none",
154
+ "nestjs",
155
+ "open-api",
156
+ "local"
157
+ ],
158
+ "default": "none"
159
+ },
160
+ "baseFormControl": {
161
+ "allOf": [
162
+ {
163
+ "$ref": "#/definitions/abstractControl"
49
164
  },
50
- "toValue": {
165
+ {
51
166
  "type": "object",
52
167
  "properties": {
53
- "property": {
54
- "$ref": "#/definitions/property"
168
+ "label": {
169
+ "type": "string",
170
+ "description": "The label of the control"
171
+ },
172
+ "role": {
173
+ "type": "string",
174
+ "const": "control"
55
175
  }
56
176
  }
177
+ }
178
+ ]
179
+ },
180
+ "button": {
181
+ "type": "object",
182
+ "properties": {
183
+ "svgIcon": {
184
+ "type": "string"
57
185
  },
58
- "upstream": {
59
- "$ref": "#/definitions/upstream"
186
+ "icon": {
187
+ "type": "string"
60
188
  },
61
- "resolver": {
62
- "type": "object",
63
- "properties": {
64
- "upstream": {
65
- "$ref": "#/definitions/upstream"
66
- }
189
+ "directiveList": {
190
+ "type": "array",
191
+ "items": {
192
+ "$ref": "#/definitions/type"
193
+ }
194
+ },
195
+ "importList": {
196
+ "type": "array",
197
+ "items": {
198
+ "$ref": "#/definitions/type"
67
199
  }
68
200
  }
69
201
  }
70
- }
71
- ],
72
- "definitions": {
73
- "formControl": {
202
+ },
203
+ "formField": {
74
204
  "type": "object",
75
205
  "properties": {
76
- "name": {
77
- "type": "string",
78
- "description": "The name of the control"
206
+ "label": {
207
+ "type": "string"
79
208
  },
80
- "type": {
81
- "$ref": "#/definitions/type"
209
+ "prefixButton": {
210
+ "$ref": "#/definitions/button"
82
211
  },
83
- "isArray": {
84
- "type": "boolean",
85
- "description": "Whether the control value is an array",
86
- "default": false
212
+ "suffixButton": {
213
+ "$ref": "#/definitions/button"
87
214
  },
88
- "state": {
215
+ "hasClearButton": {
216
+ "type": "boolean"
217
+ }
218
+ }
219
+ },
220
+ "general": {
221
+ "type": "object",
222
+ "properties": {
223
+ "project": {
89
224
  "type": "string",
90
- "description": "The initial state of the control"
225
+ "description": "Project name where the files should be generated"
91
226
  },
92
- "isRequired": {
93
- "type": "boolean",
94
- "description": "Whether the control value is required",
227
+ "feature": {
228
+ "type": "string",
229
+ "description": "Feature name where the files should be generated"
230
+ },
231
+ "overwrite": {
232
+ "anyOf": [
233
+ {
234
+ "type": "boolean"
235
+ },
236
+ {
237
+ "type": "array",
238
+ "items": {
239
+ "type": "string"
240
+ }
241
+ }
242
+ ],
243
+ "description": "Overwrite existing files",
95
244
  "default": false
96
245
  },
97
- "isReadonly": {
246
+ "overwriteHtml": {
98
247
  "type": "boolean",
99
- "description": "Whether the control value is readonly",
100
248
  "default": false
101
249
  },
102
- "isDisabled": {
250
+ "replace": {
103
251
  "type": "boolean",
104
- "description": "Whether the control value is disabled",
105
252
  "default": false
106
- },
107
- "validatorList": {
108
- "type": "array",
109
- "items": {
110
- "type": "string"
111
- }
112
- },
113
- "kind": {
114
- "type": "string",
115
- "description": "The name of the template",
116
- "enum": [
117
- "default",
118
- "input",
119
- "select",
120
- "checkbox",
121
- "autocomplete-table-select",
122
- "table-select",
123
- "textarea",
124
- "slide-toggle"
125
- ],
126
- "default": "default"
127
253
  }
128
- },
129
- "required": [
130
- "name"
131
- ],
132
- "additionalProperties": true
254
+ }
133
255
  },
134
256
  "property": {
135
257
  "oneOf": [
@@ -155,6 +277,119 @@
155
277
  }
156
278
  ]
157
279
  },
280
+ "tableSelectFormControl": {
281
+ "allOf": [
282
+ {
283
+ "$ref": "#/definitions/baseFormControl"
284
+ },
285
+ {
286
+ "type": "object",
287
+ "properties": {
288
+ "formField": {
289
+ "$ref": "#/definitions/formField"
290
+ },
291
+ "kind": {
292
+ "type": "string",
293
+ "const": "table-select"
294
+ },
295
+ "placeholder": {
296
+ "type": "string"
297
+ },
298
+ "columnList": {
299
+ "alias": "column",
300
+ "type": "array",
301
+ "items": {
302
+ "description": "table column name",
303
+ "type": "object",
304
+ "properties": {
305
+ "name": {
306
+ "type": "string",
307
+ "description": "table column name"
308
+ },
309
+ "title": {
310
+ "type": "string",
311
+ "description": "table column label"
312
+ },
313
+ "hasFilter": {
314
+ "type": "boolean",
315
+ "description": "Whether the column has a filter"
316
+ },
317
+ "kind": {
318
+ "type": "string",
319
+ "description": "The kind of data in the column"
320
+ }
321
+ }
322
+ },
323
+ "description": "List of table column names"
324
+ },
325
+ "title": {
326
+ "type": "string",
327
+ "description": "The title of the table select window"
328
+ },
329
+ "toDisplay": {
330
+ "type": "object",
331
+ "properties": {
332
+ "property": {
333
+ "$ref": "#/definitions/property"
334
+ }
335
+ }
336
+ },
337
+ "toValue": {
338
+ "type": "object",
339
+ "properties": {
340
+ "property": {
341
+ "$ref": "#/definitions/property"
342
+ }
343
+ }
344
+ },
345
+ "upstream": {
346
+ "$ref": "#/definitions/upstream"
347
+ },
348
+ "resolver": {
349
+ "type": "object",
350
+ "properties": {
351
+ "upstream": {
352
+ "$ref": "#/definitions/upstream"
353
+ }
354
+ }
355
+ }
356
+ }
357
+ }
358
+ ]
359
+ },
360
+ "type": {
361
+ "oneOf": [
362
+ {
363
+ "type": "string"
364
+ },
365
+ {
366
+ "type": "object",
367
+ "properties": {
368
+ "name": {
369
+ "type": "string"
370
+ },
371
+ "isTypeOnly": {
372
+ "type": "boolean"
373
+ },
374
+ "moduleSpecifier": {
375
+ "type": "string"
376
+ },
377
+ "namedImport": {
378
+ "type": "string"
379
+ },
380
+ "namespaceImport": {
381
+ "type": "string"
382
+ },
383
+ "defaultImport": {
384
+ "type": "string"
385
+ }
386
+ },
387
+ "required": [
388
+ "name"
389
+ ]
390
+ }
391
+ ]
392
+ },
158
393
  "upstream": {
159
394
  "oneOf": [
160
395
  {
@@ -213,39 +448,6 @@
213
448
  ]
214
449
  }
215
450
  ]
216
- },
217
- "type": {
218
- "oneOf": [
219
- {
220
- "type": "string"
221
- },
222
- {
223
- "type": "object",
224
- "properties": {
225
- "name": {
226
- "type": "string"
227
- },
228
- "isTypeOnly": {
229
- "type": "boolean"
230
- },
231
- "moduleSpecifier": {
232
- "type": "string"
233
- },
234
- "namedImport": {
235
- "type": "string"
236
- },
237
- "namespaceImport": {
238
- "type": "string"
239
- },
240
- "defaultImport": {
241
- "type": "string"
242
- }
243
- },
244
- "required": [
245
- "name"
246
- ]
247
- }
248
- ]
249
451
  }
250
452
  }
251
453
  }
@@ -3,81 +3,37 @@
3
3
  "$id": "table-select-form-control-schematic",
4
4
  "allOf": [
5
5
  {
6
- "$ref": "#/definitions/formControl"
6
+ "$ref": "#/definitions/angular"
7
+ },
8
+ {
9
+ "$ref": "#/definitions/tableSelectFormControl"
7
10
  },
8
11
  {
9
12
  "type": "object",
10
13
  "properties": {
11
- "columnList": {
12
- "alias": "column",
13
- "type": "array",
14
- "items": {
15
- "description": "table column name",
16
- "type": "object",
17
- "properties": {
18
- "name": {
19
- "type": "string",
20
- "description": "table column name"
21
- },
22
- "title": {
23
- "type": "string",
24
- "description": "table column label"
25
- },
26
- "hasFilter": {
27
- "type": "boolean",
28
- "description": "Whether the column has a filter"
29
- },
30
- "kind": {
31
- "type": "string",
32
- "description": "The kind of data in the column"
33
- }
34
- }
35
- },
36
- "description": "List of table column names"
37
- },
38
- "title": {
14
+ "formName": {
15
+ "alias": "form",
39
16
  "type": "string",
40
- "description": "The title of the table select window"
41
- },
42
- "toDisplay": {
43
- "type": "object",
44
- "properties": {
45
- "property": {
46
- "$ref": "#/definitions/property"
47
- }
48
- }
49
- },
50
- "toValue": {
51
- "type": "object",
52
- "properties": {
53
- "property": {
54
- "$ref": "#/definitions/property"
55
- }
56
- }
57
- },
58
- "upstream": {
59
- "$ref": "#/definitions/upstream"
60
- },
61
- "resolver": {
62
- "type": "object",
63
- "properties": {
64
- "upstream": {
65
- "$ref": "#/definitions/upstream"
66
- }
67
- }
17
+ "description": "The name of the form where the form control should be added"
68
18
  }
69
- }
19
+ },
20
+ "required": [
21
+ "formName"
22
+ ]
70
23
  }
71
24
  ],
72
25
  "definitions": {
73
- "formControl": {
74
- "$ref": "../../form-control/template.schema.json"
26
+ "angular": {
27
+ "$ref": "../../../angular.schema.json"
75
28
  },
76
29
  "property": {
77
30
  "$ref": "../../../property.schema.json"
78
31
  },
79
32
  "upstream": {
80
33
  "$ref": "../../../upstream.schema.json"
34
+ },
35
+ "tableSelectFormControl": {
36
+ "$ref": "../../../table-select-form-control.schema.json"
81
37
  }
82
38
  }
83
39
  }
@@ -0,0 +1,9 @@
1
+ import { Rule } from '@angular-devkit/schematics';
2
+ import { NonNullableSelected, Normalized } from '@rxap/utilities';
3
+ import { NormalizedAngularOptions } from '../../../lib/angular-options';
4
+ import { NormalizedFormArray } from '../../../lib/form/array/form-array';
5
+ import { FormArrayOptions } from './schema';
6
+ import 'colors';
7
+ export type NormalizedFormArrayOptions = Readonly<Normalized<Pick<FormArrayOptions, 'formName'>>> & NonNullableSelected<NormalizedAngularOptions, 'controllerName'> & NormalizedFormArray;
8
+ export declare function NormalizeFormArrayOptions(options: Readonly<FormArrayOptions>): NormalizedFormArrayOptions;
9
+ export default function (options: FormArrayOptions): () => Rule;
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NormalizeFormArrayOptions = 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 angular_options_1 = require("../../../lib/angular-options");
9
+ const form_array_1 = require("../../../lib/form/array/form-array");
10
+ const form_array_kind_1 = require("../../../lib/form/array/form-array-kind");
11
+ require("colors");
12
+ function NormalizeFormArrayOptions(options) {
13
+ var _a;
14
+ const normalizedAngularOptions = (0, angular_options_1.NormalizeAngularOptions)(options);
15
+ const normalizedFormDefinitionControl = (0, form_array_1.NormalizeFormArray)(options);
16
+ const formName = (0, utilities_1.dasherize)(options.formName);
17
+ const controllerName = (_a = options.controllerName) !== null && _a !== void 0 ? _a : formName;
18
+ return Object.freeze(Object.assign(Object.assign(Object.assign({}, normalizedAngularOptions), normalizedFormDefinitionControl), { formName,
19
+ controllerName, context: options.context ? (0, utilities_1.dasherize)(options.context) : null }));
20
+ }
21
+ exports.NormalizeFormArrayOptions = NormalizeFormArrayOptions;
22
+ function printOptions(options) {
23
+ (0, angular_options_1.PrintAngularOptions)('form-control', options);
24
+ console.log(`=== form: ${options.formName}`.blue);
25
+ }
26
+ function formControlKind(normalizedOptions) {
27
+ switch (normalizedOptions.kind) {
28
+ case form_array_kind_1.FormArrayKind.DEFAULT:
29
+ default:
30
+ return () => console.log(`No schematic for form array kind: ${normalizedOptions.kind}`.yellow);
31
+ }
32
+ }
33
+ function formDefinitionRule(normalizedOptions) {
34
+ const { formName, name } = normalizedOptions;
35
+ return (0, schematics_1.chain)([
36
+ (0, schematics_utilities_1.ExecuteSchematic)('form-definition', Object.assign(Object.assign({}, normalizedOptions), { name: [formName, name].join('-'), standalone: false })),
37
+ ]);
38
+ }
39
+ function default_1(options) {
40
+ const normalizedOptions = NormalizeFormArrayOptions(options);
41
+ printOptions(normalizedOptions);
42
+ return () => {
43
+ return (0, schematics_1.chain)([
44
+ () => console.group('[@rxap/schematics-angular:form-array]'.green),
45
+ () => console.log('Coerce form array in form definition class ...'),
46
+ (0, schematics_ts_morph_1.CoerceFormDefinitionFormArray)(normalizedOptions),
47
+ formControlKind(normalizedOptions),
48
+ formDefinitionRule(normalizedOptions),
49
+ () => console.groupEnd(),
50
+ ]);
51
+ };
52
+ }
53
+ exports.default = default_1;
54
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/angular/src/schematics/form/form-array/index.ts"],"names":[],"mappings":";;;AAAA,2DAGoC;AACpC,mEAA0E;AAC1E,qEAA8D;AAC9D,+CAIyB;AACzB,kEAIsC;AACtC,mEAG4C;AAC5C,6EAAwE;AAExE,kBAAgB;AAIhB,SAAgB,yBAAyB,CACvC,OAAmC;;IAEnC,MAAM,wBAAwB,GAAG,IAAA,yCAAuB,EAAC,OAAO,CAAC,CAAC;IAClE,MAAM,+BAA+B,GAAG,IAAA,+BAAkB,EAAC,OAAO,CAAC,CAAC;IACpE,MAAM,QAAQ,GAAG,IAAA,qBAAS,EAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC7C,MAAM,cAAc,GAAG,MAAA,OAAO,CAAC,cAAc,mCAAI,QAAQ,CAAC;IAC1D,OAAO,MAAM,CAAC,MAAM,+CACf,wBAAwB,GACxB,+BAA+B,KAClC,QAAQ;QACR,cAAc,EACd,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,IAAA,qBAAS,EAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,IAC5D,CAAC;AACL,CAAC;AAdD,8DAcC;AAED,SAAS,YAAY,CAAC,OAAmC;IACvD,IAAA,qCAAmB,EAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IAC7C,OAAO,CAAC,GAAG,CAAC,aAAa,OAAO,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,CAAC;AACpD,CAAC;AAED,SAAS,eAAe,CAAC,iBAA6C;IACpE,QAAQ,iBAAiB,CAAC,IAAI,EAAE;QAE9B,KAAK,+BAAa,CAAC,OAAO,CAAC;QAC3B;YACE,OAAO,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,qCAAqC,iBAAiB,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC,CAAC;KAElG;AACH,CAAC;AAED,SAAS,kBAAkB,CAAC,iBAA6C;IACvE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,iBAAiB,CAAC;IAC7C,OAAO,IAAA,kBAAK,EAAC;QACX,IAAA,uCAAgB,EAAC,iBAAiB,kCAC7B,iBAAiB,KACpB,IAAI,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAChC,UAAU,EAAE,KAAK,IACjB;KACH,CAAC,CAAC;AACL,CAAC;AAED,mBAAyB,OAAyB;IAChD,MAAM,iBAAiB,GAAG,yBAAyB,CAAC,OAAO,CAAC,CAAC;IAC7D,YAAY,CAAC,iBAAiB,CAAC,CAAC;IAEhC,OAAO,GAAG,EAAE;QACV,OAAO,IAAA,kBAAK,EAAC;YACX,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,uCAAuC,CAAC,KAAK,CAAC;YAClE,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,gDAAgD,CAAC;YACnE,IAAA,mDAA6B,EAAC,iBAAiB,CAAC;YAChD,eAAe,CAAC,iBAAiB,CAAC;YAClC,kBAAkB,CAAC,iBAAiB,CAAC;YACrC,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE;SACzB,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAdD,4BAcC"}
@@ -0,0 +1,4 @@
1
+ import { AngularOptions } from '../../../lib/angular-options';
2
+ import { FormArray } from '../../../lib/form/array/form-array';
3
+
4
+ export type FormArrayOptions = FormArray & Omit<AngularOptions, 'name'> & { formName: string; };