@rxap/schematic-angular 16.1.0-dev.9 → 16.1.1-dev.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. package/CHANGELOG.md +358 -0
  2. package/README.md +1 -1
  3. package/collection.json +5 -0
  4. package/package.json +48 -41
  5. package/src/lib/accordion-item.d.ts +2 -2
  6. package/src/lib/accordion-item.js +4 -4
  7. package/src/lib/accordion-item.js.map +1 -1
  8. package/src/lib/adapter-options.d.ts +11 -5
  9. package/src/lib/adapter-options.js +8 -5
  10. package/src/lib/adapter-options.js.map +1 -1
  11. package/src/lib/angular-options.js +1 -1
  12. package/src/lib/angular-options.js.map +1 -1
  13. package/src/lib/data-grid-item.d.ts +1 -1
  14. package/src/lib/data-grid-item.js +2 -2
  15. package/src/lib/data-grid-item.js.map +1 -1
  16. package/src/lib/data-grid-options.d.ts +3 -3
  17. package/src/lib/data-grid-options.js +1 -1
  18. package/src/lib/data-grid-options.js.map +1 -1
  19. package/src/lib/dialog-action.d.ts +1 -1
  20. package/src/lib/dialog-action.js +2 -2
  21. package/src/lib/dialog-action.js.map +1 -1
  22. package/src/lib/existing-method.d.ts +11 -2
  23. package/src/lib/existing-method.js +8 -2
  24. package/src/lib/existing-method.js.map +1 -1
  25. package/src/lib/form-component-control.d.ts +1 -1
  26. package/src/lib/form-component-control.js +2 -2
  27. package/src/lib/form-component-control.js.map +1 -1
  28. package/src/lib/form-definition-control.d.ts +1 -1
  29. package/src/lib/form-definition-control.js +6 -4
  30. package/src/lib/form-definition-control.js.map +1 -1
  31. package/src/lib/minimum-table-component-options.d.ts +6 -4
  32. package/src/lib/minimum-table-component-options.js +87 -29
  33. package/src/lib/minimum-table-component-options.js.map +1 -1
  34. package/src/lib/minimum-table-options.d.ts +10 -7
  35. package/src/lib/minimum-table-options.js +9 -6
  36. package/src/lib/minimum-table-options.js.map +1 -1
  37. package/src/lib/table-action.d.ts +1 -1
  38. package/src/lib/table-action.js +11 -5
  39. package/src/lib/table-action.js.map +1 -1
  40. package/src/lib/table-column.d.ts +16 -4
  41. package/src/lib/table-column.js +93 -6
  42. package/src/lib/table-column.js.map +1 -1
  43. package/src/lib/table-header-button.d.ts +4 -6
  44. package/src/lib/table-header-button.js +2 -1
  45. package/src/lib/table-header-button.js.map +1 -1
  46. package/src/lib/table-open-api-options.d.ts +3 -2
  47. package/src/lib/table-open-api-options.js +1 -1
  48. package/src/lib/table-open-api-options.js.map +1 -1
  49. package/src/lib/table-options.d.ts +9 -5
  50. package/src/lib/table-options.js +1 -1
  51. package/src/lib/table-options.js.map +1 -1
  52. package/src/lib/table-property.d.ts +14 -0
  53. package/src/lib/table-property.js +46 -0
  54. package/src/lib/table-property.js.map +1 -0
  55. package/src/lib/table-row-action.d.ts +5 -1
  56. package/src/lib/table-row-action.js +9 -7
  57. package/src/lib/table-row-action.js.map +1 -1
  58. package/src/lib/tree-table-options.d.ts +10 -6
  59. package/src/lib/tree-table-options.js +3 -3
  60. package/src/lib/tree-table-options.js.map +1 -1
  61. package/src/lib/type-import.d.ts +4 -0
  62. package/src/lib/type-import.js +38 -0
  63. package/src/lib/type-import.js.map +1 -0
  64. package/src/schematics/accordion/accordion-component/files/component/__componentName__.component.ts.template +5 -5
  65. package/src/schematics/accordion/accordion-component/index.d.ts +3 -1
  66. package/src/schematics/accordion/accordion-component/index.js +15 -8
  67. package/src/schematics/accordion/accordion-component/index.js.map +1 -1
  68. package/src/schematics/accordion/accordion-component/schema.json +13 -3
  69. package/src/schematics/accordion/accordion-item-component/files/component/__componentName__.component.html.template +2 -2
  70. package/src/schematics/accordion/accordion-item-component/files/component/__componentName__.component.ts.template +0 -2
  71. package/src/schematics/accordion/accordion-item-component/index.js +3 -3
  72. package/src/schematics/accordion/accordion-item-component/index.js.map +1 -1
  73. package/src/schematics/accordion/accordion-item-component/schema.json +13 -3
  74. package/src/schematics/accordion/item/accordion-item-data-grid-component/index.d.ts +3 -3
  75. package/src/schematics/accordion/item/accordion-item-data-grid-component/index.js +9 -7
  76. package/src/schematics/accordion/item/accordion-item-data-grid-component/index.js.map +1 -1
  77. package/src/schematics/accordion/item/accordion-item-data-grid-component/schema.json +13 -3
  78. package/src/schematics/accordion/item/accordion-item-table-component/index.d.ts +7 -4
  79. package/src/schematics/accordion/item/accordion-item-table-component/index.js +5 -5
  80. package/src/schematics/accordion/item/accordion-item-table-component/index.js.map +1 -1
  81. package/src/schematics/accordion/item/accordion-item-table-component/schema.json +57 -8
  82. package/src/schematics/accordion/item/accordion-item-tree-table-component/files/component/__componentName__.component.html.template +1 -1
  83. package/src/schematics/accordion/item/accordion-item-tree-table-component/files/component/__componentName__.component.ts.template +3 -3
  84. package/src/schematics/accordion/item/accordion-item-tree-table-component/index.d.ts +4 -1
  85. package/src/schematics/accordion/item/accordion-item-tree-table-component/index.js +1 -1
  86. package/src/schematics/accordion/item/accordion-item-tree-table-component/index.js.map +1 -1
  87. package/src/schematics/accordion/item/accordion-item-tree-table-component/schema.json +62 -9
  88. package/src/schematics/angular.schema.json +61 -0
  89. package/src/schematics/data-grid-component/files/form/__componentName__.component.html.template +1 -1
  90. package/src/schematics/data-grid-component/index.d.ts +1 -1
  91. package/src/schematics/data-grid-component/index.js +8 -7
  92. package/src/schematics/data-grid-component/index.js.map +1 -1
  93. package/src/schematics/data-grid-component/schema.json +13 -3
  94. package/src/schematics/dialog-component/files/component/__componentName__.component.html.template +1 -1
  95. package/src/schematics/dialog-component/index.js +3 -3
  96. package/src/schematics/dialog-component/index.js.map +1 -1
  97. package/src/schematics/dialog-component/schema.json +13 -3
  98. package/src/schematics/form/control/input-form-control/index.js +1 -1
  99. package/src/schematics/form/control/input-form-control/index.js.map +1 -1
  100. package/src/schematics/form/control/select-form-control/index.js +1 -1
  101. package/src/schematics/form/control/select-form-control/index.js.map +1 -1
  102. package/src/schematics/form/control/table-select-form-control/index.d.ts +2 -2
  103. package/src/schematics/form/control/table-select-form-control/index.js +3 -3
  104. package/src/schematics/form/control/table-select-form-control/index.js.map +1 -1
  105. package/src/schematics/form/form-component/files/component/__componentName__.component.ts.template +0 -2
  106. package/src/schematics/form/form-component/index.d.ts +1 -1
  107. package/src/schematics/form/form-component/index.js +1 -1
  108. package/src/schematics/form/form-component/index.js.map +1 -1
  109. package/src/schematics/form/form-control/index.js +1 -1
  110. package/src/schematics/form/form-control/index.js.map +1 -1
  111. package/src/schematics/form/form-definition/index.d.ts +2 -2
  112. package/src/schematics/form/form-definition/index.js +16 -9
  113. package/src/schematics/form/form-definition/index.js.map +1 -1
  114. package/src/schematics/form/form-definition/schema.d.ts +2 -1
  115. package/src/schematics/form/form-definition/schema.json +5 -0
  116. package/src/schematics/general.schema.json +41 -0
  117. package/src/schematics/table/action/dialog-table-action/index.d.ts +3 -1
  118. package/src/schematics/table/action/dialog-table-action/index.js +1 -1
  119. package/src/schematics/table/action/dialog-table-action/index.js.map +1 -1
  120. package/src/schematics/table/action/dialog-table-action/schema.json +12 -2
  121. package/src/schematics/table/action/form-table-action/index.d.ts +6 -3
  122. package/src/schematics/table/action/form-table-action/index.js +46 -18
  123. package/src/schematics/table/action/form-table-action/index.js.map +1 -1
  124. package/src/schematics/table/action/form-table-action/schema.d.ts +13 -1
  125. package/src/schematics/table/action/form-table-action/schema.json +71 -3
  126. package/src/schematics/table/action/navigation-table-action/index.js +4 -3
  127. package/src/schematics/table/action/navigation-table-action/index.js.map +1 -1
  128. package/src/schematics/table/action/navigation-table-action/schema.d.ts +1 -0
  129. package/src/schematics/table/action/navigation-table-action/schema.json +5 -0
  130. package/src/schematics/table/action/open-api-table-action/index.d.ts +10 -0
  131. package/src/schematics/table/action/open-api-table-action/index.js +50 -0
  132. package/src/schematics/table/action/open-api-table-action/index.js.map +1 -0
  133. package/src/schematics/table/action/open-api-table-action/schema.d.ts +9 -0
  134. package/src/schematics/table/action/open-api-table-action/schema.json +121 -0
  135. package/src/schematics/table/action/operation-table-action/index.js +1 -1
  136. package/src/schematics/table/action/operation-table-action/index.js.map +1 -1
  137. package/src/schematics/table/header-button/form-table-header-button/index.d.ts +10 -3
  138. package/src/schematics/table/header-button/form-table-header-button/index.js +57 -48
  139. package/src/schematics/table/header-button/form-table-header-button/index.js.map +1 -1
  140. package/src/schematics/table/header-button/form-table-header-button/schema.d.ts +8 -0
  141. package/src/schematics/table/header-button/form-table-header-button/schema.json +17 -1
  142. package/src/schematics/table/header-button/navigation-table-header-button/index.js +30 -8
  143. package/src/schematics/table/header-button/navigation-table-header-button/index.js.map +1 -1
  144. package/src/schematics/table/header-button/navigation-table-header-button/schema.d.ts +1 -0
  145. package/src/schematics/table/header-button/navigation-table-header-button/schema.json +8 -6
  146. package/src/schematics/table/table-action/index.js +1 -1
  147. package/src/schematics/table/table-action/index.js.map +1 -1
  148. package/src/schematics/table/table-action/schema.json +8 -0
  149. package/src/schematics/table/table-component/files/component/__componentName__.component.html.template +31 -40
  150. package/src/schematics/table/table-component/files/component/__componentName__.component.ts.template +17 -5
  151. package/src/schematics/table/table-component/index.d.ts +6 -8
  152. package/src/schematics/table/table-component/index.js +41 -28
  153. package/src/schematics/table/table-component/index.js.map +1 -1
  154. package/src/schematics/table/table-component/schema.json +297 -218
  155. package/src/schematics/table/table-header-button/index.d.ts +2 -4
  156. package/src/schematics/table/table-header-button/index.js +1 -1
  157. package/src/schematics/table/table-header-button/index.js.map +1 -1
  158. package/src/schematics/table/table-header-button/schema.d.ts +2 -1
  159. package/src/schematics/table/tree-table-component/files/component/__componentName__.component.html.template +94 -82
  160. package/src/schematics/table/tree-table-component/files/component/__componentName__.component.ts.template +17 -6
  161. package/src/schematics/table/tree-table-component/index.d.ts +1 -1
  162. package/src/schematics/table/tree-table-component/index.js +20 -25
  163. package/src/schematics/table/tree-table-component/index.js.map +1 -1
  164. package/src/schematics/table/tree-table-component/schema.json +90 -7
  165. package/src/schematics/tree-component/index.d.ts +2 -2
  166. package/src/schematics/tree-component/index.js +2 -2
  167. package/src/schematics/tree-component/index.js.map +1 -1
  168. package/src/schematics/tree-component/schema.json +11 -1
@@ -78,17 +78,85 @@
78
78
  "description": "The module name for the table nest operations"
79
79
  },
80
80
  "overwrite": {
81
- "type": "boolean",
82
- "description": "Whether to override the table action if it already exists",
81
+ "anyOf": [
82
+ {
83
+ "type": "boolean"
84
+ },
85
+ {
86
+ "type": "array",
87
+ "items": {
88
+ "type": "string"
89
+ }
90
+ }
91
+ ],
92
+ "description": "Overwrite existing files",
83
93
  "default": false
84
94
  },
85
95
  "context": {
86
96
  "type": "string",
87
97
  "description": "The context use to generate proper names for class, files, etc"
88
98
  },
89
- "options": {
99
+ "formInitial": {
100
+ "type": "object",
101
+ "description": "The mapping from the row object to the form initial object"
102
+ },
103
+ "formComponent": {
104
+ "type": "string"
105
+ },
106
+ "customComponent": {
107
+ "type": "boolean",
108
+ "default": false,
109
+ "description": "If true the schematic will not coerce the form component"
110
+ },
111
+ "loadFrom": {
112
+ "type": "object",
113
+ "properties": {
114
+ "operationId": {
115
+ "type": "string"
116
+ },
117
+ "scope": {
118
+ "type": "string",
119
+ "description": "The scope of package for the openapi classes"
120
+ },
121
+ "body": {
122
+ "oneOf": [
123
+ {
124
+ "type": "boolean",
125
+ "description": "Pass the full row as body for the operation request"
126
+ },
127
+ {
128
+ "type": "object",
129
+ "description": "Mapping of table columns to body properties - [request property]: [table column]",
130
+ "additionalProperties": true
131
+ }
132
+ ]
133
+ },
134
+ "parameters": {
135
+ "oneOf": [
136
+ {
137
+ "type": "boolean",
138
+ "description": "Pass the full row as parameters for the operation request"
139
+ },
140
+ {
141
+ "type": "object",
142
+ "description": "Mapping of table columns to parameters properties - [request property]: [table column]",
143
+ "additionalProperties": true
144
+ }
145
+ ]
146
+ }
147
+ }
148
+ },
149
+ "formOptions": {
90
150
  "type": "object",
91
151
  "properties": {
152
+ "role": {
153
+ "type": "string",
154
+ "description": "Define the role of the form"
155
+ },
156
+ "window": {
157
+ "type": "boolean",
158
+ "description": "Whether the form can be opened in a window"
159
+ },
92
160
  "controlList": {
93
161
  "alias": "control",
94
162
  "type": "array",
@@ -8,8 +8,8 @@ const angular_options_1 = require("../../../../lib/angular-options");
8
8
  const assert_table_component_exists_1 = require("../../../../lib/assert-table-component-exists");
9
9
  const operation_table_action_1 = require("../operation-table-action");
10
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 });
11
+ var _a, _b;
12
+ return Object.assign(Object.assign({}, (0, operation_table_action_1.NormalizeOperationTableActionOptions)(options)), { route: (_a = options.route) !== null && _a !== void 0 ? _a : null, relativeTo: (_b = options.relativeTo) !== null && _b !== void 0 ? _b : false });
13
13
  }
14
14
  exports.NormalizeNavigationTableActionOptions = NormalizeNavigationTableActionOptions;
15
15
  function printOptions(options) {
@@ -17,7 +17,7 @@ function printOptions(options) {
17
17
  }
18
18
  function default_1(options) {
19
19
  const normalizedOptions = NormalizeNavigationTableActionOptions(options);
20
- const { refresh, confirm, tooltip, errorMessage, successMessage, priority, checkFunction, tableName, project, feature, shared, directory, type, route, } = normalizedOptions;
20
+ const { refresh, confirm, tooltip, errorMessage, successMessage, priority, checkFunction, tableName, project, feature, shared, directory, type, route, relativeTo, } = normalizedOptions;
21
21
  printOptions(normalizedOptions);
22
22
  return (host) => {
23
23
  (0, assert_table_component_exists_1.AssertTableComponentExists)(host, normalizedOptions);
@@ -37,6 +37,7 @@ function default_1(options) {
37
37
  project,
38
38
  feature,
39
39
  route,
40
+ relativeTo,
40
41
  }),
41
42
  () => console.groupEnd(),
42
43
  ]);
@@ -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,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"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/schematic/angular/src/schematics/table/action/navigation-table-action/index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,KAAK;gBACL,UAAU;aACX,CAAC;YACF,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE;SACzB,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AA7CD,4BA6CC"}
@@ -2,4 +2,5 @@ import { OperationTableActionOptions } from '../operation-table-action/schema';
2
2
 
3
3
  export interface NavigationTableActionOptions extends OperationTableActionOptions {
4
4
  route?: string;
5
+ relativeTo: boolean;
5
6
  }
@@ -77,6 +77,11 @@
77
77
  "type": "string",
78
78
  "description": "The route for the table action"
79
79
  },
80
+ "relativeTo": {
81
+ "type": "boolean",
82
+ "description": "Use the current ActivatedRoute to resolve the route or not",
83
+ "default": false
84
+ },
80
85
  "options": {
81
86
  "type": "object",
82
87
  "additionalProperties": true
@@ -0,0 +1,10 @@
1
+ import { Tree } from '@angular-devkit/schematics';
2
+ import { Normalized } from '@rxap/utilities';
3
+ import { NormalizedAngularOptions } from '../../../../lib/angular-options';
4
+ import { OpenApiTableActionOptions } from './schema';
5
+ export interface NormalizedOpenApiTableActionOptions extends Readonly<Normalized<OpenApiTableActionOptions> & NormalizedAngularOptions> {
6
+ body: boolean | Record<string, string>;
7
+ parameters: boolean | Record<string, string>;
8
+ }
9
+ export declare function NormalizeOpenApiTableActionOptions(options: Readonly<OpenApiTableActionOptions>): NormalizedOpenApiTableActionOptions;
10
+ export default function (options: OpenApiTableActionOptions): (host: Tree) => import("@angular-devkit/schematics").Rule;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NormalizeOpenApiTableActionOptions = void 0;
4
+ const schematics_1 = require("@angular-devkit/schematics");
5
+ const schematics_ts_morph_1 = require("@rxap/schematics-ts-morph");
6
+ const path_1 = require("path");
7
+ const angular_options_1 = require("../../../../lib/angular-options");
8
+ const assert_table_component_exists_1 = require("../../../../lib/assert-table-component-exists");
9
+ const table_action_1 = require("../../table-action");
10
+ function NormalizeOpenApiTableActionOptions(options) {
11
+ var _a, _b, _c;
12
+ const normalizedOptions = (0, table_action_1.NormalizeTableActionOptions)(options);
13
+ return Object.freeze(Object.assign(Object.assign({}, normalizedOptions), { operationId: options.operationId, body: (_a = options.body) !== null && _a !== void 0 ? _a : false, parameters: (_b = options.parameters) !== null && _b !== void 0 ? _b : false, scope: (_c = options.scope) !== null && _c !== void 0 ? _c : null }));
14
+ }
15
+ exports.NormalizeOpenApiTableActionOptions = NormalizeOpenApiTableActionOptions;
16
+ function printOptions(options) {
17
+ (0, angular_options_1.PrintAngularOptions)('open-api-table-action', options);
18
+ }
19
+ function default_1(options) {
20
+ const normalizedOptions = NormalizeOpenApiTableActionOptions(options);
21
+ const { refresh, confirm, tooltip, errorMessage, successMessage, priority, checkFunction, tableName, project, feature, directory, type, operationId, body, parameters, scope, } = normalizedOptions;
22
+ printOptions(normalizedOptions);
23
+ return (host) => {
24
+ (0, assert_table_component_exists_1.AssertTableComponentExists)(host, normalizedOptions);
25
+ return (0, schematics_1.chain)([
26
+ () => console.group('\x1b[32m[@rxap/schematics-angular:open-api-table-action]\x1b[0m'),
27
+ (0, schematics_ts_morph_1.CoerceOpenApiTableActionRule)({
28
+ directory: (0, path_1.join)(directory !== null && directory !== void 0 ? directory : '', 'methods', 'action'),
29
+ scope,
30
+ operationId,
31
+ body,
32
+ parameters,
33
+ type,
34
+ tableName,
35
+ refresh,
36
+ confirm,
37
+ tooltip,
38
+ errorMessage,
39
+ successMessage,
40
+ priority,
41
+ checkFunction,
42
+ project,
43
+ feature,
44
+ }),
45
+ () => console.groupEnd(),
46
+ ]);
47
+ };
48
+ }
49
+ exports.default = default_1;
50
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/schematic/angular/src/schematics/table/action/open-api-table-action/index.ts"],"names":[],"mappings":";;;AAAA,2DAGoC;AACpC,mEAAyE;AAEzE,+BAA4B;AAC5B,qEAGyC;AACzC,iGAA2F;AAC3F,qDA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AS;gBACT,OAAO;gBACP,OAAO;gBACP,OAAO;gBACP,YAAY;gBACZ,cAAc;gBACd,QAAQ;gBACR,aAAa;gBACb,OAAO;gBACP,OAAO;aACR,CAAC;YACF,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE;SACzB,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAlDD,4BAkDC"}
@@ -0,0 +1,9 @@
1
+ import { TableActionOptions } from '../../table-action/schema';
2
+
3
+
4
+ export interface OpenApiTableActionOptions extends TableActionOptions {
5
+ operationId: string;
6
+ body?: boolean | Record<string, string>;
7
+ parameters?: boolean | Record<string, string>;
8
+ scope?: string;
9
+ }
@@ -0,0 +1,121 @@
1
+ {
2
+ "$schema": "http://json-schema.org/schema",
3
+ "$id": "table-action",
4
+ "type": "object",
5
+ "properties": {
6
+ "tableName": {
7
+ "alias": "table",
8
+ "type": "string",
9
+ "description": "The name of the table action"
10
+ },
11
+ "type": {
12
+ "alias": "actionType",
13
+ "type": "string",
14
+ "description": "The table action type string",
15
+ "x-prompt": "Enter the table action type string?"
16
+ },
17
+ "project": {
18
+ "type": "string",
19
+ "description": "The target project where the table action should be added."
20
+ },
21
+ "feature": {
22
+ "type": "string",
23
+ "description": "The feature name where the table action should be added.",
24
+ "x-prompt": "To which feature should the table action be added?"
25
+ },
26
+ "backend": {
27
+ "type": "string",
28
+ "description": "The backend that should be used to handel data",
29
+ "enum": [
30
+ "none",
31
+ "local",
32
+ "nestjs",
33
+ "open-api"
34
+ ],
35
+ "default": "none"
36
+ },
37
+ "shared": {
38
+ "type": "boolean",
39
+ "description": "Whether the table action is shared across applications",
40
+ "default": false
41
+ },
42
+ "refresh": {
43
+ "type": "boolean",
44
+ "description": "Whether the table action should refresh the table after execution",
45
+ "default": false
46
+ },
47
+ "confirm": {
48
+ "type": "boolean",
49
+ "description": "Whether the table action should confirm before execution",
50
+ "default": false
51
+ },
52
+ "tooltip": {
53
+ "type": "string",
54
+ "description": "The tooltip for the table action"
55
+ },
56
+ "errorMessage": {
57
+ "type": "string",
58
+ "description": "The error message for the table action"
59
+ },
60
+ "successMessage": {
61
+ "type": "string",
62
+ "description": "The success message for the table action"
63
+ },
64
+ "checkFunction": {
65
+ "type": "string",
66
+ "description": "The check function for the table action"
67
+ },
68
+ "priority": {
69
+ "type": "number",
70
+ "description": "The priority of the table action"
71
+ },
72
+ "directory": {
73
+ "type": "string",
74
+ "description": "A directory name or absolute path for the table action. relative to the feature base path"
75
+ },
76
+ "operationId": {
77
+ "type": "string",
78
+ "description": "The open api operationId for the table action"
79
+ },
80
+ "scope": {
81
+ "type": "string",
82
+ "description": "The scope of package for the openapi classes"
83
+ },
84
+ "body": {
85
+ "oneOf": [
86
+ {
87
+ "type": "boolean",
88
+ "description": "Pass the full row as body for the operation request"
89
+ },
90
+ {
91
+ "type": "object",
92
+ "description": "Mapping of table columns to body properties - [request property]: [table column]",
93
+ "additionalProperties": true
94
+ }
95
+ ]
96
+ },
97
+ "parameters": {
98
+ "oneOf": [
99
+ {
100
+ "type": "boolean",
101
+ "description": "Pass the full row as parameters for the operation request"
102
+ },
103
+ {
104
+ "type": "object",
105
+ "description": "Mapping of table columns to parameters properties - [request property]: [table column]",
106
+ "additionalProperties": true
107
+ }
108
+ ]
109
+ },
110
+ "options": {
111
+ "type": "object",
112
+ "additionalProperties": true
113
+ }
114
+ },
115
+ "required": [
116
+ "type",
117
+ "project",
118
+ "feature",
119
+ "operationId"
120
+ ]
121
+ }
@@ -14,7 +14,7 @@ function NormalizeOperationTableActionOptions(options) {
14
14
  const normalizedOptions = (0, table_action_1.NormalizeTableActionOptions)(options);
15
15
  const nestModule = (_a = options.nestModule) !== null && _a !== void 0 ? _a : normalizedOptions.tableName;
16
16
  const context = options.context ? (0, utilities_1.dasherize)(options.context) : null;
17
- return Object.seal(Object.assign(Object.assign({}, normalizedOptions), { nestModule, controllerName: (0, schematics_ts_morph_1.BuildNestControllerName)({
17
+ return Object.freeze(Object.assign(Object.assign({}, normalizedOptions), { nestModule, controllerName: (0, schematics_ts_morph_1.BuildNestControllerName)({
18
18
  controllerName: context,
19
19
  nestModule,
20
20
  }), context }));
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/schematic/angular/src/schematics/table/action/operation-table-action/index.ts"],"names":[],"mappings":";;;AAAA,2DAIoC;AACpC,mEAKmC;AACnC,+CAGyB;AACzB,+BAA4B;AAC5B,qEAGyC;AACzC,iGAA2F;AAC3F,iEAA6D;AAC7D,qDAAiE;AAQjE,SAAgB,oCAAoC,CAClD,OAAoC;;IAEpC,MAAM,iBAAiB,GAAG,IAAA,0CAA2B,EAAC,OAAO,CAAC,CAAC;IAC/D,MAAM,UAAU,GAAG,MAAA,OAAO,CAAC,UAAU,mCAAI,iBAAiB,CAAC,SAAS,CAAC;IACrE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,IAAA,qBAAS,EAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACpE,OAAO,MAAM,CAAC,IAAI,iCACb,iBAAiB,KACpB,UAAU,EACV,cAAc,EAAE,IAAA,6CAAuB,EAAC;YACtC,cAAc,EAAE,OAAO;YACvB,UAAU;SACX,CAAC,EACF,OAAO,IACP,CAAC;AACL,CAAC;AAfD,oFAeC;AAED,SAAS,oBAAoB,CAAC,iBAAwD;IAEpF,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,UAAU,EACV,cAAc,EACd,IAAI,EACJ,KAAK,GACN,GAAG,iBAAiB,CAAC;IAEtB,OAAO,IAAA,kBAAK,EAAC;QACX,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,sCAAsC,CAAC;QACzD,IAAA,oDAA8B,EAAC;YAC7B,KAAK;YACL,SAAS,EAAE,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AC,IAAU,EAAE,EAAE;QAEpB,IAAA,0DAA0B,EAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;QAEpD,OAAO,IAAA,kBAAK,EAAC;YACX,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,kEAAkE,CAAC;YACvF,WAAW,CAAC,iBAAiB,CAAC;YAC9B,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE;SACzB,CAAC,CAAC;IAEL,CAAC,CAAC;AACJ,CAAC;AAhBD,4BAgBC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/schematic/angular/src/schematics/table/action/operation-table-action/index.ts"],"names":[],"mappings":";;;AAAA,2DAIoC;AACpC,mEAKmC;AACnC,+CAGyB;AACzB,+BAA4B;AAC5B,qEAGyC;AACzC,iGAA2F;AAC3F,iEAA6D;AAC7D,qDAAiE;AAQjE,SAAgB,oCAAoC,CAClD,OAAoC;;IAEpC,MAAM,iBAAiB,GAAG,IAAA,0CAA2B,EAAC,OAAO,CAAC,CAAC;IAC/D,MAAM,UAAU,GAAG,MAAA,OAAO,CAAC,UAAU,mCAAI,iBAAiB,CAAC,SAAS,CAAC;IACrE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,IAAA,qBAAS,EAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACpE,OAAO,MAAM,CAAC,MAAM,iCACf,iBAAiB,KACpB,UAAU,EACV,cAAc,EAAE,IAAA,6CAAuB,EAAC;YACtC,cAAc,EAAE,OAAO;YACvB,UAAU;SACX,CAAC,EACF,OAAO,IACP,CAAC;AACL,CAAC;AAfD,oFAeC;AAED,SAAS,oBAAoB,CAAC,iBAAwD;IAEpF,MAAM,EACJ,OAAO,EACP,OAAO,EACP,OAAO,EACP,YAAY,EACZ,cAAc,EACd,QAAQ,EACR,aAAa,EACb,SAAS,EACT,OAAO,EACP,OAAO,EACP,MAAM,EACN,SAA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AY,CAAC,OAA8C;IAClE,IAAA,qCAAmB,EAAC,wBAAwB,EAAE,OAAO,CAAC,CAAC;AACzD,CAAC;AAED,mBAAyB,OAAoC;IAC3D,MAAM,iBAAiB,GAAG,oCAAoC,CAAC,OAAO,CAAC,CAAC;IAExE,YAAY,CAAC,iBAAiB,CAAC,CAAC;IAEhC,OAAO,CAAC,IAAU,EAAE,EAAE;QAEpB,IAAA,0DAA0B,EAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;QAEpD,OAAO,IAAA,kBAAK,EAAC;YACX,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,kEAAkE,CAAC;YACvF,WAAW,CAAC,iBAAiB,CAAC;YAC9B,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE;SACzB,CAAC,CAAC;IAEL,CAAC,CAAC;AACJ,CAAC;AAhBD,4BAgBC"}
@@ -1,11 +1,18 @@
1
- import { Tree } from '@angular-devkit/schematics';
1
+ import { Rule, Tree } from '@angular-devkit/schematics';
2
2
  import { Normalized } from '@rxap/utilities';
3
3
  import { NormalizedAngularOptions } from '../../../../lib/angular-options';
4
+ import { NormalizedFormComponentControl } from '../../../../lib/form-component-control';
4
5
  import { NormalizedTableHeaderButton } from '../../../../lib/table-header-button';
5
6
  import { FormTableHeaderButtonOptions } from './schema';
6
- export interface NormalizedFormTableHeaderButtonOptions extends Readonly<Normalized<FormTableHeaderButtonOptions> & NormalizedAngularOptions & NormalizedTableHeaderButton> {
7
+ export interface NormalizedFormTableHeaderButtonOptions extends Omit<Readonly<Normalized<FormTableHeaderButtonOptions> & NormalizedAngularOptions & NormalizedTableHeaderButton>, 'formOptions'> {
7
8
  options: Record<string, any>;
8
9
  controllerName: string;
10
+ formComponent: string;
11
+ formOptions: {
12
+ controlList: ReadonlyArray<NormalizedFormComponentControl>;
13
+ role: string | null;
14
+ window: boolean;
15
+ };
9
16
  }
10
17
  export declare function NormalizeFormTableHeaderButtonOptions(options: Readonly<FormTableHeaderButtonOptions>): NormalizedFormTableHeaderButtonOptions;
11
- export default function (options: FormTableHeaderButtonOptions): (host: Tree) => import("@angular-devkit/schematics").Rule;
18
+ export default function (options: FormTableHeaderButtonOptions): (host: Tree) => Rule;
@@ -4,17 +4,26 @@ exports.NormalizeFormTableHeaderButtonOptions = void 0;
4
4
  const schematics_1 = require("@angular-devkit/schematics");
5
5
  const schematics_ts_morph_1 = require("@rxap/schematics-ts-morph");
6
6
  const schematics_utilities_1 = require("@rxap/schematics-utilities");
7
+ const utilities_1 = require("@rxap/utilities");
7
8
  const ts_morph_1 = require("ts-morph");
8
9
  const angular_options_1 = require("../../../../lib/angular-options");
9
10
  const assert_table_component_exists_1 = require("../../../../lib/assert-table-component-exists");
11
+ const form_component_control_1 = require("../../../../lib/form-component-control");
10
12
  const index_1 = require("../../table-header-button/index");
11
13
  function NormalizeFormTableHeaderButtonOptions(options) {
14
+ var _a, _b, _c, _d, _e;
12
15
  const normalizedTableHeaderButtonOptions = (0, index_1.NormalizeTableHeaderButtonOptions)(options);
13
16
  const nestModule = options.nestModule;
14
- return Object.seal(Object.assign(Object.assign({}, normalizedTableHeaderButtonOptions), { context: options.context, nestModule, controllerName: (0, schematics_ts_morph_1.BuildNestControllerName)({
17
+ const formOptions = (_a = options.formOptions) !== null && _a !== void 0 ? _a : {};
18
+ const { tableName } = normalizedTableHeaderButtonOptions;
19
+ return Object.freeze(Object.assign(Object.assign({}, normalizedTableHeaderButtonOptions), { context: options.context, nestModule, controllerName: (0, schematics_ts_morph_1.BuildNestControllerName)({
15
20
  nestModule,
16
21
  controllerName: 'header-button',
17
- }) }));
22
+ }), formComponent: (0, utilities_1.CoerceSuffix)((0, utilities_1.dasherize)((_b = options.formComponent) !== null && _b !== void 0 ? _b : tableName.replace(/-table$/, '')), '-form'), customComponent: (_c = options.customComponent) !== null && _c !== void 0 ? _c : false, formOptions: {
23
+ window: (_d = formOptions.window) !== null && _d !== void 0 ? _d : true,
24
+ role: (_e = formOptions.role) !== null && _e !== void 0 ? _e : null,
25
+ controlList: (0, form_component_control_1.NormalizeFormComponentControlList)(formOptions.controlList),
26
+ } }));
18
27
  }
19
28
  exports.NormalizeFormTableHeaderButtonOptions = NormalizeFormTableHeaderButtonOptions;
20
29
  function printOptions(options) {
@@ -22,61 +31,61 @@ function printOptions(options) {
22
31
  }
23
32
  function default_1(options) {
24
33
  const normalizedOptions = NormalizeFormTableHeaderButtonOptions(options);
25
- const { refresh, confirm, tooltip, errorMessage, successMessage, tableName, project, feature, shared, directory, overwrite, options: formOptions, context, backend, nestModule, controllerName, } = normalizedOptions;
34
+ const { refresh, confirm, tooltip, errorMessage, successMessage, tableName, project, feature, shared, directory, overwrite, formOptions, context, backend, nestModule, controllerName, formComponent, customComponent, } = normalizedOptions;
26
35
  printOptions(normalizedOptions);
27
36
  return (host) => {
28
37
  (0, assert_table_component_exists_1.AssertTableComponentExists)(host, normalizedOptions);
29
- return (0, schematics_1.chain)([
38
+ const ruleList = [
30
39
  () => console.group('\x1b[32m[@rxap/schematics-angular:form-table-header-button]\x1b[0m'),
31
- () => console.log('Coerce table header button form ...'),
32
- (0, schematics_utilities_1.ExecuteSchematic)('form-component', Object.assign(Object.assign({}, formOptions), { project, name: `table-header-button`, feature,
40
+ ];
41
+ if (!customComponent) {
42
+ ruleList.push(() => console.log('Coerce table header button form ...'), (0, schematics_utilities_1.ExecuteSchematic)('form-component', Object.assign(Object.assign({}, formOptions), { project, name: formComponent.replace(/-form$/, ''), feature,
33
43
  directory,
34
44
  shared, window: true, nestModule,
35
45
  controllerName,
36
46
  context,
37
47
  backend,
38
- overwrite })),
39
- () => console.log('Coerce table header button method ...'),
40
- (0, schematics_ts_morph_1.CoerceTableHeaderButtonMethodRule)({
41
- project,
42
- feature,
43
- shared,
44
- directory,
45
- overwrite,
46
- tableName,
47
- refresh,
48
- confirm,
49
- tooltip,
50
- errorMessage,
51
- successMessage,
52
- tsMorphTransform: (project, sourceFile, classDeclaration) => {
53
- const [constructorDeclaration] = (0, schematics_ts_morph_1.CoerceClassConstructor)(classDeclaration);
54
- (0, schematics_ts_morph_1.CoerceParameterDeclaration)(constructorDeclaration, 'openWindowMethod', {
55
- isReadonly: true,
56
- scope: ts_morph_1.Scope.Private,
57
- type: 'OpenTableHeaderButtonFormWindowMethod',
58
- });
59
- (0, schematics_ts_morph_1.CoerceImports)(sourceFile, [
60
- {
61
- moduleSpecifier: '../table-header-button-form/open-table-header-button-form-window.method',
62
- namedImports: ['OpenTableHeaderButtonFormWindowMethod'],
63
- },
64
- ]);
65
- return {
66
- statements: ['return this.openWindowMethod.call(parameters).toPromise();'],
67
- };
68
- },
69
- tsMorphTransformComponent: (project, [sourceFile]) => {
70
- (0, schematics_ts_morph_1.AddComponentProvider)(sourceFile, 'OpenTableHeaderButtonFormWindowMethod', [
71
- {
72
- moduleSpecifier: './table-header-button-form/open-table-header-button-form-window.method',
73
- namedImports: ['OpenTableHeaderButtonFormWindowMethod'],
74
- },
75
- ]);
76
- },
77
- }),
78
- () => console.groupEnd(),
79
- ]);
48
+ overwrite })));
49
+ }
50
+ ruleList.push(() => console.log('Coerce table header button method ...'), (0, schematics_ts_morph_1.CoerceTableHeaderButtonMethodRule)({
51
+ project,
52
+ feature,
53
+ shared,
54
+ directory,
55
+ overwrite,
56
+ tableName,
57
+ refresh,
58
+ confirm,
59
+ tooltip,
60
+ errorMessage,
61
+ successMessage,
62
+ tsMorphTransform: (project, sourceFile, classDeclaration) => {
63
+ const [constructorDeclaration] = (0, schematics_ts_morph_1.CoerceClassConstructor)(classDeclaration);
64
+ (0, schematics_ts_morph_1.CoerceParameterDeclaration)(constructorDeclaration, 'openWindowMethod', {
65
+ isReadonly: true,
66
+ scope: ts_morph_1.Scope.Private,
67
+ type: `Open${(0, utilities_1.classify)(formComponent)}WindowMethod`,
68
+ });
69
+ (0, schematics_ts_morph_1.CoerceImports)(sourceFile, [
70
+ {
71
+ moduleSpecifier: `../${(0, utilities_1.dasherize)(formComponent)}/open-${(0, utilities_1.dasherize)(formComponent)}-window.method`,
72
+ namedImports: [`Open${(0, utilities_1.classify)(formComponent)}WindowMethod`],
73
+ },
74
+ ]);
75
+ return {
76
+ statements: ['return this.openWindowMethod.call(parameters).toPromise();'],
77
+ };
78
+ },
79
+ tsMorphTransformComponent: (project, [sourceFile]) => {
80
+ (0, schematics_ts_morph_1.AddComponentProvider)(sourceFile, `Open${(0, utilities_1.classify)(formComponent)}WindowMethod`, [
81
+ {
82
+ moduleSpecifier: `./${(0, utilities_1.dasherize)(formComponent)}/open-${(0, utilities_1.dasherize)(formComponent)}-window.method`,
83
+ namedImports: [`Open${(0, utilities_1.classify)(formComponent)}WindowMethod`],
84
+ },
85
+ ]);
86
+ },
87
+ }), () => console.groupEnd());
88
+ return (0, schematics_1.chain)(ruleList);
80
89
  };
81
90
  }
82
91
  exports.default = default_1;
@@ -1 +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,2DAGoC;AACpC,mEAOmC;AACnC,qEAA8D;AAE9D,uCAIkB;AAClB,qEAGyC;AACzC,iGAA2F;AAE3F,2DAAoF;AASpF,SAAgB,qCAAqC,CACnD,OAA+C;IAE/C,MAAM,kCAAkC,GAAG,IAAA,yCAAiC,EAAC,OAAO,CAAC,CAAC;IACtF,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IACtC,OAAO,MAAM,CAAC,IAAI,iCACb,kCAAkC,KACrC,OAAO,EAAE,OAAO,CAAC,OAAO,EACxB,UAAU,EACV,cAAc,EAAE,IAAA,6CAAuB,EAAC;YACtC,UAAU;YACV,cAAc,EAAE,eAAe;SAChC,CAAC,IACF,CAAC;AACL,CAAC;AAdD,sFAcC;AAED,SAAS,YAAY,CAAC,OAA+C;IACnE,IAAA,qCAAmB,EAAC,0BAA0B,EAAE,OAAO,CAAC,CAAC;AAC3D,CAAC;AAED,mBAAyB,OAAqC;IAC5D,MAAM,iB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I;wBAChB,KAAK,EAAE,gBAAK,CAAC,OAAO;wBACpB,IAAI,EAAE,uCAAuC;qBAC9C,CAAC,CAAC;oBACH,IAAA,mCAAa,EAAC,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,IAAA,0CAAoB,EAClB,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;AA7FD,4BA6FC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/schematic/angular/src/schematics/table/header-button/form-table-header-button/index.ts"],"names":[],"mappings":";;;AAAA,2DAIoC;AACpC,mEAOmC;AACnC,qEAA8D;AAC9D,+CAKyB;AACzB,uCAIkB;AAClB,qEAGyC;AACzC,iGAA2F;AAC3F,mFAGgD;AAEhD,2DAAoF;AAgBpF,SAAgB,qCAAqC,CACnD,OAA+C;;IAE/C,MAAM,kCAAkC,GAAG,IAAA,yCAAiC,EAAC,OAAO,CAAC,CAAC;IACtF,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IACtC,MAAM,WAAW,GAAG,MAAA,OAAO,CAAC,WAAW,mCAAI,EAAE,CAAC;IAC9C,MAAM,EAAE,SAAS,EAAE,GAAG,kCAAkC,CAAC;IACzD,OAAO,MAAM,CAAC,MAAM,iCACf,kCAAkC,KACrC,OAAO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BACL,UAAU,EAAE,CAAE,4DAA4D,CAAE;iBAC7E,CAAC;YACJ,CAAC;YACD,yBAAyB,EAAE,CACzB,OAAgB,EAChB,CAAE,UAAU,CAAkB,EAC9B,EAAE;gBACF,IAAA,0CAAoB,EAClB,UAAU,EACV,OAAQ,IAAA,oBAAQ,EAAC,aAAa,CAAE,cAAc,EAC9C;oBACE;wBACE,eAAe,EAAE,KAAM,IAAA,qBAAS,EAAC,aAAa,CAAE,SAAU,IAAA,qBAAS,EAAC,aAAa,CAAE,gBAAgB;wBACnG,YAAY,EAAE,CAAE,OAAQ,IAAA,oBAAQ,EAAC,aAAa,CAAE,cAAc,CAAE;qBACjE;iBACF,CACF,CAAC;YACJ,CAAC;SACF,CAAC,EACF,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,CACzB,CAAC;QAEF,OAAO,IAAA,kBAAK,EAAC,QAAQ,CAAC,CAAC;IACzB,CAAC,CAAC;AACJ,CAAC;AAzGD,4BAyGC"}
@@ -1,7 +1,15 @@
1
+ import { FormComponentControl } from '../../../../lib/form-component-control';
1
2
  import { TableHeaderButtonOptions } from '../../table-header-button/schema';
2
3
 
3
4
 
4
5
  export interface FormTableHeaderButtonOptions extends TableHeaderButtonOptions {
5
6
  nestModule: string;
6
7
  context: string;
8
+ formComponent?: string;
9
+ customComponent: boolean;
10
+ formOptions?: {
11
+ controlList?: Array<FormComponentControl>;
12
+ role?: string;
13
+ window?: boolean;
14
+ };
7
15
  }
@@ -68,9 +68,25 @@
68
68
  "svgIcon": {
69
69
  "type": "string"
70
70
  },
71
- "options": {
71
+ "formComponent": {
72
+ "type": "string"
73
+ },
74
+ "customComponent": {
75
+ "type": "boolean",
76
+ "default": false,
77
+ "description": "If true the schematic will not coerce the form component"
78
+ },
79
+ "formOptions": {
72
80
  "type": "object",
73
81
  "properties": {
82
+ "role": {
83
+ "type": "string",
84
+ "description": "Define the role of the form"
85
+ },
86
+ "window": {
87
+ "type": "boolean",
88
+ "description": "Whether the form can be opened in a window"
89
+ },
74
90
  "controlList": {
75
91
  "alias": "control",
76
92
  "type": "array",