@rxap/schematic-angular 16.1.0-dev.4 → 16.1.0-dev.40
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 +291 -0
- package/README.md +1 -1
- package/collection.json +21 -1
- package/package.json +44 -40
- package/src/lib/angular-options.js +18 -1
- package/src/lib/angular-options.js.map +1 -1
- package/src/lib/form-definition-control.js +3 -1
- package/src/lib/form-definition-control.js.map +1 -1
- package/src/lib/minimum-table-component-options.d.ts +1 -0
- package/src/lib/minimum-table-component-options.js +114 -155
- package/src/lib/minimum-table-component-options.js.map +1 -1
- package/src/lib/table-action.d.ts +1 -1
- package/src/lib/table-action.js +16 -10
- package/src/lib/table-action.js.map +1 -1
- package/src/lib/table-column.d.ts +4 -0
- package/src/lib/table-column.js +40 -2
- package/src/lib/table-column.js.map +1 -1
- package/src/lib/table-header-button.d.ts +9 -2
- package/src/lib/table-header-button.js +22 -2
- package/src/lib/table-header-button.js.map +1 -1
- package/src/lib/table-row-action.d.ts +5 -1
- package/src/lib/table-row-action.js +8 -6
- package/src/lib/table-row-action.js.map +1 -1
- package/src/schematics/accordion/accordion-component/files/component/__componentName__.component.ts.template +1 -1
- package/src/schematics/accordion/accordion-component/index.js +1 -1
- package/src/schematics/accordion/accordion-component/index.js.map +1 -1
- package/src/schematics/accordion/accordion-component/schema.json +13 -3
- package/src/schematics/accordion/accordion-item-component/files/component/__componentName__.component.html.template +1 -1
- package/src/schematics/accordion/accordion-item-component/schema.json +13 -3
- package/src/schematics/accordion/item/accordion-item-data-grid-component/schema.json +13 -3
- package/src/schematics/accordion/item/accordion-item-table-component/schema.json +16 -3
- package/src/schematics/accordion/item/accordion-item-tree-table-component/schema.json +16 -3
- package/src/schematics/angular.schema.json +61 -0
- package/src/schematics/data-grid-component/schema.json +13 -3
- package/src/schematics/dialog-component/schema.json +13 -3
- package/src/schematics/form/control/input-form-control/index.d.ts +2 -2
- package/src/schematics/form/control/input-form-control/index.js +7 -3
- package/src/schematics/form/control/input-form-control/index.js.map +1 -1
- package/src/schematics/form/control/select-form-control/index.js +2 -0
- package/src/schematics/form/control/select-form-control/index.js.map +1 -1
- package/src/schematics/form/control/table-select-form-control/index.js +2 -0
- package/src/schematics/form/control/table-select-form-control/index.js.map +1 -1
- package/src/schematics/form/form-component/index.d.ts +0 -1
- package/src/schematics/form/form-component/index.js +45 -14
- 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.d.ts +2 -2
- package/src/schematics/form/form-control/index.js +7 -8
- 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 -10
- package/src/schematics/form/form-definition/index.js.map +1 -1
- package/src/schematics/form/form-definition/schema.d.ts +2 -1
- package/src/schematics/form/form-definition/schema.json +5 -0
- package/src/schematics/general.schema.json +41 -0
- package/src/schematics/table/action/dialog-table-action/index.d.ts +2 -1
- package/src/schematics/table/action/dialog-table-action/index.js +6 -2
- package/src/schematics/table/action/dialog-table-action/index.js.map +1 -1
- package/src/schematics/table/action/dialog-table-action/schema.json +12 -2
- package/src/schematics/table/action/form-table-action/index.d.ts +9 -1
- package/src/schematics/table/action/form-table-action/index.js +151 -71
- package/src/schematics/table/action/form-table-action/index.js.map +1 -1
- package/src/schematics/table/action/form-table-action/schema.d.ts +13 -1
- package/src/schematics/table/action/form-table-action/schema.json +106 -3
- package/src/schematics/table/action/navigation-table-action/index.d.ts +1 -1
- package/src/schematics/table/action/navigation-table-action/index.js +10 -10
- package/src/schematics/table/action/navigation-table-action/index.js.map +1 -1
- package/src/schematics/table/action/open-api-table-action/index.d.ts +10 -0
- package/src/schematics/table/action/open-api-table-action/index.js +50 -0
- package/src/schematics/table/action/open-api-table-action/index.js.map +1 -0
- package/src/schematics/table/action/open-api-table-action/schema.d.ts +9 -0
- package/src/schematics/table/action/open-api-table-action/schema.json +121 -0
- package/src/schematics/table/action/operation-table-action/index.d.ts +1 -3
- package/src/schematics/table/action/operation-table-action/index.js +11 -12
- 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 +83 -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 +69 -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 +8 -0
- package/src/schematics/table/header-button/navigation-table-header-button/schema.json +87 -0
- package/src/schematics/table/table-action/index.d.ts +1 -1
- package/src/schematics/table/table-action/index.js +6 -4
- package/src/schematics/table/table-action/index.js.map +1 -1
- package/src/schematics/table/table-action/schema.json +8 -0
- package/src/schematics/table/table-component/files/component/__componentName__.component.html.template +26 -48
- package/src/schematics/table/table-component/files/component/__componentName__.component.ts.template +3 -5
- package/src/schematics/table/table-component/index.d.ts +1 -0
- package/src/schematics/table/table-component/index.js +44 -8
- package/src/schematics/table/table-component/index.js.map +1 -1
- package/src/schematics/table/table-component/schema.json +210 -220
- package/src/schematics/table/table-header-button/index.d.ts +8 -0
- package/src/schematics/table/table-header-button/index.js +50 -0
- package/src/schematics/table/table-header-button/index.js.map +1 -0
- package/src/schematics/table/table-header-button/schema.d.ts +8 -0
- package/src/schematics/table/table-header-button/schema.json +80 -0
- package/src/schematics/table/tree-table-component/files/component/__componentName__.component.html.template +86 -82
- package/src/schematics/table/tree-table-component/files/component/__componentName__.component.ts.template +1 -3
- package/src/schematics/table/tree-table-component/index.d.ts +1 -0
- package/src/schematics/table/tree-table-component/index.js +14 -18
- package/src/schematics/table/tree-table-component/index.js.map +1 -1
- package/src/schematics/table/tree-table-component/schema.json +14 -1
- package/src/schematics/tree-component/schema.json +11 -1
- /package/src/schematics/form/form-component/files/window/{open-__name__-form-window.method.ts.template → open-__componentName__-window.method.ts.template} +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FormComponentControlToDtoClassProperty = exports.NormalizeFormComponentOptions = void 0;
|
|
4
|
+
const core_1 = require("@angular-devkit/core");
|
|
4
5
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
6
|
const schematics_ts_morph_1 = require("@rxap/schematics-ts-morph");
|
|
6
7
|
const schematics_utilities_1 = require("@rxap/schematics-utilities");
|
|
@@ -10,15 +11,14 @@ const angular_options_1 = require("../../../lib/angular-options");
|
|
|
10
11
|
const backend_types_1 = require("../../../lib/backend-types");
|
|
11
12
|
const form_component_control_1 = require("../../../lib/form-component-control");
|
|
12
13
|
function NormalizeFormComponentOptions(options) {
|
|
13
|
-
var _a, _b, _c, _d
|
|
14
|
+
var _a, _b, _c, _d;
|
|
14
15
|
const normalizedAngularOptions = (0, angular_options_1.NormalizeAngularOptions)(options);
|
|
15
16
|
(0, angular_options_1.AssertAngularOptionsNameProperty)(normalizedAngularOptions);
|
|
16
|
-
const { name,
|
|
17
|
+
const { name, } = normalizedAngularOptions;
|
|
17
18
|
const componentName = (0, schematics_utilities_1.CoerceSuffix)(name, '-form');
|
|
18
19
|
const controllerName = (_a = options.controllerName) !== null && _a !== void 0 ? _a : componentName;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
controllerName, controlList: (0, form_component_control_1.NormalizeFormComponentControlList)(options.controlList), context }));
|
|
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 }));
|
|
22
22
|
}
|
|
23
23
|
exports.NormalizeFormComponentOptions = NormalizeFormComponentOptions;
|
|
24
24
|
function FormComponentControlToDtoClassProperty(control) {
|
|
@@ -60,8 +60,9 @@ function formDefinitionRule(normalizedOptions) {
|
|
|
60
60
|
}),
|
|
61
61
|
]);
|
|
62
62
|
}
|
|
63
|
-
function formSubmitProviderRule(normalizedOptions
|
|
63
|
+
function formSubmitProviderRule(normalizedOptions) {
|
|
64
64
|
const { project, feature, directory, scope, } = normalizedOptions;
|
|
65
|
+
const submitOperationId = getSubmitOperationId(normalizedOptions);
|
|
65
66
|
return (0, schematics_1.chain)([
|
|
66
67
|
() => console.log(`Coerce form submit method`),
|
|
67
68
|
(0, schematics_ts_morph_1.CoerceFormComponentProviderRule)({
|
|
@@ -98,7 +99,7 @@ function formSubmitProviderRule(normalizedOptions, submitOperationId) {
|
|
|
98
99
|
]);
|
|
99
100
|
}
|
|
100
101
|
function formSubmitBackendRule(normalizedOptions) {
|
|
101
|
-
const { backend, project, feature, controlList,
|
|
102
|
+
const { backend, project, feature, controlList, controllerName, nestModule, shared, } = normalizedOptions;
|
|
102
103
|
switch (backend) {
|
|
103
104
|
case backend_types_1.BackendTypes.NESTJS:
|
|
104
105
|
return (0, schematics_1.chain)([
|
|
@@ -110,7 +111,7 @@ function formSubmitBackendRule(normalizedOptions) {
|
|
|
110
111
|
shared,
|
|
111
112
|
nestModule,
|
|
112
113
|
propertyList: controlList.map(FormComponentControlToDtoClassProperty),
|
|
113
|
-
bodyDtoName:
|
|
114
|
+
bodyDtoName: controllerName,
|
|
114
115
|
}),
|
|
115
116
|
]);
|
|
116
117
|
}
|
|
@@ -119,29 +120,59 @@ function formSubmitBackendRule(normalizedOptions) {
|
|
|
119
120
|
function formSubmitRule(normalizedOptions) {
|
|
120
121
|
const { backend, controllerName, nestModule, } = normalizedOptions;
|
|
121
122
|
if ([backend_types_1.BackendTypes.NESTJS].includes(backend)) {
|
|
122
|
-
const submitOperationId = (0, schematics_ts_morph_1.buildOperationId)(normalizedOptions, 'submit', (0, schematics_ts_morph_1.BuildNestControllerName)({
|
|
123
|
-
controllerName,
|
|
124
|
-
nestModule,
|
|
125
|
-
}));
|
|
126
123
|
return (0, schematics_1.chain)([
|
|
127
124
|
formSubmitBackendRule(normalizedOptions),
|
|
128
|
-
formSubmitProviderRule(normalizedOptions
|
|
125
|
+
formSubmitProviderRule(normalizedOptions),
|
|
129
126
|
]);
|
|
130
127
|
}
|
|
131
128
|
return (0, schematics_1.noop)();
|
|
132
129
|
}
|
|
130
|
+
function windowRule(normalizedOptions) {
|
|
131
|
+
const { window, directory, componentName, } = normalizedOptions;
|
|
132
|
+
if (window) {
|
|
133
|
+
return tree => {
|
|
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)([
|
|
137
|
+
() => console.log(`Apply window specific templates.`),
|
|
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),
|
|
142
|
+
]);
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
return (0, schematics_1.noop)();
|
|
146
|
+
}
|
|
147
|
+
function getSubmitOperationId(normalizedOptions) {
|
|
148
|
+
const { project, feature, shared, controllerName, } = normalizedOptions;
|
|
149
|
+
return (0, schematics_ts_morph_1.buildOperationId)({
|
|
150
|
+
project,
|
|
151
|
+
feature,
|
|
152
|
+
shared,
|
|
153
|
+
}, 'submit', controllerName);
|
|
154
|
+
}
|
|
133
155
|
function printFormComponentOptions(options) {
|
|
134
156
|
(0, angular_options_1.PrintAngularOptions)('form-component', options);
|
|
135
|
-
|
|
157
|
+
if (options.controlList.length) {
|
|
158
|
+
console.log(`=== controls: ${options.controlList.map((c) => c.name).join(', ')}`);
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
console.log(`=== controls: NONE`);
|
|
162
|
+
}
|
|
163
|
+
console.log(`\x1b[34m===== WINDOW: \x1b[36m${options.window}\x1b[0m`);
|
|
136
164
|
}
|
|
137
165
|
function default_1(options) {
|
|
138
166
|
const normalizedOptions = NormalizeFormComponentOptions(options);
|
|
139
167
|
printFormComponentOptions(normalizedOptions);
|
|
140
168
|
return function () {
|
|
141
169
|
return (0, schematics_1.chain)([
|
|
170
|
+
() => console.group('\x1b[32m[@rxap/schematics-angular:form-component]\x1b[0m'),
|
|
142
171
|
componentRule(normalizedOptions),
|
|
172
|
+
windowRule(normalizedOptions),
|
|
143
173
|
formDefinitionRule(normalizedOptions),
|
|
144
174
|
formSubmitRule(normalizedOptions),
|
|
175
|
+
() => console.groupEnd(),
|
|
145
176
|
]);
|
|
146
177
|
};
|
|
147
178
|
}
|
|
@@ -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,yC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EAAE,OAAO,CAAC,CAAC;IAC/C,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;IACD,OAAO,CAAC,GAAG,CAAC,iCAAkC,OAAO,CAAC,MAAO,SAAS,CAAC,CAAC;AAC1E,CAAC;AAED,mBAAyB,OAA6B;IACpD,MAAM,iBAAiB,GAAG,6BAA6B,CAAC,OAAO,CAAC,CAAC;IACjE,yBAAyB,CAAC,iBAAiB,CAAC,CAAC;IAC7C,OAAO;QACL,OAAO,IAAA,kBAAK,EAAC;YACX,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,0DAA0D,CAAC;YAC/E,aAAa,CAAC,iBAAiB,CAAC;YAChC,UAAU,CAAC,iBAAiB,CAAC;YAC7B,kBAAkB,CAAC,iBAAiB,CAAC;YACrC,cAAc,CAAC,iBAAiB,CAAC;YACjC,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE;SACzB,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAbD,4BAaC"}
|
|
@@ -31,13 +31,11 @@
|
|
|
31
31
|
},
|
|
32
32
|
"shared": {
|
|
33
33
|
"type": "boolean",
|
|
34
|
-
"description": "Whether the form is shared across applications"
|
|
35
|
-
"default": false
|
|
34
|
+
"description": "Whether the form is shared across applications"
|
|
36
35
|
},
|
|
37
36
|
"window": {
|
|
38
37
|
"type": "boolean",
|
|
39
|
-
"description": "Whether the form can be opened in a window"
|
|
40
|
-
"default": false
|
|
38
|
+
"description": "Whether the form can be opened in a window"
|
|
41
39
|
},
|
|
42
40
|
"directory": {
|
|
43
41
|
"type": "string",
|
|
@@ -78,8 +76,7 @@
|
|
|
78
76
|
},
|
|
79
77
|
"isRequired": {
|
|
80
78
|
"type": "boolean",
|
|
81
|
-
"description": "Whether the control value is required"
|
|
82
|
-
"default": false
|
|
79
|
+
"description": "Whether the control value is required"
|
|
83
80
|
},
|
|
84
81
|
"validatorList": {
|
|
85
82
|
"type": "array",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { FormControlOptions } from './schema';
|
|
2
1
|
import { Normalized } from '@rxap/utilities';
|
|
3
|
-
import { NormalizedFormDefinitionControl } from '../../../lib/form-definition-control';
|
|
4
2
|
import { NormalizedAngularOptions } from '../../../lib/angular-options';
|
|
3
|
+
import { NormalizedFormDefinitionControl } from '../../../lib/form-definition-control';
|
|
4
|
+
import { FormControlOptions } from './schema';
|
|
5
5
|
export interface NormalizedFormControlOptions extends Readonly<Normalized<FormControlOptions> & NormalizedAngularOptions & NormalizedFormDefinitionControl> {
|
|
6
6
|
controllerName: string;
|
|
7
7
|
}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.NormalizeFormControlOptions = void 0;
|
|
4
|
-
const schematics_utilities_1 = require("@rxap/schematics-utilities");
|
|
5
4
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
6
|
-
const utilities_1 = require("@rxap/utilities");
|
|
7
5
|
const schematics_ts_morph_1 = require("@rxap/schematics-ts-morph");
|
|
8
|
-
const
|
|
6
|
+
const schematics_utilities_1 = require("@rxap/schematics-utilities");
|
|
9
7
|
const angular_options_1 = require("../../../lib/angular-options");
|
|
8
|
+
const form_definition_control_1 = require("../../../lib/form-definition-control");
|
|
10
9
|
function NormalizeFormControlOptions(options) {
|
|
11
|
-
var _a, _b
|
|
10
|
+
var _a, _b;
|
|
12
11
|
const normalizedAngularOptions = (0, angular_options_1.NormalizeAngularOptions)(options);
|
|
13
12
|
const normalizedFormDefinitionControl = (0, form_definition_control_1.NormalizeFormDefinitionControl)(options);
|
|
14
13
|
const { nestModule } = normalizedAngularOptions;
|
|
@@ -18,11 +17,9 @@ function NormalizeFormControlOptions(options) {
|
|
|
18
17
|
directory += '/' + formName + '-form';
|
|
19
18
|
}
|
|
20
19
|
const controllerName = (_b = options.controllerName) !== null && _b !== void 0 ? _b : formName;
|
|
21
|
-
|
|
22
|
-
return Object.assign(Object.assign(Object.assign({}, normalizedAngularOptions), normalizedFormDefinitionControl), { formName,
|
|
20
|
+
return Object.seal(Object.assign(Object.assign(Object.assign({}, normalizedAngularOptions), normalizedFormDefinitionControl), { formName,
|
|
23
21
|
directory,
|
|
24
|
-
controllerName,
|
|
25
|
-
context });
|
|
22
|
+
controllerName, context: options.context ? (0, schematics_utilities_1.dasherize)(options.context) : null }));
|
|
26
23
|
}
|
|
27
24
|
exports.NormalizeFormControlOptions = NormalizeFormControlOptions;
|
|
28
25
|
function printOptions(options) {
|
|
@@ -34,6 +31,7 @@ function default_1(options) {
|
|
|
34
31
|
printOptions(normalizedOptions);
|
|
35
32
|
return () => {
|
|
36
33
|
return (0, schematics_1.chain)([
|
|
34
|
+
() => console.group('\x1b[32m[@rxap/schematics-angular:form-control]\x1b[0m'),
|
|
37
35
|
() => console.log('Coerce control in form definition class ...'),
|
|
38
36
|
(0, schematics_ts_morph_1.CoerceFormDefinitionControl)({
|
|
39
37
|
project,
|
|
@@ -47,6 +45,7 @@ function default_1(options) {
|
|
|
47
45
|
isRequired,
|
|
48
46
|
validatorList,
|
|
49
47
|
}),
|
|
48
|
+
() => console.groupEnd(),
|
|
50
49
|
]);
|
|
51
50
|
};
|
|
52
51
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/angular/src/schematics/form/form-control/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/angular/src/schematics/form/form-control/index.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GACd,GAAG,iBAAiB,CAAC;IACtB,YAAY,CAAC,iBAAiB,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,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Normalized } from '@rxap/utilities';
|
|
2
2
|
import { NormalizedAngularOptions } from '../../../lib/angular-options';
|
|
3
3
|
import { NormalizedFormDefinitionControl } from '../../../lib/form-definition-control';
|
|
4
|
-
import {
|
|
4
|
+
import { FormDefinitionOptions } from './schema';
|
|
5
5
|
export interface NormalizedFormDefinitionOptions extends Readonly<Normalized<FormDefinitionOptions> & NormalizedAngularOptions> {
|
|
6
6
|
name: string;
|
|
7
7
|
controlList: Array<NormalizedFormDefinitionControl>;
|
|
@@ -6,21 +6,28 @@ const schematics_ts_morph_1 = require("@rxap/schematics-ts-morph");
|
|
|
6
6
|
const angular_options_1 = require("../../../lib/angular-options");
|
|
7
7
|
const form_definition_control_1 = require("../../../lib/form-definition-control");
|
|
8
8
|
function NormalizeFormDefinitionOptions(options) {
|
|
9
|
+
var _a;
|
|
9
10
|
const normalizedAngularOptions = (0, angular_options_1.NormalizeAngularOptions)(options);
|
|
10
11
|
(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
|
+
return Object.seal(Object.assign(Object.assign({}, normalizedAngularOptions), { controlList: (0, form_definition_control_1.NormalizeFormDefinitionControlList)(options.controlList), standalone: (_a = options.standalone) !== null && _a !== void 0 ? _a : true }));
|
|
12
13
|
}
|
|
13
14
|
exports.NormalizeFormDefinitionOptions = NormalizeFormDefinitionOptions;
|
|
14
15
|
function printFormDefinitionOptions(options) {
|
|
15
16
|
(0, angular_options_1.PrintAngularOptions)('form-definition', options);
|
|
16
|
-
|
|
17
|
+
if (options.controlList.length) {
|
|
18
|
+
console.log(`=== controls: ${options.controlList.map((c) => c.name).join(', ')}`);
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
console.log(`=== controls: NONE`);
|
|
22
|
+
}
|
|
17
23
|
}
|
|
18
24
|
function default_1(options) {
|
|
19
25
|
const normalizedOptions = NormalizeFormDefinitionOptions(options);
|
|
20
|
-
const { name, project, directory, feature, controlList, } = normalizedOptions;
|
|
26
|
+
const { name, project, directory, feature, controlList, standalone, } = normalizedOptions;
|
|
21
27
|
printFormDefinitionOptions(normalizedOptions);
|
|
22
28
|
return () => {
|
|
23
29
|
return (0, schematics_1.chain)([
|
|
30
|
+
() => console.group('\x1b[32m[@rxap/schematics-angular:form-definition]\x1b[0m'),
|
|
24
31
|
() => console.log('Coerce form definition class ...'),
|
|
25
32
|
(0, schematics_ts_morph_1.CoerceFormDefinition)({
|
|
26
33
|
project,
|
|
@@ -29,13 +36,20 @@ function default_1(options) {
|
|
|
29
36
|
controlList,
|
|
30
37
|
name,
|
|
31
38
|
}),
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
standalone ?
|
|
40
|
+
(0, schematics_1.chain)([
|
|
41
|
+
() => console.log('Coerce form providers file ...'),
|
|
42
|
+
(0, schematics_ts_morph_1.CoerceFormProvidersFile)({
|
|
43
|
+
project,
|
|
44
|
+
feature,
|
|
45
|
+
directory,
|
|
46
|
+
name,
|
|
47
|
+
}),
|
|
48
|
+
]) :
|
|
49
|
+
(0, schematics_1.chain)([
|
|
50
|
+
() => console.log('Skip form providers file ...'),
|
|
51
|
+
]),
|
|
52
|
+
() => console.groupEnd(),
|
|
39
53
|
]);
|
|
40
54
|
};
|
|
41
55
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/angular/src/schematics/form/form-definition/index.ts"],"names":[],"mappings":";;;
|
|
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,EACpE,UAAU,EAAE,MAAA,OAAO,CAAC,UAAU,mCAAI,IAAI,IACtC,CAAC;AACL,CAAC;AAVD,wEAUC;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,EACX,UAAU,GACX,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,UAAU,CAAC,CAAC;gBACZ,IAAA,kBAAK,EAAC;oBACJ,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC;oBACnD,IAAA,6CAAuB,EAAC;wBACtB,OAAO;wBACP,OAAO;wBACP,SAAS;wBACT,IAAI;qBACL,CAAC;iBACH,CAAC,CAAC,CAAC;gBACJ,IAAA,kBAAK,EAAC;oBACJ,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC;iBAClD,CAAC;YACF,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE;SACzB,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAtCD,4BAsCC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { FormDefinitionControl } from '../../../lib/form-definition-control';
|
|
2
1
|
import { AngularOptions } from '../../../lib/angular-options';
|
|
2
|
+
import { FormDefinitionControl } from '../../../lib/form-definition-control';
|
|
3
3
|
|
|
4
4
|
export interface FormDefinitionOptions extends AngularOptions {
|
|
5
5
|
controlList: Array<string | FormDefinitionControl>;
|
|
6
|
+
standalone?: boolean;
|
|
6
7
|
}
|
|
@@ -38,6 +38,11 @@
|
|
|
38
38
|
"description": "The feature name where the accordion module should be added.",
|
|
39
39
|
"x-prompt": "To which feature should the accordion module be added?"
|
|
40
40
|
},
|
|
41
|
+
"standalone": {
|
|
42
|
+
"type": "boolean",
|
|
43
|
+
"description": "Whether the form definition has a form.provider file",
|
|
44
|
+
"default": true
|
|
45
|
+
},
|
|
41
46
|
"controlList": {
|
|
42
47
|
"alias": "control",
|
|
43
48
|
"anyOf": [
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"$id": "general",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"properties": {
|
|
6
|
+
"project": {
|
|
7
|
+
"type": "string",
|
|
8
|
+
"description": "Project name where the files should be generated"
|
|
9
|
+
},
|
|
10
|
+
"feature": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"description": "Feature name where the files should be generated"
|
|
13
|
+
},
|
|
14
|
+
"overwrite": {
|
|
15
|
+
"anyOf": [
|
|
16
|
+
{
|
|
17
|
+
"type": "boolean"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"type": "array",
|
|
21
|
+
"items": {
|
|
22
|
+
"type": "string"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"description": "Overwrite existing files",
|
|
27
|
+
"default": false
|
|
28
|
+
},
|
|
29
|
+
"overwriteHtml": {
|
|
30
|
+
"type": "boolean",
|
|
31
|
+
"default": false
|
|
32
|
+
},
|
|
33
|
+
"replace": {
|
|
34
|
+
"type": "boolean",
|
|
35
|
+
"default": false
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"required": [
|
|
39
|
+
"project"
|
|
40
|
+
]
|
|
41
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Tree } from '@angular-devkit/schematics';
|
|
1
2
|
import { Normalized } from '@rxap/utilities';
|
|
2
3
|
import { NormalizedOperationTableActionOptions } from '../operation-table-action';
|
|
3
4
|
import { DialogTableActionOptions } from './schema';
|
|
@@ -5,4 +6,4 @@ export interface NormalizedDialogTableActionOptions extends Readonly<Normalized<
|
|
|
5
6
|
title: string;
|
|
6
7
|
}
|
|
7
8
|
export declare function NormalizeDialogTableActionOptions(options: DialogTableActionOptions): NormalizedDialogTableActionOptions;
|
|
8
|
-
export default function (options: DialogTableActionOptions): () => import("@angular-devkit/schematics").Rule;
|
|
9
|
+
export default function (options: DialogTableActionOptions): (host: Tree) => import("@angular-devkit/schematics").Rule;
|
|
@@ -6,6 +6,7 @@ const schematics_ts_morph_1 = require("@rxap/schematics-ts-morph");
|
|
|
6
6
|
const utilities_1 = require("@rxap/utilities");
|
|
7
7
|
const path_1 = require("path");
|
|
8
8
|
const angular_options_1 = require("../../../../lib/angular-options");
|
|
9
|
+
const assert_table_component_exists_1 = require("../../../../lib/assert-table-component-exists");
|
|
9
10
|
const dialog_action_1 = require("../../../../lib/dialog-action");
|
|
10
11
|
const to_title_1 = require("../../../../lib/to-title");
|
|
11
12
|
const operation_table_action_1 = require("../operation-table-action");
|
|
@@ -29,8 +30,10 @@ function default_1(options) {
|
|
|
29
30
|
const normalizedOptions = NormalizeDialogTableActionOptions(options);
|
|
30
31
|
const { refresh, confirm, tooltip, errorMessage, successMessage, priority, checkFunction, tableName, project, feature, shared, directory, nestModule, type, withoutBody, title, overwrite, context, controllerName, scope, } = normalizedOptions;
|
|
31
32
|
printOptions(normalizedOptions);
|
|
32
|
-
return () => {
|
|
33
|
+
return (host) => {
|
|
34
|
+
(0, assert_table_component_exists_1.AssertTableComponentExists)(host, normalizedOptions);
|
|
33
35
|
return (0, schematics_1.chain)([
|
|
36
|
+
() => console.group('\x1b[32m[@rxap/schematics-angular:dialog-table-action]\x1b[0m'),
|
|
34
37
|
() => console.log('Coerce table action method class ...'),
|
|
35
38
|
(0, schematics_ts_morph_1.CoerceDialogTableActionRule)({
|
|
36
39
|
directory: (0, path_1.join)(directory !== null && directory !== void 0 ? directory : '', 'methods', 'action'),
|
|
@@ -53,7 +56,7 @@ function default_1(options) {
|
|
|
53
56
|
tableName,
|
|
54
57
|
directory,
|
|
55
58
|
operationId: (0, schematics_ts_morph_1.buildOperationId)(normalizedOptions, `${type}-action`, (0, schematics_ts_morph_1.BuildNestControllerName)({
|
|
56
|
-
controllerName
|
|
59
|
+
controllerName,
|
|
57
60
|
nestModule,
|
|
58
61
|
})),
|
|
59
62
|
project,
|
|
@@ -92,6 +95,7 @@ function default_1(options) {
|
|
|
92
95
|
};
|
|
93
96
|
},
|
|
94
97
|
}),
|
|
98
|
+
() => console.groupEnd(),
|
|
95
99
|
]);
|
|
96
100
|
};
|
|
97
101
|
}
|
|
@@ -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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AQ;4BACzB,YAAY,EAAE,CAAE,SAAS,CAAE;yBAC5B,CAAC,CAAC;qBACJ;oBACD,OAAO;wBACL,IAAI;wBACJ,MAAM,EAAE,KAAK;wBACb,IAAI,EAAE,iBAAkB,IAAK,EAAE;wBAC/B,SAAS,EAAE,CAAE,EAAE,IAAI,EAAE,OAAO,EAAE,CAAE;qBACjC,CAAC;gBACJ,CAAC;aACF,CAAC;YACF,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE;SACzB,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AA7GD,4BA6GC"}
|
|
@@ -117,8 +117,18 @@
|
|
|
117
117
|
"description": "The title for the dialog"
|
|
118
118
|
},
|
|
119
119
|
"overwrite": {
|
|
120
|
-
"
|
|
121
|
-
|
|
120
|
+
"anyOf": [
|
|
121
|
+
{
|
|
122
|
+
"type": "boolean"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"type": "array",
|
|
126
|
+
"items": {
|
|
127
|
+
"type": "string"
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
],
|
|
131
|
+
"description": "Overwrite existing files",
|
|
122
132
|
"default": false
|
|
123
133
|
},
|
|
124
134
|
"context": {
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import { Rule, Tree } from '@angular-devkit/schematics';
|
|
2
2
|
import { Normalized } from '@rxap/utilities';
|
|
3
3
|
import { OptionalKind, SourceFile, TypeAliasDeclarationStructure } from 'ts-morph';
|
|
4
|
+
import { NormalizedFormComponentControl } from '../../../../lib/form-component-control';
|
|
4
5
|
import { NormalizedOperationTableActionOptions } from '../operation-table-action';
|
|
5
6
|
import { FormTableActionOptions } from './schema';
|
|
6
|
-
export
|
|
7
|
+
export interface NormalizedFormTableActionOptions extends Omit<Readonly<Normalized<FormTableActionOptions> & NormalizedOperationTableActionOptions>, 'formOptions'> {
|
|
8
|
+
formComponent: string;
|
|
9
|
+
formOptions: {
|
|
10
|
+
controlList: NormalizedFormComponentControl[];
|
|
11
|
+
role: string | null;
|
|
12
|
+
window: boolean;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
7
15
|
export declare function NormalizeFormTableActionOptions(options: Readonly<FormTableActionOptions>): NormalizedFormTableActionOptions;
|
|
8
16
|
export declare function CoerceTypeAlias(sourceFile: SourceFile, name: string, structure: Omit<OptionalKind<TypeAliasDeclarationStructure>, 'name'>): import("ts-morph").TypeAliasDeclaration;
|
|
9
17
|
export default function (options: FormTableActionOptions): (host: Tree) => Rule;
|