@rxap/schematic-angular 16.1.0-dev.6 → 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 +6 -0
- package/README.md +1 -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 +31 -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 +121 -92
- 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.js +15 -20
- 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.js +15 -18
- package/src/schematics/form/control/input-form-control/index.js.map +1 -1
- package/src/schematics/form/control/select-form-control/index.js +41 -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 +56 -58
- package/src/schematics/form/control/table-select-form-control/index.js.map +1 -1
- package/src/schematics/form/form-component/index.js +62 -54
- package/src/schematics/form/form-component/index.js.map +1 -1
- package/src/schematics/form/form-control/index.js +22 -23
- package/src/schematics/form/form-control/index.js.map +1 -1
- package/src/schematics/form/form-definition/index.js +16 -18
- package/src/schematics/form/form-definition/index.js.map +1 -1
- package/src/schematics/table/action/dialog-table-action/index.js +30 -30
- package/src/schematics/table/action/dialog-table-action/index.js.map +1 -1
- package/src/schematics/table/action/form-table-action/index.js +67 -56
- package/src/schematics/table/action/form-table-action/index.js.map +1 -1
- package/src/schematics/table/action/navigation-table-action/index.js +17 -20
- package/src/schematics/table/action/navigation-table-action/index.js.map +1 -1
- package/src/schematics/table/action/operation-table-action/index.js +30 -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.js +36 -29
- package/src/schematics/table/header-button/form-table-header-button/index.js.map +1 -1
- package/src/schematics/table/header-button/navigation-table-header-button/index.js +21 -23
- package/src/schematics/table/header-button/navigation-table-header-button/index.js.map +1 -1
- package/src/schematics/table/table-action/index.js +22 -23
- package/src/schematics/table/table-action/index.js.map +1 -1
- package/src/schematics/table/table-component/index.js +92 -93
- package/src/schematics/table/table-component/index.js.map +1 -1
- package/src/schematics/table/table-header-button/index.js +20 -21
- package/src/schematics/table/table-header-button/index.js.map +1 -1
- 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,63 +1,67 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
const operation_table_action_1 = require("../operation-table-action");
|
|
15
|
-
function NormalizeFormTableActionOptions(options) {
|
|
16
|
-
var _a, _b, _c;
|
|
17
|
-
const normalizedOptions = (0, operation_table_action_1.NormalizeOperationTableActionOptions)(options);
|
|
1
|
+
import { chain, noop, } from '@angular-devkit/schematics';
|
|
2
|
+
import { AddComponentProvider, BuildNestControllerName, buildOperationId, CoerceComponentRule, CoerceDtoClass, CoerceFormSubmitOperation, CoerceFormTableActionRule, CoerceImports, CoerceOperation, OperationIdToResponseClassImportPath, OperationIdToResponseClassName, TsMorphAngularProjectTransformRule, } from '@rxap/schematics-ts-morph';
|
|
3
|
+
import { ExecuteSchematic } from '@rxap/schematics-utilities';
|
|
4
|
+
import { classify, CoerceSuffix, dasherize, } from '@rxap/utilities';
|
|
5
|
+
import { join } from 'path';
|
|
6
|
+
import { PrintAngularOptions } from '../../../../lib/angular-options';
|
|
7
|
+
import { AssertTableComponentExists } from '../../../../lib/assert-table-component-exists';
|
|
8
|
+
import { BackendTypes } from '../../../../lib/backend-types';
|
|
9
|
+
import { NormalizeFormComponentControlList, } from '../../../../lib/form-component-control';
|
|
10
|
+
import { FormComponentControlToDtoClassProperty } from '../../../form/form-component/index';
|
|
11
|
+
import { NormalizeOperationTableActionOptions, } from '../operation-table-action';
|
|
12
|
+
export function NormalizeFormTableActionOptions(options) {
|
|
13
|
+
const normalizedOptions = NormalizeOperationTableActionOptions(options);
|
|
18
14
|
const { controllerName, type, nestModule, } = normalizedOptions;
|
|
19
|
-
return
|
|
15
|
+
return {
|
|
16
|
+
...normalizedOptions,
|
|
17
|
+
controllerName: BuildNestControllerName({
|
|
20
18
|
nestModule,
|
|
21
19
|
controllerName: [type, 'action'].join('-'),
|
|
22
|
-
}),
|
|
20
|
+
}),
|
|
21
|
+
options: {
|
|
22
|
+
...normalizedOptions.options ?? {},
|
|
23
|
+
controlList: NormalizeFormComponentControlList(normalizedOptions.options?.['controlList'] ?? []),
|
|
24
|
+
},
|
|
25
|
+
};
|
|
23
26
|
}
|
|
24
|
-
|
|
25
|
-
function CoerceTypeAlias(sourceFile, name, structure) {
|
|
27
|
+
export function CoerceTypeAlias(sourceFile, name, structure) {
|
|
26
28
|
let typeAliasDeclaration = sourceFile.getTypeAlias(name);
|
|
27
29
|
if (!typeAliasDeclaration) {
|
|
28
|
-
typeAliasDeclaration = sourceFile.addTypeAlias(
|
|
30
|
+
typeAliasDeclaration = sourceFile.addTypeAlias({
|
|
31
|
+
...structure,
|
|
32
|
+
name,
|
|
33
|
+
});
|
|
29
34
|
}
|
|
30
35
|
return typeAliasDeclaration;
|
|
31
36
|
}
|
|
32
|
-
exports.CoerceTypeAlias = CoerceTypeAlias;
|
|
33
37
|
function UseOperationResponseAsFormTypeRule(options) {
|
|
34
38
|
const { name, operationId, scope, } = options;
|
|
35
|
-
const className =
|
|
39
|
+
const className = CoerceSuffix(classify(name), 'Form');
|
|
36
40
|
const interfaceName = `I${className}`;
|
|
37
|
-
return
|
|
41
|
+
return TsMorphAngularProjectTransformRule(options, (project, [sourceFile]) => {
|
|
38
42
|
const interfaceDeclaration = sourceFile.getInterface(interfaceName);
|
|
39
43
|
if (interfaceDeclaration) {
|
|
40
44
|
interfaceDeclaration.remove();
|
|
41
45
|
}
|
|
42
46
|
CoerceTypeAlias(sourceFile, interfaceName, {
|
|
43
|
-
type:
|
|
47
|
+
type: OperationIdToResponseClassName(operationId),
|
|
44
48
|
isExported: true,
|
|
45
|
-
}).set({ type:
|
|
46
|
-
|
|
47
|
-
namedImports: [
|
|
48
|
-
moduleSpecifier:
|
|
49
|
+
}).set({ type: OperationIdToResponseClassName(operationId) });
|
|
50
|
+
CoerceImports(sourceFile, {
|
|
51
|
+
namedImports: [OperationIdToResponseClassName(operationId)],
|
|
52
|
+
moduleSpecifier: OperationIdToResponseClassImportPath(operationId, scope),
|
|
49
53
|
});
|
|
50
|
-
}, ['/' +
|
|
54
|
+
}, ['/' + CoerceSuffix(name, '.form.ts')]);
|
|
51
55
|
}
|
|
52
56
|
function nestjsBackendRule(normalizedOptions) {
|
|
53
57
|
const { project, feature, shared, directory, nestModule, type, context, controllerName, scope, } = normalizedOptions;
|
|
54
58
|
if (!nestModule) {
|
|
55
59
|
throw new Error('The nest module is required');
|
|
56
60
|
}
|
|
57
|
-
const controllerPath = `${
|
|
58
|
-
return
|
|
61
|
+
const controllerPath = `${dasherize(nestModule)}/action/:rowId/${type}`;
|
|
62
|
+
return chain([
|
|
59
63
|
() => console.log('Coerce form get table action operation'),
|
|
60
|
-
|
|
64
|
+
CoerceOperation({
|
|
61
65
|
controllerName,
|
|
62
66
|
nestModule,
|
|
63
67
|
project,
|
|
@@ -67,12 +71,12 @@ function nestjsBackendRule(normalizedOptions) {
|
|
|
67
71
|
operationName: `get`,
|
|
68
72
|
controllerPath,
|
|
69
73
|
tsMorphTransform: (project, sourceFile) => {
|
|
70
|
-
const { className, filePath, } =
|
|
74
|
+
const { className, filePath, } = CoerceDtoClass({
|
|
71
75
|
project,
|
|
72
76
|
name: controllerName,
|
|
73
|
-
propertyList: normalizedOptions.options.controlList.map(control =>
|
|
77
|
+
propertyList: normalizedOptions.options.controlList.map(control => FormComponentControlToDtoClassProperty(control)),
|
|
74
78
|
});
|
|
75
|
-
|
|
79
|
+
CoerceImports(sourceFile, {
|
|
76
80
|
namedImports: [className],
|
|
77
81
|
moduleSpecifier: filePath,
|
|
78
82
|
});
|
|
@@ -88,7 +92,7 @@ function nestjsBackendRule(normalizedOptions) {
|
|
|
88
92
|
},
|
|
89
93
|
}),
|
|
90
94
|
() => console.log('Coerce form submit table action operation'),
|
|
91
|
-
|
|
95
|
+
CoerceFormSubmitOperation({
|
|
92
96
|
controllerName,
|
|
93
97
|
project,
|
|
94
98
|
feature,
|
|
@@ -109,7 +113,7 @@ function nestjsBackendRule(normalizedOptions) {
|
|
|
109
113
|
scope,
|
|
110
114
|
project,
|
|
111
115
|
feature,
|
|
112
|
-
directory:
|
|
116
|
+
directory: join(directory ?? '', CoerceSuffix(type, '-form')),
|
|
113
117
|
name: type,
|
|
114
118
|
operationId: buildGetOperationId(normalizedOptions),
|
|
115
119
|
}),
|
|
@@ -118,31 +122,31 @@ function nestjsBackendRule(normalizedOptions) {
|
|
|
118
122
|
function backendRule(normalizedOptions) {
|
|
119
123
|
const { backend } = normalizedOptions;
|
|
120
124
|
switch (backend) {
|
|
121
|
-
case
|
|
125
|
+
case BackendTypes.NESTJS:
|
|
122
126
|
return nestjsBackendRule(normalizedOptions);
|
|
123
127
|
}
|
|
124
|
-
return
|
|
128
|
+
return noop();
|
|
125
129
|
}
|
|
126
130
|
function printOptions(options) {
|
|
127
|
-
|
|
131
|
+
PrintAngularOptions('form-table-action', options);
|
|
128
132
|
}
|
|
129
133
|
function buildGetOperationId(normalizedOptions) {
|
|
130
134
|
const { controllerName, } = normalizedOptions;
|
|
131
|
-
return
|
|
135
|
+
return buildOperationId(normalizedOptions, `get`, controllerName);
|
|
132
136
|
}
|
|
133
|
-
function
|
|
137
|
+
export default function (options) {
|
|
134
138
|
const normalizedOptions = NormalizeFormTableActionOptions(options);
|
|
135
139
|
const { refresh, confirm, tooltip, errorMessage, successMessage, priority, checkFunction, tableName, project, feature, shared, directory, nestModule, type, context, controllerName, overwrite, scope, options: formOptions, backend, } = normalizedOptions;
|
|
136
140
|
printOptions(normalizedOptions);
|
|
137
141
|
return (host) => {
|
|
138
|
-
|
|
139
|
-
return
|
|
142
|
+
AssertTableComponentExists(host, normalizedOptions);
|
|
143
|
+
return chain([
|
|
140
144
|
() => console.group('\x1b[32m[@rxap/schematics-angular:form-table-action]\x1b[0m'),
|
|
141
145
|
() => console.info(`Generating form table action rule...`),
|
|
142
|
-
|
|
146
|
+
CoerceFormTableActionRule({
|
|
143
147
|
scope,
|
|
144
|
-
directory:
|
|
145
|
-
loadOperationId: backend ===
|
|
148
|
+
directory: join(directory ?? '', 'methods', 'action'),
|
|
149
|
+
loadOperationId: backend === BackendTypes.NESTJS ? buildGetOperationId(normalizedOptions) : undefined,
|
|
146
150
|
type,
|
|
147
151
|
tableName,
|
|
148
152
|
refresh,
|
|
@@ -156,7 +160,7 @@ function default_1(options) {
|
|
|
156
160
|
feature,
|
|
157
161
|
}),
|
|
158
162
|
() => console.log('Coerce open form window method to table component ...'),
|
|
159
|
-
|
|
163
|
+
CoerceComponentRule({
|
|
160
164
|
project,
|
|
161
165
|
feature,
|
|
162
166
|
shared,
|
|
@@ -164,27 +168,34 @@ function default_1(options) {
|
|
|
164
168
|
directory,
|
|
165
169
|
overwrite,
|
|
166
170
|
tsMorphTransform: (project, [sourceFile]) => {
|
|
167
|
-
|
|
171
|
+
AddComponentProvider(sourceFile, `Open${classify(type)}FormWindowMethod`, [
|
|
168
172
|
{
|
|
169
173
|
moduleSpecifier: `./${type}-form/open-${type}-form-window.method`,
|
|
170
|
-
namedImports: [`Open${
|
|
174
|
+
namedImports: [`Open${classify(type)}FormWindowMethod`],
|
|
171
175
|
},
|
|
172
176
|
]);
|
|
173
177
|
},
|
|
174
178
|
}),
|
|
175
179
|
() => console.info(`Generating form component...`),
|
|
176
|
-
|
|
180
|
+
ExecuteSchematic('form-component', {
|
|
181
|
+
...formOptions ?? {},
|
|
182
|
+
project,
|
|
183
|
+
name: type,
|
|
184
|
+
feature,
|
|
177
185
|
directory,
|
|
178
|
-
shared,
|
|
186
|
+
shared,
|
|
187
|
+
window: true,
|
|
188
|
+
role: type,
|
|
189
|
+
nestModule,
|
|
179
190
|
controllerName,
|
|
180
191
|
overwrite,
|
|
181
192
|
context,
|
|
182
|
-
backend
|
|
193
|
+
backend,
|
|
194
|
+
}),
|
|
183
195
|
() => console.info(`Generating backend...`),
|
|
184
196
|
backendRule(normalizedOptions),
|
|
185
197
|
() => console.groupEnd(),
|
|
186
198
|
]);
|
|
187
199
|
};
|
|
188
200
|
}
|
|
189
|
-
exports.default = default_1;
|
|
190
201
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/schematic/angular/src/schematics/table/action/form-table-action/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/schematic/angular/src/schematics/table/action/form-table-action/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,IAAI,GAGL,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EACd,yBAAyB,EACzB,yBAAyB,EACzB,aAAa,EACb,eAAe,EACf,oCAAoC,EACpC,8BAA8B,EAE9B,kCAAkC,GACnC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,gBAA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AAS;gBACT,MAAM;gBACN,MAAM,EAAE,IAAI;gBACZ,IAAI,EAAE,IAAI;gBACV,UAAU;gBACV,cAAc;gBACd,SAAS;gBACT,OAAO;gBACP,OAAO;aACR,CAAC;YACF,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,uBAAuB,CAAC;YAC3C,WAAW,CAAC,iBAAiB,CAAC;YAC9B,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE;SACzB,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,30 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return Object.assign(Object.assign({}, (0, operation_table_action_1.NormalizeOperationTableActionOptions)(options)), { route: (_a = options.route) !== null && _a !== void 0 ? _a : null });
|
|
1
|
+
import { chain, } from '@angular-devkit/schematics';
|
|
2
|
+
import { CoerceNavigationTableActionRule } from '@rxap/schematics-ts-morph';
|
|
3
|
+
import { join } from 'path';
|
|
4
|
+
import { PrintAngularOptions } from '../../../../lib/angular-options';
|
|
5
|
+
import { AssertTableComponentExists } from '../../../../lib/assert-table-component-exists';
|
|
6
|
+
import { NormalizeOperationTableActionOptions, } from '../operation-table-action';
|
|
7
|
+
export function NormalizeNavigationTableActionOptions(options) {
|
|
8
|
+
return {
|
|
9
|
+
...NormalizeOperationTableActionOptions(options),
|
|
10
|
+
route: options.route ?? null,
|
|
11
|
+
};
|
|
13
12
|
}
|
|
14
|
-
exports.NormalizeNavigationTableActionOptions = NormalizeNavigationTableActionOptions;
|
|
15
13
|
function printOptions(options) {
|
|
16
|
-
|
|
14
|
+
PrintAngularOptions('navigation-table-action', options);
|
|
17
15
|
}
|
|
18
|
-
function
|
|
16
|
+
export default function (options) {
|
|
19
17
|
const normalizedOptions = NormalizeNavigationTableActionOptions(options);
|
|
20
18
|
const { refresh, confirm, tooltip, errorMessage, successMessage, priority, checkFunction, tableName, project, feature, shared, directory, type, route, } = normalizedOptions;
|
|
21
19
|
printOptions(normalizedOptions);
|
|
22
20
|
return (host) => {
|
|
23
|
-
|
|
24
|
-
return
|
|
21
|
+
AssertTableComponentExists(host, normalizedOptions);
|
|
22
|
+
return chain([
|
|
25
23
|
() => console.group('\x1b[32m[@rxap/schematics-angular:navigation-table-action]\x1b[0m'),
|
|
26
|
-
|
|
27
|
-
directory:
|
|
24
|
+
CoerceNavigationTableActionRule({
|
|
25
|
+
directory: join(directory ?? '', 'methods', 'action'),
|
|
28
26
|
type,
|
|
29
27
|
tableName,
|
|
30
28
|
refresh,
|
|
@@ -42,5 +40,4 @@ function default_1(options) {
|
|
|
42
40
|
]);
|
|
43
41
|
};
|
|
44
42
|
}
|
|
45
|
-
exports.default = default_1;
|
|
46
43
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/schematic/angular/src/schematics/table/action/navigation-table-action/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/schematic/angular/src/schematics/table/action/navigation-table-action/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,GAEN,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,+BAA+B,EAAE,MAAM,2BAA2B,CAAC;AAE5E,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AAC3F,OAAO,EAEL,oCAAoC,GACrC,MAAM,2BAA2B,CAAC;AAMnC,MAAM,UAAU,qCAAqC,CACnD,OAAqC;IAErC,OAAO;QACL,GAAG,oCAAoC,CAAC,OAAO,CAAC;QAChD,KAAK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
-
|
|
16
|
-
|
|
17
|
-
return Object.seal(Object.assign(Object.assign({}, normalizedOptions), { nestModule, controllerName: (0, schematics_ts_morph_1.BuildNestControllerName)({
|
|
1
|
+
import { chain, noop, } from '@angular-devkit/schematics';
|
|
2
|
+
import { BuildNestControllerName, buildOperationId, CoerceOperation, CoerceOperationTableActionRule, } from '@rxap/schematics-ts-morph';
|
|
3
|
+
import { dasherize, } from '@rxap/utilities';
|
|
4
|
+
import { join } from 'path';
|
|
5
|
+
import { PrintAngularOptions, } from '../../../../lib/angular-options';
|
|
6
|
+
import { AssertTableComponentExists } from '../../../../lib/assert-table-component-exists';
|
|
7
|
+
import { BackendTypes } from '../../../../lib/backend-types';
|
|
8
|
+
import { NormalizeTableActionOptions } from '../../table-action';
|
|
9
|
+
export function NormalizeOperationTableActionOptions(options) {
|
|
10
|
+
const normalizedOptions = NormalizeTableActionOptions(options);
|
|
11
|
+
const nestModule = options.nestModule ?? normalizedOptions.tableName;
|
|
12
|
+
const context = options.context ? dasherize(options.context) : null;
|
|
13
|
+
return Object.seal({
|
|
14
|
+
...normalizedOptions,
|
|
15
|
+
nestModule,
|
|
16
|
+
controllerName: BuildNestControllerName({
|
|
18
17
|
controllerName: context,
|
|
19
18
|
nestModule,
|
|
20
|
-
}),
|
|
19
|
+
}),
|
|
20
|
+
context,
|
|
21
|
+
});
|
|
21
22
|
}
|
|
22
|
-
exports.NormalizeOperationTableActionOptions = NormalizeOperationTableActionOptions;
|
|
23
23
|
function openApiOperationRule(normalizedOptions) {
|
|
24
24
|
const { refresh, confirm, tooltip, errorMessage, successMessage, priority, checkFunction, tableName, project, feature, shared, directory, nestModule, controllerName, type, scope, } = normalizedOptions;
|
|
25
|
-
return
|
|
25
|
+
return chain([
|
|
26
26
|
() => console.log('Coerce table action method class ...'),
|
|
27
|
-
|
|
27
|
+
CoerceOperationTableActionRule({
|
|
28
28
|
scope,
|
|
29
|
-
directory:
|
|
30
|
-
operationId:
|
|
29
|
+
directory: join(directory ?? '', 'methods', 'action'),
|
|
30
|
+
operationId: buildOperationId(normalizedOptions, `${type}-action`, controllerName),
|
|
31
31
|
type,
|
|
32
32
|
tableName,
|
|
33
33
|
refresh,
|
|
@@ -41,7 +41,7 @@ function openApiOperationRule(normalizedOptions) {
|
|
|
41
41
|
feature,
|
|
42
42
|
}),
|
|
43
43
|
() => console.log('Coerce table action method operation ...'),
|
|
44
|
-
|
|
44
|
+
CoerceOperation({
|
|
45
45
|
controllerName,
|
|
46
46
|
nestModule,
|
|
47
47
|
project,
|
|
@@ -62,25 +62,24 @@ function openApiOperationRule(normalizedOptions) {
|
|
|
62
62
|
function backendRule(normalizedOptions) {
|
|
63
63
|
const { backend, } = normalizedOptions;
|
|
64
64
|
switch (backend) {
|
|
65
|
-
case
|
|
65
|
+
case BackendTypes.NESTJS:
|
|
66
66
|
return openApiOperationRule(normalizedOptions);
|
|
67
67
|
}
|
|
68
|
-
return
|
|
68
|
+
return noop();
|
|
69
69
|
}
|
|
70
70
|
function printOptions(options) {
|
|
71
|
-
|
|
71
|
+
PrintAngularOptions('operation-table-action', options);
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
export default function (options) {
|
|
74
74
|
const normalizedOptions = NormalizeOperationTableActionOptions(options);
|
|
75
75
|
printOptions(normalizedOptions);
|
|
76
76
|
return (host) => {
|
|
77
|
-
|
|
78
|
-
return
|
|
77
|
+
AssertTableComponentExists(host, normalizedOptions);
|
|
78
|
+
return chain([
|
|
79
79
|
() => console.group('\x1b[32m[@rxap/schematics-angular:operation-table-action]\x1b[0m'),
|
|
80
80
|
backendRule(normalizedOptions),
|
|
81
81
|
() => console.groupEnd(),
|
|
82
82
|
]);
|
|
83
83
|
};
|
|
84
84
|
}
|
|
85
|
-
exports.default = default_1;
|
|
86
85
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/schematic/angular/src/schematics/table/action/operation-table-action/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/schematic/angular/src/schematics/table/action/operation-table-action/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,IAAI,GAEL,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,uBAAuB,EACvB,gBAAgB,EAChB,eAAe,EACf,8BAA8B,GAC/B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,SAAS,GAEV,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAEL,mBAAmB,GACpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AAC3F,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AAQjE,MAAM,UAAU,oCAAoC,CAClD,OAAoC;IAEpC,MAAM,iBAAiB,GAAG,2BAA2B,CAAC,OAAO,CAAC,CAAC;IAC/D,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,iBAAiB,CAAC,SAAS,CAAC;IACrE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACpE,OAAO,MAAM,CAAC,IAAI,CAAC;QACjB,GAAG,iBAAiB;QACpB,UAAU;QACV,cAAc,EAAE,uBAAuB,CAAC;YACtC,cAAc,EAAE,OAAO;YACvB,UAAU;SACX,CAAC;QACF,OAAO;KACR,CAAC,CAAC;AACL,CAAC;AAED,SAAS,oBAAoB,CAAC,iBAAwD;IAEpF,MAAM,EACJ,OAAO,EACP,OAAO,EACP,OAAO,EACP,YAAY,EACZ,cAAc,EACd,QAAQ,EACR,aAAa,EACb,SAAS,EACT,OAAO,EACP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BAAwB,EAAE,OAAO,CAAC,CAAC;AACzD,CAAC;AAED,MAAM,CAAC,OAAO,WAAW,OAAoC;IAC3D,MAAM,iBAAiB,GAAG,oCAAoC,CAAC,OAAO,CAAC,CAAC;IAExE,YAAY,CAAC,iBAAiB,CAAC,CAAC;IAEhC,OAAO,CAAC,IAAU,EAAE,EAAE;QAEpB,0BAA0B,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;QAEpD,OAAO,KAAK,CAAC;YACX,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,kEAAkE,CAAC;YACvF,WAAW,CAAC,iBAAiB,CAAC;YAC9B,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE;SACzB,CAAC,CAAC;IAEL,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,43 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
const index_1 = require("../../table-header-button/index");
|
|
11
|
-
function NormalizeFormTableHeaderButtonOptions(options) {
|
|
12
|
-
const normalizedTableHeaderButtonOptions = (0, index_1.NormalizeTableHeaderButtonOptions)(options);
|
|
1
|
+
import { chain, } from '@angular-devkit/schematics';
|
|
2
|
+
import { AddComponentProvider, BuildNestControllerName, CoerceClassConstructor, CoerceImports, CoerceParameterDeclaration, CoerceTableHeaderButtonMethodRule, } from '@rxap/schematics-ts-morph';
|
|
3
|
+
import { ExecuteSchematic } from '@rxap/schematics-utilities';
|
|
4
|
+
import { Scope, } from 'ts-morph';
|
|
5
|
+
import { PrintAngularOptions, } from '../../../../lib/angular-options';
|
|
6
|
+
import { AssertTableComponentExists } from '../../../../lib/assert-table-component-exists';
|
|
7
|
+
import { NormalizeTableHeaderButtonOptions } from '../../table-header-button/index';
|
|
8
|
+
export function NormalizeFormTableHeaderButtonOptions(options) {
|
|
9
|
+
const normalizedTableHeaderButtonOptions = NormalizeTableHeaderButtonOptions(options);
|
|
13
10
|
const nestModule = options.nestModule;
|
|
14
|
-
return Object.seal(
|
|
11
|
+
return Object.seal({
|
|
12
|
+
...normalizedTableHeaderButtonOptions,
|
|
13
|
+
context: options.context,
|
|
14
|
+
nestModule,
|
|
15
|
+
controllerName: BuildNestControllerName({
|
|
15
16
|
nestModule,
|
|
16
17
|
controllerName: 'header-button',
|
|
17
|
-
})
|
|
18
|
+
}),
|
|
19
|
+
});
|
|
18
20
|
}
|
|
19
|
-
exports.NormalizeFormTableHeaderButtonOptions = NormalizeFormTableHeaderButtonOptions;
|
|
20
21
|
function printOptions(options) {
|
|
21
|
-
|
|
22
|
+
PrintAngularOptions('form-table-header-button', options);
|
|
22
23
|
}
|
|
23
|
-
function
|
|
24
|
+
export default function (options) {
|
|
24
25
|
const normalizedOptions = NormalizeFormTableHeaderButtonOptions(options);
|
|
25
26
|
const { refresh, confirm, tooltip, errorMessage, successMessage, tableName, project, feature, shared, directory, overwrite, options: formOptions, context, backend, nestModule, controllerName, } = normalizedOptions;
|
|
26
27
|
printOptions(normalizedOptions);
|
|
27
28
|
return (host) => {
|
|
28
|
-
|
|
29
|
-
return
|
|
29
|
+
AssertTableComponentExists(host, normalizedOptions);
|
|
30
|
+
return chain([
|
|
30
31
|
() => console.group('\x1b[32m[@rxap/schematics-angular:form-table-header-button]\x1b[0m'),
|
|
31
32
|
() => console.log('Coerce table header button form ...'),
|
|
32
|
-
|
|
33
|
+
ExecuteSchematic('form-component', {
|
|
34
|
+
...formOptions,
|
|
35
|
+
project,
|
|
36
|
+
name: `table-header-button`,
|
|
37
|
+
feature,
|
|
33
38
|
directory,
|
|
34
|
-
shared,
|
|
39
|
+
shared,
|
|
40
|
+
window: true,
|
|
41
|
+
nestModule,
|
|
35
42
|
controllerName,
|
|
36
43
|
context,
|
|
37
44
|
backend,
|
|
38
|
-
overwrite
|
|
45
|
+
overwrite,
|
|
46
|
+
}),
|
|
39
47
|
() => console.log('Coerce table header button method ...'),
|
|
40
|
-
|
|
48
|
+
CoerceTableHeaderButtonMethodRule({
|
|
41
49
|
project,
|
|
42
50
|
feature,
|
|
43
51
|
shared,
|
|
@@ -50,13 +58,13 @@ function default_1(options) {
|
|
|
50
58
|
errorMessage,
|
|
51
59
|
successMessage,
|
|
52
60
|
tsMorphTransform: (project, sourceFile, classDeclaration) => {
|
|
53
|
-
const [constructorDeclaration] =
|
|
54
|
-
|
|
61
|
+
const [constructorDeclaration] = CoerceClassConstructor(classDeclaration);
|
|
62
|
+
CoerceParameterDeclaration(constructorDeclaration, 'openWindowMethod', {
|
|
55
63
|
isReadonly: true,
|
|
56
|
-
scope:
|
|
64
|
+
scope: Scope.Private,
|
|
57
65
|
type: 'OpenTableHeaderButtonFormWindowMethod',
|
|
58
66
|
});
|
|
59
|
-
|
|
67
|
+
CoerceImports(sourceFile, [
|
|
60
68
|
{
|
|
61
69
|
moduleSpecifier: '../table-header-button-form/open-table-header-button-form-window.method',
|
|
62
70
|
namedImports: ['OpenTableHeaderButtonFormWindowMethod'],
|
|
@@ -67,7 +75,7 @@ function default_1(options) {
|
|
|
67
75
|
};
|
|
68
76
|
},
|
|
69
77
|
tsMorphTransformComponent: (project, [sourceFile]) => {
|
|
70
|
-
|
|
78
|
+
AddComponentProvider(sourceFile, 'OpenTableHeaderButtonFormWindowMethod', [
|
|
71
79
|
{
|
|
72
80
|
moduleSpecifier: './table-header-button-form/open-table-header-button-form-window.method',
|
|
73
81
|
namedImports: ['OpenTableHeaderButtonFormWindowMethod'],
|
|
@@ -79,5 +87,4 @@ function default_1(options) {
|
|
|
79
87
|
]);
|
|
80
88
|
};
|
|
81
89
|
}
|
|
82
|
-
exports.default = default_1;
|
|
83
90
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/schematic/angular/src/schematics/table/header-button/form-table-header-button/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/schematic/angular/src/schematics/table/header-button/form-table-header-button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,GAEN,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,sBAAsB,EACtB,aAAa,EACb,0BAA0B,EAC1B,iCAAiC,GAClC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9D,OAAO,EAEL,KAAK,GAEN,MAAM,UAAU,CAAC;AAClB,OAAO,EAEL,mBAAmB,GACpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AAE3F,OAAO,EAAE,iCAAiC,EAAE,MAAM,iCAAiC,CAAC;AASpF,MAAM,UAAU,qCAAqC,CACnD,OAA+C;IAE/C,MAAM,kCAAkC,GAAG,iCAAiC,CAAC,OAAO,CAAC,CAAC;IACtF,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IACtC,OAAO,MAAM,CAAC,IAAI,CAAC;QACjB,GAAG,kCAAkC;QACrC,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,UAAU;QACV,cAAc,EAAE,uBAAuB,CAAC;YACtC,UAAU;YACV,cAAc,EAAE,eAAe;SAChC,CAAC;KACH,CAAC,CAAC;AACL,CAAC;AAED,SAAS,YAAY,CAAC,OAA+C;IACnE,mBAAmB,CAAC,0BAA0B,EAAE,OAAO,CAAC,CAAC;AAC3D,CAAC;AAED,MAAM,CAAC,OAAO,WAAW,OAAqC;IAC5D,MAAM,iBAAiB,GAAG,qCAAqC,CAAC,OAAO,CAAC,CAAC;IACzE,MAAM,EACJ,OAAO,EACP,OAAO,EACP,OAAO,EACP,YAAY,EACZ,cAAc,EACd,SAAS,EACT,OAAO,EACP,OAAO,EACP,MAAM,EACN,SAAS,EACT,SAAS,EACT,OAAO,EAAE,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