@sankhyalabs/sankhyablocks 8.16.0-dev.4 → 8.16.0-dev.40

Sign up to get free protection for your applications and to get access to all the features.
Files changed (256) hide show
  1. package/dist/cjs/{ConfigStorage-942ce74b.js → ConfigStorage-ecc0ed20.js} +3 -2
  2. package/dist/cjs/{IExporterProvider-597949f9.js → ContinuousInsertUtils-c7e35e3b.js} +39 -6
  3. package/dist/cjs/{DataFetcher-313debd8.js → DataFetcher-cadeef8e.js} +21 -15
  4. package/dist/cjs/{RecordIDUtils-3735135c.js → GetSelectedRecordsIDsInfo-bd50caf1.js} +10 -10
  5. package/dist/cjs/{SnkFormConfigManager-1b13bacd.js → SnkFormConfigManager-f1c92f79.js} +74 -20
  6. package/dist/cjs/{SnkMessageBuilder-722b104e.js → SnkMessageBuilder-bae64d0d.js} +7 -3
  7. package/dist/cjs/{auth-fetcher-54f5ff9d.js → auth-fetcher-d68841bc.js} +1 -1
  8. package/dist/cjs/{dataunit-fetcher-688d3f05.js → dataunit-fetcher-a36ae041.js} +48 -20
  9. package/dist/cjs/{field-search-f56aa7d6.js → field-search-68e34bf4.js} +5 -1
  10. package/dist/cjs/{form-config-fetcher-2dd00e5b.js → form-config-fetcher-ed497282.js} +5 -2
  11. package/dist/cjs/index-f9e81701.js +8 -28
  12. package/dist/cjs/loader.cjs.js +1 -1
  13. package/dist/cjs/{pesquisa-fetcher-680e198f.js → pesquisa-fetcher-490a86c3.js} +7 -2
  14. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  15. package/dist/cjs/snk-actions-button_4.cjs.entry.js +17 -14
  16. package/dist/cjs/snk-application.cjs.entry.js +7 -7
  17. package/dist/cjs/snk-attach.cjs.entry.js +38 -29
  18. package/dist/cjs/{snk-form-config.cjs.entry.js → snk-config-options_3.cjs.entry.js} +381 -7
  19. package/dist/cjs/snk-crud.cjs.entry.js +16 -7
  20. package/dist/cjs/snk-data-exporter.cjs.entry.js +19 -18
  21. package/dist/cjs/{snk-data-unit-685272e7.js → snk-data-unit-b460f1da.js} +42 -22
  22. package/dist/cjs/snk-data-unit.cjs.entry.js +5 -5
  23. package/dist/cjs/snk-detail-view.cjs.entry.js +12 -13
  24. package/dist/cjs/snk-exporter-email-sender.cjs.entry.js +1 -1
  25. package/dist/cjs/snk-filter-bar_4.cjs.entry.js +1411 -0
  26. package/dist/cjs/snk-filter-binary-select.cjs.entry.js +1 -1
  27. package/dist/cjs/snk-filter-checkbox-list.cjs.entry.js +1 -1
  28. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
  29. package/dist/cjs/snk-grid.cjs.entry.js +58 -21
  30. package/dist/cjs/{snk-guides-viewer-67605336.js → snk-guides-viewer-de0a5c57.js} +27 -14
  31. package/dist/cjs/snk-guides-viewer.cjs.entry.js +9 -9
  32. package/dist/cjs/snk-personalized-filter-editor.cjs.entry.js +1 -1
  33. package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
  34. package/dist/cjs/snk-print-selector.cjs.entry.js +1 -1
  35. package/dist/cjs/snk-simple-bar.cjs.entry.js +1 -1
  36. package/dist/cjs/snk-simple-crud.cjs.entry.js +66 -27
  37. package/dist/cjs/snk-taskbar.cjs.entry.js +24 -1
  38. package/dist/collection/collection-manifest.json +11 -31
  39. package/dist/collection/components/snk-actions-button/actions/index.js +12 -9
  40. package/dist/collection/components/snk-attach/snk-attach.js +25 -16
  41. package/dist/collection/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.js +2 -4
  42. package/dist/collection/components/snk-crud/snk-crud.js +97 -2
  43. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +3 -4
  44. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.css +6 -6
  45. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +70 -7
  46. package/dist/collection/components/snk-data-exporter/exporter-email-sender/options-step.js +1 -1
  47. package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js +4 -4
  48. package/dist/collection/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.js +5 -5
  49. package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js +1 -1
  50. package/dist/collection/components/snk-data-exporter/providers/ServerSideExporterProvider.js +1 -1
  51. package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +2 -2
  52. package/dist/collection/components/snk-data-exporter/structure/ItemBuilder.js +2 -2
  53. package/dist/collection/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.js +4 -4
  54. package/dist/collection/components/snk-data-unit/snk-data-unit.js +57 -20
  55. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.js +1 -1
  56. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-checkbox-list.js +1 -1
  57. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-personalized-filter-editor/snk-personalized-filter-editor.js +1 -1
  58. package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +1 -1
  59. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +59 -21
  60. package/dist/collection/components/snk-form/snk-form.js +2 -2
  61. package/dist/collection/components/snk-form-config/SnkFormConfigManager.js +72 -18
  62. package/dist/collection/components/snk-form-config/snk-form-config.css +8 -3
  63. package/dist/collection/components/snk-form-config/snk-form-config.js +32 -3
  64. package/dist/collection/components/snk-grid/snk-grid.css +2 -0
  65. package/dist/collection/components/snk-grid/snk-grid.js +74 -8
  66. package/dist/collection/components/snk-print-selector/snk-print-selector.js +1 -1
  67. package/dist/collection/components/snk-simple-bar/snk-simple-bar.js +1 -1
  68. package/dist/collection/components/snk-simple-crud/snk-simple-crud.css +0 -1
  69. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +91 -16
  70. package/dist/collection/components/snk-taskbar/processor/taskbar-processor.js +5 -1
  71. package/dist/collection/components/snk-taskbar/snk-taskbar.js +65 -0
  72. package/dist/collection/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.js +3 -3
  73. package/dist/collection/lib/configs/ConfigStorage.js +1 -0
  74. package/dist/collection/lib/dataUnit/InMemoryLoader.js +2 -4
  75. package/dist/collection/lib/dataUnit/dataUnitInMemoryUtils.js +34 -9
  76. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +22 -16
  77. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/anexo-sistema-fetcher.js +7 -5
  78. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.js +2 -2
  79. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +9 -2
  80. package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js +4 -1
  81. package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +6 -1
  82. package/dist/collection/lib/message/resources/snk-data-unit.msg.js +1 -1
  83. package/dist/collection/lib/message/resources/snk-exporter.msg.js +1 -1
  84. package/dist/collection/lib/message/resources/snk-grid.msg.js +5 -1
  85. package/dist/collection/lib/utils/ContinuousInsertUtils.js +31 -0
  86. package/dist/collection/{components/snk-data-exporter/utils/RecordIDUtils.js → lib/utils/GetSelectedRecordsIDsInfo.js} +9 -9
  87. package/dist/collection/sw.js +46 -0
  88. package/dist/components/ConfigStorage.js +1 -0
  89. package/dist/components/{IExporterProvider.js → ContinuousInsertUtils.js} +40 -5
  90. package/dist/components/DataFetcher.js +22 -16
  91. package/dist/{esm/RecordIDUtils-87d02110.js → components/GetSelectedRecordsIDsInfo.js} +10 -10
  92. package/dist/components/SnkFormConfigManager.js +72 -18
  93. package/dist/components/SnkMessageBuilder.js +7 -3
  94. package/dist/components/dataunit-fetcher.js +47 -17
  95. package/dist/components/form-config-fetcher.js +4 -1
  96. package/dist/components/pesquisa-fetcher.js +6 -1
  97. package/dist/components/snk-actions-button2.js +12 -9
  98. package/dist/components/snk-attach2.js +34 -25
  99. package/dist/components/snk-crud.js +15 -2
  100. package/dist/components/snk-data-exporter2.js +12 -11
  101. package/dist/components/snk-data-unit2.js +44 -60
  102. package/dist/components/snk-detail-view2.js +28 -13
  103. package/dist/components/snk-exporter-email-sender2.js +1 -1
  104. package/dist/components/snk-filter-bar2.js +35 -22
  105. package/dist/components/snk-filter-binary-select.js +1 -1
  106. package/dist/components/snk-filter-checkbox-list.js +1 -1
  107. package/dist/components/snk-form-config2.js +17 -4
  108. package/dist/components/snk-form.js +2 -2
  109. package/dist/components/snk-grid2.js +51 -12
  110. package/dist/components/snk-personalized-filter-editor.js +1 -1
  111. package/dist/components/snk-print-selector.js +1 -1
  112. package/dist/components/snk-simple-bar2.js +1 -1
  113. package/dist/components/snk-simple-crud2.js +59 -16
  114. package/dist/components/snk-taskbar2.js +25 -2
  115. package/dist/esm/{ConfigStorage-86187da3.js → ConfigStorage-7b36d041.js} +3 -2
  116. package/dist/esm/{IExporterProvider-63a188b6.js → ContinuousInsertUtils-3e520a07.js} +40 -8
  117. package/dist/esm/{DataFetcher-c1baf61d.js → DataFetcher-a9c598f2.js} +22 -16
  118. package/dist/esm/GetSelectedRecordsIDsInfo-9fa41508.js +41 -0
  119. package/dist/esm/{SnkFormConfigManager-d4554df9.js → SnkFormConfigManager-f1a0fc92.js} +74 -20
  120. package/dist/esm/{SnkMessageBuilder-89925609.js → SnkMessageBuilder-6fff4a4c.js} +7 -3
  121. package/dist/esm/{auth-fetcher-039abba3.js → auth-fetcher-749d880f.js} +1 -1
  122. package/dist/esm/{constants-8457af36.js → constants-7302ee87.js} +1 -1
  123. package/dist/esm/{dataunit-fetcher-264191b2.js → dataunit-fetcher-fd58c640.js} +48 -18
  124. package/dist/esm/{field-search-efbe307f.js → field-search-f8b1d91e.js} +5 -1
  125. package/dist/esm/{form-config-fetcher-30fb808f.js → form-config-fetcher-adbe5d34.js} +5 -2
  126. package/dist/esm/index-a7d3d3f1.js +8 -28
  127. package/dist/esm/loader.js +1 -1
  128. package/dist/esm/{pesquisa-fetcher-03c8f919.js → pesquisa-fetcher-50fc7e6b.js} +7 -2
  129. package/dist/esm/sankhyablocks.js +1 -1
  130. package/dist/esm/snk-actions-button_4.entry.js +18 -15
  131. package/dist/esm/snk-application.entry.js +7 -7
  132. package/dist/esm/snk-attach.entry.js +39 -30
  133. package/dist/esm/{snk-form-config.entry.js → snk-config-options_3.entry.js} +382 -10
  134. package/dist/esm/snk-configurator.entry.js +1 -1
  135. package/dist/esm/snk-crud.entry.js +17 -8
  136. package/dist/esm/snk-data-exporter.entry.js +20 -19
  137. package/dist/esm/{snk-data-unit-63f83504.js → snk-data-unit-590225b5.js} +42 -22
  138. package/dist/esm/snk-data-unit.entry.js +5 -5
  139. package/dist/esm/snk-detail-view.entry.js +13 -14
  140. package/dist/esm/snk-exporter-email-sender.entry.js +1 -1
  141. package/dist/esm/snk-field-config.entry.js +1 -1
  142. package/dist/esm/snk-filter-bar_4.entry.js +1404 -0
  143. package/dist/esm/snk-filter-binary-select.entry.js +1 -1
  144. package/dist/esm/snk-filter-checkbox-list.entry.js +1 -1
  145. package/dist/esm/snk-filter-modal-item.entry.js +3 -3
  146. package/dist/esm/snk-grid.entry.js +53 -16
  147. package/dist/esm/{snk-guides-viewer-151f6091.js → snk-guides-viewer-2f4dcdc5.js} +28 -15
  148. package/dist/esm/snk-guides-viewer.entry.js +9 -9
  149. package/dist/esm/snk-personalized-filter-editor.entry.js +1 -1
  150. package/dist/esm/snk-personalized-filter.entry.js +3 -3
  151. package/dist/esm/snk-print-selector.entry.js +1 -1
  152. package/dist/esm/snk-simple-bar.entry.js +1 -1
  153. package/dist/esm/snk-simple-crud.entry.js +63 -24
  154. package/dist/esm/snk-tab-config.entry.js +1 -1
  155. package/dist/esm/snk-taskbar.entry.js +24 -1
  156. package/dist/sankhyablocks/p-052213ba.entry.js +1 -0
  157. package/dist/sankhyablocks/{p-df5451c7.js → p-06421fdb.js} +2 -2
  158. package/dist/sankhyablocks/p-0b6cd238.entry.js +1 -0
  159. package/dist/sankhyablocks/p-0e320bd2.entry.js +1 -0
  160. package/dist/sankhyablocks/p-16a1dd18.entry.js +1 -0
  161. package/dist/sankhyablocks/p-17425c72.js +1 -0
  162. package/dist/sankhyablocks/{p-a1d72395.entry.js → p-212213d9.entry.js} +1 -1
  163. package/dist/sankhyablocks/p-23736d75.js +1 -0
  164. package/dist/sankhyablocks/p-275de842.entry.js +1 -0
  165. package/dist/sankhyablocks/p-2aae03a1.entry.js +1 -0
  166. package/dist/sankhyablocks/{p-8eb67fa4.entry.js → p-2d3f9482.entry.js} +1 -1
  167. package/dist/sankhyablocks/{p-7663f597.entry.js → p-41793e17.entry.js} +1 -1
  168. package/dist/sankhyablocks/{p-72fc257b.entry.js → p-434817f0.entry.js} +1 -1
  169. package/dist/sankhyablocks/p-47bce500.js +60 -0
  170. package/dist/sankhyablocks/{p-aff76a53.js → p-4d9549cf.js} +2 -2
  171. package/dist/sankhyablocks/p-583517ba.entry.js +1 -0
  172. package/dist/sankhyablocks/p-5b51491f.entry.js +1 -0
  173. package/dist/sankhyablocks/p-5e51e833.entry.js +1 -0
  174. package/dist/sankhyablocks/{p-aaa3ee68.entry.js → p-5f157b09.entry.js} +1 -1
  175. package/dist/sankhyablocks/p-656f0e51.entry.js +1 -0
  176. package/dist/sankhyablocks/p-72c10005.entry.js +1 -0
  177. package/dist/sankhyablocks/p-7bd9683d.js +1 -0
  178. package/dist/sankhyablocks/p-7dd49d15.js +1 -0
  179. package/dist/sankhyablocks/{p-af8efd95.js → p-8a9638ae.js} +2 -2
  180. package/dist/sankhyablocks/{p-95df461f.entry.js → p-8b4fc28f.entry.js} +1 -1
  181. package/dist/sankhyablocks/{p-41f8bfa3.entry.js → p-8c235d4c.entry.js} +1 -1
  182. package/dist/sankhyablocks/{p-b0ef4383.js → p-95ce311a.js} +1 -1
  183. package/dist/sankhyablocks/p-9f9b99d9.js +1 -0
  184. package/dist/sankhyablocks/p-ab1645fb.entry.js +1 -0
  185. package/dist/sankhyablocks/p-c2e468c9.entry.js +1 -0
  186. package/dist/sankhyablocks/{p-913a9979.js → p-ca5ec380.js} +1 -1
  187. package/dist/sankhyablocks/p-cefb0ee1.entry.js +1 -0
  188. package/dist/sankhyablocks/{p-82a0bfb0.entry.js → p-dbe6174a.entry.js} +2 -2
  189. package/dist/sankhyablocks/p-f3434fc4.js +1 -0
  190. package/dist/sankhyablocks/p-fa6c5826.entry.js +1 -0
  191. package/dist/sankhyablocks/p-fadc8339.js +1 -0
  192. package/dist/sankhyablocks/{p-eae7a817.entry.js → p-fb34e0cf.entry.js} +1 -1
  193. package/dist/sankhyablocks/p-fd13b4d2.js +1 -0
  194. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  195. package/dist/types/components/snk-actions-button/actions/index.d.ts +1 -0
  196. package/dist/types/components/snk-attach/snk-attach.d.ts +1 -0
  197. package/dist/types/components/snk-crud/snk-crud.d.ts +17 -0
  198. package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +15 -0
  199. package/dist/types/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.d.ts +3 -3
  200. package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +7 -0
  201. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +5 -0
  202. package/dist/types/components/snk-form-config/SnkFormConfigManager.d.ts +9 -4
  203. package/dist/types/components/snk-form-config/snk-form-config.d.ts +4 -0
  204. package/dist/types/components/snk-grid/snk-grid.d.ts +11 -0
  205. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +13 -0
  206. package/dist/types/components/snk-taskbar/processor/taskbar-processor.d.ts +1 -0
  207. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +11 -0
  208. package/dist/types/components.d.ts +113 -0
  209. package/dist/types/lib/dataUnit/dataUnitInMemoryUtils.d.ts +12 -2
  210. package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/anexo-sistema-fetcher.d.ts +3 -2
  211. package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams.d.ts +1 -1
  212. package/dist/types/lib/utils/ContinuousInsertUtils.d.ts +10 -0
  213. package/dist/types/lib/utils/GetSelectedRecordsIDsInfo.d.ts +3 -0
  214. package/package.json +4 -3
  215. package/dist/cjs/snk-config-options.cjs.entry.js +0 -239
  216. package/dist/cjs/snk-filter-bar.cjs.entry.js +0 -714
  217. package/dist/cjs/snk-filter-item.cjs.entry.js +0 -312
  218. package/dist/cjs/snk-filter-list.cjs.entry.js +0 -152
  219. package/dist/cjs/snk-filter-modal.cjs.entry.js +0 -249
  220. package/dist/cjs/snk-form.cjs.entry.js +0 -143
  221. package/dist/esm/snk-config-options.entry.js +0 -235
  222. package/dist/esm/snk-filter-bar.entry.js +0 -710
  223. package/dist/esm/snk-filter-item.entry.js +0 -308
  224. package/dist/esm/snk-filter-list.entry.js +0 -148
  225. package/dist/esm/snk-filter-modal.entry.js +0 -245
  226. package/dist/esm/snk-form.entry.js +0 -139
  227. package/dist/sankhyablocks/p-14a08904.entry.js +0 -1
  228. package/dist/sankhyablocks/p-14b9f964.entry.js +0 -1
  229. package/dist/sankhyablocks/p-219f888d.entry.js +0 -1
  230. package/dist/sankhyablocks/p-3a212712.js +0 -1
  231. package/dist/sankhyablocks/p-3a216b81.entry.js +0 -1
  232. package/dist/sankhyablocks/p-3b60db06.entry.js +0 -1
  233. package/dist/sankhyablocks/p-47b60deb.entry.js +0 -1
  234. package/dist/sankhyablocks/p-70a4af56.entry.js +0 -1
  235. package/dist/sankhyablocks/p-7505da04.entry.js +0 -1
  236. package/dist/sankhyablocks/p-75f83d1d.entry.js +0 -1
  237. package/dist/sankhyablocks/p-7a337364.js +0 -1
  238. package/dist/sankhyablocks/p-829d4045.js +0 -1
  239. package/dist/sankhyablocks/p-88aa931b.entry.js +0 -1
  240. package/dist/sankhyablocks/p-8fc470e5.entry.js +0 -1
  241. package/dist/sankhyablocks/p-941bf3ef.entry.js +0 -1
  242. package/dist/sankhyablocks/p-9863d682.js +0 -1
  243. package/dist/sankhyablocks/p-b11aa1e0.entry.js +0 -1
  244. package/dist/sankhyablocks/p-b4b21558.entry.js +0 -1
  245. package/dist/sankhyablocks/p-bad55caa.entry.js +0 -1
  246. package/dist/sankhyablocks/p-c053256c.entry.js +0 -1
  247. package/dist/sankhyablocks/p-c2495304.js +0 -1
  248. package/dist/sankhyablocks/p-c5268346.entry.js +0 -1
  249. package/dist/sankhyablocks/p-cefba299.js +0 -1
  250. package/dist/sankhyablocks/p-d3f53df2.entry.js +0 -1
  251. package/dist/sankhyablocks/p-dc7c9047.js +0 -1
  252. package/dist/sankhyablocks/p-e8763234.entry.js +0 -1
  253. package/dist/sankhyablocks/p-f2809746.entry.js +0 -1
  254. package/dist/sankhyablocks/p-fcac4dfc.js +0 -1
  255. package/dist/sankhyablocks/p-fe79f83a.js +0 -60
  256. package/dist/types/components/snk-data-exporter/utils/RecordIDUtils.d.ts +0 -3
@@ -1,249 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-f9e81701.js');
6
- const ezModalContainer = require('@sankhyalabs/ezui/dist/collection/components/ez-modal-container');
7
- const utils = require('@sankhyalabs/ezui/dist/collection/utils');
8
- const filterType_enum = require('./filter-type.enum-b14ce507.js');
9
- const filterItemType_enum = require('./filter-item-type.enum-a7ffdaa6.js');
10
- const core = require('@sankhyalabs/core');
11
- const PersonalizedFilterUtils = require('./PersonalizedFilterUtils-0184ffbb.js');
12
- const filterNumberVariation = require('./filterNumberVariation-d65332da.js');
13
- require('./index-c5771aba.js');
14
-
15
- const snkFilterModalCss = "ez-modal{--ez-modal-content-padding:24px 12px}.snk-filter-modal__container{width:344px;max-width:344px;min-width:344px;overflow:hidden}.snk-filter-modal__content{display:flex;flex-direction:column;gap:var(--space--medium, 12px);padding-right:var(--space--3xs, 4px)}.snk-filter-modal__collapsible-box{border:var(--border--small, 1px solid) var(--color--strokes, #DCE0E8);border-radius:var(--border--radius-medium);padding:var(--space--medium, 12px) var(--space--small, 6px)}.snk-filter-modal__rendered-items{max-height:760px;overflow-x:clip;overflow-y:auto}.snk-filter-modal__rendered-items::-webkit-scrollbar{width:var(--space--small);min-width:var(--space--small);max-width:var(--space--small)}";
16
-
17
- const SnkFilterModal = class {
18
- constructor(hostRef) {
19
- index.registerInstance(this, hostRef);
20
- this.getMessage = undefined;
21
- this.configName = undefined;
22
- this.filters = undefined;
23
- this.applyFilters = undefined;
24
- this.closeModal = undefined;
25
- this.addPersonalizedFilter = undefined;
26
- this.editPersonalizedFilter = undefined;
27
- this.deletePersonalizedFilter = undefined;
28
- this.filtersToDelete = [];
29
- this.disablePersonalizedFilter = undefined;
30
- }
31
- /**
32
- * Emitido quando um filtro personalizado é deletado.
33
- */
34
- deletePersonalizedFilterListener(event) {
35
- this.filtersToDelete.push(event.detail);
36
- }
37
- getCustomMessage(key, params) {
38
- var _a;
39
- return (_a = this.getMessage) === null || _a === void 0 ? void 0 : _a.call(this, `snkFilterBar.filterModal.${key}`, params);
40
- }
41
- //TODO: tratar clear all dos filtros personalizados
42
- handleClearAll() {
43
- const { customFilters, quickFilters, otherFilters, multiListFilters } = this.filters.reduce((acc, filter) => {
44
- if (filter.type === filterItemType_enum.FilterItemType.MULTI_LIST) {
45
- acc.multiListFilters.push(filter);
46
- return acc;
47
- }
48
- if (filter.filterType === filterType_enum.FilterType.QUICK_FILTER) {
49
- acc.quickFilters.push(filter);
50
- return acc;
51
- }
52
- if (filter.filterType === filterType_enum.FilterType.CUSTOM_FILTER) {
53
- acc.customFilters.push(filter);
54
- return acc;
55
- }
56
- if (filter.filterType === filterType_enum.FilterType.OTHER_FILTERS) {
57
- acc.otherFilters.push(filter);
58
- return acc;
59
- }
60
- return acc;
61
- }, { quickFilters: [], customFilters: [], otherFilters: [], multiListFilters: [] });
62
- this.handleClearFilterList(quickFilters);
63
- this.handleClearCustomFilters(customFilters);
64
- this.handleClearOthersFilters(otherFilters);
65
- multiListFilters.forEach(multiListFilter => this.handleClearSigleFilter(multiListFilter));
66
- }
67
- handleClearOthersFilters(otherFilters) {
68
- this.filters = this.filters.map(filter => otherFilters.includes(filter) ? (Object.assign(Object.assign({}, filter), { value: undefined })) : filter);
69
- }
70
- handleClearCustomFilters(customFilters) {
71
- this.filters.forEach((filter, index) => {
72
- if (filter.filterType === filterType_enum.FilterType.CUSTOM_FILTER)
73
- this.filters[index] = this.clearAllCustomFilter(customFilters).shift();
74
- });
75
- }
76
- clearAllCustomFilter(filterConfigSnapshot) {
77
- return filterConfigSnapshot.map(filterItem => {
78
- const copy = Object.assign({}, filterItem);
79
- delete copy.value;
80
- copy.visible = false;
81
- if (copy.groupedItems) {
82
- copy.groupedItems = this.clearAllCustomFilter(copy.groupedItems);
83
- }
84
- return copy;
85
- });
86
- }
87
- handleClose() {
88
- const hasChangesToSave = core.ObjectUtils.objectToString(this.filters) !== core.ObjectUtils.objectToString(this._originalFilterConfig);
89
- if (!hasChangesToSave) {
90
- this.closeModal();
91
- return;
92
- }
93
- return utils.ApplicationUtils.confirm(this.getCustomMessage('validations.notSaved.title'), this.getCustomMessage('validations.notSaved.message')).then((cancelAction) => {
94
- if (cancelAction)
95
- this.closeModal();
96
- });
97
- }
98
- handleApplyFilters() {
99
- const filterPersonalized = this.filters.find(filter => filter.filterType === filterType_enum.FilterType.CUSTOM_FILTER);
100
- if (this.isValidCustomFilter(filterPersonalized)) {
101
- this.applyFilters(this.filters);
102
- }
103
- if (this.filtersToDelete.length > 0) {
104
- this.filtersToDelete.forEach(filter => {
105
- this.deletePersonalizedFilter(filter, this.configName);
106
- });
107
- this.filtersToDelete = [];
108
- }
109
- }
110
- isValidCustomFilter(filterPersonalized) {
111
- const isValid = PersonalizedFilterUtils.PersonalizedFilterUtils.validateVariableValues(filterPersonalized);
112
- if (!isValid) {
113
- utils.ApplicationUtils.alert(this.getCustomMessage('validations.notFullFilled.title'), this.getCustomMessage('validations.notFullFilled.message'));
114
- return false;
115
- }
116
- return true;
117
- }
118
- modalActionListener(evt) {
119
- const modalAction = evt.detail;
120
- switch (modalAction) {
121
- case ezModalContainer.ModalAction.CANCEL:
122
- this.handleClearAll();
123
- break;
124
- case ezModalContainer.ModalAction.OK:
125
- this.handleApplyFilters();
126
- break;
127
- case ezModalContainer.ModalAction.CLOSE:
128
- this.handleClose();
129
- break;
130
- }
131
- }
132
- handleFilterChange(filterConfig) {
133
- this.filters = this.filters.map(filter => filter.id === filterConfig.id ? filterConfig : filter);
134
- }
135
- handleClearFilterList(filterList) {
136
- this.filters = this.filters.map(filter => filterList.includes(filter) ? (Object.assign(Object.assign({}, filter), { value: undefined })) : filter);
137
- }
138
- handleClearSigleFilter(filterItem) {
139
- if (filterItemType_enum.FilterItemType.MULTI_LIST === filterItem.type) {
140
- let filterItemCopy = core.ObjectUtils.copy(filterItem);
141
- this.uncheckFilterValues(filterItemCopy.value);
142
- const filterListCopy = core.ObjectUtils.copy(this.filters);
143
- const index = filterListCopy.findIndex(item => item.id === filterItem.id);
144
- filterListCopy.splice(index, 1, filterItemCopy);
145
- this.filters = core.ObjectUtils.copy(filterListCopy);
146
- return;
147
- }
148
- if (filterItemType_enum.FilterItemType.CHECK_BOX_LIST === filterItem.type) {
149
- const filterListCopy = core.ObjectUtils.copy(this.filters);
150
- filterListCopy.find(filter => filter.id === filterItem.id).value = undefined;
151
- this.filters = core.ObjectUtils.copy(filterListCopy);
152
- return;
153
- }
154
- this.filters.find(filter => filter.id === filterItem.id).value = undefined;
155
- }
156
- uncheckFilterValues(valueList) {
157
- valueList.forEach(value => {
158
- if (!!value) {
159
- value.check = false;
160
- }
161
- });
162
- return valueList;
163
- }
164
- renderFilterItem(filterItem, fullRow) {
165
- return (index.h("snk-filter-modal-item", { class: fullRow ? 'ez-col ez-col--sd-12' : 'ez-col ez-col--sd-6 ez-padding--small', filterItem: filterItem, configName: this.configName, onFilterChange: (event) => this.handleFilterChange(event.detail), onEditPersonalizedFilter: evt => this.editPersonalizedFilter(evt.detail), onAddPersonalizedFilter: () => this.addPersonalizedFilter() }));
166
- }
167
- isDefaultFilterNumberVariation(filter) {
168
- var _a;
169
- return filter.type === filterItemType_enum.FilterItemType.NUMBER
170
- && (!filter.props.variation || ((_a = filter.props) === null || _a === void 0 ? void 0 : _a.variation) === filterNumberVariation.FilterNumberVariation.DEFAULT);
171
- }
172
- mountFiltersLines(filters) {
173
- const MAX_LINE_LENGTH = 2;
174
- let currentLine = 0;
175
- let forceAddCurrent = false;
176
- const filtersLines = {};
177
- for (let curr = 0; curr < filters.length; curr++) {
178
- filtersLines[currentLine] = filtersLines[currentLine] || [];
179
- const item = filters[curr];
180
- const isLast = curr === filters.length - 1;
181
- const currentItemMatch = item.type === filterItemType_enum.FilterItemType.TEXT || this.isDefaultFilterNumberVariation(item);
182
- const nextItemMatch = isLast ? false : filters[curr + 1].type === filterItemType_enum.FilterItemType.TEXT || this.isDefaultFilterNumberVariation(filters[curr + 1]);
183
- if ((currentItemMatch && nextItemMatch) || forceAddCurrent) {
184
- filtersLines[currentLine].push(item);
185
- forceAddCurrent = filtersLines[currentLine].length < MAX_LINE_LENGTH;
186
- if (filtersLines[currentLine].length === MAX_LINE_LENGTH)
187
- ++currentLine;
188
- continue;
189
- }
190
- filtersLines[currentLine] = filtersLines[currentLine] || [];
191
- filtersLines[currentLine].push(item);
192
- ++currentLine;
193
- }
194
- return Object.values(filtersLines);
195
- }
196
- renderFilterLine(filters) {
197
- const fullLine = filters.length === 1;
198
- return filters.map((filter) => this.renderFilterItem(filter, fullLine));
199
- }
200
- getIformedFiltersCount(listItems) {
201
- let countInformedItens = 0;
202
- listItems.forEach(item => {
203
- var _a, _b, _c, _d, _e, _f;
204
- if (filterItemType_enum.FilterItemType.MULTI_LIST === item.type) {
205
- countInformedItens += (_e = (_d = (_c = ((_b = (_a = item.value) === null || _a === void 0 ? void 0 : _a.elements) !== null && _b !== void 0 ? _b : item.value)) === null || _c === void 0 ? void 0 : _c.filter(value => value === null || value === void 0 ? void 0 : value.check)) === null || _d === void 0 ? void 0 : _d.length) !== null && _e !== void 0 ? _e : 0;
206
- return;
207
- }
208
- if (filterItemType_enum.FilterItemType.CHECK_BOX_LIST === item.type) {
209
- countInformedItens += Object.entries((_f = item.value) !== null && _f !== void 0 ? _f : {})
210
- .filter(([_, value]) => value === true)
211
- .map(([key, _]) => key).length;
212
- return;
213
- }
214
- if (item.groupedItems != undefined) {
215
- countInformedItens = item.groupedItems.filter(item => item.visible).length;
216
- return;
217
- }
218
- if (!!item.value) {
219
- countInformedItens++;
220
- }
221
- });
222
- return countInformedItens;
223
- }
224
- renderCollapsibleFilterBox(label, listItems, isSingleItem, shouldRenderFooter = true) {
225
- if (!listItems.length)
226
- return null;
227
- const appliedFilters = this.getIformedFiltersCount(listItems);
228
- const lines = this.mountFiltersLines(listItems);
229
- return (index.h("ez-collapsible-box", { class: "snk-filter-modal__collapsible-box", headerSize: "medium", value: true, label: label }, !!appliedFilters && (index.h("ez-badge", { class: "ez-badge--primary-subtle", slot: "rightSlot", label: appliedFilters === null || appliedFilters === void 0 ? void 0 : appliedFilters.toString() })), index.h("div", { class: "ez-row snk-filter-modal__rendered-items" }, lines.map(this.renderFilterLine.bind(this))), shouldRenderFooter && (index.h("div", { class: "ez-flex ez-flex--justify-end grow" }, index.h("ez-button", { class: "ez-button--tertiary", size: "medium", label: "Limpar", onClick: () => isSingleItem ? this.handleClearSigleFilter(listItems[0]) : this.handleClearFilterList(listItems) })))));
230
- }
231
- componentWillRender() {
232
- this._modalTitle = this.getCustomMessage('title');
233
- this._okButtonLabel = this.getCustomMessage('okButtonLabel');
234
- this._cancelButtonLabel = this.getCustomMessage('cancelButtonLabel');
235
- }
236
- componentDidLoad() {
237
- if (!this._originalFilterConfig)
238
- this._originalFilterConfig = this.filters;
239
- }
240
- render() {
241
- const customFilters = this.filters.filter(filter => filter.filterType === filterType_enum.FilterType.CUSTOM_FILTER);
242
- const quickFilters = this.filters.filter(filter => filter.filterType === filterType_enum.FilterType.QUICK_FILTER);
243
- const otherFilters = this.filters.filter(filter => filter.filterType === filterType_enum.FilterType.OTHER_FILTERS);
244
- return (index.h("ez-modal-container", { class: "snk-filter-modal__container", modalTitle: this._modalTitle, cancelButtonLabel: this._cancelButtonLabel, okButtonLabel: this._okButtonLabel, onEzModalAction: this.modalActionListener.bind(this) }, index.h("div", { class: "snk-filter-modal__content ez-col--sd-12" }, !this.disablePersonalizedFilter && this.renderCollapsibleFilterBox(this.getCustomMessage('customFilters'), customFilters, false, false), this.renderCollapsibleFilterBox(this.getCustomMessage('quickFilters'), quickFilters, false), otherFilters.map(filter => this.renderCollapsibleFilterBox(filter.label, [filter], true)))));
245
- }
246
- };
247
- SnkFilterModal.style = snkFilterModalCss;
248
-
249
- exports.snk_filter_modal = SnkFilterModal;
@@ -1,143 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-f9e81701.js');
6
- const core = require('@sankhyalabs/core');
7
- const SnkFormConfigManager = require('./SnkFormConfigManager-1b13bacd.js');
8
- const ResourceIDUtils = require('./ResourceIDUtils-5ff86aa7.js');
9
- require('./ConfigStorage-942ce74b.js');
10
- require('./form-config-fetcher-2dd00e5b.js');
11
- require('./DataFetcher-313debd8.js');
12
- require('./PrintUtils-bcaeb82f.js');
13
- require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
14
- require('./filter-item-type.enum-a7ffdaa6.js');
15
-
16
- const snkFormCss = ".sc-snk-form-h{--snk-form__header--min-height:94px;display:block}.snk-form__form--hidden.sc-snk-form{display:none}";
17
-
18
- const SnkForm = class {
19
- constructor(hostRef) {
20
- index.registerInstance(this, hostRef);
21
- this.exit = index.createEvent(this, "exit", 7);
22
- this.actionClick = index.createEvent(this, "actionClick", 7);
23
- this.formItemsReady = index.createEvent(this, "formItemsReady", 7);
24
- this._customEditors = new Map();
25
- this._dataUnit = undefined;
26
- this._dataState = undefined;
27
- this._showFormConfig = false;
28
- this._configManager = undefined;
29
- this.configName = undefined;
30
- this.recordsValidator = undefined;
31
- this.messagesBuilder = undefined;
32
- this.formLegacyConfigName = undefined;
33
- this.resourceID = undefined;
34
- }
35
- /**
36
- * Exibe a janela de configurações do formulário.
37
- */
38
- async showConfig() {
39
- this._showFormConfig = true;
40
- }
41
- /**
42
- * Fecha a janela de configurações do formulário.
43
- */
44
- async hideConfig() {
45
- this._showFormConfig = false;
46
- }
47
- /**
48
- * Registra um editor customizado para campos da grade e formulário.
49
- */
50
- async addCustomEditor(fieldName, customEditor) {
51
- if (this._form) {
52
- this._form.addCustomEditor(fieldName, customEditor);
53
- return;
54
- }
55
- const newCustomEditors = new Map(this._customEditors);
56
- newCustomEditors.set(fieldName, customEditor);
57
- this._customEditors = newCustomEditors;
58
- }
59
- /**
60
- * Altera/adiciona uma propriedade nos metadados do campo.
61
- */
62
- async setFieldProp(fieldName, propName, value) {
63
- await this._form.setFieldProp(fieldName, propName, value);
64
- }
65
- closeConfig() {
66
- this.hideConfig();
67
- }
68
- dataunitReady() {
69
- const dataInfo = { dataUnit: this._dataUnit };
70
- core.ElementIDUtils.addIDInfo(this._element, null, dataInfo);
71
- }
72
- setCustomEditors() {
73
- if (!this._form) {
74
- return;
75
- }
76
- for (const [fieldName, customEditor] of this._customEditors) {
77
- this._form.addCustomEditor(fieldName, customEditor);
78
- this._customEditors.delete(fieldName);
79
- }
80
- }
81
- async componentDidRender() {
82
- this.setCustomEditors();
83
- }
84
- async componentWillLoad() {
85
- let parent = this._element.parentElement;
86
- while (parent) {
87
- if (parent.tagName.toUpperCase() === "SNK-DATA-UNIT") {
88
- this._snkDataUnit = parent;
89
- this._dataUnit = this._snkDataUnit.dataUnit;
90
- this._dataState = this._snkDataUnit.dataState;
91
- if (this._dataUnit) {
92
- this.dataunitReady();
93
- }
94
- else {
95
- this._snkDataUnit.addEventListener("dataUnitReady", (evt) => {
96
- this._dataUnit = evt.detail;
97
- });
98
- }
99
- this._snkDataUnit.addEventListener("dataStateChange", this.handleDataStateChange.bind(this));
100
- break;
101
- }
102
- parent = parent.parentElement;
103
- }
104
- if (this.resourceID == undefined) {
105
- this.resourceID = await ResourceIDUtils.ResourceIDUtils.getResourceID();
106
- }
107
- this._configManager = new SnkFormConfigManager.SnkFormConfigManager(this.configName, this.resourceID);
108
- this.addFormLegacyConfig();
109
- await this._configManager.loadConfig();
110
- }
111
- async handleDataStateChange(evt) {
112
- var _a;
113
- this._dataState = evt.detail;
114
- const fieldsWithRmPrecision = await this._snkDataUnit.getFieldsWithRmPrecision();
115
- for (const field of fieldsWithRmPrecision || []) {
116
- if (!field) {
117
- continue;
118
- }
119
- const rmPrecision = (_a = this._dataState.rowMetadata) === null || _a === void 0 ? void 0 : _a.getProp('rm_precision', field);
120
- if (!rmPrecision && rmPrecision !== 0) {
121
- continue;
122
- }
123
- await this.setFieldProp(field, 'precision', rmPrecision);
124
- await this.setFieldProp(field, 'prettyPrecision', rmPrecision);
125
- }
126
- }
127
- addFormLegacyConfig() {
128
- if (this.formLegacyConfigName) {
129
- this._configManager.addFormLegacyConfig(this.formLegacyConfigName);
130
- }
131
- }
132
- render() {
133
- if (!this._dataUnit || !this._dataState) {
134
- return undefined;
135
- }
136
- return (index.h("section", null, index.h("div", { class: "ez-row" }, index.h("div", { class: "ez-col ez-col--sd-12" }, index.h("ez-form", { ref: (ref) => this._form = ref, key: "ezForm" + this._snkDataUnit.entityName, "data-element-id": "embedded", dataUnit: this._dataUnit, config: this._configManager.getConfig(this._dataState.insertionMode, this._dataUnit), recordsValidator: this.recordsValidator, class: this._showFormConfig ? 'snk-form__form--hidden' : '' }), this._showFormConfig &&
137
- index.h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this._dataUnit, configManager: this._configManager, onConfigClose: () => this.closeConfig() })))));
138
- }
139
- get _element() { return index.getElement(this); }
140
- };
141
- SnkForm.style = snkFormCss;
142
-
143
- exports.snk_form = SnkForm;
@@ -1,235 +0,0 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
2
- import { UserInterface, ObjectUtils, StringUtils, ApplicationContext, ElementIDUtils } from '@sankhyalabs/core';
3
- import { DataType, getConvertedValue } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
4
- import { CheckMode } from '@sankhyalabs/ezui/dist/collection/utils';
5
- import { V as VARS_BY_TYPE, D as DEFAULT_TYPE, b as TAGS_BY_TYPE } from './constants-8457af36.js';
6
-
7
- const snkConfigOptionsCss = ".sc-snk-config-options-h{--snk-config-options--border:2px solid var(--color--secondary-200, #D2D3DA);width:100%;border-radius:15px;border:var(--snk-config-options--border)}.config-options__switch-row.sc-snk-config-options{margin-top:-30px}";
8
-
9
- const SnkConfigOptions = class {
10
- constructor(hostRef) {
11
- registerInstance(this, hostRef);
12
- this.configOptionsChanged = createEvent(this, "configOptionsChanged", 7);
13
- this._defaultType = undefined;
14
- this.fieldConfig = {};
15
- this.idConfig = undefined;
16
- this.dataUnit = undefined;
17
- this.messagesBuilder = undefined;
18
- }
19
- onConfigDefault(optionSelected) {
20
- if (optionSelected != undefined) {
21
- this._defaultType = optionSelected;
22
- this.fieldConfig.defaultValue = {
23
- type: this._defaultType
24
- };
25
- this.configOptionsChanged.emit(this.fieldConfig);
26
- }
27
- }
28
- buildOptions() {
29
- var _a, _b, _c;
30
- let interfaceField = (_c = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getField((_b = this.fieldConfig) === null || _b === void 0 ? void 0 : _b.name)) === null || _c === void 0 ? void 0 : _c.userInterface;
31
- if (interfaceField === UserInterface.SEARCH) {
32
- interfaceField = UserInterface.INTEGERNUMBER;
33
- }
34
- return VARS_BY_TYPE.UserInterface[interfaceField];
35
- }
36
- enabledValueDefault() {
37
- var _a, _b, _c;
38
- const field = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getField((_b = this.fieldConfig) === null || _b === void 0 ? void 0 : _b.name);
39
- const allowDefault = (_c = field === null || field === void 0 ? void 0 : field.properties) === null || _c === void 0 ? void 0 : _c.allowDefault;
40
- const hasVariableVar = VARS_BY_TYPE.UserInterface.hasOwnProperty(field === null || field === void 0 ? void 0 : field.userInterface)
41
- || (field === null || field === void 0 ? void 0 : field.userInterface) === UserInterface.SEARCH;
42
- if ((allowDefault == undefined || allowDefault === "true") && hasVariableVar) {
43
- return true;
44
- }
45
- return false;
46
- }
47
- isAllowDefault() {
48
- var _a, _b;
49
- const allowDefault = (_b = (_a = this._fieldProperties) === null || _a === void 0 ? void 0 : _a.properties) === null || _b === void 0 ? void 0 : _b.allowDefault;
50
- if (allowDefault == undefined) {
51
- return true;
52
- }
53
- return allowDefault === "true";
54
- }
55
- loadDefaultValue() {
56
- var _a;
57
- if (this.fieldConfig == undefined) {
58
- this._defaultType = DEFAULT_TYPE.fixed;
59
- this.fieldConfig = {
60
- defaultValue: {
61
- type: this._defaultType
62
- }
63
- };
64
- }
65
- else if (((_a = this.fieldConfig.defaultValue) === null || _a === void 0 ? void 0 : _a.type) == undefined) {
66
- this._defaultType = DEFAULT_TYPE.fixed;
67
- this.fieldConfig.defaultValue = {
68
- type: this._defaultType
69
- };
70
- }
71
- else {
72
- this._defaultType = this.fieldConfig.defaultValue.type;
73
- }
74
- }
75
- getFieldProperties(field) {
76
- var _a;
77
- if (field != undefined) {
78
- return (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getField(field);
79
- }
80
- }
81
- getMessage(key, params) {
82
- return this.messagesBuilder.getMessage(key, params);
83
- }
84
- getDefaultType() {
85
- var _a;
86
- return (_a = this.fieldConfig.defaultValue.type) !== null && _a !== void 0 ? _a : DEFAULT_TYPE.fixed;
87
- }
88
- getEnabledByProperty(attribName, propertyName) {
89
- const fieldDescriptor = this._fieldProperties;
90
- if (fieldDescriptor == undefined) {
91
- return true;
92
- }
93
- const fieldProperties = fieldDescriptor.properties || {};
94
- return fieldProperties.hasOwnProperty(propertyName) ? fieldProperties[propertyName] !== "S" : fieldDescriptor[attribName] !== true;
95
- }
96
- getValueByProperty(property) {
97
- const properties = this._fieldProperties;
98
- if (properties != undefined && properties[property] === true) {
99
- return true;
100
- }
101
- return this.fieldConfig[property];
102
- }
103
- getValidatedValue(fieldValue) {
104
- var _a, _b;
105
- if (fieldValue == undefined) {
106
- return;
107
- }
108
- const field = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getField((_b = this.fieldConfig) === null || _b === void 0 ? void 0 : _b.name);
109
- const dataType = field === null || field === void 0 ? void 0 : field.dataType;
110
- if (dataType == undefined) {
111
- return;
112
- }
113
- const value = (fieldValue === null || fieldValue === void 0 ? void 0 : fieldValue.waitmessage) != undefined ? undefined :
114
- dataType !== DataType.OBJECT && dataType !== DataType.DATE
115
- && typeof fieldValue === "object"
116
- ? fieldValue.value
117
- : fieldValue;
118
- return dataType === DataType.OBJECT ? JSON.stringify(value) : value;
119
- }
120
- buildInputDefault({ value, enabled, label, name, required, userInterface }, properties = undefined, mode = undefined) {
121
- let options;
122
- let precision = 0;
123
- let prettyPrecision = 0;
124
- const TagName = userInterface == undefined || TAGS_BY_TYPE[userInterface] == undefined
125
- ? TAGS_BY_TYPE.DEFAULT
126
- : TAGS_BY_TYPE[userInterface];
127
- if (userInterface === UserInterface.OPTIONSELECTOR) {
128
- const prop = properties === null || properties === void 0 ? void 0 : properties.options;
129
- if (typeof prop === "string") {
130
- const parsed = ObjectUtils.stringToObject(prop);
131
- options = Object.keys(parsed).map(key => { return { value: key, label: parsed[key] }; });
132
- }
133
- else {
134
- options = prop;
135
- }
136
- }
137
- else if (userInterface === UserInterface.DECIMALNUMBER) {
138
- precision = Number((properties === null || properties === void 0 ? void 0 : properties.precision) || 2);
139
- prettyPrecision = Number((properties === null || properties === void 0 ? void 0 : properties.prettyPrecision) || precision);
140
- }
141
- return h(TagName, Object.assign({ value: value, enabled: enabled, label: label, "data-field-name": name, key: name, onEzChange: (evt) => this.onChange(evt === null || evt === void 0 ? void 0 : evt.detail) }, (this.getConditionalAttributes(userInterface, required, options, precision, prettyPrecision, mode))));
142
- }
143
- getConditionalAttributes(userInterface, required, options, precision, prettyPrecision, mode) {
144
- switch (userInterface) {
145
- case UserInterface.SEARCH:
146
- return {
147
- suppressEmptyOption: required,
148
- optionLoader: (searchArgument) => this.onSearch(searchArgument)
149
- };
150
- case UserInterface.OPTIONSELECTOR:
151
- return {
152
- suppressEmptyOption: required,
153
- options
154
- };
155
- case UserInterface.CHECKBOX:
156
- case UserInterface.SWITCH:
157
- return {
158
- mode
159
- };
160
- case UserInterface.INTEGERNUMBER:
161
- case UserInterface.DECIMALNUMBER:
162
- return {
163
- precision,
164
- prettyPrecision,
165
- onEzStartChange: (evt) => this.onChange(evt === null || evt === void 0 ? void 0 : evt.detail)
166
- };
167
- case UserInterface.DATE:
168
- case UserInterface.DATETIME:
169
- case UserInterface.TIME:
170
- return {
171
- onEzStartChange: (evt) => this.onChange(evt === null || evt === void 0 ? void 0 : evt.detail)
172
- };
173
- default:
174
- return {};
175
- }
176
- }
177
- onChange(fieldValue) {
178
- this.fieldConfig.defaultValue.value = this.getValidatedValue(fieldValue);
179
- this.configOptionsChanged.emit(this.fieldConfig);
180
- }
181
- onSearch(searchArgument) {
182
- if (this._application != undefined && this.fieldConfig != undefined) {
183
- return this._application.executeSearch(searchArgument, this.fieldConfig.name, this.dataUnit);
184
- }
185
- }
186
- buildField(descriptor, config) {
187
- const { name, label, readOnly, required, defaultValue } = config;
188
- const { userInterface, properties } = descriptor;
189
- const allowDefault = properties === null || properties === void 0 ? void 0 : properties.allowDefault;
190
- let value;
191
- let enabled = StringUtils.getBooleanValue(allowDefault, !readOnly);
192
- if (userInterface === UserInterface.FILE) {
193
- enabled = false;
194
- }
195
- if (enabled) {
196
- value = defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.value;
197
- if (value != undefined) {
198
- value = getConvertedValue(descriptor === null || descriptor === void 0 ? void 0 : descriptor.dataType, value);
199
- }
200
- }
201
- const configField = { value, enabled, label, name, required, userInterface };
202
- switch (userInterface) {
203
- case UserInterface.SWITCH:
204
- return this.buildInputDefault(configField, undefined, CheckMode.SWITCH);
205
- case UserInterface.CHECKBOX:
206
- return this.buildInputDefault(configField, undefined, CheckMode.REGULAR);
207
- case UserInterface.OPTIONSELECTOR:
208
- case UserInterface.DECIMALNUMBER:
209
- return this.buildInputDefault(configField, properties);
210
- default:
211
- return this.buildInputDefault(configField);
212
- }
213
- }
214
- componentWillLoad() {
215
- var _a;
216
- this.loadDefaultValue();
217
- this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
218
- this._fieldProperties = this.getFieldProperties((_a = this.fieldConfig) === null || _a === void 0 ? void 0 : _a.name);
219
- }
220
- componentDidLoad() {
221
- ElementIDUtils.addIDInfo(this._element, this.fieldConfig.name);
222
- }
223
- render() {
224
- var _a, _b;
225
- return (h(Host, null, h("div", { id: this.idConfig }, h("div", { class: "ez-row ez-padding--medium" }, h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-4 ez-padding--small" }, h("ez-text-input", { label: this.getMessage("snkConfigOptions.label.nameField"), value: (_a = this.fieldConfig) === null || _a === void 0 ? void 0 : _a.label, onEzChange: (evt) => { this.fieldConfig.label = evt.detail; this.configOptionsChanged.emit(this.fieldConfig); } })), h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-4 ez-padding--small" }, h("ez-combo-box", { label: this.getMessage("snkConfigOptions.label.typeValueDefault"), suppressEmptyOption: true, enabled: this.enabledValueDefault(), onEzChange: (evt) => { var _a; return this.onConfigDefault((_a = evt.detail) === null || _a === void 0 ? void 0 : _a.value); }, value: this.getDefaultType() }, h("option", { value: DEFAULT_TYPE.fixed }, this.getMessage("snkConfigOptions.options.valueFixed")), h("option", { value: DEFAULT_TYPE.variable }, this.getMessage("snkConfigOptions.options.variable")))), h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-4 ez-padding--small" }, this._defaultType === DEFAULT_TYPE.variable ?
226
- h("ez-combo-box", { label: this.getMessage("snkConfigOptions.label.valueDefault"), enabled: this.isAllowDefault(), onEzChange: (evt) => { var _a; this.fieldConfig.defaultValue.value = (_a = evt.detail) === null || _a === void 0 ? void 0 : _a.value; this.configOptionsChanged.emit(this.fieldConfig); }, value: this.fieldConfig.defaultValue.value, options: this.buildOptions() })
227
- :
228
- ((_b = this._fieldProperties) === null || _b === void 0 ? void 0 : _b.userInterface) &&
229
- this.buildField(this._fieldProperties, this.fieldConfig))), h("div", { class: "ez-row ez-padding--medium config-options__switch-row" }, h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-4 ez-padding--small" }, h("ez-check", { mode: CheckMode.SWITCH, label: this.getMessage("snkConfigOptions.label.clearDuplicate"), value: this.fieldConfig.cleanOnCopy, onEzChange: (evt) => { this.fieldConfig.cleanOnCopy = evt.detail; this.configOptionsChanged.emit(this.fieldConfig); } })), h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-4 ez-padding--small" }, h("ez-check", { mode: CheckMode.SWITCH, label: this.getMessage("snkConfigOptions.label.requiredField"), enabled: this.getEnabledByProperty("required", "systemRequired"), value: this.getValueByProperty("required"), onEzChange: (evt) => { this.fieldConfig.required = evt.detail; this.configOptionsChanged.emit(this.fieldConfig); } })), h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-4 ez-padding--small" }, h("ez-check", { mode: CheckMode.SWITCH, label: this.getMessage("snkConfigOptions.label.protectedField"), enabled: this.getEnabledByProperty("readOnly", "systemReadOnly"), value: this.getValueByProperty("readOnly"), onEzChange: (evt) => { this.fieldConfig.readOnly = evt.detail; this.configOptionsChanged.emit(this.fieldConfig); } }))))));
230
- }
231
- get _element() { return getElement(this); }
232
- };
233
- SnkConfigOptions.style = snkConfigOptionsCss;
234
-
235
- export { SnkConfigOptions as snk_config_options };