@rxap/schematic-angular 16.1.0-dev.5 → 16.1.0-dev.50

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 (166) hide show
  1. package/CHANGELOG.md +337 -0
  2. package/README.md +1 -1
  3. package/collection.json +21 -1
  4. package/package.json +48 -40
  5. package/src/lib/accordion-item.d.ts +2 -2
  6. package/src/lib/accordion-item.js +4 -4
  7. package/src/lib/accordion-item.js.map +1 -1
  8. package/src/lib/adapter-options.d.ts +11 -5
  9. package/src/lib/adapter-options.js +8 -5
  10. package/src/lib/adapter-options.js.map +1 -1
  11. package/src/lib/angular-options.js +7 -1
  12. package/src/lib/angular-options.js.map +1 -1
  13. package/src/lib/data-grid-item.d.ts +1 -1
  14. package/src/lib/data-grid-item.js +2 -2
  15. package/src/lib/data-grid-item.js.map +1 -1
  16. package/src/lib/data-grid-options.d.ts +3 -3
  17. package/src/lib/data-grid-options.js +1 -1
  18. package/src/lib/data-grid-options.js.map +1 -1
  19. package/src/lib/dialog-action.d.ts +1 -1
  20. package/src/lib/dialog-action.js +2 -2
  21. package/src/lib/dialog-action.js.map +1 -1
  22. package/src/lib/existing-method.d.ts +11 -2
  23. package/src/lib/existing-method.js +8 -2
  24. package/src/lib/existing-method.js.map +1 -1
  25. package/src/lib/form-component-control.d.ts +1 -1
  26. package/src/lib/form-component-control.js +2 -2
  27. package/src/lib/form-component-control.js.map +1 -1
  28. package/src/lib/form-definition-control.d.ts +1 -1
  29. package/src/lib/form-definition-control.js +6 -4
  30. package/src/lib/form-definition-control.js.map +1 -1
  31. package/src/lib/minimum-table-component-options.d.ts +5 -3
  32. package/src/lib/minimum-table-component-options.js +95 -140
  33. package/src/lib/minimum-table-component-options.js.map +1 -1
  34. package/src/lib/minimum-table-options.d.ts +9 -6
  35. package/src/lib/minimum-table-options.js +7 -4
  36. package/src/lib/minimum-table-options.js.map +1 -1
  37. package/src/lib/table-action.d.ts +1 -1
  38. package/src/lib/table-action.js +11 -5
  39. package/src/lib/table-action.js.map +1 -1
  40. package/src/lib/table-column.d.ts +16 -4
  41. package/src/lib/table-column.js +93 -6
  42. package/src/lib/table-column.js.map +1 -1
  43. package/src/lib/table-header-button.d.ts +9 -2
  44. package/src/lib/table-header-button.js +22 -2
  45. package/src/lib/table-header-button.js.map +1 -1
  46. package/src/lib/table-open-api-options.d.ts +3 -2
  47. package/src/lib/table-open-api-options.js +1 -1
  48. package/src/lib/table-open-api-options.js.map +1 -1
  49. package/src/lib/table-options.d.ts +9 -5
  50. package/src/lib/table-options.js +1 -1
  51. package/src/lib/table-options.js.map +1 -1
  52. package/src/lib/table-property.d.ts +14 -0
  53. package/src/lib/table-property.js +46 -0
  54. package/src/lib/table-property.js.map +1 -0
  55. package/src/lib/table-row-action.d.ts +5 -1
  56. package/src/lib/table-row-action.js +9 -7
  57. package/src/lib/table-row-action.js.map +1 -1
  58. package/src/lib/tree-table-options.d.ts +10 -6
  59. package/src/lib/tree-table-options.js +2 -2
  60. package/src/lib/tree-table-options.js.map +1 -1
  61. package/src/lib/type-import.d.ts +4 -0
  62. package/src/lib/type-import.js +38 -0
  63. package/src/lib/type-import.js.map +1 -0
  64. package/src/schematics/accordion/accordion-component/files/component/__componentName__.component.ts.template +1 -1
  65. package/src/schematics/accordion/accordion-component/index.d.ts +3 -1
  66. package/src/schematics/accordion/accordion-component/index.js +2 -2
  67. package/src/schematics/accordion/accordion-component/index.js.map +1 -1
  68. package/src/schematics/accordion/accordion-component/schema.json +13 -3
  69. package/src/schematics/accordion/accordion-item-component/files/component/__componentName__.component.html.template +1 -1
  70. package/src/schematics/accordion/accordion-item-component/index.js +2 -2
  71. package/src/schematics/accordion/accordion-item-component/index.js.map +1 -1
  72. package/src/schematics/accordion/accordion-item-component/schema.json +13 -3
  73. package/src/schematics/accordion/item/accordion-item-data-grid-component/index.d.ts +3 -3
  74. package/src/schematics/accordion/item/accordion-item-data-grid-component/index.js +5 -5
  75. package/src/schematics/accordion/item/accordion-item-data-grid-component/index.js.map +1 -1
  76. package/src/schematics/accordion/item/accordion-item-data-grid-component/schema.json +13 -3
  77. package/src/schematics/accordion/item/accordion-item-table-component/index.d.ts +7 -4
  78. package/src/schematics/accordion/item/accordion-item-table-component/index.js +5 -5
  79. package/src/schematics/accordion/item/accordion-item-table-component/index.js.map +1 -1
  80. package/src/schematics/accordion/item/accordion-item-table-component/schema.json +57 -8
  81. package/src/schematics/accordion/item/accordion-item-tree-table-component/index.d.ts +4 -1
  82. package/src/schematics/accordion/item/accordion-item-tree-table-component/index.js +1 -1
  83. package/src/schematics/accordion/item/accordion-item-tree-table-component/index.js.map +1 -1
  84. package/src/schematics/accordion/item/accordion-item-tree-table-component/schema.json +62 -9
  85. package/src/schematics/angular.schema.json +61 -0
  86. package/src/schematics/data-grid-component/index.d.ts +1 -1
  87. package/src/schematics/data-grid-component/index.js +1 -1
  88. package/src/schematics/data-grid-component/index.js.map +1 -1
  89. package/src/schematics/data-grid-component/schema.json +13 -3
  90. package/src/schematics/dialog-component/index.js +3 -3
  91. package/src/schematics/dialog-component/index.js.map +1 -1
  92. package/src/schematics/dialog-component/schema.json +13 -3
  93. package/src/schematics/form/control/input-form-control/index.d.ts +2 -2
  94. package/src/schematics/form/control/input-form-control/index.js +8 -4
  95. package/src/schematics/form/control/input-form-control/index.js.map +1 -1
  96. package/src/schematics/form/control/select-form-control/index.js +3 -1
  97. package/src/schematics/form/control/select-form-control/index.js.map +1 -1
  98. package/src/schematics/form/control/table-select-form-control/index.d.ts +2 -2
  99. package/src/schematics/form/control/table-select-form-control/index.js +5 -3
  100. package/src/schematics/form/control/table-select-form-control/index.js.map +1 -1
  101. package/src/schematics/form/form-component/index.d.ts +1 -1
  102. package/src/schematics/form/form-component/index.js +22 -9
  103. package/src/schematics/form/form-component/index.js.map +1 -1
  104. package/src/schematics/form/form-component/schema.json +3 -6
  105. package/src/schematics/form/form-control/index.js +3 -1
  106. package/src/schematics/form/form-control/index.js.map +1 -1
  107. package/src/schematics/form/form-definition/index.d.ts +4 -4
  108. package/src/schematics/form/form-definition/index.js +24 -10
  109. package/src/schematics/form/form-definition/index.js.map +1 -1
  110. package/src/schematics/form/form-definition/schema.d.ts +2 -1
  111. package/src/schematics/form/form-definition/schema.json +5 -0
  112. package/src/schematics/general.schema.json +41 -0
  113. package/src/schematics/table/action/dialog-table-action/index.d.ts +3 -1
  114. package/src/schematics/table/action/dialog-table-action/index.js +3 -1
  115. package/src/schematics/table/action/dialog-table-action/index.js.map +1 -1
  116. package/src/schematics/table/action/dialog-table-action/schema.json +12 -2
  117. package/src/schematics/table/action/form-table-action/index.d.ts +6 -3
  118. package/src/schematics/table/action/form-table-action/index.js +68 -18
  119. package/src/schematics/table/action/form-table-action/index.js.map +1 -1
  120. package/src/schematics/table/action/form-table-action/schema.d.ts +13 -1
  121. package/src/schematics/table/action/form-table-action/schema.json +71 -3
  122. package/src/schematics/table/action/navigation-table-action/index.js +6 -3
  123. package/src/schematics/table/action/navigation-table-action/index.js.map +1 -1
  124. package/src/schematics/table/action/navigation-table-action/schema.d.ts +1 -0
  125. package/src/schematics/table/action/navigation-table-action/schema.json +5 -0
  126. package/src/schematics/table/action/open-api-table-action/index.d.ts +10 -0
  127. package/src/schematics/table/action/open-api-table-action/index.js +50 -0
  128. package/src/schematics/table/action/open-api-table-action/index.js.map +1 -0
  129. package/src/schematics/table/action/open-api-table-action/schema.d.ts +9 -0
  130. package/src/schematics/table/action/open-api-table-action/schema.json +121 -0
  131. package/src/schematics/table/action/operation-table-action/index.js +3 -1
  132. package/src/schematics/table/action/operation-table-action/index.js.map +1 -1
  133. package/src/schematics/table/header-button/form-table-header-button/index.d.ts +18 -0
  134. package/src/schematics/table/header-button/form-table-header-button/index.js +92 -0
  135. package/src/schematics/table/header-button/form-table-header-button/index.js.map +1 -0
  136. package/src/schematics/table/header-button/form-table-header-button/schema.d.ts +15 -0
  137. package/src/schematics/table/header-button/form-table-header-button/schema.json +139 -0
  138. package/src/schematics/table/header-button/navigation-table-header-button/index.d.ts +8 -0
  139. package/src/schematics/table/header-button/navigation-table-header-button/index.js +84 -0
  140. package/src/schematics/table/header-button/navigation-table-header-button/index.js.map +1 -0
  141. package/src/schematics/table/header-button/navigation-table-header-button/schema.d.ts +7 -0
  142. package/src/schematics/table/header-button/navigation-table-header-button/schema.json +87 -0
  143. package/src/schematics/table/table-action/index.js +3 -1
  144. package/src/schematics/table/table-action/index.js.map +1 -1
  145. package/src/schematics/table/table-action/schema.json +8 -0
  146. package/src/schematics/table/table-component/files/component/__componentName__.component.html.template +34 -48
  147. package/src/schematics/table/table-component/files/component/__componentName__.component.ts.template +19 -5
  148. package/src/schematics/table/table-component/index.d.ts +6 -8
  149. package/src/schematics/table/table-component/index.js +43 -28
  150. package/src/schematics/table/table-component/index.js.map +1 -1
  151. package/src/schematics/table/table-component/schema.json +267 -215
  152. package/src/schematics/table/table-header-button/index.d.ts +8 -0
  153. package/src/schematics/table/table-header-button/index.js +50 -0
  154. package/src/schematics/table/table-header-button/index.js.map +1 -0
  155. package/src/schematics/table/table-header-button/schema.d.ts +8 -0
  156. package/src/schematics/table/table-header-button/schema.json +80 -0
  157. package/src/schematics/table/tree-table-component/files/component/__componentName__.component.html.template +94 -82
  158. package/src/schematics/table/tree-table-component/files/component/__componentName__.component.ts.template +17 -4
  159. package/src/schematics/table/tree-table-component/index.d.ts +1 -1
  160. package/src/schematics/table/tree-table-component/index.js +19 -24
  161. package/src/schematics/table/tree-table-component/index.js.map +1 -1
  162. package/src/schematics/table/tree-table-component/schema.json +60 -7
  163. package/src/schematics/tree-component/index.d.ts +2 -2
  164. package/src/schematics/tree-component/index.js +2 -2
  165. package/src/schematics/tree-component/index.js.map +1 -1
  166. package/src/schematics/tree-component/schema.json +11 -1
@@ -1,257 +1,309 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/schema",
3
3
  "$id": "template-table-module",
4
- "type": "object",
5
- "properties": {
6
- "name": {
7
- "type": "string",
8
- "description": "The name of the table",
9
- "x-prompt": "Which name should the table module have?"
4
+ "allOf": [
5
+ {
6
+ "$ref": "https://unpkg.com/@rxap/schematic-angular@16.1.0-dev.23/src/schematics/angular.schema.json"
10
7
  },
11
- "project": {
12
- "type": "string",
13
- "description": "The target project where the table module should be added."
14
- },
15
- "feature": {
16
- "type": "string",
17
- "description": "The feature name where the table module should be added.",
18
- "x-prompt": "To which feature should the table module be added?"
19
- },
20
- "shared": {
21
- "type": "boolean",
22
- "description": "Whether the table is shared across applications",
23
- "default": false
24
- },
25
- "backend": {
26
- "type": "string",
27
- "description": "The backend that should be used to handel data",
28
- "enum": [
29
- "none",
30
- "local",
31
- "nestjs",
32
- "open-api"
33
- ],
34
- "default": "none"
35
- },
36
- "tableMethod": {
37
- "type": "object",
38
- "properties": {
39
- "className": {
40
- "type": "string",
41
- "description": "The name of the table method class"
42
- },
43
- "importPath": {
44
- "type": "string",
45
- "description": "The import path for the table method class"
46
- }
47
- }
48
- },
49
- "openApi": {
8
+ {
50
9
  "type": "object",
51
10
  "properties": {
52
- "operationId": {
11
+ "name": {
53
12
  "type": "string",
54
- "description": "The operationId for the open api operation"
13
+ "description": "The name of the table",
14
+ "x-prompt": "Which name should the table module have?"
55
15
  },
56
- "adapter": {
16
+ "tableMethod": {
57
17
  "type": "object",
58
18
  "properties": {
59
- "className": {
19
+ "name": {
60
20
  "type": "string",
61
- "description": "The name of the open api adapter class"
21
+ "description": "The name of the table method class"
62
22
  },
63
- "importPath": {
23
+ "moduleSpecifier": {
64
24
  "type": "string",
65
- "description": "The import path for the open api adapter class"
25
+ "description": "The import path for the table method class"
66
26
  }
67
27
  },
68
28
  "required": [
69
- "className",
70
- "importPath"
29
+ "name",
30
+ "moduleSpecifier"
71
31
  ]
72
- }
73
- },
74
- "required": [
75
- "operationId"
76
- ]
77
- },
78
- "modifiers": {
79
- "alias": "modifier",
80
- "type": "array",
81
- "items": {
82
- "type": "string",
83
- "enum": [
84
- "navigation-back-header",
85
- "without-title"
86
- ]
87
- },
88
- "description": "The table modifiers"
89
- },
90
- "headerButton": {
91
- "oneOf": [
92
- {
93
- "type": "string"
94
32
  },
95
- {
33
+ "openApi": {
96
34
  "type": "object",
97
35
  "properties": {
98
- "role": {
99
- "type": "string"
100
- },
101
- "permission": {
102
- "type": "string"
103
- },
104
- "icon": {
105
- "type": "string"
36
+ "operationId": {
37
+ "type": "string",
38
+ "description": "The operationId for the open api operation"
106
39
  },
107
- "svgIcon": {
108
- "type": "string"
40
+ "adapter": {
41
+ "type": "object",
42
+ "properties": {
43
+ "name": {
44
+ "type": "string",
45
+ "description": "The name of the open api adapter class"
46
+ },
47
+ "moduleSpecifier": {
48
+ "type": "string",
49
+ "description": "The import path for the open api adapter class"
50
+ }
51
+ },
52
+ "required": [
53
+ "name",
54
+ "moduleSpecifier"
55
+ ]
109
56
  }
110
- }
111
- }
112
- ],
113
- "description": "The header button configuration"
114
- },
115
- "directory": {
116
- "type": "string",
117
- "description": "A directory name or absolute path for the table module. relative to the feature base path"
118
- },
119
- "nestModule": {
120
- "type": "string",
121
- "description": "The module name for the table nest operations"
122
- },
123
- "columnList": {
124
- "alias": "column",
125
- "type": "array",
126
- "items": {
127
- "oneOf": [
128
- {
129
- "type": "string"
130
57
  },
131
- {
132
- "type": "object",
133
- "properties": {
134
- "name": {
135
- "type": "string"
136
- },
137
- "type": {
138
- "type": "string"
139
- },
140
- "modifiers": {
141
- "type": "array",
142
- "items": {
58
+ "required": [
59
+ "operationId"
60
+ ]
61
+ },
62
+ "modifiers": {
63
+ "alias": "modifier",
64
+ "type": "array",
65
+ "items": {
66
+ "type": "string",
67
+ "enum": [
68
+ "navigation-back-header",
69
+ "without-title"
70
+ ]
71
+ },
72
+ "description": "The table modifiers"
73
+ },
74
+ "headerButton": {
75
+ "oneOf": [
76
+ {
77
+ "type": "string"
78
+ },
79
+ {
80
+ "type": "object",
81
+ "properties": {
82
+ "role": {
83
+ "type": "string",
84
+ "enum": [
85
+ "form",
86
+ "navigation",
87
+ "method"
88
+ ]
89
+ },
90
+ "permission": {
91
+ "type": "string"
92
+ },
93
+ "icon": {
94
+ "type": "string"
95
+ },
96
+ "svgIcon": {
143
97
  "type": "string"
98
+ },
99
+ "options": {
100
+ "type": "object",
101
+ "additionalProperties": true
144
102
  }
145
103
  },
146
- "hasFilter": {
147
- "type": "boolean"
148
- },
149
- "title": {
150
- "type": "string"
151
- },
152
- "propertyPath": {
104
+ "additionalProperties": true
105
+ }
106
+ ],
107
+ "description": "The header button configuration"
108
+ },
109
+ "propertyList": {
110
+ "alias": "property",
111
+ "type": "array",
112
+ "items": {
113
+ "oneOf": [
114
+ {
153
115
  "type": "string"
154
116
  },
155
- "hidden": {
156
- "type": "boolean"
157
- },
158
- "active": {
159
- "type": "boolean"
160
- },
161
- "inactive": {
162
- "type": "boolean"
163
- },
164
- "show": {
165
- "type": "boolean"
117
+ {
118
+ "type": "object",
119
+ "properties": {
120
+ "name": {
121
+ "type": "string"
122
+ },
123
+ "type": {
124
+ "type": "string"
125
+ }
126
+ },
127
+ "required": [
128
+ "name"
129
+ ]
166
130
  }
167
- },
168
- "required": [
169
- "name"
170
131
  ]
171
132
  }
172
- ],
173
- "description": "table column name"
174
- },
175
- "description": "List of table column names"
176
- },
177
- "actionList": {
178
- "alias": "action",
179
- "type": "array",
180
- "items": {
181
- "oneOf": [
182
- {
183
- "type": "string"
184
- },
185
- {
186
- "type": "object",
187
- "properties": {
188
- "type": {
189
- "type": "string"
190
- },
191
- "refresh": {
192
- "type": "boolean"
193
- },
194
- "confirm": {
195
- "type": "boolean"
196
- },
197
- "tooltip": {
198
- "type": "string"
199
- },
200
- "errorMessage": {
201
- "type": "string"
202
- },
203
- "successMessage": {
204
- "type": "string"
205
- },
206
- "priority": {
207
- "type": "number"
208
- },
209
- "checkFunction": {
210
- "type": "string"
211
- },
212
- "inHeader": {
213
- "type": "boolean"
214
- },
215
- "role": {
216
- "type": "string"
217
- },
218
- "icon": {
219
- "type": "string"
220
- },
221
- "svgIcon": {
133
+ },
134
+ "columnList": {
135
+ "alias": "column",
136
+ "type": "array",
137
+ "items": {
138
+ "oneOf": [
139
+ {
222
140
  "type": "string"
223
141
  },
224
- "permission": {
142
+ {
143
+ "type": "object",
144
+ "properties": {
145
+ "name": {
146
+ "type": "string"
147
+ },
148
+ "type": {
149
+ "type": "string"
150
+ },
151
+ "role": {
152
+ "type": "string"
153
+ },
154
+ "modifiers": {
155
+ "type": "array",
156
+ "items": {
157
+ "type": "string"
158
+ }
159
+ },
160
+ "template": {
161
+ "type": "string"
162
+ },
163
+ "pipeList": {
164
+ "type": "array",
165
+ "items": {
166
+ "oneOf": [
167
+ {
168
+ "type": "string"
169
+ },
170
+ {
171
+ "type": "object",
172
+ "properties": {
173
+ "name": {
174
+ "type": "string"
175
+ },
176
+ "namedImport": {
177
+ "type": "string"
178
+ },
179
+ "moduleSpecifier": {
180
+ "type": "string"
181
+ }
182
+ },
183
+ "required": [
184
+ "name",
185
+ "namedImport",
186
+ "moduleSpecifier"
187
+ ]
188
+ }
189
+ ]
190
+ }
191
+ },
192
+ "hasFilter": {
193
+ "type": "boolean"
194
+ },
195
+ "nowrap": {
196
+ "type": "boolean"
197
+ },
198
+ "cssClass": {
199
+ "type": "string"
200
+ },
201
+ "title": {
202
+ "type": "string"
203
+ },
204
+ "propertyPath": {
205
+ "type": "string"
206
+ },
207
+ "hidden": {
208
+ "type": "boolean"
209
+ },
210
+ "active": {
211
+ "type": "boolean"
212
+ },
213
+ "inactive": {
214
+ "type": "boolean"
215
+ },
216
+ "show": {
217
+ "type": "boolean"
218
+ }
219
+ },
220
+ "required": [
221
+ "name"
222
+ ]
223
+ }
224
+ ],
225
+ "description": "table column name"
226
+ },
227
+ "description": "List of table column names"
228
+ },
229
+ "actionList": {
230
+ "alias": "action",
231
+ "type": "array",
232
+ "items": {
233
+ "oneOf": [
234
+ {
225
235
  "type": "string"
226
236
  },
227
- "options": {
237
+ {
228
238
  "type": "object",
229
- "additionalProperties": true
239
+ "properties": {
240
+ "type": {
241
+ "type": "string"
242
+ },
243
+ "refresh": {
244
+ "type": "boolean"
245
+ },
246
+ "confirm": {
247
+ "type": "boolean"
248
+ },
249
+ "tooltip": {
250
+ "type": "string"
251
+ },
252
+ "errorMessage": {
253
+ "type": "string"
254
+ },
255
+ "successMessage": {
256
+ "type": "string"
257
+ },
258
+ "priority": {
259
+ "type": "number"
260
+ },
261
+ "checkFunction": {
262
+ "type": "string"
263
+ },
264
+ "inHeader": {
265
+ "type": "boolean"
266
+ },
267
+ "role": {
268
+ "type": "string"
269
+ },
270
+ "icon": {
271
+ "type": "string"
272
+ },
273
+ "svgIcon": {
274
+ "type": "string"
275
+ },
276
+ "permission": {
277
+ "type": "string"
278
+ },
279
+ "color": {
280
+ "type": "string",
281
+ "description": "Value for the color input of the mat-button / mat-icon component"
282
+ },
283
+ "cssClass": {
284
+ "type": "string",
285
+ "description": "Additional CSS classes added to the button element"
286
+ },
287
+ "options": {
288
+ "type": "object",
289
+ "additionalProperties": true
290
+ }
291
+ },
292
+ "required": [
293
+ "type"
294
+ ]
230
295
  }
231
- },
232
- "required": [
233
- "type"
234
296
  ]
235
297
  }
236
- ]
237
- }
238
- },
239
- "overwrite": {
240
- "type": "boolean",
241
- "description": "Overwrite existing files",
242
- "default": false
243
- },
244
- "selectColumn": {
245
- "type": "boolean",
246
- "description": "Whether to add a select column to the table"
247
- },
248
- "context": {
249
- "type": "string",
250
- "description": "The context use to generate proper names for class, files, etc"
298
+ },
299
+ "selectColumn": {
300
+ "type": "boolean",
301
+ "description": "Whether to add a select column to the table"
302
+ }
303
+ },
304
+ "required": [
305
+ "name"
306
+ ]
251
307
  }
252
- },
253
- "required": [
254
- "name",
255
- "feature"
256
308
  ]
257
309
  }
@@ -0,0 +1,8 @@
1
+ import { Tree } from '@angular-devkit/schematics';
2
+ import { Normalized } from '@rxap/utilities';
3
+ import { NormalizedAngularOptions } from '../../../lib/angular-options';
4
+ import { NormalizedTableHeaderButton } from '../../../lib/table-header-button';
5
+ import { TableHeaderButtonOptions } from './schema';
6
+ export type NormalizedTableHeaderButtonOptions<Options extends Record<string, any> = Record<string, any>> = Readonly<Normalized<TableHeaderButtonOptions<Options>> & NormalizedAngularOptions & NormalizedTableHeaderButton>;
7
+ export declare function NormalizeTableHeaderButtonOptions<Options extends Record<string, any> = Record<string, any>>(options: Readonly<TableHeaderButtonOptions<Options>>): NormalizedTableHeaderButtonOptions<Options>;
8
+ export default function (options: TableHeaderButtonOptions): (host: Tree) => import("@angular-devkit/schematics").Rule;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NormalizeTableHeaderButtonOptions = 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 angular_options_1 = require("../../../lib/angular-options");
8
+ const assert_table_component_exists_1 = require("../../../lib/assert-table-component-exists");
9
+ const table_header_button_1 = require("../../../lib/table-header-button");
10
+ function NormalizeTableHeaderButtonOptions(options) {
11
+ const normalizedAngularOptions = (0, angular_options_1.NormalizeAngularOptions)(options);
12
+ const normalizedTableHeaderButton = (0, table_header_button_1.NormalizeTableHeaderButton)(options, options.tableName);
13
+ if (!normalizedTableHeaderButton) {
14
+ throw new Error('FATAL: should never happen');
15
+ }
16
+ const tableName = (0, schematics_utilities_1.CoerceSuffix)((0, schematics_utilities_1.dasherize)(options.tableName), '-table');
17
+ return Object.freeze(Object.assign(Object.assign(Object.assign({}, normalizedTableHeaderButton), normalizedAngularOptions), { tableName }));
18
+ }
19
+ exports.NormalizeTableHeaderButtonOptions = NormalizeTableHeaderButtonOptions;
20
+ function printOptions(options) {
21
+ (0, angular_options_1.PrintAngularOptions)('table-header-button', options);
22
+ }
23
+ function default_1(options) {
24
+ const normalizedOptions = NormalizeTableHeaderButtonOptions(options);
25
+ const { refresh, confirm, tooltip, errorMessage, successMessage, tableName, project, feature, shared, directory, overwrite, } = normalizedOptions;
26
+ printOptions(normalizedOptions);
27
+ return (host) => {
28
+ (0, assert_table_component_exists_1.AssertTableComponentExists)(host, normalizedOptions);
29
+ return (0, schematics_1.chain)([
30
+ () => console.group('\x1b[32m[@rxap/schematics-angular:table-header-button]\x1b[0m'),
31
+ () => console.log('Coerce table header button method ...'),
32
+ (0, schematics_ts_morph_1.CoerceTableHeaderButtonMethodRule)({
33
+ project,
34
+ feature,
35
+ shared,
36
+ directory,
37
+ overwrite,
38
+ tableName,
39
+ refresh,
40
+ confirm,
41
+ tooltip,
42
+ errorMessage,
43
+ successMessage,
44
+ }),
45
+ () => console.groupEnd(),
46
+ ]);
47
+ };
48
+ }
49
+ exports.default = default_1;
50
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/angular/src/schematics/table/table-header-button/index.ts"],"names":[],"mappings":";;;AAAA,2DAGoC;AACpC,mEAA8E;AAC9E,qEAGoC;AAEpC,kEAIsC;AACtC,8FAAwF;AACxF,0EAG0C;AAK1C,SAAgB,iCAAiC,CAC/C,OAAoD;IAEpD,MAAM,wBAAwB,GAAG,IAAA,yCAAuB,EAAC,OAAO,CAAC,CAAC;IAClE,MAAM,2BAA2B,GAAG,IAAA,gDAA0B,EAAU,OAAO,EAAE,OAAO,CAAC,SAAS,CAAQ,CAAC;IAC3G,IAAI,CAAC,2BAA2B,EAAE;QAChC,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;KAC/C;IACD,MAAM,SAAS,GAAG,IAAA,mCAAY,EAAC,IAAA,gCAAS,EAAC,OAAO,CAAC,SAAS,CAAC,EAAE,QAAQ,CAAC,CAAC;IACvE,OAAO,MAAM,CAAC,MAAM,+CACf,2BAA2B,GAC3B,wBAAwB,KAC3B,SAAS,IACT,CAAC;AACL,CAAC;AAdD,8EAcC;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,OAAO,EACP,OAAO,EACP,OAAO,EACP,YAAY,EACZ,cAAc,EACd,SAAS,EACT,OAAO,EACP,OAAO,EACP,MAAM,EACN,SAAS,EACT,SAAS,GACV,GAAG,iBAAiB,CAAC;IAEtB,YAAY,CAAC,iBAAiB,CAAC,CAAC;IAEhC,OAAO,CAAC,IAAU,EAAE,EAAE;QAEpB,IAAA,0DAA0B,EAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;QAEpD,OAAO,IAAA,kBAAK,EAAC;YACX,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,+DAA+D,CAAC;YACpF,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,uCAAuC,CAAC;YAC1D,IAAA,uDAAiC,EAAC;gBAChC,OAAO;gBACP,OAAO;gBACP,MAAM;gBACN,SAAS;gBACT,SAAS;gBACT,SAAS;gBACT,OAAO;gBACP,OAAO;gBACP,OAAO;gBACP,YAAY;gBACZ,cAAc;aACf,CAAC;YACF,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE;SACzB,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAzCD,4BAyCC"}
@@ -0,0 +1,8 @@
1
+ import { AngularOptions } from '../../../lib/angular-options';
2
+ import { TableHeaderButton } from '../../../lib/table-header-button';
3
+
4
+
5
+ export interface TableHeaderButtonOptions<Options extends Record<string, any> = Record<string, any>>
6
+ extends AngularOptions, TableHeaderButton<Options> {
7
+ tableName: string;
8
+ }
@@ -0,0 +1,80 @@
1
+ {
2
+ "$schema": "http://json-schema.org/schema",
3
+ "$id": "table-action",
4
+ "type": "object",
5
+ "properties": {
6
+ "tableName": {
7
+ "alias": "table",
8
+ "type": "string",
9
+ "description": "The name of the table action"
10
+ },
11
+ "project": {
12
+ "type": "string",
13
+ "description": "The target project where the table action should be added."
14
+ },
15
+ "feature": {
16
+ "type": "string",
17
+ "description": "The feature name where the table action should be added.",
18
+ "x-prompt": "To which feature should the table action be added?"
19
+ },
20
+ "backend": {
21
+ "type": "string",
22
+ "description": "The backend that should be used to handel data",
23
+ "enum": [
24
+ "none",
25
+ "local",
26
+ "nestjs",
27
+ "open-api"
28
+ ],
29
+ "default": "none"
30
+ },
31
+ "shared": {
32
+ "type": "boolean",
33
+ "description": "Whether the table action is shared across applications",
34
+ "default": false
35
+ },
36
+ "refresh": {
37
+ "type": "boolean",
38
+ "description": "Whether the table action should refresh the table after execution",
39
+ "default": false
40
+ },
41
+ "confirm": {
42
+ "type": "boolean",
43
+ "description": "Whether the table action should confirm before execution",
44
+ "default": false
45
+ },
46
+ "tooltip": {
47
+ "type": "string",
48
+ "description": "The tooltip for the table action"
49
+ },
50
+ "errorMessage": {
51
+ "type": "string",
52
+ "description": "The error message for the table action"
53
+ },
54
+ "successMessage": {
55
+ "type": "string",
56
+ "description": "The success message for the table action"
57
+ },
58
+ "directory": {
59
+ "type": "string",
60
+ "description": "A directory name or absolute path for the table action. relative to the feature base path"
61
+ },
62
+ "permission": {
63
+ "type": "string"
64
+ },
65
+ "icon": {
66
+ "type": "string"
67
+ },
68
+ "svgIcon": {
69
+ "type": "string"
70
+ },
71
+ "options": {
72
+ "type": "object",
73
+ "additionalProperties": true
74
+ }
75
+ },
76
+ "required": [
77
+ "project",
78
+ "feature"
79
+ ]
80
+ }