@sankhyalabs/ezui 5.21.0-dev.2 → 5.21.0-dev.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (283) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/ICustomRender-6fafffce.js +13 -0
  3. package/dist/cjs/ez-actions-button.cjs.entry.js +2 -1
  4. package/dist/cjs/ez-alert-list.cjs.entry.js +7 -5
  5. package/dist/cjs/ez-alert.cjs.entry.js +1 -1
  6. package/dist/cjs/ez-application.cjs.entry.js +1 -1
  7. package/dist/cjs/ez-badge.cjs.entry.js +1 -1
  8. package/dist/cjs/ez-breadcrumb.cjs.entry.js +1 -1
  9. package/dist/cjs/ez-button.cjs.entry.js +3 -3
  10. package/dist/cjs/ez-calendar.cjs.entry.js +1 -1
  11. package/dist/cjs/ez-card-item_3.cjs.entry.js +1 -1
  12. package/dist/cjs/ez-chart.cjs.entry.js +433 -0
  13. package/dist/cjs/ez-check.cjs.entry.js +1 -1
  14. package/dist/cjs/ez-chip.cjs.entry.js +1 -1
  15. package/dist/cjs/ez-collapsible-box.cjs.entry.js +2 -1
  16. package/dist/cjs/ez-combo-box.cjs.entry.js +2 -1
  17. package/dist/cjs/{ez-text-edit.cjs.entry.js → ez-custom-form-input_2.cjs.entry.js} +95 -1
  18. package/dist/cjs/ez-date-input.cjs.entry.js +1 -1
  19. package/dist/cjs/ez-date-time-input.cjs.entry.js +1 -1
  20. package/dist/cjs/ez-dialog.cjs.entry.js +1 -1
  21. package/dist/cjs/ez-dropdown.cjs.entry.js +1 -1
  22. package/dist/cjs/ez-file-item.cjs.entry.js +1 -1
  23. package/dist/cjs/ez-form-view.cjs.entry.js +34 -4
  24. package/dist/cjs/ez-form.cjs.entry.js +78 -3
  25. package/dist/cjs/ez-grid.cjs.entry.js +333 -33
  26. package/dist/cjs/ez-guide-navigator.cjs.entry.js +1 -1
  27. package/dist/cjs/ez-icon.cjs.entry.js +1 -1
  28. package/dist/cjs/ez-list.cjs.entry.js +2 -2
  29. package/dist/cjs/ez-loading-bar.cjs.entry.js +1 -1
  30. package/dist/cjs/ez-modal-container.cjs.entry.js +16 -5
  31. package/dist/cjs/ez-modal.cjs.entry.js +8 -9
  32. package/dist/cjs/ez-multi-selection-list.cjs.entry.js +1 -1
  33. package/dist/cjs/ez-number-input.cjs.entry.js +35 -29
  34. package/dist/cjs/ez-popover.cjs.entry.js +1 -1
  35. package/dist/cjs/ez-popup.cjs.entry.js +15 -9
  36. package/dist/cjs/ez-radio-button.cjs.entry.js +1 -1
  37. package/dist/cjs/ez-scroller_3.cjs.entry.js +1 -1
  38. package/dist/cjs/ez-search.cjs.entry.js +18 -6
  39. package/dist/cjs/ez-skeleton.cjs.entry.js +1 -1
  40. package/dist/cjs/ez-split-button.cjs.entry.js +1 -1
  41. package/dist/cjs/ez-split-item.cjs.entry.js +2 -1
  42. package/dist/cjs/ez-split-panel.cjs.entry.js +2 -2
  43. package/dist/cjs/ez-tabselector.cjs.entry.js +1 -1
  44. package/dist/cjs/ez-text-area.cjs.entry.js +1 -1
  45. package/dist/cjs/ez-text-input.cjs.entry.js +1 -1
  46. package/dist/cjs/ez-time-input.cjs.entry.js +1 -1
  47. package/dist/cjs/ez-toast.cjs.entry.js +1 -1
  48. package/dist/cjs/ez-upload.cjs.entry.js +1 -1
  49. package/dist/cjs/ez-view-stack.cjs.entry.js +1 -1
  50. package/dist/cjs/ezui.cjs.js +2 -2
  51. package/dist/cjs/filter-column.cjs.entry.js +1 -1
  52. package/dist/cjs/{index-a7b0c73d.js → index-9e5554cb.js} +11 -4
  53. package/dist/cjs/loader.cjs.js +2 -2
  54. package/dist/collection/collection-manifest.json +2 -0
  55. package/dist/collection/components/ez-alert-list/ez-alert-list.js +6 -4
  56. package/dist/collection/components/ez-button/ez-button.css +7 -0
  57. package/dist/collection/components/ez-button/ez-button.js +1 -1
  58. package/dist/collection/components/ez-chart/components/BarChart.js +27 -0
  59. package/dist/collection/components/ez-chart/components/ColumnChart.js +27 -0
  60. package/dist/collection/components/ez-chart/components/DonutChart.js +42 -0
  61. package/dist/collection/components/ez-chart/components/LineChart.js +27 -0
  62. package/dist/collection/components/ez-chart/components/PieChart.js +45 -0
  63. package/dist/collection/components/ez-chart/components/index.js +5 -0
  64. package/dist/collection/components/ez-chart/ez-chart.css +5 -0
  65. package/dist/collection/components/ez-chart/ez-chart.js +284 -0
  66. package/dist/collection/components/ez-chart/interfaces/ChartAxis.js +1 -0
  67. package/dist/collection/components/ez-chart/interfaces/ChartContext.js +14 -0
  68. package/dist/collection/components/ez-chart/interfaces/ChartOptions.js +1 -0
  69. package/dist/collection/components/ez-chart/interfaces/ChartSerie.js +1 -0
  70. package/dist/collection/components/ez-chart/interfaces/ChartStrategies.js +1 -0
  71. package/dist/collection/components/ez-chart/interfaces/ChartType.js +8 -0
  72. package/dist/collection/components/ez-chart/interfaces/index.js +5 -0
  73. package/dist/collection/components/ez-chart/test/mock-chart.js +137 -0
  74. package/dist/collection/components/ez-chart/types/BaseHighChartsRender.js +146 -0
  75. package/dist/collection/components/ez-form/ez-form.js +130 -4
  76. package/dist/collection/components/ez-form-view/custom-input/ez-custom-form-input.js +253 -0
  77. package/dist/collection/components/ez-form-view/ez-form-view.js +89 -1
  78. package/dist/collection/components/ez-form-view/fieldbuilder/templates/NumberInput.tpl.js +3 -2
  79. package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +56 -5
  80. package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +1 -0
  81. package/dist/collection/components/ez-grid/controller/ag-grid/GridEditionManager.js +35 -1
  82. package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.js +58 -0
  83. package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomCellRender.js +40 -0
  84. package/dist/collection/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellEditorConstants.js +11 -0
  85. package/dist/collection/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellRenderConstants.js +11 -0
  86. package/dist/collection/components/ez-grid/controller/ag-grid/editor/EzCellEditor.js +6 -3
  87. package/dist/collection/components/ez-grid/controller/ag-grid/editor/EzCellRender.js +40 -0
  88. package/dist/collection/components/ez-grid/controller/ag-grid/editor/IUICellRender.js +1 -0
  89. package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/NumberInput.tpl.js +3 -2
  90. package/dist/collection/components/ez-grid/ez-grid.css +1 -0
  91. package/dist/collection/components/ez-grid/ez-grid.js +233 -11
  92. package/dist/collection/components/ez-grid/interfaces/ICustomFormatter.js +1 -0
  93. package/dist/collection/components/ez-grid/interfaces/index.js +1 -0
  94. package/dist/collection/components/ez-grid/subcomponents/selection-counter.js +3 -11
  95. package/dist/collection/components/ez-grid/subcomponents/utils/selectionCounterUtils.js +22 -0
  96. package/dist/collection/components/ez-grid/test/resources/gridDataUnit.js +19 -0
  97. package/dist/collection/components/ez-list/ez-list.css +6 -2
  98. package/dist/collection/components/ez-modal/ez-modal.js +22 -9
  99. package/dist/collection/components/ez-modal-container/ez-modal-container.css +4 -0
  100. package/dist/collection/components/ez-modal-container/ez-modal-container.js +23 -3
  101. package/dist/collection/components/ez-number-input/ez-number-input.js +42 -27
  102. package/dist/collection/components/ez-popup/ez-popup.js +14 -8
  103. package/dist/collection/components/ez-search/ez-search.js +16 -5
  104. package/dist/collection/components/ez-split-panel/ez-split-panel.css +1 -0
  105. package/dist/collection/utils/customEditor/interfaces/ICustomEditor.js +5 -0
  106. package/dist/collection/utils/customEditor/interfaces/ICustomEditorInfo.js +1 -0
  107. package/dist/collection/utils/customRender/interfaces/ICustomRender.js +5 -0
  108. package/dist/collection/utils/customRender/interfaces/ICustomRenderInfo.js +1 -0
  109. package/dist/collection/utils/form/DataBinder.js +26 -0
  110. package/dist/collection/utils/form/test/DataBinder.test.js +41 -4
  111. package/dist/collection/utils/form/test/resources/metadataTest.js +15 -0
  112. package/dist/collection/utils/index.js +2 -0
  113. package/dist/custom-elements/index.d.ts +12 -0
  114. package/dist/custom-elements/index.js +1081 -105
  115. package/dist/esm/ICustomRender-875b5a40.js +13 -0
  116. package/dist/esm/ez-actions-button.entry.js +2 -1
  117. package/dist/esm/ez-alert-list.entry.js +7 -5
  118. package/dist/esm/ez-alert.entry.js +1 -1
  119. package/dist/esm/ez-application.entry.js +1 -1
  120. package/dist/esm/ez-badge.entry.js +1 -1
  121. package/dist/esm/ez-breadcrumb.entry.js +1 -1
  122. package/dist/esm/ez-button.entry.js +3 -3
  123. package/dist/esm/ez-calendar.entry.js +1 -1
  124. package/dist/esm/ez-card-item_3.entry.js +1 -1
  125. package/dist/esm/ez-chart.entry.js +429 -0
  126. package/dist/esm/ez-check.entry.js +1 -1
  127. package/dist/esm/ez-chip.entry.js +1 -1
  128. package/dist/esm/ez-collapsible-box.entry.js +2 -1
  129. package/dist/esm/ez-combo-box.entry.js +2 -1
  130. package/dist/esm/{ez-text-edit.entry.js → ez-custom-form-input_2.entry.js} +96 -3
  131. package/dist/esm/ez-date-input.entry.js +1 -1
  132. package/dist/esm/ez-date-time-input.entry.js +1 -1
  133. package/dist/esm/ez-dialog.entry.js +1 -1
  134. package/dist/esm/ez-dropdown.entry.js +1 -1
  135. package/dist/esm/ez-file-item.entry.js +1 -1
  136. package/dist/esm/ez-form-view.entry.js +34 -4
  137. package/dist/esm/ez-form.entry.js +79 -4
  138. package/dist/esm/ez-grid.entry.js +333 -33
  139. package/dist/esm/ez-guide-navigator.entry.js +1 -1
  140. package/dist/esm/ez-icon.entry.js +1 -1
  141. package/dist/esm/ez-list.entry.js +2 -2
  142. package/dist/esm/ez-loading-bar.entry.js +1 -1
  143. package/dist/esm/ez-modal-container.entry.js +16 -5
  144. package/dist/esm/ez-modal.entry.js +9 -10
  145. package/dist/esm/ez-multi-selection-list.entry.js +1 -1
  146. package/dist/esm/ez-number-input.entry.js +35 -29
  147. package/dist/esm/ez-popover.entry.js +1 -1
  148. package/dist/esm/ez-popup.entry.js +15 -9
  149. package/dist/esm/ez-radio-button.entry.js +1 -1
  150. package/dist/esm/ez-scroller_3.entry.js +1 -1
  151. package/dist/esm/ez-search.entry.js +18 -6
  152. package/dist/esm/ez-skeleton.entry.js +1 -1
  153. package/dist/esm/ez-split-button.entry.js +1 -1
  154. package/dist/esm/ez-split-item.entry.js +2 -1
  155. package/dist/esm/ez-split-panel.entry.js +2 -2
  156. package/dist/esm/ez-tabselector.entry.js +1 -1
  157. package/dist/esm/ez-text-area.entry.js +1 -1
  158. package/dist/esm/ez-text-input.entry.js +1 -1
  159. package/dist/esm/ez-time-input.entry.js +1 -1
  160. package/dist/esm/ez-toast.entry.js +1 -1
  161. package/dist/esm/ez-upload.entry.js +1 -1
  162. package/dist/esm/ez-view-stack.entry.js +1 -1
  163. package/dist/esm/ezui.js +3 -3
  164. package/dist/esm/filter-column.entry.js +1 -1
  165. package/dist/esm/{index-baa5e267.js → index-5a720e56.js} +11 -5
  166. package/dist/esm/loader.js +3 -3
  167. package/dist/ezui/ezui.esm.js +1 -1
  168. package/dist/ezui/{p-44caad9a.entry.js → p-0378416a.entry.js} +1 -1
  169. package/dist/ezui/p-085babb4.entry.js +1 -0
  170. package/dist/ezui/{p-91f626d3.entry.js → p-0e551dd4.entry.js} +1 -1
  171. package/dist/ezui/{p-af2ecb1b.entry.js → p-11b09aa1.entry.js} +1 -1
  172. package/dist/ezui/{p-77a4bd35.entry.js → p-11bfeca3.entry.js} +1 -1
  173. package/dist/ezui/p-23a796cc.entry.js +1 -0
  174. package/dist/ezui/{p-af95cd16.entry.js → p-24ca32a3.entry.js} +1 -1
  175. package/dist/ezui/{p-cc2dc4f4.entry.js → p-2a6e44a0.entry.js} +1 -1
  176. package/dist/ezui/p-2af4e2de.entry.js +1 -0
  177. package/dist/ezui/{p-baf80b13.entry.js → p-30951bd7.entry.js} +1 -1
  178. package/dist/ezui/p-31674f8e.entry.js +1 -0
  179. package/dist/ezui/{p-bf79aaa1.entry.js → p-33792b2b.entry.js} +1 -1
  180. package/dist/ezui/{p-b44741b0.entry.js → p-355c20f5.entry.js} +2 -2
  181. package/dist/ezui/{p-e85c48d7.entry.js → p-36180f4d.entry.js} +1 -1
  182. package/dist/ezui/{p-7bc07c31.entry.js → p-3f8c33e0.entry.js} +1 -1
  183. package/dist/ezui/p-4559c266.entry.js +1 -0
  184. package/dist/ezui/p-4607fb89.js +1 -0
  185. package/dist/ezui/p-507ec8ed.entry.js +1 -0
  186. package/dist/ezui/{p-8defa6d3.entry.js → p-51e4c040.entry.js} +1 -1
  187. package/dist/ezui/p-569a0b9a.entry.js +1 -0
  188. package/dist/ezui/{p-1f50fa05.entry.js → p-6b51c9cc.entry.js} +1 -1
  189. package/dist/ezui/p-6ec40dec.entry.js +1 -0
  190. package/dist/ezui/{p-5ed81457.entry.js → p-6fc26622.entry.js} +1 -1
  191. package/dist/ezui/{p-555c9018.entry.js → p-7567ccdd.entry.js} +1 -1
  192. package/dist/ezui/{p-1e7a8633.entry.js → p-81461d2f.entry.js} +1 -1
  193. package/dist/ezui/{p-072e6347.entry.js → p-82ac8b06.entry.js} +1 -1
  194. package/dist/ezui/{p-8df1ca33.entry.js → p-82fa4b09.entry.js} +1 -1
  195. package/dist/ezui/p-868b56f7.entry.js +1 -0
  196. package/dist/ezui/{p-85c8baae.entry.js → p-8eef0f70.entry.js} +1 -1
  197. package/dist/ezui/p-91ccae0c.entry.js +1 -0
  198. package/dist/ezui/{p-3faa2b46.entry.js → p-9634631d.entry.js} +1 -1
  199. package/dist/ezui/p-9a11e223.entry.js +1 -0
  200. package/dist/ezui/{p-7af81663.entry.js → p-9a23d513.entry.js} +1 -1
  201. package/dist/ezui/p-9aa27e69.entry.js +1 -0
  202. package/dist/ezui/{p-784fe207.entry.js → p-9c2e2d68.entry.js} +1 -1
  203. package/dist/ezui/{p-9050d2cd.entry.js → p-b0e71d23.entry.js} +1 -1
  204. package/dist/ezui/{p-17be134a.entry.js → p-b2f6bc0a.entry.js} +1 -1
  205. package/dist/ezui/{p-9f5fa3f9.entry.js → p-c2b20f78.entry.js} +1 -1
  206. package/dist/ezui/{p-5bd5e68f.entry.js → p-c3b7a23e.entry.js} +1 -1
  207. package/dist/ezui/p-cd1a2e6b.entry.js +1 -0
  208. package/dist/ezui/p-d62ff380.entry.js +1 -0
  209. package/dist/ezui/{p-bae4e180.entry.js → p-dbeee5aa.entry.js} +1 -1
  210. package/dist/ezui/{p-a80b1287.entry.js → p-dfca5946.entry.js} +1 -1
  211. package/dist/ezui/p-e151e795.entry.js +1 -0
  212. package/dist/ezui/{p-23a36bb6.js → p-e4c7eb39.js} +2 -2
  213. package/dist/ezui/{p-0306dff7.entry.js → p-e6b38ade.entry.js} +1 -1
  214. package/dist/ezui/{p-650e4b6d.entry.js → p-f1c2c19e.entry.js} +1 -1
  215. package/dist/ezui/p-f1c3f85d.entry.js +1 -0
  216. package/dist/ezui/{p-49456b34.entry.js → p-f291db18.entry.js} +1 -1
  217. package/dist/ezui/{p-6e429cff.entry.js → p-fc194825.entry.js} +1 -1
  218. package/dist/types/components/ez-alert-list/ez-alert-list.d.ts +2 -2
  219. package/dist/types/components/ez-chart/components/BarChart.d.ts +9 -0
  220. package/dist/types/components/ez-chart/components/ColumnChart.d.ts +9 -0
  221. package/dist/types/components/ez-chart/components/DonutChart.d.ts +9 -0
  222. package/dist/types/components/ez-chart/components/LineChart.d.ts +9 -0
  223. package/dist/types/components/ez-chart/components/PieChart.d.ts +9 -0
  224. package/dist/types/components/ez-chart/components/index.d.ts +5 -0
  225. package/dist/types/components/ez-chart/ez-chart.d.ts +58 -0
  226. package/dist/types/components/ez-chart/interfaces/ChartAxis.d.ts +7 -0
  227. package/dist/types/components/ez-chart/interfaces/ChartContext.d.ts +11 -0
  228. package/dist/types/components/ez-chart/interfaces/ChartOptions.d.ts +10 -0
  229. package/dist/types/components/ez-chart/interfaces/ChartSerie.d.ts +20 -0
  230. package/dist/types/components/ez-chart/interfaces/ChartStrategies.d.ts +7 -0
  231. package/dist/types/components/ez-chart/interfaces/ChartType.d.ts +7 -0
  232. package/dist/types/components/ez-chart/interfaces/index.d.ts +5 -0
  233. package/dist/types/components/ez-chart/types/BaseHighChartsRender.d.ts +15 -0
  234. package/dist/types/components/ez-form/ez-form.d.ts +20 -1
  235. package/dist/types/components/ez-form-view/custom-input/ez-custom-form-input.d.ts +43 -0
  236. package/dist/types/components/ez-form-view/ez-form-view.d.ts +11 -0
  237. package/dist/types/components/ez-grid/controller/EzGridController.d.ts +30 -0
  238. package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +13 -0
  239. package/dist/types/components/ez-grid/controller/ag-grid/GridEditionManager.d.ts +7 -1
  240. package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.d.ts +19 -0
  241. package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellRender.d.ts +14 -0
  242. package/dist/types/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellEditorConstants.d.ts +11 -0
  243. package/dist/types/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellRenderConstants.d.ts +11 -0
  244. package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellEditor.d.ts +3 -0
  245. package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellRender.d.ts +15 -0
  246. package/dist/types/components/ez-grid/controller/ag-grid/editor/IUICellRender.d.ts +10 -0
  247. package/dist/types/components/ez-grid/ez-grid.d.ts +34 -1
  248. package/dist/types/components/ez-grid/interfaces/ICustomFormatter.d.ts +5 -0
  249. package/dist/types/components/ez-grid/interfaces/index.d.ts +1 -0
  250. package/dist/types/components/ez-grid/subcomponents/utils/selectionCounterUtils.d.ts +4 -0
  251. package/dist/types/components/ez-grid/test/resources/gridDataUnit.d.ts +2 -0
  252. package/dist/types/components/ez-modal/ez-modal.d.ts +9 -1
  253. package/dist/types/components/ez-modal-container/ez-modal-container.d.ts +3 -0
  254. package/dist/types/components/ez-number-input/ez-number-input.d.ts +3 -0
  255. package/dist/types/components/ez-popup/ez-popup.d.ts +3 -3
  256. package/dist/types/components/ez-search/ez-search.d.ts +2 -1
  257. package/dist/types/components.d.ts +223 -4
  258. package/dist/types/utils/customEditor/interfaces/ICustomEditor.d.ts +29 -0
  259. package/dist/types/utils/customEditor/interfaces/ICustomEditorInfo.d.ts +5 -0
  260. package/dist/types/utils/customRender/interfaces/ICustomRender.d.ts +29 -0
  261. package/dist/types/utils/customRender/interfaces/ICustomRenderInfo.d.ts +5 -0
  262. package/dist/types/utils/form/DataBinder.d.ts +3 -0
  263. package/dist/types/utils/form/test/resources/metadataTest.d.ts +2 -0
  264. package/dist/types/utils/index.d.ts +2 -0
  265. package/package.json +2 -1
  266. package/react/components.d.ts +2 -0
  267. package/react/components.js +2 -0
  268. package/react/components.js.map +1 -1
  269. package/dist/ezui/p-0447d17c.entry.js +0 -1
  270. package/dist/ezui/p-20ec22c0.entry.js +0 -1
  271. package/dist/ezui/p-2a1a0e04.entry.js +0 -1
  272. package/dist/ezui/p-5e1d036e.entry.js +0 -1
  273. package/dist/ezui/p-5ef056ce.entry.js +0 -1
  274. package/dist/ezui/p-637f69f2.entry.js +0 -1
  275. package/dist/ezui/p-701231f0.entry.js +0 -1
  276. package/dist/ezui/p-99ead599.entry.js +0 -1
  277. package/dist/ezui/p-9aefaa52.entry.js +0 -1
  278. package/dist/ezui/p-a1ec32ef.entry.js +0 -1
  279. package/dist/ezui/p-b041333c.entry.js +0 -1
  280. package/dist/ezui/p-b567fa8c.entry.js +0 -1
  281. package/dist/ezui/p-bae3d0aa.entry.js +0 -1
  282. package/dist/ezui/p-bc2f844e.entry.js +0 -1
  283. package/dist/ezui/p-db77a984.entry.js +0 -1
@@ -1,20 +1,23 @@
1
1
  import { Action, DataUnit, ElementIDUtils, StringUtils } from "@sankhyalabs/core";
2
2
  import { Host, forceUpdate, h } from "@stencil/core";
3
3
  import { createStore } from "redux";
4
- import { changeTab, formReducer, loadMetadata, selectCurrentSheet, selectFormMetadata } from "./store/form.slice";
5
- import { buildFormMetadata } from "../../utils/form/FormMetadata";
6
4
  import DataBinder from "../../utils/form/DataBinder";
5
+ import { buildFormMetadata } from "../../utils/form/FormMetadata";
6
+ import { changeTab, formReducer, loadMetadata, selectCurrentSheet, selectFormMetadata } from "./store/form.slice";
7
7
  export class EzForm {
8
8
  constructor() {
9
+ this._customEditors = new Map();
9
10
  this.onDataUnitAction = (action) => {
10
11
  if (action.type === Action.METADATA_LOADED) {
11
12
  this.processMetadata();
12
13
  }
13
14
  };
15
+ this._fieldsProps = new Map();
14
16
  this.dataUnit = undefined;
15
17
  this.config = undefined;
16
18
  this.recordsValidator = undefined;
17
19
  this.fieldToFocus = undefined;
20
+ this.onlyStaticFields = false;
18
21
  }
19
22
  /**
20
23
  * Realiza validação no conteúdo de todos os campos.
@@ -22,9 +25,30 @@ export class EzForm {
22
25
  validate() {
23
26
  return this._dataBinder.validate();
24
27
  }
28
+ /**
29
+ * Registra um editor customizado para campos da grade e formulário.
30
+ */
31
+ async addCustomEditor(fieldName, customEditor, detailContext) {
32
+ if (this._formView) {
33
+ this._formView.addCustomEditor(fieldName, customEditor, detailContext);
34
+ return;
35
+ }
36
+ const newCustomEditors = new Map(this._customEditors);
37
+ newCustomEditors.set(fieldName, { customEditor, detailContext });
38
+ this._customEditors = newCustomEditors;
39
+ }
25
40
  observeConfig() {
26
41
  this.processMetadata();
27
42
  }
43
+ /**
44
+ * Altera/adiciona uma propriedade nos metadados do campo.
45
+ */
46
+ async setFieldProp(fieldName, propName, value) {
47
+ const newCustomFieldProps = new Map(this._fieldsProps);
48
+ const currentProps = this._fieldsProps.get(fieldName);
49
+ newCustomFieldProps.set(fieldName, Object.assign(Object.assign({}, currentProps), { [propName]: value }));
50
+ this._fieldsProps = newCustomFieldProps;
51
+ }
28
52
  getDynamicContent() {
29
53
  var _a;
30
54
  const formMD = selectFormMetadata(this._store.getState());
@@ -51,10 +75,10 @@ export class EzForm {
51
75
  }
52
76
  this.ezFormSetFields.emit(fields);
53
77
  const idFormSheet = `${StringUtils.replaceAccentuatedChars(StringUtils.toCamelCase(currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.label), false)}_selectorContainer`;
54
- return (h("div", { class: "dynamic-content", "data-element-id": idFormSheet }, h("ez-form-view", { class: "ez-row ez-padding-vertical--small", fields: fields })));
78
+ return (h("div", { class: "dynamic-content", "data-element-id": idFormSheet }, h("ez-form-view", { ref: (element) => (this._formView = element), class: "ez-row ez-padding-vertical--small", fields: fields })));
55
79
  }
56
80
  processMetadata() {
57
- if (!this.isStatic() && this.dataUnit && this._store) {
81
+ if (this.bindFields() && this.dataUnit && this._store) {
58
82
  const metadata = buildFormMetadata(this.config, this.dataUnit);
59
83
  this._store.dispatch(loadMetadata(metadata));
60
84
  }
@@ -63,6 +87,9 @@ export class EzForm {
63
87
  var _a;
64
88
  return ((_a = this._staticFields) === null || _a === void 0 ? void 0 : _a.length) > 0;
65
89
  }
90
+ bindFields() {
91
+ return !this.isStatic() || this.onlyStaticFields === false;
92
+ }
66
93
  componentWillLoad() {
67
94
  if (this.dataUnit === undefined) {
68
95
  this.dataUnit = new DataUnit("ez-form");
@@ -82,6 +109,17 @@ export class EzForm {
82
109
  this._dataBinder.bind(Array.from(this._element.querySelectorAll("[data-field-name]")), this.dataUnit.dataUnitId, metadata, this.recordsValidator);
83
110
  this.ezReady.emit();
84
111
  this.handleFieldToFocus();
112
+ this.setCustomEditors();
113
+ this.setFieldsProps();
114
+ }
115
+ setCustomEditors() {
116
+ if (!this._formView) {
117
+ return;
118
+ }
119
+ for (const [fieldName, customEditorProps] of this._customEditors) {
120
+ this._formView.addCustomEditor(fieldName, customEditorProps.customEditor, customEditorProps.detailContext);
121
+ this._customEditors.delete(fieldName);
122
+ }
85
123
  }
86
124
  handleFieldToFocus() {
87
125
  var _a;
@@ -98,6 +136,17 @@ export class EzForm {
98
136
  this.ezFormRequestClearFieldToFocus.emit();
99
137
  });
100
138
  }
139
+ setFieldsProps() {
140
+ if (!this._formView) {
141
+ return;
142
+ }
143
+ for (const [fieldName, props] of this._fieldsProps) {
144
+ for (const prop in props) {
145
+ this._formView.setFieldProp(fieldName, prop, props[prop]);
146
+ }
147
+ this._fieldsProps.delete(fieldName);
148
+ }
149
+ }
101
150
  disconnectedCallback() {
102
151
  this.dataUnit.unsubscribe(this.onDataUnitAction);
103
152
  this._dataBinder.onDisconnectedCallback();
@@ -201,9 +250,32 @@ export class EzForm {
201
250
  },
202
251
  "attribute": "field-to-focus",
203
252
  "reflect": false
253
+ },
254
+ "onlyStaticFields": {
255
+ "type": "boolean",
256
+ "mutable": false,
257
+ "complexType": {
258
+ "original": "boolean",
259
+ "resolved": "boolean",
260
+ "references": {}
261
+ },
262
+ "required": false,
263
+ "optional": false,
264
+ "docs": {
265
+ "tags": [],
266
+ "text": "Define se os campos que ser\u00E3o apresentados s\u00E3o todos est\u00E1ticos. Quando verdadeira, ocorrer\u00E1 no DataBinder o bind dos campos com o DataUnit."
267
+ },
268
+ "attribute": "only-static-fields",
269
+ "reflect": false,
270
+ "defaultValue": "false"
204
271
  }
205
272
  };
206
273
  }
274
+ static get states() {
275
+ return {
276
+ "_fieldsProps": {}
277
+ };
278
+ }
207
279
  static get events() {
208
280
  return [{
209
281
  "method": "ezFormRequestClearFieldToFocus",
@@ -297,6 +369,60 @@ export class EzForm {
297
369
  "text": "Realiza valida\u00E7\u00E3o no conte\u00FAdo de todos os campos.",
298
370
  "tags": []
299
371
  }
372
+ },
373
+ "addCustomEditor": {
374
+ "complexType": {
375
+ "signature": "(fieldName: string, customEditor: ICustomEditor, detailContext?: string) => Promise<void>",
376
+ "parameters": [{
377
+ "tags": [],
378
+ "text": ""
379
+ }, {
380
+ "tags": [],
381
+ "text": ""
382
+ }, {
383
+ "tags": [],
384
+ "text": ""
385
+ }],
386
+ "references": {
387
+ "Promise": {
388
+ "location": "global"
389
+ },
390
+ "ICustomEditor": {
391
+ "location": "import",
392
+ "path": "../../utils/customEditor/interfaces/ICustomEditor"
393
+ }
394
+ },
395
+ "return": "Promise<void>"
396
+ },
397
+ "docs": {
398
+ "text": "Registra um editor customizado para campos da grade e formul\u00E1rio.",
399
+ "tags": []
400
+ }
401
+ },
402
+ "setFieldProp": {
403
+ "complexType": {
404
+ "signature": "(fieldName: string, propName: string, value: any) => Promise<void>",
405
+ "parameters": [{
406
+ "tags": [],
407
+ "text": ""
408
+ }, {
409
+ "tags": [],
410
+ "text": ""
411
+ }, {
412
+ "tags": [],
413
+ "text": ""
414
+ }],
415
+ "references": {
416
+ "Promise": {
417
+ "location": "global"
418
+ }
419
+ },
420
+ "return": "Promise<void>"
421
+ },
422
+ "docs": {
423
+ "text": "Altera/adiciona uma propriedade nos metadados do campo.",
424
+ "tags": []
425
+ }
300
426
  }
301
427
  };
302
428
  }
@@ -0,0 +1,253 @@
1
+ import { h, Host } from '@stencil/core';
2
+ import { CustomEditorSource } from '../../../utils/customEditor/interfaces/ICustomEditor';
3
+ import { HTMLBuilder, StringUtils } from '@sankhyalabs/core';
4
+ export class EzCustomFormInput {
5
+ constructor() {
6
+ this.gui = undefined;
7
+ this.customEditor = undefined;
8
+ this.formViewField = undefined;
9
+ this.value = undefined;
10
+ this.detailContext = undefined;
11
+ this.builderFallback = undefined;
12
+ }
13
+ /**
14
+ * Aplica foco no campo.
15
+ */
16
+ async setFocus() {
17
+ var _a, _b;
18
+ (_b = (_a = this.gui) === null || _a === void 0 ? void 0 : _a["setFocus"]) === null || _b === void 0 ? void 0 : _b.call(_a);
19
+ }
20
+ /**
21
+ * Remove o foco do campo.
22
+ */
23
+ async setBlur() {
24
+ var _a, _b;
25
+ (_b = (_a = this.gui) === null || _a === void 0 ? void 0 : _a["setBlur"]) === null || _b === void 0 ? void 0 : _b.call(_a);
26
+ }
27
+ /**
28
+ * Retorna se o conteúdo é inválido.
29
+ */
30
+ async isInvalid() {
31
+ var _a, _b;
32
+ return ((_b = (_a = this.gui) === null || _a === void 0 ? void 0 : _a["isInvalid"]) === null || _b === void 0 ? void 0 : _b.call(_a)) || false;
33
+ }
34
+ getContent() {
35
+ var _a, _b;
36
+ const fieldProps = new Map();
37
+ for (const prop in this.formViewField.props) {
38
+ fieldProps.set(prop, this.formViewField.props[prop]);
39
+ }
40
+ const params = {
41
+ value: this.value,
42
+ name: this.formViewField.name,
43
+ currentEditor: this.builderFallback(this.formViewField),
44
+ setValue: (value) => this.setValue(value),
45
+ getValue: this.getValue,
46
+ editorMetadata: {
47
+ label: this.formViewField.label,
48
+ hidden: ((_a = this.formViewField.props) === null || _a === void 0 ? void 0 : _a.visible) === false,
49
+ userInterface: this.formViewField.userInterface,
50
+ options: (_b = this.formViewField.props) === null || _b === void 0 ? void 0 : _b.options,
51
+ props: this.formViewField.props ? fieldProps : undefined,
52
+ optionLoader: this.formViewField.optionLoader
53
+ },
54
+ source: CustomEditorSource.FORM,
55
+ detailContext: this.detailContext
56
+ };
57
+ let gui = this.customEditor.getEditorElement(params);
58
+ if (!gui) {
59
+ gui = this.builderFallback(this.formViewField);
60
+ this.handleValue(gui);
61
+ this.gui = gui;
62
+ return;
63
+ }
64
+ if (!(gui instanceof HTMLElement) && typeof gui !== 'string') {
65
+ this.handleValue(gui);
66
+ this.gui = gui;
67
+ return;
68
+ }
69
+ if (typeof gui === 'string') {
70
+ gui = HTMLBuilder.parseElement(gui);
71
+ }
72
+ gui.setAttribute('value', this.value);
73
+ this.gui = h("div", { key: StringUtils.generateUUID(), ref: el => el && el.appendChild(gui) });
74
+ }
75
+ setValue(value) {
76
+ this.value = value;
77
+ }
78
+ getValue() {
79
+ return this.value;
80
+ }
81
+ handleValue(gui) {
82
+ //@ts-ignore
83
+ gui.$children$.forEach((child) => {
84
+ child.$attrs$.value = this.value;
85
+ });
86
+ }
87
+ componentWillRender() {
88
+ this.getContent();
89
+ }
90
+ render() {
91
+ return (h(Host, null, this.gui));
92
+ }
93
+ static get is() { return "ez-custom-form-input"; }
94
+ static get encapsulation() { return "scoped"; }
95
+ static get properties() {
96
+ return {
97
+ "customEditor": {
98
+ "type": "unknown",
99
+ "mutable": false,
100
+ "complexType": {
101
+ "original": "ICustomEditor",
102
+ "resolved": "ICustomEditor",
103
+ "references": {
104
+ "ICustomEditor": {
105
+ "location": "import",
106
+ "path": "../../../utils/customEditor/interfaces/ICustomEditor"
107
+ }
108
+ }
109
+ },
110
+ "required": false,
111
+ "optional": false,
112
+ "docs": {
113
+ "tags": [],
114
+ "text": "Inst\u00E2ncia do editor customizado."
115
+ }
116
+ },
117
+ "formViewField": {
118
+ "type": "unknown",
119
+ "mutable": false,
120
+ "complexType": {
121
+ "original": "IFormViewField",
122
+ "resolved": "IFormViewField",
123
+ "references": {
124
+ "IFormViewField": {
125
+ "location": "import",
126
+ "path": "../interfaces"
127
+ }
128
+ }
129
+ },
130
+ "required": false,
131
+ "optional": false,
132
+ "docs": {
133
+ "tags": [],
134
+ "text": "Campo que o elemento customizado representa."
135
+ }
136
+ },
137
+ "value": {
138
+ "type": "any",
139
+ "mutable": true,
140
+ "complexType": {
141
+ "original": "any",
142
+ "resolved": "any",
143
+ "references": {}
144
+ },
145
+ "required": false,
146
+ "optional": false,
147
+ "docs": {
148
+ "tags": [],
149
+ "text": "Valores dos campos do formul\u00E1rio."
150
+ },
151
+ "attribute": "value",
152
+ "reflect": false
153
+ },
154
+ "detailContext": {
155
+ "type": "string",
156
+ "mutable": false,
157
+ "complexType": {
158
+ "original": "string",
159
+ "resolved": "string",
160
+ "references": {}
161
+ },
162
+ "required": false,
163
+ "optional": false,
164
+ "docs": {
165
+ "tags": [],
166
+ "text": "Define de qual contexto o editor est\u00E1 sendo acionado."
167
+ },
168
+ "attribute": "detail-context",
169
+ "reflect": false
170
+ },
171
+ "builderFallback": {
172
+ "type": "unknown",
173
+ "mutable": false,
174
+ "complexType": {
175
+ "original": "(field: IFormViewField) => HTMLElement",
176
+ "resolved": "(field: IFormViewField) => HTMLElement",
177
+ "references": {
178
+ "IFormViewField": {
179
+ "location": "import",
180
+ "path": "../interfaces"
181
+ },
182
+ "HTMLElement": {
183
+ "location": "global"
184
+ }
185
+ }
186
+ },
187
+ "required": false,
188
+ "optional": false,
189
+ "docs": {
190
+ "tags": [],
191
+ "text": "Builder original do FormView que ser\u00E1 chamado caso o custom n\u00E3o retorne nenhum valor."
192
+ }
193
+ }
194
+ };
195
+ }
196
+ static get states() {
197
+ return {
198
+ "gui": {}
199
+ };
200
+ }
201
+ static get methods() {
202
+ return {
203
+ "setFocus": {
204
+ "complexType": {
205
+ "signature": "() => Promise<void>",
206
+ "parameters": [],
207
+ "references": {
208
+ "Promise": {
209
+ "location": "global"
210
+ }
211
+ },
212
+ "return": "Promise<void>"
213
+ },
214
+ "docs": {
215
+ "text": "Aplica foco no campo.",
216
+ "tags": []
217
+ }
218
+ },
219
+ "setBlur": {
220
+ "complexType": {
221
+ "signature": "() => Promise<void>",
222
+ "parameters": [],
223
+ "references": {
224
+ "Promise": {
225
+ "location": "global"
226
+ }
227
+ },
228
+ "return": "Promise<void>"
229
+ },
230
+ "docs": {
231
+ "text": "Remove o foco do campo.",
232
+ "tags": []
233
+ }
234
+ },
235
+ "isInvalid": {
236
+ "complexType": {
237
+ "signature": "() => Promise<boolean>",
238
+ "parameters": [],
239
+ "references": {
240
+ "Promise": {
241
+ "location": "global"
242
+ }
243
+ },
244
+ "return": "Promise<boolean>"
245
+ },
246
+ "docs": {
247
+ "text": "Retorna se o conte\u00FAdo \u00E9 inv\u00E1lido.",
248
+ "tags": []
249
+ }
250
+ }
251
+ };
252
+ }
253
+ }
@@ -4,11 +4,33 @@ import { ElementIDUtils, UserInterface } from '@sankhyalabs/core';
4
4
  import { FormItems } from './structure';
5
5
  export class EzFormView {
6
6
  constructor() {
7
+ this._customEditors = new Map();
7
8
  this.fields = undefined;
8
9
  }
9
10
  async showUp() {
10
11
  this._element.scrollIntoView({ behavior: "smooth", block: "start" });
11
12
  }
13
+ /**
14
+ * Registra um editor customizado para campos da grade e formulário.
15
+ */
16
+ async addCustomEditor(fieldName, customEditor, detailContext) {
17
+ const newCustomEditors = new Map(this._customEditors);
18
+ newCustomEditors.set(fieldName, { customEditor, detailContext });
19
+ this._customEditors = newCustomEditors;
20
+ }
21
+ /**
22
+ * Altera/adiciona uma propriedade nos metados do campo.
23
+ */
24
+ async setFieldProp(fieldName, propName, value) {
25
+ const fields = this.fields.map(field => {
26
+ if (field.name === fieldName && (value || value === 0)) {
27
+ field.props = field.props || {};
28
+ field.props[propName] = value;
29
+ }
30
+ return field;
31
+ });
32
+ this.fields = [...fields];
33
+ }
12
34
  groupFields(fields) {
13
35
  const result = new Map();
14
36
  fields.forEach(item => {
@@ -28,7 +50,8 @@ export class EzFormView {
28
50
  return result;
29
51
  }
30
52
  componentDidRender() {
31
- this.ezContentReady.emit(Array.from(this._element.querySelectorAll("[data-field-name]")));
53
+ this._formElements = Array.from(this._element.querySelectorAll("[data-field-name]"));
54
+ this.ezContentReady.emit(this._formElements);
32
55
  const formItems = new FormItems(Array.from(this._element.querySelectorAll("[data-form-item]")));
33
56
  this.formItemsReady.emit(formItems);
34
57
  }
@@ -39,9 +62,15 @@ export class EzFormView {
39
62
  ].includes(userInterface);
40
63
  }
41
64
  buildFormItemElement(item, classItem = "") {
65
+ var _a;
42
66
  if (this.isItemFullWidth(item.userInterface)) {
43
67
  classItem += " input-full_width";
44
68
  }
69
+ if (this._customEditors.has(item.name)) {
70
+ const value = (_a = this._formElements.map(el => ({ name: el.dataset.fieldName, value: el['value'] })).find(field => field.name === item.name)) === null || _a === void 0 ? void 0 : _a.value;
71
+ const customEditor = this._customEditors.get(item.name).customEditor;
72
+ return h("div", { class: classItem }, h("ez-custom-form-input", { "data-field-name": item.name, customEditor: customEditor, formViewField: item, builderFallback: fieldBuilder, value: value }));
73
+ }
45
74
  return h("div", { class: classItem }, fieldBuilder(item));
46
75
  }
47
76
  render() {
@@ -102,6 +131,11 @@ export class EzFormView {
102
131
  }
103
132
  };
104
133
  }
134
+ static get states() {
135
+ return {
136
+ "_customEditors": {}
137
+ };
138
+ }
105
139
  static get events() {
106
140
  return [{
107
141
  "method": "ezContentReady",
@@ -164,6 +198,60 @@ export class EzFormView {
164
198
  "text": "",
165
199
  "tags": []
166
200
  }
201
+ },
202
+ "addCustomEditor": {
203
+ "complexType": {
204
+ "signature": "(fieldName: string, customEditor: ICustomEditor, detailContext?: string) => Promise<void>",
205
+ "parameters": [{
206
+ "tags": [],
207
+ "text": ""
208
+ }, {
209
+ "tags": [],
210
+ "text": ""
211
+ }, {
212
+ "tags": [],
213
+ "text": ""
214
+ }],
215
+ "references": {
216
+ "Promise": {
217
+ "location": "global"
218
+ },
219
+ "ICustomEditor": {
220
+ "location": "import",
221
+ "path": "../../utils/customEditor/interfaces/ICustomEditor"
222
+ }
223
+ },
224
+ "return": "Promise<void>"
225
+ },
226
+ "docs": {
227
+ "text": "Registra um editor customizado para campos da grade e formul\u00E1rio.",
228
+ "tags": []
229
+ }
230
+ },
231
+ "setFieldProp": {
232
+ "complexType": {
233
+ "signature": "(fieldName: string, propName: string, value: any) => Promise<void>",
234
+ "parameters": [{
235
+ "tags": [],
236
+ "text": ""
237
+ }, {
238
+ "tags": [],
239
+ "text": ""
240
+ }, {
241
+ "tags": [],
242
+ "text": ""
243
+ }],
244
+ "references": {
245
+ "Promise": {
246
+ "location": "global"
247
+ }
248
+ },
249
+ "return": "Promise<void>"
250
+ },
251
+ "docs": {
252
+ "text": "Altera/adiciona uma propriedade nos metados do campo.",
253
+ "tags": []
254
+ }
167
255
  }
168
256
  };
169
257
  }
@@ -1,7 +1,8 @@
1
1
  import { h } from "@stencil/core";
2
2
  export const buildDecimal = ({ name, label, readOnly, props, contextName, canShowError }) => {
3
- const precision = Number((props === null || props === void 0 ? void 0 : props.precision) || 2);
4
- const prettyPrecision = Number((props === null || props === void 0 ? void 0 : props.prettyPrecision) || precision);
3
+ var _a, _b;
4
+ const precision = Number((_a = props === null || props === void 0 ? void 0 : props.precision) !== null && _a !== void 0 ? _a : 2);
5
+ const prettyPrecision = Number((_b = props === null || props === void 0 ? void 0 : props.prettyPrecision) !== null && _b !== void 0 ? _b : precision);
5
6
  return buildNumeric(name, label, readOnly, precision, prettyPrecision, contextName, canShowError);
6
7
  };
7
8
  export const buildInteger = ({ name, label, readOnly, contextName, canShowError }) => {