@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.
Files changed (112) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +1 -1
  3. package/collection.json +16 -1
  4. package/package.json +10 -10
  5. package/src/lib/accordion-item.js +17 -19
  6. package/src/lib/accordion-item.js.map +1 -1
  7. package/src/lib/accordion-itme-types.js +3 -7
  8. package/src/lib/accordion-itme-types.js.map +1 -1
  9. package/src/lib/adapter-options.js +2 -6
  10. package/src/lib/adapter-options.js.map +1 -1
  11. package/src/lib/angular-options.js +37 -22
  12. package/src/lib/angular-options.js.map +1 -1
  13. package/src/lib/assert-table-component-exists.js +5 -9
  14. package/src/lib/assert-table-component-exists.js.map +1 -1
  15. package/src/lib/backend-types.js +2 -5
  16. package/src/lib/backend-types.js.map +1 -1
  17. package/src/lib/data-grid-item.js +5 -12
  18. package/src/lib/data-grid-item.js.map +1 -1
  19. package/src/lib/data-grid-options.js +8 -13
  20. package/src/lib/data-grid-options.js.map +1 -1
  21. package/src/lib/dialog-action.js +7 -14
  22. package/src/lib/dialog-action.js.map +1 -1
  23. package/src/lib/existing-method.js +1 -5
  24. package/src/lib/existing-method.js.map +1 -1
  25. package/src/lib/form-component-control.js +9 -16
  26. package/src/lib/form-component-control.js.map +1 -1
  27. package/src/lib/form-definition-control.js +9 -17
  28. package/src/lib/form-definition-control.js.map +1 -1
  29. package/src/lib/minimum-table-component-options.js +128 -202
  30. package/src/lib/minimum-table-component-options.js.map +1 -1
  31. package/src/lib/minimum-table-options.js +12 -17
  32. package/src/lib/minimum-table-options.js.map +1 -1
  33. package/src/lib/table-action.js +33 -37
  34. package/src/lib/table-action.js.map +1 -1
  35. package/src/lib/table-column.js +20 -27
  36. package/src/lib/table-column.js.map +1 -1
  37. package/src/lib/table-header-button.d.ts +10 -1
  38. package/src/lib/table-header-button.js +27 -13
  39. package/src/lib/table-header-button.js.map +1 -1
  40. package/src/lib/table-open-api-options.js +4 -8
  41. package/src/lib/table-open-api-options.js.map +1 -1
  42. package/src/lib/table-options.js +13 -15
  43. package/src/lib/table-options.js.map +1 -1
  44. package/src/lib/table-row-action.js +13 -18
  45. package/src/lib/table-row-action.js.map +1 -1
  46. package/src/lib/to-title.js +4 -8
  47. package/src/lib/to-title.js.map +1 -1
  48. package/src/lib/tree-table-options.js +11 -13
  49. package/src/lib/tree-table-options.js.map +1 -1
  50. package/src/schematics/accordion/accordion-component/index.js +125 -105
  51. package/src/schematics/accordion/accordion-component/index.js.map +1 -1
  52. package/src/schematics/accordion/accordion-item-component/index.js +119 -107
  53. package/src/schematics/accordion/accordion-item-component/index.js.map +1 -1
  54. package/src/schematics/accordion/item/accordion-item-data-grid-component/index.js +55 -54
  55. package/src/schematics/accordion/item/accordion-item-data-grid-component/index.js.map +1 -1
  56. package/src/schematics/accordion/item/accordion-item-table-component/index.js +38 -36
  57. package/src/schematics/accordion/item/accordion-item-table-component/index.js.map +1 -1
  58. package/src/schematics/accordion/item/accordion-item-tree-table-component/index.js +54 -52
  59. package/src/schematics/accordion/item/accordion-item-tree-table-component/index.js.map +1 -1
  60. package/src/schematics/data-grid-component/index.js +87 -81
  61. package/src/schematics/data-grid-component/index.js.map +1 -1
  62. package/src/schematics/dialog-component/index.js +21 -20
  63. package/src/schematics/dialog-component/index.js.map +1 -1
  64. package/src/schematics/form/control/input-form-control/index.d.ts +2 -2
  65. package/src/schematics/form/control/input-form-control/index.js +18 -17
  66. package/src/schematics/form/control/input-form-control/index.js.map +1 -1
  67. package/src/schematics/form/control/select-form-control/index.js +43 -43
  68. package/src/schematics/form/control/select-form-control/index.js.map +1 -1
  69. package/src/schematics/form/control/table-select-form-control/index.js +58 -58
  70. package/src/schematics/form/control/table-select-form-control/index.js.map +1 -1
  71. package/src/schematics/form/form-component/index.js +82 -61
  72. package/src/schematics/form/form-component/index.js.map +1 -1
  73. package/src/schematics/form/form-component/schema.json +3 -6
  74. package/src/schematics/form/form-control/index.js +24 -23
  75. package/src/schematics/form/form-control/index.js.map +1 -1
  76. package/src/schematics/form/form-definition/index.d.ts +2 -2
  77. package/src/schematics/form/form-definition/index.js +24 -19
  78. package/src/schematics/form/form-definition/index.js.map +1 -1
  79. package/src/schematics/table/action/dialog-table-action/index.js +32 -30
  80. package/src/schematics/table/action/dialog-table-action/index.js.map +1 -1
  81. package/src/schematics/table/action/form-table-action/index.js +89 -56
  82. package/src/schematics/table/action/form-table-action/index.js.map +1 -1
  83. package/src/schematics/table/action/navigation-table-action/index.js +19 -20
  84. package/src/schematics/table/action/navigation-table-action/index.js.map +1 -1
  85. package/src/schematics/table/action/operation-table-action/index.js +32 -31
  86. package/src/schematics/table/action/operation-table-action/index.js.map +1 -1
  87. package/src/schematics/table/header-button/form-table-header-button/index.d.ts +11 -0
  88. package/src/schematics/table/header-button/form-table-header-button/index.js +90 -0
  89. package/src/schematics/table/header-button/form-table-header-button/index.js.map +1 -0
  90. package/src/schematics/table/header-button/form-table-header-button/schema.d.ts +7 -0
  91. package/src/schematics/table/header-button/form-table-header-button/schema.json +123 -0
  92. package/src/schematics/table/header-button/navigation-table-header-button/index.d.ts +8 -0
  93. package/src/schematics/table/header-button/navigation-table-header-button/index.js +60 -0
  94. package/src/schematics/table/header-button/navigation-table-header-button/index.js.map +1 -0
  95. package/src/schematics/table/header-button/navigation-table-header-button/schema.d.ts +6 -0
  96. package/src/schematics/table/header-button/navigation-table-header-button/schema.json +85 -0
  97. package/src/schematics/table/table-action/index.js +24 -23
  98. package/src/schematics/table/table-action/index.js.map +1 -1
  99. package/src/schematics/table/table-component/files/component/__componentName__.component.html.template +5 -8
  100. package/src/schematics/table/table-component/files/component/__componentName__.component.ts.template +2 -2
  101. package/src/schematics/table/table-component/index.js +94 -93
  102. package/src/schematics/table/table-component/index.js.map +1 -1
  103. package/src/schematics/table/table-component/schema.json +4 -0
  104. package/src/schematics/table/table-header-button/index.d.ts +10 -0
  105. package/src/schematics/table/table-header-button/index.js +49 -0
  106. package/src/schematics/table/table-header-button/index.js.map +1 -0
  107. package/src/schematics/table/table-header-button/schema.d.ts +7 -0
  108. package/src/schematics/table/table-header-button/schema.json +80 -0
  109. package/src/schematics/table/tree-table-component/index.js +66 -63
  110. package/src/schematics/table/tree-table-component/index.js.map +1 -1
  111. package/src/schematics/tree-component/index.js +18 -18
  112. package/src/schematics/tree-component/index.js.map +1 -1
@@ -1,59 +1,67 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CoerceTypeAlias = exports.NormalizeFormTableActionOptions = void 0;
4
- const schematics_1 = require("@angular-devkit/schematics");
5
- const schematics_ts_morph_1 = require("@rxap/schematics-ts-morph");
6
- const schematics_utilities_1 = require("@rxap/schematics-utilities");
7
- const utilities_1 = require("@rxap/utilities");
8
- const 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");
14
- const operation_table_action_1 = require("../operation-table-action");
15
- function NormalizeFormTableActionOptions(options) {
16
- var _a, _b, _c;
17
- const normalizedOptions = (0, operation_table_action_1.NormalizeOperationTableActionOptions)(options);
1
+ import { chain, noop, } from '@angular-devkit/schematics';
2
+ import { AddComponentProvider, BuildNestControllerName, buildOperationId, CoerceComponentRule, CoerceDtoClass, CoerceFormSubmitOperation, CoerceFormTableActionRule, CoerceImports, CoerceOperation, OperationIdToResponseClassImportPath, OperationIdToResponseClassName, TsMorphAngularProjectTransformRule, } from '@rxap/schematics-ts-morph';
3
+ import { ExecuteSchematic } from '@rxap/schematics-utilities';
4
+ import { classify, CoerceSuffix, dasherize, } from '@rxap/utilities';
5
+ import { join } from 'path';
6
+ import { PrintAngularOptions } from '../../../../lib/angular-options';
7
+ import { AssertTableComponentExists } from '../../../../lib/assert-table-component-exists';
8
+ import { BackendTypes } from '../../../../lib/backend-types';
9
+ import { NormalizeFormComponentControlList, } from '../../../../lib/form-component-control';
10
+ import { FormComponentControlToDtoClassProperty } from '../../../form/form-component/index';
11
+ import { NormalizeOperationTableActionOptions, } from '../operation-table-action';
12
+ export function NormalizeFormTableActionOptions(options) {
13
+ const normalizedOptions = NormalizeOperationTableActionOptions(options);
18
14
  const { controllerName, type, nestModule, } = normalizedOptions;
19
- return Object.assign(Object.assign({}, normalizedOptions), { controllerName: (0, schematics_ts_morph_1.BuildNestControllerName)({
15
+ return {
16
+ ...normalizedOptions,
17
+ controllerName: BuildNestControllerName({
20
18
  nestModule,
21
19
  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 : []) }) });
20
+ }),
21
+ options: {
22
+ ...normalizedOptions.options ?? {},
23
+ controlList: NormalizeFormComponentControlList(normalizedOptions.options?.['controlList'] ?? []),
24
+ },
25
+ };
23
26
  }
24
- exports.NormalizeFormTableActionOptions = NormalizeFormTableActionOptions;
25
- function CoerceTypeAlias(sourceFile, name, structure) {
27
+ export function CoerceTypeAlias(sourceFile, name, structure) {
26
28
  let typeAliasDeclaration = sourceFile.getTypeAlias(name);
27
29
  if (!typeAliasDeclaration) {
28
- typeAliasDeclaration = sourceFile.addTypeAlias(Object.assign(Object.assign({}, structure), { name }));
30
+ typeAliasDeclaration = sourceFile.addTypeAlias({
31
+ ...structure,
32
+ name,
33
+ });
29
34
  }
30
35
  return typeAliasDeclaration;
31
36
  }
32
- exports.CoerceTypeAlias = CoerceTypeAlias;
33
37
  function UseOperationResponseAsFormTypeRule(options) {
34
38
  const { name, operationId, scope, } = options;
35
- const className = (0, utilities_1.CoerceSuffix)((0, utilities_1.classify)(name), 'Form');
39
+ const className = CoerceSuffix(classify(name), 'Form');
36
40
  const interfaceName = `I${className}`;
37
- return (0, schematics_ts_morph_1.TsMorphAngularProjectTransformRule)(options, (project, [sourceFile]) => {
41
+ return TsMorphAngularProjectTransformRule(options, (project, [sourceFile]) => {
38
42
  const interfaceDeclaration = sourceFile.getInterface(interfaceName);
39
43
  if (interfaceDeclaration) {
40
44
  interfaceDeclaration.remove();
41
45
  }
42
46
  CoerceTypeAlias(sourceFile, interfaceName, {
43
- type: (0, schematics_ts_morph_1.OperationIdToResponseClassName)(operationId),
47
+ type: OperationIdToResponseClassName(operationId),
44
48
  isExported: true,
45
- }).set({ type: (0, schematics_ts_morph_1.OperationIdToResponseClassName)(operationId) });
46
- (0, schematics_ts_morph_1.CoerceImports)(sourceFile, {
47
- namedImports: [(0, schematics_ts_morph_1.OperationIdToResponseClassName)(operationId)],
48
- moduleSpecifier: (0, schematics_ts_morph_1.OperationIdToResponseClassImportPath)(operationId, scope),
49
+ }).set({ type: OperationIdToResponseClassName(operationId) });
50
+ CoerceImports(sourceFile, {
51
+ namedImports: [OperationIdToResponseClassName(operationId)],
52
+ moduleSpecifier: OperationIdToResponseClassImportPath(operationId, scope),
49
53
  });
50
- }, ['/' + (0, utilities_1.CoerceSuffix)(name, '.form.ts')]);
54
+ }, ['/' + CoerceSuffix(name, '.form.ts')]);
51
55
  }
52
56
  function nestjsBackendRule(normalizedOptions) {
53
57
  const { project, feature, shared, directory, nestModule, type, context, controllerName, scope, } = normalizedOptions;
54
- return (0, schematics_1.chain)([
58
+ if (!nestModule) {
59
+ throw new Error('The nest module is required');
60
+ }
61
+ const controllerPath = `${dasherize(nestModule)}/action/:rowId/${type}`;
62
+ return chain([
55
63
  () => console.log('Coerce form get table action operation'),
56
- (0, schematics_ts_morph_1.CoerceOperation)({
64
+ CoerceOperation({
57
65
  controllerName,
58
66
  nestModule,
59
67
  project,
@@ -61,15 +69,14 @@ function nestjsBackendRule(normalizedOptions) {
61
69
  shared,
62
70
  context,
63
71
  operationName: `get`,
64
- controllerPath: `action/:rowId/${type}`,
65
- overwriteControllerPath: true,
72
+ controllerPath,
66
73
  tsMorphTransform: (project, sourceFile) => {
67
- const { className, filePath, } = (0, schematics_ts_morph_1.CoerceDtoClass)({
74
+ const { className, filePath, } = CoerceDtoClass({
68
75
  project,
69
76
  name: controllerName,
70
- propertyList: normalizedOptions.options.controlList.map(control => (0, index_1.FormComponentControlToDtoClassProperty)(control)),
77
+ propertyList: normalizedOptions.options.controlList.map(control => FormComponentControlToDtoClassProperty(control)),
71
78
  });
72
- (0, schematics_ts_morph_1.CoerceImports)(sourceFile, {
79
+ CoerceImports(sourceFile, {
73
80
  namedImports: [className],
74
81
  moduleSpecifier: filePath,
75
82
  });
@@ -85,13 +92,14 @@ function nestjsBackendRule(normalizedOptions) {
85
92
  },
86
93
  }),
87
94
  () => console.log('Coerce form submit table action operation'),
88
- (0, schematics_ts_morph_1.CoerceFormSubmitOperation)({
95
+ CoerceFormSubmitOperation({
89
96
  controllerName,
90
97
  project,
91
98
  feature,
92
99
  shared,
93
100
  nestModule,
94
101
  context,
102
+ controllerPath,
95
103
  paramList: [
96
104
  {
97
105
  name: 'rowId',
@@ -105,7 +113,7 @@ function nestjsBackendRule(normalizedOptions) {
105
113
  scope,
106
114
  project,
107
115
  feature,
108
- directory: (0, path_1.join)(directory !== null && directory !== void 0 ? directory : '', (0, utilities_1.CoerceSuffix)(type, '-form')),
116
+ directory: join(directory ?? '', CoerceSuffix(type, '-form')),
109
117
  name: type,
110
118
  operationId: buildGetOperationId(normalizedOptions),
111
119
  }),
@@ -114,32 +122,31 @@ function nestjsBackendRule(normalizedOptions) {
114
122
  function backendRule(normalizedOptions) {
115
123
  const { backend } = normalizedOptions;
116
124
  switch (backend) {
117
- case backend_types_1.BackendTypes.NESTJS:
125
+ case BackendTypes.NESTJS:
118
126
  return nestjsBackendRule(normalizedOptions);
119
127
  }
120
- return (0, schematics_1.noop)();
128
+ return noop();
121
129
  }
122
130
  function printOptions(options) {
123
- (0, angular_options_1.PrintAngularOptions)('form-table-action', options);
131
+ PrintAngularOptions('form-table-action', options);
124
132
  }
125
133
  function buildGetOperationId(normalizedOptions) {
126
134
  const { controllerName, } = normalizedOptions;
127
- return (0, schematics_ts_morph_1.buildOperationId)(normalizedOptions, `get`, controllerName);
135
+ return buildOperationId(normalizedOptions, `get`, controllerName);
128
136
  }
129
- function default_1(options) {
137
+ export default function (options) {
130
138
  const normalizedOptions = NormalizeFormTableActionOptions(options);
131
139
  const { refresh, confirm, tooltip, errorMessage, successMessage, priority, checkFunction, tableName, project, feature, shared, directory, nestModule, type, context, controllerName, overwrite, scope, options: formOptions, backend, } = normalizedOptions;
132
140
  printOptions(normalizedOptions);
133
141
  return (host) => {
134
- (0, assert_table_component_exists_1.AssertTableComponentExists)(host, normalizedOptions);
135
- const loadOperationId = backend === backend_types_1.BackendTypes.NESTJS ? buildGetOperationId(normalizedOptions) : undefined;
136
- console.log('loadOperationId', loadOperationId);
137
- return (0, schematics_1.chain)([
142
+ AssertTableComponentExists(host, normalizedOptions);
143
+ return chain([
144
+ () => console.group('\x1b[32m[@rxap/schematics-angular:form-table-action]\x1b[0m'),
138
145
  () => console.info(`Generating form table action rule...`),
139
- (0, schematics_ts_morph_1.CoerceFormTableActionRule)({
146
+ CoerceFormTableActionRule({
140
147
  scope,
141
- directory: (0, path_1.join)(directory !== null && directory !== void 0 ? directory : '', 'methods', 'action'),
142
- loadOperationId,
148
+ directory: join(directory ?? '', 'methods', 'action'),
149
+ loadOperationId: backend === BackendTypes.NESTJS ? buildGetOperationId(normalizedOptions) : undefined,
143
150
  type,
144
151
  tableName,
145
152
  refresh,
@@ -152,17 +159,43 @@ function default_1(options) {
152
159
  project,
153
160
  feature,
154
161
  }),
162
+ () => console.log('Coerce open form window method to table component ...'),
163
+ CoerceComponentRule({
164
+ project,
165
+ feature,
166
+ shared,
167
+ name: tableName,
168
+ directory,
169
+ overwrite,
170
+ tsMorphTransform: (project, [sourceFile]) => {
171
+ AddComponentProvider(sourceFile, `Open${classify(type)}FormWindowMethod`, [
172
+ {
173
+ moduleSpecifier: `./${type}-form/open-${type}-form-window.method`,
174
+ namedImports: [`Open${classify(type)}FormWindowMethod`],
175
+ },
176
+ ]);
177
+ },
178
+ }),
155
179
  () => console.info(`Generating form component...`),
156
- (0, schematics_utilities_1.ExecuteSchematic)('form-component', Object.assign(Object.assign({}, formOptions !== null && formOptions !== void 0 ? formOptions : {}), { project, name: type, feature,
180
+ ExecuteSchematic('form-component', {
181
+ ...formOptions ?? {},
182
+ project,
183
+ name: type,
184
+ feature,
157
185
  directory,
158
- shared, window: true, role: type, nestModule,
186
+ shared,
187
+ window: true,
188
+ role: type,
189
+ nestModule,
159
190
  controllerName,
160
191
  overwrite,
161
- context })),
192
+ context,
193
+ backend,
194
+ }),
162
195
  () => console.info(`Generating backend...`),
163
196
  backendRule(normalizedOptions),
197
+ () => console.groupEnd(),
164
198
  ]);
165
199
  };
166
200
  }
167
- exports.default = default_1;
168
201
  //# sourceMappingURL=index.js.map
@@ -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,mEAYmC;AACnC,qEAA8D;AAC9D,+CAIyB;AACzB,+BAA4B;AAM5B,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,CAA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,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,IACP;YACF,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,uBAAuB,CAAC;YAC3C,WAAW,CAAC,iBAAiB,CAAC;SAC/B,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAxED,4BAwEC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/schematic/angular/src/schematics/table/action/form-table-action/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,IAAI,GAGL,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EACd,yBAAyB,EACzB,yBAAyB,EACzB,aAAa,EACb,eAAe,EACf,oCAAoC,EACpC,8BAA8B,EAE9B,kCAAkC,GACnC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,SAAS,GAEV,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAO5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AAC3F,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAEL,iCAAiC,GAClC,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,sCAAsC,EAAE,MAAM,oCAAoC,CAAC;AAC5F,OAAO,EAEL,oCAAoC,GACrC,MAAM,2BAA2B,CAAC;AAUnC,MAAM,UAAU,+BAA+B,CAC7C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ACR,aAAa;gBACb,OAAO;gBACP,OAAO;aACR,CAAC;YACF,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,uDAAuD,CAAC;YAC1E,mBAAmB,CAAC;gBAClB,OAAO;gBACP,OAAO;gBACP,MAAM;gBACN,IAAI,EAAE,SAAS;gBACf,SAAS;gBACT,SAAS;gBACT,gBAAgB,EAAE,CAChB,OAAgB,EAChB,CAAE,UAAU,CAAkB,EAC9B,EAAE;oBACF,oBAAoB,CAClB,UAAU,EACV,OAAQ,QAAQ,CAAC,IAAI,CAAE,kBAAkB,EACzC;wBACE;4BACE,eAAe,EAAE,KAAM,IAAK,cAAe,IAAK,qBAAqB;4BACrE,YAAY,EAAE,CAAE,OAAQ,QAAQ,CAAC,IAAI,CAAE,kBAAkB,CAAE;yBAC5D;qBACF,CACF,CAAC;gBACJ,CAAC;aACF,CAAC;YACF,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,8BAA8B,CAAC;YAClD,gBAAgB,CAAC,gBAAgB,EAAE;gBACjC,GAAG,WAAW,IAAI,EAAE;gBACpB,OAAO;gBACP,IAAI,EAAE,IAAI;gBACV,OAAO;gBACP,SAAS;gBACT,MAAM;gBACN,MAAM,EAAE,IAAI;gBACZ,IAAI,EAAE,IAAI;gBACV,UAAU;gBACV,cAAc;gBACd,SAAS;gBACT,OAAO;gBACP,OAAO;aACR,CAAC;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"}
@@ -1,29 +1,28 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NormalizeNavigationTableActionOptions = void 0;
4
- const schematics_1 = require("@angular-devkit/schematics");
5
- const schematics_ts_morph_1 = require("@rxap/schematics-ts-morph");
6
- const path_1 = require("path");
7
- const angular_options_1 = require("../../../../lib/angular-options");
8
- const assert_table_component_exists_1 = require("../../../../lib/assert-table-component-exists");
9
- const operation_table_action_1 = require("../operation-table-action");
10
- function NormalizeNavigationTableActionOptions(options) {
11
- var _a;
12
- return Object.assign(Object.assign({}, (0, operation_table_action_1.NormalizeOperationTableActionOptions)(options)), { route: (_a = options.route) !== null && _a !== void 0 ? _a : null });
1
+ import { chain, } from '@angular-devkit/schematics';
2
+ import { CoerceNavigationTableActionRule } from '@rxap/schematics-ts-morph';
3
+ import { join } from 'path';
4
+ import { PrintAngularOptions } from '../../../../lib/angular-options';
5
+ import { AssertTableComponentExists } from '../../../../lib/assert-table-component-exists';
6
+ import { NormalizeOperationTableActionOptions, } from '../operation-table-action';
7
+ export function NormalizeNavigationTableActionOptions(options) {
8
+ return {
9
+ ...NormalizeOperationTableActionOptions(options),
10
+ route: options.route ?? null,
11
+ };
13
12
  }
14
- exports.NormalizeNavigationTableActionOptions = NormalizeNavigationTableActionOptions;
15
13
  function printOptions(options) {
16
- (0, angular_options_1.PrintAngularOptions)('navigation-table-action', options);
14
+ PrintAngularOptions('navigation-table-action', options);
17
15
  }
18
- function default_1(options) {
16
+ export default function (options) {
19
17
  const normalizedOptions = NormalizeNavigationTableActionOptions(options);
20
18
  const { refresh, confirm, tooltip, errorMessage, successMessage, priority, checkFunction, tableName, project, feature, shared, directory, type, route, } = normalizedOptions;
21
19
  printOptions(normalizedOptions);
22
20
  return (host) => {
23
- (0, assert_table_component_exists_1.AssertTableComponentExists)(host, normalizedOptions);
24
- return (0, schematics_1.chain)([
25
- (0, schematics_ts_morph_1.CoerceNavigationTableActionRule)({
26
- directory: (0, path_1.join)(directory !== null && directory !== void 0 ? directory : '', 'methods', 'action'),
21
+ AssertTableComponentExists(host, normalizedOptions);
22
+ return chain([
23
+ () => console.group('\x1b[32m[@rxap/schematics-angular:navigation-table-action]\x1b[0m'),
24
+ CoerceNavigationTableActionRule({
25
+ directory: join(directory ?? '', 'methods', 'action'),
27
26
  type,
28
27
  tableName,
29
28
  refresh,
@@ -37,8 +36,8 @@ function default_1(options) {
37
36
  feature,
38
37
  route,
39
38
  }),
39
+ () => console.groupEnd(),
40
40
  ]);
41
41
  };
42
42
  }
43
- exports.default = default_1;
44
43
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/schematic/angular/src/schematics/table/action/navigation-table-action/index.ts"],"names":[],"mappings":";;;AAAA,2DAGoC;AACpC,mEAA4E;AAE5E,+BAA4B;AAC5B,qEAAsE;AACtE,iGAA2F;AAC3F,sEAGmC;AAMnC,SAAgB,qCAAqC,CACnD,OAAqC;;IAErC,uCACK,IAAA,6DAAoC,EAAC,OAAO,CAAC,KAChD,KAAK,EAAE,MAAA,OAAO,CAAC,KAAK,mCAAI,IAAI,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,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;AAzCD,4BAyCC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/schematic/angular/src/schematics/table/action/navigation-table-action/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,GAEN,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,+BAA+B,EAAE,MAAM,2BAA2B,CAAC;AAE5E,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AAC3F,OAAO,EAEL,oCAAoC,GACrC,MAAM,2BAA2B,CAAC;AAMnC,MAAM,UAAU,qCAAqC,CACnD,OAAqC;IAErC,OAAO;QACL,GAAG,oCAAoC,CAAC,OAAO,CAAC;QAChD,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,IAAI;KAC7B,CAAC;AACJ,CAAC;AAED,SAAS,YAAY,CAAC,OAA+C;IACnE,mBAAmB,CAAC,yBAAyB,EAAE,OAAO,CAAC,CAAC;AAC1D,CAAC;AAED,MAAM,CAAC,OAAO,WAAW,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,0BAA0B,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;QAEpD,OAAO,KAAK,CAAC;YACX,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,mEAAmE,CAAC;YACxF,+BAA+B,CAAC;gBAC9B,SAAS,EAAE,IAAI,CAAC,SAAS,IAAI,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"}
@@ -1,33 +1,33 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NormalizeOperationTableActionOptions = void 0;
4
- const schematics_1 = require("@angular-devkit/schematics");
5
- const schematics_ts_morph_1 = require("@rxap/schematics-ts-morph");
6
- const utilities_1 = require("@rxap/utilities");
7
- const path_1 = require("path");
8
- const angular_options_1 = require("../../../../lib/angular-options");
9
- const assert_table_component_exists_1 = require("../../../../lib/assert-table-component-exists");
10
- const backend_types_1 = require("../../../../lib/backend-types");
11
- const table_action_1 = require("../../table-action");
12
- function NormalizeOperationTableActionOptions(options) {
13
- var _a;
14
- const normalizedOptions = (0, table_action_1.NormalizeTableActionOptions)(options);
15
- const nestModule = (_a = options.nestModule) !== null && _a !== void 0 ? _a : normalizedOptions.tableName;
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)({
1
+ import { chain, noop, } from '@angular-devkit/schematics';
2
+ import { BuildNestControllerName, buildOperationId, CoerceOperation, CoerceOperationTableActionRule, } from '@rxap/schematics-ts-morph';
3
+ import { dasherize, } from '@rxap/utilities';
4
+ import { join } from 'path';
5
+ import { PrintAngularOptions, } from '../../../../lib/angular-options';
6
+ import { AssertTableComponentExists } from '../../../../lib/assert-table-component-exists';
7
+ import { BackendTypes } from '../../../../lib/backend-types';
8
+ import { NormalizeTableActionOptions } from '../../table-action';
9
+ export function NormalizeOperationTableActionOptions(options) {
10
+ const normalizedOptions = NormalizeTableActionOptions(options);
11
+ const nestModule = options.nestModule ?? normalizedOptions.tableName;
12
+ const context = options.context ? dasherize(options.context) : null;
13
+ return Object.seal({
14
+ ...normalizedOptions,
15
+ nestModule,
16
+ controllerName: BuildNestControllerName({
18
17
  controllerName: context,
19
18
  nestModule,
20
- }), context }));
19
+ }),
20
+ context,
21
+ });
21
22
  }
22
- exports.NormalizeOperationTableActionOptions = NormalizeOperationTableActionOptions;
23
23
  function openApiOperationRule(normalizedOptions) {
24
24
  const { refresh, confirm, tooltip, errorMessage, successMessage, priority, checkFunction, tableName, project, feature, shared, directory, nestModule, controllerName, type, scope, } = normalizedOptions;
25
- return (0, schematics_1.chain)([
25
+ return chain([
26
26
  () => console.log('Coerce table action method class ...'),
27
- (0, schematics_ts_morph_1.CoerceOperationTableActionRule)({
27
+ CoerceOperationTableActionRule({
28
28
  scope,
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`, controllerName),
29
+ directory: join(directory ?? '', 'methods', 'action'),
30
+ operationId: buildOperationId(normalizedOptions, `${type}-action`, controllerName),
31
31
  type,
32
32
  tableName,
33
33
  refresh,
@@ -41,7 +41,7 @@ function openApiOperationRule(normalizedOptions) {
41
41
  feature,
42
42
  }),
43
43
  () => console.log('Coerce table action method operation ...'),
44
- (0, schematics_ts_morph_1.CoerceOperation)({
44
+ CoerceOperation({
45
45
  controllerName,
46
46
  nestModule,
47
47
  project,
@@ -62,23 +62,24 @@ function openApiOperationRule(normalizedOptions) {
62
62
  function backendRule(normalizedOptions) {
63
63
  const { backend, } = normalizedOptions;
64
64
  switch (backend) {
65
- case backend_types_1.BackendTypes.NESTJS:
65
+ case BackendTypes.NESTJS:
66
66
  return openApiOperationRule(normalizedOptions);
67
67
  }
68
- return (0, schematics_1.noop)();
68
+ return noop();
69
69
  }
70
70
  function printOptions(options) {
71
- (0, angular_options_1.PrintAngularOptions)('operation-table-action', options);
71
+ PrintAngularOptions('operation-table-action', options);
72
72
  }
73
- function default_1(options) {
73
+ export default function (options) {
74
74
  const normalizedOptions = NormalizeOperationTableActionOptions(options);
75
75
  printOptions(normalizedOptions);
76
76
  return (host) => {
77
- (0, assert_table_component_exists_1.AssertTableComponentExists)(host, normalizedOptions);
78
- return (0, schematics_1.chain)([
77
+ AssertTableComponentExists(host, normalizedOptions);
78
+ return chain([
79
+ () => console.group('\x1b[32m[@rxap/schematics-angular:operation-table-action]\x1b[0m'),
79
80
  backendRule(normalizedOptions),
81
+ () => console.groupEnd(),
80
82
  ]);
81
83
  };
82
84
  }
83
- exports.default = default_1;
84
85
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/schematic/angular/src/schematics/table/action/operation-table-action/index.ts"],"names":[],"mappings":";;;AAAA,2DAIoC;AACpC,mEAKmC;AACnC,+CAGyB;AACzB,+BAA4B;AAC5B,qEAGyC;AACzC,iGAA2F;AAC3F,iEAA6D;AAC7D,qDAAiE;AAQjE,SAAgB,oCAAoC,CAClD,OAAoC;;IAEpC,MAAM,iBAAiB,GAAG,IAAA,0CAA2B,EAAC,OAAO,CAAC,CAAC;IAC/D,MAAM,UAAU,GAAG,MAAA,OAAO,CAAC,UAAU,mCAAI,iBAAiB,CAAC,SAAS,CAAC;IACrE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,IAAA,qBAAS,EAA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oBACb,IAAI,EAAE,iBAAkB,IAAK,EAAE;oBAC/B,SAAS,EAAE,CAAE,EAAE,IAAI,EAAE,OAAO,EAAE,CAAE;iBACjC,CAAC;YACJ,CAAC;SACF,CAAC;KACH,CAAC,CAAC;AAEL,CAAC;AAED,SAAS,WAAW,CAAC,iBAAwD;IAE3E,MAAM,EACJ,OAAO,GACR,GAAG,iBAAiB,CAAC;IAEtB,QAAQ,OAAO,EAAE;QAEf,KAAK,4BAAY,CAAC,MAAM;YACtB,OAAO,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;KAElD;IAED,OAAO,IAAA,iBAAI,GAAE,CAAC;AAEhB,CAAC;AAED,SAAS,YAAY,CAAC,OAA8C;IAClE,IAAA,qCAAmB,EAAC,wBAAwB,EAAE,OAAO,CAAC,CAAC;AACzD,CAAC;AAED,mBAAyB,OAAoC;IAC3D,MAAM,iBAAiB,GAAG,oCAAoC,CAAC,OAAO,CAAC,CAAC;IAExE,YAAY,CAAC,iBAAiB,CAAC,CAAC;IAEhC,OAAO,CAAC,IAAU,EAAE,EAAE;QAEpB,IAAA,0DAA0B,EAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;QAEpD,OAAO,IAAA,kBAAK,EAAC;YACX,WAAW,CAAC,iBAAiB,CAAC;SAC/B,CAAC,CAAC;IAEL,CAAC,CAAC;AACJ,CAAC;AAdD,4BAcC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/schematic/angular/src/schematics/table/action/operation-table-action/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,IAAI,GAEL,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,uBAAuB,EACvB,gBAAgB,EAChB,eAAe,EACf,8BAA8B,GAC/B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,SAAS,GAEV,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAEL,mBAAmB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E,CAAC,OAAO,CAAC,QAAQ,EAAE;SACzB,CAAC,CAAC;IAEL,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,11 @@
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 { FormTableHeaderButtonOptions } from './schema';
6
+ export interface NormalizedFormTableHeaderButtonOptions extends Readonly<Normalized<FormTableHeaderButtonOptions> & NormalizedAngularOptions & NormalizedTableHeaderButton> {
7
+ options: Record<string, any>;
8
+ controllerName: string;
9
+ }
10
+ export declare function NormalizeFormTableHeaderButtonOptions(options: Readonly<FormTableHeaderButtonOptions>): NormalizedFormTableHeaderButtonOptions;
11
+ export default function (options: FormTableHeaderButtonOptions): (host: Tree) => import("@angular-devkit/schematics").Rule;
@@ -0,0 +1,90 @@
1
+ import { chain, } from '@angular-devkit/schematics';
2
+ import { AddComponentProvider, BuildNestControllerName, CoerceClassConstructor, CoerceImports, CoerceParameterDeclaration, CoerceTableHeaderButtonMethodRule, } from '@rxap/schematics-ts-morph';
3
+ import { ExecuteSchematic } from '@rxap/schematics-utilities';
4
+ import { Scope, } from 'ts-morph';
5
+ import { PrintAngularOptions, } from '../../../../lib/angular-options';
6
+ import { AssertTableComponentExists } from '../../../../lib/assert-table-component-exists';
7
+ import { NormalizeTableHeaderButtonOptions } from '../../table-header-button/index';
8
+ export function NormalizeFormTableHeaderButtonOptions(options) {
9
+ const normalizedTableHeaderButtonOptions = NormalizeTableHeaderButtonOptions(options);
10
+ const nestModule = options.nestModule;
11
+ return Object.seal({
12
+ ...normalizedTableHeaderButtonOptions,
13
+ context: options.context,
14
+ nestModule,
15
+ controllerName: BuildNestControllerName({
16
+ nestModule,
17
+ controllerName: 'header-button',
18
+ }),
19
+ });
20
+ }
21
+ function printOptions(options) {
22
+ PrintAngularOptions('form-table-header-button', options);
23
+ }
24
+ export default function (options) {
25
+ const normalizedOptions = NormalizeFormTableHeaderButtonOptions(options);
26
+ const { refresh, confirm, tooltip, errorMessage, successMessage, tableName, project, feature, shared, directory, overwrite, options: formOptions, context, backend, nestModule, controllerName, } = normalizedOptions;
27
+ printOptions(normalizedOptions);
28
+ return (host) => {
29
+ AssertTableComponentExists(host, normalizedOptions);
30
+ return chain([
31
+ () => console.group('\x1b[32m[@rxap/schematics-angular:form-table-header-button]\x1b[0m'),
32
+ () => console.log('Coerce table header button form ...'),
33
+ ExecuteSchematic('form-component', {
34
+ ...formOptions,
35
+ project,
36
+ name: `table-header-button`,
37
+ feature,
38
+ directory,
39
+ shared,
40
+ window: true,
41
+ nestModule,
42
+ controllerName,
43
+ context,
44
+ backend,
45
+ overwrite,
46
+ }),
47
+ () => console.log('Coerce table header button method ...'),
48
+ CoerceTableHeaderButtonMethodRule({
49
+ project,
50
+ feature,
51
+ shared,
52
+ directory,
53
+ overwrite,
54
+ tableName,
55
+ refresh,
56
+ confirm,
57
+ tooltip,
58
+ errorMessage,
59
+ successMessage,
60
+ tsMorphTransform: (project, sourceFile, classDeclaration) => {
61
+ const [constructorDeclaration] = CoerceClassConstructor(classDeclaration);
62
+ CoerceParameterDeclaration(constructorDeclaration, 'openWindowMethod', {
63
+ isReadonly: true,
64
+ scope: Scope.Private,
65
+ type: 'OpenTableHeaderButtonFormWindowMethod',
66
+ });
67
+ CoerceImports(sourceFile, [
68
+ {
69
+ moduleSpecifier: '../table-header-button-form/open-table-header-button-form-window.method',
70
+ namedImports: ['OpenTableHeaderButtonFormWindowMethod'],
71
+ },
72
+ ]);
73
+ return {
74
+ statements: ['return this.openWindowMethod.call(parameters).toPromise();'],
75
+ };
76
+ },
77
+ tsMorphTransformComponent: (project, [sourceFile]) => {
78
+ AddComponentProvider(sourceFile, 'OpenTableHeaderButtonFormWindowMethod', [
79
+ {
80
+ moduleSpecifier: './table-header-button-form/open-table-header-button-form-window.method',
81
+ namedImports: ['OpenTableHeaderButtonFormWindowMethod'],
82
+ },
83
+ ]);
84
+ },
85
+ }),
86
+ () => console.groupEnd(),
87
+ ]);
88
+ };
89
+ }
90
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/schematic/angular/src/schematics/table/header-button/form-table-header-button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,GAEN,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,sBAAsB,EACtB,aAAa,EACb,0BAA0B,EAC1B,iCAAiC,GAClC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9D,OAAO,EAEL,KAAK,GAEN,MAAM,UAAU,CAAC;AAClB,OAAO,EAEL,mBAAmB,GACpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AAE3F,OAAO,EAAE,iCAAiC,EAAE,MAAM,iCAAiC,CAAC;AASpF,MAAM,UAAU,qCAAqC,CACnD,OAA+C;IAE/C,MAAM,kCAAkC,GAAG,iCAAiC,CAAC,OAAO,CAAC,CAAC;IACtF,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IACtC,OAAO,MAAM,CAAC,IAAI,CAAC;QACjB,GAAG,kCAAkC;QACrC,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,UAAU;QACV,cAAc,EAAE,uBAAuB,CAAC;YACtC,UAAU;YACV,cAAc,EAAE,eAAe;SAChC,CAAC;KACH,CAAC,CAAC;AACL,CAAC;AAED,SAAS,YAAY,CAAC,OAA+C;IACnE,mBAAmB,CAAC,0BAA0B,EAAE,OAAO,CAAC,CAAC;AAC3D,CAAC;AAED,MAAM,CAAC,OAAO,WAAW,OAAqC;IAC5D,MAAM,iBAAiB,GAAG,qCAAqC,CAAC,OAAO,CAAC,CAAC;IACzE,MAAM,EACJ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,CAAC,CAAC;oBACH,aAAa,CAAC,UAAU,EAAE;wBACxB;4BACE,eAAe,EAAE,yEAAyE;4BAC1F,YAAY,EAAE,CAAE,uCAAuC,CAAE;yBAC1D;qBACF,CAAC,CAAC;oBACH,OAAO;wBACL,UAAU,EAAE,CAAE,4DAA4D,CAAE;qBAC7E,CAAC;gBACJ,CAAC;gBACD,yBAAyB,EAAE,CACzB,OAAgB,EAChB,CAAE,UAAU,CAAkB,EAC9B,EAAE;oBACF,oBAAoB,CAClB,UAAU,EACV,uCAAuC,EACvC;wBACE;4BACE,eAAe,EAAE,wEAAwE;4BACzF,YAAY,EAAE,CAAE,uCAAuC,CAAE;yBAC1D;qBACF,CACF,CAAC;gBACJ,CAAC;aACF,CAAC;YACF,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE;SACzB,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { TableHeaderButtonOptions } from '../../table-header-button/schema';
2
+
3
+
4
+ export interface FormTableHeaderButtonOptions extends TableHeaderButtonOptions {
5
+ nestModule: string;
6
+ context: string;
7
+ }