@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.
Files changed (200) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/GETSTARTED.md +0 -0
  3. package/GUIDES.md +0 -0
  4. package/README.md +21 -0
  5. package/collection.json +109 -0
  6. package/package.json +70 -0
  7. package/src/index.d.ts +0 -0
  8. package/src/index.js +2 -0
  9. package/src/index.js.map +1 -0
  10. package/src/lib/accordion-item.d.ts +10 -0
  11. package/src/lib/accordion-item.js +36 -0
  12. package/src/lib/accordion-item.js.map +1 -0
  13. package/src/lib/accordion-itme-types.d.ts +7 -0
  14. package/src/lib/accordion-itme-types.js +15 -0
  15. package/src/lib/accordion-itme-types.js.map +1 -0
  16. package/src/lib/angular-options.d.ts +20 -0
  17. package/src/lib/angular-options.js +57 -0
  18. package/src/lib/angular-options.js.map +1 -0
  19. package/src/lib/assert-table-component-exists.d.ts +8 -0
  20. package/src/lib/assert-table-component-exists.js +18 -0
  21. package/src/lib/assert-table-component-exists.js.map +1 -0
  22. package/src/lib/backend-types.d.ts +5 -0
  23. package/src/lib/backend-types.js +10 -0
  24. package/src/lib/backend-types.js.map +1 -0
  25. package/src/lib/data-grid-item.d.ts +9 -0
  26. package/src/lib/data-grid-item.js +31 -0
  27. package/src/lib/data-grid-item.js.map +1 -0
  28. package/src/lib/data-grid-options.d.ts +18 -0
  29. package/src/lib/data-grid-options.js +25 -0
  30. package/src/lib/data-grid-options.js.map +1 -0
  31. package/src/lib/dialog-action.d.ts +9 -0
  32. package/src/lib/dialog-action.js +33 -0
  33. package/src/lib/dialog-action.js.map +1 -0
  34. package/src/lib/existing-method.d.ts +5 -0
  35. package/src/lib/existing-method.js +11 -0
  36. package/src/lib/existing-method.js.map +1 -0
  37. package/src/lib/form-component-control.d.ts +13 -0
  38. package/src/lib/form-component-control.js +46 -0
  39. package/src/lib/form-component-control.js.map +1 -0
  40. package/src/lib/form-definition-control.d.ts +15 -0
  41. package/src/lib/form-definition-control.js +59 -0
  42. package/src/lib/form-definition-control.js.map +1 -0
  43. package/src/lib/minimum-table-component-options.d.ts +17 -0
  44. package/src/lib/minimum-table-component-options.js +343 -0
  45. package/src/lib/minimum-table-component-options.js.map +1 -0
  46. package/src/lib/minimum-table-options.d.ts +18 -0
  47. package/src/lib/minimum-table-options.js +27 -0
  48. package/src/lib/minimum-table-options.js.map +1 -0
  49. package/src/lib/table-action.d.ts +11 -0
  50. package/src/lib/table-action.js +93 -0
  51. package/src/lib/table-action.js.map +1 -0
  52. package/src/lib/table-column.d.ts +18 -0
  53. package/src/lib/table-column.js +73 -0
  54. package/src/lib/table-column.js.map +1 -0
  55. package/src/lib/table-header-button.d.ts +9 -0
  56. package/src/lib/table-header-button.js +58 -0
  57. package/src/lib/table-header-button.js.map +1 -0
  58. package/src/lib/table-options.d.ts +15 -0
  59. package/src/lib/table-options.js +16 -0
  60. package/src/lib/table-options.js.map +1 -0
  61. package/src/lib/table-row-action.d.ts +14 -0
  62. package/src/lib/table-row-action.js +21 -0
  63. package/src/lib/table-row-action.js.map +1 -0
  64. package/src/lib/to-title.d.ts +1 -0
  65. package/src/lib/to-title.js +12 -0
  66. package/src/lib/to-title.js.map +1 -0
  67. package/src/lib/tree-table-options.d.ts +15 -0
  68. package/src/lib/tree-table-options.js +15 -0
  69. package/src/lib/tree-table-options.js.map +1 -0
  70. package/src/schematics/accordion/accordion-component/files/component/__componentName__.component.html.template +30 -0
  71. package/src/schematics/accordion/accordion-component/files/component/__componentName__.component.ts.template +54 -0
  72. package/src/schematics/accordion/accordion-component/files/header-component/accordion-header.component.html.template +5 -0
  73. package/src/schematics/accordion/accordion-component/files/header-component/accordion-header.component.ts.template +14 -0
  74. package/src/schematics/accordion/accordion-component/index.d.ts +8 -0
  75. package/src/schematics/accordion/accordion-component/index.js +350 -0
  76. package/src/schematics/accordion/accordion-component/index.js.map +1 -0
  77. package/src/schematics/accordion/accordion-component/schema.d.ts +7 -0
  78. package/src/schematics/accordion/accordion-component/schema.json +90 -0
  79. package/src/schematics/accordion/accordion-item-component/files/component/__componentName__.component.html.template +7 -0
  80. package/src/schematics/accordion/accordion-item-component/files/component/__componentName__.component.ts.template +32 -0
  81. package/src/schematics/accordion/accordion-item-component/index.d.ts +21 -0
  82. package/src/schematics/accordion/accordion-item-component/index.js +319 -0
  83. package/src/schematics/accordion/accordion-item-component/index.js.map +1 -0
  84. package/src/schematics/accordion/accordion-item-component/schema.d.ts +9 -0
  85. package/src/schematics/accordion/accordion-item-component/schema.json +73 -0
  86. package/src/schematics/accordion/item/accordion-item-data-grid-component/files/data-grid/__componentName__.component.html.template +1 -0
  87. package/src/schematics/accordion/item/accordion-item-data-grid-component/files/data-grid/__componentName__.component.ts.template +14 -0
  88. package/src/schematics/accordion/item/accordion-item-data-grid-component/files/data-grid-collection/__componentName__.component.html.template +10 -0
  89. package/src/schematics/accordion/item/accordion-item-data-grid-component/files/data-grid-collection/__componentName__.component.ts.template +32 -0
  90. package/src/schematics/accordion/item/accordion-item-data-grid-component/index.d.ts +10 -0
  91. package/src/schematics/accordion/item/accordion-item-data-grid-component/index.js +211 -0
  92. package/src/schematics/accordion/item/accordion-item-data-grid-component/index.js.map +1 -0
  93. package/src/schematics/accordion/item/accordion-item-data-grid-component/schema.d.ts +7 -0
  94. package/src/schematics/accordion/item/accordion-item-data-grid-component/schema.json +122 -0
  95. package/src/schematics/accordion/item/accordion-item-table-component/files/component/__componentName__.component.html.template +1 -0
  96. package/src/schematics/accordion/item/accordion-item-table-component/files/component/__componentName__.component.ts.template +35 -0
  97. package/src/schematics/accordion/item/accordion-item-table-component/index.d.ts +7 -0
  98. package/src/schematics/accordion/item/accordion-item-table-component/index.js +108 -0
  99. package/src/schematics/accordion/item/accordion-item-table-component/index.js.map +1 -0
  100. package/src/schematics/accordion/item/accordion-item-table-component/schema.d.ts +7 -0
  101. package/src/schematics/accordion/item/accordion-item-table-component/schema.json +248 -0
  102. package/src/schematics/accordion/item/accordion-item-tree-table-component/files/component/__componentName__.component.html.template +1 -0
  103. package/src/schematics/accordion/item/accordion-item-tree-table-component/files/component/__componentName__.component.ts.template +34 -0
  104. package/src/schematics/accordion/item/accordion-item-tree-table-component/index.d.ts +7 -0
  105. package/src/schematics/accordion/item/accordion-item-tree-table-component/index.js +182 -0
  106. package/src/schematics/accordion/item/accordion-item-tree-table-component/index.js.map +1 -0
  107. package/src/schematics/accordion/item/accordion-item-tree-table-component/schema.d.ts +7 -0
  108. package/src/schematics/accordion/item/accordion-item-tree-table-component/schema.json +257 -0
  109. package/src/schematics/data-grid-component/files/form/__componentName__.component.html.template +42 -0
  110. package/src/schematics/data-grid-component/files/form/__componentName__.component.ts.template +43 -0
  111. package/src/schematics/data-grid-component/files/plain/__componentName__.component.html.template +25 -0
  112. package/src/schematics/data-grid-component/files/plain/__componentName__.component.ts.template +36 -0
  113. package/src/schematics/data-grid-component/index.d.ts +16 -0
  114. package/src/schematics/data-grid-component/index.js +320 -0
  115. package/src/schematics/data-grid-component/index.js.map +1 -0
  116. package/src/schematics/data-grid-component/schema.d.ts +4 -0
  117. package/src/schematics/data-grid-component/schema.json +112 -0
  118. package/src/schematics/dialog-component/files/component/__componentName__.component.html.template +23 -0
  119. package/src/schematics/dialog-component/index.d.ts +2 -0
  120. package/src/schematics/dialog-component/index.js +43 -0
  121. package/src/schematics/dialog-component/index.js.map +1 -0
  122. package/src/schematics/dialog-component/schema.d.ts +9 -0
  123. package/src/schematics/dialog-component/schema.json +71 -0
  124. package/src/schematics/form/control/input-form-control/index.d.ts +7 -0
  125. package/src/schematics/form/control/input-form-control/index.js +40 -0
  126. package/src/schematics/form/control/input-form-control/index.js.map +1 -0
  127. package/src/schematics/form/control/input-form-control/schema.d.ts +5 -0
  128. package/src/schematics/form/control/input-form-control/schema.json +115 -0
  129. package/src/schematics/form/control/select-form-control/index.d.ts +6 -0
  130. package/src/schematics/form/control/select-form-control/index.js +124 -0
  131. package/src/schematics/form/control/select-form-control/index.js.map +1 -0
  132. package/src/schematics/form/control/select-form-control/schema.d.ts +6 -0
  133. package/src/schematics/form/control/select-form-control/schema.json +101 -0
  134. package/src/schematics/form/control/table-select-form-control/index.d.ts +12 -0
  135. package/src/schematics/form/control/table-select-form-control/index.js +183 -0
  136. package/src/schematics/form/control/table-select-form-control/index.js.map +1 -0
  137. package/src/schematics/form/control/table-select-form-control/schema.d.ts +7 -0
  138. package/src/schematics/form/control/table-select-form-control/schema.json +105 -0
  139. package/src/schematics/form/form-component/files/component/__componentName__.component.html.template +12 -0
  140. package/src/schematics/form/form-component/files/component/__componentName__.component.ts.template +52 -0
  141. package/src/schematics/form/form-component/files/window/open-__name__-form-window.method.ts.template +29 -0
  142. package/src/schematics/form/form-component/index.d.ts +16 -0
  143. package/src/schematics/form/form-component/index.js +149 -0
  144. package/src/schematics/form/form-component/index.js.map +1 -0
  145. package/src/schematics/form/form-component/schema.d.ts +8 -0
  146. package/src/schematics/form/form-component/schema.json +107 -0
  147. package/src/schematics/form/form-control/index.d.ts +9 -0
  148. package/src/schematics/form/form-control/index.js +54 -0
  149. package/src/schematics/form/form-control/index.js.map +1 -0
  150. package/src/schematics/form/form-control/schema.d.ts +6 -0
  151. package/src/schematics/form/form-control/schema.json +91 -0
  152. package/src/schematics/form/form-definition/index.d.ts +10 -0
  153. package/src/schematics/form/form-definition/index.js +43 -0
  154. package/src/schematics/form/form-definition/index.js.map +1 -0
  155. package/src/schematics/form/form-definition/schema.d.ts +6 -0
  156. package/src/schematics/form/form-definition/schema.json +97 -0
  157. package/src/schematics/table/action/dialog-table-action/index.d.ts +8 -0
  158. package/src/schematics/table/action/dialog-table-action/index.js +99 -0
  159. package/src/schematics/table/action/dialog-table-action/index.js.map +1 -0
  160. package/src/schematics/table/action/dialog-table-action/schema.d.ts +8 -0
  161. package/src/schematics/table/action/dialog-table-action/schema.json +133 -0
  162. package/src/schematics/table/action/form-table-action/index.d.ts +9 -0
  163. package/src/schematics/table/action/form-table-action/index.js +146 -0
  164. package/src/schematics/table/action/form-table-action/index.js.map +1 -0
  165. package/src/schematics/table/action/form-table-action/schema.d.ts +4 -0
  166. package/src/schematics/table/action/form-table-action/schema.json +94 -0
  167. package/src/schematics/table/action/navigation-table-action/index.d.ts +7 -0
  168. package/src/schematics/table/action/navigation-table-action/index.js +46 -0
  169. package/src/schematics/table/action/navigation-table-action/index.js.map +1 -0
  170. package/src/schematics/table/action/navigation-table-action/schema.d.ts +5 -0
  171. package/src/schematics/table/action/navigation-table-action/schema.json +85 -0
  172. package/src/schematics/table/action/operation-table-action/index.d.ts +11 -0
  173. package/src/schematics/table/action/operation-table-action/index.js +87 -0
  174. package/src/schematics/table/action/operation-table-action/index.js.map +1 -0
  175. package/src/schematics/table/action/operation-table-action/schema.d.ts +4 -0
  176. package/src/schematics/table/action/operation-table-action/schema.json +93 -0
  177. package/src/schematics/table/table-action/index.d.ts +7 -0
  178. package/src/schematics/table/table-action/index.js +46 -0
  179. package/src/schematics/table/table-action/index.js.map +1 -0
  180. package/src/schematics/table/table-action/schema.d.ts +7 -0
  181. package/src/schematics/table/table-action/schema.json +81 -0
  182. package/src/schematics/table/table-component/files/component/__componentName__.component.html.template +311 -0
  183. package/src/schematics/table/table-component/files/component/__componentName__.component.ts.template +100 -0
  184. package/src/schematics/table/table-component/index.d.ts +17 -0
  185. package/src/schematics/table/table-component/index.js +329 -0
  186. package/src/schematics/table/table-component/index.js.map +1 -0
  187. package/src/schematics/table/table-component/schema.d.ts +4 -0
  188. package/src/schematics/table/table-component/schema.json +230 -0
  189. package/src/schematics/table/tree-table-component/files/component/__componentName__.component.html.template +201 -0
  190. package/src/schematics/table/tree-table-component/files/component/__componentName__.component.ts.template +102 -0
  191. package/src/schematics/table/tree-table-component/index.d.ts +9 -0
  192. package/src/schematics/table/tree-table-component/index.js +314 -0
  193. package/src/schematics/table/tree-table-component/index.js.map +1 -0
  194. package/src/schematics/table/tree-table-component/schema.d.ts +4 -0
  195. package/src/schematics/table/tree-table-component/schema.json +239 -0
  196. package/src/schematics/tree-component/index.d.ts +10 -0
  197. package/src/schematics/tree-component/index.js +33 -0
  198. package/src/schematics/tree-component/index.js.map +1 -0
  199. package/src/schematics/tree-component/schema.d.ts +6 -0
  200. package/src/schematics/tree-component/schema.json +75 -0
@@ -0,0 +1,350 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const schematics_1 = require("@angular-devkit/schematics");
4
+ const schematics_ts_morph_1 = require("@rxap/schematics-ts-morph");
5
+ const schematics_utilities_1 = require("@rxap/schematics-utilities");
6
+ const utilities_1 = require("@rxap/utilities");
7
+ const ts_morph_1 = require("ts-morph");
8
+ const accordion_item_1 = require("../../../lib/accordion-item");
9
+ const angular_options_1 = require("../../../lib/angular-options");
10
+ const backend_types_1 = require("../../../lib/backend-types");
11
+ function NormalizeOptions(options) {
12
+ var _a;
13
+ const normalizedAngularOptions = (0, angular_options_1.NormalizeAngularOptions)(options);
14
+ (0, angular_options_1.AssertAngularOptionsNameProperty)(normalizedAngularOptions);
15
+ let { name } = normalizedAngularOptions;
16
+ const itemList = (0, accordion_item_1.NormalizeAccordionItemList)(options.itemList);
17
+ name = (0, schematics_utilities_1.CoerceSuffix)((0, schematics_utilities_1.dasherize)(name), '-accordion');
18
+ return Object.seal(Object.assign(Object.assign({}, normalizedAngularOptions), { directory: name, itemList,
19
+ name, multiple: (_a = options.multiple) !== null && _a !== void 0 ? _a : false }));
20
+ }
21
+ function HasMissingPanelComponents(host, itemList, { project, feature, directory, }) {
22
+ const hasMissing = itemList.some((item) => !(0, schematics_ts_morph_1.HasComponent)(host, {
23
+ project,
24
+ feature,
25
+ directory,
26
+ name: (0, schematics_utilities_1.CoerceSuffix)(item, '-panel'),
27
+ }));
28
+ if (hasMissing) {
29
+ console.log(`Missing panel components for accordion '${itemList.join(', ')}'. Overwrite accordion component template`);
30
+ }
31
+ return hasMissing;
32
+ }
33
+ function printOptions(options) {
34
+ (0, angular_options_1.PrintAngularOptions)('accordion-component', options);
35
+ if (options.itemList.length) {
36
+ console.log(`=== items: \x1b[34m${options.itemList.map((item) => item.name).join(', ')}\x1b[0m`);
37
+ }
38
+ else {
39
+ console.log('=== items: \x1b[31mempty\x1b[0m');
40
+ }
41
+ }
42
+ function componentRule(normalizedOptions, hasMissingPanelComponents) {
43
+ const { project, feature, directory, overwrite, itemList, name, } = normalizedOptions;
44
+ const templateOptions = Object.assign(Object.assign({}, normalizedOptions), { name, accordionName: name, itemList });
45
+ return (0, schematics_1.chain)([
46
+ () => console.log('Coerce accordion component ...'),
47
+ (0, schematics_ts_morph_1.CoerceComponentRule)({
48
+ project,
49
+ name,
50
+ feature,
51
+ directory,
52
+ overwrite: overwrite || hasMissingPanelComponents,
53
+ template: {
54
+ options: templateOptions,
55
+ },
56
+ }),
57
+ ]);
58
+ }
59
+ // region accordion item panel component
60
+ function headerComponentOpenApiRule(normalizedOptions) {
61
+ const { name, project, feature, directory, overwrite, scope, } = normalizedOptions;
62
+ const operationId = (0, schematics_ts_morph_1.buildOperationId)(normalizedOptions, 'getById', name);
63
+ return (0, schematics_1.chain)([
64
+ (0, schematics_ts_morph_1.CoerceComponentRule)({
65
+ project,
66
+ name: 'accordion-header',
67
+ feature,
68
+ directory,
69
+ overwrite,
70
+ tsMorphTransform: (project, [sourceFile], [classDeclaration]) => {
71
+ const propertyDeclaration = (0, schematics_ts_morph_1.CoercePropertyDeclaration)(classDeclaration, 'data');
72
+ propertyDeclaration.setType((0, schematics_ts_morph_1.OperationIdToResponseClassName)(operationId));
73
+ (0, schematics_ts_morph_1.CoerceImports)(sourceFile, {
74
+ moduleSpecifier: (0, schematics_ts_morph_1.OperationIdToResponseClassImportPath)(operationId, scope),
75
+ namedImports: [(0, schematics_ts_morph_1.OperationIdToResponseClassName)(operationId)],
76
+ });
77
+ },
78
+ }),
79
+ ]);
80
+ }
81
+ function headerComponentLocalRule(normalizedOptions) {
82
+ const { name, project, feature, directory, overwrite, } = normalizedOptions;
83
+ return (0, schematics_1.chain)([
84
+ (0, schematics_ts_morph_1.CoerceComponentRule)({
85
+ project,
86
+ name: 'accordion-header',
87
+ feature,
88
+ directory,
89
+ overwrite,
90
+ tsMorphTransform: (project, [sourceFile], [classDeclaration]) => {
91
+ const propertyDeclaration = (0, schematics_ts_morph_1.CoercePropertyDeclaration)(classDeclaration, 'data');
92
+ propertyDeclaration.setType((0, utilities_1.classify)(name));
93
+ (0, schematics_ts_morph_1.CoerceImports)(sourceFile, {
94
+ moduleSpecifier: `../${(0, schematics_utilities_1.dasherize)(name)}`,
95
+ namedImports: [(0, utilities_1.classify)(name)],
96
+ });
97
+ },
98
+ }),
99
+ ]);
100
+ }
101
+ function headerComponentBackendRule(normalizedOptions) {
102
+ const { backend } = normalizedOptions;
103
+ switch (backend) {
104
+ case backend_types_1.BackendTypes.NESTJS:
105
+ return headerComponentOpenApiRule(normalizedOptions);
106
+ case backend_types_1.BackendTypes.LOCAL:
107
+ return headerComponentLocalRule(normalizedOptions);
108
+ }
109
+ return (0, schematics_1.noop)();
110
+ }
111
+ function headerComponentRule(normalizedOptions) {
112
+ const { project, feature, directory, overwrite, name, } = normalizedOptions;
113
+ const templateOptions = Object.assign(Object.assign({}, normalizedOptions), { name, operationId: (0, schematics_ts_morph_1.buildOperationId)(normalizedOptions, 'getById', name), OperationIdToResponseClassImportPath: schematics_ts_morph_1.OperationIdToResponseClassImportPath,
114
+ OperationIdToResponseClassName: schematics_ts_morph_1.OperationIdToResponseClassName });
115
+ return (0, schematics_1.chain)([
116
+ () => console.log('Coerce accordion header component ...'),
117
+ (0, schematics_ts_morph_1.CoerceComponentRule)({
118
+ project,
119
+ name: 'accordion-header',
120
+ feature,
121
+ directory,
122
+ overwrite,
123
+ template: {
124
+ url: './files/header-component',
125
+ options: templateOptions,
126
+ },
127
+ tsMorphTransform: (project, [sourceFile], [classDeclaration]) => {
128
+ (0, schematics_ts_morph_1.CoercePropertyDeclaration)(classDeclaration, 'data', {
129
+ scope: ts_morph_1.Scope.Public,
130
+ decorators: [
131
+ {
132
+ name: 'Input',
133
+ arguments: [ts_morph_1.Writers.object({ required: 'true' })],
134
+ },
135
+ ],
136
+ type: 'unknown',
137
+ hasExclamationToken: true,
138
+ });
139
+ },
140
+ }),
141
+ headerComponentBackendRule(normalizedOptions),
142
+ ]);
143
+ }
144
+ // endregion
145
+ function openApiDataSourceRule(normalizedOptions, getOperationId) {
146
+ const { name, project, feature, directory, shared, scope, } = normalizedOptions;
147
+ return (0, schematics_1.chain)([
148
+ () => console.log('Create accordion data source ...'),
149
+ (0, schematics_ts_morph_1.CoerceDataSourceClass)({
150
+ project,
151
+ feature,
152
+ shared,
153
+ directory,
154
+ name,
155
+ tsMorphTransform: (project, sourceFile, classDeclaration) => {
156
+ classDeclaration.setExtends(`AccordionDataSource<${(0, schematics_ts_morph_1.OperationIdToResponseClassName)(getOperationId)}>`);
157
+ (0, schematics_ts_morph_1.CoerceImports)(sourceFile, {
158
+ namedImports: [(0, schematics_ts_morph_1.OperationIdToResponseClassName)(getOperationId)],
159
+ moduleSpecifier: (0, schematics_ts_morph_1.OperationIdToResponseClassImportPath)(getOperationId, scope),
160
+ });
161
+ (0, schematics_ts_morph_1.CoerceImports)(sourceFile, {
162
+ namedImports: [(0, schematics_ts_morph_1.OperationIdToClassName)(getOperationId)],
163
+ moduleSpecifier: (0, schematics_ts_morph_1.OperationIdToClassImportPath)(getOperationId, scope),
164
+ });
165
+ (0, schematics_ts_morph_1.CoerceImports)(sourceFile, {
166
+ namedImports: ['AccordionDataSource'],
167
+ moduleSpecifier: '@rxap/data-source/accordion',
168
+ });
169
+ (0, schematics_ts_morph_1.CoerceImports)(sourceFile, {
170
+ moduleSpecifier: '@angular/router',
171
+ namedImports: ['ActivatedRoute'],
172
+ });
173
+ const [constructorDeclaration] = (0, schematics_ts_morph_1.CoerceClassConstructor)(classDeclaration);
174
+ (0, schematics_ts_morph_1.CoerceParameterDeclaration)(constructorDeclaration, 'method').set({
175
+ type: (0, schematics_ts_morph_1.OperationIdToClassName)(getOperationId),
176
+ });
177
+ (0, schematics_ts_morph_1.CoerceParameterDeclaration)(constructorDeclaration, 'route').set({
178
+ type: 'ActivatedRoute',
179
+ });
180
+ (0, schematics_ts_morph_1.CoerceStatements)(constructorDeclaration, [`super(method, route);`]);
181
+ },
182
+ }),
183
+ ]);
184
+ }
185
+ function localBackendRule(normalizedOptions) {
186
+ const { name, project, feature, directory, shared, overwrite, } = normalizedOptions;
187
+ return (0, schematics_1.chain)([
188
+ () => console.log('Create accordion data source ...'),
189
+ (0, schematics_ts_morph_1.CoerceInterfaceRule)({
190
+ project,
191
+ feature,
192
+ shared,
193
+ directory,
194
+ name,
195
+ structure: {
196
+ isExported: true,
197
+ properties: [
198
+ {
199
+ name: 'uuid',
200
+ type: 'string',
201
+ },
202
+ {
203
+ name: 'name',
204
+ type: 'string',
205
+ },
206
+ ],
207
+ },
208
+ }, schematics_ts_morph_1.TsMorphAngularProjectTransformRule),
209
+ (0, schematics_ts_morph_1.CoerceMethodClass)({
210
+ project,
211
+ feature,
212
+ shared,
213
+ directory,
214
+ name,
215
+ tsMorphTransform: (project, sourceFile, classDeclaration) => {
216
+ (0, schematics_ts_morph_1.CoerceImports)(sourceFile, [
217
+ {
218
+ namedImports: ['faker'],
219
+ moduleSpecifier: '@faker-js/faker',
220
+ },
221
+ {
222
+ namedImports: [(0, utilities_1.classify)(name)],
223
+ moduleSpecifier: `./${(0, schematics_utilities_1.dasherize)(name)}`,
224
+ },
225
+ ]);
226
+ return {
227
+ returnType: (0, utilities_1.classify)(name),
228
+ statements: [
229
+ `console.log('parameters: ', parameters);`,
230
+ 'return { uuid: faker.string.uuid(), name: faker.commerce.productName() };',
231
+ ],
232
+ };
233
+ },
234
+ }),
235
+ (0, schematics_ts_morph_1.CoerceDataSourceClass)({
236
+ project,
237
+ feature,
238
+ shared,
239
+ directory,
240
+ name,
241
+ tsMorphTransform: (project, sourceFile, classDeclaration) => {
242
+ classDeclaration.setExtends(`AccordionDataSource<${(0, utilities_1.classify)(name)}>`);
243
+ (0, schematics_ts_morph_1.CoerceImports)(sourceFile, {
244
+ namedImports: [(0, utilities_1.classify)(name)],
245
+ moduleSpecifier: `./${(0, schematics_utilities_1.dasherize)(name)}`,
246
+ });
247
+ (0, schematics_ts_morph_1.CoerceImports)(sourceFile, {
248
+ namedImports: [(0, utilities_1.classify)(name) + 'Method'],
249
+ moduleSpecifier: `./${(0, schematics_utilities_1.dasherize)(name)}.method`,
250
+ });
251
+ (0, schematics_ts_morph_1.CoerceImports)(sourceFile, {
252
+ namedImports: ['AccordionDataSource'],
253
+ moduleSpecifier: '@rxap/data-source/accordion',
254
+ });
255
+ (0, schematics_ts_morph_1.CoerceImports)(sourceFile, {
256
+ moduleSpecifier: '@angular/router',
257
+ namedImports: ['ActivatedRoute'],
258
+ });
259
+ const [constructorDeclaration] = (0, schematics_ts_morph_1.CoerceClassConstructor)(classDeclaration);
260
+ (0, schematics_ts_morph_1.CoerceParameterDeclaration)(constructorDeclaration, 'method').set({
261
+ type: (0, utilities_1.classify)(name) + 'Method',
262
+ });
263
+ (0, schematics_ts_morph_1.CoerceParameterDeclaration)(constructorDeclaration, 'route').set({
264
+ type: 'ActivatedRoute',
265
+ });
266
+ (0, schematics_ts_morph_1.CoerceStatements)(constructorDeclaration, [`super(method, route);`]);
267
+ },
268
+ }),
269
+ (0, schematics_ts_morph_1.CoerceComponentRule)({
270
+ project,
271
+ name,
272
+ feature,
273
+ directory,
274
+ overwrite,
275
+ tsMorphTransform: (project, [sourceFile], [classDeclaration]) => {
276
+ (0, schematics_ts_morph_1.AddComponentProvider)(sourceFile, (0, utilities_1.classify)(name) + 'Method', [
277
+ {
278
+ moduleSpecifier: `./${(0, schematics_utilities_1.dasherize)(name)}.method`,
279
+ namedImports: [(0, utilities_1.classify)(name) + 'Method'],
280
+ },
281
+ ]);
282
+ },
283
+ }),
284
+ ]);
285
+ }
286
+ function itemComponentRule(normalizedOptions, item) {
287
+ const { project, feature, backend, name, overwrite, } = normalizedOptions;
288
+ return (0, schematics_1.chain)([
289
+ () => console.log(`Create accordion item component '${item.name}' ...`),
290
+ (0, schematics_utilities_1.ExecuteSchematic)('accordion-item-component', Object.assign(Object.assign({}, item), { itemName: item.name, type: item.type, modifiers: item.modifiers, project,
291
+ feature, accordionName: name, overwrite: overwrite || item.modifiers.includes('overwrite'), backend })),
292
+ ]);
293
+ }
294
+ function itemListRule(normalizedOptions) {
295
+ const { itemList, } = normalizedOptions;
296
+ return (0, schematics_1.chain)([
297
+ () => console.log('Create accordion item components ...'),
298
+ ...itemList.map((item) => itemComponentRule(normalizedOptions, item)),
299
+ ]);
300
+ }
301
+ function nestjsBackendRule(normalizedOptions) {
302
+ const { project, feature, componentName, nestModule, } = normalizedOptions;
303
+ const controllerName = (0, schematics_ts_morph_1.BuildNestControllerName)({
304
+ controllerName: componentName,
305
+ nestModule,
306
+ });
307
+ const getOperationId = (0, schematics_ts_morph_1.buildOperationId)(normalizedOptions, 'getById', controllerName);
308
+ return (0, schematics_1.chain)([
309
+ () => console.log('Create GetById Operation ...'),
310
+ (0, schematics_ts_morph_1.CoerceGetByIdOperation)({
311
+ controllerName,
312
+ project,
313
+ feature,
314
+ shared: false,
315
+ propertyList: [
316
+ {
317
+ name: 'name',
318
+ type: 'string',
319
+ },
320
+ ],
321
+ }),
322
+ openApiDataSourceRule(normalizedOptions, getOperationId),
323
+ ]);
324
+ }
325
+ function backendRule(normalizedOptions) {
326
+ const { backend, } = normalizedOptions;
327
+ switch (backend) {
328
+ case backend_types_1.BackendTypes.NESTJS:
329
+ return nestjsBackendRule(normalizedOptions);
330
+ case backend_types_1.BackendTypes.LOCAL:
331
+ return localBackendRule(normalizedOptions);
332
+ }
333
+ return (0, schematics_1.noop)();
334
+ }
335
+ function default_1(options) {
336
+ const normalizedOptions = NormalizeOptions(options);
337
+ const { itemList, } = normalizedOptions;
338
+ printOptions(normalizedOptions);
339
+ return function (host) {
340
+ const hasMissingPanelComponents = HasMissingPanelComponents(host, itemList.map((item) => item.name), normalizedOptions);
341
+ return (0, schematics_1.chain)([
342
+ componentRule(normalizedOptions, hasMissingPanelComponents),
343
+ headerComponentRule(normalizedOptions),
344
+ backendRule(normalizedOptions),
345
+ itemListRule(normalizedOptions),
346
+ ]);
347
+ };
348
+ }
349
+ exports.default = default_1;
350
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/angular/src/schematics/accordion/accordion-component/index.ts"],"names":[],"mappings":";;AAAA,2DAIoC;AACpC,mEAqBmC;AACnC,qEAIoC;AACpC,+CAGyB;AACzB,uCAMkB;AAClB,gEAGqC;AACrC,kEAKsC;AACtC,8DAA0D;AAQ1D,SAAS,gBAAgB,CACvB,OAA4C;;IAE5C,MAAM,wBAAwB,GAAG,IAAA,yCAAuB,EAAC,OAAO,CAAC,CAAC;IAClE,IAAA,kDAAgC,EAAC,wBAAwB,CAAC,CAAC;IAC3D,IAAI,EAAE,IAAI,EAAE,GAAG,wBAAwB,CAAC;IACxC,MAAM,QAAQ,GAAG,IAAA,2CAA0B,EAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC9D,IAAI,GAAG,IAAA,mCAAY,EAAC,IAAA,gCAAS,EAAC,IAAI,CAAC,EAAE,YAAY,CAAC,CAAC;IACnD,OAAO,MAAM,CAAC,IAAI,iCACb,wBAAwB,KAC3B,SAAS,EAAE,IAAI,EACf,QAAQ;QACR,IAAI,EACJ,QAAQ,EAAE,MAAA,OAAO,CAAC,QAAQ,mCAAI,KAAK,IACnC,CAAC;AACL,CAAC;AAED,SAAS,yBAAyB,CAChC,IAAU,EACV,QAAkB,EAClB,EACE,OAAO,EACP,OAAO,EACP,SAAS,GACyB;IAEpC,MAAM,UAAU,GAAG,QAAQ,CAAC,IAAI,CAC9B,CAAC,IAAI,EAAE,EAAE,CACP,CAAC,IAAA,kCAAY,EAAC,IAAI,EAAE;QAClB,OAAO;QACP,OAAO;QACP,SAAS;QACT,IAAI,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AiB,CAAC;YAC9B,YAAY,CAAC,iBAAiB,CAAC;SAChC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAnBD,4BAmBC"}
@@ -0,0 +1,7 @@
1
+ import { AngularOptions } from '../../../lib/angular-options';
2
+ import { AccordionItem } from '../../../lib/accordion-item';
3
+
4
+ export interface AccordionComponentOptions extends AngularOptions {
5
+ itemList?: Array<string | AccordionItem>;
6
+ multiple?: boolean;
7
+ }
@@ -0,0 +1,90 @@
1
+ {
2
+ "$schema": "http://json-schema.org/schema",
3
+ "$id": "accordion-module",
4
+ "type": "object",
5
+ "properties": {
6
+ "name": {
7
+ "alias": "accordionName",
8
+ "type": "string",
9
+ "description": "The name of the accordion",
10
+ "x-prompt": "Which name should the accordion module have?"
11
+ },
12
+ "project": {
13
+ "type": "string",
14
+ "description": "The target project where the accordion module should be added.",
15
+ "x-prompt": "To which project should the accordion module be added?"
16
+ },
17
+ "feature": {
18
+ "type": "string",
19
+ "description": "The feature name where the accordion module should be added.",
20
+ "x-prompt": "To which feature should the accordion module be added?"
21
+ },
22
+ "multiple": {
23
+ "type": "boolean",
24
+ "description": "Whether the accordion should allow multiple panels to be expanded at the same time",
25
+ "default": false,
26
+ "alias": "multi"
27
+ },
28
+ "backend": {
29
+ "type": "string",
30
+ "description": "The backend that should be used to handel data",
31
+ "enum": [
32
+ "none",
33
+ "local",
34
+ "nestjs"
35
+ ],
36
+ "default": "none"
37
+ },
38
+ "itemList": {
39
+ "alias": "item",
40
+ "type": "array",
41
+ "items": {
42
+ "oneOf": [
43
+ {
44
+ "type": "string"
45
+ },
46
+ {
47
+ "type": "object",
48
+ "properties": {
49
+ "name": {
50
+ "type": "string"
51
+ },
52
+ "type": {
53
+ "type": "string",
54
+ "enum": [
55
+ "panel",
56
+ "table",
57
+ "data-grid",
58
+ "data-grid-collection",
59
+ "tree-table"
60
+ ]
61
+ },
62
+ "modifiers": {
63
+ "type": "array",
64
+ "items": {
65
+ "type": "string"
66
+ }
67
+ }
68
+ },
69
+ "additionalProperties": true,
70
+ "required": [
71
+ "name"
72
+ ]
73
+ }
74
+ ],
75
+ "description": "The name of the accordion expansion panel"
76
+ },
77
+ "description": "The list of accordion expansion panels"
78
+ },
79
+ "overwrite": {
80
+ "type": "boolean",
81
+ "default": false,
82
+ "description": "Whether to overwrite existing files"
83
+ }
84
+ },
85
+ "required": [
86
+ "name",
87
+ "project",
88
+ "feature"
89
+ ]
90
+ }
@@ -0,0 +1,7 @@
1
+ <mat-progress-bar *ngIf="panelDataSource.loading$ | async" mode="indeterminate"></mat-progress-bar>
2
+ <ng-template #errorTemplate let-error let-refresh="refresh">
3
+ <<%= prefix %>-data-source-error [error]="error" [refresh]="refresh"></<%= prefix %>-data-source-error>
4
+ </ng-template>
5
+ <div *rxapDataSource="let panel from panelDataSource; errorTemplate: errorTemplate" class="container" fxLayout="column" fxLayoutGap="16px">
6
+ <pre fxFlex="nogrow">{{ panel | json }}</pre>
7
+ </div>
@@ -0,0 +1,32 @@
1
+ import { ChangeDetectionStrategy, Component } from '@angular/core';
2
+ import { <%= classify(name) %>PanelDataSource } from './<%= name %>-panel.data-source';
3
+ import { DataSourceDirective } from '@rxap/data-source/directive';
4
+ import { MatProgressBarModule } from '@angular/material/progress-bar';
5
+ import { FlexLayoutModule } from '@angular/flex-layout';
6
+ import { DataSourceErrorComponent } from '@rxap/data-source';
7
+ import { CommonModule } from '@angular/common';
8
+
9
+ @Component({
10
+ selector: '<%= prefix %>-<%= componentName %>',
11
+ templateUrl: './<%= componentName %>.component.html',
12
+ styleUrls: [ './<%= componentName %>.component.scss' ],
13
+ changeDetection: ChangeDetectionStrategy.OnPush,
14
+ imports: [
15
+ DataSourceDirective,
16
+ MatProgressBarModule,
17
+ FlexLayoutModule,
18
+ CommonModule,
19
+ DataSourceErrorComponent,
20
+ ],
21
+ standalone: true,
22
+ providers: [
23
+ <%= classify(name) %>PanelDataSource,
24
+ ],
25
+ })
26
+ export class <%= classify(componentName) %>Component {
27
+
28
+ constructor(
29
+ public readonly panelDataSource: <%= classify(name) %>PanelDataSource,
30
+ ) {}
31
+
32
+ }
@@ -0,0 +1,21 @@
1
+ import { Rule } from '@angular-devkit/schematics';
2
+ import { Normalized } from '@rxap/utilities';
3
+ import { NormalizedAngularOptions } from '../../../lib/angular-options';
4
+ import { AccordionItemComponentOptions } from './schema';
5
+ export type AccordionItemStandaloneComponentOptions = Omit<AccordionItemComponentOptions, 'type'>;
6
+ export interface NormalizedAccordionItemStandaloneComponentOptions extends Readonly<Normalized<AccordionItemStandaloneComponentOptions> & NormalizedAngularOptions> {
7
+ componentName: string;
8
+ }
9
+ export declare function NormalizeAccordionItemStandaloneComponentOptions(options: Readonly<AccordionItemStandaloneComponentOptions>): NormalizedAccordionItemStandaloneComponentOptions;
10
+ export type NormalizedAccordionItemComponentOptions = Readonly<NormalizedAccordionItemStandaloneComponentOptions & {
11
+ type: string;
12
+ }>;
13
+ export declare function NormalizeAccordionItemComponentOptions(options: Readonly<AccordionItemComponentOptions>): NormalizedAccordionItemComponentOptions;
14
+ interface ItemOptions {
15
+ hasSharedModifier: boolean;
16
+ hasCollectionModifier: boolean;
17
+ hasEditModifier: boolean;
18
+ }
19
+ export declare function GetItemOptions(normalizedOptions: Pick<NormalizedAccordionItemComponentOptions, 'modifiers' | 'shared'>): ItemOptions;
20
+ export default function (options: AccordionItemComponentOptions): () => Rule;
21
+ export {};