@rxap/schematic-angular 16.1.0-dev.5 → 16.1.0-dev.7
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 +19 -0
- package/README.md +1 -1
- package/collection.json +16 -1
- package/package.json +10 -10
- package/src/lib/accordion-item.js +17 -19
- package/src/lib/accordion-item.js.map +1 -1
- package/src/lib/accordion-itme-types.js +3 -7
- package/src/lib/accordion-itme-types.js.map +1 -1
- package/src/lib/adapter-options.js +2 -6
- package/src/lib/adapter-options.js.map +1 -1
- package/src/lib/angular-options.js +37 -22
- package/src/lib/angular-options.js.map +1 -1
- package/src/lib/assert-table-component-exists.js +5 -9
- package/src/lib/assert-table-component-exists.js.map +1 -1
- package/src/lib/backend-types.js +2 -5
- package/src/lib/backend-types.js.map +1 -1
- package/src/lib/data-grid-item.js +5 -12
- package/src/lib/data-grid-item.js.map +1 -1
- package/src/lib/data-grid-options.js +8 -13
- package/src/lib/data-grid-options.js.map +1 -1
- package/src/lib/dialog-action.js +7 -14
- package/src/lib/dialog-action.js.map +1 -1
- package/src/lib/existing-method.js +1 -5
- package/src/lib/existing-method.js.map +1 -1
- package/src/lib/form-component-control.js +9 -16
- package/src/lib/form-component-control.js.map +1 -1
- package/src/lib/form-definition-control.js +9 -17
- package/src/lib/form-definition-control.js.map +1 -1
- package/src/lib/minimum-table-component-options.js +128 -202
- package/src/lib/minimum-table-component-options.js.map +1 -1
- package/src/lib/minimum-table-options.js +12 -17
- package/src/lib/minimum-table-options.js.map +1 -1
- package/src/lib/table-action.js +33 -37
- package/src/lib/table-action.js.map +1 -1
- package/src/lib/table-column.js +20 -27
- package/src/lib/table-column.js.map +1 -1
- package/src/lib/table-header-button.d.ts +10 -1
- package/src/lib/table-header-button.js +27 -13
- package/src/lib/table-header-button.js.map +1 -1
- package/src/lib/table-open-api-options.js +4 -8
- package/src/lib/table-open-api-options.js.map +1 -1
- package/src/lib/table-options.js +13 -15
- package/src/lib/table-options.js.map +1 -1
- package/src/lib/table-row-action.js +13 -18
- package/src/lib/table-row-action.js.map +1 -1
- package/src/lib/to-title.js +4 -8
- package/src/lib/to-title.js.map +1 -1
- package/src/lib/tree-table-options.js +11 -13
- package/src/lib/tree-table-options.js.map +1 -1
- package/src/schematics/accordion/accordion-component/index.js +125 -105
- package/src/schematics/accordion/accordion-component/index.js.map +1 -1
- package/src/schematics/accordion/accordion-item-component/index.js +119 -107
- package/src/schematics/accordion/accordion-item-component/index.js.map +1 -1
- package/src/schematics/accordion/item/accordion-item-data-grid-component/index.js +55 -54
- package/src/schematics/accordion/item/accordion-item-data-grid-component/index.js.map +1 -1
- package/src/schematics/accordion/item/accordion-item-table-component/index.js +38 -36
- package/src/schematics/accordion/item/accordion-item-table-component/index.js.map +1 -1
- package/src/schematics/accordion/item/accordion-item-tree-table-component/index.js +54 -52
- package/src/schematics/accordion/item/accordion-item-tree-table-component/index.js.map +1 -1
- package/src/schematics/data-grid-component/index.js +87 -81
- package/src/schematics/data-grid-component/index.js.map +1 -1
- package/src/schematics/dialog-component/index.js +21 -20
- package/src/schematics/dialog-component/index.js.map +1 -1
- package/src/schematics/form/control/input-form-control/index.d.ts +2 -2
- package/src/schematics/form/control/input-form-control/index.js +18 -17
- package/src/schematics/form/control/input-form-control/index.js.map +1 -1
- package/src/schematics/form/control/select-form-control/index.js +43 -43
- package/src/schematics/form/control/select-form-control/index.js.map +1 -1
- package/src/schematics/form/control/table-select-form-control/index.js +58 -58
- package/src/schematics/form/control/table-select-form-control/index.js.map +1 -1
- package/src/schematics/form/form-component/index.js +82 -61
- 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 +24 -23
- package/src/schematics/form/form-control/index.js.map +1 -1
- package/src/schematics/form/form-definition/index.d.ts +2 -2
- package/src/schematics/form/form-definition/index.js +24 -19
- package/src/schematics/form/form-definition/index.js.map +1 -1
- package/src/schematics/table/action/dialog-table-action/index.js +32 -30
- package/src/schematics/table/action/dialog-table-action/index.js.map +1 -1
- package/src/schematics/table/action/form-table-action/index.js +89 -56
- package/src/schematics/table/action/form-table-action/index.js.map +1 -1
- package/src/schematics/table/action/navigation-table-action/index.js +19 -20
- package/src/schematics/table/action/navigation-table-action/index.js.map +1 -1
- package/src/schematics/table/action/operation-table-action/index.js +32 -31
- package/src/schematics/table/action/operation-table-action/index.js.map +1 -1
- package/src/schematics/table/header-button/form-table-header-button/index.d.ts +11 -0
- package/src/schematics/table/header-button/form-table-header-button/index.js +90 -0
- package/src/schematics/table/header-button/form-table-header-button/index.js.map +1 -0
- package/src/schematics/table/header-button/form-table-header-button/schema.d.ts +7 -0
- package/src/schematics/table/header-button/form-table-header-button/schema.json +123 -0
- package/src/schematics/table/header-button/navigation-table-header-button/index.d.ts +8 -0
- package/src/schematics/table/header-button/navigation-table-header-button/index.js +60 -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 +6 -0
- package/src/schematics/table/header-button/navigation-table-header-button/schema.json +85 -0
- package/src/schematics/table/table-action/index.js +24 -23
- package/src/schematics/table/table-action/index.js.map +1 -1
- package/src/schematics/table/table-component/files/component/__componentName__.component.html.template +5 -8
- package/src/schematics/table/table-component/files/component/__componentName__.component.ts.template +2 -2
- package/src/schematics/table/table-component/index.js +94 -93
- package/src/schematics/table/table-component/index.js.map +1 -1
- package/src/schematics/table/table-component/schema.json +4 -0
- package/src/schematics/table/table-header-button/index.d.ts +10 -0
- package/src/schematics/table/table-header-button/index.js +49 -0
- package/src/schematics/table/table-header-button/index.js.map +1 -0
- package/src/schematics/table/table-header-button/schema.d.ts +7 -0
- package/src/schematics/table/table-header-button/schema.json +80 -0
- package/src/schematics/table/tree-table-component/index.js +66 -63
- package/src/schematics/table/tree-table-component/index.js.map +1 -1
- package/src/schematics/tree-component/index.js +18 -18
- package/src/schematics/tree-component/index.js.map +1 -1
|
@@ -0,0 +1,123 @@
|
|
|
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
|
+
"options": {
|
|
72
|
+
"type": "object",
|
|
73
|
+
"properties": {
|
|
74
|
+
"controlList": {
|
|
75
|
+
"alias": "control",
|
|
76
|
+
"type": "array",
|
|
77
|
+
"items": {
|
|
78
|
+
"type": "object",
|
|
79
|
+
"properties": {
|
|
80
|
+
"type": {
|
|
81
|
+
"type": "string"
|
|
82
|
+
},
|
|
83
|
+
"name": {
|
|
84
|
+
"type": "string"
|
|
85
|
+
},
|
|
86
|
+
"state": {
|
|
87
|
+
"type": "string",
|
|
88
|
+
"description": "The initial state of the control"
|
|
89
|
+
},
|
|
90
|
+
"isRequired": {
|
|
91
|
+
"type": "boolean",
|
|
92
|
+
"description": "Whether the control value is required",
|
|
93
|
+
"default": false
|
|
94
|
+
},
|
|
95
|
+
"validatorList": {
|
|
96
|
+
"type": "array",
|
|
97
|
+
"items": {
|
|
98
|
+
"type": "string"
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"required": [
|
|
103
|
+
"name"
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
"additionalProperties": true
|
|
109
|
+
},
|
|
110
|
+
"nestModule": {
|
|
111
|
+
"type": "string",
|
|
112
|
+
"description": "The module name for the table nest operations"
|
|
113
|
+
},
|
|
114
|
+
"context": {
|
|
115
|
+
"type": "string",
|
|
116
|
+
"description": "The context use to generate proper names for class, files, etc"
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
"required": [
|
|
120
|
+
"project",
|
|
121
|
+
"feature"
|
|
122
|
+
]
|
|
123
|
+
}
|
|
@@ -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,60 @@
|
|
|
1
|
+
import { chain, } from '@angular-devkit/schematics';
|
|
2
|
+
import { CoerceClassConstructor, CoerceImports, CoerceParameterDeclaration, CoerceTableHeaderButtonMethodRule, } from '@rxap/schematics-ts-morph';
|
|
3
|
+
import { Scope } from 'ts-morph';
|
|
4
|
+
import { PrintAngularOptions, } from '../../../../lib/angular-options';
|
|
5
|
+
import { AssertTableComponentExists } from '../../../../lib/assert-table-component-exists';
|
|
6
|
+
import { NormalizeTableHeaderButtonOptions } from '../../table-header-button/index';
|
|
7
|
+
export function NormalizeNavigationTableHeaderButtonOptions(options) {
|
|
8
|
+
const normalizedTableHeaderButtonOptions = NormalizeTableHeaderButtonOptions(options);
|
|
9
|
+
return Object.seal({
|
|
10
|
+
...normalizedTableHeaderButtonOptions,
|
|
11
|
+
route: options.route,
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
function printOptions(options) {
|
|
15
|
+
PrintAngularOptions('navigation-table-header-button', options);
|
|
16
|
+
}
|
|
17
|
+
export default function (options) {
|
|
18
|
+
const normalizedOptions = NormalizeNavigationTableHeaderButtonOptions(options);
|
|
19
|
+
const { refresh, confirm, tooltip, errorMessage, successMessage, tableName, project, feature, shared, directory, overwrite, route, } = normalizedOptions;
|
|
20
|
+
printOptions(normalizedOptions);
|
|
21
|
+
return (host) => {
|
|
22
|
+
AssertTableComponentExists(host, normalizedOptions);
|
|
23
|
+
return chain([
|
|
24
|
+
() => console.group('\x1b[32m[@rxap/schematics-angular:navigation-table-header-button]\x1b[0m'),
|
|
25
|
+
() => console.log('Coerce table header button method ...'),
|
|
26
|
+
CoerceTableHeaderButtonMethodRule({
|
|
27
|
+
project,
|
|
28
|
+
feature,
|
|
29
|
+
shared,
|
|
30
|
+
directory,
|
|
31
|
+
overwrite,
|
|
32
|
+
tableName,
|
|
33
|
+
refresh,
|
|
34
|
+
confirm,
|
|
35
|
+
tooltip,
|
|
36
|
+
errorMessage,
|
|
37
|
+
successMessage,
|
|
38
|
+
tsMorphTransform: (project, sourceFile, classDeclaration) => {
|
|
39
|
+
const [constructorDeclaration] = CoerceClassConstructor(classDeclaration);
|
|
40
|
+
CoerceParameterDeclaration(constructorDeclaration, 'route', {
|
|
41
|
+
isReadonly: true,
|
|
42
|
+
scope: Scope.Private,
|
|
43
|
+
type: 'ActivatedRoute',
|
|
44
|
+
});
|
|
45
|
+
CoerceImports(sourceFile, [
|
|
46
|
+
{
|
|
47
|
+
moduleSpecifier: '@angular/router',
|
|
48
|
+
namedImports: ['ActivatedRoute'],
|
|
49
|
+
},
|
|
50
|
+
]);
|
|
51
|
+
return {
|
|
52
|
+
statements: [`return this.router.navigate('${route}', { route: this.route })`],
|
|
53
|
+
};
|
|
54
|
+
},
|
|
55
|
+
}),
|
|
56
|
+
() => console.groupEnd(),
|
|
57
|
+
]);
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/schematic/angular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AAC,GAAG,CAAC,uCAAuC,CAAC;YAC1D,iCAAiC,CAAC;gBAChC,OAAO;gBACP,OAAO;gBACP,MAAM;gBACN,SAAS;gBACT,SAAS;gBACT,SAAS;gBACT,OAAO;gBACP,OAAO;gBACP,OAAO;gBACP,YAAY;gBACZ,cAAc;gBACd,gBAAgB,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,EAAE;oBAC1D,MAAM,CAAE,sBAAsB,CAAE,GAAG,sBAAsB,CAAC,gBAAgB,CAAC,CAAC;oBAC5E,0BAA0B,CAAC,sBAAsB,EAAE,OAAO,EAAE;wBAC1D,UAAU,EAAE,IAAI;wBAChB,KAAK,EAAE,KAAK,CAAC,OAAO;wBACpB,IAAI,EAAE,gBAAgB;qBACvB,CAAC,CAAC;oBACH,aAAa,CAAC,UAAU,EAAE;wBACxB;4BACE,eAAe,EAAE,iBAAiB;4BAClC,YAAY,EAAE,CAAE,gBAAgB,CAAE;yBACnC;qBACF,CAAC,CAAC;oBACH,OAAO;wBACL,UAAU,EAAE,CAAE,gCAAiC,KAAM,2BAA2B,CAAE;qBACnF,CAAC;gBACJ,CAAC;aACF,CAAC;YACF,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE;SACzB,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
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
|
+
"options": {
|
|
72
|
+
"type": "object",
|
|
73
|
+
"additionalProperties": true
|
|
74
|
+
},
|
|
75
|
+
"route": {
|
|
76
|
+
"type": "string",
|
|
77
|
+
"description": "The route path for the table action"
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"required": [
|
|
81
|
+
"route",
|
|
82
|
+
"project",
|
|
83
|
+
"feature"
|
|
84
|
+
]
|
|
85
|
+
}
|
|
@@ -1,32 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { chain, } from '@angular-devkit/schematics';
|
|
2
|
+
import { CoerceTableActionRule } from '@rxap/schematics-ts-morph';
|
|
3
|
+
import { CoerceSuffix, dasherize, } from '@rxap/schematics-utilities';
|
|
4
|
+
import { join } from 'path';
|
|
5
|
+
import { NormalizeAngularOptions, PrintAngularOptions, } from '../../../lib/angular-options';
|
|
6
|
+
import { AssertTableComponentExists } from '../../../lib/assert-table-component-exists';
|
|
7
|
+
import { NormalizeTableRowAction } from '../../../lib/table-row-action';
|
|
8
|
+
export function NormalizeTableActionOptions(options) {
|
|
9
|
+
const normalizedAngularOptions = NormalizeAngularOptions(options);
|
|
10
|
+
const normalizedTableRowAction = NormalizeTableRowAction(options);
|
|
11
|
+
const tableName = CoerceSuffix(dasherize(options.tableName), '-table');
|
|
12
|
+
return Object.seal({
|
|
13
|
+
...normalizedTableRowAction,
|
|
14
|
+
...normalizedAngularOptions,
|
|
15
|
+
tableName,
|
|
16
|
+
});
|
|
16
17
|
}
|
|
17
|
-
exports.NormalizeTableActionOptions = NormalizeTableActionOptions;
|
|
18
18
|
function printOptions(options) {
|
|
19
|
-
|
|
19
|
+
PrintAngularOptions('table-action', options);
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
export default function (options) {
|
|
22
22
|
const normalizedOptions = NormalizeTableActionOptions(options);
|
|
23
23
|
const { refresh, confirm, tooltip, errorMessage, successMessage, priority, checkFunction, tableName, project, feature, directory, type, } = normalizedOptions;
|
|
24
24
|
printOptions(normalizedOptions);
|
|
25
25
|
return (host) => {
|
|
26
|
-
|
|
27
|
-
return
|
|
28
|
-
(
|
|
29
|
-
|
|
26
|
+
AssertTableComponentExists(host, normalizedOptions);
|
|
27
|
+
return chain([
|
|
28
|
+
() => console.group('\x1b[32m[@rxap/schematics-angular:table-action]\x1b[0m'),
|
|
29
|
+
CoerceTableActionRule({
|
|
30
|
+
directory: join(directory ?? '', 'methods', 'action'),
|
|
30
31
|
type,
|
|
31
32
|
tableName,
|
|
32
33
|
refresh,
|
|
@@ -39,8 +40,8 @@ function default_1(options) {
|
|
|
39
40
|
project,
|
|
40
41
|
feature,
|
|
41
42
|
}),
|
|
43
|
+
() => console.groupEnd(),
|
|
42
44
|
]);
|
|
43
45
|
};
|
|
44
46
|
}
|
|
45
|
-
exports.default = default_1;
|
|
46
47
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/angular/src/schematics/table/table-action/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/angular/src/schematics/table/table-action/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,GAEN,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EACL,YAAY,EACZ,SAAS,GACV,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EACL,uBAAuB,EAEvB,mBAAmB,GACpB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,0BAA0B,EAAE,MAAM,4CAA4C,CAAC;AACxF,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAKxE,MAAM,UAAU,2BAA2B,CACzC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CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
[loading$]="tableDataSourceDirective.loading$"
|
|
14
14
|
></mat-progress-bar>
|
|
15
15
|
<mat-card-header class="min-h-full h-12">
|
|
16
|
-
<% if (!
|
|
16
|
+
<% if (!hasWithoutTitle) { %>
|
|
17
17
|
<mat-card-title i18n><%= title %></mat-card-title>
|
|
18
18
|
<% } %>
|
|
19
19
|
<% if (headerButton) { %>
|
|
@@ -21,10 +21,9 @@
|
|
|
21
21
|
mat-card-avatar
|
|
22
22
|
mat-mini-fab
|
|
23
23
|
color="primary"
|
|
24
|
-
matTooltip
|
|
25
|
-
i18n-matTooltip
|
|
24
|
+
matTooltip
|
|
26
25
|
[disabled]="tableDataSourceDirective.hasError$ | async"
|
|
27
|
-
|
|
26
|
+
[rxapTableHeaderButton]="tableDataSourceDirective"
|
|
28
27
|
<% if (headerButton.permission) { %>rxapHasEnablePermission="<%= headerButton.permission %>"<% } %>
|
|
29
28
|
>
|
|
30
29
|
<% if (headerButton.icon) { %><mat-icon><%= headerButton.icon %></mat-icon><% } else if (headerButton.svgIcon) { %><mat-icon svgIcon="<%= headerButton.svgIcon %>"></mat-icon><% } else { %><mat-icon>add</mat-icon><% } %>
|
|
@@ -118,8 +117,7 @@
|
|
|
118
117
|
mat-icon-button
|
|
119
118
|
*ngIf="selected | rxapRowActionCheck:'<%= action.type %>'"
|
|
120
119
|
<% if (action.permission) { %>rxapHasEnablePermission="<%= action.permission %>"<% } %>
|
|
121
|
-
matTooltip
|
|
122
|
-
i18n-matTooltip
|
|
120
|
+
matTooltip
|
|
123
121
|
>
|
|
124
122
|
<% if (action.icon) { %><mat-icon><%= action.icon %></mat-icon><% } else if (action.svgIcon) { %><mat-icon svgIcon="<%= action.svgIcon %>"></mat-icon><% } else { %><mat-icon><%= action.type %></mat-icon><% } %>
|
|
125
123
|
<mat-progress-bar
|
|
@@ -142,8 +140,7 @@
|
|
|
142
140
|
mat-icon-button
|
|
143
141
|
*ngIf="element | rxapRowActionCheck:'<%= action.type %>'"
|
|
144
142
|
<% if (action.permission) { %>rxapHasEnablePermission="<%= action.permission %>"<% } %>
|
|
145
|
-
matTooltip
|
|
146
|
-
i18n-matTooltip
|
|
143
|
+
matTooltip
|
|
147
144
|
>
|
|
148
145
|
<% if (action.icon) { %><mat-icon><%= action.icon %></mat-icon><% } else if (action.svgIcon) { %><mat-icon svgIcon="<%= action.svgIcon %>"></mat-icon><% } else { %><mat-icon><%= action.type %></mat-icon><% } %>
|
|
149
146
|
<mat-progress-bar
|
package/src/schematics/table/table-component/files/component/__componentName__.component.ts.template
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
CopyToClipboardCellComponent, DateCellComponent,
|
|
12
12
|
IconCellComponent,
|
|
13
13
|
LinkCellComponent, PersistentPaginatorDirective,
|
|
14
|
-
TableColumnMenuModule,
|
|
14
|
+
TableColumnMenuModule, TableHeaderButtonDirective,
|
|
15
15
|
TableDataSourceDirective,
|
|
16
16
|
TableFilterModule, TableRowActionsModule,
|
|
17
17
|
TableRowControlsModule,
|
|
@@ -75,7 +75,7 @@ import { MatSnackBarModule } from '@angular/material/snack-bar';
|
|
|
75
75
|
MatInputModule,
|
|
76
76
|
MatButtonModule,
|
|
77
77
|
InputClearButtonDirective,
|
|
78
|
-
|
|
78
|
+
TableHeaderButtonDirective,
|
|
79
79
|
TableShowArchivedSlideComponent,
|
|
80
80
|
PersistentPaginatorDirective,
|
|
81
81
|
ConfirmModule,
|