@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,319 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetItemOptions = exports.NormalizeAccordionItemComponentOptions = exports.NormalizeAccordionItemStandaloneComponentOptions = void 0;
4
+ const core_1 = require("@angular-devkit/core");
5
+ const schematics_1 = require("@angular-devkit/schematics");
6
+ const schematics_ts_morph_1 = require("@rxap/schematics-ts-morph");
7
+ const schematics_utilities_1 = require("@rxap/schematics-utilities");
8
+ const utilities_1 = require("@rxap/utilities");
9
+ const path_1 = require("path");
10
+ const accordion_itme_types_1 = require("../../../lib/accordion-itme-types");
11
+ const angular_options_1 = require("../../../lib/angular-options");
12
+ const backend_types_1 = require("../../../lib/backend-types");
13
+ function NormalizeAccordionItemStandaloneComponentOptions(options) {
14
+ var _a, _b;
15
+ const normalizedAngularOptions = (0, angular_options_1.NormalizeAngularOptions)(options);
16
+ const { feature } = normalizedAngularOptions;
17
+ const itemName = (0, schematics_utilities_1.dasherize)(options.itemName);
18
+ const componentName = (0, schematics_utilities_1.CoerceSuffix)(itemName, '-panel');
19
+ let accordionName = (_a = options.accordionName) !== null && _a !== void 0 ? _a : feature;
20
+ accordionName = (0, schematics_utilities_1.CoerceSuffix)((0, schematics_utilities_1.dasherize)(accordionName), '-accordion');
21
+ return Object.seal(Object.assign(Object.assign(Object.assign({}, options), normalizedAngularOptions), { itemName: itemName, nestModule: accordionName, modifiers: (_b = options.modifiers) !== null && _b !== void 0 ? _b : [], accordionName: accordionName, directory: (0, path_1.join)(accordionName, componentName), componentName }));
22
+ }
23
+ exports.NormalizeAccordionItemStandaloneComponentOptions = NormalizeAccordionItemStandaloneComponentOptions;
24
+ function NormalizeAccordionItemComponentOptions(options) {
25
+ var _a;
26
+ const type = (_a = options.type) !== null && _a !== void 0 ? _a : 'panel';
27
+ if (!(0, accordion_itme_types_1.IsAccordionItemType)(type)) {
28
+ throw new schematics_1.SchematicsException(`The type "${type}" is not a valid accordion item type`);
29
+ }
30
+ return Object.seal(Object.assign(Object.assign({}, NormalizeAccordionItemStandaloneComponentOptions(options)), { type }));
31
+ }
32
+ exports.NormalizeAccordionItemComponentOptions = NormalizeAccordionItemComponentOptions;
33
+ function printAccordionItemComponentOptions(options) {
34
+ (0, angular_options_1.PrintAngularOptions)('accordion-item-component', options);
35
+ }
36
+ function componentRule(normalizedOptions) {
37
+ const { componentName, project, feature, directory, shared, overwrite, itemName, } = normalizedOptions;
38
+ const templateOptions = Object.assign(Object.assign(Object.assign(Object.assign({}, core_1.strings), normalizedOptions), { name: itemName }), GetItemOptions(normalizedOptions));
39
+ return (0, schematics_1.chain)([
40
+ () => console.log(`Coerce accordion item component ...`),
41
+ (0, schematics_ts_morph_1.CoerceComponentRule)({
42
+ name: componentName,
43
+ project,
44
+ feature,
45
+ directory,
46
+ shared,
47
+ overwrite,
48
+ template: {
49
+ options: templateOptions,
50
+ },
51
+ }),
52
+ ]);
53
+ }
54
+ // region panel item
55
+ function panelItemOpenApiDataSourceRule(normalizedOptions) {
56
+ const { itemName, nestModule, directory, project, feature, shared, scope, } = normalizedOptions;
57
+ const controllerName = (0, schematics_ts_morph_1.BuildNestControllerName)({
58
+ controllerName: itemName,
59
+ nestModule,
60
+ });
61
+ const operationId = (0, schematics_ts_morph_1.buildOperationId)(normalizedOptions, 'getById', controllerName);
62
+ return (0, schematics_1.chain)([
63
+ () => console.log(`Coerce getById operation ...`),
64
+ (0, schematics_ts_morph_1.CoerceGetByIdOperation)({
65
+ controllerName: itemName,
66
+ project,
67
+ feature,
68
+ shared,
69
+ nestModule,
70
+ }),
71
+ () => console.log(`Coerce panel data source ...`),
72
+ (0, schematics_ts_morph_1.CoerceDataSourceClass)({
73
+ project,
74
+ feature,
75
+ shared,
76
+ directory,
77
+ name: (0, schematics_utilities_1.CoerceSuffix)(itemName, '-panel'),
78
+ tsMorphTransform: (project, sourceFile, classDeclaration) => {
79
+ classDeclaration.setExtends(`PanelAccordionDataSource<${(0, schematics_ts_morph_1.OperationIdToResponseClassName)(operationId)}>`);
80
+ (0, schematics_ts_morph_1.CoerceImports)(sourceFile, {
81
+ namedImports: [(0, schematics_ts_morph_1.OperationIdToResponseClassName)(operationId)],
82
+ moduleSpecifier: (0, schematics_ts_morph_1.OperationIdToResponseClassImportPath)(operationId, scope),
83
+ });
84
+ (0, schematics_ts_morph_1.CoerceImports)(sourceFile, {
85
+ namedImports: [(0, schematics_ts_morph_1.OperationIdToClassName)(operationId)],
86
+ moduleSpecifier: (0, schematics_ts_morph_1.OperationIdToClassImportPath)(operationId, scope),
87
+ });
88
+ (0, schematics_ts_morph_1.CoerceImports)(sourceFile, {
89
+ namedImports: [
90
+ 'PanelAccordionDataSource',
91
+ 'AccordionDataSource',
92
+ 'ACCORDION_DATA_SOURCE',
93
+ ],
94
+ moduleSpecifier: '@rxap/data-source/accordion',
95
+ });
96
+ (0, schematics_ts_morph_1.CoerceImports)(sourceFile, {
97
+ moduleSpecifier: '@angular/router',
98
+ namedImports: ['ActivatedRoute'],
99
+ });
100
+ (0, schematics_ts_morph_1.CoerceImports)(sourceFile, {
101
+ moduleSpecifier: '@angular/core',
102
+ namedImports: ['Inject'],
103
+ });
104
+ const [constructorDeclaration] = (0, schematics_ts_morph_1.CoerceClassConstructor)(classDeclaration);
105
+ (0, schematics_ts_morph_1.CoerceParameterDeclaration)(constructorDeclaration, 'method').set({
106
+ type: (0, schematics_ts_morph_1.OperationIdToClassName)(operationId),
107
+ });
108
+ (0, schematics_ts_morph_1.CoerceParameterDeclaration)(constructorDeclaration, 'route').set({
109
+ type: 'ActivatedRoute',
110
+ });
111
+ (0, schematics_ts_morph_1.CoerceParameterDeclaration)(constructorDeclaration, 'accordionDataSource').set({
112
+ type: 'AccordionDataSource',
113
+ decorators: [
114
+ {
115
+ name: 'Inject',
116
+ arguments: ['ACCORDION_DATA_SOURCE'],
117
+ },
118
+ ],
119
+ });
120
+ (0, schematics_ts_morph_1.CoerceStatements)(constructorDeclaration, [
121
+ `super(method, route, accordionDataSource);`,
122
+ ]);
123
+ },
124
+ }),
125
+ ]);
126
+ }
127
+ function panelItemLocalDataSourceRule(normalizedOptions) {
128
+ const { itemName, directory, project, feature, shared, componentName: name, overwrite, } = normalizedOptions;
129
+ return (0, schematics_1.chain)([
130
+ () => console.log(`Coerce panel data source ...`),
131
+ (0, schematics_ts_morph_1.CoerceInterfaceRule)({
132
+ project,
133
+ feature,
134
+ shared,
135
+ directory,
136
+ name,
137
+ structure: {
138
+ isExported: true,
139
+ properties: [
140
+ {
141
+ name: 'uuid',
142
+ type: 'string',
143
+ },
144
+ {
145
+ name: 'name',
146
+ type: 'string',
147
+ },
148
+ ],
149
+ },
150
+ }, schematics_ts_morph_1.TsMorphAngularProjectTransformRule),
151
+ (0, schematics_ts_morph_1.CoerceMethodClass)({
152
+ project,
153
+ feature,
154
+ shared,
155
+ directory,
156
+ name,
157
+ tsMorphTransform: (project, sourceFile) => {
158
+ (0, schematics_ts_morph_1.CoerceImports)(sourceFile, [
159
+ {
160
+ namedImports: ['faker'],
161
+ moduleSpecifier: '@faker-js/faker',
162
+ },
163
+ {
164
+ namedImports: [(0, utilities_1.classify)(name)],
165
+ moduleSpecifier: `./${(0, schematics_utilities_1.dasherize)(name)}`,
166
+ },
167
+ ]);
168
+ return {
169
+ returnType: (0, utilities_1.classify)(name),
170
+ statements: [
171
+ `console.log('parameters: ', parameters);`,
172
+ 'return { uuid: faker.string.uuid(), name: faker.commerce.productName() };',
173
+ ],
174
+ };
175
+ },
176
+ }),
177
+ (0, schematics_ts_morph_1.CoerceDataSourceClass)({
178
+ project,
179
+ feature,
180
+ shared,
181
+ directory,
182
+ name: (0, schematics_utilities_1.CoerceSuffix)(itemName, '-panel'),
183
+ tsMorphTransform: (project, sourceFile, classDeclaration) => {
184
+ classDeclaration.setExtends(`PanelAccordionDataSource<${(0, utilities_1.classify)(name)}>`);
185
+ (0, schematics_ts_morph_1.CoerceImports)(sourceFile, {
186
+ namedImports: [(0, utilities_1.classify)(name)],
187
+ moduleSpecifier: `./${(0, schematics_utilities_1.dasherize)(name)}`,
188
+ });
189
+ (0, schematics_ts_morph_1.CoerceImports)(sourceFile, {
190
+ namedImports: [(0, utilities_1.classify)(name) + 'Method'],
191
+ moduleSpecifier: `./${(0, schematics_utilities_1.dasherize)(name)}.method`,
192
+ });
193
+ (0, schematics_ts_morph_1.CoerceImports)(sourceFile, {
194
+ namedImports: [
195
+ 'PanelAccordionDataSource',
196
+ 'AccordionDataSource',
197
+ 'ACCORDION_DATA_SOURCE',
198
+ ],
199
+ moduleSpecifier: '@rxap/data-source/accordion',
200
+ });
201
+ (0, schematics_ts_morph_1.CoerceImports)(sourceFile, {
202
+ moduleSpecifier: '@angular/router',
203
+ namedImports: ['ActivatedRoute'],
204
+ });
205
+ (0, schematics_ts_morph_1.CoerceImports)(sourceFile, {
206
+ moduleSpecifier: '@angular/core',
207
+ namedImports: ['Inject'],
208
+ });
209
+ const [constructorDeclaration] = (0, schematics_ts_morph_1.CoerceClassConstructor)(classDeclaration);
210
+ (0, schematics_ts_morph_1.CoerceParameterDeclaration)(constructorDeclaration, 'method').set({
211
+ type: (0, utilities_1.classify)(name) + 'Method',
212
+ });
213
+ (0, schematics_ts_morph_1.CoerceParameterDeclaration)(constructorDeclaration, 'route').set({
214
+ type: 'ActivatedRoute',
215
+ });
216
+ (0, schematics_ts_morph_1.CoerceParameterDeclaration)(constructorDeclaration, 'accordionDataSource').set({
217
+ type: 'AccordionDataSource',
218
+ decorators: [
219
+ {
220
+ name: 'Inject',
221
+ arguments: ['ACCORDION_DATA_SOURCE'],
222
+ },
223
+ ],
224
+ });
225
+ (0, schematics_ts_morph_1.CoerceStatements)(constructorDeclaration, [
226
+ `super(method, route, accordionDataSource);`,
227
+ ]);
228
+ },
229
+ }),
230
+ (0, schematics_ts_morph_1.CoerceComponentRule)({
231
+ project,
232
+ name,
233
+ feature,
234
+ directory,
235
+ overwrite,
236
+ tsMorphTransform: (project, [sourceFile]) => {
237
+ (0, schematics_ts_morph_1.AddComponentProvider)(sourceFile, (0, utilities_1.classify)(name) + 'Method', [
238
+ {
239
+ moduleSpecifier: `./${(0, schematics_utilities_1.dasherize)(name)}.method`,
240
+ namedImports: [(0, utilities_1.classify)(name) + 'Method'],
241
+ },
242
+ ]);
243
+ },
244
+ }),
245
+ ]);
246
+ }
247
+ function panelItemBackendRule(normalizedOptions) {
248
+ const { backend, } = normalizedOptions;
249
+ switch (backend) {
250
+ case backend_types_1.BackendTypes.NESTJS:
251
+ return panelItemOpenApiDataSourceRule(normalizedOptions);
252
+ case backend_types_1.BackendTypes.LOCAL:
253
+ return panelItemLocalDataSourceRule(normalizedOptions);
254
+ }
255
+ return (0, schematics_1.noop)();
256
+ }
257
+ function panelItemRule(normalizedOptions) {
258
+ const { itemName, directory, project, feature, shared, overwrite, componentName, } = normalizedOptions;
259
+ const templateOptions = Object.assign(Object.assign(Object.assign({}, core_1.strings), normalizedOptions), { name: itemName });
260
+ return (0, schematics_1.chain)([
261
+ (0, schematics_ts_morph_1.CoerceComponentRule)({
262
+ name: componentName,
263
+ project,
264
+ feature,
265
+ directory,
266
+ shared,
267
+ overwrite,
268
+ template: {
269
+ options: templateOptions,
270
+ },
271
+ }),
272
+ panelItemBackendRule(normalizedOptions),
273
+ ]);
274
+ }
275
+ // endregion
276
+ function GetItemOptions(normalizedOptions) {
277
+ const { shared, modifiers, } = normalizedOptions;
278
+ return {
279
+ hasSharedModifier: shared || !!(modifiers === null || modifiers === void 0 ? void 0 : modifiers.includes('shared')),
280
+ hasCollectionModifier: !!(modifiers === null || modifiers === void 0 ? void 0 : modifiers.includes('collection')),
281
+ hasEditModifier: !!(modifiers === null || modifiers === void 0 ? void 0 : modifiers.includes('edit')),
282
+ };
283
+ }
284
+ exports.GetItemOptions = GetItemOptions;
285
+ function itemRule(normalizedOptions) {
286
+ const { type, } = normalizedOptions;
287
+ const rules = [
288
+ () => console.log(`Modify accordion item component for type '${type}' ...`),
289
+ ];
290
+ switch (type) {
291
+ case accordion_itme_types_1.AccordionItemTypes.Panel:
292
+ rules.push(panelItemRule(normalizedOptions));
293
+ break;
294
+ case accordion_itme_types_1.AccordionItemTypes.Table:
295
+ rules.push((0, schematics_utilities_1.ExecuteSchematic)('accordion-item-table-component', normalizedOptions));
296
+ break;
297
+ case accordion_itme_types_1.AccordionItemTypes.DataGrid:
298
+ rules.push((0, schematics_utilities_1.ExecuteSchematic)('accordion-item-data-grid-component', normalizedOptions));
299
+ break;
300
+ case accordion_itme_types_1.AccordionItemTypes.TreeTable:
301
+ rules.push((0, schematics_utilities_1.ExecuteSchematic)('accordion-item-tree-table-component', normalizedOptions));
302
+ break;
303
+ default:
304
+ throw new schematics_1.SchematicsException(`Invalid accordion item type '${type}'!`);
305
+ }
306
+ return (0, schematics_1.chain)(rules);
307
+ }
308
+ function default_1(options) {
309
+ const normalizedOptions = NormalizeAccordionItemComponentOptions(options);
310
+ printAccordionItemComponentOptions(normalizedOptions);
311
+ return () => {
312
+ return (0, schematics_1.chain)([
313
+ componentRule(normalizedOptions),
314
+ itemRule(normalizedOptions),
315
+ ]);
316
+ };
317
+ }
318
+ exports.default = default_1;
319
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/angular/src/schematics/accordion/accordion-item-component/index.ts"],"names":[],"mappings":";;;AAAA,+CAA+C;AAC/C,2DAKoC;AACpC,mEAkBmC;AACnC,qEAIoC;AACpC,+CAGyB;AACzB,+BAA4B;AAM5B,4EAG2C;AAC3C,kEAIsC;AACtC,8DAA0D;AAU1D,SAAgB,gDAAgD,CAC9D,OAA0D;;IAE1D,MAAM,wBAAwB,GAAG,IAAA,yCAAuB,EAAC,OAAO,CAAC,CAAC;IAClE,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AACJ,CAAC;AAVD,4BAUC"}
@@ -0,0 +1,9 @@
1
+ import { AccordionItemTypes } from '../../../lib/accordion-itme-types';
2
+ import { AngularOptions } from '../../../lib/angular-options';
3
+
4
+ export interface AccordionItemComponentOptions extends AngularOptions {
5
+ itemName: string;
6
+ type: AccordionItemTypes;
7
+ accordionName: string;
8
+ modifiers?: string[];
9
+ }
@@ -0,0 +1,73 @@
1
+ {
2
+ "$schema": "http://json-schema.org/schema",
3
+ "$id": "accordion-item-component",
4
+ "type": "object",
5
+ "properties": {
6
+ "itemName": {
7
+ "alias": "name",
8
+ "type": "string",
9
+ "description": "The name of the accordion item",
10
+ "x-prompt": "Which name should the accordion item module have?"
11
+ },
12
+ "project": {
13
+ "type": "string",
14
+ "description": "The target project where the accordion item module should be added.",
15
+ "x-prompt": "To which project should the accordion item module be added?"
16
+ },
17
+ "feature": {
18
+ "type": "string",
19
+ "description": "The feature name where the accordion item module should be added.",
20
+ "x-prompt": "To which feature should the accordion item module be added?"
21
+ },
22
+ "backend": {
23
+ "type": "string",
24
+ "description": "The backend that should be used to handel data",
25
+ "enum": [
26
+ "none",
27
+ "local",
28
+ "nestjs"
29
+ ],
30
+ "default": "none"
31
+ },
32
+ "accordionName": {
33
+ "type": "string",
34
+ "description": "The name of the accordion module where the item should be added."
35
+ },
36
+ "shared": {
37
+ "type": "boolean",
38
+ "default": false,
39
+ "description": "Whether the item is based of a shared component"
40
+ },
41
+ "type": {
42
+ "type": "string",
43
+ "enum": [
44
+ "panel",
45
+ "table",
46
+ "tree-table",
47
+ "data-grid"
48
+ ],
49
+ "description": "The type of the accordion item",
50
+ "x-prompt": "Select the type of the accordion item",
51
+ "default": "panel"
52
+ },
53
+ "modifiers": {
54
+ "alias": "modifier",
55
+ "type": "array",
56
+ "items": {
57
+ "type": "string"
58
+ },
59
+ "description": "The modifiers to apply to the accordion item type"
60
+ },
61
+ "overwrite": {
62
+ "type": "boolean",
63
+ "default": false,
64
+ "description": "Whether to overwrite existing files"
65
+ }
66
+ },
67
+ "additionalProperties": true,
68
+ "required": [
69
+ "itemName",
70
+ "project",
71
+ "feature"
72
+ ]
73
+ }
@@ -0,0 +1 @@
1
+ <<%= prefix %>-<%= name %>-data-grid></<%= prefix %>-<%= name %>-data-grid>
@@ -0,0 +1,14 @@
1
+ import { ChangeDetectionStrategy, Component } from '@angular/core';
2
+ import { <%= classify(name) %>DataGridComponent } from './<%= name %>-data-grid/<%= name %>-data-grid.component';
3
+
4
+ @Component({
5
+ selector: '<%= prefix %>-<%= componentName %>',
6
+ templateUrl: './<%= componentName %>.component.html',
7
+ styleUrls: [ './<%= componentName %>.component.scss' ],
8
+ changeDetection: ChangeDetectionStrategy.OnPush,
9
+ standalone: true,
10
+ imports: [
11
+ <%= classify(name) %>DataGridComponent,
12
+ ],
13
+ })
14
+ export class <%= classify(componentName) %>Component { }
@@ -0,0 +1,10 @@
1
+ <mat-progress-bar
2
+ *ngIf="dataGridDataSource.loading$ | async"
3
+ mode="indeterminate"
4
+ ></mat-progress-bar>
5
+ <ng-template #errorTemplate let-error let-refresh="refresh">
6
+ <<%= prefix %>-data-source-error [error]="error" [refresh]="refresh"></<%= prefix %>-data-source-error>
7
+ </ng-template>
8
+ <div *rxapDataSource="let collection; from: dataGridDataSource; errorTemplate: errorTemplate" class="flex flex-wrap justify-start gap-8">
9
+ <<%= prefix %>-<%= name %>-data-grid class="grow" [data]="item" *ngFor="let item of collection"></<%= prefix %>-<%= name %>-data-grid>
10
+ </div>
@@ -0,0 +1,32 @@
1
+ import { ChangeDetectionStrategy, Component } from '@angular/core';
2
+ import { <%= classify(name) %>DataGridDataSource } from './<%= name %>-data-grid/<%= name %>-data-grid.data-source';
3
+ import { CommonModule } from '@angular/common';
4
+ import { <%= classify(name) %>DataGridComponent } from './<%= name %>-data-grid/<%= name %>-data-grid.component';
5
+ import { DataSourceDirective } from '@rxap/data-source/directive';
6
+ import { DataSourceErrorComponent } from '@rxap/data-source';
7
+ import { MatProgressBarModule } from '@angular/material/progress-bar';
8
+
9
+ @Component({
10
+ selector: '<%= prefix %>-<%= componentName %>',
11
+ templateUrl: './<%= componentName %>.component.html',
12
+ styleUrls: [ './<%= componentName %>.component.scss' ],
13
+ changeDetection: ChangeDetectionStrategy.OnPush,
14
+ standalone: true,
15
+ imports: [
16
+ <%= classify(name) %>DataGridComponent,
17
+ DataSourceDirective,
18
+ CommonModule,
19
+ DataSourceErrorComponent,
20
+ MatProgressBarModule,
21
+ ],
22
+ providers: [
23
+ <%= classify(name) %>DataGridDataSource,
24
+ ],
25
+ })
26
+ export class <%= classify(componentName) %>Component {
27
+
28
+ constructor(
29
+ public readonly dataGridDataSource: <%= classify(name) %>DataGridDataSource,
30
+ ) {}
31
+
32
+ }
@@ -0,0 +1,10 @@
1
+ import { AccordionItemDataGridComponentOptions } from './schema';
2
+ import { NormalizedAccordionItemStandaloneComponentOptions } from '../../accordion-item-component';
3
+ import { NormalizedAngularOptions } from '../../../../lib/angular-options';
4
+ import { Normalized } from '@rxap/utilities';
5
+ import { NormalizedDataGridOptions } from '../../../../lib/data-grid-options';
6
+ export interface NormalizedAccordionItemDataGridComponentOptions extends Omit<Readonly<Normalized<AccordionItemDataGridComponentOptions> & NormalizedAngularOptions & NormalizedAccordionItemStandaloneComponentOptions>, 'dataGrid'> {
7
+ dataGrid: NormalizedDataGridOptions;
8
+ }
9
+ export declare function NormalizeAccordionItemDataGridComponentOptions(options: Readonly<AccordionItemDataGridComponentOptions>): Readonly<NormalizedAccordionItemDataGridComponentOptions>;
10
+ export default function (options: AccordionItemDataGridComponentOptions): () => import("@angular-devkit/schematics").Rule;