@rxap/schematic-angular 16.1.0-dev.7 → 16.1.0-dev.9
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 +12 -0
- package/README.md +1 -1
- package/package.json +14 -13
- package/src/lib/accordion-item.js +19 -17
- package/src/lib/accordion-item.js.map +1 -1
- package/src/lib/accordion-itme-types.js +7 -3
- package/src/lib/accordion-itme-types.js.map +1 -1
- package/src/lib/adapter-options.js +6 -2
- package/src/lib/adapter-options.js.map +1 -1
- package/src/lib/angular-options.js +22 -31
- package/src/lib/angular-options.js.map +1 -1
- package/src/lib/assert-table-component-exists.js +9 -5
- package/src/lib/assert-table-component-exists.js.map +1 -1
- package/src/lib/backend-types.js +5 -2
- package/src/lib/backend-types.js.map +1 -1
- package/src/lib/data-grid-item.js +12 -5
- package/src/lib/data-grid-item.js.map +1 -1
- package/src/lib/data-grid-options.js +13 -8
- package/src/lib/data-grid-options.js.map +1 -1
- package/src/lib/dialog-action.js +14 -7
- package/src/lib/dialog-action.js.map +1 -1
- package/src/lib/existing-method.js +5 -1
- package/src/lib/existing-method.js.map +1 -1
- package/src/lib/form-component-control.js +16 -9
- package/src/lib/form-component-control.js.map +1 -1
- package/src/lib/form-definition-control.js +17 -9
- package/src/lib/form-definition-control.js.map +1 -1
- package/src/lib/minimum-table-component-options.js +92 -121
- package/src/lib/minimum-table-component-options.js.map +1 -1
- package/src/lib/minimum-table-options.js +17 -12
- package/src/lib/minimum-table-options.js.map +1 -1
- package/src/lib/table-action.js +37 -33
- package/src/lib/table-action.js.map +1 -1
- package/src/lib/table-column.js +27 -20
- package/src/lib/table-column.js.map +1 -1
- package/src/lib/table-header-button.js +20 -15
- package/src/lib/table-header-button.js.map +1 -1
- package/src/lib/table-open-api-options.js +8 -4
- package/src/lib/table-open-api-options.js.map +1 -1
- package/src/lib/table-options.js +15 -13
- package/src/lib/table-options.js.map +1 -1
- package/src/lib/table-row-action.js +18 -13
- package/src/lib/table-row-action.js.map +1 -1
- package/src/lib/to-title.js +8 -4
- package/src/lib/to-title.js.map +1 -1
- package/src/lib/tree-table-options.js +13 -11
- package/src/lib/tree-table-options.js.map +1 -1
- package/src/schematics/accordion/accordion-component/index.js +105 -125
- package/src/schematics/accordion/accordion-component/index.js.map +1 -1
- package/src/schematics/accordion/accordion-item-component/index.js +107 -119
- package/src/schematics/accordion/accordion-item-component/index.js.map +1 -1
- package/src/schematics/accordion/item/accordion-item-data-grid-component/index.js +54 -55
- 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 +36 -38
- 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 +52 -54
- package/src/schematics/accordion/item/accordion-item-tree-table-component/index.js.map +1 -1
- package/src/schematics/data-grid-component/index.js +81 -87
- package/src/schematics/data-grid-component/index.js.map +1 -1
- package/src/schematics/dialog-component/index.js +20 -21
- package/src/schematics/dialog-component/index.js.map +1 -1
- package/src/schematics/form/control/input-form-control/index.js +18 -15
- package/src/schematics/form/control/input-form-control/index.js.map +1 -1
- package/src/schematics/form/control/select-form-control/index.js +43 -41
- 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 -56
- package/src/schematics/form/control/table-select-form-control/index.js.map +1 -1
- package/src/schematics/form/form-component/index.js +54 -62
- package/src/schematics/form/form-component/index.js.map +1 -1
- package/src/schematics/form/form-control/index.js +23 -22
- package/src/schematics/form/form-control/index.js.map +1 -1
- package/src/schematics/form/form-definition/index.js +18 -16
- 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 +56 -67
- package/src/schematics/table/action/form-table-action/index.js.map +1 -1
- package/src/schematics/table/action/navigation-table-action/index.js +20 -17
- package/src/schematics/table/action/navigation-table-action/index.js.map +1 -1
- package/src/schematics/table/action/operation-table-action/index.js +31 -30
- 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 +29 -36
- 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 +23 -21
- package/src/schematics/table/header-button/navigation-table-header-button/index.js.map +1 -1
- package/src/schematics/table/table-action/index.js +23 -22
- package/src/schematics/table/table-action/index.js.map +1 -1
- package/src/schematics/table/table-component/index.js +93 -92
- package/src/schematics/table/table-component/index.js.map +1 -1
- package/src/schematics/table/table-header-button/index.js +21 -20
- package/src/schematics/table/table-header-button/index.js.map +1 -1
- package/src/schematics/table/tree-table-component/index.js +63 -66
- 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,61 +1,56 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FormComponentControlToDtoClassProperty = exports.NormalizeFormComponentOptions = 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 angular_options_1 = require("../../../lib/angular-options");
|
|
11
|
+
const backend_types_1 = require("../../../lib/backend-types");
|
|
12
|
+
const form_component_control_1 = require("../../../lib/form-component-control");
|
|
13
|
+
function NormalizeFormComponentOptions(options) {
|
|
14
|
+
var _a, _b, _c, _d;
|
|
15
|
+
const normalizedAngularOptions = (0, angular_options_1.NormalizeAngularOptions)(options);
|
|
16
|
+
(0, angular_options_1.AssertAngularOptionsNameProperty)(normalizedAngularOptions);
|
|
13
17
|
const { name, } = normalizedAngularOptions;
|
|
14
|
-
const componentName = CoerceSuffix(name, '-form');
|
|
15
|
-
const controllerName = options.controllerName
|
|
16
|
-
return Object.seal({
|
|
17
|
-
|
|
18
|
-
window: options.window ?? false,
|
|
19
|
-
directory: join(options.directory ?? '', componentName),
|
|
20
|
-
role: options.role ?? null,
|
|
21
|
-
componentName,
|
|
22
|
-
controllerName,
|
|
23
|
-
controlList: NormalizeFormComponentControlList(options.controlList),
|
|
24
|
-
context: options.context ? dasherize(options.context) : null,
|
|
25
|
-
});
|
|
18
|
+
const componentName = (0, schematics_utilities_1.CoerceSuffix)(name, '-form');
|
|
19
|
+
const controllerName = (_a = options.controllerName) !== null && _a !== void 0 ? _a : componentName;
|
|
20
|
+
return Object.seal(Object.assign(Object.assign({}, normalizedAngularOptions), { window: (_b = options.window) !== null && _b !== void 0 ? _b : false, directory: (0, path_1.join)((_c = options.directory) !== null && _c !== void 0 ? _c : '', componentName), role: (_d = options.role) !== null && _d !== void 0 ? _d : null, componentName,
|
|
21
|
+
controllerName, controlList: (0, form_component_control_1.NormalizeFormComponentControlList)(options.controlList), context: options.context ? (0, utilities_1.dasherize)(options.context) : null }));
|
|
26
22
|
}
|
|
27
|
-
|
|
23
|
+
exports.NormalizeFormComponentOptions = NormalizeFormComponentOptions;
|
|
24
|
+
function FormComponentControlToDtoClassProperty(control) {
|
|
28
25
|
return {
|
|
29
26
|
name: control.name,
|
|
30
27
|
type: control.type,
|
|
31
28
|
isOptional: !control.isRequired,
|
|
32
29
|
};
|
|
33
30
|
}
|
|
31
|
+
exports.FormComponentControlToDtoClassProperty = FormComponentControlToDtoClassProperty;
|
|
34
32
|
function componentRule(normalizedOptions) {
|
|
35
33
|
const { componentName, project, feature, directory, overwrite, } = normalizedOptions;
|
|
36
|
-
return chain([
|
|
34
|
+
return (0, schematics_1.chain)([
|
|
37
35
|
() => console.log(`Coerce form component '${componentName}'`),
|
|
38
|
-
CoerceComponentRule({
|
|
36
|
+
(0, schematics_ts_morph_1.CoerceComponentRule)({
|
|
39
37
|
project,
|
|
40
38
|
feature,
|
|
41
39
|
name: componentName,
|
|
42
40
|
directory,
|
|
43
41
|
overwrite,
|
|
44
42
|
template: {
|
|
45
|
-
options: {
|
|
46
|
-
|
|
47
|
-
OperationIdToClassName,
|
|
48
|
-
OperationIdToClassImportPath,
|
|
49
|
-
},
|
|
43
|
+
options: Object.assign(Object.assign({}, normalizedOptions), { OperationIdToClassName: schematics_ts_morph_1.OperationIdToClassName,
|
|
44
|
+
OperationIdToClassImportPath: schematics_ts_morph_1.OperationIdToClassImportPath }),
|
|
50
45
|
},
|
|
51
46
|
}),
|
|
52
47
|
]);
|
|
53
48
|
}
|
|
54
49
|
function formDefinitionRule(normalizedOptions) {
|
|
55
50
|
const { name, project, feature, directory, controlList, overwrite, } = normalizedOptions;
|
|
56
|
-
return chain([
|
|
51
|
+
return (0, schematics_1.chain)([
|
|
57
52
|
() => console.log(`Coerce form definition files`),
|
|
58
|
-
ExecuteSchematic('form-definition', {
|
|
53
|
+
(0, schematics_utilities_1.ExecuteSchematic)('form-definition', {
|
|
59
54
|
name,
|
|
60
55
|
project,
|
|
61
56
|
directory,
|
|
@@ -68,9 +63,9 @@ function formDefinitionRule(normalizedOptions) {
|
|
|
68
63
|
function formSubmitProviderRule(normalizedOptions) {
|
|
69
64
|
const { project, feature, directory, scope, } = normalizedOptions;
|
|
70
65
|
const submitOperationId = getSubmitOperationId(normalizedOptions);
|
|
71
|
-
return chain([
|
|
66
|
+
return (0, schematics_1.chain)([
|
|
72
67
|
() => console.log(`Coerce form submit method`),
|
|
73
|
-
CoerceFormComponentProviderRule({
|
|
68
|
+
(0, schematics_ts_morph_1.CoerceFormComponentProviderRule)({
|
|
74
69
|
project,
|
|
75
70
|
feature,
|
|
76
71
|
directory,
|
|
@@ -78,7 +73,7 @@ function formSubmitProviderRule(normalizedOptions) {
|
|
|
78
73
|
provide: 'RXAP_FORM_SUBMIT_METHOD',
|
|
79
74
|
useFactory: 'SubmitContextFormAdapterFactory',
|
|
80
75
|
deps: [
|
|
81
|
-
OperationIdToClassName(submitOperationId),
|
|
76
|
+
(0, schematics_ts_morph_1.OperationIdToClassName)(submitOperationId),
|
|
82
77
|
'[ new Optional(), RXAP_FORM_CONTEXT ]',
|
|
83
78
|
],
|
|
84
79
|
},
|
|
@@ -96,8 +91,8 @@ function formSubmitProviderRule(normalizedOptions) {
|
|
|
96
91
|
namedImports: ['Optional'],
|
|
97
92
|
},
|
|
98
93
|
{
|
|
99
|
-
moduleSpecifier: OperationIdToClassImportPath(submitOperationId, scope),
|
|
100
|
-
namedImports: [OperationIdToClassName(submitOperationId)],
|
|
94
|
+
moduleSpecifier: (0, schematics_ts_morph_1.OperationIdToClassImportPath)(submitOperationId, scope),
|
|
95
|
+
namedImports: [(0, schematics_ts_morph_1.OperationIdToClassName)(submitOperationId)],
|
|
101
96
|
},
|
|
102
97
|
],
|
|
103
98
|
}),
|
|
@@ -106,10 +101,10 @@ function formSubmitProviderRule(normalizedOptions) {
|
|
|
106
101
|
function formSubmitBackendRule(normalizedOptions) {
|
|
107
102
|
const { backend, project, feature, controlList, controllerName, nestModule, shared, } = normalizedOptions;
|
|
108
103
|
switch (backend) {
|
|
109
|
-
case BackendTypes.NESTJS:
|
|
110
|
-
return chain([
|
|
104
|
+
case backend_types_1.BackendTypes.NESTJS:
|
|
105
|
+
return (0, schematics_1.chain)([
|
|
111
106
|
() => console.log(`Coerce form submit operation`),
|
|
112
|
-
CoerceFormSubmitOperation({
|
|
107
|
+
(0, schematics_ts_morph_1.CoerceFormSubmitOperation)({
|
|
113
108
|
controllerName,
|
|
114
109
|
project,
|
|
115
110
|
feature,
|
|
@@ -120,49 +115,45 @@ function formSubmitBackendRule(normalizedOptions) {
|
|
|
120
115
|
}),
|
|
121
116
|
]);
|
|
122
117
|
}
|
|
123
|
-
return noop();
|
|
118
|
+
return (0, schematics_1.noop)();
|
|
124
119
|
}
|
|
125
120
|
function formSubmitRule(normalizedOptions) {
|
|
126
121
|
const { backend, controllerName, nestModule, } = normalizedOptions;
|
|
127
|
-
if ([BackendTypes.NESTJS].includes(backend)) {
|
|
128
|
-
return chain([
|
|
122
|
+
if ([backend_types_1.BackendTypes.NESTJS].includes(backend)) {
|
|
123
|
+
return (0, schematics_1.chain)([
|
|
129
124
|
formSubmitBackendRule(normalizedOptions),
|
|
130
125
|
formSubmitProviderRule(normalizedOptions),
|
|
131
126
|
]);
|
|
132
127
|
}
|
|
133
|
-
return noop();
|
|
128
|
+
return (0, schematics_1.noop)();
|
|
134
129
|
}
|
|
135
130
|
function windowRule(normalizedOptions) {
|
|
136
131
|
const { window, directory, componentName, } = normalizedOptions;
|
|
137
132
|
if (window) {
|
|
138
133
|
return tree => {
|
|
139
|
-
const basePath = BuildAngularBasePath(tree, normalizedOptions);
|
|
140
|
-
const flat = !!directory
|
|
141
|
-
return chain([
|
|
134
|
+
const basePath = (0, schematics_ts_morph_1.BuildAngularBasePath)(tree, normalizedOptions);
|
|
135
|
+
const flat = !!(directory === null || directory === void 0 ? void 0 : directory.endsWith(componentName));
|
|
136
|
+
return (0, schematics_1.chain)([
|
|
142
137
|
() => console.log(`Apply window specific templates.`),
|
|
143
|
-
mergeWith(apply(url('./files/window'), [
|
|
144
|
-
applyTemplates({
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
...strings,
|
|
148
|
-
}),
|
|
149
|
-
move(flat ? basePath : join(basePath, componentName)),
|
|
150
|
-
]), MergeStrategy.Overwrite),
|
|
138
|
+
(0, schematics_1.mergeWith)((0, schematics_1.apply)((0, schematics_1.url)('./files/window'), [
|
|
139
|
+
(0, schematics_1.applyTemplates)(Object.assign({ componentName, name: (0, utilities_1.dasherize)(componentName).replace(/-form$/, '') }, core_1.strings)),
|
|
140
|
+
(0, schematics_1.move)(flat ? basePath : (0, path_1.join)(basePath, componentName)),
|
|
141
|
+
]), schematics_1.MergeStrategy.Overwrite),
|
|
151
142
|
]);
|
|
152
143
|
};
|
|
153
144
|
}
|
|
154
|
-
return noop();
|
|
145
|
+
return (0, schematics_1.noop)();
|
|
155
146
|
}
|
|
156
147
|
function getSubmitOperationId(normalizedOptions) {
|
|
157
148
|
const { project, feature, shared, controllerName, } = normalizedOptions;
|
|
158
|
-
return buildOperationId({
|
|
149
|
+
return (0, schematics_ts_morph_1.buildOperationId)({
|
|
159
150
|
project,
|
|
160
151
|
feature,
|
|
161
152
|
shared,
|
|
162
153
|
}, 'submit', controllerName);
|
|
163
154
|
}
|
|
164
155
|
function printFormComponentOptions(options) {
|
|
165
|
-
PrintAngularOptions('form-component', options);
|
|
156
|
+
(0, angular_options_1.PrintAngularOptions)('form-component', options);
|
|
166
157
|
if (options.controlList.length) {
|
|
167
158
|
console.log(`=== controls: ${options.controlList.map((c) => c.name).join(', ')}`);
|
|
168
159
|
}
|
|
@@ -171,11 +162,11 @@ function printFormComponentOptions(options) {
|
|
|
171
162
|
}
|
|
172
163
|
console.log(`\x1b[34m===== WINDOW: \x1b[36m${options.window}\x1b[0m`);
|
|
173
164
|
}
|
|
174
|
-
|
|
165
|
+
function default_1(options) {
|
|
175
166
|
const normalizedOptions = NormalizeFormComponentOptions(options);
|
|
176
167
|
printFormComponentOptions(normalizedOptions);
|
|
177
168
|
return function () {
|
|
178
|
-
return chain([
|
|
169
|
+
return (0, schematics_1.chain)([
|
|
179
170
|
() => console.group('\x1b[32m[@rxap/schematics-angular:form-component]\x1b[0m'),
|
|
180
171
|
componentRule(normalizedOptions),
|
|
181
172
|
windowRule(normalizedOptions),
|
|
@@ -185,4 +176,5 @@ export default function (options) {
|
|
|
185
176
|
]);
|
|
186
177
|
};
|
|
187
178
|
}
|
|
179
|
+
exports.default = default_1;
|
|
188
180
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/angular/src/schematics/form/form-component/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/angular/src/schematics/form/form-component/index.ts"],"names":[],"mappings":";;;AAAA,+CAA+C;AAC/C,2DAUoC;AACpC,mEASmC;AACnC,qEAGoC;AACpC,+CAGyB;AACzB,+BAA4B;AAC5B,kEAKsC;AACtC,8DAA0D;AAC1D,gFAG6C;AAY7C,SAAgB,6BAA6B,CAC3C,OAAuC;;IAEvC,MAAM,wBAAwB,GAAG,IAAA,yCAAuB,EAAC,OAAO,CAAC,CAAC;IAClE,IAAA,kDAAgC,EAAC,wBAAwB,CAAC,CAAC;IAC3D,MAAM,EACJ,IAAI,GACL,GAAG,wBAAwB,CAAC;IAC7B,MAAM,aAAa,GAAG,IAAA,mCAAY,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAClD,MAAM,cAAc,GAAG,MAAA,OAAO,CAAC,cAAc,mCAAI,aAAa,CAAC;IAC/D,OAAO,MAAM,CAAC,IAAI,iCACb,wBAAwB,KAC3B,MAAM,EAAE,MAAA,OAAO,CAAC,MAAM,mCAAI,KAAK,EAC/B,SAAS,EAAE,IAAA,WAAI,EAAC,MAAA,OAAO,CAAC,SAAS,mCAAI,EAAE,EAAE,aAAa,CAAC,EACvD,IAAI,EAAE,MAAA,OAAO,CAAC,IAAI,mCAAI,IAAI,EAC1B,aAAa;QACb,cAAc,EACd,WAAW,EAAE,IAAA,0DAAiC,EAAC,OAAO,CAAC,WAAW,CAAC,EACnE,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,IAAA,qBAAS,EAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,IAC5D,CAAC;AACL,CAAC;AApBD,sEA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AAC;YACjC,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE;SACzB,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAbD,4BAaC"}
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NormalizeFormControlOptions = void 0;
|
|
4
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
+
const schematics_ts_morph_1 = require("@rxap/schematics-ts-morph");
|
|
6
|
+
const schematics_utilities_1 = require("@rxap/schematics-utilities");
|
|
7
|
+
const angular_options_1 = require("../../../lib/angular-options");
|
|
8
|
+
const form_definition_control_1 = require("../../../lib/form-definition-control");
|
|
9
|
+
function NormalizeFormControlOptions(options) {
|
|
10
|
+
var _a, _b;
|
|
11
|
+
const normalizedAngularOptions = (0, angular_options_1.NormalizeAngularOptions)(options);
|
|
12
|
+
const normalizedFormDefinitionControl = (0, form_definition_control_1.NormalizeFormDefinitionControl)(options);
|
|
9
13
|
const { nestModule } = normalizedAngularOptions;
|
|
10
|
-
const formName = dasherize(options.formName);
|
|
11
|
-
let directory = options.directory
|
|
14
|
+
const formName = (0, schematics_utilities_1.dasherize)(options.formName);
|
|
15
|
+
let directory = (_a = options.directory) !== null && _a !== void 0 ? _a : '';
|
|
12
16
|
if (!directory.endsWith('/' + formName + '-form')) {
|
|
13
17
|
directory += '/' + formName + '-form';
|
|
14
18
|
}
|
|
15
|
-
const controllerName = options.controllerName
|
|
16
|
-
return Object.seal({
|
|
17
|
-
...normalizedAngularOptions,
|
|
18
|
-
...normalizedFormDefinitionControl,
|
|
19
|
-
formName,
|
|
19
|
+
const controllerName = (_b = options.controllerName) !== null && _b !== void 0 ? _b : formName;
|
|
20
|
+
return Object.seal(Object.assign(Object.assign(Object.assign({}, normalizedAngularOptions), normalizedFormDefinitionControl), { formName,
|
|
20
21
|
directory,
|
|
21
|
-
controllerName,
|
|
22
|
-
context: options.context ? dasherize(options.context) : null,
|
|
23
|
-
});
|
|
22
|
+
controllerName, context: options.context ? (0, schematics_utilities_1.dasherize)(options.context) : null }));
|
|
24
23
|
}
|
|
24
|
+
exports.NormalizeFormControlOptions = NormalizeFormControlOptions;
|
|
25
25
|
function printOptions(options) {
|
|
26
|
-
PrintAngularOptions('form-control', options);
|
|
26
|
+
(0, angular_options_1.PrintAngularOptions)('form-control', options);
|
|
27
27
|
}
|
|
28
|
-
|
|
28
|
+
function default_1(options) {
|
|
29
29
|
const normalizedOptions = NormalizeFormControlOptions(options);
|
|
30
30
|
const { name, project, feature, directory, formName, type, isArray, state, isRequired, validatorList, } = normalizedOptions;
|
|
31
31
|
printOptions(normalizedOptions);
|
|
32
32
|
return () => {
|
|
33
|
-
return chain([
|
|
33
|
+
return (0, schematics_1.chain)([
|
|
34
34
|
() => console.group('\x1b[32m[@rxap/schematics-angular:form-control]\x1b[0m'),
|
|
35
35
|
() => console.log('Coerce control in form definition class ...'),
|
|
36
|
-
CoerceFormDefinitionControl({
|
|
36
|
+
(0, schematics_ts_morph_1.CoerceFormDefinitionControl)({
|
|
37
37
|
project,
|
|
38
38
|
feature,
|
|
39
39
|
directory,
|
|
@@ -49,4 +49,5 @@ export default function (options) {
|
|
|
49
49
|
]);
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
|
+
exports.default = default_1;
|
|
52
53
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/angular/src/schematics/form/form-control/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/angular/src/schematics/form/form-control/index.ts"],"names":[],"mappings":";;;AAAA,2DAAmD;AACnD,mEAAwE;A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,CAAC,CAAC;IAEhC,OAAO,GAAG,EAAE;QACV,OAAO,IAAA,kBAAK,EAAC;YACX,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,wDAAwD,CAAC;YAC7E,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,6CAA6C,CAAC;YAChE,IAAA,iDAA2B,EAAC;gBAC1B,OAAO;gBACP,OAAO;gBACP,SAAS;gBACT,QAAQ;gBACR,IAAI;gBACJ,IAAI;gBACJ,OAAO;gBACP,KAAK;gBACL,UAAU;gBACV,aAAa;aACd,CAAC;YACF,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE;SACzB,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAnCD,4BAmCC"}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NormalizeFormDefinitionOptions = void 0;
|
|
4
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
+
const schematics_ts_morph_1 = require("@rxap/schematics-ts-morph");
|
|
6
|
+
const angular_options_1 = require("../../../lib/angular-options");
|
|
7
|
+
const form_definition_control_1 = require("../../../lib/form-definition-control");
|
|
8
|
+
function NormalizeFormDefinitionOptions(options) {
|
|
9
|
+
const normalizedAngularOptions = (0, angular_options_1.NormalizeAngularOptions)(options);
|
|
10
|
+
(0, angular_options_1.AssertAngularOptionsNameProperty)(normalizedAngularOptions);
|
|
11
|
+
return Object.seal(Object.assign(Object.assign({}, normalizedAngularOptions), { controlList: (0, form_definition_control_1.NormalizeFormDefinitionControlList)(options.controlList) }));
|
|
12
12
|
}
|
|
13
|
+
exports.NormalizeFormDefinitionOptions = NormalizeFormDefinitionOptions;
|
|
13
14
|
function printFormDefinitionOptions(options) {
|
|
14
|
-
PrintAngularOptions('form-definition', options);
|
|
15
|
+
(0, angular_options_1.PrintAngularOptions)('form-definition', options);
|
|
15
16
|
if (options.controlList.length) {
|
|
16
17
|
console.log(`=== controls: ${options.controlList.map((c) => c.name).join(', ')}`);
|
|
17
18
|
}
|
|
@@ -19,15 +20,15 @@ function printFormDefinitionOptions(options) {
|
|
|
19
20
|
console.log(`=== controls: NONE`);
|
|
20
21
|
}
|
|
21
22
|
}
|
|
22
|
-
|
|
23
|
+
function default_1(options) {
|
|
23
24
|
const normalizedOptions = NormalizeFormDefinitionOptions(options);
|
|
24
25
|
const { name, project, directory, feature, controlList, } = normalizedOptions;
|
|
25
26
|
printFormDefinitionOptions(normalizedOptions);
|
|
26
27
|
return () => {
|
|
27
|
-
return chain([
|
|
28
|
+
return (0, schematics_1.chain)([
|
|
28
29
|
() => console.group('\x1b[32m[@rxap/schematics-angular:form-definition]\x1b[0m'),
|
|
29
30
|
() => console.log('Coerce form definition class ...'),
|
|
30
|
-
CoerceFormDefinition({
|
|
31
|
+
(0, schematics_ts_morph_1.CoerceFormDefinition)({
|
|
31
32
|
project,
|
|
32
33
|
feature,
|
|
33
34
|
directory,
|
|
@@ -35,7 +36,7 @@ export default function (options) {
|
|
|
35
36
|
name,
|
|
36
37
|
}),
|
|
37
38
|
() => console.log('Coerce form providers file ...'),
|
|
38
|
-
CoerceFormProvidersFile({
|
|
39
|
+
(0, schematics_ts_morph_1.CoerceFormProvidersFile)({
|
|
39
40
|
project,
|
|
40
41
|
feature,
|
|
41
42
|
directory,
|
|
@@ -45,4 +46,5 @@ export default function (options) {
|
|
|
45
46
|
]);
|
|
46
47
|
};
|
|
47
48
|
}
|
|
49
|
+
exports.default = default_1;
|
|
48
50
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/angular/src/schematics/form/form-definition/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/angular/src/schematics/form/form-definition/index.ts"],"names":[],"mappings":";;;AAAA,2DAAmD;AACnD,mEAGmC;AAEnC,kEAKsC;AACtC,kFAG8C;AAS9C,SAAgB,8BAA8B,CAC5C,OAAwC;IAExC,MAAM,wBAAwB,GAAG,IAAA,yCAAuB,EAAC,OAAO,CAAC,CAAC;IAClE,IAAA,kDAAgC,EAAC,wBAAwB,CAAC,CAAC;IAC3D,OAAO,MAAM,CAAC,IAAI,iCACb,wBAAwB,KAC3B,WAAW,EAAE,IAAA,4DAAkC,EAAC,OAAO,CAAC,WAAW,CAAC,IACpE,CAAC;AACL,CAAC;AATD,wEASC;AAED,SAAS,0BAA0B,CAAC,OAAwC;IAC1E,IAAA,qCAAmB,EAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;IAChD,IAAI,OAAO,CAAC,WAAW,CAAC,MAAM,EAAE;QAC9B,OAAO,CAAC,GAAG,CAAC,iBAAkB,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAE,EAAE,CAAC,CAAC;KACrF;SAAM;QACL,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;KACnC;AACH,CAAC;AAED,mBAAyB,OAA8B;IACrD,MAAM,iBAAiB,GAAG,8BAA8B,CAAC,OAAO,CAAC,CAAC;IAClE,MAAM,EACJ,IAAI,EACJ,OAAO,EACP,SAAS,EACT,OAAO,EACP,WAAW,GACZ,GAAG,iBAAiB,CAAC;IACtB,0BAA0B,CAAC,iBAAiB,CAAC,CAAC;IAC9C,OAAO,GAAG,EAAE;QACV,OAAO,IAAA,kBAAK,EAAC;YACX,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,2DAA2D,CAAC;YAChF,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,kCAAkC,CAAC;YACrD,IAAA,0CAAoB,EAAC;gBACnB,OAAO;gBACP,OAAO;gBACP,SAAS;gBACT,WAAW;gBACX,IAAI;aACL,CAAC;YACF,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC;YACnD,IAAA,6CAAuB,EAAC;gBACtB,OAAO;gBACP,OAAO;gBACP,SAAS;gBACT,IAAI;aACL,CAAC;YACF,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE;SACzB,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AA/BD,4BA+BC"}
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NormalizeDialogTableActionOptions = void 0;
|
|
4
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
+
const schematics_ts_morph_1 = require("@rxap/schematics-ts-morph");
|
|
6
|
+
const utilities_1 = require("@rxap/utilities");
|
|
7
|
+
const path_1 = require("path");
|
|
8
|
+
const angular_options_1 = require("../../../../lib/angular-options");
|
|
9
|
+
const assert_table_component_exists_1 = require("../../../../lib/assert-table-component-exists");
|
|
10
|
+
const dialog_action_1 = require("../../../../lib/dialog-action");
|
|
11
|
+
const to_title_1 = require("../../../../lib/to-title");
|
|
12
|
+
const operation_table_action_1 = require("../operation-table-action");
|
|
13
|
+
function NormalizeDialogTableActionOptions(options) {
|
|
14
|
+
var _a, _b, _c, _d, _e;
|
|
15
|
+
const actionList = (_b = (_a = options.actionList) === null || _a === void 0 ? void 0 : _a.slice()) !== null && _b !== void 0 ? _b : [];
|
|
12
16
|
if (actionList.length === 0) {
|
|
13
17
|
actionList.push({
|
|
14
18
|
role: 'close',
|
|
@@ -16,28 +20,23 @@ export function NormalizeDialogTableActionOptions(options) {
|
|
|
16
20
|
});
|
|
17
21
|
actionList.push({ role: 'submit' });
|
|
18
22
|
}
|
|
19
|
-
return Object.seal({
|
|
20
|
-
...NormalizeOperationTableActionOptions(options),
|
|
21
|
-
withoutBody: options.withoutBody ?? false,
|
|
22
|
-
actionList: NormalizeDialogActionList(actionList),
|
|
23
|
-
title: options.title ?? ToTitle(options.type),
|
|
24
|
-
overwrite: options.overwrite ?? false,
|
|
25
|
-
});
|
|
23
|
+
return Object.seal(Object.assign(Object.assign({}, (0, operation_table_action_1.NormalizeOperationTableActionOptions)(options)), { withoutBody: (_c = options.withoutBody) !== null && _c !== void 0 ? _c : false, actionList: (0, dialog_action_1.NormalizeDialogActionList)(actionList), title: (_d = options.title) !== null && _d !== void 0 ? _d : (0, to_title_1.ToTitle)(options.type), overwrite: (_e = options.overwrite) !== null && _e !== void 0 ? _e : false }));
|
|
26
24
|
}
|
|
25
|
+
exports.NormalizeDialogTableActionOptions = NormalizeDialogTableActionOptions;
|
|
27
26
|
function printOptions(options) {
|
|
28
|
-
PrintAngularOptions('dialog-table-action', options);
|
|
27
|
+
(0, angular_options_1.PrintAngularOptions)('dialog-table-action', options);
|
|
29
28
|
}
|
|
30
|
-
|
|
29
|
+
function default_1(options) {
|
|
31
30
|
const normalizedOptions = NormalizeDialogTableActionOptions(options);
|
|
32
31
|
const { refresh, confirm, tooltip, errorMessage, successMessage, priority, checkFunction, tableName, project, feature, shared, directory, nestModule, type, withoutBody, title, overwrite, context, controllerName, scope, } = normalizedOptions;
|
|
33
32
|
printOptions(normalizedOptions);
|
|
34
33
|
return (host) => {
|
|
35
|
-
AssertTableComponentExists(host, normalizedOptions);
|
|
36
|
-
return chain([
|
|
34
|
+
(0, assert_table_component_exists_1.AssertTableComponentExists)(host, normalizedOptions);
|
|
35
|
+
return (0, schematics_1.chain)([
|
|
37
36
|
() => console.group('\x1b[32m[@rxap/schematics-angular:dialog-table-action]\x1b[0m'),
|
|
38
37
|
() => console.log('Coerce table action method class ...'),
|
|
39
|
-
CoerceDialogTableActionRule({
|
|
40
|
-
directory: join(directory
|
|
38
|
+
(0, schematics_ts_morph_1.CoerceDialogTableActionRule)({
|
|
39
|
+
directory: (0, path_1.join)(directory !== null && directory !== void 0 ? directory : '', 'methods', 'action'),
|
|
41
40
|
type,
|
|
42
41
|
tableName,
|
|
43
42
|
refresh,
|
|
@@ -51,12 +50,12 @@ export default function (options) {
|
|
|
51
50
|
feature,
|
|
52
51
|
}),
|
|
53
52
|
() => console.log('Coerce table action dialog component ...'),
|
|
54
|
-
CoerceDialogTableActionComponentRule({
|
|
53
|
+
(0, schematics_ts_morph_1.CoerceDialogTableActionComponentRule)({
|
|
55
54
|
scope,
|
|
56
55
|
dialogName: `${type}-dialog`,
|
|
57
56
|
tableName,
|
|
58
57
|
directory,
|
|
59
|
-
operationId: buildOperationId(normalizedOptions, `${type}-action`, BuildNestControllerName({
|
|
58
|
+
operationId: (0, schematics_ts_morph_1.buildOperationId)(normalizedOptions, `${type}-action`, (0, schematics_ts_morph_1.BuildNestControllerName)({
|
|
60
59
|
controllerName,
|
|
61
60
|
nestModule,
|
|
62
61
|
})),
|
|
@@ -67,7 +66,7 @@ export default function (options) {
|
|
|
67
66
|
overwrite,
|
|
68
67
|
}),
|
|
69
68
|
() => console.log('Coerce table action dialog operation ...'),
|
|
70
|
-
CoerceOperation({
|
|
69
|
+
(0, schematics_ts_morph_1.CoerceOperation)({
|
|
71
70
|
nestModule,
|
|
72
71
|
controllerName,
|
|
73
72
|
project,
|
|
@@ -78,12 +77,12 @@ export default function (options) {
|
|
|
78
77
|
tsMorphTransform: (project, sourceFile, classDeclaration, controllerName) => {
|
|
79
78
|
let body = undefined;
|
|
80
79
|
if (!withoutBody) {
|
|
81
|
-
const { className, filePath, } = CoerceDtoClass({
|
|
80
|
+
const { className, filePath, } = (0, schematics_ts_morph_1.CoerceDtoClass)({
|
|
82
81
|
project,
|
|
83
|
-
name: joinWithDash([context, `${type}-action-body`]),
|
|
82
|
+
name: (0, utilities_1.joinWithDash)([context, `${type}-action-body`]),
|
|
84
83
|
});
|
|
85
84
|
body = className;
|
|
86
|
-
CoerceImports(sourceFile, {
|
|
85
|
+
(0, schematics_ts_morph_1.CoerceImports)(sourceFile, {
|
|
87
86
|
moduleSpecifier: filePath,
|
|
88
87
|
namedImports: [className],
|
|
89
88
|
});
|
|
@@ -100,4 +99,5 @@ export default function (options) {
|
|
|
100
99
|
]);
|
|
101
100
|
};
|
|
102
101
|
}
|
|
102
|
+
exports.default = default_1;
|
|
103
103
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/schematic/angular/src/schematics/table/action/dialog-table-action/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/schematic/angular/src/schematics/table/action/dialog-table-action/index.ts"],"names":[],"mappings":";;;AAAA,2DAGoC;AACpC,mEAQmC;AACnC,+CAGyB;AACzB,+BAA4B;AAC5B,qEAAsE;AACtE,iGAA2F;AAC3F,iEAA0E;AAC1E,uDAAmD;AACnD,sEAGmC;AAQnC,SAAgB,iCAAiC,CAC/C,OAAiC;;IAEjC,MAAM,UAAU,GAAG,MAAA,MAAA,OAAO,CAAC,UAAU,0CAAE,KAAK,EAAE,mCAAI,EAAE,CAAC;IACrD,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE;QAC3B,UAAU,CAAC,IAAI,CAAC;YACd,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,QAAQ;SAChB,CAAC,CAAC;QACH,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;KACrC;IACD,OAAO,MAAM,CAAC,IAAI,iCACb,IAAA,6DAAoC,EAAC,OAAO,CAAC,KAChD,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