@rxap/schematic-angular 16.2.0-dev.4 → 16.2.0-dev.40

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 (364) hide show
  1. package/CHANGELOG.md +285 -0
  2. package/README.md +1 -1
  3. package/collection.json +15 -0
  4. package/package.json +15 -13
  5. package/src/lib/accordion-header.d.ts +5 -0
  6. package/src/lib/accordion-header.js +14 -5
  7. package/src/lib/accordion-header.js.map +1 -1
  8. package/src/lib/accordion-identifier.d.ts +6 -2
  9. package/src/lib/accordion-identifier.js +2 -1
  10. package/src/lib/accordion-identifier.js.map +1 -1
  11. package/src/lib/accordion-item.d.ts +25 -17
  12. package/src/lib/accordion-item.js +81 -42
  13. package/src/lib/accordion-item.js.map +1 -1
  14. package/src/lib/accordion-itme-kinds.d.ts +8 -0
  15. package/src/lib/accordion-itme-kinds.js +16 -0
  16. package/src/lib/accordion-itme-kinds.js.map +1 -0
  17. package/src/lib/coerce-accordion-component.js +5 -3
  18. package/src/lib/coerce-accordion-component.js.map +1 -1
  19. package/src/lib/coerce-accordion-item-table-component.js +1 -1
  20. package/src/lib/coerce-accordion-item-table-component.js.map +1 -1
  21. package/src/lib/coerce-form-component.js +18 -2
  22. package/src/lib/coerce-form-component.js.map +1 -1
  23. package/src/lib/coerce-minimum-table-component.js +8 -4
  24. package/src/lib/coerce-minimum-table-component.js.map +1 -1
  25. package/src/lib/coerce-tree-table-component.js +15 -3
  26. package/src/lib/coerce-tree-table-component.js.map +1 -1
  27. package/src/lib/css-class.d.ts +9 -0
  28. package/src/lib/css-class.js +52 -0
  29. package/src/lib/css-class.js.map +1 -0
  30. package/src/lib/data-grid-item.d.ts +46 -11
  31. package/src/lib/data-grid-item.js +86 -6
  32. package/src/lib/data-grid-item.js.map +1 -1
  33. package/src/lib/data-grid-mode.d.ts +4 -0
  34. package/src/lib/data-grid-mode.js +9 -0
  35. package/src/lib/data-grid-mode.js.map +1 -0
  36. package/src/lib/data-grid-options.d.ts +12 -5
  37. package/src/lib/data-grid-options.js +43 -13
  38. package/src/lib/data-grid-options.js.map +1 -1
  39. package/src/lib/form/abstract-control.d.ts +29 -0
  40. package/src/lib/form/abstract-control.js +37 -0
  41. package/src/lib/form/abstract-control.js.map +1 -0
  42. package/src/lib/form/array/base-form-array.d.ts +18 -0
  43. package/src/lib/form/array/base-form-array.js +40 -0
  44. package/src/lib/form/array/base-form-array.js.map +1 -0
  45. package/src/lib/form/array/form-array-kind.d.ts +3 -0
  46. package/src/lib/form/array/form-array-kind.js +8 -0
  47. package/src/lib/form/array/form-array-kind.js.map +1 -0
  48. package/src/lib/form/array/form-array.d.ts +12 -0
  49. package/src/lib/form/array/form-array.js +18 -0
  50. package/src/lib/form/array/form-array.js.map +1 -0
  51. package/src/lib/form/coerce-control-component-imports.d.ts +3 -0
  52. package/src/lib/form/coerce-control-component-imports.js +18 -0
  53. package/src/lib/form/coerce-control-component-imports.js.map +1 -0
  54. package/src/lib/form/control/autocomplete-table-select-form-control.d.ts +9 -0
  55. package/src/lib/form/control/autocomplete-table-select-form-control.js +58 -0
  56. package/src/lib/form/control/autocomplete-table-select-form-control.js.map +1 -0
  57. package/src/lib/form/control/base-form-control.d.ts +15 -0
  58. package/src/lib/form/control/base-form-control.js +19 -0
  59. package/src/lib/form/control/base-form-control.js.map +1 -0
  60. package/src/lib/form/control/checkbox-form-control.d.ts +11 -0
  61. package/src/lib/form/control/checkbox-form-control.js +23 -0
  62. package/src/lib/form/control/checkbox-form-control.js.map +1 -0
  63. package/src/lib/form/control/form-control-kind.d.ts +9 -0
  64. package/src/lib/form/control/form-control-kind.js +14 -0
  65. package/src/lib/form/control/form-control-kind.js.map +1 -0
  66. package/src/lib/form/control/form-control.d.ts +20 -0
  67. package/src/lib/form/control/form-control.js +43 -0
  68. package/src/lib/form/control/form-control.js.map +1 -0
  69. package/src/lib/form/control/form-field-form-control.d.ts +39 -0
  70. package/src/lib/form/control/form-field-form-control.js +81 -0
  71. package/src/lib/form/control/form-field-form-control.js.map +1 -0
  72. package/src/lib/form/control/input-form-control.d.ts +15 -0
  73. package/src/lib/form/control/input-form-control.js +75 -0
  74. package/src/lib/form/control/input-form-control.js.map +1 -0
  75. package/src/lib/form/control/select-form-control.d.ts +21 -0
  76. package/src/lib/form/control/select-form-control.js +30 -0
  77. package/src/lib/form/control/select-form-control.js.map +1 -0
  78. package/src/lib/form/control/slide-toggle-form-control.d.ts +11 -0
  79. package/src/lib/form/control/slide-toggle-form-control.js +23 -0
  80. package/src/lib/form/control/slide-toggle-form-control.js.map +1 -0
  81. package/src/lib/form/control/table-select-form-control.d.ts +46 -0
  82. package/src/lib/form/control/table-select-form-control.js +81 -0
  83. package/src/lib/form/control/table-select-form-control.js.map +1 -0
  84. package/src/lib/form/control.d.ts +8 -0
  85. package/src/lib/form/control.js +38 -0
  86. package/src/lib/form/control.js.map +1 -0
  87. package/src/lib/form/generate-form-template.d.ts +5 -0
  88. package/src/lib/form/generate-form-template.js +12 -0
  89. package/src/lib/form/generate-form-template.js.map +1 -0
  90. package/src/lib/form/group/base-form-group.d.ts +17 -0
  91. package/src/lib/form/group/base-form-group.js +20 -0
  92. package/src/lib/form/group/base-form-group.js.map +1 -0
  93. package/src/lib/form/group/form-group-kind.d.ts +3 -0
  94. package/src/lib/form/group/form-group-kind.js +8 -0
  95. package/src/lib/form/group/form-group-kind.js.map +1 -0
  96. package/src/lib/form/group/form-group.d.ts +12 -0
  97. package/src/lib/form/group/form-group.js +18 -0
  98. package/src/lib/form/group/form-group.js.map +1 -0
  99. package/src/lib/load-handlebars-template.d.ts +6 -0
  100. package/src/lib/load-handlebars-template.js +36 -0
  101. package/src/lib/load-handlebars-template.js.map +1 -0
  102. package/src/lib/minimum-table-component-options.d.ts +12 -2
  103. package/src/lib/minimum-table-component-options.js +26 -19
  104. package/src/lib/minimum-table-component-options.js.map +1 -1
  105. package/src/lib/minimum-table-options.d.ts +12 -2
  106. package/src/lib/minimum-table-options.js +22 -5
  107. package/src/lib/minimum-table-options.js.map +1 -1
  108. package/src/lib/pipe-option.d.ts +11 -0
  109. package/src/lib/pipe-option.js +75 -0
  110. package/src/lib/pipe-option.js.map +1 -0
  111. package/src/lib/table/table-filter-column-rule.d.ts +13 -0
  112. package/src/lib/table/table-filter-column-rule.js +89 -0
  113. package/src/lib/table/table-filter-column-rule.js.map +1 -0
  114. package/src/lib/table-action.js.map +1 -1
  115. package/src/lib/table-column.d.ts +46 -13
  116. package/src/lib/table-column.js +147 -120
  117. package/src/lib/table-column.js.map +1 -1
  118. package/src/lib/table-options.d.ts +1 -1
  119. package/src/lib/table-row-action.d.ts +4 -2
  120. package/src/lib/table-row-action.js +8 -7
  121. package/src/lib/table-row-action.js.map +1 -1
  122. package/src/lib/tree-table-options.d.ts +4 -2
  123. package/src/lib/tree-table-options.js +40 -4
  124. package/src/lib/tree-table-options.js.map +1 -1
  125. package/src/lib/use-pick-from-table-interface-as-form-type.d.ts +10 -0
  126. package/src/lib/use-pick-from-table-interface-as-form-type.js +32 -0
  127. package/src/lib/use-pick-from-table-interface-as-form-type.js.map +1 -0
  128. package/src/lib/value-option.d.ts +12 -0
  129. package/src/lib/value-option.js +66 -0
  130. package/src/lib/value-option.js.map +1 -0
  131. package/src/schema.json +2871 -0
  132. package/src/schematic-input.schema.json +560 -0
  133. package/src/schematics/abstract-control.schema.json +78 -0
  134. package/src/schematics/accordion/accordion-component/files/component/__componentName__.component.html.hbs +25 -0
  135. package/src/schematics/accordion/accordion-component/index.d.ts +5 -2
  136. package/src/schematics/accordion/accordion-component/index.js +56 -122
  137. package/src/schematics/accordion/accordion-component/index.js.map +1 -1
  138. package/src/schematics/accordion/accordion-component/schema.d.ts +6 -0
  139. package/src/schematics/accordion/accordion-component/schema.json +1636 -132
  140. package/src/schematics/accordion/accordion-component/template.schema.json +105 -0
  141. package/src/schematics/accordion/accordion-item-component/index.d.ts +9 -4
  142. package/src/schematics/accordion/accordion-item-component/index.js +112 -86
  143. package/src/schematics/accordion/accordion-item-component/index.js.map +1 -1
  144. package/src/schematics/accordion/accordion-item-component/schema.d.ts +2 -2
  145. package/src/schematics/accordion/accordion-item-component/schema.json +1597 -63
  146. package/src/schematics/accordion/accordion-item-component/template.schema.json +32 -0
  147. package/src/schematics/accordion/item/accordion-item-data-grid-component/index.d.ts +1 -1
  148. package/src/schematics/accordion/item/accordion-item-data-grid-component/index.js +36 -54
  149. package/src/schematics/accordion/item/accordion-item-data-grid-component/index.js.map +1 -1
  150. package/src/schematics/accordion/item/accordion-item-data-grid-component/schema.d.ts +1 -1
  151. package/src/schematics/accordion/item/accordion-item-data-grid-component/schema.json +1059 -73
  152. package/src/schematics/accordion/item/accordion-item-data-grid-component/template.schema.json +20 -0
  153. package/src/schematics/accordion/item/accordion-item-switch-component/index.d.ts +1 -1
  154. package/src/schematics/accordion/item/accordion-item-switch-component/index.js +16 -8
  155. package/src/schematics/accordion/item/accordion-item-switch-component/index.js.map +1 -1
  156. package/src/schematics/accordion/item/accordion-item-switch-component/schema.d.ts +1 -1
  157. package/src/schematics/accordion/item/accordion-item-switch-component/schema.json +1575 -187
  158. package/src/schematics/accordion/item/accordion-item-switch-component/template.schema.json +20 -0
  159. package/src/schematics/accordion/item/accordion-item-table-component/index.d.ts +1 -1
  160. package/src/schematics/accordion/item/accordion-item-table-component/index.js +19 -33
  161. package/src/schematics/accordion/item/accordion-item-table-component/index.js.map +1 -1
  162. package/src/schematics/accordion/item/accordion-item-table-component/schema.d.ts +1 -1
  163. package/src/schematics/accordion/item/accordion-item-table-component/schema.json +1139 -292
  164. package/src/schematics/accordion/item/accordion-item-table-component/template.schema.json +20 -0
  165. package/src/schematics/accordion/item/accordion-item-tree-table-component/index.d.ts +1 -1
  166. package/src/schematics/accordion/item/accordion-item-tree-table-component/index.js +23 -84
  167. package/src/schematics/accordion/item/accordion-item-tree-table-component/index.js.map +1 -1
  168. package/src/schematics/accordion/item/accordion-item-tree-table-component/schema.d.ts +1 -1
  169. package/src/schematics/accordion/item/accordion-item-tree-table-component/schema.json +1091 -260
  170. package/src/schematics/accordion/item/accordion-item-tree-table-component/template.schema.json +20 -0
  171. package/src/schematics/accordion/templates/accordion-header.hbs +6 -0
  172. package/src/schematics/accordion/templates/data-grid-accordion-item.hbs +15 -0
  173. package/src/schematics/accordion/templates/default-accordion-item.hbs +15 -0
  174. package/src/schematics/accordion/templates/switch-accordion-item.hbs +21 -0
  175. package/src/schematics/accordion/templates/table-accordion-item.hbs +15 -0
  176. package/src/schematics/accordion/templates/tree-table-accordion-item.hbs +15 -0
  177. package/src/schematics/accordion-identifier.schema.json +24 -0
  178. package/src/schematics/accordion-item.schema.json +52 -0
  179. package/src/schematics/angular.schema.json +11 -11
  180. package/src/schematics/autocomplete-table-select-form-control.schema.json +96 -0
  181. package/src/schematics/backend.schema.json +13 -0
  182. package/src/schematics/base-accordion-item.schema.json +52 -0
  183. package/src/schematics/base-form-array.schema.json +45 -0
  184. package/src/schematics/base-form-control.schema.json +27 -0
  185. package/src/schematics/base-form-group.schema.json +42 -0
  186. package/src/schematics/button.schema.json +30 -0
  187. package/src/schematics/checkbox-form-control.schema.json +30 -0
  188. package/src/schematics/control.schema.json +26 -0
  189. package/src/schematics/css-class.schema.json +34 -0
  190. package/src/schematics/data-grid-accordion-item.schema.json +34 -0
  191. package/src/schematics/data-grid-component/files/component/__componentName__.component.html.hbs +35 -0
  192. package/src/schematics/data-grid-component/index.d.ts +2 -4
  193. package/src/schematics/data-grid-component/index.js +101 -68
  194. package/src/schematics/data-grid-component/index.js.map +1 -1
  195. package/src/schematics/data-grid-component/schema.json +1009 -131
  196. package/src/schematics/data-grid-component/template.schema.json +20 -0
  197. package/src/schematics/data-grid-component/templates/default-data-grid-item.hbs +3 -0
  198. package/src/schematics/data-grid-component/templates/link-data-grid-item.hbs +8 -0
  199. package/src/schematics/data-grid-item.schema.json +50 -0
  200. package/src/schematics/data-grid.schema.json +66 -0
  201. package/src/schematics/dialog-component/schema.json +141 -65
  202. package/src/schematics/dialog-component/template.schema.json +62 -0
  203. package/src/schematics/form/control/autocomplete-table-select-form-control/index.d.ts +10 -0
  204. package/src/schematics/form/control/autocomplete-table-select-form-control/index.js +283 -0
  205. package/src/schematics/form/control/autocomplete-table-select-form-control/index.js.map +1 -0
  206. package/src/schematics/form/control/autocomplete-table-select-form-control/schema.d.ts +4 -0
  207. package/src/schematics/form/control/autocomplete-table-select-form-control/schema.json +450 -0
  208. package/src/schematics/form/control/autocomplete-table-select-form-control/template.schema.json +39 -0
  209. package/src/schematics/form/control/input-form-control/index.d.ts +2 -2
  210. package/src/schematics/form/control/input-form-control/index.js +4 -27
  211. package/src/schematics/form/control/input-form-control/index.js.map +1 -1
  212. package/src/schematics/form/control/input-form-control/schema.d.ts +2 -3
  213. package/src/schematics/form/control/input-form-control/schema.json +338 -94
  214. package/src/schematics/form/control/input-form-control/template.schema.json +33 -0
  215. package/src/schematics/form/control/select-form-control/index.d.ts +4 -2
  216. package/src/schematics/form/control/select-form-control/index.js +140 -98
  217. package/src/schematics/form/control/select-form-control/index.js.map +1 -1
  218. package/src/schematics/form/control/select-form-control/schema.d.ts +2 -4
  219. package/src/schematics/form/control/select-form-control/schema.json +406 -80
  220. package/src/schematics/form/control/select-form-control/template.schema.json +33 -0
  221. package/src/schematics/form/control/table-select-form-control/index.d.ts +5 -7
  222. package/src/schematics/form/control/table-select-form-control/index.js +207 -143
  223. package/src/schematics/form/control/table-select-form-control/index.js.map +1 -1
  224. package/src/schematics/form/control/table-select-form-control/schema.d.ts +2 -5
  225. package/src/schematics/form/control/table-select-form-control/schema.json +448 -84
  226. package/src/schematics/form/control/table-select-form-control/template.schema.json +39 -0
  227. package/src/schematics/form/form-array/index.d.ts +9 -0
  228. package/src/schematics/form/form-array/index.js +54 -0
  229. package/src/schematics/form/form-array/index.js.map +1 -0
  230. package/src/schematics/form/form-array/schema.d.ts +4 -0
  231. package/src/schematics/form/form-array/schema.json +926 -0
  232. package/src/schematics/form/form-array/template.schema.json +33 -0
  233. package/src/schematics/form/form-component/files/component/{__componentName__.component.html.template → __componentName__.component.html.hbs} +7 -4
  234. package/src/schematics/form/form-component/index.d.ts +4 -4
  235. package/src/schematics/form/form-component/index.js +22 -23
  236. package/src/schematics/form/form-component/index.js.map +1 -1
  237. package/src/schematics/form/form-component/schema.d.ts +4 -2
  238. package/src/schematics/form/form-component/schema.json +926 -136
  239. package/src/schematics/form/form-component/template.schema.json +20 -0
  240. package/src/schematics/form/form-control/index.d.ts +6 -6
  241. package/src/schematics/form/form-control/index.js +25 -24
  242. package/src/schematics/form/form-control/index.js.map +1 -1
  243. package/src/schematics/form/form-control/schema.d.ts +2 -4
  244. package/src/schematics/form/form-control/schema.json +755 -67
  245. package/src/schematics/form/form-control/template.schema.json +33 -0
  246. package/src/schematics/form/form-definition/index.d.ts +2 -2
  247. package/src/schematics/form/form-definition/index.js +30 -4
  248. package/src/schematics/form/form-definition/index.js.map +1 -1
  249. package/src/schematics/form/form-definition/schema.d.ts +2 -2
  250. package/src/schematics/form/form-definition/schema.json +908 -118
  251. package/src/schematics/form/form-definition/template.schema.json +30 -0
  252. package/src/schematics/form/form-group/index.d.ts +9 -0
  253. package/src/schematics/form/form-group/index.js +54 -0
  254. package/src/schematics/form/form-group/index.js.map +1 -0
  255. package/src/schematics/form/form-group/schema.d.ts +4 -0
  256. package/src/schematics/form/form-group/schema.json +926 -0
  257. package/src/schematics/form/form-group/template.schema.json +33 -0
  258. package/src/schematics/form/templates/autocomplete-table-select-form-control.hbs +25 -0
  259. package/src/schematics/form/templates/checkbox-form-control.hbs +9 -0
  260. package/src/schematics/form/templates/default-form-array.hbs +27 -0
  261. package/src/schematics/form/templates/default-form-control.hbs +2 -0
  262. package/src/schematics/form/templates/default-form-group.hbs +13 -0
  263. package/src/schematics/form/templates/input-form-control.hbs +9 -0
  264. package/src/schematics/form/templates/mat-form-field.hbs +31 -0
  265. package/src/schematics/form/templates/select-form-control.hbs +5 -0
  266. package/src/schematics/form/templates/slide-toggle-form-control.hbs +8 -0
  267. package/src/schematics/form/templates/table-select-form-control.hbs +19 -0
  268. package/src/schematics/form-array.schema.json +40 -0
  269. package/src/schematics/form-component.schema.json +45 -0
  270. package/src/schematics/form-control.schema.json +83 -0
  271. package/src/schematics/form-definition.schema.json +22 -0
  272. package/src/schematics/form-field.schema.json +24 -0
  273. package/src/schematics/form-group.schema.json +40 -0
  274. package/src/schematics/general.schema.json +1 -4
  275. package/src/schematics/header-button.schema.json +42 -0
  276. package/src/schematics/input-form-control.schema.json +59 -0
  277. package/src/schematics/minimum-table.schema.json +76 -0
  278. package/src/schematics/pipe.schema.json +38 -0
  279. package/src/schematics/property.schema.json +28 -0
  280. package/src/schematics/select-form-control.schema.json +74 -0
  281. package/src/schematics/slide-toggle-form-control.schema.json +30 -0
  282. package/src/schematics/switch-accordion-item.schema.json +82 -0
  283. package/src/schematics/table/action/dialog-table-action/schema.json +234 -119
  284. package/src/schematics/table/action/dialog-table-action/template.schema.json +58 -0
  285. package/src/schematics/table/action/form-table-action/index.d.ts +2 -2
  286. package/src/schematics/table/action/form-table-action/index.js +3 -4
  287. package/src/schematics/table/action/form-table-action/index.js.map +1 -1
  288. package/src/schematics/table/action/form-table-action/schema.d.ts +2 -2
  289. package/src/schematics/table/action/form-table-action/schema.json +1064 -138
  290. package/src/schematics/table/action/form-table-action/template.schema.json +75 -0
  291. package/src/schematics/table/action/navigation-table-action/schema.json +218 -80
  292. package/src/schematics/table/action/navigation-table-action/template.schema.json +28 -0
  293. package/src/schematics/table/action/open-api-table-action/schema.json +232 -92
  294. package/src/schematics/table/action/open-api-table-action/template.schema.json +56 -0
  295. package/src/schematics/table/action/operation-table-action/schema.json +205 -84
  296. package/src/schematics/table/action/operation-table-action/template.schema.json +14 -0
  297. package/src/schematics/table/header-button/form-table-header-button/index.d.ts +2 -2
  298. package/src/schematics/table/header-button/form-table-header-button/index.js +2 -2
  299. package/src/schematics/table/header-button/form-table-header-button/index.js.map +1 -1
  300. package/src/schematics/table/header-button/form-table-header-button/schema.d.ts +2 -2
  301. package/src/schematics/table/header-button/form-table-header-button/schema.json +995 -98
  302. package/src/schematics/table/header-button/form-table-header-button/template.schema.json +33 -0
  303. package/src/schematics/table/header-button/navigation-table-header-button/schema.json +167 -71
  304. package/src/schematics/table/header-button/navigation-table-header-button/template.schema.json +28 -0
  305. package/src/schematics/table/table-action/schema.json +195 -77
  306. package/src/schematics/table/table-action/template.schema.json +30 -0
  307. package/src/schematics/table/table-component/files/component/__componentName__.component.html.hbs +248 -0
  308. package/src/schematics/table/table-component/index.d.ts +0 -5
  309. package/src/schematics/table/table-component/index.js +16 -128
  310. package/src/schematics/table/table-component/index.js.map +1 -1
  311. package/src/schematics/table/table-component/schema.json +1064 -295
  312. package/src/schematics/table/table-component/template.schema.json +20 -0
  313. package/src/schematics/table/table-header-button/schema.json +145 -63
  314. package/src/schematics/table/table-header-button/template.schema.json +30 -0
  315. package/src/schematics/table/templates/boolean-table-column.hbs +17 -0
  316. package/src/schematics/table/templates/component-table-column.hbs +19 -0
  317. package/src/schematics/table/templates/copy-to-clipboard-table-column.hbs +17 -0
  318. package/src/schematics/table/templates/date-table-column.hbs +18 -0
  319. package/src/schematics/table/templates/default-table-column.hbs +17 -0
  320. package/src/schematics/table/templates/icon-table-column.hbs +17 -0
  321. package/src/schematics/table/templates/link-table-column.hbs +17 -0
  322. package/src/schematics/table/templates/mat-column-def.hbs +3 -0
  323. package/src/schematics/table/templates/spinner-table-column.hbs +21 -0
  324. package/src/schematics/table/templates/tree-table-column.hbs +15 -0
  325. package/src/schematics/table/tree-table-component/files/component/__componentName__.component.html.hbs +253 -0
  326. package/src/schematics/table/tree-table-component/index.d.ts +3 -0
  327. package/src/schematics/table/tree-table-component/index.js +33 -7
  328. package/src/schematics/table/tree-table-component/index.js.map +1 -1
  329. package/src/schematics/table/tree-table-component/schema.json +1041 -264
  330. package/src/schematics/table/tree-table-component/template.schema.json +20 -0
  331. package/src/schematics/table-accordion-item.schema.json +41 -0
  332. package/src/schematics/table-action.schema.json +65 -0
  333. package/src/schematics/table-column.schema.json +81 -0
  334. package/src/schematics/table-select-form-control.schema.json +102 -0
  335. package/src/schematics/table.schema.json +57 -0
  336. package/src/schematics/templates/css-class.hbs +1 -0
  337. package/src/schematics/templates/pipe.hbs +4 -0
  338. package/src/schematics/textarea-form-control.schema.json +32 -0
  339. package/src/schematics/tree-component/schema.json +115 -70
  340. package/src/schematics/tree-component/template.schema.json +36 -0
  341. package/src/schematics/tree-table-accordion-item.schema.json +41 -0
  342. package/src/schematics/tree-table.schema.json +41 -0
  343. package/src/schematics/type.schema.json +35 -0
  344. package/src/schematics/upstream.schema.json +56 -0
  345. package/src/schematics/value.schema.json +26 -0
  346. package/src/template.schema.json +236 -0
  347. package/src/lib/accordion-itme-types.d.ts +0 -8
  348. package/src/lib/accordion-itme-types.js +0 -16
  349. package/src/lib/accordion-itme-types.js.map +0 -1
  350. package/src/lib/form-component-control.d.ts +0 -12
  351. package/src/lib/form-component-control.js +0 -15
  352. package/src/lib/form-component-control.js.map +0 -1
  353. package/src/lib/form-definition-control.d.ts +0 -59
  354. package/src/lib/form-definition-control.js +0 -156
  355. package/src/lib/form-definition-control.js.map +0 -1
  356. package/src/lib/merge-with-column-list.d.ts +0 -3
  357. package/src/lib/merge-with-column-list.js +0 -18
  358. package/src/lib/merge-with-column-list.js.map +0 -1
  359. package/src/schematics/accordion/accordion-component/files/component/__componentName__.component.html.template +0 -94
  360. package/src/schematics/accordion/accordion-component/files/header-component/accordion-header.component.html.template +0 -10
  361. package/src/schematics/data-grid-component/files/form/__componentName__.component.html.template +0 -42
  362. package/src/schematics/data-grid-component/files/plain/__componentName__.component.html.template +0 -25
  363. package/src/schematics/table/table-component/files/component/__componentName__.component.html.template +0 -299
  364. package/src/schematics/table/tree-table-component/files/component/__componentName__.component.html.template +0 -259
@@ -0,0 +1,11 @@
1
+ import { NormalizedTypeImport, TypeImport } from '@rxap/ts-morph';
2
+ import { NormalizedValueOption, ValueOption } from './value-option';
3
+ export interface PipeOption extends TypeImport {
4
+ argumentList?: Array<ValueOption | string>;
5
+ }
6
+ export interface NormalizedPipeOption extends NormalizedTypeImport {
7
+ argumentList: ReadonlyArray<NormalizedValueOption>;
8
+ }
9
+ export declare function NormalizePipeOption(options: Readonly<PipeOption> | string): Readonly<NormalizedPipeOption>;
10
+ export declare function NormalizePipeOptionList(optionList?: Array<Readonly<PipeOption> | string>): ReadonlyArray<NormalizedPipeOption>;
11
+ export declare function PipeOptionToTypeImport(option: NormalizedPipeOption): NormalizedTypeImport;
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PipeOptionToTypeImport = exports.NormalizePipeOptionList = exports.NormalizePipeOption = void 0;
4
+ const ts_morph_1 = require("@rxap/ts-morph");
5
+ const value_option_1 = require("./value-option");
6
+ function guessPipeType(name) {
7
+ switch (name) {
8
+ case 'async':
9
+ return {
10
+ name: 'async',
11
+ namedImport: 'AsyncPipe',
12
+ moduleSpecifier: '@angular/common',
13
+ };
14
+ case 'date':
15
+ return {
16
+ name: 'date',
17
+ namedImport: 'DatePipe',
18
+ moduleSpecifier: '@angular/common',
19
+ };
20
+ case 'json':
21
+ return {
22
+ name: 'json',
23
+ namedImport: 'JsonPipe',
24
+ moduleSpecifier: '@angular/common',
25
+ };
26
+ case 'keyvalue':
27
+ return {
28
+ name: 'keyvalue',
29
+ namedImport: 'KeyValuePipe',
30
+ moduleSpecifier: '@angular/common',
31
+ };
32
+ case 'getFromObject':
33
+ return {
34
+ name: 'getFromObject',
35
+ namedImport: 'GetFromObjectPipe',
36
+ moduleSpecifier: '@rxap/pipes',
37
+ };
38
+ default:
39
+ throw new Error(`Unknown pipe ${name}`);
40
+ }
41
+ }
42
+ function NormalizePipeOption(options) {
43
+ let type;
44
+ let argumentList = typeof options === 'string' ? undefined : options.argumentList;
45
+ if (typeof options === 'string') {
46
+ const [name, ...args] = options.split(':');
47
+ type = guessPipeType(name);
48
+ argumentList = args;
49
+ }
50
+ else if (!options.namedImport) {
51
+ type = guessPipeType(options.name);
52
+ }
53
+ else {
54
+ type = options;
55
+ }
56
+ return Object.freeze(Object.assign(Object.assign({}, (0, ts_morph_1.NormalizeTypeImport)(type)), { argumentList: (0, value_option_1.NormalizeValueOptionList)(argumentList) }));
57
+ }
58
+ exports.NormalizePipeOption = NormalizePipeOption;
59
+ function NormalizePipeOptionList(optionList) {
60
+ var _a;
61
+ return Object.freeze((_a = optionList === null || optionList === void 0 ? void 0 : optionList.map(NormalizePipeOption)) !== null && _a !== void 0 ? _a : []);
62
+ }
63
+ exports.NormalizePipeOptionList = NormalizePipeOptionList;
64
+ function PipeOptionToTypeImport(option) {
65
+ return {
66
+ name: option.name,
67
+ namedImport: option.namedImport,
68
+ moduleSpecifier: option.moduleSpecifier,
69
+ namespaceImport: option.namespaceImport,
70
+ isTypeOnly: option.isTypeOnly,
71
+ defaultImport: option.defaultImport,
72
+ };
73
+ }
74
+ exports.PipeOptionToTypeImport = PipeOptionToTypeImport;
75
+ //# sourceMappingURL=pipe-option.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pipe-option.js","sourceRoot":"","sources":["../../../../../../packages/schematic/angular/src/lib/pipe-option.ts"],"names":[],"mappings":";;;AAAA,6CAIwB;AACxB,iDAIwB;AAWxB,SAAS,aAAa,CAAC,IAAY;IACjC,QAAQ,IAAI,EAAE;QACZ,KAAK,OAAO;YACV,OAAO;gBACL,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,WAAW;gBACxB,eAAe,EAAE,iBAAiB;aACnC,CAAC;QACJ,KAAK,MAAM;YACT,OAAO;gBACL,IAAI,EAAE,MAAM;gBACZ,WAAW,EAAE,UAAU;gBACvB,eAAe,EAAE,iBAAiB;aACnC,CAAC;QACJ,KAAK,MAAM;YACT,OAAO;gBACL,IAAI,EAAE,MAAM;gBACZ,WAAW,EAAE,UAAU;gBACvB,eAAe,EAAE,iBAAiB;aACnC,CAAC;QACJ,KAAK,UAAU;YACb,OAAO;gBACL,IAAI,EAAE,UAAU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EAAE,MAAM,CAAC,IAAI;QACjB,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,eAAe,EAAE,MAAM,CAAC,eAAe;QACvC,eAAe,EAAE,MAAM,CAAC,eAAe;QACvC,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,aAAa,EAAE,MAAM,CAAC,aAAa;KACpC,CAAC;AACJ,CAAC;AATD,wDASC"}
@@ -0,0 +1,13 @@
1
+ import { Rule } from '@angular-devkit/schematics';
2
+ import { NormalizedAngularOptions } from '../angular-options';
3
+ import { NormalizedMinimumTableOptions } from '../minimum-table-options';
4
+ /**
5
+ * Applies table filter column rule.
6
+ *
7
+ * @param {NormalizedMinimumTableOptions & NormalizedAngularOptions & { name: string }} normalizedOptions - The normalized options object.
8
+ * @param {string} [suffix] - The optional suffix string for the file name of the table interface.
9
+ * @returns {Rule} - The rule function.
10
+ */
11
+ export declare function TableFilterColumnRule(normalizedOptions: NormalizedMinimumTableOptions & NormalizedAngularOptions & {
12
+ name: string;
13
+ }, suffix?: string): Rule;
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TableFilterColumnRule = 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 use_pick_from_table_interface_as_form_type_1 = require("../use-pick-from-table-interface-as-form-type");
8
+ /**
9
+ * Applies table filter column rule.
10
+ *
11
+ * @param {NormalizedMinimumTableOptions & NormalizedAngularOptions & { name: string }} normalizedOptions - The normalized options object.
12
+ * @param {string} [suffix] - The optional suffix string for the file name of the table interface.
13
+ * @returns {Rule} - The rule function.
14
+ */
15
+ function TableFilterColumnRule(normalizedOptions, suffix) {
16
+ const { columnList, project, feature, shared, directory, backend, overwrite, componentName, controllerName, nestModule, name, } = normalizedOptions;
17
+ if (columnList.some((c) => c.hasFilter)) {
18
+ return (0, schematics_1.chain)([
19
+ () => console.log(`Coerce the filter form definition`),
20
+ (0, schematics_utilities_1.ExecuteSchematic)('form-definition', {
21
+ name: (0, schematics_utilities_1.CoerceSuffix)(componentName, '-filter'),
22
+ project,
23
+ feature,
24
+ shared,
25
+ directory,
26
+ controllerName,
27
+ nestModule,
28
+ backend,
29
+ overwrite,
30
+ controlList: columnList
31
+ .filter((column) => column.filterControl)
32
+ .map(column => column.filterControl),
33
+ }),
34
+ (0, schematics_ts_morph_1.CoerceComponentRule)({
35
+ project,
36
+ feature,
37
+ shared,
38
+ name: componentName,
39
+ directory,
40
+ overwrite,
41
+ tsMorphTransform: (project, [sourceFile]) => {
42
+ (0, schematics_ts_morph_1.AddComponentProvider)(sourceFile, 'FormProviders', [
43
+ {
44
+ moduleSpecifier: './form.providers',
45
+ namedImports: ['FormProviders'],
46
+ },
47
+ ]);
48
+ (0, schematics_ts_morph_1.AddComponentProvider)(sourceFile, 'TableFilterService', [
49
+ {
50
+ moduleSpecifier: '@rxap/material-table-system',
51
+ namedImports: ['TableFilterService'],
52
+ },
53
+ ]);
54
+ (0, schematics_ts_morph_1.AddComponentProvider)(sourceFile, {
55
+ provide: 'RXAP_TABLE_FILTER_FORM_DEFINITION',
56
+ useFactory: 'FormFactory',
57
+ deps: ['INJECTOR'],
58
+ }, [
59
+ {
60
+ moduleSpecifier: '@angular/core',
61
+ namedImports: ['INJECTOR'],
62
+ },
63
+ {
64
+ moduleSpecifier: './form.providers',
65
+ namedImports: ['FormFactory'],
66
+ },
67
+ {
68
+ moduleSpecifier: '@rxap/material-table-system',
69
+ namedImports: ['RXAP_TABLE_FILTER_FORM_DEFINITION'],
70
+ },
71
+ ]);
72
+ },
73
+ }),
74
+ (0, use_pick_from_table_interface_as_form_type_1.UsePickFromTableInterfaceAsFormTypeRule)({
75
+ name,
76
+ columnList,
77
+ feature,
78
+ project,
79
+ shared,
80
+ directory,
81
+ suffix,
82
+ formName: (0, schematics_utilities_1.CoerceSuffix)(componentName, '-filter'),
83
+ }),
84
+ ]);
85
+ }
86
+ return (0, schematics_1.noop)();
87
+ }
88
+ exports.TableFilterColumnRule = TableFilterColumnRule;
89
+ //# sourceMappingURL=table-filter-column-rule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table-filter-column-rule.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/angular/src/lib/table/table-filter-column-rule.ts"],"names":[],"mappings":";;;AAAA,2DAIoC;AACpC,mEAGmC;AACnC,qEAGoC;AAOpC,8GAAwG;AAExG;;;;;;GAMG;AACH,SAAgB,qBAAqB,CAAC,iBAA8F,EAAE,MAAe;IACnJ,MAAM,EACJ,UAAU,EACV,OAAO,EACP,OAAO,EACP,MAAM,EACN,SAAS,EACT,OAAO,EACP,SAAS,EACT,aAAa,EACb,cAAc,EACd,UAAU,EACV,IAAI,GACL,GAAG,iBAAiB,CAAC;IACtB,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE;QACvC,OAAO,IAAA,kBAAK,EAAC;YACX,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,mCAAmC,CAAC;YACtD,IAAA,uCAAgB,EAAC,iBAAiB,EAAE;gBAClC,IAAI,EAAE,IAAA,mCAAY,EAAC,aAAa,EAAE,SAAS,CAAC;gBAC5C,OAAO;gBACP,OAAO;gBACP,MAAM;gBACN,SAAS;gBACT,cAAc;gBACd,UAAU;gBACV,OAAO;gBACP,SAAS;gBACT,WAAW,EAAE,UAAU;qBACpB,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC;qBACxC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC;aACvC,CAAC;YACF,IAAA,yCAAmB,EAAC;gBAClB,OAAO;gBACP,OAAO;gBACP,MAAM;gBACN,IAAI,EAAE,aAAa;gBACnB,SAAS;gBACT,SAAS;gBACT,gBAAgB,EAAE,CAChB,OAAgB,EAChB,CAAE,UAAU,CAAkB,EAC9B,EAAE;oBACF,IAAA,0CAAoB,EAClB,UAAU,EACV,eAAe,EACf;wBACE;4BACE,eAAe,EAAE,kBAAkB;4BACnC,YAAY,EAAE,CAAE,eAAe,CAAE;yBAClC;qBACF,CACF,CAAC;oBACF,IAAA,0CAAoB,EAClB,UAAU,EACV,oBAAoB,EACpB;wBACE;4BACE,eAAe,EAAE,6BAA6B;4BAC9C,YAAY,EAAE,CAAE,oBAAoB,CAAE;yBACvC;qBACF,CACF,CAAC;oBACF,IAAA,0CAAoB,EAClB,UAAU,EACV;wBACE,OAAO,EAAE,mCAAmC;wBAC5C,UAAU,EAAE,aAAa;wBACzB,IAAI,EAAE,CAAE,UAAU,CAAE;qBACrB,EACD;wBACE;4BACE,eAAe,EAAE,eAAe;4BAChC,YAAY,EAAE,CAAE,UAAU,CAAE;yBAC7B;wBACD;4BACE,eAAe,EAAE,kBAAkB;4BACnC,YAAY,EAAE,CAAE,aAAa,CAAE;yBAChC;wBACD;4BACE,eAAe,EAAE,6BAA6B;4BAC9C,YAAY,EAAE,CAAE,mCAAmC,CAAE;yBACtD;qBACF,CACF,CAAC;gBACJ,CAAC;aACF,CAAC;YACF,IAAA,oFAAuC,EAAC;gBACtC,IAAI;gBACJ,UAAU;gBACV,OAAO;gBACP,OAAO;gBACP,MAAM;gBACN,SAAS;gBACT,MAAM;gBACN,QAAQ,EAAE,IAAA,mCAAY,EAAC,aAAa,EAAE,SAAS,CAAC;aACjD,CAAC;SACH,CAAC,CAAC;KACJ;IAED,OAAO,IAAA,iBAAI,GAAE,CAAC;AAChB,CAAC;AApGD,sDAoGC"}
@@ -1 +1 @@
1
- {"version":3,"file":"table-action.js","sourceRoot":"","sources":["../../../../../../packages/schematic/angular/src/lib/table-action.ts"],"names":[],"mappings":";;;AACA,yDAG4B;AAa5B,SAAgB,oBAAoB,CAClC,WAA2C;;IAE3C,IAAI,IAAY,CAAC;IACjB,IAAI,aAAa,GA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A7FD,oDA6FC;AAED,SAAgB,wBAAwB,CACtC,eAAuD;;IAEvD,OAAO,MAAM,CAAC,MAAM,CAAC,MAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,GAAG,CAAC,oBAAoB,CAAC,mCAAI,EAAE,CAAC,CAAC;AACzE,CAAC;AAJD,4DAIC"}
1
+ {"version":3,"file":"table-action.js","sourceRoot":"","sources":["../../../../../../packages/schematic/angular/src/lib/table-action.ts"],"names":[],"mappings":";;;AAEA,yDAG4B;AAa5B,SAAgB,oBAAoB,CAClC,WAA2C;;IAE3C,IAAI,IAAY,CAAC;IACjB,IAAI,aAAa,GAAuB,SAAS,CAAC;IAClD,IAAI,OAAO,GAAuB,SAAS,CAAC;IAC5C,IAAI,YAAY,GAAuB,SAAS,CAAC;IACjD,IAAI,cAAc,GAAuB,SAAS,CAAC;IACnD,IAAI,OAAO,GAAG,KAAK,CAAC;IACpB,IAAI,OAAO,GAAG,KAAK,CAAC;IACpB,IAAI,QAAQ,GAAuB,SAAS,CAAC;IAC7C,IAAI,IAAI,GAAkB,IAAI,CAAC;IAC/B,IAAI,IAAI,GAAkB,IAAI,CAAC;IAC/B,IAAI,OAAO,GAAkB,IAAI,CAAC;IAClC,IAAI,UAAU,GAAkB,IAAI,CAAC;IACrC,IAAI,QAAQ,GAAG,KAAK,CAAC;IACrB,IAAI,OAAO,GAAwB,EAAE,CAAC;IACtC,IAAI,KAAK,GAAuB,SAAS,CAAC;IAC1C,IAAI,QAAQ,GAAyB,SAAS,CAAC;IAC/C,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE;QACnC,gCAAgC;QAChC,4BAA4B;QAC5B,MAAM,SAAS,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACzC,IAAI,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;QACpB,IAAI,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;QACpB,IAAI,SAAS,CAAC,CAAC,CAAC,EAAE;YAChB,MAAM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AK,GAAG,MAAA,WAAW,CAAC,KAAK,mCAAI,KAAK,CAAC;QACnC,QAAQ,GAAG,MAAA,WAAW,CAAC,QAAQ,mCAAI,QAAQ,CAAC;KAC7C;IACD,OAAO,MAAM,CAAC,MAAM,iCACf,IAAA,0CAAuB,EAAC;QACzB,IAAI;QACJ,aAAa;QACb,OAAO;QACP,YAAY;QACZ,cAAc;QACd,OAAO;QACP,OAAO;QACP,QAAQ;QACR,QAAQ;QACR,OAAO;QACP,KAAK;QACL,QAAQ;KACT,CAAC,KACF,IAAI;QACJ,IAAI;QACJ,OAAO;QACP,UAAU,IACV,CAAC;AACL,CAAC;AA7FD,oDA6FC;AAED,SAAgB,wBAAwB,CACtC,eAAuD;;IAEvD,OAAO,MAAM,CAAC,MAAM,CAAC,MAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,GAAG,CAAC,oBAAoB,CAAC,mCAAI,EAAE,CAAC,CAAC;AACzE,CAAC;AAJD,4DAIC"}
@@ -1,6 +1,10 @@
1
- import { NormalizedTypeImport, TypeImport } from '@rxap/ts-morph';
1
+ import { DataProperty, NormalizedDataProperty, NormalizedTypeImport, TypeImport } from '@rxap/ts-morph';
2
2
  import { Normalized } from '@rxap/utilities';
3
- export type TableColumnPipe = TypeImport;
3
+ import Handlebars from 'handlebars';
4
+ import { CssClass, NormalizedCssClass } from './css-class';
5
+ import { FormControl, NormalizedFormControl } from './form/control/form-control';
6
+ import { PipeOption } from './pipe-option';
7
+ export type TableColumnPipe = PipeOption;
4
8
  export declare enum TableColumnModifier {
5
9
  FILTER = "filter",
6
10
  ACTIVE = "active",
@@ -20,37 +24,66 @@ export declare enum TableColumnKind {
20
24
  ICON = "icon",
21
25
  BOOLEAN = "boolean",
22
26
  COMPONENT = "component",
23
- COPY_TO_CLIPBOARD = "copy-to-clipboard"
27
+ COPY_TO_CLIPBOARD = "copy-to-clipboard",
28
+ TREE = "tree",
29
+ SPINNER = "spinner"
24
30
  }
25
31
  export declare function IsTableColumnKind(value: string): value is TableColumnKind;
26
- export interface TableColumn {
27
- name: string;
28
- type?: string | TypeImport;
32
+ export declare enum TableColumnSticky {
33
+ START = "start",
34
+ END = "end"
35
+ }
36
+ export declare function IsTableColumnSticky(value: string): value is TableColumnSticky;
37
+ export interface TableColumn extends DataProperty {
29
38
  modifiers?: string[];
30
39
  hasFilter?: boolean;
31
40
  withoutTitle?: boolean;
32
41
  title?: string;
33
- propertyPath?: string;
34
42
  hidden?: boolean;
35
43
  active?: boolean;
36
44
  inactive?: boolean;
37
45
  show?: boolean;
38
46
  nowrap?: boolean;
39
- cssClass?: string;
40
- role?: TableColumnKind;
47
+ cssClass?: CssClass;
48
+ headerCssClass?: CssClass;
49
+ filterCssClass?: CssClass;
50
+ kind?: TableColumnKind;
41
51
  template?: string;
42
52
  pipeList?: Array<TableColumnPipe | string>;
43
53
  importList?: TypeImport[];
54
+ filterControl?: FormControl;
55
+ sticky?: boolean | TableColumnSticky;
56
+ synthetic?: boolean;
57
+ sortable?: boolean;
44
58
  }
45
59
  export type NormalizedTableColumnPipe = NormalizedTypeImport;
46
- export interface NormalizedTableColumn extends Omit<Readonly<Normalized<TableColumn>>, 'pipeList' | 'importList'> {
60
+ export interface NormalizedTableColumn extends Readonly<Normalized<Omit<TableColumn, 'pipeList' | 'importList' | 'filterControl'>> & NormalizedDataProperty> {
47
61
  type: NormalizedTypeImport;
48
- propertyPath: string;
49
62
  pipeList: ReadonlyArray<NormalizedTableColumnPipe>;
50
63
  modifiers: TableColumnModifier[];
51
64
  importList: ReadonlyArray<NormalizedTypeImport>;
52
- role: TableColumnKind;
65
+ kind: TableColumnKind;
66
+ handlebars: Handlebars.TemplateDelegate<{
67
+ column: NormalizedTableColumn;
68
+ }>;
69
+ filterControl: NormalizedFormControl | null;
70
+ cssClass: NormalizedCssClass;
71
+ headerCssClass: NormalizedCssClass;
72
+ filterCssClass: NormalizedCssClass;
73
+ sticky: TableColumnSticky | null;
74
+ stickyEnd: boolean;
75
+ stickyStart: boolean;
76
+ /**
77
+ * the column name of the filter column matColumnDef
78
+ */
79
+ filterName: string;
80
+ /**
81
+ * use in the html template to define how the value is accessed from the element variable
82
+ */
83
+ propertyPath: string;
53
84
  }
54
- export declare function NormalizeTableColumnPipe(pipe: string | TableColumnPipe): NormalizedTableColumnPipe;
85
+ export declare function GuessColumnTypeType(kind: TableColumnKind, type?: string | TypeImport): string | TypeImport;
86
+ export declare function TableColumnNameToPropertyPath(name: string): string;
87
+ export declare function TableColumnNameToTitle(name: string): string;
55
88
  export declare function NormalizeTableColumn(column: Readonly<TableColumn>): NormalizedTableColumn;
56
89
  export declare function NormalizeTableColumnList(columnList?: ReadonlyArray<Readonly<TableColumn>>): ReadonlyArray<NormalizedTableColumn>;
@@ -1,9 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NormalizeTableColumnList = exports.NormalizeTableColumn = exports.NormalizeTableColumnPipe = exports.IsTableColumnKind = exports.TableColumnKind = exports.IsTableColumnModifier = exports.TableColumnModifier = void 0;
3
+ exports.NormalizeTableColumnList = exports.NormalizeTableColumn = exports.TableColumnNameToTitle = exports.TableColumnNameToPropertyPath = exports.GuessColumnTypeType = exports.IsTableColumnSticky = exports.TableColumnSticky = exports.IsTableColumnKind = exports.TableColumnKind = exports.IsTableColumnModifier = exports.TableColumnModifier = void 0;
4
+ const schematics_1 = require("@angular-devkit/schematics");
4
5
  const schematics_utilities_1 = require("@rxap/schematics-utilities");
5
6
  const ts_morph_1 = require("@rxap/ts-morph");
6
7
  const utilities_1 = require("@rxap/utilities");
8
+ const path_1 = require("path");
9
+ const css_class_1 = require("./css-class");
10
+ const abstract_control_1 = require("./form/abstract-control");
11
+ const form_control_1 = require("./form/control/form-control");
12
+ const form_control_kind_1 = require("./form/control/form-control-kind");
13
+ const form_field_form_control_1 = require("./form/control/form-field-form-control");
14
+ const input_form_control_1 = require("./form/control/input-form-control");
15
+ const load_handlebars_template_1 = require("./load-handlebars-template");
16
+ const pipe_option_1 = require("./pipe-option");
7
17
  var TableColumnModifier;
8
18
  (function (TableColumnModifier) {
9
19
  TableColumnModifier["FILTER"] = "filter";
@@ -29,49 +39,26 @@ var TableColumnKind;
29
39
  TableColumnKind["BOOLEAN"] = "boolean";
30
40
  TableColumnKind["COMPONENT"] = "component";
31
41
  TableColumnKind["COPY_TO_CLIPBOARD"] = "copy-to-clipboard";
42
+ TableColumnKind["TREE"] = "tree";
43
+ TableColumnKind["SPINNER"] = "spinner";
32
44
  })(TableColumnKind || (exports.TableColumnKind = TableColumnKind = {}));
33
45
  function IsTableColumnKind(value) {
34
46
  return Object.values(TableColumnKind).includes(value);
35
47
  }
36
48
  exports.IsTableColumnKind = IsTableColumnKind;
37
- function NormalizeTableColumnPipe(pipe) {
38
- if (typeof pipe === 'string') {
39
- switch (pipe) {
40
- case 'async':
41
- return (0, ts_morph_1.NormalizeTypeImport)({
42
- name: 'async',
43
- namedImport: 'AsyncPipe',
44
- moduleSpecifier: '@angular/common',
45
- });
46
- case 'date':
47
- return (0, ts_morph_1.NormalizeTypeImport)({
48
- name: 'date',
49
- namedImport: 'DatePipe',
50
- moduleSpecifier: '@angular/common',
51
- });
52
- case 'json':
53
- return (0, ts_morph_1.NormalizeTypeImport)({
54
- name: 'json',
55
- namedImport: 'JsonPipe',
56
- moduleSpecifier: '@angular/common',
57
- });
58
- case 'keyvalue':
59
- return (0, ts_morph_1.NormalizeTypeImport)({
60
- name: 'keyvalue',
61
- namedImport: 'KeyValuePipe',
62
- moduleSpecifier: '@angular/common',
63
- });
64
- default:
65
- throw new Error(`Unknown pipe ${pipe}`);
66
- }
67
- }
68
- return (0, ts_morph_1.NormalizeTypeImport)(pipe);
49
+ var TableColumnSticky;
50
+ (function (TableColumnSticky) {
51
+ TableColumnSticky["START"] = "start";
52
+ TableColumnSticky["END"] = "end";
53
+ })(TableColumnSticky || (exports.TableColumnSticky = TableColumnSticky = {}));
54
+ function IsTableColumnSticky(value) {
55
+ return Object.values(TableColumnSticky).includes(value);
69
56
  }
70
- exports.NormalizeTableColumnPipe = NormalizeTableColumnPipe;
57
+ exports.IsTableColumnSticky = IsTableColumnSticky;
71
58
  function coerceTableColumnImportList(column) {
72
59
  var _a;
73
60
  const importList = (_a = column.importList) !== null && _a !== void 0 ? _a : [];
74
- switch (column.role) {
61
+ switch (column.kind) {
75
62
  case TableColumnKind.COMPONENT:
76
63
  (0, utilities_1.CoerceArrayItems)(importList, [
77
64
  {
@@ -122,7 +109,7 @@ function coerceTableColumnImportList(column) {
122
109
  break;
123
110
  }
124
111
  if (column.hasFilter) {
125
- switch (column.role) {
112
+ switch (column.kind) {
126
113
  case TableColumnKind.BOOLEAN:
127
114
  (0, utilities_1.CoerceArrayItems)(importList, [
128
115
  {
@@ -171,124 +158,164 @@ function coerceTableColumnImportList(column) {
171
158
  }
172
159
  return importList;
173
160
  }
174
- function NormalizeTableColumn(column) {
175
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
176
- let name;
177
- let type = 'unknown';
178
- let modifiers = [];
179
- let hasFilter = false;
180
- let title = null;
181
- let propertyPath = null;
182
- let hidden = false;
183
- let active = false;
184
- let inactive = false;
185
- let show = false;
186
- let nowrap = false;
187
- let withoutTitle = false;
188
- let cssClass = null;
189
- let role = TableColumnKind.DEFAULT;
190
- let template = null;
191
- let pipeList = [];
192
- let importList = [];
193
- name = column.name;
194
- type = (_a = column.type) !== null && _a !== void 0 ? _a : type;
195
- modifiers = (_b = column.modifiers) !== null && _b !== void 0 ? _b : [];
196
- hasFilter = (_c = column.hasFilter) !== null && _c !== void 0 ? _c : false;
197
- title = (_d = column.title) !== null && _d !== void 0 ? _d : title;
198
- propertyPath = (_e = column.propertyPath) !== null && _e !== void 0 ? _e : propertyPath;
199
- hidden = (_f = column.hidden) !== null && _f !== void 0 ? _f : false;
200
- active = (_g = column.active) !== null && _g !== void 0 ? _g : false;
201
- inactive = (_h = column.inactive) !== null && _h !== void 0 ? _h : false;
202
- show = (_j = column.show) !== null && _j !== void 0 ? _j : false;
203
- nowrap = (_k = column.nowrap) !== null && _k !== void 0 ? _k : false;
204
- withoutTitle = (_l = column.withoutTitle) !== null && _l !== void 0 ? _l : false;
205
- cssClass = (_m = column.cssClass) !== null && _m !== void 0 ? _m : cssClass;
206
- role = (_o = column.role) !== null && _o !== void 0 ? _o : role;
207
- template = (_p = column.template) !== null && _p !== void 0 ? _p : template;
208
- pipeList = (_q = column.pipeList) !== null && _q !== void 0 ? _q : pipeList;
209
- importList = coerceTableColumnImportList(column);
210
- const namePrefix = (_s = (_r = name.match(/^(_+)/)) === null || _r === void 0 ? void 0 : _r[1]) !== null && _s !== void 0 ? _s : '';
211
- propertyPath !== null && propertyPath !== void 0 ? propertyPath : (propertyPath = name
212
- .replace(/\?\./g, '.')
213
- .split('.')
214
- .map((part) => (0, schematics_utilities_1.camelize)(part))
215
- .join('?.'));
216
- name = (0, schematics_utilities_1.dasherize)(name.replace(/\??\./g, '_'));
217
- if (namePrefix) {
218
- name = namePrefix + name;
219
- propertyPath = namePrefix + propertyPath;
220
- }
221
- title !== null && title !== void 0 ? title : (title = (0, schematics_utilities_1.dasherize)(name)
222
- .replace(/_/g, '-')
223
- .split('-')
224
- .map((part) => (0, schematics_utilities_1.capitalize)(part))
225
- .join(' '));
226
- hasFilter = modifiers.includes(TableColumnModifier.FILTER) || hasFilter;
227
- active = modifiers.includes(TableColumnModifier.ACTIVE) || active;
228
- inactive = modifiers.includes(TableColumnModifier.INACTIVE) || inactive;
229
- show = modifiers.includes(TableColumnModifier.SHOW) || show;
230
- hidden = modifiers.includes(TableColumnModifier.HIDDEN) || hidden;
231
- nowrap = modifiers.includes(TableColumnModifier.NOWRAP) || nowrap;
232
- withoutTitle = modifiers.includes(TableColumnModifier.WITHOUT_TITLE) || modifiers.includes(TableColumnModifier.NO_TITLE) || withoutTitle;
233
- if (!type || type === 'unknown') {
234
- switch (role) {
235
- case 'date':
161
+ function GuessColumnTypeType(kind, type) {
162
+ const autoType = type ? typeof type === 'string' ? type : type.name : null;
163
+ if (!autoType || autoType === 'unknown') {
164
+ switch (kind) {
165
+ case TableColumnKind.DATE:
236
166
  type = 'number | Date';
237
167
  break;
238
- case 'link':
168
+ case TableColumnKind.LINK:
239
169
  type = 'string';
240
170
  break;
241
- case 'icon':
242
- // TODO : use the IconConfig type
171
+ case TableColumnKind.ICON:
243
172
  type = {
244
173
  name: 'IconConfig',
245
174
  moduleSpecifier: '@rxap/utilities',
246
175
  };
247
176
  break;
248
- case 'boolean':
177
+ case TableColumnKind.BOOLEAN:
249
178
  type = 'boolean';
250
179
  break;
251
180
  }
252
181
  }
253
182
  type !== null && type !== void 0 ? type : (type = 'unknown');
254
- if (nowrap) {
255
- if (!cssClass) {
256
- cssClass = 'nowrap';
183
+ return type;
184
+ }
185
+ exports.GuessColumnTypeType = GuessColumnTypeType;
186
+ function TableColumnNameToPropertyPath(name) {
187
+ var _a, _b;
188
+ const leadingUnderscoreCount = (_b = (_a = name.match(/^_*/)) === null || _a === void 0 ? void 0 : _a[0].length) !== null && _b !== void 0 ? _b : 0;
189
+ const nameWithoutLeadingUnderscores = name.slice(leadingUnderscoreCount);
190
+ const propertyPath = nameWithoutLeadingUnderscores
191
+ .replace(/\?\./g, '.')
192
+ .split('.')
193
+ .map((part) => (0, utilities_1.camelize)(part))
194
+ .join('?.');
195
+ return '_'.repeat(leadingUnderscoreCount) + propertyPath;
196
+ }
197
+ exports.TableColumnNameToPropertyPath = TableColumnNameToPropertyPath;
198
+ function TableColumnNameToTitle(name) {
199
+ return (0, schematics_utilities_1.dasherize)(name)
200
+ .replace(/_/g, '-')
201
+ .split('-')
202
+ .map((part) => (0, schematics_utilities_1.capitalize)(part))
203
+ .join(' ');
204
+ }
205
+ exports.TableColumnNameToTitle = TableColumnNameToTitle;
206
+ function NormalizeTableColumn(column) {
207
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
208
+ if (!column.name) {
209
+ throw new schematics_1.SchematicsException('The column name is required');
210
+ }
211
+ const modifiers = (_a = column.modifiers) !== null && _a !== void 0 ? _a : [];
212
+ const propertyPath = TableColumnNameToPropertyPath(column.name);
213
+ let hasFilter = modifiers.includes(TableColumnModifier.FILTER) || ((_b = column.hasFilter) !== null && _b !== void 0 ? _b : false);
214
+ const title = (_c = column.title) !== null && _c !== void 0 ? _c : TableColumnNameToTitle(column.name);
215
+ const hidden = modifiers.includes(TableColumnModifier.HIDDEN) || ((_d = column.hidden) !== null && _d !== void 0 ? _d : false);
216
+ const active = modifiers.includes(TableColumnModifier.ACTIVE) || ((_e = column.active) !== null && _e !== void 0 ? _e : false);
217
+ const inactive = modifiers.includes(TableColumnModifier.INACTIVE) || ((_f = column.inactive) !== null && _f !== void 0 ? _f : false);
218
+ const show = modifiers.includes(TableColumnModifier.SHOW) || ((_g = column.show) !== null && _g !== void 0 ? _g : false);
219
+ const nowrap = modifiers.includes(TableColumnModifier.NOWRAP) || ((_h = column.nowrap) !== null && _h !== void 0 ? _h : false);
220
+ const withoutTitle = modifiers.includes(TableColumnModifier.WITHOUT_TITLE) || modifiers.includes(TableColumnModifier.NO_TITLE) || ((_j = column.withoutTitle) !== null && _j !== void 0 ? _j : false);
221
+ let cssClass = (_k = column.cssClass) !== null && _k !== void 0 ? _k : null;
222
+ let headerCssClass = (_l = column.headerCssClass) !== null && _l !== void 0 ? _l : null;
223
+ let filterCssClass = (_m = column.filterCssClass) !== null && _m !== void 0 ? _m : null;
224
+ const kind = (_o = column.kind) !== null && _o !== void 0 ? _o : TableColumnKind.DEFAULT;
225
+ const template = (_p = column.template) !== null && _p !== void 0 ? _p : kind + '-table-column.hbs';
226
+ const pipeList = (_q = column.pipeList) !== null && _q !== void 0 ? _q : [];
227
+ const importList = coerceTableColumnImportList(column);
228
+ const type = GuessColumnTypeType(kind, column.type);
229
+ const source = (_r = column.source) !== null && _r !== void 0 ? _r : undefined;
230
+ let sticky = null;
231
+ let stickyStart = false;
232
+ let stickyEnd = false;
233
+ const dataProperty = (0, ts_morph_1.NormalizeDataProperty)(Object.assign(Object.assign({}, column), { type,
234
+ source }));
235
+ const { name } = dataProperty;
236
+ if (column.sticky) {
237
+ if (typeof column.sticky !== 'string' || !IsTableColumnSticky(column.sticky)) {
238
+ sticky = TableColumnSticky.START;
257
239
  }
258
240
  else {
259
- cssClass += ' nowrap';
241
+ sticky = column.sticky;
242
+ }
243
+ if (sticky === TableColumnSticky.START) {
244
+ stickyStart = true;
245
+ }
246
+ if (sticky === TableColumnSticky.END) {
247
+ stickyEnd = true;
260
248
  }
261
249
  }
250
+ if (sticky || stickyEnd || stickyStart) {
251
+ cssClass = (0, css_class_1.CoerceCssClass)(cssClass, 'drop-shadow-2xl');
252
+ headerCssClass = (0, css_class_1.CoerceCssClass)(headerCssClass, 'drop-shadow-2xl');
253
+ filterCssClass = (0, css_class_1.CoerceCssClass)(filterCssClass, 'drop-shadow-2xl');
254
+ }
255
+ if (nowrap) {
256
+ cssClass = (0, css_class_1.CoerceCssClass)(cssClass, 'nowrap');
257
+ }
262
258
  if (!modifiers.every(IsTableColumnModifier)) {
263
259
  throw new Error(`Unknown modifier in column ${name} - [ ${modifiers.join(', ')} ]`);
264
260
  }
265
- if (!IsTableColumnKind(role)) {
266
- throw new Error(`Unknown role in column ${name} - ${role}`);
261
+ if (!IsTableColumnKind(kind)) {
262
+ throw new Error(`Unknown kind in column ${name} - ${kind}`);
263
+ }
264
+ let filterControl = (_s = column.filterControl) !== null && _s !== void 0 ? _s : null;
265
+ if (Object.keys(filterControl !== null && filterControl !== void 0 ? filterControl : {}).length === 0) {
266
+ filterControl = null;
267
267
  }
268
- return Object.freeze({
269
- role,
270
- name,
271
- type: (0, ts_morph_1.NormalizeTypeImport)(type),
268
+ if (hasFilter && !filterControl) {
269
+ filterControl = { name: column.name, kind: form_control_kind_1.FormControlKinds.DEFAULT, role: abstract_control_1.AbstractControlRolls.CONTROL };
270
+ }
271
+ if (filterControl && !hasFilter) {
272
+ hasFilter = true;
273
+ }
274
+ if (filterControl) {
275
+ (_t = filterControl.label) !== null && _t !== void 0 ? _t : (filterControl.label = title);
276
+ (_u = filterControl.name) !== null && _u !== void 0 ? _u : (filterControl.name = name);
277
+ if (!filterControl.type || filterControl.type === 'unknown' || (typeof filterControl.type === 'object' && filterControl.type.name === 'unknown')) {
278
+ filterControl.type = type !== null && type !== void 0 ? type : 'unknown';
279
+ }
280
+ if ((0, input_form_control_1.IsInputFormControlOptions)(filterControl)) {
281
+ (_v = filterControl.placeholder) !== null && _v !== void 0 ? _v : (filterControl.placeholder = 'Enter filter');
282
+ }
283
+ if ((0, form_field_form_control_1.IsFormFieldFormControl)(filterControl)) {
284
+ (_w = filterControl.formField) !== null && _w !== void 0 ? _w : (filterControl.formField = {});
285
+ filterControl.formField.cssClass = (0, css_class_1.CoerceCssClass)(filterControl.formField.cssClass, 'w-full');
286
+ }
287
+ }
288
+ const normalizedFilterControl = filterControl ? (0, form_control_1.NormalizeFormControl)(filterControl) : null;
289
+ if (normalizedFilterControl) {
290
+ (0, utilities_1.CoerceArrayItems)(importList, normalizedFilterControl.importList, (a, b) => a.name === b.name);
291
+ }
292
+ return Object.freeze(Object.assign(Object.assign({}, dataProperty), { synthetic: (_x = column.synthetic) !== null && _x !== void 0 ? _x : false, filterName: `filter_${name}`, propertyPath,
293
+ sticky,
294
+ stickyStart,
295
+ stickyEnd,
296
+ kind,
272
297
  modifiers,
273
298
  hasFilter,
274
299
  title,
275
- propertyPath,
276
300
  hidden,
277
301
  active,
278
302
  inactive,
279
303
  show,
280
304
  nowrap,
281
- withoutTitle,
282
- cssClass,
283
- pipeList: pipeList.map(NormalizeTableColumnPipe),
284
- template,
285
- importList: importList.map(ts_morph_1.NormalizeTypeImport),
286
- });
305
+ withoutTitle, cssClass: (0, css_class_1.NormalizeCssClass)(cssClass), headerCssClass: (0, css_class_1.NormalizeCssClass)(headerCssClass), filterCssClass: (0, css_class_1.NormalizeCssClass)(filterCssClass), pipeList: (0, pipe_option_1.NormalizePipeOptionList)(pipeList), template, importList: (0, ts_morph_1.NormalizeTypeImportList)(importList), handlebars: (0, load_handlebars_template_1.LoadHandlebarsTemplate)(template, (0, path_1.join)(__dirname, '..', 'schematics', 'table', 'templates')), filterControl: normalizedFilterControl, sortable: (_y = column.sortable) !== null && _y !== void 0 ? _y : false }));
287
306
  }
288
307
  exports.NormalizeTableColumn = NormalizeTableColumn;
289
308
  function NormalizeTableColumnList(columnList) {
290
309
  var _a;
291
- return Object.freeze((_a = columnList === null || columnList === void 0 ? void 0 : columnList.map(NormalizeTableColumn)) !== null && _a !== void 0 ? _a : []);
310
+ return Object.freeze(((_a = columnList === null || columnList === void 0 ? void 0 : columnList.map(NormalizeTableColumn)) !== null && _a !== void 0 ? _a : []).sort((a, b) => {
311
+ if (a.stickyStart) {
312
+ return b.stickyStart ? 0 : -1;
313
+ }
314
+ if (a.stickyEnd) {
315
+ return b.stickyEnd ? 0 : 1;
316
+ }
317
+ return 0;
318
+ }));
292
319
  }
293
320
  exports.NormalizeTableColumnList = NormalizeTableColumnList;
294
321
  //# sourceMappingURL=table-column.js.map