@rxap/schematic-angular 16.1.0-dev.5 → 16.1.0-dev.50
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 +337 -0
- package/README.md +1 -1
- package/collection.json +21 -1
- package/package.json +48 -40
- package/src/lib/accordion-item.d.ts +2 -2
- package/src/lib/accordion-item.js +4 -4
- package/src/lib/accordion-item.js.map +1 -1
- package/src/lib/adapter-options.d.ts +11 -5
- package/src/lib/adapter-options.js +8 -5
- package/src/lib/adapter-options.js.map +1 -1
- package/src/lib/angular-options.js +7 -1
- package/src/lib/angular-options.js.map +1 -1
- package/src/lib/data-grid-item.d.ts +1 -1
- package/src/lib/data-grid-item.js +2 -2
- package/src/lib/data-grid-item.js.map +1 -1
- package/src/lib/data-grid-options.d.ts +3 -3
- package/src/lib/data-grid-options.js +1 -1
- package/src/lib/data-grid-options.js.map +1 -1
- package/src/lib/dialog-action.d.ts +1 -1
- package/src/lib/dialog-action.js +2 -2
- package/src/lib/dialog-action.js.map +1 -1
- package/src/lib/existing-method.d.ts +11 -2
- package/src/lib/existing-method.js +8 -2
- package/src/lib/existing-method.js.map +1 -1
- package/src/lib/form-component-control.d.ts +1 -1
- package/src/lib/form-component-control.js +2 -2
- package/src/lib/form-component-control.js.map +1 -1
- package/src/lib/form-definition-control.d.ts +1 -1
- package/src/lib/form-definition-control.js +6 -4
- package/src/lib/form-definition-control.js.map +1 -1
- package/src/lib/minimum-table-component-options.d.ts +5 -3
- package/src/lib/minimum-table-component-options.js +95 -140
- package/src/lib/minimum-table-component-options.js.map +1 -1
- package/src/lib/minimum-table-options.d.ts +9 -6
- package/src/lib/minimum-table-options.js +7 -4
- package/src/lib/minimum-table-options.js.map +1 -1
- package/src/lib/table-action.d.ts +1 -1
- package/src/lib/table-action.js +11 -5
- package/src/lib/table-action.js.map +1 -1
- package/src/lib/table-column.d.ts +16 -4
- package/src/lib/table-column.js +93 -6
- 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-open-api-options.d.ts +3 -2
- package/src/lib/table-open-api-options.js +1 -1
- package/src/lib/table-open-api-options.js.map +1 -1
- package/src/lib/table-options.d.ts +9 -5
- package/src/lib/table-options.js +1 -1
- package/src/lib/table-options.js.map +1 -1
- package/src/lib/table-property.d.ts +14 -0
- package/src/lib/table-property.js +46 -0
- package/src/lib/table-property.js.map +1 -0
- package/src/lib/table-row-action.d.ts +5 -1
- package/src/lib/table-row-action.js +9 -7
- package/src/lib/table-row-action.js.map +1 -1
- package/src/lib/tree-table-options.d.ts +10 -6
- package/src/lib/tree-table-options.js +2 -2
- package/src/lib/tree-table-options.js.map +1 -1
- package/src/lib/type-import.d.ts +4 -0
- package/src/lib/type-import.js +38 -0
- package/src/lib/type-import.js.map +1 -0
- package/src/schematics/accordion/accordion-component/files/component/__componentName__.component.ts.template +1 -1
- package/src/schematics/accordion/accordion-component/index.d.ts +3 -1
- package/src/schematics/accordion/accordion-component/index.js +2 -2
- 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/index.js +2 -2
- package/src/schematics/accordion/accordion-item-component/index.js.map +1 -1
- package/src/schematics/accordion/accordion-item-component/schema.json +13 -3
- package/src/schematics/accordion/item/accordion-item-data-grid-component/index.d.ts +3 -3
- package/src/schematics/accordion/item/accordion-item-data-grid-component/index.js +5 -5
- package/src/schematics/accordion/item/accordion-item-data-grid-component/index.js.map +1 -1
- package/src/schematics/accordion/item/accordion-item-data-grid-component/schema.json +13 -3
- package/src/schematics/accordion/item/accordion-item-table-component/index.d.ts +7 -4
- package/src/schematics/accordion/item/accordion-item-table-component/index.js +5 -5
- package/src/schematics/accordion/item/accordion-item-table-component/index.js.map +1 -1
- package/src/schematics/accordion/item/accordion-item-table-component/schema.json +57 -8
- package/src/schematics/accordion/item/accordion-item-tree-table-component/index.d.ts +4 -1
- package/src/schematics/accordion/item/accordion-item-tree-table-component/index.js +1 -1
- package/src/schematics/accordion/item/accordion-item-tree-table-component/index.js.map +1 -1
- package/src/schematics/accordion/item/accordion-item-tree-table-component/schema.json +62 -9
- package/src/schematics/angular.schema.json +61 -0
- package/src/schematics/data-grid-component/index.d.ts +1 -1
- package/src/schematics/data-grid-component/index.js +1 -1
- package/src/schematics/data-grid-component/index.js.map +1 -1
- package/src/schematics/data-grid-component/schema.json +13 -3
- package/src/schematics/dialog-component/index.js +3 -3
- package/src/schematics/dialog-component/index.js.map +1 -1
- 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 +8 -4
- package/src/schematics/form/control/input-form-control/index.js.map +1 -1
- package/src/schematics/form/control/select-form-control/index.js +3 -1
- package/src/schematics/form/control/select-form-control/index.js.map +1 -1
- package/src/schematics/form/control/table-select-form-control/index.d.ts +2 -2
- package/src/schematics/form/control/table-select-form-control/index.js +5 -3
- package/src/schematics/form/control/table-select-form-control/index.js.map +1 -1
- package/src/schematics/form/form-component/index.d.ts +1 -1
- package/src/schematics/form/form-component/index.js +22 -9
- package/src/schematics/form/form-component/index.js.map +1 -1
- package/src/schematics/form/form-component/schema.json +3 -6
- package/src/schematics/form/form-control/index.js +3 -1
- package/src/schematics/form/form-control/index.js.map +1 -1
- package/src/schematics/form/form-definition/index.d.ts +4 -4
- 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 +3 -1
- package/src/schematics/table/action/dialog-table-action/index.js +3 -1
- 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 +6 -3
- package/src/schematics/table/action/form-table-action/index.js +68 -18
- 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 +71 -3
- package/src/schematics/table/action/navigation-table-action/index.js +6 -3
- package/src/schematics/table/action/navigation-table-action/index.js.map +1 -1
- package/src/schematics/table/action/navigation-table-action/schema.d.ts +1 -0
- package/src/schematics/table/action/navigation-table-action/schema.json +5 -0
- 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.js +3 -1
- 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 +18 -0
- package/src/schematics/table/header-button/form-table-header-button/index.js +92 -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 +15 -0
- package/src/schematics/table/header-button/form-table-header-button/schema.json +139 -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 +84 -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 +7 -0
- package/src/schematics/table/header-button/navigation-table-header-button/schema.json +87 -0
- package/src/schematics/table/table-action/index.js +3 -1
- 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 +34 -48
- package/src/schematics/table/table-component/files/component/__componentName__.component.ts.template +19 -5
- package/src/schematics/table/table-component/index.d.ts +6 -8
- package/src/schematics/table/table-component/index.js +43 -28
- package/src/schematics/table/table-component/index.js.map +1 -1
- package/src/schematics/table/table-component/schema.json +267 -215
- 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 +94 -82
- package/src/schematics/table/tree-table-component/files/component/__componentName__.component.ts.template +17 -4
- package/src/schematics/table/tree-table-component/index.d.ts +1 -1
- package/src/schematics/table/tree-table-component/index.js +19 -24
- package/src/schematics/table/tree-table-component/index.js.map +1 -1
- package/src/schematics/table/tree-table-component/schema.json +60 -7
- package/src/schematics/tree-component/index.d.ts +2 -2
- package/src/schematics/tree-component/index.js +2 -2
- package/src/schematics/tree-component/index.js.map +1 -1
- package/src/schematics/tree-component/schema.json +11 -1
|
@@ -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.
|
|
12
|
+
return Object.freeze(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,MAAM,iCACf,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,9 +1,11 @@
|
|
|
1
1
|
import { Tree } from '@angular-devkit/schematics';
|
|
2
2
|
import { Normalized } from '@rxap/utilities';
|
|
3
|
+
import { NormalizedDialogAction } from '../../../../lib/dialog-action';
|
|
3
4
|
import { NormalizedOperationTableActionOptions } from '../operation-table-action';
|
|
4
5
|
import { DialogTableActionOptions } from './schema';
|
|
5
|
-
export interface NormalizedDialogTableActionOptions extends Readonly<Normalized<DialogTableActionOptions
|
|
6
|
+
export interface NormalizedDialogTableActionOptions extends Readonly<Normalized<Omit<DialogTableActionOptions, 'actionList'>> & NormalizedOperationTableActionOptions> {
|
|
6
7
|
title: string;
|
|
8
|
+
actionList: ReadonlyArray<NormalizedDialogAction>;
|
|
7
9
|
}
|
|
8
10
|
export declare function NormalizeDialogTableActionOptions(options: DialogTableActionOptions): NormalizedDialogTableActionOptions;
|
|
9
11
|
export default function (options: DialogTableActionOptions): (host: Tree) => import("@angular-devkit/schematics").Rule;
|
|
@@ -20,7 +20,7 @@ function NormalizeDialogTableActionOptions(options) {
|
|
|
20
20
|
});
|
|
21
21
|
actionList.push({ role: 'submit' });
|
|
22
22
|
}
|
|
23
|
-
return Object.
|
|
23
|
+
return Object.freeze(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 }));
|
|
24
24
|
}
|
|
25
25
|
exports.NormalizeDialogTableActionOptions = NormalizeDialogTableActionOptions;
|
|
26
26
|
function printOptions(options) {
|
|
@@ -33,6 +33,7 @@ function default_1(options) {
|
|
|
33
33
|
return (host) => {
|
|
34
34
|
(0, assert_table_component_exists_1.AssertTableComponentExists)(host, normalizedOptions);
|
|
35
35
|
return (0, schematics_1.chain)([
|
|
36
|
+
() => console.group('\x1b[32m[@rxap/schematics-angular:dialog-table-action]\x1b[0m'),
|
|
36
37
|
() => console.log('Coerce table action method class ...'),
|
|
37
38
|
(0, schematics_ts_morph_1.CoerceDialogTableActionRule)({
|
|
38
39
|
directory: (0, path_1.join)(directory !== null && directory !== void 0 ? directory : '', 'methods', 'action'),
|
|
@@ -94,6 +95,7 @@ function default_1(options) {
|
|
|
94
95
|
};
|
|
95
96
|
},
|
|
96
97
|
}),
|
|
98
|
+
() => console.groupEnd(),
|
|
97
99
|
]);
|
|
98
100
|
};
|
|
99
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,2DAGoC;AACpC,mEAQmC;AACnC,+CAGyB;AACzB,+BAA4B;AAC5B,qEAAsE;AACtE,iGAA2F;AAC3F,
|
|
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,iEAGuC;AACvC,uDAAmD;AACnD,sEAGmC;AASnC,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,MAAM,iCACf,IAAA,6DAAoC,EAAC,OAAO,CAAC,KAChD,WAAW,EAAE,MAAA,OAAO,CAAC,WAAW,mCAAI,KAAK,EACzC,UAAU,EAAE,IAAA,yCAAyB,EAAC,UAAU,CAAC,EACjD,KAAK,EAAE,MAAA,OAAO,CAAC,KAAK,mCAAI,IAAA,kBAAO,EAAC,OAAO,CAAC,IAAI,CAAC,EAC7C,SAAS,EAAE,MAAA,OAAO,CAAC,SAAS,mCAAI,KAAY,IAC5C,CAAC;AACL,CAAC;AAlBD,8EAkBC;AAED,SAAS,YAAY,CAAC,OAA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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": {
|
|
@@ -4,9 +4,12 @@ import { OptionalKind, SourceFile, TypeAliasDeclarationStructure } from 'ts-morp
|
|
|
4
4
|
import { NormalizedFormComponentControl } from '../../../../lib/form-component-control';
|
|
5
5
|
import { NormalizedOperationTableActionOptions } from '../operation-table-action';
|
|
6
6
|
import { FormTableActionOptions } from './schema';
|
|
7
|
-
export interface NormalizedFormTableActionOptions extends Readonly<Normalized<FormTableActionOptions> & NormalizedOperationTableActionOptions> {
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
export interface NormalizedFormTableActionOptions extends Omit<Readonly<Normalized<FormTableActionOptions> & NormalizedOperationTableActionOptions>, 'formOptions'> {
|
|
8
|
+
formComponent: string;
|
|
9
|
+
formOptions: {
|
|
10
|
+
controlList: ReadonlyArray<NormalizedFormComponentControl>;
|
|
11
|
+
role: string | null;
|
|
12
|
+
window: boolean;
|
|
10
13
|
};
|
|
11
14
|
}
|
|
12
15
|
export declare function NormalizeFormTableActionOptions(options: Readonly<FormTableActionOptions>): NormalizedFormTableActionOptions;
|
|
@@ -13,13 +13,20 @@ const form_component_control_1 = require("../../../../lib/form-component-control
|
|
|
13
13
|
const index_1 = require("../../../form/form-component/index");
|
|
14
14
|
const operation_table_action_1 = require("../operation-table-action");
|
|
15
15
|
function NormalizeFormTableActionOptions(options) {
|
|
16
|
-
var _a, _b, _c;
|
|
16
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
17
17
|
const normalizedOptions = (0, operation_table_action_1.NormalizeOperationTableActionOptions)(options);
|
|
18
|
-
const { controllerName, type, nestModule, } = normalizedOptions;
|
|
18
|
+
const { controllerName, type, nestModule, tableName, } = normalizedOptions;
|
|
19
|
+
const loadFrom = (_a = options.loadFrom) !== null && _a !== void 0 ? _a : null;
|
|
20
|
+
const formInitial = (_b = options.formInitial) !== null && _b !== void 0 ? _b : null;
|
|
21
|
+
const formOptions = (_c = options.formOptions) !== null && _c !== void 0 ? _c : {};
|
|
19
22
|
return Object.assign(Object.assign({}, normalizedOptions), { controllerName: (0, schematics_ts_morph_1.BuildNestControllerName)({
|
|
20
23
|
nestModule,
|
|
21
24
|
controllerName: [type, 'action'].join('-'),
|
|
22
|
-
}),
|
|
25
|
+
}), formComponent: (0, utilities_1.CoerceSuffix)((0, utilities_1.dasherize)((_d = options.formComponent) !== null && _d !== void 0 ? _d : [type, tableName.replace(/-table$/, '')].join('-')), '-form'), loadFrom: Object.keys(loadFrom !== null && loadFrom !== void 0 ? loadFrom : {}).length ? loadFrom : null, formInitial: Object.keys(formInitial !== null && formInitial !== void 0 ? formInitial : {}).length ? formInitial : null, customComponent: (_e = options.customComponent) !== null && _e !== void 0 ? _e : false, formOptions: {
|
|
26
|
+
window: (_f = formOptions.window) !== null && _f !== void 0 ? _f : true,
|
|
27
|
+
role: (_g = formOptions.role) !== null && _g !== void 0 ? _g : type,
|
|
28
|
+
controlList: (0, form_component_control_1.NormalizeFormComponentControlList)(formOptions.controlList),
|
|
29
|
+
} });
|
|
23
30
|
}
|
|
24
31
|
exports.NormalizeFormTableActionOptions = NormalizeFormTableActionOptions;
|
|
25
32
|
function CoerceTypeAlias(sourceFile, name, structure) {
|
|
@@ -51,6 +58,10 @@ function UseOperationResponseAsFormTypeRule(options) {
|
|
|
51
58
|
}
|
|
52
59
|
function nestjsBackendRule(normalizedOptions) {
|
|
53
60
|
const { project, feature, shared, directory, nestModule, type, context, controllerName, scope, } = normalizedOptions;
|
|
61
|
+
if (!nestModule) {
|
|
62
|
+
throw new Error('The nest module is required');
|
|
63
|
+
}
|
|
64
|
+
const controllerPath = `${(0, utilities_1.dasherize)(nestModule)}/action/:rowId/${type}`;
|
|
54
65
|
return (0, schematics_1.chain)([
|
|
55
66
|
() => console.log('Coerce form get table action operation'),
|
|
56
67
|
(0, schematics_ts_morph_1.CoerceOperation)({
|
|
@@ -61,13 +72,13 @@ function nestjsBackendRule(normalizedOptions) {
|
|
|
61
72
|
shared,
|
|
62
73
|
context,
|
|
63
74
|
operationName: `get`,
|
|
64
|
-
controllerPath
|
|
65
|
-
overwriteControllerPath: true,
|
|
75
|
+
controllerPath,
|
|
66
76
|
tsMorphTransform: (project, sourceFile) => {
|
|
77
|
+
var _a, _b;
|
|
67
78
|
const { className, filePath, } = (0, schematics_ts_morph_1.CoerceDtoClass)({
|
|
68
79
|
project,
|
|
69
80
|
name: controllerName,
|
|
70
|
-
propertyList: normalizedOptions.
|
|
81
|
+
propertyList: (_b = (_a = normalizedOptions.formOptions) === null || _a === void 0 ? void 0 : _a.controlList.map(control => (0, index_1.FormComponentControlToDtoClassProperty)(control))) !== null && _b !== void 0 ? _b : [],
|
|
71
82
|
});
|
|
72
83
|
(0, schematics_ts_morph_1.CoerceImports)(sourceFile, {
|
|
73
84
|
namedImports: [className],
|
|
@@ -92,6 +103,7 @@ function nestjsBackendRule(normalizedOptions) {
|
|
|
92
103
|
shared,
|
|
93
104
|
nestModule,
|
|
94
105
|
context,
|
|
106
|
+
controllerPath,
|
|
95
107
|
paramList: [
|
|
96
108
|
{
|
|
97
109
|
name: 'rowId',
|
|
@@ -126,20 +138,37 @@ function buildGetOperationId(normalizedOptions) {
|
|
|
126
138
|
const { controllerName, } = normalizedOptions;
|
|
127
139
|
return (0, schematics_ts_morph_1.buildOperationId)(normalizedOptions, `get`, controllerName);
|
|
128
140
|
}
|
|
141
|
+
function buildLoadFormOptions(normalizedOptions) {
|
|
142
|
+
const { backend } = normalizedOptions;
|
|
143
|
+
let loadFrom = undefined;
|
|
144
|
+
if (backend === backend_types_1.BackendTypes.NESTJS) {
|
|
145
|
+
loadFrom = {
|
|
146
|
+
operationId: buildGetOperationId(normalizedOptions),
|
|
147
|
+
body: false,
|
|
148
|
+
parameters: {
|
|
149
|
+
rowId: 'rowId',
|
|
150
|
+
},
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
else if (normalizedOptions.loadFrom) {
|
|
154
|
+
loadFrom = normalizedOptions.loadFrom;
|
|
155
|
+
}
|
|
156
|
+
return loadFrom;
|
|
157
|
+
}
|
|
129
158
|
function default_1(options) {
|
|
130
159
|
const normalizedOptions = NormalizeFormTableActionOptions(options);
|
|
131
|
-
const { refresh, confirm, tooltip, errorMessage, successMessage, priority, checkFunction, tableName, project, feature, shared, directory, nestModule, type, context, controllerName, overwrite, scope,
|
|
160
|
+
const { refresh, confirm, tooltip, errorMessage, successMessage, priority, checkFunction, tableName, project, feature, shared, directory, nestModule, type, context, controllerName, overwrite, scope, backend, formInitial, formComponent, customComponent, formOptions, } = normalizedOptions;
|
|
132
161
|
printOptions(normalizedOptions);
|
|
133
162
|
return (host) => {
|
|
134
163
|
(0, assert_table_component_exists_1.AssertTableComponentExists)(host, normalizedOptions);
|
|
135
|
-
const
|
|
136
|
-
|
|
137
|
-
return (0, schematics_1.chain)([
|
|
164
|
+
const ruleList = [
|
|
165
|
+
() => console.group('\x1b[32m[@rxap/schematics-angular:form-table-action]\x1b[0m'),
|
|
138
166
|
() => console.info(`Generating form table action rule...`),
|
|
139
167
|
(0, schematics_ts_morph_1.CoerceFormTableActionRule)({
|
|
140
168
|
scope,
|
|
141
169
|
directory: (0, path_1.join)(directory !== null && directory !== void 0 ? directory : '', 'methods', 'action'),
|
|
142
|
-
|
|
170
|
+
loadFrom: buildLoadFormOptions(normalizedOptions),
|
|
171
|
+
formInitial,
|
|
143
172
|
type,
|
|
144
173
|
tableName,
|
|
145
174
|
refresh,
|
|
@@ -151,17 +180,38 @@ function default_1(options) {
|
|
|
151
180
|
checkFunction,
|
|
152
181
|
project,
|
|
153
182
|
feature,
|
|
183
|
+
formComponent,
|
|
184
|
+
}),
|
|
185
|
+
() => console.log('Coerce open form window method to table component ...'),
|
|
186
|
+
(0, schematics_ts_morph_1.CoerceComponentRule)({
|
|
187
|
+
project,
|
|
188
|
+
feature,
|
|
189
|
+
shared,
|
|
190
|
+
name: tableName,
|
|
191
|
+
directory,
|
|
192
|
+
overwrite,
|
|
193
|
+
tsMorphTransform: (project, [sourceFile]) => {
|
|
194
|
+
(0, schematics_ts_morph_1.AddComponentProvider)(sourceFile, `Open${(0, utilities_1.classify)(formComponent)}WindowMethod`, [
|
|
195
|
+
{
|
|
196
|
+
moduleSpecifier: `./${(0, utilities_1.dasherize)(formComponent)}/open-${(0, utilities_1.dasherize)(formComponent)}-window.method`,
|
|
197
|
+
namedImports: [`Open${(0, utilities_1.classify)(formComponent)}WindowMethod`],
|
|
198
|
+
},
|
|
199
|
+
]);
|
|
200
|
+
},
|
|
154
201
|
}),
|
|
155
|
-
|
|
156
|
-
|
|
202
|
+
];
|
|
203
|
+
if (!customComponent) {
|
|
204
|
+
ruleList.push(() => console.info(`Generating form component...`), (0, schematics_utilities_1.ExecuteSchematic)('form-component', Object.assign(Object.assign({}, formOptions !== null && formOptions !== void 0 ? formOptions : {}), { project, name: formComponent.replace(/-form$/, ''), feature,
|
|
157
205
|
directory,
|
|
158
|
-
shared,
|
|
206
|
+
shared,
|
|
207
|
+
nestModule,
|
|
159
208
|
controllerName,
|
|
160
209
|
overwrite,
|
|
161
|
-
context
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
210
|
+
context,
|
|
211
|
+
backend })), () => console.info(`Generating backend...`), backendRule(normalizedOptions));
|
|
212
|
+
}
|
|
213
|
+
ruleList.push(() => console.groupEnd());
|
|
214
|
+
return (0, schematics_1.chain)(ruleList);
|
|
165
215
|
};
|
|
166
216
|
}
|
|
167
217
|
exports.default = default_1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/schematic/angular/src/schematics/table/action/form-table-action/index.ts"],"names":[],"mappings":";;;AAAA,2DAKoC;AACpC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/schematic/angular/src/schematics/table/action/form-table-action/index.ts"],"names":[],"mappings":";;;AAAA,2DAKoC;AACpC,mEAemC;AACnC,qEAA8D;AAC9D,+CAKyB;AACzB,+BAA4B;AAO5B,qEAAsE;AACtE,iGAA2F;AAC3F,iEAA6D;AAC7D,mFAGgD;AAChD,8DAA4F;AAC5F,sEAGmC;AAcnC,SAAgB,+BAA+B,CAC7C,OAAyC;;IAEzC,MAAM,iBAAiB,GAAG,IAAA,6DAAoC,EAAC,OAAO,CAAC,CAAC;IACxE,MAAM,EACJ,cAAc,EACd,IAAI,EACJ,UAAU,EACV,SAAS,GACV,GAAG,iBAAiB,CAAC;IACtB,MAAM,QAAQ,GAAG,MAAA,OAAO,CAAC,QAAQ,mCAAI,IAAI,CAAC;IAC1C,MAAM,WAAW,GAAG,MAAA,OAAO,CAAC,WAAW,mCAAI,IAAI,CAAC;IAChD,MAAM,WAAW,GAAG,MAAA,OAAO,CAAC,WAAW,mCAAI,EAAE,CAAC;IAC9C,uCACK,iBAAiB,KACpB,cAAc,EAAE,IAAA,6CAAuB,EAAC;YACtC,UAAU;YACV,cAAc,EAAE,CAAE,IAAI,EAAE,QAAQ,CAAE,CAAC,IAAI,CAAC,GAAG,CAAC;SAC7C,CAAC,EACF,aAAa,EAAE,IAAA,wBAAY,EACzB,IAAA,qBAAS,EAAC,MAAA,OAAO,CAAC,aAAa,mCAAI,CAAE,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,EACpG,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,QAAQ,aAAR,QAAQ,cAAR,QAA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E;yBACjE;qBACF,CACF,CAAC;gBACJ,CAAC;aACF,CAAC;SACH,CAAC;QAEF,IAAI,CAAC,eAAe,EAAE;YACpB,QAAQ,CAAC,IAAI,CACX,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,8BAA8B,CAAC,EAClD,IAAA,uCAAgB,EAAC,gBAAgB,kCAC5B,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,EAAE,KACpB,OAAO,EACP,IAAI,EAAE,aAAa,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,EACzC,OAAO;gBACP,SAAS;gBACT,MAAM;gBACN,UAAU;gBACV,cAAc;gBACd,SAAS;gBACT,OAAO;gBACP,OAAO,IACP,EACF,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,uBAAuB,CAAC,EAC3C,WAAW,CAAC,iBAAiB,CAAC,CAC/B,CAAC;SACH;QAED,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;QAExC,OAAO,IAAA,kBAAK,EAAC,QAAQ,CAAC,CAAC;IACzB,CAAC,CAAC;AACJ,CAAC;AA3GD,4BA2GC"}
|
|
@@ -1,4 +1,16 @@
|
|
|
1
|
+
import { LoadFromTableActionOptions } from '@rxap/schematics-ts-morph';
|
|
2
|
+
import { FormComponentControl } from '../../../../lib/form-component-control';
|
|
1
3
|
import { OperationTableActionOptions } from '../operation-table-action/schema';
|
|
2
4
|
|
|
3
5
|
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
4
|
-
export interface FormTableActionOptions extends OperationTableActionOptions {
|
|
6
|
+
export interface FormTableActionOptions extends OperationTableActionOptions {
|
|
7
|
+
loadFrom?: LoadFromTableActionOptions;
|
|
8
|
+
formInitial?: Record<string, any>;
|
|
9
|
+
formComponent?: string;
|
|
10
|
+
customComponent: boolean;
|
|
11
|
+
formOptions?: {
|
|
12
|
+
controlList?: Array<FormComponentControl>;
|
|
13
|
+
role?: string;
|
|
14
|
+
window?: boolean;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -78,17 +78,85 @@
|
|
|
78
78
|
"description": "The module name for the table nest operations"
|
|
79
79
|
},
|
|
80
80
|
"overwrite": {
|
|
81
|
-
"
|
|
82
|
-
|
|
81
|
+
"anyOf": [
|
|
82
|
+
{
|
|
83
|
+
"type": "boolean"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"type": "array",
|
|
87
|
+
"items": {
|
|
88
|
+
"type": "string"
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
],
|
|
92
|
+
"description": "Overwrite existing files",
|
|
83
93
|
"default": false
|
|
84
94
|
},
|
|
85
95
|
"context": {
|
|
86
96
|
"type": "string",
|
|
87
97
|
"description": "The context use to generate proper names for class, files, etc"
|
|
88
98
|
},
|
|
89
|
-
"
|
|
99
|
+
"formInitial": {
|
|
100
|
+
"type": "object",
|
|
101
|
+
"description": "The mapping from the row object to the form initial object"
|
|
102
|
+
},
|
|
103
|
+
"formComponent": {
|
|
104
|
+
"type": "string"
|
|
105
|
+
},
|
|
106
|
+
"customComponent": {
|
|
107
|
+
"type": "boolean",
|
|
108
|
+
"default": false,
|
|
109
|
+
"description": "If true the schematic will not coerce the form component"
|
|
110
|
+
},
|
|
111
|
+
"loadFrom": {
|
|
112
|
+
"type": "object",
|
|
113
|
+
"properties": {
|
|
114
|
+
"operationId": {
|
|
115
|
+
"type": "string"
|
|
116
|
+
},
|
|
117
|
+
"scope": {
|
|
118
|
+
"type": "string",
|
|
119
|
+
"description": "The scope of package for the openapi classes"
|
|
120
|
+
},
|
|
121
|
+
"body": {
|
|
122
|
+
"oneOf": [
|
|
123
|
+
{
|
|
124
|
+
"type": "boolean",
|
|
125
|
+
"description": "Pass the full row as body for the operation request"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"type": "object",
|
|
129
|
+
"description": "Mapping of table columns to body properties - [request property]: [table column]",
|
|
130
|
+
"additionalProperties": true
|
|
131
|
+
}
|
|
132
|
+
]
|
|
133
|
+
},
|
|
134
|
+
"parameters": {
|
|
135
|
+
"oneOf": [
|
|
136
|
+
{
|
|
137
|
+
"type": "boolean",
|
|
138
|
+
"description": "Pass the full row as parameters for the operation request"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"type": "object",
|
|
142
|
+
"description": "Mapping of table columns to parameters properties - [request property]: [table column]",
|
|
143
|
+
"additionalProperties": true
|
|
144
|
+
}
|
|
145
|
+
]
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
"formOptions": {
|
|
90
150
|
"type": "object",
|
|
91
151
|
"properties": {
|
|
152
|
+
"role": {
|
|
153
|
+
"type": "string",
|
|
154
|
+
"description": "Define the role of the form"
|
|
155
|
+
},
|
|
156
|
+
"window": {
|
|
157
|
+
"type": "boolean",
|
|
158
|
+
"description": "Whether the form can be opened in a window"
|
|
159
|
+
},
|
|
92
160
|
"controlList": {
|
|
93
161
|
"alias": "control",
|
|
94
162
|
"type": "array",
|
|
@@ -8,8 +8,8 @@ const angular_options_1 = require("../../../../lib/angular-options");
|
|
|
8
8
|
const assert_table_component_exists_1 = require("../../../../lib/assert-table-component-exists");
|
|
9
9
|
const operation_table_action_1 = require("../operation-table-action");
|
|
10
10
|
function NormalizeNavigationTableActionOptions(options) {
|
|
11
|
-
var _a;
|
|
12
|
-
return Object.assign(Object.assign({}, (0, operation_table_action_1.NormalizeOperationTableActionOptions)(options)), { route: (_a = options.route) !== null && _a !== void 0 ? _a : null });
|
|
11
|
+
var _a, _b;
|
|
12
|
+
return Object.assign(Object.assign({}, (0, operation_table_action_1.NormalizeOperationTableActionOptions)(options)), { route: (_a = options.route) !== null && _a !== void 0 ? _a : null, relativeTo: (_b = options.relativeTo) !== null && _b !== void 0 ? _b : false });
|
|
13
13
|
}
|
|
14
14
|
exports.NormalizeNavigationTableActionOptions = NormalizeNavigationTableActionOptions;
|
|
15
15
|
function printOptions(options) {
|
|
@@ -17,11 +17,12 @@ function printOptions(options) {
|
|
|
17
17
|
}
|
|
18
18
|
function default_1(options) {
|
|
19
19
|
const normalizedOptions = NormalizeNavigationTableActionOptions(options);
|
|
20
|
-
const { refresh, confirm, tooltip, errorMessage, successMessage, priority, checkFunction, tableName, project, feature, shared, directory, type, route, } = normalizedOptions;
|
|
20
|
+
const { refresh, confirm, tooltip, errorMessage, successMessage, priority, checkFunction, tableName, project, feature, shared, directory, type, route, relativeTo, } = normalizedOptions;
|
|
21
21
|
printOptions(normalizedOptions);
|
|
22
22
|
return (host) => {
|
|
23
23
|
(0, assert_table_component_exists_1.AssertTableComponentExists)(host, normalizedOptions);
|
|
24
24
|
return (0, schematics_1.chain)([
|
|
25
|
+
() => console.group('\x1b[32m[@rxap/schematics-angular:navigation-table-action]\x1b[0m'),
|
|
25
26
|
(0, schematics_ts_morph_1.CoerceNavigationTableActionRule)({
|
|
26
27
|
directory: (0, path_1.join)(directory !== null && directory !== void 0 ? directory : '', 'methods', 'action'),
|
|
27
28
|
type,
|
|
@@ -36,7 +37,9 @@ function default_1(options) {
|
|
|
36
37
|
project,
|
|
37
38
|
feature,
|
|
38
39
|
route,
|
|
40
|
+
relativeTo,
|
|
39
41
|
}),
|
|
42
|
+
() => console.groupEnd(),
|
|
40
43
|
]);
|
|
41
44
|
};
|
|
42
45
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/schematic/angular/src/schematics/table/action/navigation-table-action/index.ts"],"names":[],"mappings":";;;AAAA,2DAGoC;AACpC,mEAA4E;AAE5E,+BAA4B;AAC5B,qEAAsE;AACtE,iGAA2F;AAC3F,sEAGmC;AAMnC,SAAgB,qCAAqC,CACnD,OAAqC;;IAErC,uCACK,IAAA,6DAAoC,EAAC,OAAO,CAAC,KAChD,KAAK,EAAE,MAAA,OAAO,CAAC,KAAK,mCAAI,IAAI,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/schematic/angular/src/schematics/table/action/navigation-table-action/index.ts"],"names":[],"mappings":";;;AAAA,2DAGoC;AACpC,mEAA4E;AAE5E,+BAA4B;AAC5B,qEAAsE;AACtE,iGAA2F;AAC3F,sEAGmC;AAMnC,SAAgB,qCAAqC,CACnD,OAAqC;;IAErC,uCACK,IAAA,6DAAoC,EAAC,OAAO,CAAC,KAChD,KAAK,EAAE,MAAA,OAAO,CAAC,KAAK,mCAAI,IAAI,EAC5B,UAAU,EAAE,MAAA,OAAO,CAAC,UAAU,mCAAI,KAAK,IACvC;AACJ,CAAC;AARD,sFAQC;AAED,SAAS,YAAY,CAAC,OAA+C;IACnE,IAAA,qCAAmB,EAAC,yBAAyB,EAAE,OAAO,CAAC,CAAC;AAC1D,CAAC;AAED,mBAAyB,OAAqC;IAC5D,MAAM,iBAAiB,GAAG,qCAAqC,CAAC,OAAO,CAAC,CAAC;IACzE,MAAM,EACJ,OAAO,EACP,OAAO,EACP,OAAO,EACP,YAAY,EACZ,cAAc,EACd,QAAQ,EACR,aAAa,EACb,SAAS,EACT,OAAO,EACP,OAAO,EACP,MAAM,EACN,SAAS,EACT,IAAI,EACJ,KAAK,EACL,UAAU,GACX,GAAG,iBAAiB,CAAC;IACtB,YAAY,CAAC,iBAAiB,CAAC,CAAC;IAChC,OAAO,CAAC,IAAU,EAAE,EAAE;QAEpB,IAAA,0DAA0B,EAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;QAEpD,OAAO,IAAA,kBAAK,EAAC;YACX,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,mEAAmE,CAAC;YACxF,IAAA,qDAA+B,EAAC;gBAC9B,SAAS,EAAE,IAAA,WAAI,EAAC,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,EAAE,EAAE,SAAS,EAAE,QAAQ,CAAC;gBACrD,IAAI;gBACJ,SAAS;gBACT,OAAO;gBACP,OAAO;gBACP,OAAO;gBACP,YAAY;gBACZ,cAAc;gBACd,QAAQ;gBACR,aAAa;gBACb,OAAO;gBACP,OAAO;gBACP,KAAK;gBACL,UAAU;aACX,CAAC;YACF,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE;SACzB,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AA7CD,4BA6CC"}
|
|
@@ -77,6 +77,11 @@
|
|
|
77
77
|
"type": "string",
|
|
78
78
|
"description": "The route for the table action"
|
|
79
79
|
},
|
|
80
|
+
"relativeTo": {
|
|
81
|
+
"type": "boolean",
|
|
82
|
+
"description": "Use the current ActivatedRoute to resolve the route or not",
|
|
83
|
+
"default": false
|
|
84
|
+
},
|
|
80
85
|
"options": {
|
|
81
86
|
"type": "object",
|
|
82
87
|
"additionalProperties": true
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Tree } from '@angular-devkit/schematics';
|
|
2
|
+
import { Normalized } from '@rxap/utilities';
|
|
3
|
+
import { NormalizedAngularOptions } from '../../../../lib/angular-options';
|
|
4
|
+
import { OpenApiTableActionOptions } from './schema';
|
|
5
|
+
export interface NormalizedOpenApiTableActionOptions extends Readonly<Normalized<OpenApiTableActionOptions> & NormalizedAngularOptions> {
|
|
6
|
+
body: boolean | Record<string, string>;
|
|
7
|
+
parameters: boolean | Record<string, string>;
|
|
8
|
+
}
|
|
9
|
+
export declare function NormalizeOpenApiTableActionOptions(options: Readonly<OpenApiTableActionOptions>): NormalizedOpenApiTableActionOptions;
|
|
10
|
+
export default function (options: OpenApiTableActionOptions): (host: Tree) => import("@angular-devkit/schematics").Rule;
|