@rxap/schematic-angular 16.1.0-dev.5 → 16.1.0-dev.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/README.md +1 -1
- package/collection.json +16 -1
- package/package.json +10 -10
- package/src/lib/accordion-item.js +17 -19
- package/src/lib/accordion-item.js.map +1 -1
- package/src/lib/accordion-itme-types.js +3 -7
- package/src/lib/accordion-itme-types.js.map +1 -1
- package/src/lib/adapter-options.js +2 -6
- package/src/lib/adapter-options.js.map +1 -1
- package/src/lib/angular-options.js +37 -22
- package/src/lib/angular-options.js.map +1 -1
- package/src/lib/assert-table-component-exists.js +5 -9
- package/src/lib/assert-table-component-exists.js.map +1 -1
- package/src/lib/backend-types.js +2 -5
- package/src/lib/backend-types.js.map +1 -1
- package/src/lib/data-grid-item.js +5 -12
- package/src/lib/data-grid-item.js.map +1 -1
- package/src/lib/data-grid-options.js +8 -13
- package/src/lib/data-grid-options.js.map +1 -1
- package/src/lib/dialog-action.js +7 -14
- package/src/lib/dialog-action.js.map +1 -1
- package/src/lib/existing-method.js +1 -5
- package/src/lib/existing-method.js.map +1 -1
- package/src/lib/form-component-control.js +9 -16
- package/src/lib/form-component-control.js.map +1 -1
- package/src/lib/form-definition-control.js +9 -17
- package/src/lib/form-definition-control.js.map +1 -1
- package/src/lib/minimum-table-component-options.js +128 -202
- package/src/lib/minimum-table-component-options.js.map +1 -1
- package/src/lib/minimum-table-options.js +12 -17
- package/src/lib/minimum-table-options.js.map +1 -1
- package/src/lib/table-action.js +33 -37
- package/src/lib/table-action.js.map +1 -1
- package/src/lib/table-column.js +20 -27
- package/src/lib/table-column.js.map +1 -1
- package/src/lib/table-header-button.d.ts +10 -1
- package/src/lib/table-header-button.js +27 -13
- package/src/lib/table-header-button.js.map +1 -1
- package/src/lib/table-open-api-options.js +4 -8
- package/src/lib/table-open-api-options.js.map +1 -1
- package/src/lib/table-options.js +13 -15
- package/src/lib/table-options.js.map +1 -1
- package/src/lib/table-row-action.js +13 -18
- package/src/lib/table-row-action.js.map +1 -1
- package/src/lib/to-title.js +4 -8
- package/src/lib/to-title.js.map +1 -1
- package/src/lib/tree-table-options.js +11 -13
- package/src/lib/tree-table-options.js.map +1 -1
- package/src/schematics/accordion/accordion-component/index.js +125 -105
- package/src/schematics/accordion/accordion-component/index.js.map +1 -1
- package/src/schematics/accordion/accordion-item-component/index.js +119 -107
- package/src/schematics/accordion/accordion-item-component/index.js.map +1 -1
- package/src/schematics/accordion/item/accordion-item-data-grid-component/index.js +55 -54
- package/src/schematics/accordion/item/accordion-item-data-grid-component/index.js.map +1 -1
- package/src/schematics/accordion/item/accordion-item-table-component/index.js +38 -36
- package/src/schematics/accordion/item/accordion-item-table-component/index.js.map +1 -1
- package/src/schematics/accordion/item/accordion-item-tree-table-component/index.js +54 -52
- package/src/schematics/accordion/item/accordion-item-tree-table-component/index.js.map +1 -1
- package/src/schematics/data-grid-component/index.js +87 -81
- package/src/schematics/data-grid-component/index.js.map +1 -1
- package/src/schematics/dialog-component/index.js +21 -20
- package/src/schematics/dialog-component/index.js.map +1 -1
- package/src/schematics/form/control/input-form-control/index.d.ts +2 -2
- package/src/schematics/form/control/input-form-control/index.js +18 -17
- package/src/schematics/form/control/input-form-control/index.js.map +1 -1
- package/src/schematics/form/control/select-form-control/index.js +43 -43
- package/src/schematics/form/control/select-form-control/index.js.map +1 -1
- package/src/schematics/form/control/table-select-form-control/index.js +58 -58
- package/src/schematics/form/control/table-select-form-control/index.js.map +1 -1
- package/src/schematics/form/form-component/index.js +82 -61
- package/src/schematics/form/form-component/index.js.map +1 -1
- package/src/schematics/form/form-component/schema.json +3 -6
- package/src/schematics/form/form-control/index.js +24 -23
- package/src/schematics/form/form-control/index.js.map +1 -1
- package/src/schematics/form/form-definition/index.d.ts +2 -2
- package/src/schematics/form/form-definition/index.js +24 -19
- package/src/schematics/form/form-definition/index.js.map +1 -1
- package/src/schematics/table/action/dialog-table-action/index.js +32 -30
- package/src/schematics/table/action/dialog-table-action/index.js.map +1 -1
- package/src/schematics/table/action/form-table-action/index.js +89 -56
- package/src/schematics/table/action/form-table-action/index.js.map +1 -1
- package/src/schematics/table/action/navigation-table-action/index.js +19 -20
- package/src/schematics/table/action/navigation-table-action/index.js.map +1 -1
- package/src/schematics/table/action/operation-table-action/index.js +32 -31
- package/src/schematics/table/action/operation-table-action/index.js.map +1 -1
- package/src/schematics/table/header-button/form-table-header-button/index.d.ts +11 -0
- package/src/schematics/table/header-button/form-table-header-button/index.js +90 -0
- package/src/schematics/table/header-button/form-table-header-button/index.js.map +1 -0
- package/src/schematics/table/header-button/form-table-header-button/schema.d.ts +7 -0
- package/src/schematics/table/header-button/form-table-header-button/schema.json +123 -0
- package/src/schematics/table/header-button/navigation-table-header-button/index.d.ts +8 -0
- package/src/schematics/table/header-button/navigation-table-header-button/index.js +60 -0
- package/src/schematics/table/header-button/navigation-table-header-button/index.js.map +1 -0
- package/src/schematics/table/header-button/navigation-table-header-button/schema.d.ts +6 -0
- package/src/schematics/table/header-button/navigation-table-header-button/schema.json +85 -0
- package/src/schematics/table/table-action/index.js +24 -23
- package/src/schematics/table/table-action/index.js.map +1 -1
- package/src/schematics/table/table-component/files/component/__componentName__.component.html.template +5 -8
- package/src/schematics/table/table-component/files/component/__componentName__.component.ts.template +2 -2
- package/src/schematics/table/table-component/index.js +94 -93
- package/src/schematics/table/table-component/index.js.map +1 -1
- package/src/schematics/table/table-component/schema.json +4 -0
- package/src/schematics/table/table-header-button/index.d.ts +10 -0
- package/src/schematics/table/table-header-button/index.js +49 -0
- package/src/schematics/table/table-header-button/index.js.map +1 -0
- package/src/schematics/table/table-header-button/schema.d.ts +7 -0
- package/src/schematics/table/table-header-button/schema.json +80 -0
- package/src/schematics/table/tree-table-component/index.js +66 -63
- package/src/schematics/table/tree-table-component/index.js.map +1 -1
- package/src/schematics/tree-component/index.js +18 -18
- package/src/schematics/tree-component/index.js.map +1 -1
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { chain, noop, SchematicsException, } from '@angular-devkit/schematics';
|
|
2
|
+
import { GetItemOptions, NormalizeAccordionItemStandaloneComponentOptions, } from '../../accordion-item-component';
|
|
3
|
+
import { CoerceClassConstructor, CoerceComponentRule, CoerceDataSourceClass, CoerceFormComponentProviderRule, CoerceGetDataGridOperation, CoerceImports, CoerceParameterDeclaration, CoerceStatements, CoerceSubmitDataGridOperation, } from '@rxap/schematics-ts-morph';
|
|
4
|
+
import { PrintAngularOptions, } from '../../../../lib/angular-options';
|
|
5
|
+
import { BackendTypes } from '../../../../lib/backend-types';
|
|
6
|
+
import { DataGridMode, NormalizeDataGridOptions, } from '../../../../lib/data-grid-options';
|
|
7
|
+
import { join } from 'path';
|
|
8
|
+
import { CoerceSuffix, ExecuteSchematic, } from '@rxap/schematics-utilities';
|
|
9
|
+
import { strings } from '@angular-devkit/core';
|
|
10
|
+
export function NormalizeAccordionItemDataGridComponentOptions(options) {
|
|
11
|
+
const normalizedAccordionItemComponentOptions = NormalizeAccordionItemStandaloneComponentOptions(options);
|
|
12
|
+
return Object.seal({
|
|
13
|
+
...normalizedAccordionItemComponentOptions,
|
|
14
|
+
dataGrid: NormalizeDataGridOptions(options.dataGrid),
|
|
15
|
+
});
|
|
16
16
|
}
|
|
17
|
-
exports.NormalizeAccordionItemDataGridComponentOptions = NormalizeAccordionItemDataGridComponentOptions;
|
|
18
17
|
function printOptions(options) {
|
|
19
|
-
|
|
18
|
+
PrintAngularOptions('accordion-item-data-grid-component', options);
|
|
20
19
|
if (options.dataGrid.itemList.length) {
|
|
21
20
|
console.log(`=== items: \x1b[34m${options.dataGrid.itemList.map((item) => item.name).join(', ')}\x1b[0m`);
|
|
22
21
|
}
|
|
@@ -25,13 +24,17 @@ function printOptions(options) {
|
|
|
25
24
|
}
|
|
26
25
|
}
|
|
27
26
|
function componentRule(normalizedOptions) {
|
|
28
|
-
var _a, _b, _c;
|
|
29
27
|
const { itemName, nestModule, directory, project, feature, overwrite, componentName, shared, backend, dataGrid, } = normalizedOptions;
|
|
30
|
-
const { hasSharedModifier, hasCollectionModifier, hasEditModifier, } =
|
|
31
|
-
const templateOptions =
|
|
32
|
-
|
|
28
|
+
const { hasSharedModifier, hasCollectionModifier, hasEditModifier, } = GetItemOptions(normalizedOptions);
|
|
29
|
+
const templateOptions = {
|
|
30
|
+
...strings,
|
|
31
|
+
...normalizedOptions,
|
|
32
|
+
name: itemName,
|
|
33
|
+
...GetItemOptions(normalizedOptions),
|
|
34
|
+
};
|
|
35
|
+
return chain([
|
|
33
36
|
() => console.log(`Coerce data grid component ...`),
|
|
34
|
-
|
|
37
|
+
ExecuteSchematic('data-grid-component', {
|
|
35
38
|
project,
|
|
36
39
|
feature,
|
|
37
40
|
shared: hasSharedModifier,
|
|
@@ -39,13 +42,13 @@ function componentRule(normalizedOptions) {
|
|
|
39
42
|
nestModule: hasSharedModifier ? undefined : nestModule,
|
|
40
43
|
nestController: itemName,
|
|
41
44
|
directory: hasSharedModifier ? undefined : directory,
|
|
42
|
-
itemList:
|
|
43
|
-
collection: hasCollectionModifier || (
|
|
44
|
-
mode: hasEditModifier ? 'form' : (
|
|
45
|
+
itemList: dataGrid?.itemList ?? [],
|
|
46
|
+
collection: hasCollectionModifier || (dataGrid?.collection ?? false),
|
|
47
|
+
mode: hasEditModifier ? 'form' : (dataGrid?.mode ?? 'plain'),
|
|
45
48
|
backend: backend,
|
|
46
49
|
overwrite,
|
|
47
50
|
}),
|
|
48
|
-
|
|
51
|
+
CoerceComponentRule({
|
|
49
52
|
name: componentName,
|
|
50
53
|
project,
|
|
51
54
|
feature,
|
|
@@ -61,24 +64,23 @@ function componentRule(normalizedOptions) {
|
|
|
61
64
|
}
|
|
62
65
|
function nestjsBackendRule(normalizedOptions) {
|
|
63
66
|
const { itemName, nestModule, directory, project, feature, shared, } = normalizedOptions;
|
|
64
|
-
const { hasSharedModifier, hasCollectionModifier, hasEditModifier, } =
|
|
67
|
+
const { hasSharedModifier, hasCollectionModifier, hasEditModifier, } = GetItemOptions(normalizedOptions);
|
|
65
68
|
const rules = ([
|
|
66
69
|
() => console.log(`Modify the data source class ...`),
|
|
67
|
-
|
|
70
|
+
CoerceDataSourceClass({
|
|
68
71
|
project,
|
|
69
72
|
feature,
|
|
70
73
|
shared: hasSharedModifier,
|
|
71
|
-
directory:
|
|
72
|
-
name:
|
|
74
|
+
directory: join(directory ?? '', CoerceSuffix(itemName, '-data-grid')),
|
|
75
|
+
name: CoerceSuffix(itemName, '-data-grid'),
|
|
73
76
|
tsMorphTransform: (project, sourceFile, classDeclaration) => {
|
|
74
|
-
|
|
75
|
-
const
|
|
76
|
-
const match = current === null || current === void 0 ? void 0 : current.match(/<([^>]+)>/);
|
|
77
|
+
const current = classDeclaration.getExtends()?.getText();
|
|
78
|
+
const match = current?.match(/<([^>]+)>/);
|
|
77
79
|
if (!match) {
|
|
78
|
-
throw new
|
|
80
|
+
throw new SchematicsException(`Could not extract the generic type from '${current}'!`);
|
|
79
81
|
}
|
|
80
82
|
classDeclaration.setExtends(`PanelAccordionDataSource<${match[1]}>`);
|
|
81
|
-
|
|
83
|
+
CoerceImports(sourceFile, {
|
|
82
84
|
namedImports: [
|
|
83
85
|
'PanelAccordionDataSource',
|
|
84
86
|
'AccordionDataSource',
|
|
@@ -86,19 +88,19 @@ function nestjsBackendRule(normalizedOptions) {
|
|
|
86
88
|
],
|
|
87
89
|
moduleSpecifier: '@rxap/data-source/accordion',
|
|
88
90
|
});
|
|
89
|
-
|
|
91
|
+
CoerceImports(sourceFile, {
|
|
90
92
|
moduleSpecifier: '@angular/router',
|
|
91
93
|
namedImports: ['ActivatedRoute'],
|
|
92
94
|
});
|
|
93
|
-
|
|
95
|
+
CoerceImports(sourceFile, {
|
|
94
96
|
moduleSpecifier: '@angular/core',
|
|
95
97
|
namedImports: ['Inject'],
|
|
96
98
|
});
|
|
97
|
-
const [constructorDeclaration] =
|
|
98
|
-
|
|
99
|
+
const [constructorDeclaration] = CoerceClassConstructor(classDeclaration);
|
|
100
|
+
CoerceParameterDeclaration(constructorDeclaration, 'route').set({
|
|
99
101
|
type: 'ActivatedRoute',
|
|
100
102
|
});
|
|
101
|
-
|
|
103
|
+
CoerceParameterDeclaration(constructorDeclaration, 'accordionDataSource').set({
|
|
102
104
|
type: 'AccordionDataSource',
|
|
103
105
|
decorators: [
|
|
104
106
|
{
|
|
@@ -107,13 +109,13 @@ function nestjsBackendRule(normalizedOptions) {
|
|
|
107
109
|
},
|
|
108
110
|
],
|
|
109
111
|
});
|
|
110
|
-
|
|
112
|
+
CoerceStatements(constructorDeclaration, [
|
|
111
113
|
`super(method, route, accordionDataSource);`,
|
|
112
114
|
]);
|
|
113
115
|
},
|
|
114
116
|
}),
|
|
115
117
|
() => console.log(`Modify the get data grid operation ...`),
|
|
116
|
-
|
|
118
|
+
CoerceGetDataGridOperation({
|
|
117
119
|
controllerName: itemName,
|
|
118
120
|
project,
|
|
119
121
|
feature,
|
|
@@ -131,7 +133,7 @@ function nestjsBackendRule(normalizedOptions) {
|
|
|
131
133
|
}),
|
|
132
134
|
]);
|
|
133
135
|
if (hasEditModifier) {
|
|
134
|
-
rules.push(() => console.log(`Modify the submit data grid operation ...`),
|
|
136
|
+
rules.push(() => console.log(`Modify the submit data grid operation ...`), CoerceSubmitDataGridOperation({
|
|
135
137
|
controllerName: itemName,
|
|
136
138
|
nestModule: hasSharedModifier ? undefined : nestModule,
|
|
137
139
|
project,
|
|
@@ -148,24 +150,24 @@ function nestjsBackendRule(normalizedOptions) {
|
|
|
148
150
|
skipCoerce: true,
|
|
149
151
|
}));
|
|
150
152
|
}
|
|
151
|
-
return
|
|
153
|
+
return chain(rules);
|
|
152
154
|
}
|
|
153
155
|
function backendRule(normalizedOptions) {
|
|
154
156
|
const { backend } = normalizedOptions;
|
|
155
157
|
switch (backend) {
|
|
156
|
-
case
|
|
158
|
+
case BackendTypes.NESTJS:
|
|
157
159
|
return nestjsBackendRule(normalizedOptions);
|
|
158
160
|
}
|
|
159
|
-
return
|
|
161
|
+
return noop();
|
|
160
162
|
}
|
|
161
163
|
function dataGridFormModeRule(normalizedOptions) {
|
|
162
164
|
const { itemName, directory, project, feature, } = normalizedOptions;
|
|
163
|
-
return
|
|
165
|
+
return chain([
|
|
164
166
|
() => console.log(`Extend the form component providers ...`),
|
|
165
|
-
|
|
167
|
+
CoerceFormComponentProviderRule({
|
|
166
168
|
project,
|
|
167
169
|
feature,
|
|
168
|
-
directory:
|
|
170
|
+
directory: join(directory ?? '', CoerceSuffix(itemName, '-data-grid')),
|
|
169
171
|
providerObject: {
|
|
170
172
|
provide: 'RXAP_FORM_CONTEXT',
|
|
171
173
|
useFactory: 'FormContextFromActivatedRouteFactory',
|
|
@@ -191,21 +193,20 @@ function dataGridFormModeRule(normalizedOptions) {
|
|
|
191
193
|
function dataGridModeRule(normalizedOptions) {
|
|
192
194
|
const { dataGrid: { mode } } = normalizedOptions;
|
|
193
195
|
switch (mode) {
|
|
194
|
-
case
|
|
196
|
+
case DataGridMode.Form:
|
|
195
197
|
return dataGridFormModeRule(normalizedOptions);
|
|
196
198
|
}
|
|
197
|
-
return
|
|
199
|
+
return noop();
|
|
198
200
|
}
|
|
199
|
-
function
|
|
201
|
+
export default function (options) {
|
|
200
202
|
const normalizedOptions = NormalizeAccordionItemDataGridComponentOptions(options);
|
|
201
203
|
printOptions(normalizedOptions);
|
|
202
204
|
return () => {
|
|
203
|
-
return
|
|
205
|
+
return chain([
|
|
204
206
|
componentRule(normalizedOptions),
|
|
205
207
|
backendRule(normalizedOptions),
|
|
206
208
|
dataGridModeRule(normalizedOptions),
|
|
207
209
|
]);
|
|
208
210
|
};
|
|
209
211
|
}
|
|
210
|
-
exports.default = default_1;
|
|
211
212
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/schematic/angular/src/schematics/accordion/item/accordion-item-data-grid-component/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/schematic/angular/src/schematics/accordion/item/accordion-item-data-grid-component/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,EACL,IAAI,EACJ,mBAAmB,GACpB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,cAAc,EACd,gDAAgD,GAEjD,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,qBAAqB,EACrB,+BAA+B,EAC/B,0BAA0B,EAC1B,aAAa,EACb,0BAA0B,EAC1B,gBAAgB,EAChB,6BAA6B,GAC9B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAEL,mBAAmB,GACpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE7D,OAAO,EACL,YAAY,EACZ,wBAAwB,GAEzB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EACL,YAAY,EACZ,gBAAgB,GACjB,MAAM,4BAA4B,CAAC;AAMpC,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAO/C,MAAM,UAAU,8CAA8C,CAC5D,OAAwD;IAExD,MAAM,uCAAuC,GAAG,gDAAgD,CAAC,OAAO,CAAC,CAAC;IAC1G,OAAO,MAAM,CAAC,IAAI,CAAC;QACjB,GAAG,uCAAuC;QAC1C,QAAQ,EAAE,wBAAwB,CAAC,OAAO,CAAC,QAAQ,CAAC;KACrD,CAAC,CAAC;AACL,CAAC;AAED,SAAS,YAAY,CAAC,OAAwD;IAC5E,mBAAmB,CA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
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
const schematics_utilities_1 = require("@rxap/schematics-utilities");
|
|
12
|
-
function NormalizeAccordionItemTableComponentOptions(options) {
|
|
13
|
-
const normalizedAccordionItemComponentOptions = (0, accordion_item_component_1.NormalizeAccordionItemStandaloneComponentOptions)(options);
|
|
1
|
+
import { chain, noop, } from '@angular-devkit/schematics';
|
|
2
|
+
import { GetItemOptions, NormalizeAccordionItemStandaloneComponentOptions, } from '../../accordion-item-component';
|
|
3
|
+
import { CoerceComponentRule, CoerceGetPageOperation, } from '@rxap/schematics-ts-morph';
|
|
4
|
+
import { PrintAngularOptions, } from '../../../../lib/angular-options';
|
|
5
|
+
import { BackendTypes } from '../../../../lib/backend-types';
|
|
6
|
+
import { NormalizeTableOptions } from '../../../../lib/table-options';
|
|
7
|
+
import { strings } from '@angular-devkit/core';
|
|
8
|
+
import { ExecuteSchematic } from '@rxap/schematics-utilities';
|
|
9
|
+
export function NormalizeAccordionItemTableComponentOptions(options) {
|
|
10
|
+
const normalizedAccordionItemComponentOptions = NormalizeAccordionItemStandaloneComponentOptions(options);
|
|
14
11
|
const { itemName } = normalizedAccordionItemComponentOptions;
|
|
15
|
-
return Object.seal(
|
|
12
|
+
return Object.seal({
|
|
13
|
+
...normalizedAccordionItemComponentOptions,
|
|
14
|
+
table: NormalizeTableOptions(options.table, itemName),
|
|
15
|
+
});
|
|
16
16
|
}
|
|
17
|
-
exports.NormalizeAccordionItemTableComponentOptions = NormalizeAccordionItemTableComponentOptions;
|
|
18
17
|
function printOptions(options) {
|
|
19
|
-
|
|
18
|
+
PrintAngularOptions('accordion-item-table-component', options);
|
|
20
19
|
}
|
|
21
20
|
function componentRule(normalizedOptions) {
|
|
22
21
|
const { componentName, project, feature, directory, shared, overwrite, itemName, } = normalizedOptions;
|
|
23
|
-
const templateOptions =
|
|
24
|
-
|
|
22
|
+
const templateOptions = {
|
|
23
|
+
...strings,
|
|
24
|
+
...normalizedOptions,
|
|
25
|
+
name: itemName,
|
|
26
|
+
...GetItemOptions(normalizedOptions),
|
|
27
|
+
};
|
|
28
|
+
return chain([
|
|
25
29
|
() => console.log(`Coerce accordion item component ...`),
|
|
26
|
-
|
|
30
|
+
CoerceComponentRule({
|
|
27
31
|
name: componentName,
|
|
28
32
|
project,
|
|
29
33
|
feature,
|
|
@@ -37,25 +41,24 @@ function componentRule(normalizedOptions) {
|
|
|
37
41
|
]);
|
|
38
42
|
}
|
|
39
43
|
function tableComponentSchematicRule(normalizedOptions) {
|
|
40
|
-
var _a, _b, _c;
|
|
41
44
|
const { directory, nestModule, itemName, project, feature, overwrite, backend, table, } = normalizedOptions;
|
|
42
|
-
const { hasSharedModifier } =
|
|
43
|
-
return
|
|
45
|
+
const { hasSharedModifier } = GetItemOptions(normalizedOptions);
|
|
46
|
+
return chain([
|
|
44
47
|
() => console.log(`Generate table component ...`),
|
|
45
|
-
|
|
48
|
+
ExecuteSchematic('table-component', {
|
|
46
49
|
shared: hasSharedModifier,
|
|
47
50
|
name: itemName,
|
|
48
51
|
project,
|
|
49
52
|
feature,
|
|
50
53
|
directory: hasSharedModifier ? undefined : directory,
|
|
51
54
|
nestModule: hasSharedModifier ? undefined : nestModule,
|
|
52
|
-
modifiers: ['without-title', ...
|
|
55
|
+
modifiers: ['without-title', ...table?.modifiers ?? []],
|
|
53
56
|
overwrite,
|
|
54
57
|
backend,
|
|
55
|
-
columnList:
|
|
56
|
-
actionList:
|
|
57
|
-
title: table
|
|
58
|
-
headerButton: table
|
|
58
|
+
columnList: table?.columnList ?? [],
|
|
59
|
+
actionList: table?.actionList ?? [],
|
|
60
|
+
title: table?.title,
|
|
61
|
+
headerButton: table?.headerButton,
|
|
59
62
|
tableMethod: table.tableMethod,
|
|
60
63
|
selectColumn: table.selectColumn,
|
|
61
64
|
}),
|
|
@@ -63,10 +66,10 @@ function tableComponentSchematicRule(normalizedOptions) {
|
|
|
63
66
|
}
|
|
64
67
|
function nestjsBackendRule(normalizedOptions) {
|
|
65
68
|
const { nestModule, itemName, project, feature, } = normalizedOptions;
|
|
66
|
-
const { hasSharedModifier } =
|
|
67
|
-
return
|
|
69
|
+
const { hasSharedModifier } = GetItemOptions(normalizedOptions);
|
|
70
|
+
return chain([
|
|
68
71
|
() => console.log(`Modify the get page operation ...`),
|
|
69
|
-
|
|
72
|
+
CoerceGetPageOperation({
|
|
70
73
|
controllerName: itemName,
|
|
71
74
|
nestModule: hasSharedModifier ? undefined : nestModule,
|
|
72
75
|
project,
|
|
@@ -87,16 +90,16 @@ function nestjsBackendRule(normalizedOptions) {
|
|
|
87
90
|
function backendRule(normalizedOptions) {
|
|
88
91
|
const { backend } = normalizedOptions;
|
|
89
92
|
switch (backend) {
|
|
90
|
-
case
|
|
93
|
+
case BackendTypes.NESTJS:
|
|
91
94
|
return nestjsBackendRule(normalizedOptions);
|
|
92
95
|
}
|
|
93
|
-
return
|
|
96
|
+
return noop();
|
|
94
97
|
}
|
|
95
|
-
function
|
|
98
|
+
export default function (options) {
|
|
96
99
|
const normalizedOptions = NormalizeAccordionItemTableComponentOptions(options);
|
|
97
100
|
printOptions(normalizedOptions);
|
|
98
101
|
return () => {
|
|
99
|
-
return
|
|
102
|
+
return chain([
|
|
100
103
|
componentRule(normalizedOptions),
|
|
101
104
|
() => console.log(`Modify accordion item component for type table ...`),
|
|
102
105
|
tableComponentSchematicRule(normalizedOptions),
|
|
@@ -104,5 +107,4 @@ function default_1(options) {
|
|
|
104
107
|
]);
|
|
105
108
|
};
|
|
106
109
|
}
|
|
107
|
-
exports.default = default_1;
|
|
108
110
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/schematic/angular/src/schematics/accordion/item/accordion-item-table-component/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/schematic/angular/src/schematics/accordion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+1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
const accordion_item_component_1 = require("../../accordion-item-component");
|
|
13
|
-
function NormalizeAccordionItemTreeTableComponentOptions(options) {
|
|
14
|
-
const normalizedAccordionItemComponentOptions = (0, accordion_item_component_1.NormalizeAccordionItemStandaloneComponentOptions)(options);
|
|
1
|
+
import { strings } from '@angular-devkit/core';
|
|
2
|
+
import { chain, noop, } from '@angular-devkit/schematics';
|
|
3
|
+
import { BuildNestControllerName, buildOperationId, CoerceClassConstructor, CoerceComponentRule, CoerceGetChildrenOperation, CoerceGetRootOperation, CoerceImports, CoerceParameterDeclaration, CoerceTreeTableChildrenProxyRemoteMethodClass, CoerceTreeTableRootProxyRemoteMethodClass, } from '@rxap/schematics-ts-morph';
|
|
4
|
+
import { CoerceSuffix, ExecuteSchematic, } from '@rxap/schematics-utilities';
|
|
5
|
+
import { Scope, } from 'ts-morph';
|
|
6
|
+
import { PrintAngularOptions, } from '../../../../lib/angular-options';
|
|
7
|
+
import { BackendTypes } from '../../../../lib/backend-types';
|
|
8
|
+
import { NormalizeTreeTableOptions } from '../../../../lib/tree-table-options';
|
|
9
|
+
import { GetItemOptions, NormalizeAccordionItemStandaloneComponentOptions, } from '../../accordion-item-component';
|
|
10
|
+
export function NormalizeAccordionItemTreeTableComponentOptions(options) {
|
|
11
|
+
const normalizedAccordionItemComponentOptions = NormalizeAccordionItemStandaloneComponentOptions(options);
|
|
15
12
|
const { itemName } = normalizedAccordionItemComponentOptions;
|
|
16
|
-
return Object.seal(
|
|
13
|
+
return Object.seal({
|
|
14
|
+
...normalizedAccordionItemComponentOptions,
|
|
15
|
+
table: NormalizeTreeTableOptions(options.table, itemName),
|
|
16
|
+
});
|
|
17
17
|
}
|
|
18
|
-
exports.NormalizeAccordionItemTreeTableComponentOptions = NormalizeAccordionItemTreeTableComponentOptions;
|
|
19
18
|
function printOptions(options) {
|
|
20
|
-
|
|
19
|
+
PrintAngularOptions('accordion-item-tree-table-component', options);
|
|
21
20
|
}
|
|
22
21
|
function componentRule(normalizedOptions) {
|
|
23
22
|
const { componentName, project, feature, directory, shared, overwrite, itemName, } = normalizedOptions;
|
|
24
|
-
const templateOptions =
|
|
25
|
-
|
|
23
|
+
const templateOptions = {
|
|
24
|
+
...strings,
|
|
25
|
+
...normalizedOptions,
|
|
26
|
+
name: itemName,
|
|
27
|
+
...GetItemOptions(normalizedOptions),
|
|
28
|
+
};
|
|
29
|
+
return chain([
|
|
26
30
|
() => console.log(`Coerce accordion item component ...`),
|
|
27
|
-
|
|
31
|
+
CoerceComponentRule({
|
|
28
32
|
name: componentName,
|
|
29
33
|
project,
|
|
30
34
|
feature,
|
|
@@ -38,23 +42,22 @@ function componentRule(normalizedOptions) {
|
|
|
38
42
|
]);
|
|
39
43
|
}
|
|
40
44
|
function treeTableComponentSchematicRule(normalizedOptions) {
|
|
41
|
-
var _a, _b, _c;
|
|
42
45
|
const { directory, nestModule, itemName, project, feature, table, overwrite, backend, } = normalizedOptions;
|
|
43
|
-
const { hasSharedModifier } =
|
|
44
|
-
return
|
|
46
|
+
const { hasSharedModifier } = GetItemOptions(normalizedOptions);
|
|
47
|
+
return chain([
|
|
45
48
|
() => console.log(`Generate tree table component ...`),
|
|
46
|
-
|
|
49
|
+
ExecuteSchematic('tree-table-component', {
|
|
47
50
|
shared: hasSharedModifier,
|
|
48
51
|
name: itemName,
|
|
49
52
|
project,
|
|
50
53
|
feature,
|
|
51
54
|
directory: hasSharedModifier ? undefined : directory,
|
|
52
|
-
columnList:
|
|
53
|
-
actionList:
|
|
54
|
-
title: table
|
|
55
|
-
headerButton: table
|
|
55
|
+
columnList: table?.columnList ?? [],
|
|
56
|
+
actionList: table?.actionList ?? [],
|
|
57
|
+
title: table?.title,
|
|
58
|
+
headerButton: table?.headerButton,
|
|
56
59
|
nestModule: hasSharedModifier ? undefined : nestModule,
|
|
57
|
-
modifiers: ['without-title', ...
|
|
60
|
+
modifiers: ['without-title', ...table?.modifiers ?? []],
|
|
58
61
|
tableChildMethod: table.tableChildMethod,
|
|
59
62
|
tableRootMethod: table.tableRootMethod,
|
|
60
63
|
overwrite,
|
|
@@ -64,14 +67,14 @@ function treeTableComponentSchematicRule(normalizedOptions) {
|
|
|
64
67
|
}
|
|
65
68
|
function nestjsBackendRule(normalizedOptions) {
|
|
66
69
|
const { itemName, nestModule, directory, project, feature, shared, scope, } = normalizedOptions;
|
|
67
|
-
const { hasSharedModifier, } =
|
|
68
|
-
const controllerName =
|
|
69
|
-
controllerName:
|
|
70
|
+
const { hasSharedModifier, } = GetItemOptions(normalizedOptions);
|
|
71
|
+
const controllerName = BuildNestControllerName({
|
|
72
|
+
controllerName: CoerceSuffix(itemName, '-tree-table'),
|
|
70
73
|
nestModule: hasSharedModifier ? undefined : nestModule,
|
|
71
74
|
});
|
|
72
|
-
return
|
|
75
|
+
return chain([
|
|
73
76
|
() => console.log(`Modify the get root operation ...`),
|
|
74
|
-
|
|
77
|
+
CoerceGetRootOperation({
|
|
75
78
|
controllerName: itemName,
|
|
76
79
|
nestModule: hasSharedModifier ? undefined : nestModule,
|
|
77
80
|
project,
|
|
@@ -87,7 +90,7 @@ function nestjsBackendRule(normalizedOptions) {
|
|
|
87
90
|
skipCoerce: true,
|
|
88
91
|
}),
|
|
89
92
|
() => console.log(`Modify the get children operation ...`),
|
|
90
|
-
|
|
93
|
+
CoerceGetChildrenOperation({
|
|
91
94
|
controllerName: itemName,
|
|
92
95
|
nestModule: hasSharedModifier ? undefined : nestModule,
|
|
93
96
|
project,
|
|
@@ -103,23 +106,23 @@ function nestjsBackendRule(normalizedOptions) {
|
|
|
103
106
|
skipCoerce: true,
|
|
104
107
|
}),
|
|
105
108
|
() => console.log(`Modify the get root proxy method ...`),
|
|
106
|
-
|
|
109
|
+
CoerceTreeTableRootProxyRemoteMethodClass({
|
|
107
110
|
project,
|
|
108
111
|
feature,
|
|
109
112
|
shared,
|
|
110
113
|
directory,
|
|
111
114
|
scope,
|
|
112
|
-
getRootOperationId:
|
|
115
|
+
getRootOperationId: buildOperationId(normalizedOptions, 'get-root', controllerName),
|
|
113
116
|
tsMorphTransform: (project, sourceFile, classDeclaration) => {
|
|
114
|
-
|
|
117
|
+
CoerceImports(sourceFile, {
|
|
115
118
|
moduleSpecifier: '@angular/router',
|
|
116
119
|
namedImports: ['ActivatedRoute'],
|
|
117
120
|
});
|
|
118
|
-
const [constructorDeclaration] =
|
|
119
|
-
|
|
121
|
+
const [constructorDeclaration] = CoerceClassConstructor(classDeclaration);
|
|
122
|
+
CoerceParameterDeclaration(constructorDeclaration, 'route').set({
|
|
120
123
|
type: 'ActivatedRoute',
|
|
121
124
|
isReadonly: true,
|
|
122
|
-
scope:
|
|
125
|
+
scope: Scope.Private,
|
|
123
126
|
});
|
|
124
127
|
return {
|
|
125
128
|
statements: [
|
|
@@ -130,23 +133,23 @@ function nestjsBackendRule(normalizedOptions) {
|
|
|
130
133
|
},
|
|
131
134
|
}),
|
|
132
135
|
() => console.log(`Modify the get children proxy method ...`),
|
|
133
|
-
|
|
136
|
+
CoerceTreeTableChildrenProxyRemoteMethodClass({
|
|
134
137
|
project,
|
|
135
138
|
feature,
|
|
136
139
|
shared,
|
|
137
140
|
directory,
|
|
138
141
|
scope,
|
|
139
|
-
getChildrenOperationId:
|
|
142
|
+
getChildrenOperationId: buildOperationId(normalizedOptions, 'get-children', controllerName),
|
|
140
143
|
tsMorphTransform: (project, sourceFile, classDeclaration) => {
|
|
141
|
-
|
|
144
|
+
CoerceImports(sourceFile, {
|
|
142
145
|
moduleSpecifier: '@angular/router',
|
|
143
146
|
namedImports: ['ActivatedRoute'],
|
|
144
147
|
});
|
|
145
|
-
const [constructorDeclaration] =
|
|
146
|
-
|
|
148
|
+
const [constructorDeclaration] = CoerceClassConstructor(classDeclaration);
|
|
149
|
+
CoerceParameterDeclaration(constructorDeclaration, 'route').set({
|
|
147
150
|
type: 'ActivatedRoute',
|
|
148
151
|
isReadonly: true,
|
|
149
|
-
scope:
|
|
152
|
+
scope: Scope.Private,
|
|
150
153
|
});
|
|
151
154
|
return {
|
|
152
155
|
statements: [
|
|
@@ -161,16 +164,16 @@ function nestjsBackendRule(normalizedOptions) {
|
|
|
161
164
|
function backendRule(normalizedOptions) {
|
|
162
165
|
const { backend } = normalizedOptions;
|
|
163
166
|
switch (backend) {
|
|
164
|
-
case
|
|
167
|
+
case BackendTypes.NESTJS:
|
|
165
168
|
return nestjsBackendRule(normalizedOptions);
|
|
166
169
|
}
|
|
167
|
-
return
|
|
170
|
+
return noop();
|
|
168
171
|
}
|
|
169
|
-
function
|
|
172
|
+
export default function (options) {
|
|
170
173
|
const normalizedOptions = NormalizeAccordionItemTreeTableComponentOptions(options);
|
|
171
174
|
printOptions(normalizedOptions);
|
|
172
175
|
return () => {
|
|
173
|
-
return
|
|
176
|
+
return chain([
|
|
174
177
|
componentRule(normalizedOptions),
|
|
175
178
|
() => console.log(`Modify accordion item component for type tree table ...`),
|
|
176
179
|
treeTableComponentSchematicRule(normalizedOptions),
|
|
@@ -178,5 +181,4 @@ function default_1(options) {
|
|
|
178
181
|
]);
|
|
179
182
|
};
|
|
180
183
|
}
|
|
181
|
-
exports.default = default_1;
|
|
182
184
|
//# sourceMappingURL=index.js.map
|