@rxap/schematic-angular 16.1.0-dev.9 → 16.1.1-dev.0
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 +358 -0
- package/README.md +1 -1
- package/collection.json +5 -0
- package/package.json +48 -41
- 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 +1 -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 +6 -4
- package/src/lib/minimum-table-component-options.js +87 -29
- package/src/lib/minimum-table-component-options.js.map +1 -1
- package/src/lib/minimum-table-options.d.ts +10 -7
- package/src/lib/minimum-table-options.js +9 -6
- 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 +4 -6
- package/src/lib/table-header-button.js +2 -1
- 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 +3 -3
- 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 +5 -5
- package/src/schematics/accordion/accordion-component/index.d.ts +3 -1
- package/src/schematics/accordion/accordion-component/index.js +15 -8
- 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 +2 -2
- package/src/schematics/accordion/accordion-item-component/files/component/__componentName__.component.ts.template +0 -2
- package/src/schematics/accordion/accordion-item-component/index.js +3 -3
- 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 +9 -7
- 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/files/component/__componentName__.component.html.template +1 -1
- package/src/schematics/accordion/item/accordion-item-tree-table-component/files/component/__componentName__.component.ts.template +3 -3
- 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/files/form/__componentName__.component.html.template +1 -1
- package/src/schematics/data-grid-component/index.d.ts +1 -1
- package/src/schematics/data-grid-component/index.js +8 -7
- 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/files/component/__componentName__.component.html.template +1 -1
- 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.js +1 -1
- package/src/schematics/form/control/input-form-control/index.js.map +1 -1
- package/src/schematics/form/control/select-form-control/index.js +1 -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 +3 -3
- package/src/schematics/form/control/table-select-form-control/index.js.map +1 -1
- package/src/schematics/form/form-component/files/component/__componentName__.component.ts.template +0 -2
- package/src/schematics/form/form-component/index.d.ts +1 -1
- package/src/schematics/form/form-component/index.js +1 -1
- package/src/schematics/form/form-component/index.js.map +1 -1
- package/src/schematics/form/form-control/index.js +1 -1
- 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 +16 -9
- 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 +1 -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 +46 -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 +4 -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 +1 -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 +10 -3
- package/src/schematics/table/header-button/form-table-header-button/index.js +57 -48
- package/src/schematics/table/header-button/form-table-header-button/index.js.map +1 -1
- package/src/schematics/table/header-button/form-table-header-button/schema.d.ts +8 -0
- package/src/schematics/table/header-button/form-table-header-button/schema.json +17 -1
- package/src/schematics/table/header-button/navigation-table-header-button/index.js +30 -8
- package/src/schematics/table/header-button/navigation-table-header-button/index.js.map +1 -1
- package/src/schematics/table/header-button/navigation-table-header-button/schema.d.ts +1 -0
- package/src/schematics/table/header-button/navigation-table-header-button/schema.json +8 -6
- package/src/schematics/table/table-action/index.js +1 -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 +31 -40
- package/src/schematics/table/table-component/files/component/__componentName__.component.ts.template +17 -5
- package/src/schematics/table/table-component/index.d.ts +6 -8
- package/src/schematics/table/table-component/index.js +41 -28
- package/src/schematics/table/table-component/index.js.map +1 -1
- package/src/schematics/table/table-component/schema.json +297 -218
- package/src/schematics/table/table-header-button/index.d.ts +2 -4
- package/src/schematics/table/table-header-button/index.js +1 -1
- package/src/schematics/table/table-header-button/index.js.map +1 -1
- package/src/schematics/table/table-header-button/schema.d.ts +2 -1
- 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 -6
- package/src/schematics/table/tree-table-component/index.d.ts +1 -1
- package/src/schematics/table/tree-table-component/index.js +20 -25
- package/src/schematics/table/tree-table-component/index.js.map +1 -1
- package/src/schematics/table/tree-table-component/schema.json +90 -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
|
@@ -8,8 +8,9 @@ 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 index_1 = require("../../table-header-button/index");
|
|
10
10
|
function NormalizeNavigationTableHeaderButtonOptions(options) {
|
|
11
|
+
var _a;
|
|
11
12
|
const normalizedTableHeaderButtonOptions = (0, index_1.NormalizeTableHeaderButtonOptions)(options);
|
|
12
|
-
return Object.
|
|
13
|
+
return Object.freeze(Object.assign(Object.assign({}, normalizedTableHeaderButtonOptions), { route: options.route, relativeTo: (_a = options.relativeTo) !== null && _a !== void 0 ? _a : false }));
|
|
13
14
|
}
|
|
14
15
|
exports.NormalizeNavigationTableHeaderButtonOptions = NormalizeNavigationTableHeaderButtonOptions;
|
|
15
16
|
function printOptions(options) {
|
|
@@ -17,7 +18,7 @@ function printOptions(options) {
|
|
|
17
18
|
}
|
|
18
19
|
function default_1(options) {
|
|
19
20
|
const normalizedOptions = NormalizeNavigationTableHeaderButtonOptions(options);
|
|
20
|
-
const { refresh, confirm, tooltip, errorMessage, successMessage, tableName, project, feature, shared, directory, overwrite, route, } = normalizedOptions;
|
|
21
|
+
const { refresh, confirm, tooltip, errorMessage, successMessage, tableName, project, feature, shared, directory, overwrite, route, relativeTo, } = normalizedOptions;
|
|
21
22
|
printOptions(normalizedOptions);
|
|
22
23
|
return (host) => {
|
|
23
24
|
(0, assert_table_component_exists_1.AssertTableComponentExists)(host, normalizedOptions);
|
|
@@ -38,23 +39,44 @@ function default_1(options) {
|
|
|
38
39
|
successMessage,
|
|
39
40
|
tsMorphTransform: (project, sourceFile, classDeclaration) => {
|
|
40
41
|
const [constructorDeclaration] = (0, schematics_ts_morph_1.CoerceClassConstructor)(classDeclaration);
|
|
41
|
-
(
|
|
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', {
|
|
42
56
|
isReadonly: true,
|
|
43
57
|
scope: ts_morph_1.Scope.Private,
|
|
44
|
-
type: '
|
|
58
|
+
type: 'Router',
|
|
45
59
|
});
|
|
46
60
|
(0, schematics_ts_morph_1.CoerceImports)(sourceFile, [
|
|
47
61
|
{
|
|
48
62
|
moduleSpecifier: '@angular/router',
|
|
49
|
-
namedImports: ['
|
|
63
|
+
namedImports: ['Router'],
|
|
50
64
|
},
|
|
51
65
|
]);
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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
|
+
}
|
|
55
76
|
},
|
|
56
77
|
}),
|
|
57
78
|
() => console.groupEnd(),
|
|
79
|
+
() => console.log('\x1b[32m[/@rxap/schematics-angular:navigation-table-header-button]\x1b[0m'),
|
|
58
80
|
]);
|
|
59
81
|
};
|
|
60
82
|
}
|
|
@@ -1 +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
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/schematic/angular/src/schematics/table/header-button/navigation-table-header-button/index.ts"],"names":[],"mappings":"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"}
|
|
@@ -68,18 +68,20 @@
|
|
|
68
68
|
"svgIcon": {
|
|
69
69
|
"type": "string"
|
|
70
70
|
},
|
|
71
|
-
"options": {
|
|
72
|
-
"type": "object",
|
|
73
|
-
"additionalProperties": true
|
|
74
|
-
},
|
|
75
71
|
"route": {
|
|
76
72
|
"type": "string",
|
|
77
73
|
"description": "The route path for the table action"
|
|
74
|
+
},
|
|
75
|
+
"relativeTo": {
|
|
76
|
+
"type": "boolean",
|
|
77
|
+
"description": "Indicates if the route path should be relative to the current activated route",
|
|
78
|
+
"default": false
|
|
78
79
|
}
|
|
79
80
|
},
|
|
80
81
|
"required": [
|
|
81
|
-
"
|
|
82
|
+
"options",
|
|
82
83
|
"project",
|
|
83
|
-
"feature"
|
|
84
|
+
"feature",
|
|
85
|
+
"route"
|
|
84
86
|
]
|
|
85
87
|
}
|
|
@@ -12,7 +12,7 @@ function NormalizeTableActionOptions(options) {
|
|
|
12
12
|
const normalizedAngularOptions = (0, angular_options_1.NormalizeAngularOptions)(options);
|
|
13
13
|
const normalizedTableRowAction = (0, table_row_action_1.NormalizeTableRowAction)(options);
|
|
14
14
|
const tableName = (0, schematics_utilities_1.CoerceSuffix)((0, schematics_utilities_1.dasherize)(options.tableName), '-table');
|
|
15
|
-
return Object.
|
|
15
|
+
return Object.freeze(Object.assign(Object.assign(Object.assign({}, normalizedTableRowAction), normalizedAngularOptions), { tableName }));
|
|
16
16
|
}
|
|
17
17
|
exports.NormalizeTableActionOptions = NormalizeTableActionOptions;
|
|
18
18
|
function printOptions(options) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/angular/src/schematics/table/table-action/index.ts"],"names":[],"mappings":";;;AAAA,2DAGoC;AACpC,mEAAkE;AAClE,qEAGoC;AAEpC,+BAA4B;AAC5B,kEAIsC;AACtC,8FAAwF;AACxF,oEAAwE;AAKxE,SAAgB,2BAA2B,CACzC,OAAqC;IAErC,MAAM,wBAAwB,GAAG,IAAA,yCAAuB,EAAC,OAAO,CAAC,CAAC;IAClE,MAAM,wBAAwB,GAAG,IAAA,0CAAuB,EAAC,OAAO,CAAC,CAAC;IAClE,MAAM,SAAS,GAAG,IAAA,mCAAY,EAAC,IAAA,gCAAS,EAAC,OAAO,CAAC,SAAS,CAAC,EAAE,QAAQ,CAAC,CAAC;IACvE,OAAO,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/angular/src/schematics/table/table-action/index.ts"],"names":[],"mappings":";;;AAAA,2DAGoC;AACpC,mEAAkE;AAClE,qEAGoC;AAEpC,+BAA4B;AAC5B,kEAIsC;AACtC,8FAAwF;AACxF,oEAAwE;AAKxE,SAAgB,2BAA2B,CACzC,OAAqC;IAErC,MAAM,wBAAwB,GAAG,IAAA,yCAAuB,EAAC,OAAO,CAAC,CAAC;IAClE,MAAM,wBAAwB,GAAG,IAAA,0CAAuB,EAAC,OAAO,CAAC,CAAC;IAClE,MAAM,SAAS,GAAG,IAAA,mCAAY,EAAC,IAAA,gCAAS,EAAC,OAAO,CAAC,SAAS,CAAC,EAAE,QAAQ,CAAC,CAAC;IACvE,OAAO,MAAM,CAAC,MAAM,+CACf,wBAAwB,GACxB,wBAAwB,KAC3B,SAAS,IACT,CAAC;AACL,CAAC;AAXD,kEAWC;AAED,SAAS,YAAY,CAAC,OAAqC;IACzD,IAAA,qCAAmB,EAAC,cAAc,EAAE,OAAO,CAAC,CAAC;AAC/C,CAAC;AAED,mBAAyB,OAA2B;IAClD,MAAM,iBAAiB,GAAG,2BAA2B,CAAC,OAAO,CAAC,CAAC;IAC/D,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,GACL,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,wDAAwD,CAAC;YAC7E,IAAA,2CAAqB,EAAC;gBACpB,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;aACR,CAAC;YACF,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE;SACzB,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AA1CD,4BA0CC"}
|
|
@@ -65,6 +65,14 @@
|
|
|
65
65
|
"type": "string",
|
|
66
66
|
"description": "The check function for the table action"
|
|
67
67
|
},
|
|
68
|
+
"color": {
|
|
69
|
+
"type": "string",
|
|
70
|
+
"description": "Value for the color input of the mat-button / mat-icon component"
|
|
71
|
+
},
|
|
72
|
+
"cssClass": {
|
|
73
|
+
"type": "string",
|
|
74
|
+
"description": "Additional CSS classes added to the button element"
|
|
75
|
+
},
|
|
68
76
|
"priority": {
|
|
69
77
|
"type": "number",
|
|
70
78
|
"description": "The priority of the table action"
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
rxapCardProgressBar
|
|
13
13
|
[loading$]="tableDataSourceDirective.loading$"
|
|
14
14
|
></mat-progress-bar>
|
|
15
|
-
<mat-card-header class="min-h-full h-12">
|
|
15
|
+
<mat-card-header class="min-h-full h-12<% if (!headerButton && hasWithoutTitle) { %> justify-end<% } %>">
|
|
16
16
|
<% if (!hasWithoutTitle) { %>
|
|
17
17
|
<mat-card-title i18n><%= title %></mat-card-title>
|
|
18
18
|
<% } %>
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
</button>
|
|
31
31
|
<mat-card-subtitle i18n><%= headerButton.label %></mat-card-subtitle>
|
|
32
32
|
<% } %>
|
|
33
|
-
<rxap-table-column-menu matCard #rxapTableColumns="rxapTableColumns"
|
|
33
|
+
<rxap-table-column-menu matCard #rxapTableColumns="rxapTableColumns" <% if (!headerButton && hasWithoutTitle) { %>inline<% } %>>
|
|
34
34
|
<% if (selectColumn) { %>
|
|
35
35
|
<rxap-table-column-option hidden name="select">
|
|
36
36
|
<ng-container i18n>Select</ng-container>
|
|
@@ -47,12 +47,14 @@
|
|
|
47
47
|
<ng-container i18n>Actions</ng-container>
|
|
48
48
|
</rxap-table-column-option>
|
|
49
49
|
<% } %>
|
|
50
|
+
<% if (hasShowArchivedSlide) { %>
|
|
50
51
|
<mat-divider></mat-divider>
|
|
51
52
|
<span mat-menu-item>
|
|
52
53
|
<rxap-table-show-archived-slide
|
|
53
54
|
[paginator]="paginator"
|
|
54
55
|
></rxap-table-show-archived-slide>
|
|
55
56
|
</span>
|
|
57
|
+
<% } %>
|
|
56
58
|
</rxap-table-column-menu>
|
|
57
59
|
</mat-card-header>
|
|
58
60
|
|
|
@@ -63,7 +65,7 @@
|
|
|
63
65
|
*ngIf="tableDataSourceDirective.hasError$ | async"
|
|
64
66
|
[refresh]="tableDataSourceDirective.retry">
|
|
65
67
|
</rxap-data-source-error>
|
|
66
|
-
<div class="table-scroll-container mt-4 overflow-x-auto overscroll-
|
|
68
|
+
<div class="table-scroll-container mt-4 overflow-x-auto overscroll-auto">
|
|
67
69
|
<table
|
|
68
70
|
[ngClass]="{ 'hidden': tableDataSourceDirective.hasError$ | async }"
|
|
69
71
|
[paginator]="paginator"
|
|
@@ -88,23 +90,6 @@
|
|
|
88
90
|
></td>
|
|
89
91
|
</ng-container>
|
|
90
92
|
<% } %>
|
|
91
|
-
<ng-container matColumnDef="removedAt">
|
|
92
|
-
<th mat-header-cell *matHeaderCellDef>
|
|
93
|
-
<ng-container i18n>Removed at</ng-container>
|
|
94
|
-
</th>
|
|
95
|
-
<td
|
|
96
|
-
mat-cell
|
|
97
|
-
[rxap-date-cell]="element.__removedAt"
|
|
98
|
-
*matCellDef="let element"
|
|
99
|
-
></td>
|
|
100
|
-
</ng-container>
|
|
101
|
-
<ng-container matColumnDef="uuid">
|
|
102
|
-
<th mat-header-cell *matHeaderCellDef mat-sort-header>
|
|
103
|
-
<ng-container i18n>UUID</ng-container>
|
|
104
|
-
</th>
|
|
105
|
-
|
|
106
|
-
<td mat-cell *matCellDef="let element">{{ element?.uuid }}</td>
|
|
107
|
-
</ng-container>
|
|
108
93
|
<% if (actionList.length) { %>
|
|
109
94
|
<ng-container matColumnDef="actions" stickyEnd>
|
|
110
95
|
<th mat-header-cell *matHeaderCellDef>
|
|
@@ -115,6 +100,8 @@
|
|
|
115
100
|
<button
|
|
116
101
|
rxapTableRowHeaderAction="<%= action.type %>"
|
|
117
102
|
mat-icon-button
|
|
103
|
+
<% if (action.color) { %>color="<%= action.color %>"<% } %>
|
|
104
|
+
<% if (action.cssClass) { %>class="<%= action.cssClass %>"<% } %>
|
|
118
105
|
*ngIf="selected | rxapRowActionCheck:'<%= action.type %>'"
|
|
119
106
|
<% if (action.permission) { %>rxapHasEnablePermission="<%= action.permission %>"<% } %>
|
|
120
107
|
matTooltip
|
|
@@ -137,6 +124,8 @@
|
|
|
137
124
|
<button
|
|
138
125
|
rxapTableRowAction="<%= action.type %>"
|
|
139
126
|
[element]="element"
|
|
127
|
+
<% if (action.color) { %>color="<%= action.color %>"<% } %>
|
|
128
|
+
<% if (action.cssClass) { %>class="<%= action.cssClass %>"<% } %>
|
|
140
129
|
mat-icon-button
|
|
141
130
|
*ngIf="element | rxapRowActionCheck:'<%= action.type %>'"
|
|
142
131
|
<% if (action.permission) { %>rxapHasEnablePermission="<%= action.permission %>"<% } %>
|
|
@@ -154,51 +143,51 @@
|
|
|
154
143
|
</ng-container>
|
|
155
144
|
<% } %>
|
|
156
145
|
<% for (const column of columnList) { %>
|
|
157
|
-
<% if (column.
|
|
146
|
+
<% if (column.role === 'copy-to-clipboard') { %>
|
|
158
147
|
<ng-container matColumnDef="<%= column.name %>">
|
|
159
148
|
<th mat-header-cell *matHeaderCellDef mat-sort-header>
|
|
160
149
|
<ng-container i18n><%= column.title %></ng-container>
|
|
161
150
|
</th>
|
|
162
|
-
<td *matCellDef="let element" mat-cell [rxap-copy-to-clipboard-cell]="element?.<%= column.propertyPath %>"></td>
|
|
151
|
+
<td *matCellDef="let element" mat-cell <% if (column.cssClass) { %>class="<%= column.cssClass %>"<% } %> [rxap-copy-to-clipboard-cell]="element?.<%= column.propertyPath %>"></td>
|
|
163
152
|
</ng-container>
|
|
164
|
-
<% } else if (column.
|
|
153
|
+
<% } else if (column.role === 'link') { %>
|
|
165
154
|
<ng-container matColumnDef="<%= column.name %>">
|
|
166
155
|
<th mat-header-cell *matHeaderCellDef mat-sort-header>
|
|
167
156
|
<ng-container i18n><%= column.title %></ng-container>
|
|
168
157
|
</th>
|
|
169
|
-
<td *matCellDef="let element" mat-cell [rxap-link-cell]="element?.<%= column.propertyPath %>"></td>
|
|
158
|
+
<td *matCellDef="let element" mat-cell <% if (column.cssClass) { %>class="<%= column.cssClass %>"<% } %> [rxap-link-cell]="element?.<%= column.propertyPath %>"></td>
|
|
170
159
|
</ng-container>
|
|
171
|
-
<% } else if (column.
|
|
160
|
+
<% } else if (column.role === 'date') { %>
|
|
172
161
|
<ng-container matColumnDef="<%= column.name %>">
|
|
173
162
|
<th mat-header-cell *matHeaderCellDef mat-sort-header>
|
|
174
163
|
<ng-container i18n><%= column.title %></ng-container>
|
|
175
164
|
</th>
|
|
176
165
|
|
|
177
|
-
<td *matCellDef="let element" mat-cell [rxap-date-cell]="element?.<%= column.propertyPath %>" format="dd.MM.yyyy HH:mm:ss"></td>
|
|
166
|
+
<td *matCellDef="let element" mat-cell <% if (column.cssClass) { %>class="<%= column.cssClass %>"<% } %> [rxap-date-cell]="element?.<%= column.propertyPath %>" format="dd.MM.yyyy HH:mm:ss"></td>
|
|
178
167
|
</ng-container>
|
|
179
|
-
<% } else if (column.
|
|
168
|
+
<% } else if (column.role === 'boolean') { %>
|
|
180
169
|
<ng-container matColumnDef="<%= column.name %>">
|
|
181
170
|
<th mat-header-cell *matHeaderCellDef mat-sort-header>
|
|
182
171
|
<ng-container i18n><%= column.title %></ng-container>
|
|
183
172
|
</th>
|
|
184
173
|
|
|
185
|
-
<td *matCellDef="let element" mat-cell [rxap-boolean-cell]="element?.<%= column.propertyPath %>"></td>
|
|
174
|
+
<td *matCellDef="let element" mat-cell <% if (column.cssClass) { %>class="<%= column.cssClass %>"<% } %> [rxap-boolean-cell]="element?.<%= column.propertyPath %>"></td>
|
|
186
175
|
</ng-container>
|
|
187
|
-
<% } else if (column.
|
|
176
|
+
<% } else if (column.role === 'icon') { %>
|
|
188
177
|
<ng-container matColumnDef="<%= column.name %>">
|
|
189
178
|
<th mat-header-cell *matHeaderCellDef mat-sort-header>
|
|
190
179
|
<ng-container i18n><%= column.title %></ng-container>
|
|
191
180
|
</th>
|
|
192
181
|
|
|
193
|
-
<td *matCellDef="let element" mat-cell [rxap-icon-cell]="element?.<%= column.propertyPath %>"></td>
|
|
182
|
+
<td *matCellDef="let element" mat-cell <% if (column.cssClass) { %>class="<%= column.cssClass %>"<% } %> [rxap-icon-cell]="element?.<%= column.propertyPath %>"></td>
|
|
194
183
|
</ng-container>
|
|
195
|
-
<% } else if (column.
|
|
184
|
+
<% } else if (column.role === 'component') { %>
|
|
196
185
|
<ng-container matColumnDef="<%= column.name %>">
|
|
197
186
|
<th mat-header-cell *matHeaderCellDef mat-sort-header>
|
|
198
187
|
<ng-container i18n><%= column.title %></ng-container>
|
|
199
188
|
</th>
|
|
200
189
|
|
|
201
|
-
<td *matCellDef="let element" mat-cell
|
|
190
|
+
<td *matCellDef="let element" mat-cell <% if (column.cssClass) { %>class="<%= column.cssClass %>"<% } %> <%= prefix %>-<%= column.name %>-cell [element]="element" [value]="element?.<%= column.propertyPath %>"></td>
|
|
202
191
|
</ng-container>
|
|
203
192
|
<% } else { %>
|
|
204
193
|
<ng-container matColumnDef="<%= column.name %>">
|
|
@@ -206,7 +195,15 @@
|
|
|
206
195
|
<ng-container i18n><%= column.title %></ng-container>
|
|
207
196
|
</th>
|
|
208
197
|
|
|
209
|
-
<td mat-cell
|
|
198
|
+
<td mat-cell <% if (column.cssClass) { %>class="<%= column.cssClass %>"<% } %> *matCellDef="let element">
|
|
199
|
+
<% if (column.template) { %>
|
|
200
|
+
<%= column.template %>
|
|
201
|
+
<% } else if (column.pipeList.length) { %>
|
|
202
|
+
{{ element?.<%= column.propertyPath %><% for (const pipe of column.pipeList) { %> | <%= pipe.name %><% } %> }}
|
|
203
|
+
<% } else { %>
|
|
204
|
+
{{ element?.<%= column.propertyPath %> }}
|
|
205
|
+
<% } %>
|
|
206
|
+
</td>
|
|
210
207
|
</ng-container>
|
|
211
208
|
<% } %>
|
|
212
209
|
<% } %>
|
|
@@ -219,12 +216,6 @@
|
|
|
219
216
|
<th mat-header-cell *matHeaderCellDef></th>
|
|
220
217
|
</ng-container>
|
|
221
218
|
<% } %>
|
|
222
|
-
<ng-container matColumnDef="filter_removedAt">
|
|
223
|
-
<th mat-header-cell *matHeaderCellDef></th>
|
|
224
|
-
</ng-container>
|
|
225
|
-
<ng-container matColumnDef="filter_uuid">
|
|
226
|
-
<th mat-header-cell *matHeaderCellDef></th>
|
|
227
|
-
</ng-container>
|
|
228
219
|
<% if (actionList.length) { %>
|
|
229
220
|
<ng-container matColumnDef="filter_actions" stickyEnd>
|
|
230
221
|
<th mat-header-cell *matHeaderCellDef></th>
|
|
@@ -244,7 +235,7 @@
|
|
|
244
235
|
<ng-container i18n><%= column.title %></ng-container>
|
|
245
236
|
</mat-checkbox>
|
|
246
237
|
<% } else { %>
|
|
247
|
-
<mat-form-field class="w-
|
|
238
|
+
<mat-form-field class="w-full pt-3">
|
|
248
239
|
<mat-label i18n><%= column.title %></mat-label>
|
|
249
240
|
<input
|
|
250
241
|
matInput
|
package/src/schematics/table/table-component/files/component/__componentName__.component.ts.template
CHANGED
|
@@ -14,13 +14,11 @@ import {
|
|
|
14
14
|
TableColumnMenuModule, TableHeaderButtonDirective,
|
|
15
15
|
TableDataSourceDirective,
|
|
16
16
|
TableFilterModule, TableRowActionsModule,
|
|
17
|
-
TableRowControlsModule,
|
|
18
17
|
} from '@rxap/material-table-system';
|
|
19
18
|
import { MatCardModule } from '@angular/material/card';
|
|
20
19
|
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
|
21
20
|
import { CardProgressBarDirective } from '@rxap/material-directives/card';
|
|
22
21
|
import { MatTableModule } from '@angular/material/table';
|
|
23
|
-
import { FlexLayoutModule } from '@angular/flex-layout';
|
|
24
22
|
import { RxapFormsModule } from '@rxap/forms';
|
|
25
23
|
import { ReactiveFormsModule } from '@angular/forms';
|
|
26
24
|
import { RouterModule } from '@angular/router';
|
|
@@ -40,6 +38,14 @@ import { CommonModule } from '@angular/common';
|
|
|
40
38
|
import { DataSourceErrorComponent } from '@rxap/data-source';
|
|
41
39
|
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
42
40
|
import { MatSnackBarModule } from '@angular/material/snack-bar';
|
|
41
|
+
<% for (const column of columnList) { %>
|
|
42
|
+
<% if (column.role === 'component') { %>
|
|
43
|
+
import { <%= classify(column.name) %>CellComponent } from './<%= dasherize(column.name) %>-cell/<%= dasherize(column.name) %>-cell.component';
|
|
44
|
+
<% } %>
|
|
45
|
+
<% for (const pipe of column.pipeList) { %>
|
|
46
|
+
import { <%= pipe.namedImport %> } from '<%= pipe.moduleSpecifier %>';
|
|
47
|
+
<% } %>
|
|
48
|
+
<% } %>
|
|
43
49
|
|
|
44
50
|
@Component({
|
|
45
51
|
selector: '<%= prefix %>-<%= name %>-table',
|
|
@@ -49,12 +55,19 @@ import { MatSnackBarModule } from '@angular/material/snack-bar';
|
|
|
49
55
|
animations: [ RowAnimation ],
|
|
50
56
|
standalone: true,
|
|
51
57
|
imports: [
|
|
58
|
+
<% for (const column of columnList) { %>
|
|
59
|
+
<% if (column.role === 'component') { %>
|
|
60
|
+
<%= classify(column.name) %>CellComponent,
|
|
61
|
+
<% } %>
|
|
62
|
+
<% for (const pipe of column.pipeList) { %>
|
|
63
|
+
<%= pipe.namedImport %>,
|
|
64
|
+
<% } %>
|
|
65
|
+
<% } %>
|
|
52
66
|
CommonModule,
|
|
53
67
|
MatCardModule,
|
|
54
68
|
MatProgressBarModule,
|
|
55
69
|
CardProgressBarDirective,
|
|
56
70
|
MatTableModule,
|
|
57
|
-
FlexLayoutModule,
|
|
58
71
|
TableDataSourceDirective,
|
|
59
72
|
TableFilterModule,
|
|
60
73
|
RxapFormsModule,
|
|
@@ -65,7 +78,6 @@ import { MatSnackBarModule } from '@angular/material/snack-bar';
|
|
|
65
78
|
<% if (hasNavigationBackHeader) { %>
|
|
66
79
|
NavigateBackButtonComponent,
|
|
67
80
|
<% } %>
|
|
68
|
-
TableRowControlsModule,
|
|
69
81
|
TableColumnMenuModule,
|
|
70
82
|
DateCellComponent,
|
|
71
83
|
|
|
@@ -97,4 +109,4 @@ export class <%= classify(componentName) %>Component {
|
|
|
97
109
|
|
|
98
110
|
}
|
|
99
111
|
|
|
100
|
-
export default <%= classify(name) %>TableComponent
|
|
112
|
+
<% if (exportDefault) { %>export default <%= classify(name) %>TableComponent;<% } %>
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
import { Rule } from '@angular-devkit/schematics';
|
|
2
|
-
import { FormDefinitionControl,
|
|
2
|
+
import { FormDefinitionControl, GetPageOperationProperty } from '@rxap/schematics-ts-morph';
|
|
3
3
|
import { Normalized } from '@rxap/utilities';
|
|
4
4
|
import { NormalizedAngularOptions } from '../../../lib/angular-options';
|
|
5
|
-
import { NormalizedTableAction } from '../../../lib/table-action';
|
|
6
5
|
import { NormalizedTableColumn } from '../../../lib/table-column';
|
|
7
6
|
import { NormalizedTableOptions } from '../../../lib/table-options';
|
|
7
|
+
import { NormalizedTableProperty } from '../../../lib/table-property';
|
|
8
8
|
import { TableComponentOptions } from './schema';
|
|
9
|
-
export interface NormalizedTableComponentOptions extends Readonly<Normalized<TableComponentOptions
|
|
10
|
-
name: string;
|
|
11
|
-
controllerName: string;
|
|
12
|
-
columnList: NormalizedTableColumn[];
|
|
13
|
-
actionList: NormalizedTableAction[];
|
|
9
|
+
export interface NormalizedTableComponentOptions extends Readonly<Normalized<Omit<TableComponentOptions, keyof NormalizedTableOptions>> & NormalizedTableOptions & NormalizedAngularOptions> {
|
|
10
|
+
readonly name: string;
|
|
11
|
+
readonly controllerName: string;
|
|
14
12
|
}
|
|
15
13
|
export declare function NormalizeTableComponentOptions(options: Readonly<TableComponentOptions>): NormalizedTableComponentOptions;
|
|
16
|
-
export declare function
|
|
14
|
+
export declare function TableColumnListAndPropertyListToGetPageOperationPropertyList(columnList: ReadonlyArray<NormalizedTableColumn>, propertyList: ReadonlyArray<NormalizedTableProperty>): GetPageOperationProperty[];
|
|
17
15
|
export declare function TableColumnToFormControl(column: NormalizedTableColumn): FormDefinitionControl;
|
|
18
16
|
export default function (options: TableComponentOptions): () => Rule;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TableColumnToFormControl = exports.
|
|
3
|
+
exports.TableColumnToFormControl = exports.TableColumnListAndPropertyListToGetPageOperationPropertyList = exports.NormalizeTableComponentOptions = void 0;
|
|
4
4
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
5
|
const schematics_ts_morph_1 = require("@rxap/schematics-ts-morph");
|
|
6
6
|
const schematics_utilities_1 = require("@rxap/schematics-utilities");
|
|
7
|
+
const ts_morph_1 = require("@rxap/ts-morph");
|
|
7
8
|
const utilities_1 = require("@rxap/utilities");
|
|
8
|
-
const
|
|
9
|
+
const ts_morph_2 = require("ts-morph");
|
|
9
10
|
const angular_options_1 = require("../../../lib/angular-options");
|
|
10
11
|
const backend_types_1 = require("../../../lib/backend-types");
|
|
11
12
|
const minimum_table_component_options_1 = require("../../../lib/minimum-table-component-options");
|
|
@@ -22,23 +23,36 @@ function NormalizeTableComponentOptions(options) {
|
|
|
22
23
|
throw new Error('openApi options must be provided. If backend is open-api');
|
|
23
24
|
}
|
|
24
25
|
}
|
|
25
|
-
return Object.
|
|
26
|
+
return Object.freeze(Object.assign(Object.assign({}, normalizedMinimumTableComponentOptions), normalizedTableOptions));
|
|
26
27
|
}
|
|
27
28
|
exports.NormalizeTableComponentOptions = NormalizeTableComponentOptions;
|
|
28
|
-
function
|
|
29
|
-
var _a, _b;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
function TableColumnListAndPropertyListToGetPageOperationPropertyList(columnList, propertyList) {
|
|
30
|
+
var _a, _b, _c, _d;
|
|
31
|
+
const list = [];
|
|
32
|
+
for (const column of columnList) {
|
|
33
|
+
list.push({
|
|
34
|
+
name: column.name,
|
|
35
|
+
type: (_a = column.type) !== null && _a !== void 0 ? _a : undefined,
|
|
36
|
+
source: (_b = column.propertyPath) !== null && _b !== void 0 ? _b : undefined,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
for (const property of propertyList) {
|
|
40
|
+
if (!list.find((p) => p.source === property.name)) {
|
|
41
|
+
list.push({
|
|
42
|
+
name: property.name,
|
|
43
|
+
type: (_c = property.type) !== null && _c !== void 0 ? _c : undefined,
|
|
44
|
+
source: (_d = property.name) !== null && _d !== void 0 ? _d : undefined,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return list;
|
|
35
49
|
}
|
|
36
|
-
exports.
|
|
50
|
+
exports.TableColumnListAndPropertyListToGetPageOperationPropertyList = TableColumnListAndPropertyListToGetPageOperationPropertyList;
|
|
37
51
|
function TableColumnToFormControl(column) {
|
|
38
|
-
var _a;
|
|
52
|
+
var _a, _b;
|
|
39
53
|
return {
|
|
40
54
|
name: column.name,
|
|
41
|
-
type: (_a = column.type) !== null &&
|
|
55
|
+
type: (_b = (_a = column.type) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : undefined,
|
|
42
56
|
};
|
|
43
57
|
}
|
|
44
58
|
exports.TableColumnToFormControl = TableColumnToFormControl;
|
|
@@ -59,7 +73,7 @@ function printOptions(options) {
|
|
|
59
73
|
}
|
|
60
74
|
function componentRule(normalizedOptions) {
|
|
61
75
|
const { project, feature, shared, directory, overwrite, modifiers, columnList, tableMethod, componentName, } = normalizedOptions;
|
|
62
|
-
const templateOptions = Object.assign(Object.assign({}, normalizedOptions), { hasNavigationBackHeader: modifiers.includes('navigation-back-header'), hasWithoutTitle: modifiers.includes('without-title'), hasColumnWithFilter: columnList.some((c) => c.hasFilter) });
|
|
76
|
+
const templateOptions = Object.assign(Object.assign({}, normalizedOptions), { hasNavigationBackHeader: modifiers.includes('navigation-back-header'), hasWithoutTitle: modifiers.includes('without-title'), hasColumnWithFilter: columnList.some((c) => c.hasFilter), hasShowArchivedSlide: modifiers.includes('show-archived-slide'), exportDefault: !!feature && !directory });
|
|
63
77
|
return (0, schematics_1.chain)([
|
|
64
78
|
() => console.log(`Coerce the table component '${componentName}'`),
|
|
65
79
|
(0, schematics_ts_morph_1.CoerceComponentRule)({
|
|
@@ -76,12 +90,9 @@ function componentRule(normalizedOptions) {
|
|
|
76
90
|
if (tableMethod) {
|
|
77
91
|
(0, schematics_ts_morph_1.AddComponentProvider)(componentSourceFile, {
|
|
78
92
|
provide: 'RXAP_TABLE_METHOD',
|
|
79
|
-
useClass: tableMethod.
|
|
93
|
+
useClass: tableMethod.name,
|
|
80
94
|
}, [
|
|
81
|
-
|
|
82
|
-
namedImports: [tableMethod.className],
|
|
83
|
-
moduleSpecifier: tableMethod.importPath,
|
|
84
|
-
},
|
|
95
|
+
(0, ts_morph_1.TypeImportToImportStructure)(tableMethod),
|
|
85
96
|
{
|
|
86
97
|
namedImports: ['RXAP_TABLE_METHOD'],
|
|
87
98
|
moduleSpecifier: '@rxap/material-table-system',
|
|
@@ -200,16 +211,13 @@ function openApiBackendRule(normalizedOptions) {
|
|
|
200
211
|
if (openApi.adapter) {
|
|
201
212
|
(0, schematics_ts_morph_1.AddComponentProvider)(sourceFile, {
|
|
202
213
|
provide: 'TABLE_REMOTE_METHOD_ADAPTER_FACTORY',
|
|
203
|
-
useValue: openApi.adapter.
|
|
214
|
+
useValue: openApi.adapter.name,
|
|
204
215
|
}, [
|
|
205
216
|
{
|
|
206
217
|
moduleSpecifier: '@rxap/material-table-system',
|
|
207
218
|
namedImports: ['TABLE_REMOTE_METHOD_ADAPTER_FACTORY'],
|
|
208
219
|
},
|
|
209
|
-
|
|
210
|
-
moduleSpecifier: openApi.adapter.importPath,
|
|
211
|
-
namedImports: [openApi.adapter.className],
|
|
212
|
-
},
|
|
220
|
+
(0, ts_morph_1.TypeImportToImportStructure)(openApi.adapter),
|
|
213
221
|
]);
|
|
214
222
|
}
|
|
215
223
|
(0, schematics_ts_morph_1.AddComponentProvider)(sourceFile, {
|
|
@@ -230,7 +238,7 @@ function openApiBackendRule(normalizedOptions) {
|
|
|
230
238
|
]);
|
|
231
239
|
}
|
|
232
240
|
function nestjsBackendRule(normalizedOptions) {
|
|
233
|
-
const { project, feature, shared, columnList, context, nestModule, componentName, directory, overwrite, scope, controllerName, } = normalizedOptions;
|
|
241
|
+
const { project, feature, shared, columnList, propertyList, context, nestModule, componentName, directory, overwrite, scope, controllerName, } = normalizedOptions;
|
|
234
242
|
const operationId = (0, schematics_ts_morph_1.buildOperationId)(normalizedOptions, 'get-page', controllerName);
|
|
235
243
|
return (0, schematics_1.chain)([
|
|
236
244
|
() => console.log(`Coerce the getPage operation for the table`),
|
|
@@ -240,7 +248,7 @@ function nestjsBackendRule(normalizedOptions) {
|
|
|
240
248
|
project,
|
|
241
249
|
feature,
|
|
242
250
|
shared,
|
|
243
|
-
|
|
251
|
+
propertyList: TableColumnListAndPropertyListToGetPageOperationPropertyList(columnList, propertyList),
|
|
244
252
|
context,
|
|
245
253
|
}),
|
|
246
254
|
() => console.log('Add the open api methods to the table component providers'),
|
|
@@ -261,7 +269,7 @@ function nestjsBackendRule(normalizedOptions) {
|
|
|
261
269
|
namedImports: ['TABLE_REMOTE_METHOD_ADAPTER_FACTORY'],
|
|
262
270
|
},
|
|
263
271
|
{
|
|
264
|
-
moduleSpecifier: '@rxap/
|
|
272
|
+
moduleSpecifier: '@rxap/open-api/remote-method',
|
|
265
273
|
namedImports: ['GetPageAdapterFactory'],
|
|
266
274
|
},
|
|
267
275
|
]);
|
|
@@ -374,7 +382,7 @@ function selectColumnRule(normalizedOptions) {
|
|
|
374
382
|
]);
|
|
375
383
|
(0, schematics_ts_morph_1.AddComponentProvider)(sourceFile, {
|
|
376
384
|
provide: 'RXAP_MATERIAL_TABLE_SYSTEM_SELECT_ROW_OPTIONS',
|
|
377
|
-
useValue:
|
|
385
|
+
useValue: ts_morph_2.Writers.object({
|
|
378
386
|
multiple: 'true',
|
|
379
387
|
}),
|
|
380
388
|
}, [
|
|
@@ -404,6 +412,11 @@ function default_1(options) {
|
|
|
404
412
|
(0, minimum_table_component_options_1.cellComponentRule)(normalizedOptions),
|
|
405
413
|
(0, minimum_table_component_options_1.actionListRule)(normalizedOptions),
|
|
406
414
|
selectColumnRule(normalizedOptions),
|
|
415
|
+
(0, schematics_utilities_1.AddPackageJsonDependencyRule)('@rxap/material-table-system', 'latest', { soft: true }),
|
|
416
|
+
(0, schematics_utilities_1.AddPackageJsonDependencyRule)('@rxap/material-form-system', 'latest', { soft: true }),
|
|
417
|
+
(0, schematics_utilities_1.AddPackageJsonDependencyRule)('@rxap/form-system', 'latest', { soft: true }),
|
|
418
|
+
(0, schematics_utilities_1.AddPackageJsonDependencyRule)('@rxap/window-system', 'latest', { soft: true }),
|
|
419
|
+
(0, schematics_utilities_1.AddPackageJsonDependencyRule)('@rxap/nest-dto', 'latest', { soft: true }),
|
|
407
420
|
() => console.groupEnd(),
|
|
408
421
|
]);
|
|
409
422
|
};
|