@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
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NormalizeOpenApiTableActionOptions = void 0;
|
|
4
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
+
const schematics_ts_morph_1 = require("@rxap/schematics-ts-morph");
|
|
6
|
+
const path_1 = require("path");
|
|
7
|
+
const angular_options_1 = require("../../../../lib/angular-options");
|
|
8
|
+
const assert_table_component_exists_1 = require("../../../../lib/assert-table-component-exists");
|
|
9
|
+
const table_action_1 = require("../../table-action");
|
|
10
|
+
function NormalizeOpenApiTableActionOptions(options) {
|
|
11
|
+
var _a, _b, _c;
|
|
12
|
+
const normalizedOptions = (0, table_action_1.NormalizeTableActionOptions)(options);
|
|
13
|
+
return Object.freeze(Object.assign(Object.assign({}, normalizedOptions), { operationId: options.operationId, body: (_a = options.body) !== null && _a !== void 0 ? _a : false, parameters: (_b = options.parameters) !== null && _b !== void 0 ? _b : false, scope: (_c = options.scope) !== null && _c !== void 0 ? _c : null }));
|
|
14
|
+
}
|
|
15
|
+
exports.NormalizeOpenApiTableActionOptions = NormalizeOpenApiTableActionOptions;
|
|
16
|
+
function printOptions(options) {
|
|
17
|
+
(0, angular_options_1.PrintAngularOptions)('open-api-table-action', options);
|
|
18
|
+
}
|
|
19
|
+
function default_1(options) {
|
|
20
|
+
const normalizedOptions = NormalizeOpenApiTableActionOptions(options);
|
|
21
|
+
const { refresh, confirm, tooltip, errorMessage, successMessage, priority, checkFunction, tableName, project, feature, directory, type, operationId, body, parameters, scope, } = normalizedOptions;
|
|
22
|
+
printOptions(normalizedOptions);
|
|
23
|
+
return (host) => {
|
|
24
|
+
(0, assert_table_component_exists_1.AssertTableComponentExists)(host, normalizedOptions);
|
|
25
|
+
return (0, schematics_1.chain)([
|
|
26
|
+
() => console.group('\x1b[32m[@rxap/schematics-angular:open-api-table-action]\x1b[0m'),
|
|
27
|
+
(0, schematics_ts_morph_1.CoerceOpenApiTableActionRule)({
|
|
28
|
+
directory: (0, path_1.join)(directory !== null && directory !== void 0 ? directory : '', 'methods', 'action'),
|
|
29
|
+
scope,
|
|
30
|
+
operationId,
|
|
31
|
+
body,
|
|
32
|
+
parameters,
|
|
33
|
+
type,
|
|
34
|
+
tableName,
|
|
35
|
+
refresh,
|
|
36
|
+
confirm,
|
|
37
|
+
tooltip,
|
|
38
|
+
errorMessage,
|
|
39
|
+
successMessage,
|
|
40
|
+
priority,
|
|
41
|
+
checkFunction,
|
|
42
|
+
project,
|
|
43
|
+
feature,
|
|
44
|
+
}),
|
|
45
|
+
() => console.groupEnd(),
|
|
46
|
+
]);
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
exports.default = default_1;
|
|
50
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/schematic/angular/src/schematics/table/action/open-api-table-action/index.ts"],"names":[],"mappings":";;;AAAA,2DAGoC;AACpC,mEAAyE;AAEzE,+BAA4B;AAC5B,qEAGyC;AACzC,iGAA2F;AAC3F,qDAAiE;AASjE,SAAgB,kCAAkC,CAChD,OAA4C;;IAE5C,MAAM,iBAAiB,GAAG,IAAA,0CAA2B,EAAC,OAAO,CAAC,CAAC;IAC/D,OAAO,MAAM,CAAC,MAAM,iCACf,iBAAiB,KACpB,WAAW,EAAE,OAAO,CAAC,WAAW,EAChC,IAAI,EAAE,MAAA,OAAO,CAAC,IAAI,mCAAI,KAAK,EAC3B,UAAU,EAAE,MAAA,OAAO,CAAC,UAAU,mCAAI,KAAK,EACvC,KAAK,EAAE,MAAA,OAAO,CAAC,KAAK,mCAAI,IAAI,IAC5B,CAAC;AACL,CAAC;AAXD,gFAWC;AAED,SAAS,YAAY,CAAC,OAA4C;IAChE,IAAA,qCAAmB,EAAC,uBAAuB,EAAE,OAAO,CAAC,CAAC;AACxD,CAAC;AAED,mBAAyB,OAAkC;IACzD,MAAM,iBAAiB,GAAG,kCAAkC,CAAC,OAAO,CAAC,CAAC;IACtE,MAAM,EACJ,OAAO,EACP,OAAO,EACP,OAAO,EACP,YAAY,EACZ,cAAc,EACd,QAAQ,EACR,aAAa,EACb,SAAS,EACT,OAAO,EACP,OAAO,EACP,SAAS,EACT,IAAI,EACJ,WAAW,EACX,IAAI,EACJ,UAAU,EACV,KAAK,GACN,GAAG,iBAAiB,CAAC;IAEtB,YAAY,CAAC,iBAAiB,CAAC,CAAC;IAEhC,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,iEAAiE,CAAC;YACtF,IAAA,kDAA4B,EAAC;gBAC3B,SAAS,EAAE,IAAA,WAAI,EAAC,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,EAAE,EAAE,SAAS,EAAE,QAAQ,CAAC;gBACrD,KAAK;gBACL,WAAW;gBACX,IAAI;gBACJ,UAAU;gBACV,IAAI;gBACJ,SAAS;gBACT,OAAO;gBACP,OAAO;gBACP,OAAO;gBACP,YAAY;gBACZ,cAAc;gBACd,QAAQ;gBACR,aAAa;gBACb,OAAO;gBACP,OAAO;aACR,CAAC;YACF,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE;SACzB,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAlDD,4BAkDC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TableActionOptions } from '../../table-action/schema';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
export interface OpenApiTableActionOptions extends TableActionOptions {
|
|
5
|
+
operationId: string;
|
|
6
|
+
body?: boolean | Record<string, string>;
|
|
7
|
+
parameters?: boolean | Record<string, string>;
|
|
8
|
+
scope?: string;
|
|
9
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"$id": "table-action",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"properties": {
|
|
6
|
+
"tableName": {
|
|
7
|
+
"alias": "table",
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "The name of the table action"
|
|
10
|
+
},
|
|
11
|
+
"type": {
|
|
12
|
+
"alias": "actionType",
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "The table action type string",
|
|
15
|
+
"x-prompt": "Enter the table action type string?"
|
|
16
|
+
},
|
|
17
|
+
"project": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"description": "The target project where the table action should be added."
|
|
20
|
+
},
|
|
21
|
+
"feature": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"description": "The feature name where the table action should be added.",
|
|
24
|
+
"x-prompt": "To which feature should the table action be added?"
|
|
25
|
+
},
|
|
26
|
+
"backend": {
|
|
27
|
+
"type": "string",
|
|
28
|
+
"description": "The backend that should be used to handel data",
|
|
29
|
+
"enum": [
|
|
30
|
+
"none",
|
|
31
|
+
"local",
|
|
32
|
+
"nestjs",
|
|
33
|
+
"open-api"
|
|
34
|
+
],
|
|
35
|
+
"default": "none"
|
|
36
|
+
},
|
|
37
|
+
"shared": {
|
|
38
|
+
"type": "boolean",
|
|
39
|
+
"description": "Whether the table action is shared across applications",
|
|
40
|
+
"default": false
|
|
41
|
+
},
|
|
42
|
+
"refresh": {
|
|
43
|
+
"type": "boolean",
|
|
44
|
+
"description": "Whether the table action should refresh the table after execution",
|
|
45
|
+
"default": false
|
|
46
|
+
},
|
|
47
|
+
"confirm": {
|
|
48
|
+
"type": "boolean",
|
|
49
|
+
"description": "Whether the table action should confirm before execution",
|
|
50
|
+
"default": false
|
|
51
|
+
},
|
|
52
|
+
"tooltip": {
|
|
53
|
+
"type": "string",
|
|
54
|
+
"description": "The tooltip for the table action"
|
|
55
|
+
},
|
|
56
|
+
"errorMessage": {
|
|
57
|
+
"type": "string",
|
|
58
|
+
"description": "The error message for the table action"
|
|
59
|
+
},
|
|
60
|
+
"successMessage": {
|
|
61
|
+
"type": "string",
|
|
62
|
+
"description": "The success message for the table action"
|
|
63
|
+
},
|
|
64
|
+
"checkFunction": {
|
|
65
|
+
"type": "string",
|
|
66
|
+
"description": "The check function for the table action"
|
|
67
|
+
},
|
|
68
|
+
"priority": {
|
|
69
|
+
"type": "number",
|
|
70
|
+
"description": "The priority of the table action"
|
|
71
|
+
},
|
|
72
|
+
"directory": {
|
|
73
|
+
"type": "string",
|
|
74
|
+
"description": "A directory name or absolute path for the table action. relative to the feature base path"
|
|
75
|
+
},
|
|
76
|
+
"operationId": {
|
|
77
|
+
"type": "string",
|
|
78
|
+
"description": "The open api operationId for the table action"
|
|
79
|
+
},
|
|
80
|
+
"scope": {
|
|
81
|
+
"type": "string",
|
|
82
|
+
"description": "The scope of package for the openapi classes"
|
|
83
|
+
},
|
|
84
|
+
"body": {
|
|
85
|
+
"oneOf": [
|
|
86
|
+
{
|
|
87
|
+
"type": "boolean",
|
|
88
|
+
"description": "Pass the full row as body for the operation request"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"type": "object",
|
|
92
|
+
"description": "Mapping of table columns to body properties - [request property]: [table column]",
|
|
93
|
+
"additionalProperties": true
|
|
94
|
+
}
|
|
95
|
+
]
|
|
96
|
+
},
|
|
97
|
+
"parameters": {
|
|
98
|
+
"oneOf": [
|
|
99
|
+
{
|
|
100
|
+
"type": "boolean",
|
|
101
|
+
"description": "Pass the full row as parameters for the operation request"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"type": "object",
|
|
105
|
+
"description": "Mapping of table columns to parameters properties - [request property]: [table column]",
|
|
106
|
+
"additionalProperties": true
|
|
107
|
+
}
|
|
108
|
+
]
|
|
109
|
+
},
|
|
110
|
+
"options": {
|
|
111
|
+
"type": "object",
|
|
112
|
+
"additionalProperties": true
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
"required": [
|
|
116
|
+
"type",
|
|
117
|
+
"project",
|
|
118
|
+
"feature",
|
|
119
|
+
"operationId"
|
|
120
|
+
]
|
|
121
|
+
}
|
|
@@ -14,7 +14,7 @@ function NormalizeOperationTableActionOptions(options) {
|
|
|
14
14
|
const normalizedOptions = (0, table_action_1.NormalizeTableActionOptions)(options);
|
|
15
15
|
const nestModule = (_a = options.nestModule) !== null && _a !== void 0 ? _a : normalizedOptions.tableName;
|
|
16
16
|
const context = options.context ? (0, utilities_1.dasherize)(options.context) : null;
|
|
17
|
-
return Object.
|
|
17
|
+
return Object.freeze(Object.assign(Object.assign({}, normalizedOptions), { nestModule, controllerName: (0, schematics_ts_morph_1.BuildNestControllerName)({
|
|
18
18
|
controllerName: context,
|
|
19
19
|
nestModule,
|
|
20
20
|
}), context }));
|
|
@@ -76,7 +76,9 @@ function default_1(options) {
|
|
|
76
76
|
return (host) => {
|
|
77
77
|
(0, assert_table_component_exists_1.AssertTableComponentExists)(host, normalizedOptions);
|
|
78
78
|
return (0, schematics_1.chain)([
|
|
79
|
+
() => console.group('\x1b[32m[@rxap/schematics-angular:operation-table-action]\x1b[0m'),
|
|
79
80
|
backendRule(normalizedOptions),
|
|
81
|
+
() => console.groupEnd(),
|
|
80
82
|
]);
|
|
81
83
|
};
|
|
82
84
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/schematic/angular/src/schematics/table/action/operation-table-action/index.ts"],"names":[],"mappings":";;;AAAA,2DAIoC;AACpC,mEAKmC;AACnC,+CAGyB;AACzB,+BAA4B;AAC5B,qEAGyC;AACzC,iGAA2F;AAC3F,iEAA6D;AAC7D,qDAAiE;AAQjE,SAAgB,oCAAoC,CAClD,OAAoC;;IAEpC,MAAM,iBAAiB,GAAG,IAAA,0CAA2B,EAAC,OAAO,CAAC,CAAC;IAC/D,MAAM,UAAU,GAAG,MAAA,OAAO,CAAC,UAAU,mCAAI,iBAAiB,CAAC,SAAS,CAAC;IACrE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,IAAA,qBAAS,EAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACpE,OAAO,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/schematic/angular/src/schematics/table/action/operation-table-action/index.ts"],"names":[],"mappings":";;;AAAA,2DAIoC;AACpC,mEAKmC;AACnC,+CAGyB;AACzB,+BAA4B;AAC5B,qEAGyC;AACzC,iGAA2F;AAC3F,iEAA6D;AAC7D,qDAAiE;AAQjE,SAAgB,oCAAoC,CAClD,OAAoC;;IAEpC,MAAM,iBAAiB,GAAG,IAAA,0CAA2B,EAAC,OAAO,CAAC,CAAC;IAC/D,MAAM,UAAU,GAAG,MAAA,OAAO,CAAC,UAAU,mCA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YAC7B,aAAa,EAAE,GAAI,IAAK,SAAS;YACjC,gBAAgB,EAAE,GAAG,EAAE;gBACrB,OAAO;oBACL,MAAM,EAAE,KAAK;oBACb,IAAI,EAAE,iBAAkB,IAAK,EAAE;oBAC/B,SAAS,EAAE,CAAE,EAAE,IAAI,EAAE,OAAO,EAAE,CAAE;iBACjC,CAAC;YACJ,CAAC;SACF,CAAC;KACH,CAAC,CAAC;AAEL,CAAC;AAED,SAAS,WAAW,CAAC,iBAAwD;IAE3E,MAAM,EACJ,OAAO,GACR,GAAG,iBAAiB,CAAC;IAEtB,QAAQ,OAAO,EAAE;QAEf,KAAK,4BAAY,CAAC,MAAM;YACtB,OAAO,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;KAElD;IAED,OAAO,IAAA,iBAAI,GAAE,CAAC;AAEhB,CAAC;AAED,SAAS,YAAY,CAAC,OAA8C;IAClE,IAAA,qCAAmB,EAAC,wBAAwB,EAAE,OAAO,CAAC,CAAC;AACzD,CAAC;AAED,mBAAyB,OAAoC;IAC3D,MAAM,iBAAiB,GAAG,oCAAoC,CAAC,OAAO,CAAC,CAAC;IAExE,YAAY,CAAC,iBAAiB,CAAC,CAAC;IAEhC,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,kEAAkE,CAAC;YACvF,WAAW,CAAC,iBAAiB,CAAC;YAC9B,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE;SACzB,CAAC,CAAC;IAEL,CAAC,CAAC;AACJ,CAAC;AAhBD,4BAgBC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Rule, Tree } from '@angular-devkit/schematics';
|
|
2
|
+
import { Normalized } from '@rxap/utilities';
|
|
3
|
+
import { NormalizedAngularOptions } from '../../../../lib/angular-options';
|
|
4
|
+
import { NormalizedFormComponentControl } from '../../../../lib/form-component-control';
|
|
5
|
+
import { NormalizedTableHeaderButton } from '../../../../lib/table-header-button';
|
|
6
|
+
import { FormTableHeaderButtonOptions } from './schema';
|
|
7
|
+
export interface NormalizedFormTableHeaderButtonOptions extends Omit<Readonly<Normalized<FormTableHeaderButtonOptions> & NormalizedAngularOptions & NormalizedTableHeaderButton>, 'formOptions'> {
|
|
8
|
+
options: Record<string, any>;
|
|
9
|
+
controllerName: string;
|
|
10
|
+
formComponent: string;
|
|
11
|
+
formOptions: {
|
|
12
|
+
controlList: ReadonlyArray<NormalizedFormComponentControl>;
|
|
13
|
+
role: string | null;
|
|
14
|
+
window: boolean;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export declare function NormalizeFormTableHeaderButtonOptions(options: Readonly<FormTableHeaderButtonOptions>): NormalizedFormTableHeaderButtonOptions;
|
|
18
|
+
export default function (options: FormTableHeaderButtonOptions): (host: Tree) => Rule;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NormalizeFormTableHeaderButtonOptions = 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 utilities_1 = require("@rxap/utilities");
|
|
8
|
+
const ts_morph_1 = require("ts-morph");
|
|
9
|
+
const angular_options_1 = require("../../../../lib/angular-options");
|
|
10
|
+
const assert_table_component_exists_1 = require("../../../../lib/assert-table-component-exists");
|
|
11
|
+
const form_component_control_1 = require("../../../../lib/form-component-control");
|
|
12
|
+
const index_1 = require("../../table-header-button/index");
|
|
13
|
+
function NormalizeFormTableHeaderButtonOptions(options) {
|
|
14
|
+
var _a, _b, _c, _d, _e;
|
|
15
|
+
const normalizedTableHeaderButtonOptions = (0, index_1.NormalizeTableHeaderButtonOptions)(options);
|
|
16
|
+
const nestModule = options.nestModule;
|
|
17
|
+
const formOptions = (_a = options.formOptions) !== null && _a !== void 0 ? _a : {};
|
|
18
|
+
const { tableName } = normalizedTableHeaderButtonOptions;
|
|
19
|
+
return Object.freeze(Object.assign(Object.assign({}, normalizedTableHeaderButtonOptions), { context: options.context, nestModule, controllerName: (0, schematics_ts_morph_1.BuildNestControllerName)({
|
|
20
|
+
nestModule,
|
|
21
|
+
controllerName: 'header-button',
|
|
22
|
+
}), formComponent: (0, utilities_1.CoerceSuffix)((0, utilities_1.dasherize)((_b = options.formComponent) !== null && _b !== void 0 ? _b : tableName.replace(/-table$/, '')), '-form'), customComponent: (_c = options.customComponent) !== null && _c !== void 0 ? _c : false, formOptions: {
|
|
23
|
+
window: (_d = formOptions.window) !== null && _d !== void 0 ? _d : true,
|
|
24
|
+
role: (_e = formOptions.role) !== null && _e !== void 0 ? _e : null,
|
|
25
|
+
controlList: (0, form_component_control_1.NormalizeFormComponentControlList)(formOptions.controlList),
|
|
26
|
+
} }));
|
|
27
|
+
}
|
|
28
|
+
exports.NormalizeFormTableHeaderButtonOptions = NormalizeFormTableHeaderButtonOptions;
|
|
29
|
+
function printOptions(options) {
|
|
30
|
+
(0, angular_options_1.PrintAngularOptions)('form-table-header-button', options);
|
|
31
|
+
}
|
|
32
|
+
function default_1(options) {
|
|
33
|
+
const normalizedOptions = NormalizeFormTableHeaderButtonOptions(options);
|
|
34
|
+
const { refresh, confirm, tooltip, errorMessage, successMessage, tableName, project, feature, shared, directory, overwrite, formOptions, context, backend, nestModule, controllerName, formComponent, customComponent, } = normalizedOptions;
|
|
35
|
+
printOptions(normalizedOptions);
|
|
36
|
+
return (host) => {
|
|
37
|
+
(0, assert_table_component_exists_1.AssertTableComponentExists)(host, normalizedOptions);
|
|
38
|
+
const ruleList = [
|
|
39
|
+
() => console.group('\x1b[32m[@rxap/schematics-angular:form-table-header-button]\x1b[0m'),
|
|
40
|
+
];
|
|
41
|
+
if (!customComponent) {
|
|
42
|
+
ruleList.push(() => console.log('Coerce table header button form ...'), (0, schematics_utilities_1.ExecuteSchematic)('form-component', Object.assign(Object.assign({}, formOptions), { project, name: formComponent.replace(/-form$/, ''), feature,
|
|
43
|
+
directory,
|
|
44
|
+
shared, window: true, nestModule,
|
|
45
|
+
controllerName,
|
|
46
|
+
context,
|
|
47
|
+
backend,
|
|
48
|
+
overwrite })));
|
|
49
|
+
}
|
|
50
|
+
ruleList.push(() => console.log('Coerce table header button method ...'), (0, schematics_ts_morph_1.CoerceTableHeaderButtonMethodRule)({
|
|
51
|
+
project,
|
|
52
|
+
feature,
|
|
53
|
+
shared,
|
|
54
|
+
directory,
|
|
55
|
+
overwrite,
|
|
56
|
+
tableName,
|
|
57
|
+
refresh,
|
|
58
|
+
confirm,
|
|
59
|
+
tooltip,
|
|
60
|
+
errorMessage,
|
|
61
|
+
successMessage,
|
|
62
|
+
tsMorphTransform: (project, sourceFile, classDeclaration) => {
|
|
63
|
+
const [constructorDeclaration] = (0, schematics_ts_morph_1.CoerceClassConstructor)(classDeclaration);
|
|
64
|
+
(0, schematics_ts_morph_1.CoerceParameterDeclaration)(constructorDeclaration, 'openWindowMethod', {
|
|
65
|
+
isReadonly: true,
|
|
66
|
+
scope: ts_morph_1.Scope.Private,
|
|
67
|
+
type: `Open${(0, utilities_1.classify)(formComponent)}WindowMethod`,
|
|
68
|
+
});
|
|
69
|
+
(0, schematics_ts_morph_1.CoerceImports)(sourceFile, [
|
|
70
|
+
{
|
|
71
|
+
moduleSpecifier: `../${(0, utilities_1.dasherize)(formComponent)}/open-${(0, utilities_1.dasherize)(formComponent)}-window.method`,
|
|
72
|
+
namedImports: [`Open${(0, utilities_1.classify)(formComponent)}WindowMethod`],
|
|
73
|
+
},
|
|
74
|
+
]);
|
|
75
|
+
return {
|
|
76
|
+
statements: ['return this.openWindowMethod.call(parameters).toPromise();'],
|
|
77
|
+
};
|
|
78
|
+
},
|
|
79
|
+
tsMorphTransformComponent: (project, [sourceFile]) => {
|
|
80
|
+
(0, schematics_ts_morph_1.AddComponentProvider)(sourceFile, `Open${(0, utilities_1.classify)(formComponent)}WindowMethod`, [
|
|
81
|
+
{
|
|
82
|
+
moduleSpecifier: `./${(0, utilities_1.dasherize)(formComponent)}/open-${(0, utilities_1.dasherize)(formComponent)}-window.method`,
|
|
83
|
+
namedImports: [`Open${(0, utilities_1.classify)(formComponent)}WindowMethod`],
|
|
84
|
+
},
|
|
85
|
+
]);
|
|
86
|
+
},
|
|
87
|
+
}), () => console.groupEnd());
|
|
88
|
+
return (0, schematics_1.chain)(ruleList);
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
exports.default = default_1;
|
|
92
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/schematic/angular/src/schematics/table/header-button/form-table-header-button/index.ts"],"names":[],"mappings":";;;AAAA,2DAIoC;AACpC,mEAOmC;AACnC,qEAA8D;AAC9D,+CAKyB;AACzB,uCAIkB;AAClB,qEAGyC;AACzC,iGAA2F;AAC3F,mFAGgD;AAEhD,2DAAoF;AAgBpF,SAAgB,qCAAqC,CACnD,OAA+C;;IAE/C,MAAM,kCAAkC,GAAG,IAAA,yCAAiC,EAAC,OAAO,CAAC,CAAC;IACtF,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IACtC,MAAM,WAAW,GAAG,MAAA,OAAO,CAAC,WAAW,mCAAI,EAAE,CAAC;IAC9C,MAAM,EAAE,SAAS,EAAE,GAAG,kCAAkC,CAAC;IACzD,OAAO,MAAM,CAAC,MAAM,iCACf,kCAAkC,KACrC,OAAO,EAAE,OAAO,CAAC,OAAO,EACxB,UAAU,EACV,cAAc,EAAE,IAAA,6CAAuB,EAAC;YACtC,UAAU;YACV,cAAc,EAAE,eAAe;SAChC,CAAC,EACF,aAAa,EAAE,IAAA,wBAAY,EACzB,IAAA,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AU,EACV,OAAQ,IAAA,oBAAQ,EAAC,aAAa,CAAE,cAAc,EAC9C;oBACE;wBACE,eAAe,EAAE,KAAM,IAAA,qBAAS,EAAC,aAAa,CAAE,SAAU,IAAA,qBAAS,EAAC,aAAa,CAAE,gBAAgB;wBACnG,YAAY,EAAE,CAAE,OAAQ,IAAA,oBAAQ,EAAC,aAAa,CAAE,cAAc,CAAE;qBACjE;iBACF,CACF,CAAC;YACJ,CAAC;SACF,CAAC,EACF,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,CACzB,CAAC;QAEF,OAAO,IAAA,kBAAK,EAAC,QAAQ,CAAC,CAAC;IACzB,CAAC,CAAC;AACJ,CAAC;AAzGD,4BAyGC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FormComponentControl } from '../../../../lib/form-component-control';
|
|
2
|
+
import { TableHeaderButtonOptions } from '../../table-header-button/schema';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export interface FormTableHeaderButtonOptions extends TableHeaderButtonOptions {
|
|
6
|
+
nestModule: string;
|
|
7
|
+
context: string;
|
|
8
|
+
formComponent?: string;
|
|
9
|
+
customComponent: boolean;
|
|
10
|
+
formOptions?: {
|
|
11
|
+
controlList?: Array<FormComponentControl>;
|
|
12
|
+
role?: string;
|
|
13
|
+
window?: boolean;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"$id": "table-action",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"properties": {
|
|
6
|
+
"tableName": {
|
|
7
|
+
"alias": "table",
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "The name of the table action"
|
|
10
|
+
},
|
|
11
|
+
"project": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"description": "The target project where the table action should be added."
|
|
14
|
+
},
|
|
15
|
+
"feature": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "The feature name where the table action should be added.",
|
|
18
|
+
"x-prompt": "To which feature should the table action be added?"
|
|
19
|
+
},
|
|
20
|
+
"backend": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"description": "The backend that should be used to handel data",
|
|
23
|
+
"enum": [
|
|
24
|
+
"none",
|
|
25
|
+
"local",
|
|
26
|
+
"nestjs",
|
|
27
|
+
"open-api"
|
|
28
|
+
],
|
|
29
|
+
"default": "none"
|
|
30
|
+
},
|
|
31
|
+
"shared": {
|
|
32
|
+
"type": "boolean",
|
|
33
|
+
"description": "Whether the table action is shared across applications",
|
|
34
|
+
"default": false
|
|
35
|
+
},
|
|
36
|
+
"refresh": {
|
|
37
|
+
"type": "boolean",
|
|
38
|
+
"description": "Whether the table action should refresh the table after execution",
|
|
39
|
+
"default": false
|
|
40
|
+
},
|
|
41
|
+
"confirm": {
|
|
42
|
+
"type": "boolean",
|
|
43
|
+
"description": "Whether the table action should confirm before execution",
|
|
44
|
+
"default": false
|
|
45
|
+
},
|
|
46
|
+
"tooltip": {
|
|
47
|
+
"type": "string",
|
|
48
|
+
"description": "The tooltip for the table action"
|
|
49
|
+
},
|
|
50
|
+
"errorMessage": {
|
|
51
|
+
"type": "string",
|
|
52
|
+
"description": "The error message for the table action"
|
|
53
|
+
},
|
|
54
|
+
"successMessage": {
|
|
55
|
+
"type": "string",
|
|
56
|
+
"description": "The success message for the table action"
|
|
57
|
+
},
|
|
58
|
+
"directory": {
|
|
59
|
+
"type": "string",
|
|
60
|
+
"description": "A directory name or absolute path for the table action. relative to the feature base path"
|
|
61
|
+
},
|
|
62
|
+
"permission": {
|
|
63
|
+
"type": "string"
|
|
64
|
+
},
|
|
65
|
+
"icon": {
|
|
66
|
+
"type": "string"
|
|
67
|
+
},
|
|
68
|
+
"svgIcon": {
|
|
69
|
+
"type": "string"
|
|
70
|
+
},
|
|
71
|
+
"formComponent": {
|
|
72
|
+
"type": "string"
|
|
73
|
+
},
|
|
74
|
+
"customComponent": {
|
|
75
|
+
"type": "boolean",
|
|
76
|
+
"default": false,
|
|
77
|
+
"description": "If true the schematic will not coerce the form component"
|
|
78
|
+
},
|
|
79
|
+
"formOptions": {
|
|
80
|
+
"type": "object",
|
|
81
|
+
"properties": {
|
|
82
|
+
"role": {
|
|
83
|
+
"type": "string",
|
|
84
|
+
"description": "Define the role of the form"
|
|
85
|
+
},
|
|
86
|
+
"window": {
|
|
87
|
+
"type": "boolean",
|
|
88
|
+
"description": "Whether the form can be opened in a window"
|
|
89
|
+
},
|
|
90
|
+
"controlList": {
|
|
91
|
+
"alias": "control",
|
|
92
|
+
"type": "array",
|
|
93
|
+
"items": {
|
|
94
|
+
"type": "object",
|
|
95
|
+
"properties": {
|
|
96
|
+
"type": {
|
|
97
|
+
"type": "string"
|
|
98
|
+
},
|
|
99
|
+
"name": {
|
|
100
|
+
"type": "string"
|
|
101
|
+
},
|
|
102
|
+
"state": {
|
|
103
|
+
"type": "string",
|
|
104
|
+
"description": "The initial state of the control"
|
|
105
|
+
},
|
|
106
|
+
"isRequired": {
|
|
107
|
+
"type": "boolean",
|
|
108
|
+
"description": "Whether the control value is required",
|
|
109
|
+
"default": false
|
|
110
|
+
},
|
|
111
|
+
"validatorList": {
|
|
112
|
+
"type": "array",
|
|
113
|
+
"items": {
|
|
114
|
+
"type": "string"
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
"required": [
|
|
119
|
+
"name"
|
|
120
|
+
]
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
"additionalProperties": true
|
|
125
|
+
},
|
|
126
|
+
"nestModule": {
|
|
127
|
+
"type": "string",
|
|
128
|
+
"description": "The module name for the table nest operations"
|
|
129
|
+
},
|
|
130
|
+
"context": {
|
|
131
|
+
"type": "string",
|
|
132
|
+
"description": "The context use to generate proper names for class, files, etc"
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
"required": [
|
|
136
|
+
"project",
|
|
137
|
+
"feature"
|
|
138
|
+
]
|
|
139
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Tree } from '@angular-devkit/schematics';
|
|
2
|
+
import { Normalized } from '@rxap/utilities';
|
|
3
|
+
import { NormalizedAngularOptions } from '../../../../lib/angular-options';
|
|
4
|
+
import { NormalizedTableHeaderButton } from '../../../../lib/table-header-button';
|
|
5
|
+
import { NavigationTableHeaderButtonOptions } from './schema';
|
|
6
|
+
export type NormalizedNavigationTableHeaderButtonOptions = Readonly<Normalized<NavigationTableHeaderButtonOptions> & NormalizedAngularOptions & NormalizedTableHeaderButton>;
|
|
7
|
+
export declare function NormalizeNavigationTableHeaderButtonOptions(options: Readonly<NavigationTableHeaderButtonOptions>): NormalizedNavigationTableHeaderButtonOptions;
|
|
8
|
+
export default function (options: NavigationTableHeaderButtonOptions): (host: Tree) => import("@angular-devkit/schematics").Rule;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NormalizeNavigationTableHeaderButtonOptions = void 0;
|
|
4
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
+
const schematics_ts_morph_1 = require("@rxap/schematics-ts-morph");
|
|
6
|
+
const ts_morph_1 = require("ts-morph");
|
|
7
|
+
const angular_options_1 = require("../../../../lib/angular-options");
|
|
8
|
+
const assert_table_component_exists_1 = require("../../../../lib/assert-table-component-exists");
|
|
9
|
+
const index_1 = require("../../table-header-button/index");
|
|
10
|
+
function NormalizeNavigationTableHeaderButtonOptions(options) {
|
|
11
|
+
var _a;
|
|
12
|
+
const normalizedTableHeaderButtonOptions = (0, index_1.NormalizeTableHeaderButtonOptions)(options);
|
|
13
|
+
return Object.freeze(Object.assign(Object.assign({}, normalizedTableHeaderButtonOptions), { route: options.route, relativeTo: (_a = options.relativeTo) !== null && _a !== void 0 ? _a : false }));
|
|
14
|
+
}
|
|
15
|
+
exports.NormalizeNavigationTableHeaderButtonOptions = NormalizeNavigationTableHeaderButtonOptions;
|
|
16
|
+
function printOptions(options) {
|
|
17
|
+
(0, angular_options_1.PrintAngularOptions)('navigation-table-header-button', options);
|
|
18
|
+
}
|
|
19
|
+
function default_1(options) {
|
|
20
|
+
const normalizedOptions = NormalizeNavigationTableHeaderButtonOptions(options);
|
|
21
|
+
const { refresh, confirm, tooltip, errorMessage, successMessage, tableName, project, feature, shared, directory, overwrite, route, relativeTo, } = normalizedOptions;
|
|
22
|
+
printOptions(normalizedOptions);
|
|
23
|
+
return (host) => {
|
|
24
|
+
(0, assert_table_component_exists_1.AssertTableComponentExists)(host, normalizedOptions);
|
|
25
|
+
return (0, schematics_1.chain)([
|
|
26
|
+
() => console.group('\x1b[32m[@rxap/schematics-angular:navigation-table-header-button]\x1b[0m'),
|
|
27
|
+
() => console.log('Coerce table header button method ...'),
|
|
28
|
+
(0, schematics_ts_morph_1.CoerceTableHeaderButtonMethodRule)({
|
|
29
|
+
project,
|
|
30
|
+
feature,
|
|
31
|
+
shared,
|
|
32
|
+
directory,
|
|
33
|
+
overwrite,
|
|
34
|
+
tableName,
|
|
35
|
+
refresh,
|
|
36
|
+
confirm,
|
|
37
|
+
tooltip,
|
|
38
|
+
errorMessage,
|
|
39
|
+
successMessage,
|
|
40
|
+
tsMorphTransform: (project, sourceFile, classDeclaration) => {
|
|
41
|
+
const [constructorDeclaration] = (0, schematics_ts_morph_1.CoerceClassConstructor)(classDeclaration);
|
|
42
|
+
if (relativeTo) {
|
|
43
|
+
(0, schematics_ts_morph_1.CoerceParameterDeclaration)(constructorDeclaration, 'route', {
|
|
44
|
+
isReadonly: true,
|
|
45
|
+
scope: ts_morph_1.Scope.Private,
|
|
46
|
+
type: 'ActivatedRoute',
|
|
47
|
+
});
|
|
48
|
+
(0, schematics_ts_morph_1.CoerceImports)(sourceFile, [
|
|
49
|
+
{
|
|
50
|
+
moduleSpecifier: '@angular/router',
|
|
51
|
+
namedImports: ['ActivatedRoute'],
|
|
52
|
+
},
|
|
53
|
+
]);
|
|
54
|
+
}
|
|
55
|
+
(0, schematics_ts_morph_1.CoerceParameterDeclaration)(constructorDeclaration, 'router', {
|
|
56
|
+
isReadonly: true,
|
|
57
|
+
scope: ts_morph_1.Scope.Private,
|
|
58
|
+
type: 'Router',
|
|
59
|
+
});
|
|
60
|
+
(0, schematics_ts_morph_1.CoerceImports)(sourceFile, [
|
|
61
|
+
{
|
|
62
|
+
moduleSpecifier: '@angular/router',
|
|
63
|
+
namedImports: ['Router'],
|
|
64
|
+
},
|
|
65
|
+
]);
|
|
66
|
+
if (relativeTo) {
|
|
67
|
+
return {
|
|
68
|
+
statements: [`return this.router.navigate(['${route}'], { relativeTo: this.route })`],
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
return {
|
|
73
|
+
statements: [`return this.router.navigate(['${route}'])`],
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
}),
|
|
78
|
+
() => console.groupEnd(),
|
|
79
|
+
() => console.log('\x1b[32m[/@rxap/schematics-angular:navigation-table-header-button]\x1b[0m'),
|
|
80
|
+
]);
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
exports.default = default_1;
|
|
84
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/schematic/angular/src/schematics/table/header-button/navigation-table-header-button/index.ts"],"names":[],"mappings":";;;AAAA,2DAGoC;AACpC,mEAKmC;AAEnC,uCAAiC;AACjC,qEAGyC;AACzC,iGAA2F;AAE3F,2DAAoF;AAKpF,SAAgB,2CAA2C,CACzD,OAAqD;;IAErD,MAAM,kCAAkC,GAAG,IAAA,yCAAiC,EAAC,OAAO,CAAC,CAAC;IACtF,OAAO,MAAM,CAAC,MAAM,iCACf,kCAAkC,KACrC,KAAK,EAAE,OAAO,CAAC,KAAK,EACpB,UAAU,EAAE,MAAA,OAAO,C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