@rxap/schematic-angular 16.1.0-dev.2 → 16.1.0-dev.21

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.
Files changed (78) hide show
  1. package/CHANGELOG.md +129 -0
  2. package/README.md +1 -1
  3. package/collection.json +16 -1
  4. package/package.json +40 -38
  5. package/src/lib/angular-options.js +18 -1
  6. package/src/lib/angular-options.js.map +1 -1
  7. package/src/lib/minimum-table-component-options.d.ts +1 -0
  8. package/src/lib/minimum-table-component-options.js +53 -144
  9. package/src/lib/minimum-table-component-options.js.map +1 -1
  10. package/src/lib/table-action.d.ts +1 -1
  11. package/src/lib/table-action.js +8 -8
  12. package/src/lib/table-action.js.map +1 -1
  13. package/src/lib/table-header-button.d.ts +9 -2
  14. package/src/lib/table-header-button.js +22 -2
  15. package/src/lib/table-header-button.js.map +1 -1
  16. package/src/schematics/accordion/accordion-item-component/files/component/__componentName__.component.html.template +1 -1
  17. package/src/schematics/form/control/input-form-control/index.d.ts +2 -2
  18. package/src/schematics/form/control/input-form-control/index.js +7 -3
  19. package/src/schematics/form/control/input-form-control/index.js.map +1 -1
  20. package/src/schematics/form/control/select-form-control/index.js +2 -0
  21. package/src/schematics/form/control/select-form-control/index.js.map +1 -1
  22. package/src/schematics/form/control/table-select-form-control/index.js +2 -0
  23. package/src/schematics/form/control/table-select-form-control/index.js.map +1 -1
  24. package/src/schematics/form/form-component/index.d.ts +0 -1
  25. package/src/schematics/form/form-component/index.js +45 -14
  26. package/src/schematics/form/form-component/index.js.map +1 -1
  27. package/src/schematics/form/form-component/schema.json +3 -6
  28. package/src/schematics/form/form-control/index.d.ts +2 -2
  29. package/src/schematics/form/form-control/index.js +7 -8
  30. package/src/schematics/form/form-control/index.js.map +1 -1
  31. package/src/schematics/form/form-definition/index.d.ts +2 -2
  32. package/src/schematics/form/form-definition/index.js +24 -10
  33. package/src/schematics/form/form-definition/index.js.map +1 -1
  34. package/src/schematics/form/form-definition/schema.d.ts +2 -1
  35. package/src/schematics/form/form-definition/schema.json +5 -0
  36. package/src/schematics/table/action/dialog-table-action/index.d.ts +2 -1
  37. package/src/schematics/table/action/dialog-table-action/index.js +6 -2
  38. package/src/schematics/table/action/dialog-table-action/index.js.map +1 -1
  39. package/src/schematics/table/action/form-table-action/index.d.ts +6 -1
  40. package/src/schematics/table/action/form-table-action/index.js +120 -68
  41. package/src/schematics/table/action/form-table-action/index.js.map +1 -1
  42. package/src/schematics/table/action/form-table-action/schema.json +35 -0
  43. package/src/schematics/table/action/navigation-table-action/index.d.ts +1 -1
  44. package/src/schematics/table/action/navigation-table-action/index.js +10 -10
  45. package/src/schematics/table/action/navigation-table-action/index.js.map +1 -1
  46. package/src/schematics/table/action/operation-table-action/index.d.ts +1 -3
  47. package/src/schematics/table/action/operation-table-action/index.js +11 -12
  48. package/src/schematics/table/action/operation-table-action/index.js.map +1 -1
  49. package/src/schematics/table/header-button/form-table-header-button/index.d.ts +11 -0
  50. package/src/schematics/table/header-button/form-table-header-button/index.js +83 -0
  51. package/src/schematics/table/header-button/form-table-header-button/index.js.map +1 -0
  52. package/src/schematics/table/header-button/form-table-header-button/schema.d.ts +7 -0
  53. package/src/schematics/table/header-button/form-table-header-button/schema.json +123 -0
  54. package/src/schematics/table/header-button/navigation-table-header-button/index.d.ts +8 -0
  55. package/src/schematics/table/header-button/navigation-table-header-button/index.js +69 -0
  56. package/src/schematics/table/header-button/navigation-table-header-button/index.js.map +1 -0
  57. package/src/schematics/table/header-button/navigation-table-header-button/schema.d.ts +8 -0
  58. package/src/schematics/table/header-button/navigation-table-header-button/schema.json +87 -0
  59. package/src/schematics/table/table-action/index.d.ts +1 -1
  60. package/src/schematics/table/table-action/index.js +6 -4
  61. package/src/schematics/table/table-action/index.js.map +1 -1
  62. package/src/schematics/table/table-component/files/component/__componentName__.component.html.template +6 -9
  63. package/src/schematics/table/table-component/files/component/__componentName__.component.ts.template +2 -4
  64. package/src/schematics/table/table-component/index.d.ts +1 -0
  65. package/src/schematics/table/table-component/index.js +43 -7
  66. package/src/schematics/table/table-component/index.js.map +1 -1
  67. package/src/schematics/table/table-component/schema.json +14 -11
  68. package/src/schematics/table/table-header-button/index.d.ts +8 -0
  69. package/src/schematics/table/table-header-button/index.js +50 -0
  70. package/src/schematics/table/table-header-button/index.js.map +1 -0
  71. package/src/schematics/table/table-header-button/schema.d.ts +8 -0
  72. package/src/schematics/table/table-header-button/schema.json +80 -0
  73. package/src/schematics/table/tree-table-component/files/component/__componentName__.component.html.template +1 -1
  74. package/src/schematics/table/tree-table-component/files/component/__componentName__.component.ts.template +0 -2
  75. package/src/schematics/table/tree-table-component/index.d.ts +1 -0
  76. package/src/schematics/table/tree-table-component/index.js +13 -17
  77. package/src/schematics/table/tree-table-component/index.js.map +1 -1
  78. /package/src/schematics/form/form-component/files/window/{open-__name__-form-window.method.ts.template → open-__componentName__-window.method.ts.template} +0 -0
@@ -6,21 +6,28 @@ const schematics_ts_morph_1 = require("@rxap/schematics-ts-morph");
6
6
  const angular_options_1 = require("../../../lib/angular-options");
7
7
  const form_definition_control_1 = require("../../../lib/form-definition-control");
8
8
  function NormalizeFormDefinitionOptions(options) {
9
+ var _a;
9
10
  const normalizedAngularOptions = (0, angular_options_1.NormalizeAngularOptions)(options);
10
11
  (0, angular_options_1.AssertAngularOptionsNameProperty)(normalizedAngularOptions);
11
- return Object.seal(Object.assign(Object.assign({}, normalizedAngularOptions), { controlList: (0, form_definition_control_1.NormalizeFormDefinitionControlList)(options.controlList) }));
12
+ return Object.seal(Object.assign(Object.assign({}, normalizedAngularOptions), { controlList: (0, form_definition_control_1.NormalizeFormDefinitionControlList)(options.controlList), standalone: (_a = options.standalone) !== null && _a !== void 0 ? _a : true }));
12
13
  }
13
14
  exports.NormalizeFormDefinitionOptions = NormalizeFormDefinitionOptions;
14
15
  function printFormDefinitionOptions(options) {
15
16
  (0, angular_options_1.PrintAngularOptions)('form-definition', options);
16
- console.log(`=== controls: ${options.controlList.map((c) => c.name).join(', ')}`);
17
+ if (options.controlList.length) {
18
+ console.log(`=== controls: ${options.controlList.map((c) => c.name).join(', ')}`);
19
+ }
20
+ else {
21
+ console.log(`=== controls: NONE`);
22
+ }
17
23
  }
18
24
  function default_1(options) {
19
25
  const normalizedOptions = NormalizeFormDefinitionOptions(options);
20
- const { name, project, directory, feature, controlList, } = normalizedOptions;
26
+ const { name, project, directory, feature, controlList, standalone, } = normalizedOptions;
21
27
  printFormDefinitionOptions(normalizedOptions);
22
28
  return () => {
23
29
  return (0, schematics_1.chain)([
30
+ () => console.group('\x1b[32m[@rxap/schematics-angular:form-definition]\x1b[0m'),
24
31
  () => console.log('Coerce form definition class ...'),
25
32
  (0, schematics_ts_morph_1.CoerceFormDefinition)({
26
33
  project,
@@ -29,13 +36,20 @@ function default_1(options) {
29
36
  controlList,
30
37
  name,
31
38
  }),
32
- () => console.log('Coerce form providers file ...'),
33
- (0, schematics_ts_morph_1.CoerceFormProvidersFile)({
34
- project,
35
- feature,
36
- directory,
37
- name,
38
- }),
39
+ standalone ?
40
+ (0, schematics_1.chain)([
41
+ () => console.log('Coerce form providers file ...'),
42
+ (0, schematics_ts_morph_1.CoerceFormProvidersFile)({
43
+ project,
44
+ feature,
45
+ directory,
46
+ name,
47
+ }),
48
+ ]) :
49
+ (0, schematics_1.chain)([
50
+ () => console.log('Skip form providers file ...'),
51
+ ]),
52
+ () => console.groupEnd(),
39
53
  ]);
40
54
  };
41
55
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/angular/src/schematics/form/form-definition/index.ts"],"names":[],"mappings":";;;AACA,2DAAmD;AACnD,mEAGmC;AACnC,kEAKsC;AACtC,kFAG8C;AAS9C,SAAgB,8BAA8B,CAC5C,OAAwC;IAExC,MAAM,wBAAwB,GAAG,IAAA,yCAAuB,EAAC,OAAO,CAAC,CAAC;IAClE,IAAA,kDAAgC,EAAC,wBAAwB,CAAC,CAAC;IAC3D,OAAO,MAAM,CAAC,IAAI,iCACb,wBAAwB,KAC3B,WAAW,EAAE,IAAA,4DAAkC,EAAC,OAAO,CAAC,WAAW,CAAC,IACpE,CAAC;AACL,CAAC;AATD,wEASC;AAED,SAAS,0BAA0B,CAAC,OAAwC;IAC1E,IAAA,qCAAmB,EAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;IAChD,OAAO,CAAC,GAAG,CAAC,iBAAkB,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAE,EAAE,CAAC,CAAC;AACtF,CAAC;AAED,mBAAyB,OAA8B;IACrD,MAAM,iBAAiB,GAAG,8BAA8B,CAAC,OAAO,CAAC,CAAC;IAClE,MAAM,EACJ,IAAI,EACJ,OAAO,EACP,SAAS,EACT,OAAO,EACP,WAAW,GACZ,GAAG,iBAAiB,CAAC;IACtB,0BAA0B,CAAC,iBAAiB,CAAC,CAAC;IAC9C,OAAO,GAAG,EAAE;QACV,OAAO,IAAA,kBAAK,EAAC;YACX,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,kCAAkC,CAAC;YACrD,IAAA,0CAAoB,EAAC;gBACnB,OAAO;gBACP,OAAO;gBACP,SAAS;gBACT,WAAW;gBACX,IAAI;aACL,CAAC;YACF,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC;YACnD,IAAA,6CAAuB,EAAC;gBACtB,OAAO;gBACP,OAAO;gBACP,SAAS;gBACT,IAAI;aACL,CAAC;SACH,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AA7BD,4BA6BC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/angular/src/schematics/form/form-definition/index.ts"],"names":[],"mappings":";;;AAAA,2DAAmD;AACnD,mEAGmC;AAEnC,kEAKsC;AACtC,kFAG8C;AAS9C,SAAgB,8BAA8B,CAC5C,OAAwC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CAAC;gBACZ,IAAA,kBAAK,EAAC;oBACJ,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC;oBACnD,IAAA,6CAAuB,EAAC;wBACtB,OAAO;wBACP,OAAO;wBACP,SAAS;wBACT,IAAI;qBACL,CAAC;iBACH,CAAC,CAAC,CAAC;gBACJ,IAAA,kBAAK,EAAC;oBACJ,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC;iBAClD,CAAC;YACF,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE;SACzB,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAtCD,4BAsCC"}
@@ -1,6 +1,7 @@
1
- import { FormDefinitionControl } from '../../../lib/form-definition-control';
2
1
  import { AngularOptions } from '../../../lib/angular-options';
2
+ import { FormDefinitionControl } from '../../../lib/form-definition-control';
3
3
 
4
4
  export interface FormDefinitionOptions extends AngularOptions {
5
5
  controlList: Array<string | FormDefinitionControl>;
6
+ standalone?: boolean;
6
7
  }
@@ -38,6 +38,11 @@
38
38
  "description": "The feature name where the accordion module should be added.",
39
39
  "x-prompt": "To which feature should the accordion module be added?"
40
40
  },
41
+ "standalone": {
42
+ "type": "boolean",
43
+ "description": "Whether the form definition has a form.provider file",
44
+ "default": true
45
+ },
41
46
  "controlList": {
42
47
  "alias": "control",
43
48
  "anyOf": [
@@ -1,3 +1,4 @@
1
+ import { Tree } from '@angular-devkit/schematics';
1
2
  import { Normalized } from '@rxap/utilities';
2
3
  import { NormalizedOperationTableActionOptions } from '../operation-table-action';
3
4
  import { DialogTableActionOptions } from './schema';
@@ -5,4 +6,4 @@ export interface NormalizedDialogTableActionOptions extends Readonly<Normalized<
5
6
  title: string;
6
7
  }
7
8
  export declare function NormalizeDialogTableActionOptions(options: DialogTableActionOptions): NormalizedDialogTableActionOptions;
8
- export default function (options: DialogTableActionOptions): () => import("@angular-devkit/schematics").Rule;
9
+ export default function (options: DialogTableActionOptions): (host: Tree) => import("@angular-devkit/schematics").Rule;
@@ -6,6 +6,7 @@ const schematics_ts_morph_1 = require("@rxap/schematics-ts-morph");
6
6
  const utilities_1 = require("@rxap/utilities");
7
7
  const path_1 = require("path");
8
8
  const angular_options_1 = require("../../../../lib/angular-options");
9
+ const assert_table_component_exists_1 = require("../../../../lib/assert-table-component-exists");
9
10
  const dialog_action_1 = require("../../../../lib/dialog-action");
10
11
  const to_title_1 = require("../../../../lib/to-title");
11
12
  const operation_table_action_1 = require("../operation-table-action");
@@ -29,8 +30,10 @@ function default_1(options) {
29
30
  const normalizedOptions = NormalizeDialogTableActionOptions(options);
30
31
  const { refresh, confirm, tooltip, errorMessage, successMessage, priority, checkFunction, tableName, project, feature, shared, directory, nestModule, type, withoutBody, title, overwrite, context, controllerName, scope, } = normalizedOptions;
31
32
  printOptions(normalizedOptions);
32
- return () => {
33
+ return (host) => {
34
+ (0, assert_table_component_exists_1.AssertTableComponentExists)(host, normalizedOptions);
33
35
  return (0, schematics_1.chain)([
36
+ () => console.group('\x1b[32m[@rxap/schematics-angular:dialog-table-action]\x1b[0m'),
34
37
  () => console.log('Coerce table action method class ...'),
35
38
  (0, schematics_ts_morph_1.CoerceDialogTableActionRule)({
36
39
  directory: (0, path_1.join)(directory !== null && directory !== void 0 ? directory : '', 'methods', 'action'),
@@ -53,7 +56,7 @@ function default_1(options) {
53
56
  tableName,
54
57
  directory,
55
58
  operationId: (0, schematics_ts_morph_1.buildOperationId)(normalizedOptions, `${type}-action`, (0, schematics_ts_morph_1.BuildNestControllerName)({
56
- controllerName: tableName,
59
+ controllerName,
57
60
  nestModule,
58
61
  })),
59
62
  project,
@@ -92,6 +95,7 @@ function default_1(options) {
92
95
  };
93
96
  },
94
97
  }),
98
+ () => console.groupEnd(),
95
99
  ]);
96
100
  };
97
101
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/schematic/angular/src/schematics/table/action/dialog-table-action/index.ts"],"names":[],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I,GAAuB,SAAS,CAAC;oBACzC,IAAI,CAAC,WAAW,EAAE;wBAChB,MAAM,EACJ,SAAS,EACT,QAAQ,GACT,GAAG,IAAA,oCAAc,EAAC;4BACjB,OAAO;4BACP,IAAI,EAAE,IAAA,wBAAY,EAAC,CAAE,OAAO,EAAE,GAAI,IAAK,cAAc,CAAE,CAAC;yBACzD,CAAC,CAAC;wBACH,IAAI,GAAG,SAAS,CAAC;wBACjB,IAAA,mCAAa,EAAC,UAAU,EAAE;4BACxB,eAAe,EAAE,QAAQ;4BACzB,YAAY,EAAE,CAAE,SAAS,CAAE;yBAC5B,CAAC,CAAC;qBACJ;oBACD,OAAO;wBACL,IAAI;wBACJ,MAAM,EAAE,KAAK;wBACb,IAAI,EAAE,iBAAkB,IAAK,EAAE;wBAC/B,SAAS,EAAE,CAAE,EAAE,IAAI,EAAE,OAAO,EAAE,CAAE;qBACjC,CAAC;gBACJ,CAAC;aACF,CAAC;SACH,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAtGD,4BAsGC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/schematic/angular/src/schematics/table/action/dialog-table-action/index.ts"],"names":[],"mappings":";;;AAAA,2DAGoC;AACpC,mEAQmC;AACnC,+CAGyB;AACzB,+BAA4B;AAC5B,qEAAsE;AACtE,iGAA2F;AAC3F,iEAA0E;AAC1E,uDAAmD;AACnD,sEAGmC;AAQnC,SAAgB,iCAAiC,CAC/C,OAAiC;;IAEjC,MAAM,UAAU,GAAG,MAAA,MAAA,OAAO,CAAC,UAAU,0CAAE,KAAK,EAAE,mCAAI,EAAE,CAAC;IACrD,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE;QAC3B,UAAU,CAAC,IAAI,CAAC;YACd,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,QAAQ;SAChB,CAAC,CAAC;QACH,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,C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,EAAE,CAAE,SAAS,CAAE;yBAC5B,CAAC,CAAC;qBACJ;oBACD,OAAO;wBACL,IAAI;wBACJ,MAAM,EAAE,KAAK;wBACb,IAAI,EAAE,iBAAkB,IAAK,EAAE;wBAC/B,SAAS,EAAE,CAAE,EAAE,IAAI,EAAE,OAAO,EAAE,CAAE;qBACjC,CAAC;gBACJ,CAAC;aACF,CAAC;YACF,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE;SACzB,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AA7GD,4BA6GC"}
@@ -1,9 +1,14 @@
1
1
  import { Rule, Tree } from '@angular-devkit/schematics';
2
2
  import { Normalized } from '@rxap/utilities';
3
3
  import { OptionalKind, SourceFile, TypeAliasDeclarationStructure } from 'ts-morph';
4
+ import { NormalizedFormComponentControl } from '../../../../lib/form-component-control';
4
5
  import { NormalizedOperationTableActionOptions } from '../operation-table-action';
5
6
  import { FormTableActionOptions } from './schema';
6
- export type NormalizedFormTableActionOptions = Readonly<Normalized<FormTableActionOptions>> & NormalizedOperationTableActionOptions;
7
+ export interface NormalizedFormTableActionOptions extends Readonly<Normalized<FormTableActionOptions> & NormalizedOperationTableActionOptions> {
8
+ options: Record<string, any> & {
9
+ controlList: NormalizedFormComponentControl[];
10
+ };
11
+ }
7
12
  export declare function NormalizeFormTableActionOptions(options: Readonly<FormTableActionOptions>): NormalizedFormTableActionOptions;
8
13
  export declare function CoerceTypeAlias(sourceFile: SourceFile, name: string, structure: Omit<OptionalKind<TypeAliasDeclarationStructure>, 'name'>): import("ts-morph").TypeAliasDeclaration;
9
14
  export default function (options: FormTableActionOptions): (host: Tree) => Rule;
@@ -6,9 +6,20 @@ const schematics_ts_morph_1 = require("@rxap/schematics-ts-morph");
6
6
  const schematics_utilities_1 = require("@rxap/schematics-utilities");
7
7
  const utilities_1 = require("@rxap/utilities");
8
8
  const path_1 = require("path");
9
+ const angular_options_1 = require("../../../../lib/angular-options");
10
+ const assert_table_component_exists_1 = require("../../../../lib/assert-table-component-exists");
11
+ const backend_types_1 = require("../../../../lib/backend-types");
12
+ const form_component_control_1 = require("../../../../lib/form-component-control");
13
+ const index_1 = require("../../../form/form-component/index");
9
14
  const operation_table_action_1 = require("../operation-table-action");
10
15
  function NormalizeFormTableActionOptions(options) {
11
- return Object.assign({}, (0, operation_table_action_1.NormalizeOperationTableActionOptions)(options));
16
+ var _a, _b, _c;
17
+ const normalizedOptions = (0, operation_table_action_1.NormalizeOperationTableActionOptions)(options);
18
+ const { controllerName, type, nestModule, } = normalizedOptions;
19
+ return Object.assign(Object.assign({}, normalizedOptions), { controllerName: (0, schematics_ts_morph_1.BuildNestControllerName)({
20
+ nestModule,
21
+ controllerName: [type, 'action'].join('-'),
22
+ }), options: Object.assign(Object.assign({}, (_a = normalizedOptions.options) !== null && _a !== void 0 ? _a : {}), { controlList: (0, form_component_control_1.NormalizeFormComponentControlList)((_c = (_b = normalizedOptions.options) === null || _b === void 0 ? void 0 : _b['controlList']) !== null && _c !== void 0 ? _c : []) }) });
12
23
  }
13
24
  exports.NormalizeFormTableActionOptions = NormalizeFormTableActionOptions;
14
25
  function CoerceTypeAlias(sourceFile, name, structure) {
@@ -23,8 +34,7 @@ function UseOperationResponseAsFormTypeRule(options) {
23
34
  const { name, operationId, scope, } = options;
24
35
  const className = (0, utilities_1.CoerceSuffix)((0, utilities_1.classify)(name), 'Form');
25
36
  const interfaceName = `I${className}`;
26
- return (0, schematics_ts_morph_1.TsMorphAngularProjectTransformRule)(options, (project) => {
27
- const sourceFile = (0, schematics_ts_morph_1.CoerceSourceFile)(project, '/' + (0, utilities_1.CoerceSuffix)(name, '.form.ts'));
37
+ return (0, schematics_ts_morph_1.TsMorphAngularProjectTransformRule)(options, (project, [sourceFile]) => {
28
38
  const interfaceDeclaration = sourceFile.getInterface(interfaceName);
29
39
  if (interfaceDeclaration) {
30
40
  interfaceDeclaration.remove();
@@ -37,29 +47,102 @@ function UseOperationResponseAsFormTypeRule(options) {
37
47
  namedImports: [(0, schematics_ts_morph_1.OperationIdToResponseClassName)(operationId)],
38
48
  moduleSpecifier: (0, schematics_ts_morph_1.OperationIdToResponseClassImportPath)(operationId, scope),
39
49
  });
40
- });
50
+ }, ['/' + (0, utilities_1.CoerceSuffix)(name, '.form.ts')]);
51
+ }
52
+ function nestjsBackendRule(normalizedOptions) {
53
+ const { project, feature, shared, directory, nestModule, type, context, controllerName, scope, } = normalizedOptions;
54
+ if (!nestModule) {
55
+ throw new Error('The nest module is required');
56
+ }
57
+ const controllerPath = `${(0, utilities_1.dasherize)(nestModule)}/action/:rowId/${type}`;
58
+ return (0, schematics_1.chain)([
59
+ () => console.log('Coerce form get table action operation'),
60
+ (0, schematics_ts_morph_1.CoerceOperation)({
61
+ controllerName,
62
+ nestModule,
63
+ project,
64
+ feature,
65
+ shared,
66
+ context,
67
+ operationName: `get`,
68
+ controllerPath,
69
+ tsMorphTransform: (project, sourceFile) => {
70
+ const { className, filePath, } = (0, schematics_ts_morph_1.CoerceDtoClass)({
71
+ project,
72
+ name: controllerName,
73
+ propertyList: normalizedOptions.options.controlList.map(control => (0, index_1.FormComponentControlToDtoClassProperty)(control)),
74
+ });
75
+ (0, schematics_ts_morph_1.CoerceImports)(sourceFile, {
76
+ namedImports: [className],
77
+ moduleSpecifier: filePath,
78
+ });
79
+ return {
80
+ returnType: className,
81
+ paramList: [
82
+ {
83
+ name: 'rowId',
84
+ fromParent: true,
85
+ },
86
+ ],
87
+ };
88
+ },
89
+ }),
90
+ () => console.log('Coerce form submit table action operation'),
91
+ (0, schematics_ts_morph_1.CoerceFormSubmitOperation)({
92
+ controllerName,
93
+ project,
94
+ feature,
95
+ shared,
96
+ nestModule,
97
+ context,
98
+ controllerPath,
99
+ paramList: [
100
+ {
101
+ name: 'rowId',
102
+ fromParent: true,
103
+ },
104
+ ],
105
+ bodyDtoName: controllerName,
106
+ }),
107
+ () => console.log('Update form type alias'),
108
+ UseOperationResponseAsFormTypeRule({
109
+ scope,
110
+ project,
111
+ feature,
112
+ directory: (0, path_1.join)(directory !== null && directory !== void 0 ? directory : '', (0, utilities_1.CoerceSuffix)(type, '-form')),
113
+ name: type,
114
+ operationId: buildGetOperationId(normalizedOptions),
115
+ }),
116
+ ]);
117
+ }
118
+ function backendRule(normalizedOptions) {
119
+ const { backend } = normalizedOptions;
120
+ switch (backend) {
121
+ case backend_types_1.BackendTypes.NESTJS:
122
+ return nestjsBackendRule(normalizedOptions);
123
+ }
124
+ return (0, schematics_1.noop)();
125
+ }
126
+ function printOptions(options) {
127
+ (0, angular_options_1.PrintAngularOptions)('form-table-action', options);
128
+ }
129
+ function buildGetOperationId(normalizedOptions) {
130
+ const { controllerName, } = normalizedOptions;
131
+ return (0, schematics_ts_morph_1.buildOperationId)(normalizedOptions, `get`, controllerName);
41
132
  }
42
133
  function default_1(options) {
43
134
  const normalizedOptions = NormalizeFormTableActionOptions(options);
44
- const { refresh, confirm, tooltip, errorMessage, successMessage, priority, checkFunction, tableName, project, feature, shared, directory, nestModule, type, context, controllerName, overwrite, scope, options: formOptions, } = normalizedOptions;
45
- console.log(`===== Generating form table action for type '${type}' for project '${project}' in feature '${feature}' in directory '${directory}' with context '${context}' and the nest module '${nestModule}' and controller '${controllerName}' ...`);
135
+ const { refresh, confirm, tooltip, errorMessage, successMessage, priority, checkFunction, tableName, project, feature, shared, directory, nestModule, type, context, controllerName, overwrite, scope, options: formOptions, backend, } = normalizedOptions;
136
+ printOptions(normalizedOptions);
46
137
  return (host) => {
47
- if (!(0, schematics_ts_morph_1.HasTableComponent)(host, {
48
- project,
49
- feature,
50
- directory,
51
- name: tableName,
52
- })) {
53
- throw new schematics_1.SchematicsException(`Could not find the table component '${tableName}' in the project '${project}' and feature '${feature}' and directory '${directory}'.`);
54
- }
138
+ (0, assert_table_component_exists_1.AssertTableComponentExists)(host, normalizedOptions);
55
139
  return (0, schematics_1.chain)([
140
+ () => console.group('\x1b[32m[@rxap/schematics-angular:form-table-action]\x1b[0m'),
141
+ () => console.info(`Generating form table action rule...`),
56
142
  (0, schematics_ts_morph_1.CoerceFormTableActionRule)({
57
143
  scope,
58
144
  directory: (0, path_1.join)(directory !== null && directory !== void 0 ? directory : '', 'methods', 'action'),
59
- loadOperationId: (0, schematics_ts_morph_1.buildOperationId)(normalizedOptions, `get`, (0, schematics_ts_morph_1.BuildNestControllerName)({
60
- controllerName,
61
- nestModule,
62
- })),
145
+ loadOperationId: backend === backend_types_1.BackendTypes.NESTJS ? buildGetOperationId(normalizedOptions) : undefined,
63
146
  type,
64
147
  tableName,
65
148
  refresh,
@@ -72,65 +155,34 @@ function default_1(options) {
72
155
  project,
73
156
  feature,
74
157
  }),
75
- (0, schematics_ts_morph_1.CoerceOperation)({
76
- controllerName,
77
- nestModule,
158
+ () => console.log('Coerce open form window method to table component ...'),
159
+ (0, schematics_ts_morph_1.CoerceComponentRule)({
78
160
  project,
79
161
  feature,
80
162
  shared,
81
- operationName: `get`,
82
- controllerPath: `action/:rowId/${type}`,
83
- overwriteControllerPath: true,
84
- tsMorphTransform: (project, sourceFile) => {
85
- const { className, filePath, } = (0, schematics_ts_morph_1.CoerceDtoClass)({
86
- project,
87
- name: (0, utilities_1.joinWithDash)([context, type, 'action', type, 'form']),
88
- });
89
- (0, schematics_ts_morph_1.CoerceImports)(sourceFile, {
90
- namedImports: [className],
91
- moduleSpecifier: filePath,
92
- });
93
- return {
94
- returnType: className,
95
- paramList: [
96
- {
97
- name: 'rowId',
98
- fromParent: true,
99
- },
100
- ],
101
- };
163
+ name: tableName,
164
+ directory,
165
+ overwrite,
166
+ tsMorphTransform: (project, [sourceFile]) => {
167
+ (0, schematics_ts_morph_1.AddComponentProvider)(sourceFile, `Open${(0, utilities_1.classify)(type)}FormWindowMethod`, [
168
+ {
169
+ moduleSpecifier: `./${type}-form/open-${type}-form-window.method`,
170
+ namedImports: [`Open${(0, utilities_1.classify)(type)}FormWindowMethod`],
171
+ },
172
+ ]);
102
173
  },
103
174
  }),
175
+ () => console.info(`Generating form component...`),
104
176
  (0, schematics_utilities_1.ExecuteSchematic)('form-component', Object.assign(Object.assign({}, formOptions !== null && formOptions !== void 0 ? formOptions : {}), { project, name: type, feature,
105
177
  directory,
106
178
  shared, window: true, role: type, nestModule,
107
179
  controllerName,
108
- overwrite, context: (0, utilities_1.joinWithDash)([context, type, 'action']) })),
109
- (0, schematics_ts_morph_1.CoerceFormSubmitOperation)({
110
- controllerName,
111
- project,
112
- feature,
113
- shared,
114
- nestModule,
115
- paramList: [
116
- {
117
- name: 'rowId',
118
- fromParent: true,
119
- },
120
- ],
121
- bodyDtoName: (0, utilities_1.joinWithDash)([context, type, 'action', type, 'form']),
122
- }),
123
- UseOperationResponseAsFormTypeRule({
124
- scope,
125
- project,
126
- feature,
127
- directory: (0, path_1.join)(directory !== null && directory !== void 0 ? directory : '', (0, utilities_1.CoerceSuffix)(type, '-form')),
128
- name: type,
129
- operationId: (0, schematics_ts_morph_1.buildOperationId)(normalizedOptions, `get`, (0, schematics_ts_morph_1.BuildNestControllerName)({
130
- controllerName,
131
- nestModule,
132
- })),
133
- }),
180
+ overwrite,
181
+ context,
182
+ backend })),
183
+ () => console.info(`Generating backend...`),
184
+ backendRule(normalizedOptions),
185
+ () => console.groupEnd(),
134
186
  ]);
135
187
  };
136
188
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/schematic/angular/src/schematics/table/action/form-table-action/index.ts"],"names":[],"mappings":";;;AAAA,2DAKoC;AACpC,mEAcmC;AACnC,qEAA8D;AAC9D,+CAKyB;AACzB,+BAA4B;AAM5B,sEAGmC;AAMnC,SAAgB,+BAA+B,CAC7C,OAAyC;IAEzC,yBACK,IAAA,6DAAoC,EAAC,OAAO,CAAC,EAChD;AACJ,CAAC;AAND,0EAMC;AAED,SAAgB,eAAe,CAC7B,UAAsB,EACtB,IAAY,EACZ,SAAoE;IAEpE,IAAI,oBAAoB,GAAG,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IACzD,I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EAAE,IAAI,EAAE,MAAM,CAAE,CAAC;aACrE,CAAC;YACF,kCAAkC,CAAC;gBACjC,KAAK;gBACL,OAAO;gBACP,OAAO;gBACP,SAAS,EAAE,IAAA,WAAI,EAAC,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,EAAE,EAAE,IAAA,wBAAY,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;gBAC7D,IAAI,EAAE,IAAI;gBACV,WAAW,EAAE,IAAA,sCAAgB,EAC3B,iBAAiB,EACjB,KAAK,EACL,IAAA,6CAAuB,EAAC;oBACtB,cAAc;oBACd,UAAU;iBACX,CAAC,CACH;aACF,CAAC;SACH,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAlJD,4BAkJC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/schematic/angular/src/schematics/table/action/form-table-action/index.ts"],"names":[],"mappings":";;;AAAA,2DAKoC;AACpC,mEAcmC;AACnC,qEAA8D;AAC9D,+CAKyB;AACzB,+BAA4B;AAO5B,qEAAsE;AACtE,iGAA2F;AAC3F,iEAA6D;AAC7D,mFAGgD;AAChD,8DAA4F;AAC5F,sEAGmC;AAUnC,SAAgB,+BAA+B,CAC7C,OAAyC;;IAEzC,MAAM,iBAAiB,GAAG,IAAA,6DAAoC,EAAC,OAAO,CAAC,CAAC;IACxE,MAAM,EACJ,cAAc,EACd,IAAI,EACJ,UAAU,GACX,GAAG,iBAAiB,CAAC;IACtB,uCACK,iBAAiB,KACpB,cAAc,EAAE,IAAA,6CAAuB,EAAC;YACtC,UAAU;YACV,cAAc,EAAE,CAAE,IAAI,EAAE,QAAQ,CAAE,CAAC,IAAI,CAAC,GAAG,CAAC;SAC7C,CAAC,EACF,OAAO,kCACF,MAAA,iBAAiB,CAAC,OAAO,mCAAI,EAAE,KAClC,WAAW,EAAE,IAAA,0DAAiC,EAAC,MAAA,MAAA,iBAAiB,CAAC,OAAO,0CAAG,aAAa,CAAC,mCAAI,EAAE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AE,UAAU,CAAkB,EAC9B,EAAE;oBACF,IAAA,0CAAoB,EAClB,UAAU,EACV,OAAQ,IAAA,oBAAQ,EAAC,IAAI,CAAE,kBAAkB,EACzC;wBACE;4BACE,eAAe,EAAE,KAAM,IAAK,cAAe,IAAK,qBAAqB;4BACrE,YAAY,EAAE,CAAE,OAAQ,IAAA,oBAAQ,EAAC,IAAI,CAAE,kBAAkB,CAAE;yBAC5D;qBACF,CACF,CAAC;gBACJ,CAAC;aACF,CAAC;YACF,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,8BAA8B,CAAC;YAClD,IAAA,uCAAgB,EAAC,gBAAgB,kCAC5B,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,EAAE,KACpB,OAAO,EACP,IAAI,EAAE,IAAI,EACV,OAAO;gBACP,SAAS;gBACT,MAAM,EACN,MAAM,EAAE,IAAI,EACZ,IAAI,EAAE,IAAI,EACV,UAAU;gBACV,cAAc;gBACd,SAAS;gBACT,OAAO;gBACP,OAAO,IACP;YACF,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,uBAAuB,CAAC;YAC3C,WAAW,CAAC,iBAAiB,CAAC;YAC9B,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE;SACzB,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AA/FD,4BA+FC"}
@@ -88,6 +88,41 @@
88
88
  },
89
89
  "options": {
90
90
  "type": "object",
91
+ "properties": {
92
+ "controlList": {
93
+ "alias": "control",
94
+ "type": "array",
95
+ "items": {
96
+ "type": "object",
97
+ "properties": {
98
+ "type": {
99
+ "type": "string"
100
+ },
101
+ "name": {
102
+ "type": "string"
103
+ },
104
+ "state": {
105
+ "type": "string",
106
+ "description": "The initial state of the control"
107
+ },
108
+ "isRequired": {
109
+ "type": "boolean",
110
+ "description": "Whether the control value is required",
111
+ "default": false
112
+ },
113
+ "validatorList": {
114
+ "type": "array",
115
+ "items": {
116
+ "type": "string"
117
+ }
118
+ }
119
+ },
120
+ "required": [
121
+ "name"
122
+ ]
123
+ }
124
+ }
125
+ },
91
126
  "additionalProperties": true
92
127
  }
93
128
  },
@@ -1,7 +1,7 @@
1
- import { NavigationTableActionOptions } from './schema';
2
1
  import { Tree } from '@angular-devkit/schematics';
3
2
  import { Normalized } from '@rxap/utilities';
4
3
  import { NormalizedOperationTableActionOptions } from '../operation-table-action';
4
+ import { NavigationTableActionOptions } from './schema';
5
5
  export type NormalizedNavigationTableActionOptions = Readonly<Normalized<NavigationTableActionOptions>> & NormalizedOperationTableActionOptions;
6
6
  export declare function NormalizeNavigationTableActionOptions(options: NavigationTableActionOptions): NormalizedNavigationTableActionOptions;
7
7
  export default function (options: NavigationTableActionOptions): (host: Tree) => import("@angular-devkit/schematics").Rule;
@@ -2,28 +2,27 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.NormalizeNavigationTableActionOptions = void 0;
4
4
  const schematics_1 = require("@angular-devkit/schematics");
5
- const path_1 = require("path");
6
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");
7
9
  const operation_table_action_1 = require("../operation-table-action");
8
10
  function NormalizeNavigationTableActionOptions(options) {
9
11
  var _a;
10
12
  return Object.assign(Object.assign({}, (0, operation_table_action_1.NormalizeOperationTableActionOptions)(options)), { route: (_a = options.route) !== null && _a !== void 0 ? _a : null });
11
13
  }
12
14
  exports.NormalizeNavigationTableActionOptions = NormalizeNavigationTableActionOptions;
15
+ function printOptions(options) {
16
+ (0, angular_options_1.PrintAngularOptions)('navigation-table-action', options);
17
+ }
13
18
  function default_1(options) {
14
19
  const normalizedOptions = NormalizeNavigationTableActionOptions(options);
15
20
  const { refresh, confirm, tooltip, errorMessage, successMessage, priority, checkFunction, tableName, project, feature, shared, directory, type, route, } = normalizedOptions;
16
- console.log(`===== Generating navigation table action for type '${type}' for project '${project}' in feature '${feature}' in directory '${directory}' ...`);
21
+ printOptions(normalizedOptions);
17
22
  return (host) => {
18
- if (!(0, schematics_ts_morph_1.HasTableComponent)(host, {
19
- project,
20
- feature,
21
- directory,
22
- name: tableName,
23
- })) {
24
- throw new schematics_1.SchematicsException(`Could not find the table component '${tableName}' in the project '${project}' and feature '${feature}' and directory '${directory}'.`);
25
- }
23
+ (0, assert_table_component_exists_1.AssertTableComponentExists)(host, normalizedOptions);
26
24
  return (0, schematics_1.chain)([
25
+ () => console.group('\x1b[32m[@rxap/schematics-angular:navigation-table-action]\x1b[0m'),
27
26
  (0, schematics_ts_morph_1.CoerceNavigationTableActionRule)({
28
27
  directory: (0, path_1.join)(directory !== null && directory !== void 0 ? directory : '', 'methods', 'action'),
29
28
  type,
@@ -39,6 +38,7 @@ function default_1(options) {
39
38
  feature,
40
39
  route,
41
40
  }),
41
+ () => console.groupEnd(),
42
42
  ]);
43
43
  };
44
44
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/schematic/angular/src/schematics/table/action/navigation-table-action/index.ts"],"names":[],"mappings":";;;AACA,2DAIoC;AACpC,+BAA4B;AAC5B,mEAGmC;AAEnC,sEAGmC;AAKnC,SAAgB,qCAAqC,CACnD,OAAqC;;IAErC,uCACK,IAAA,6DAAoC,EAAC,OAAO,CAAC,KAChD,KAAK,EAAE,MAAA,OAAO,CAAC,KAAK,mCAAI,IAAI,IAC5B;AACJ,CAAC;AAPD,sFAOC;AAED,mBAAyB,OAAqC;IAC5D,MAAM,iBAAiB,GAAG,qCAAqC,CAAC,OAAO,CAAC,CAAC;IACzE,MAAM,EACJ,OAAO,EACP,OAAO,EACP,OAAO,EACP,YAAY,EACZ,cAAc,EACd,QAAQ,EACR,aAAa,EACb,SAAS,EACT,OAAO,EACP,OAAO,EACP,MAAM,EACN,SAAS,EACT,IAAI,EACJ,KAAK,GACN,GAAG,iBAAiB,CAAC;IACtB,OAAO,CAAC,GAAG,CACT,sDAAuD,IAAK,kBAAmB,OAAQ,iBAAkB,OAAQ,mBAAoB,SAAU,OAAO,CACvJ,CAAC;IACF,OAAO,CAAC,IAAU,EAAE,EAAE;QACpB,IACE,CAAC,IAAA,uCAAiB,EAAC,IAAI,EAAE;YACvB,OAAO;YACP,OAAO;YACP,SAAS;YACT,IAAI,EAAE,SAAS;SAChB,CAAC,EACF;YACA,MAAM,IAAI,gCAAmB,CAC3B,uCAAwC,SAAU,qBAAsB,OAAQ,kBAAmB,OAAQ,oBAAqB,SAAU,IAAI,CAC/I,CAAC;SACH;QAED,OAAO,IAAA,kBAAK,EAAC;YACX,IAAA,qDAA+B,EAAC;gBAC9B,SAAS,EAAE,IAAA,WAAI,EAAC,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,EAAE,EAAE,SAAS,EAAE,QAAQ,CAAC;gBACrD,IAAI;gBACJ,SAAS;gBACT,OAAO;gBACP,OAAO;gBACP,OAAO;gBACP,YAAY;gBACZ,cAAc;gBACd,QAAQ;gBACR,aAAa;gBACb,OAAO;gBACP,OAAO;gBACP,KAAK;aACN,CAAC;SACH,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AArDD,4BAqDC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/schematic/angular/src/schematics/table/action/navigation-table-action/index.ts"],"names":[],"mappings":";;;AAAA,2DAGoC;AACpC,mEAA4E;AAE5E,+BAA4B;AAC5B,qEAAsE;AACtE,iGAA2F;AAC3F,sEAGmC;AAMnC,SAAgB,qCAAqC,CACnD,OAAqC;;IAErC,uCACK,IAAA,6DAAoC,EAAC,OAAO,CAAC,KAChD,KAAK,EAAE,MAAA,OAAO,CAAC,KAAK,mCAAI,IAAI,IAC5B;AACJ,CAAC;AAPD,sFAOC;AAED,SAAS,YAAY,CAAC,OAA+C;IACnE,IAAA,qCAAmB,EAAC,yBAAyB,EAAE,OAAO,CAAC,CAAC;AAC1D,CAAC;AAED,mBAAyB,OAAqC;IAC5D,MAAM,iBAAiB,GAAG,qCAAqC,CAAC,OAAO,CAAC,CAAC;IACzE,MAAM,EACJ,OAAO,EACP,OAAO,EACP,OAAO,EACP,YAAY,EACZ,cAAc,EACd,QAAQ,EACR,aAAa,EACb,SAAS,EACT,OAAO,EACP,OAAO,EACP,MAAM,EACN,SAAS,EACT,IAAI,EACJ,KAAK,GACN,GAAG,iBAAiB,CAAC;IACtB,YAAY,CAAC,iBAAiB,CAAC,CAAC;IAChC,OAAO,CAAC,IAAU,EAAE,EAAE;QAEpB,IAAA,0DAA0B,EAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;QAEpD,OAAO,IAAA,kBAAK,EAAC;YACX,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,mEAAmE,CAAC;YACxF,IAAA,qDAA+B,EAAC;gBAC9B,SAAS,EAAE,IAAA,WAAI,EAAC,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,EAAE,EAAE,SAAS,EAAE,QAAQ,CAAC;gBACrD,IAAI;gBACJ,SAAS;gBACT,OAAO;gBACP,OAAO;gBACP,OAAO;gBACP,YAAY;gBACZ,cAAc;gBACd,QAAQ;gBACR,aAAa;gBACb,OAAO;gBACP,OAAO;gBACP,KAAK;aACN,CAAC;YACF,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE;SACzB,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AA3CD,4BA2CC"}
@@ -2,10 +2,8 @@ import { Tree } from '@angular-devkit/schematics';
2
2
  import { Normalized } from '@rxap/utilities';
3
3
  import { NormalizedAngularOptions } from '../../../../lib/angular-options';
4
4
  import { OperationTableActionOptions } from './schema';
5
- type tmp = Readonly<Normalized<OperationTableActionOptions>> & NormalizedAngularOptions;
6
- export interface NormalizedOperationTableActionOptions extends tmp {
5
+ export interface NormalizedOperationTableActionOptions extends Readonly<Normalized<OperationTableActionOptions> & NormalizedAngularOptions> {
7
6
  controllerName: string;
8
7
  }
9
8
  export declare function NormalizeOperationTableActionOptions(options: OperationTableActionOptions): NormalizedOperationTableActionOptions;
10
9
  export default function (options: OperationTableActionOptions): (host: Tree) => import("@angular-devkit/schematics").Rule;
11
- export {};
@@ -10,14 +10,14 @@ const assert_table_component_exists_1 = require("../../../../lib/assert-table-co
10
10
  const backend_types_1 = require("../../../../lib/backend-types");
11
11
  const table_action_1 = require("../../table-action");
12
12
  function NormalizeOperationTableActionOptions(options) {
13
- var _a, _b;
13
+ var _a;
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
- const controllerName = normalizedOptions.tableName;
17
- const context = (_b = options.context) !== null && _b !== void 0 ? _b : (0, utilities_1.joinWithDash)([nestModule, controllerName], { removeDuplicated: true });
18
- return Object.assign(Object.assign({}, normalizedOptions), { nestModule,
19
- controllerName,
20
- context });
16
+ const context = options.context ? (0, utilities_1.dasherize)(options.context) : null;
17
+ return Object.seal(Object.assign(Object.assign({}, normalizedOptions), { nestModule, controllerName: (0, schematics_ts_morph_1.BuildNestControllerName)({
18
+ controllerName: context,
19
+ nestModule,
20
+ }), context }));
21
21
  }
22
22
  exports.NormalizeOperationTableActionOptions = NormalizeOperationTableActionOptions;
23
23
  function openApiOperationRule(normalizedOptions) {
@@ -27,10 +27,7 @@ function openApiOperationRule(normalizedOptions) {
27
27
  (0, schematics_ts_morph_1.CoerceOperationTableActionRule)({
28
28
  scope,
29
29
  directory: (0, path_1.join)(directory !== null && directory !== void 0 ? directory : '', 'methods', 'action'),
30
- operationId: (0, schematics_ts_morph_1.buildOperationId)(normalizedOptions, `${type}-action`, (0, schematics_ts_morph_1.BuildNestControllerName)({
31
- controllerName,
32
- nestModule,
33
- })),
30
+ operationId: (0, schematics_ts_morph_1.buildOperationId)(normalizedOptions, `${type}-action`, controllerName),
34
31
  type,
35
32
  tableName,
36
33
  refresh,
@@ -70,16 +67,18 @@ function backendRule(normalizedOptions) {
70
67
  }
71
68
  return (0, schematics_1.noop)();
72
69
  }
73
- function printOperationTableActionOptions(options) {
70
+ function printOptions(options) {
74
71
  (0, angular_options_1.PrintAngularOptions)('operation-table-action', options);
75
72
  }
76
73
  function default_1(options) {
77
74
  const normalizedOptions = NormalizeOperationTableActionOptions(options);
78
- printOperationTableActionOptions(normalizedOptions);
75
+ printOptions(normalizedOptions);
79
76
  return (host) => {
80
77
  (0, assert_table_component_exists_1.AssertTableComponentExists)(host, normalizedOptions);
81
78
  return (0, schematics_1.chain)([
79
+ () => console.group('\x1b[32m[@rxap/schematics-angular:operation-table-action]\x1b[0m'),
82
80
  backendRule(normalizedOptions),
81
+ () => console.groupEnd(),
83
82
  ]);
84
83
  };
85
84
  }