@sankhyalabs/sankhyablocks 10.1.0-dev.4 → 10.1.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 (448) hide show
  1. package/dist/cjs/{ConfigStorage-b29e31be.js → ConfigStorage-a1fab5ca.js} +19 -2
  2. package/dist/cjs/ContinuousInsertUtils-1ae0c6ac.js +41 -0
  3. package/dist/cjs/{DataFetcher-ed9d97ea.js → DataFetcher-384d2ce8.js} +2 -2733
  4. package/dist/cjs/{FormConfigHelper-ebb77625.js → FormConfigHelper-28fe4668.js} +44 -0
  5. package/dist/cjs/{ISave-81eb2fbc.js → ISave-ecbe9336.js} +1 -1
  6. package/dist/cjs/ImageUtils-c46f2d11.js +142 -0
  7. package/dist/cjs/{PersonalizedFilterUtils-7259cf65.js → PersonalizedFilterUtils-eccb267a.js} +13 -0
  8. package/dist/cjs/{SnkFormConfigManager-6838389c.js → SnkFormConfigManager-44386305.js} +7 -7
  9. package/dist/cjs/SnkMessageBuilder-a9300ebe.js +2833 -0
  10. package/dist/cjs/{SnkMultiSelectionListDataSource-1e804147.js → SnkMultiSelectionListDataSource-b951ed91.js} +61 -47
  11. package/dist/cjs/{auth-fetcher-cc28d847.js → auth-fetcher-6b134ec4.js} +1 -1
  12. package/dist/cjs/config-header.cjs.entry.js +1 -1
  13. package/dist/cjs/configs-button.cjs.entry.js +1 -1
  14. package/dist/cjs/css-shim-a27d231b.js +6 -0
  15. package/dist/cjs/{dataunit-fetcher-ab1cc071.js → dataunit-fetcher-93f53260.js} +26 -3
  16. package/dist/cjs/dom-ff96a4bc.js +75 -0
  17. package/dist/cjs/field-config_2.cjs.entry.js +3 -3
  18. package/dist/cjs/fields-layout.cjs.entry.js +8 -5
  19. package/dist/cjs/fields-selector.cjs.entry.js +3 -3
  20. package/dist/cjs/{form-config-fetcher-f0897eb5.js → form-config-fetcher-45d1964c.js} +19 -1
  21. package/dist/cjs/guides-configurator.cjs.entry.js +6 -4
  22. package/dist/cjs/{index-1cf293c1.js → index-1894343a.js} +1529 -177
  23. package/dist/cjs/{index-13d05f03.js → index-f0fe7e6e.js} +90 -21
  24. package/dist/cjs/loader.cjs.js +16 -2
  25. package/dist/cjs/pesquisa-grid_2.cjs.entry.js +6 -5
  26. package/dist/cjs/sankhyablocks.cjs.js +132 -4
  27. package/dist/cjs/shadow-css-7e3e0ab1.js +389 -0
  28. package/dist/cjs/snk-actions-button_9.cjs.entry.js +147 -101
  29. package/dist/cjs/snk-actions-form.cjs.entry.js +1 -1
  30. package/dist/cjs/snk-application.cjs.entry.js +29 -9
  31. package/dist/cjs/snk-attach.cjs.entry.js +53 -26
  32. package/dist/cjs/snk-client-confirm.cjs.entry.js +1 -1
  33. package/dist/cjs/snk-configurator.cjs.entry.js +1 -1
  34. package/dist/cjs/snk-crud.cjs.entry.js +351 -108
  35. package/dist/cjs/snk-custom-slot-elements.cjs.entry.js +1 -1
  36. package/dist/cjs/snk-custom-slot-guide.cjs.entry.js +40 -0
  37. package/dist/cjs/snk-data-exporter.cjs.entry.js +9 -7
  38. package/dist/cjs/{snk-data-unit-68992932.js → snk-data-unit-6abc5efc.js} +21 -12
  39. package/dist/cjs/snk-data-unit.cjs.entry.js +5 -4
  40. package/dist/cjs/snk-default-filter.cjs.entry.js +1 -1
  41. package/dist/cjs/snk-detail-view.cjs.entry.js +19 -20
  42. package/dist/cjs/snk-entity-list.cjs.entry.js +1 -1
  43. package/dist/cjs/snk-entity-search.cjs.entry.js +211 -0
  44. package/dist/cjs/snk-exporter-email-sender.cjs.entry.js +2 -2
  45. package/dist/cjs/snk-expression-group_2.cjs.entry.js +2 -2
  46. package/dist/cjs/{snk-filter-advanced-mode_2.cjs.entry.js → snk-filter-advanced-mode_3.cjs.entry.js} +41 -3
  47. package/dist/cjs/snk-filter-bar_4.cjs.entry.js +147 -94
  48. package/dist/cjs/snk-filter-binary-select.cjs.entry.js +1 -1
  49. package/dist/cjs/snk-filter-checkbox-list.cjs.entry.js +1 -1
  50. package/dist/cjs/snk-filter-detail.cjs.entry.js +3 -3
  51. package/dist/cjs/snk-filter-field-search_2.cjs.entry.js +2 -2
  52. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +5 -4
  53. package/dist/cjs/snk-filter-multi-select.cjs.entry.js +1 -1
  54. package/dist/cjs/snk-filter-number.cjs.entry.js +11 -7
  55. package/dist/cjs/snk-filter-period.cjs.entry.js +14 -7
  56. package/dist/cjs/snk-filter-search.cjs.entry.js +1 -1
  57. package/dist/cjs/snk-filter-text.cjs.entry.js +2 -2
  58. package/dist/cjs/snk-form-summary.cjs.entry.js +1 -1
  59. package/dist/cjs/snk-form-view.cjs.entry.js +70 -8
  60. package/dist/cjs/snk-form_2.cjs.entry.js +34 -10
  61. package/dist/cjs/snk-grid.cjs.entry.js +63 -30
  62. package/dist/cjs/{snk-guides-viewer-8b841753.js → snk-guides-viewer-b4ca3437.js} +114 -188
  63. package/dist/cjs/snk-guides-viewer.cjs.entry.js +11 -18
  64. package/dist/cjs/snk-image-input.cjs.entry.js +148 -0
  65. package/dist/cjs/snk-layout-form-config.cjs.entry.js +72 -0
  66. package/dist/cjs/snk-personalized-filter-editor.cjs.entry.js +1 -1
  67. package/dist/cjs/snk-personalized-filter.cjs.entry.js +8 -7
  68. package/dist/cjs/snk-pesquisa.cjs.entry.js +6 -6
  69. package/dist/cjs/snk-print-selector.cjs.entry.js +1 -1
  70. package/dist/cjs/snk-simple-crud.cjs.entry.js +30 -35
  71. package/dist/cjs/snk-taskbar.cjs.entry.js +237 -168
  72. package/dist/cjs/{sortable.esm-9a110bb7.js → sortable.esm-b87669ab.js} +76 -90
  73. package/dist/cjs/taskbar-elements-80eddec8.js +152 -0
  74. package/dist/cjs/teste-pesquisa.cjs.entry.js +1 -1
  75. package/dist/collection/collection-manifest.json +10 -1
  76. package/dist/collection/components/snk-actions-button/snk-actions-button.js +27 -3
  77. package/dist/collection/components/snk-application/errorhandler/snk-error-handler.js +1 -0
  78. package/dist/collection/components/snk-application/snk-application.js +20 -2
  79. package/dist/collection/components/snk-attach/snk-attach.css +29 -7
  80. package/dist/collection/components/snk-attach/snk-attach.js +82 -19
  81. package/dist/collection/components/snk-crud/snk-crud.css +46 -0
  82. package/dist/collection/components/snk-crud/snk-crud.js +190 -96
  83. package/dist/collection/components/snk-crud/subcomponents/GuideBuilder.js +1 -1
  84. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +5 -5
  85. package/dist/collection/components/snk-crud/subcomponents/snk-entity-search.css +17 -0
  86. package/dist/collection/components/snk-crud/subcomponents/snk-entity-search.js +330 -0
  87. package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js +90 -8
  88. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.css +22 -8
  89. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +165 -179
  90. package/dist/collection/components/snk-crud/utils/taskbarUtils.js +144 -0
  91. package/dist/collection/components/snk-custom-slot-guide/snk-custom-slot-guide.css +3 -0
  92. package/dist/collection/components/snk-custom-slot-guide/snk-custom-slot-guide.js +95 -0
  93. package/dist/collection/components/snk-data-exporter/exporter-email-sender/snk-exporter-email-sender.js +1 -1
  94. package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +20 -1
  95. package/dist/collection/components/snk-data-unit/snk-data-unit.js +9 -0
  96. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js +13 -9
  97. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js +14 -7
  98. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js +1 -1
  99. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +1 -1
  100. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.css +5 -1
  101. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +28 -2
  102. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.css +7 -1
  103. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +22 -8
  104. package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +1 -6
  105. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +166 -78
  106. package/dist/collection/components/snk-form-config/FormConfigHelper.js +42 -0
  107. package/dist/collection/components/snk-form-config/SnkFormConfigManager.js +6 -6
  108. package/dist/collection/components/snk-form-config/field-item/field-config/field-config.css +1 -0
  109. package/dist/collection/components/snk-form-config/fields-layout/fields-layout.css +16 -0
  110. package/dist/collection/components/snk-form-config/fields-layout/fields-layout.js +6 -3
  111. package/dist/collection/components/snk-form-config/guides-configurator/guides-configurator.css +3 -4
  112. package/dist/collection/components/snk-form-config/guides-configurator/guides-configurator.js +5 -3
  113. package/dist/collection/components/snk-form-config/snk-form-config.js +53 -6
  114. package/dist/collection/components/snk-grid/snk-grid.css +24 -3
  115. package/dist/collection/components/snk-grid/snk-grid.js +170 -18
  116. package/dist/collection/components/snk-grid-config/snk-grid-config.js +140 -39
  117. package/dist/collection/components/snk-image-input/snk-image-input.css +3 -0
  118. package/dist/collection/components/snk-image-input/snk-image-input.js +326 -0
  119. package/dist/collection/components/snk-image-input/utils/ImageUtils.js +133 -0
  120. package/dist/collection/components/snk-layout-form-config/snk-layout-form-config.js +1 -1
  121. package/dist/collection/components/snk-layout-form-config/snk-view-representation/snk-view-representation.js +1 -1
  122. package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js +1 -1
  123. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/utils/PersonalizedFilterUtils.js +13 -0
  124. package/dist/collection/components/snk-pesquisa/snk-pesquisa.js +0 -4
  125. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +35 -23
  126. package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.css +8 -0
  127. package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.js +38 -2
  128. package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +54 -37
  129. package/dist/collection/components/snk-taskbar/elements/taskbar-split-button/taskbar-split-button.js +27 -1
  130. package/dist/collection/components/snk-taskbar/processor/simple-taskbar-processor.js +55 -0
  131. package/dist/collection/components/snk-taskbar/snk-taskbar.css +44 -1
  132. package/dist/collection/components/snk-taskbar/snk-taskbar.js +304 -174
  133. package/dist/collection/components/snk-taskbar/subcomponents/snk-taskbar-skeleton.css +12 -0
  134. package/dist/collection/components/snk-taskbar/subcomponents/snk-taskbar-skeleton.js +19 -0
  135. package/dist/collection/lib/configs/ConfigStorage.js +5 -0
  136. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.js +24 -2
  137. package/dist/collection/lib/http/data-fetcher/fetchers/grid-config-fetcher.js +12 -0
  138. package/dist/collection/lib/http/data-fetcher/fetchers/resource-fetcher.js +18 -0
  139. package/dist/collection/lib/message/SnkMessageBuilder.js +11 -2
  140. package/dist/collection/lib/message/messageResourceEnUSUtils.js +2 -0
  141. package/dist/collection/lib/message/messageResourceEsESUtils.js +2 -0
  142. package/dist/collection/lib/message/messageResourcePtBRUtils.js +2 -0
  143. package/dist/collection/lib/message/resources/en-us/snk-crud.msg.js +9 -1
  144. package/dist/collection/lib/message/resources/en-us/snk-form.msg.js +7 -0
  145. package/dist/collection/lib/message/resources/en-us/snk-image-input.msg.js +11 -0
  146. package/dist/collection/lib/message/resources/en-us/snk-layout-form-config.msg.js +10 -2
  147. package/dist/collection/lib/message/resources/es-es/snk-crud.msg.js +9 -1
  148. package/dist/collection/lib/message/resources/es-es/snk-form.msg.js +7 -0
  149. package/dist/collection/lib/message/resources/es-es/snk-image-input.msg.js +11 -0
  150. package/dist/collection/lib/message/resources/es-es/snk-layout-form-config.msg.js +8 -0
  151. package/dist/collection/lib/message/resources/pt-br/snk-configurator.msg.js +1 -1
  152. package/dist/collection/lib/message/resources/pt-br/snk-crud.msg.js +9 -1
  153. package/dist/collection/lib/message/resources/pt-br/snk-form.msg.js +8 -1
  154. package/dist/collection/lib/message/resources/pt-br/snk-image-input.msg.js +11 -0
  155. package/dist/collection/lib/message/resources/pt-br/snk-layout-form-config.msg.js +10 -2
  156. package/dist/components/ConfigStorage.js +17 -0
  157. package/dist/components/ContinuousInsertUtils.js +1 -1
  158. package/dist/components/DataFetcher.js +3 -2713
  159. package/dist/components/PersonalizedFilterUtils.js +13 -0
  160. package/dist/components/SnkFormConfigManager.js +6 -6
  161. package/dist/components/SnkMessageBuilder.js +2831 -0
  162. package/dist/components/dataunit-fetcher.js +25 -2
  163. package/dist/components/field-config2.js +44 -2
  164. package/dist/components/fields-layout2.js +6 -3
  165. package/dist/components/form-config-fetcher.js +18 -0
  166. package/dist/components/guides-configurator2.js +5 -3
  167. package/dist/components/index.d.ts +4 -0
  168. package/dist/components/index.js +4 -0
  169. package/dist/components/index2.js +90 -21
  170. package/dist/components/snk-actions-button2.js +6 -3
  171. package/dist/components/snk-application2.js +22 -2
  172. package/dist/components/snk-attach2.js +59 -29
  173. package/dist/components/snk-crud.js +435 -174
  174. package/dist/components/snk-custom-slot-guide.d.ts +11 -0
  175. package/dist/components/snk-custom-slot-guide.js +55 -0
  176. package/dist/components/snk-data-exporter2.js +3 -1
  177. package/dist/components/snk-data-unit2.js +10 -1
  178. package/dist/components/snk-detail-view2.js +250 -292
  179. package/dist/components/snk-entity-search.d.ts +11 -0
  180. package/dist/components/snk-entity-search.js +6 -0
  181. package/dist/components/snk-entity-search2.js +231 -0
  182. package/dist/components/snk-exporter-email-sender2.js +1 -1
  183. package/dist/components/snk-filter-bar2.js +116 -80
  184. package/dist/components/snk-filter-detail2.js +1 -1
  185. package/dist/components/snk-filter-item2.js +9 -3
  186. package/dist/components/snk-filter-modal2.js +22 -9
  187. package/dist/components/snk-filter-number.js +12 -8
  188. package/dist/components/snk-filter-period.js +13 -6
  189. package/dist/components/snk-filter-text.js +1 -1
  190. package/dist/components/snk-form-config2.js +29 -5
  191. package/dist/components/snk-form-view2.js +79 -10
  192. package/dist/components/snk-grid-config2.js +96 -38
  193. package/dist/components/snk-grid2.js +103 -59
  194. package/dist/components/snk-image-input.d.ts +11 -0
  195. package/dist/components/snk-image-input.js +6 -0
  196. package/dist/components/snk-image-input2.js +302 -0
  197. package/dist/components/snk-layout-form-config2.js +1 -1
  198. package/dist/components/snk-personalized-filter2.js +1 -1
  199. package/dist/components/snk-pesquisa2.js +0 -1
  200. package/dist/components/snk-simple-crud2.js +47 -46
  201. package/dist/components/snk-taskbar-skeleton.d.ts +11 -0
  202. package/dist/components/snk-taskbar-skeleton.js +6 -0
  203. package/dist/components/snk-taskbar-skeleton2.js +29 -0
  204. package/dist/components/snk-taskbar2.js +310 -218
  205. package/dist/components/snk-view-representation2.js +1 -1
  206. package/dist/components/sortable.esm.js +76 -90
  207. package/dist/components/taskbar-actions-button2.js +21 -2
  208. package/dist/components/taskbar-split-button2.js +10 -1
  209. package/dist/esm/{ConfigStorage-13d80e36.js → ConfigStorage-76872695.js} +19 -2
  210. package/dist/esm/ContinuousInsertUtils-bce77dc1.js +39 -0
  211. package/dist/esm/{DataFetcher-f4ccd9f3.js → DataFetcher-e60f8d53.js} +3 -2713
  212. package/dist/esm/{FormConfigHelper-4e42f0b6.js → FormConfigHelper-d09669f3.js} +43 -1
  213. package/dist/esm/{ISave-288fa9df.js → ISave-4929c071.js} +1 -1
  214. package/dist/esm/ImageUtils-7f3a4149.js +136 -0
  215. package/dist/esm/{PersonalizedFilterUtils-2db38ff2.js → PersonalizedFilterUtils-d2439a9a.js} +13 -0
  216. package/dist/esm/{SnkFormConfigManager-3ee2937b.js → SnkFormConfigManager-83f6b22f.js} +7 -7
  217. package/dist/esm/SnkMessageBuilder-1eb7a1af.js +2831 -0
  218. package/dist/esm/{SnkMultiSelectionListDataSource-5d3a93f2.js → SnkMultiSelectionListDataSource-7fe25a58.js} +55 -41
  219. package/dist/esm/{auth-fetcher-59ab0c67.js → auth-fetcher-1a31c1e4.js} +1 -1
  220. package/dist/esm/config-header.entry.js +1 -1
  221. package/dist/esm/configs-button.entry.js +1 -1
  222. package/dist/esm/css-shim-9f2d321e.js +4 -0
  223. package/dist/esm/{dataunit-fetcher-c4f9f222.js → dataunit-fetcher-050b6d31.js} +25 -2
  224. package/dist/esm/dom-64053c71.js +73 -0
  225. package/dist/esm/field-config_2.entry.js +3 -3
  226. package/dist/esm/fields-layout.entry.js +8 -5
  227. package/dist/esm/fields-selector.entry.js +3 -3
  228. package/dist/esm/{form-config-fetcher-6a00fe9e.js → form-config-fetcher-b44b2727.js} +19 -1
  229. package/dist/esm/guides-configurator.entry.js +6 -4
  230. package/dist/esm/{index-479e1293.js → index-04f73a26.js} +1521 -177
  231. package/dist/esm/{index-446f9341.js → index-ea250be6.js} +90 -21
  232. package/dist/esm/loader.js +17 -3
  233. package/dist/esm/pesquisa-grid_2.entry.js +6 -5
  234. package/dist/esm/sankhyablocks.js +133 -5
  235. package/dist/esm/shadow-css-98135883.js +387 -0
  236. package/dist/esm/snk-actions-button_9.entry.js +148 -102
  237. package/dist/esm/snk-actions-form.entry.js +1 -1
  238. package/dist/esm/snk-application.entry.js +28 -8
  239. package/dist/esm/snk-attach.entry.js +52 -25
  240. package/dist/esm/snk-client-confirm.entry.js +1 -1
  241. package/dist/esm/snk-configurator.entry.js +1 -1
  242. package/dist/esm/snk-crud.entry.js +343 -100
  243. package/dist/esm/snk-custom-slot-elements.entry.js +1 -1
  244. package/dist/esm/snk-custom-slot-guide.entry.js +36 -0
  245. package/dist/esm/snk-data-exporter.entry.js +9 -7
  246. package/dist/esm/{snk-data-unit-0edeb967.js → snk-data-unit-ca2c9858.js} +12 -3
  247. package/dist/esm/snk-data-unit.entry.js +5 -4
  248. package/dist/esm/snk-default-filter.entry.js +1 -1
  249. package/dist/esm/snk-detail-view.entry.js +17 -18
  250. package/dist/esm/snk-entity-list.entry.js +1 -1
  251. package/dist/esm/snk-entity-search.entry.js +207 -0
  252. package/dist/esm/snk-exporter-email-sender.entry.js +2 -2
  253. package/dist/esm/snk-expression-group_2.entry.js +2 -2
  254. package/dist/esm/{snk-filter-advanced-mode_2.entry.js → snk-filter-advanced-mode_3.entry.js} +41 -4
  255. package/dist/esm/snk-filter-bar_4.entry.js +148 -95
  256. package/dist/esm/snk-filter-binary-select.entry.js +1 -1
  257. package/dist/esm/snk-filter-checkbox-list.entry.js +1 -1
  258. package/dist/esm/snk-filter-detail.entry.js +3 -3
  259. package/dist/esm/snk-filter-field-search_2.entry.js +2 -2
  260. package/dist/esm/snk-filter-modal-item.entry.js +5 -4
  261. package/dist/esm/snk-filter-multi-select.entry.js +1 -1
  262. package/dist/esm/snk-filter-number.entry.js +11 -7
  263. package/dist/esm/snk-filter-period.entry.js +14 -7
  264. package/dist/esm/snk-filter-search.entry.js +1 -1
  265. package/dist/esm/snk-filter-text.entry.js +2 -2
  266. package/dist/esm/snk-form-summary.entry.js +1 -1
  267. package/dist/esm/snk-form-view.entry.js +71 -9
  268. package/dist/esm/snk-form_2.entry.js +34 -10
  269. package/dist/esm/snk-grid.entry.js +60 -27
  270. package/dist/esm/{snk-guides-viewer-9cd4d20f.js → snk-guides-viewer-cc37535b.js} +115 -189
  271. package/dist/esm/snk-guides-viewer.entry.js +11 -18
  272. package/dist/esm/snk-image-input.entry.js +144 -0
  273. package/dist/esm/snk-layout-form-config.entry.js +68 -0
  274. package/dist/esm/snk-personalized-filter-editor.entry.js +1 -1
  275. package/dist/esm/snk-personalized-filter.entry.js +8 -7
  276. package/dist/esm/snk-pesquisa.entry.js +6 -6
  277. package/dist/esm/snk-print-selector.entry.js +1 -1
  278. package/dist/esm/snk-simple-crud.entry.js +28 -33
  279. package/dist/esm/snk-taskbar.entry.js +238 -169
  280. package/dist/esm/{sortable.esm-842f85a3.js → sortable.esm-bc277c12.js} +76 -90
  281. package/dist/esm/taskbar-elements-63651ca7.js +149 -0
  282. package/dist/esm/teste-pesquisa.entry.js +1 -1
  283. package/dist/sankhyablocks/p-09ba6bd4.js +1 -0
  284. package/dist/sankhyablocks/{p-7f7fe6c4.entry.js → p-0a160fb5.entry.js} +1 -1
  285. package/dist/sankhyablocks/p-10f27dc6.entry.js +1 -0
  286. package/dist/sankhyablocks/{p-162bddae.entry.js → p-175c9576.entry.js} +1 -1
  287. package/dist/sankhyablocks/p-20af4b6a.entry.js +1 -0
  288. package/dist/sankhyablocks/p-225f92cf.entry.js +1 -0
  289. package/dist/sankhyablocks/p-251aee41.entry.js +11 -0
  290. package/dist/sankhyablocks/{p-c4fcf1fb.entry.js → p-27e0cd68.entry.js} +1 -1
  291. package/dist/sankhyablocks/p-2af815bb.entry.js +1 -0
  292. package/dist/sankhyablocks/p-2af8aca3.js +1 -0
  293. package/dist/sankhyablocks/p-2c9d0870.js +2 -0
  294. package/dist/sankhyablocks/{p-cb4343c4.entry.js → p-2cc2526e.entry.js} +1 -1
  295. package/dist/sankhyablocks/{p-75af335e.entry.js → p-2ebda226.entry.js} +1 -1
  296. package/dist/sankhyablocks/p-3072136e.js +1 -0
  297. package/dist/sankhyablocks/p-33492640.entry.js +1 -0
  298. package/dist/sankhyablocks/p-35317d9a.entry.js +1 -0
  299. package/dist/sankhyablocks/{p-1c2971e4.js → p-3704bf1b.js} +1 -1
  300. package/dist/sankhyablocks/p-3870748a.js +28 -0
  301. package/dist/sankhyablocks/p-3a35917e.entry.js +1 -0
  302. package/dist/sankhyablocks/{p-78ff8734.js → p-3c990841.js} +2 -2
  303. package/dist/sankhyablocks/p-420b39b5.js +1 -0
  304. package/dist/sankhyablocks/{p-49ddc27a.entry.js → p-438a225f.entry.js} +1 -1
  305. package/dist/sankhyablocks/p-46f75667.entry.js +1 -0
  306. package/dist/sankhyablocks/{p-53599b26.js → p-4f7adf97.js} +2 -2
  307. package/dist/sankhyablocks/p-554c0e54.js +1 -0
  308. package/dist/sankhyablocks/{p-27482793.entry.js → p-5aae5c74.entry.js} +1 -1
  309. package/dist/sankhyablocks/p-68c1a093.js +1 -0
  310. package/dist/sankhyablocks/p-6ae7543b.entry.js +1 -0
  311. package/dist/sankhyablocks/{p-825098c1.entry.js → p-752c57f4.entry.js} +1 -1
  312. package/dist/sankhyablocks/{p-e258de96.entry.js → p-76729994.entry.js} +1 -1
  313. package/dist/sankhyablocks/p-771b137e.js +1 -0
  314. package/dist/sankhyablocks/p-77f608bc.entry.js +1 -0
  315. package/dist/sankhyablocks/p-7c8bf699.entry.js +1 -0
  316. package/dist/sankhyablocks/p-855ccf64.entry.js +1 -0
  317. package/dist/sankhyablocks/p-8a8900a9.entry.js +1 -0
  318. package/dist/sankhyablocks/p-8b4d6719.js +1 -0
  319. package/dist/sankhyablocks/{p-3d41f5a8.entry.js → p-8d946600.entry.js} +1 -1
  320. package/dist/sankhyablocks/{p-96d45943.entry.js → p-90ae6c2e.entry.js} +1 -1
  321. package/dist/sankhyablocks/p-95af0bb1.entry.js +1 -0
  322. package/dist/sankhyablocks/{p-7b3ca294.entry.js → p-9742ea0e.entry.js} +1 -1
  323. package/dist/sankhyablocks/p-98241c21.entry.js +1 -0
  324. package/dist/sankhyablocks/{p-2fdac5e6.entry.js → p-9e109f5e.entry.js} +1 -1
  325. package/dist/sankhyablocks/p-9e7dc97d.entry.js +1 -0
  326. package/dist/sankhyablocks/p-a2a9f520.entry.js +1 -0
  327. package/dist/sankhyablocks/p-a46ac091.js +1 -0
  328. package/dist/sankhyablocks/p-a73b6b00.js +1 -0
  329. package/dist/sankhyablocks/p-ab12f544.entry.js +1 -0
  330. package/dist/sankhyablocks/p-ab5e12fa.js +1 -0
  331. package/dist/sankhyablocks/p-ac384a1e.entry.js +1 -0
  332. package/dist/sankhyablocks/{p-180716b2.entry.js → p-ae326d06.entry.js} +1 -1
  333. package/dist/sankhyablocks/p-aff2d081.entry.js +1 -0
  334. package/dist/sankhyablocks/p-b3b51693.entry.js +1 -0
  335. package/dist/sankhyablocks/p-b555ce38.entry.js +1 -0
  336. package/dist/sankhyablocks/p-bab4cde4.entry.js +1 -0
  337. package/dist/sankhyablocks/p-c3ec6642.js +19 -0
  338. package/dist/sankhyablocks/p-cbb8e351.js +7 -0
  339. package/dist/sankhyablocks/{p-c3dbf441.entry.js → p-cc64239c.entry.js} +1 -1
  340. package/dist/sankhyablocks/{p-471b34f4.entry.js → p-cd00a3d1.entry.js} +1 -1
  341. package/dist/sankhyablocks/p-ce3b284c.entry.js +1 -0
  342. package/dist/sankhyablocks/p-ce8ccd72.entry.js +1 -0
  343. package/dist/sankhyablocks/{p-4c763b10.entry.js → p-d657f71f.entry.js} +1 -1
  344. package/dist/sankhyablocks/p-d972a9c1.js +60 -0
  345. package/dist/sankhyablocks/p-da455c82.js +12 -0
  346. package/dist/sankhyablocks/p-e5a3711f.js +1 -0
  347. package/dist/sankhyablocks/{p-9a63f3f7.entry.js → p-e737fd5a.entry.js} +1 -1
  348. package/dist/sankhyablocks/p-ee56dda6.entry.js +1 -0
  349. package/dist/sankhyablocks/p-ef9343c3.entry.js +1 -0
  350. package/dist/sankhyablocks/p-efd18bc2.entry.js +1 -0
  351. package/dist/sankhyablocks/{p-667cab42.entry.js → p-f152ef98.entry.js} +1 -1
  352. package/dist/sankhyablocks/p-f185d5ad.js +1 -0
  353. package/dist/sankhyablocks/{p-7e250432.entry.js → p-f7170e10.entry.js} +1 -1
  354. package/dist/sankhyablocks/{p-7345782c.entry.js → p-f921270b.entry.js} +1 -1
  355. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  356. package/dist/types/components/snk-actions-button/snk-actions-button.d.ts +4 -0
  357. package/dist/types/components/snk-application/snk-application.d.ts +1 -1
  358. package/dist/types/components/snk-attach/snk-attach.d.ts +20 -4
  359. package/dist/types/components/snk-crud/snk-crud.d.ts +37 -9
  360. package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +1 -1
  361. package/dist/types/components/snk-crud/subcomponents/snk-entity-search.d.ts +62 -0
  362. package/dist/types/components/snk-crud/subcomponents/snk-form-view.d.ts +12 -0
  363. package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +28 -18
  364. package/dist/types/components/snk-crud/utils/taskbarUtils.d.ts +13 -0
  365. package/dist/types/components/snk-custom-slot-guide/snk-custom-slot-guide.d.ts +16 -0
  366. package/dist/types/components/snk-data-exporter/snk-data-exporter.d.ts +4 -0
  367. package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +1 -0
  368. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-number.d.ts +1 -1
  369. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-period.d.ts +1 -0
  370. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +5 -1
  371. package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +2 -1
  372. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +33 -16
  373. package/dist/types/components/snk-form-config/FormConfigHelper.d.ts +6 -1
  374. package/dist/types/components/snk-form-config/SnkFormConfigManager.d.ts +1 -1
  375. package/dist/types/components/snk-form-config/fields-layout/fields-layout.d.ts +2 -2
  376. package/dist/types/components/snk-form-config/guides-configurator/guides-configurator.d.ts +1 -1
  377. package/dist/types/components/snk-form-config/snk-form-config.d.ts +9 -2
  378. package/dist/types/components/snk-grid/snk-grid.d.ts +29 -1
  379. package/dist/types/components/snk-grid-config/snk-grid-config.d.ts +11 -0
  380. package/dist/types/components/snk-image-input/snk-image-input.d.ts +56 -0
  381. package/dist/types/components/snk-image-input/utils/ImageUtils.d.ts +15 -0
  382. package/dist/types/components/snk-personalized-filter/interfaces/IParameter.d.ts +1 -0
  383. package/dist/types/components/snk-pesquisa/snk-pesquisa.d.ts +0 -1
  384. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +4 -1
  385. package/dist/types/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.d.ts +6 -0
  386. package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +29 -2
  387. package/dist/types/components/snk-taskbar/elements/taskbar-split-button/taskbar-split-button.d.ts +5 -0
  388. package/dist/types/components/snk-taskbar/processor/simple-taskbar-processor.d.ts +31 -0
  389. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +37 -23
  390. package/dist/types/components/snk-taskbar/subcomponents/snk-taskbar-skeleton.d.ts +3 -0
  391. package/dist/types/components.d.ts +377 -5
  392. package/dist/types/lib/configs/ConfigStorage.d.ts +1 -0
  393. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.d.ts +2 -1
  394. package/dist/types/lib/http/data-fetcher/fetchers/grid-config-fetcher.d.ts +1 -0
  395. package/dist/types/lib/http/data-fetcher/fetchers/resource-fetcher.d.ts +1 -0
  396. package/dist/types/lib/message/resources/en-us/snk-image-input.msg.d.ts +1 -0
  397. package/dist/types/lib/message/resources/es-es/snk-image-input.msg.d.ts +1 -0
  398. package/dist/types/lib/message/resources/pt-br/snk-image-input.msg.d.ts +1 -0
  399. package/package.json +6 -7
  400. package/react/components.d.ts +4 -0
  401. package/react/components.js +4 -0
  402. package/react/components.js.map +1 -1
  403. package/dist/cjs/snk-simple-bar.cjs.entry.js +0 -45
  404. package/dist/cjs/taskbar-elements-fb5d1e08.js +0 -132
  405. package/dist/cjs/taskbar-processor-2fba34a8.js +0 -53
  406. package/dist/esm/snk-simple-bar.entry.js +0 -41
  407. package/dist/esm/taskbar-elements-faaf5d8f.js +0 -129
  408. package/dist/esm/taskbar-processor-3436124c.js +0 -51
  409. package/dist/sankhyablocks/p-093f58fa.entry.js +0 -1
  410. package/dist/sankhyablocks/p-0e279e7a.js +0 -1
  411. package/dist/sankhyablocks/p-11346b8d.entry.js +0 -1
  412. package/dist/sankhyablocks/p-1858c023.entry.js +0 -1
  413. package/dist/sankhyablocks/p-1a0caadb.js +0 -1
  414. package/dist/sankhyablocks/p-21107f0d.entry.js +0 -1
  415. package/dist/sankhyablocks/p-26e0f63c.entry.js +0 -1
  416. package/dist/sankhyablocks/p-34df7eca.entry.js +0 -1
  417. package/dist/sankhyablocks/p-34f447ba.entry.js +0 -1
  418. package/dist/sankhyablocks/p-38e56b68.entry.js +0 -1
  419. package/dist/sankhyablocks/p-3abeeefa.entry.js +0 -1
  420. package/dist/sankhyablocks/p-3d021bef.entry.js +0 -1
  421. package/dist/sankhyablocks/p-3ed04f0d.entry.js +0 -1
  422. package/dist/sankhyablocks/p-44939a0e.entry.js +0 -1
  423. package/dist/sankhyablocks/p-51833248.js +0 -7
  424. package/dist/sankhyablocks/p-5304753a.js +0 -60
  425. package/dist/sankhyablocks/p-557368df.entry.js +0 -1
  426. package/dist/sankhyablocks/p-55798617.js +0 -1
  427. package/dist/sankhyablocks/p-583151c5.entry.js +0 -1
  428. package/dist/sankhyablocks/p-60dd1d27.entry.js +0 -1
  429. package/dist/sankhyablocks/p-6180de07.entry.js +0 -1
  430. package/dist/sankhyablocks/p-80014119.entry.js +0 -1
  431. package/dist/sankhyablocks/p-8f73da95.js +0 -1
  432. package/dist/sankhyablocks/p-91a9abb6.entry.js +0 -1
  433. package/dist/sankhyablocks/p-9317942f.js +0 -26
  434. package/dist/sankhyablocks/p-988afe78.js +0 -1
  435. package/dist/sankhyablocks/p-a2ed1ebd.entry.js +0 -1
  436. package/dist/sankhyablocks/p-a5108625.entry.js +0 -1
  437. package/dist/sankhyablocks/p-a644a956.js +0 -1
  438. package/dist/sankhyablocks/p-ae108ffd.entry.js +0 -11
  439. package/dist/sankhyablocks/p-b4322b87.entry.js +0 -1
  440. package/dist/sankhyablocks/p-b7e891cc.entry.js +0 -1
  441. package/dist/sankhyablocks/p-b987e15d.js +0 -1
  442. package/dist/sankhyablocks/p-bb2f5f38.js +0 -1
  443. package/dist/sankhyablocks/p-d8d8169b.js +0 -2
  444. package/dist/sankhyablocks/p-d9c54991.js +0 -1
  445. package/dist/sankhyablocks/p-dc851b6e.entry.js +0 -1
  446. package/dist/sankhyablocks/p-e9021f79.entry.js +0 -1
  447. package/dist/sankhyablocks/p-f15478a1.js +0 -1
  448. package/dist/sankhyablocks/p-f8f29e1a.entry.js +0 -1
@@ -1,7 +0,0 @@
1
- /**!
2
- * Sortable 1.15.6
3
- * @author RubaXa <trash@rubaxa.org>
4
- * @author owenm <owen23355@gmail.com>
5
- * @license MIT
6
- */
7
- function t(t,n){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);n&&(e=e.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),i.push.apply(i,e)}return i}function n(n){for(var i=1;i<arguments.length;i++){var o=null!=arguments[i]?arguments[i]:{};i%2?t(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):t(Object(o)).forEach((function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(o,t))}))}return n}function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function e(t,n,i){return n in t?Object.defineProperty(t,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[n]=i,t}function o(){return o=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var i=arguments[n];for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&(t[e]=i[e])}return t},o.apply(this,arguments)}function r(t,n){if(null==t)return{};var i,e,o=function(t,n){if(null==t)return{};var i,e,o={},r=Object.keys(t);for(e=0;e<r.length;e++)n.indexOf(i=r[e])>=0||(o[i]=t[i]);return o}(t,n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(e=0;e<r.length;e++)n.indexOf(i=r[e])>=0||Object.prototype.propertyIsEnumerable.call(t,i)&&(o[i]=t[i])}return o}function a(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var u=a(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),s=a(/Edge/i),l=a(/firefox/i),c=a(/safari/i)&&!a(/chrome/i)&&!a(/android/i),f=a(/iP(ad|od|hone)/i),h=a(/chrome/i)&&a(/android/i),d={capture:!1,passive:!1};function v(t,n,i){t.addEventListener(n,i,!u&&d)}function m(t,n,i){t.removeEventListener(n,i,!u&&d)}function p(t,n){if(n){if(">"===n[0]&&(n=n.substring(1)),t)try{if(t.matches)return t.matches(n);if(t.msMatchesSelector)return t.msMatchesSelector(n);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(n)}catch(t){return!1}return!1}}function g(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function b(t,n,i,e){if(t){i=i||document;do{if(null!=n&&(">"===n[0]?t.parentNode===i&&p(t,n):p(t,n))||e&&t===i)return t;if(t===i)break}while(t=g(t))}return null}var w,E=/\s+/g;function y(t,n,i){if(t&&n)if(t.classList)t.classList[i?"add":"remove"](n);else{var e=(" "+t.className+" ").replace(E," ").replace(" "+n+" "," ");t.className=(e+(i?" "+n:"")).replace(E," ")}}function S(t,n,i){var e=t&&t.style;if(e){if(void 0===i)return document.defaultView&&document.defaultView.getComputedStyle?i=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(i=t.currentStyle),void 0===n?i:i[n];n in e||-1!==n.indexOf("webkit")||(n="-webkit-"+n),e[n]=i+("string"==typeof i?"":"px")}}function M(t,n){var i="";if("string"==typeof t)i=t;else do{var e=S(t,"transform");e&&"none"!==e&&(i=e+" "+i)}while(!n&&(t=t.parentNode));var o=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return o&&new o(i)}function T(t,n,i){if(t){var e=t.getElementsByTagName(n),o=0,r=e.length;if(i)for(;o<r;o++)i(e[o],o);return e}return[]}function O(){return document.scrollingElement||document.documentElement}function I(t,n,i,e,o){if(t.getBoundingClientRect||t===window){var r,a,s,l,c,f,h;if(t!==window&&t.parentNode&&t!==O()?(a=(r=t.getBoundingClientRect()).top,s=r.left,l=r.bottom,c=r.right,f=r.height,h=r.width):(a=0,s=0,l=window.innerHeight,c=window.innerWidth,f=window.innerHeight,h=window.innerWidth),(n||i)&&t!==window&&(o=o||t.parentNode,!u))do{if(o&&o.getBoundingClientRect&&("none"!==S(o,"transform")||i&&"static"!==S(o,"position"))){var d=o.getBoundingClientRect();a-=d.top+parseInt(S(o,"border-top-width")),s-=d.left+parseInt(S(o,"border-left-width")),l=a+r.height,c=s+r.width;break}}while(o=o.parentNode);if(e&&t!==window){var v=M(o||t),m=v&&v.a,p=v&&v.d;v&&(l=(a/=p)+(f/=p),c=(s/=m)+(h/=m))}return{top:a,left:s,bottom:l,right:c,width:h,height:f}}}function x(t,n,i){for(var e=j(t,!0),o=I(t)[n];e;){var r=I(e)[i];if(!("top"===i||"left"===i?o>=r:o<=r))return e;if(e===O())break;e=j(e,!1)}return!1}function _(t,n,i,e){for(var o=0,r=0,a=t.children;r<a.length;){if("none"!==a[r].style.display&&a[r]!==Nt.ghost&&(e||a[r]!==Nt.dragged)&&b(a[r],i.draggable,t,!1)){if(o===n)return a[r];o++}r++}return null}function D(t,n){for(var i=t.lastElementChild;i&&(i===Nt.ghost||"none"===S(i,"display")||n&&!p(i,n));)i=i.previousElementSibling;return i||null}function k(t,n){var i=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)"TEMPLATE"===t.nodeName.toUpperCase()||t===Nt.clone||n&&!p(t,n)||i++;return i}function C(t){var n=0,i=0,e=O();if(t)do{var o=M(t);n+=t.scrollLeft*o.a,i+=t.scrollTop*o.d}while(t!==e&&(t=t.parentNode));return[n,i]}function j(t,n){if(!t||!t.getBoundingClientRect)return O();var i=t,e=!1;do{if(i.clientWidth<i.scrollWidth||i.clientHeight<i.scrollHeight){var o=S(i);if(i.clientWidth<i.scrollWidth&&("auto"==o.overflowX||"scroll"==o.overflowX)||i.clientHeight<i.scrollHeight&&("auto"==o.overflowY||"scroll"==o.overflowY)){if(!i.getBoundingClientRect||i===document.body)return O();if(e||n)return i;e=!0}}}while(i=i.parentNode);return O()}function A(t,n){return Math.round(t.top)===Math.round(n.top)&&Math.round(t.left)===Math.round(n.left)&&Math.round(t.height)===Math.round(n.height)&&Math.round(t.width)===Math.round(n.width)}function z(t,n){return function(){if(!w){var i=arguments,e=this;1===i.length?t.call(e,i[0]):t.apply(e,i),w=setTimeout((function(){w=void 0}),n)}}}function N(t,n,i){t.scrollLeft+=n,t.scrollTop+=i}function F(t){var n=window.Polymer,i=window.jQuery||window.Zepto;return n&&n.dom?n.dom(t).cloneNode(!0):i?i(t).clone(!0)[0]:t.cloneNode(!0)}function P(t,n,i){var e={};return Array.from(t.children).forEach((function(o){var r,a,u,s;if(b(o,n.draggable,t,!1)&&!o.animated&&o!==i){var l=I(o);e.left=Math.min(null!==(r=e.left)&&void 0!==r?r:1/0,l.left),e.top=Math.min(null!==(a=e.top)&&void 0!==a?a:1/0,l.top),e.right=Math.max(null!==(u=e.right)&&void 0!==u?u:-1/0,l.right),e.bottom=Math.max(null!==(s=e.bottom)&&void 0!==s?s:-1/0,l.bottom)}})),e.width=e.right-e.left,e.height=e.bottom-e.top,e.x=e.left,e.y=e.top,e}var B="Sortable"+(new Date).getTime();var H=[],G={initializeByDefault:!0},L={mount:function(t){for(var n in G)G.hasOwnProperty(n)&&!(n in t)&&(t[n]=G[n]);H.forEach((function(n){if(n.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")})),H.push(t)},pluginEvent:function(t,i,e){var o=this;this.eventCanceled=!1,e.cancel=function(){o.eventCanceled=!0};var r=t+"Global";H.forEach((function(o){i[o.pluginName]&&(i[o.pluginName][r]&&i[o.pluginName][r](n({sortable:i},e)),i.options[o.pluginName]&&i[o.pluginName][t]&&i[o.pluginName][t](n({sortable:i},e)))}))},initializePlugins:function(t,n,i){for(var e in H.forEach((function(e){var r=e.pluginName;if(t.options[r]||e.initializeByDefault){var a=new e(t,n,t.options);a.sortable=t,a.options=t.options,t[r]=a,o(i,a.defaults)}})),t.options)if(t.options.hasOwnProperty(e)){var r=this.modifyOption(t,e,t.options[e]);void 0!==r&&(t.options[e]=r)}},getEventProperties:function(t,n){var i={};return H.forEach((function(e){"function"==typeof e.eventProperties&&o(i,e.eventProperties.call(n[e.pluginName],t))})),i},modifyOption:function(t,n,i){var e;return H.forEach((function(o){t[o.pluginName]&&o.optionListeners&&"function"==typeof o.optionListeners[n]&&(e=o.optionListeners[n].call(t[o.pluginName],i))})),e}},R=["evt"],W=function(t,i){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=e.evt,a=r(e,R);L.pluginEvent.bind(Nt)(t,i,n({dragEl:Y,parentEl:U,ghostEl:V,rootEl:Z,nextEl:$,lastDownEl:q,cloneEl:J,cloneHidden:K,dragStarted:ft,putSortable:ot,activeSortable:Nt.active,originalEvent:o,oldIndex:Q,oldDraggableIndex:nt,newIndex:tt,newDraggableIndex:it,hideGhostForTarget:Ct,unhideGhostForTarget:jt,cloneNowHidden:function(){K=!0},cloneNowShown:function(){K=!1},dispatchSortableEvent:function(t){X({sortable:i,name:t,originalEvent:o})}},a))};function X(t){!function(t){var i=t.sortable,e=t.rootEl,o=t.name,r=t.targetEl,a=t.cloneEl,l=t.toEl,c=t.fromEl,f=t.oldIndex,h=t.newIndex,d=t.oldDraggableIndex,v=t.newDraggableIndex,m=t.originalEvent,p=t.putSortable,g=t.extraEventProperties;if(i=i||e&&e[B]){var b,w=i.options,E="on"+o.charAt(0).toUpperCase()+o.substr(1);!window.CustomEvent||u||s?(b=document.createEvent("Event")).initEvent(o,!0,!0):b=new CustomEvent(o,{bubbles:!0,cancelable:!0}),b.to=l||e,b.from=c||e,b.item=r||e,b.clone=a,b.oldIndex=f,b.newIndex=h,b.oldDraggableIndex=d,b.newDraggableIndex=v,b.originalEvent=m,b.pullMode=p?p.lastPutMode:void 0;var y=n(n({},g),L.getEventProperties(o,i));for(var S in y)b[S]=y[S];e&&e.dispatchEvent(b),w[E]&&w[E].call(i,b)}}(n({putSortable:ot,cloneEl:J,targetEl:Y,rootEl:Z,oldIndex:Q,oldDraggableIndex:nt,newIndex:tt,newDraggableIndex:it},t))}var Y,U,V,Z,$,q,J,K,Q,tt,nt,it,et,ot,rt,at,ut,st,lt,ct,ft,ht,dt,vt,mt,pt=!1,gt=!1,bt=[],wt=!1,Et=!1,yt=[],St=!1,Mt=[],Tt="undefined"!=typeof document,Ot=f,It=s||u?"cssFloat":"float",xt=Tt&&!h&&!f&&"draggable"in document.createElement("div"),_t=function(){if(Tt){if(u)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),Dt=function(t,n){var i=S(t),e=parseInt(i.width)-parseInt(i.paddingLeft)-parseInt(i.paddingRight)-parseInt(i.borderLeftWidth)-parseInt(i.borderRightWidth),o=_(t,0,n),r=_(t,1,n),a=o&&S(o),u=r&&S(r),s=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+I(o).width,l=u&&parseInt(u.marginLeft)+parseInt(u.marginRight)+I(r).width;return"flex"===i.display?"column"===i.flexDirection||"column-reverse"===i.flexDirection?"vertical":"horizontal":"grid"===i.display?i.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal":o&&a.float&&"none"!==a.float?!r||"both"!==u.clear&&u.clear!==("left"===a.float?"left":"right")?"horizontal":"vertical":o&&("block"===a.display||"flex"===a.display||"table"===a.display||"grid"===a.display||s>=e&&"none"===i[It]||r&&"none"===i[It]&&s+l>e)?"vertical":"horizontal"},kt=function(t){function n(t,i){return function(e,o,r,a){if(null==t&&(i||e.options.group.name&&o.options.group.name&&e.options.group.name===o.options.group.name))return!0;if(null==t||!1===t)return!1;if(i&&"clone"===t)return t;if("function"==typeof t)return n(t(e,o,r,a),i)(e,o,r,a);var u=(i?e:o).options.group.name;return!0===t||"string"==typeof t&&t===u||t.join&&t.indexOf(u)>-1}}var e={},o=t.group;o&&"object"==i(o)||(o={name:o}),e.name=o.name,e.checkPull=n(o.pull,!0),e.checkPut=n(o.put),e.revertClone=o.revertClone,t.group=e},Ct=function(){!_t&&V&&S(V,"display","none")},jt=function(){!_t&&V&&S(V,"display","")};Tt&&!h&&document.addEventListener("click",(function(t){if(gt)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),gt=!1,!1}),!0);var At=function(t){if(Y){var n=(o=(t=t.touches?t.touches[0]:t).clientX,r=t.clientY,bt.some((function(t){var n=t[B].options.emptyInsertThreshold;if(n&&!D(t)){var i=I(t);return o>=i.left-n&&o<=i.right+n&&r>=i.top-n&&r<=i.bottom+n?a=t:void 0}})),a);if(n){var i={};for(var e in t)t.hasOwnProperty(e)&&(i[e]=t[e]);i.target=i.rootEl=n,i.preventDefault=void 0,i.stopPropagation=void 0,n[B]._onDragOver(i)}}var o,r,a},zt=function(t){Y&&Y.parentNode[B]._isOutsideThisEl(t.target)};function Nt(t,i){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=i=o({},i),t[B]=this;var e,r,a={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Dt(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,n){t.setData("Text",n.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==Nt.supportPointer&&"PointerEvent"in window&&(!c||f),emptyInsertThreshold:5};for(var u in L.initializePlugins(this,t,a),a)!(u in i)&&(i[u]=a[u]);for(var s in kt(i),this)"_"===s.charAt(0)&&"function"==typeof this[s]&&(this[s]=this[s].bind(this));this.nativeDraggable=!i.forceFallback&&xt,this.nativeDraggable&&(this.options.touchStartThreshold=1),i.supportPointer?v(t,"pointerdown",this._onTapStart):(v(t,"mousedown",this._onTapStart),v(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(v(t,"dragover",this),v(t,"dragenter",this)),bt.push(this.el),i.store&&i.store.get&&this.sort(i.store.get(this)||[]),o(this,(r=[],{captureAnimationState:function(){r=[],this.options.animation&&[].slice.call(this.el.children).forEach((function(t){if("none"!==S(t,"display")&&t!==Nt.ghost){r.push({target:t,rect:I(t)});var i=n({},r[r.length-1].rect);if(t.thisAnimationDuration){var e=M(t,!0);e&&(i.top-=e.f,i.left-=e.e)}t.fromRect=i}}))},addAnimationState:function(t){r.push(t)},removeAnimationState:function(t){r.splice(function(t,n){for(var i in t)if(t.hasOwnProperty(i))for(var e in n)if(n.hasOwnProperty(e)&&n[e]===t[i][e])return Number(i);return-1}(r,{target:t}),1)},animateAll:function(t){var n=this;if(!this.options.animation)return clearTimeout(e),void("function"==typeof t&&t());var i=!1,o=0;r.forEach((function(t){var e=0,r=t.target,a=r.fromRect,u=I(r),s=r.prevFromRect,l=r.prevToRect,c=t.rect,f=M(r,!0);f&&(u.top-=f.f,u.left-=f.e),r.toRect=u,r.thisAnimationDuration&&A(s,u)&&!A(a,u)&&(c.top-u.top)/(c.left-u.left)==(a.top-u.top)/(a.left-u.left)&&(e=function(t,n,i,e){return Math.sqrt(Math.pow(n.top-t.top,2)+Math.pow(n.left-t.left,2))/Math.sqrt(Math.pow(n.top-i.top,2)+Math.pow(n.left-i.left,2))*e.animation}(c,s,l,n.options)),A(u,a)||(r.prevFromRect=a,r.prevToRect=u,e||(e=n.options.animation),n.animate(r,c,u,e)),e&&(i=!0,o=Math.max(o,e),clearTimeout(r.animationResetTimer),r.animationResetTimer=setTimeout((function(){r.animationTime=0,r.prevFromRect=null,r.fromRect=null,r.prevToRect=null,r.thisAnimationDuration=null}),e),r.thisAnimationDuration=e)})),clearTimeout(e),i?e=setTimeout((function(){"function"==typeof t&&t()}),o):"function"==typeof t&&t(),r=[]},animate:function(t,n,i,e){if(e){S(t,"transition",""),S(t,"transform","");var o=M(this.el),r=(n.left-i.left)/(o&&o.a||1),a=(n.top-i.top)/(o&&o.d||1);t.animatingX=!!r,t.animatingY=!!a,S(t,"transform","translate3d("+r+"px,"+a+"px,0)"),this.forRepaintDummy=function(t){return t.offsetWidth}(t),S(t,"transition","transform "+e+"ms"+(this.options.easing?" "+this.options.easing:"")),S(t,"transform","translate3d(0,0,0)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout((function(){S(t,"transition",""),S(t,"transform",""),t.animated=!1,t.animatingX=!1,t.animatingY=!1}),e)}}}))}function Ft(t,n,i,e,o,r,a,l){var c,f,h=t[B],d=h.options.onMove;return!window.CustomEvent||u||s?(c=document.createEvent("Event")).initEvent("move",!0,!0):c=new CustomEvent("move",{bubbles:!0,cancelable:!0}),c.to=n,c.from=t,c.dragged=i,c.draggedRect=e,c.related=o||n,c.relatedRect=r||I(n),c.willInsertAfter=l,c.originalEvent=a,t.dispatchEvent(c),d&&(f=d.call(h,c,a)),f}function Pt(t){t.draggable=!1}function Bt(){St=!1}function Ht(t){for(var n=t.tagName+t.className+t.src+t.href+t.textContent,i=n.length,e=0;i--;)e+=n.charCodeAt(i);return e.toString(36)}function Gt(t){return setTimeout(t,0)}function Lt(t){return clearTimeout(t)}Nt.prototype={constructor:Nt,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(ht=null)},_getDirection:function(t,n){return"function"==typeof this.options.direction?this.options.direction.call(this,t,n,Y):this.options.direction},_onTapStart:function(t){if(t.cancelable){var n=this,i=this.el,e=this.options,o=e.preventOnFilter,r=t.type,a=t.touches&&t.touches[0]||t.pointerType&&"touch"===t.pointerType&&t,u=(a||t).target,s=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||u,l=e.filter;if(function(t){Mt.length=0;for(var n=t.getElementsByTagName("input"),i=n.length;i--;){var e=n[i];e.checked&&Mt.push(e)}}(i),!Y&&!(/mousedown|pointerdown/.test(r)&&0!==t.button||e.disabled)&&!s.isContentEditable&&(this.nativeDraggable||!c||!u||"SELECT"!==u.tagName.toUpperCase())&&!((u=b(u,e.draggable,i,!1))&&u.animated||q===u)){if(Q=k(u),nt=k(u,e.draggable),"function"==typeof l){if(l.call(this,t,u,this))return X({sortable:n,rootEl:s,name:"filter",targetEl:u,toEl:i,fromEl:i}),W("filter",n,{evt:t}),void(o&&t.preventDefault())}else if(l&&(l=l.split(",").some((function(e){if(e=b(s,e.trim(),i,!1))return X({sortable:n,rootEl:e,name:"filter",targetEl:u,fromEl:i,toEl:i}),W("filter",n,{evt:t}),!0}))))return void(o&&t.preventDefault());e.handle&&!b(s,e.handle,i,!1)||this._prepareDragStart(t,a,u)}}},_prepareDragStart:function(t,n,i){var e,o=this,r=o.el,a=o.options,c=r.ownerDocument;if(i&&!Y&&i.parentNode===r){var f=I(i);if(Z=r,U=(Y=i).parentNode,$=Y.nextSibling,q=i,et=a.group,Nt.dragged=Y,lt=(rt={target:Y,clientX:(n||t).clientX,clientY:(n||t).clientY}).clientX-f.left,ct=rt.clientY-f.top,this._lastX=(n||t).clientX,this._lastY=(n||t).clientY,Y.style["will-change"]="all",e=function(){W("delayEnded",o,{evt:t}),Nt.eventCanceled?o._onDrop():(o._disableDelayedDragEvents(),!l&&o.nativeDraggable&&(Y.draggable=!0),o._triggerDragStart(t,n),X({sortable:o,name:"choose",originalEvent:t}),y(Y,a.chosenClass,!0))},a.ignore.split(",").forEach((function(t){T(Y,t.trim(),Pt)})),v(c,"dragover",At),v(c,"mousemove",At),v(c,"touchmove",At),a.supportPointer?(v(c,"pointerup",o._onDrop),!this.nativeDraggable&&v(c,"pointercancel",o._onDrop)):(v(c,"mouseup",o._onDrop),v(c,"touchend",o._onDrop),v(c,"touchcancel",o._onDrop)),l&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Y.draggable=!0),W("delayStart",this,{evt:t}),!a.delay||a.delayOnTouchOnly&&!n||this.nativeDraggable&&(s||u))e();else{if(Nt.eventCanceled)return void this._onDrop();a.supportPointer?(v(c,"pointerup",o._disableDelayedDrag),v(c,"pointercancel",o._disableDelayedDrag)):(v(c,"mouseup",o._disableDelayedDrag),v(c,"touchend",o._disableDelayedDrag),v(c,"touchcancel",o._disableDelayedDrag)),v(c,"mousemove",o._delayedDragTouchMoveHandler),v(c,"touchmove",o._delayedDragTouchMoveHandler),a.supportPointer&&v(c,"pointermove",o._delayedDragTouchMoveHandler),o._dragStartTimer=setTimeout(e,a.delay)}}},_delayedDragTouchMoveHandler:function(t){var n=t.touches?t.touches[0]:t;Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){Y&&Pt(Y),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;m(t,"mouseup",this._disableDelayedDrag),m(t,"touchend",this._disableDelayedDrag),m(t,"touchcancel",this._disableDelayedDrag),m(t,"pointerup",this._disableDelayedDrag),m(t,"pointercancel",this._disableDelayedDrag),m(t,"mousemove",this._delayedDragTouchMoveHandler),m(t,"touchmove",this._delayedDragTouchMoveHandler),m(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,n){n=n||"touch"==t.pointerType&&t,!this.nativeDraggable||n?v(document,this.options.supportPointer?"pointermove":n?"touchmove":"mousemove",this._onTouchMove):(v(Y,"dragend",this),v(Z,"dragstart",this._onDragStart));try{document.selection?Gt((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(t,n){if(pt=!1,Z&&Y){W("dragStarted",this,{evt:n}),this.nativeDraggable&&v(document,"dragover",zt);var i=this.options;!t&&y(Y,i.dragClass,!1),y(Y,i.ghostClass,!0),Nt.active=this,t&&this._appendGhost(),X({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(at){this._lastX=at.clientX,this._lastY=at.clientY,Ct();for(var t=document.elementFromPoint(at.clientX,at.clientY),n=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(at.clientX,at.clientY))!==n;)n=t;if(Y.parentNode[B]._isOutsideThisEl(t),n)do{if(n[B]&&n[B]._onDragOver({clientX:at.clientX,clientY:at.clientY,target:t,rootEl:n})&&!this.options.dragoverBubble)break;t=n}while(n=g(n));jt()}},_onTouchMove:function(t){if(rt){var n=this.options,i=n.fallbackTolerance,e=n.fallbackOffset,o=t.touches?t.touches[0]:t,r=V&&M(V,!0),a=V&&r&&r.a,u=V&&r&&r.d,s=Ot&&mt&&C(mt),l=(o.clientX-rt.clientX+e.x)/(a||1)+(s?s[0]-yt[0]:0)/(a||1),c=(o.clientY-rt.clientY+e.y)/(u||1)+(s?s[1]-yt[1]:0)/(u||1);if(!Nt.active&&!pt){if(i&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))<i)return;this._onDragStart(t,!0)}if(V){r?(r.e+=l-(ut||0),r.f+=c-(st||0)):r={a:1,b:0,c:0,d:1,e:l,f:c};var f="matrix(".concat(r.a,",").concat(r.b,",").concat(r.c,",").concat(r.d,",").concat(r.e,",").concat(r.f,")");S(V,"webkitTransform",f),S(V,"mozTransform",f),S(V,"msTransform",f),S(V,"transform",f),ut=l,st=c,at=o}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!V){var t=this.options.fallbackOnBody?document.body:Z,n=I(Y,!0,Ot,!0,t),i=this.options;if(Ot){for(mt=t;"static"===S(mt,"position")&&"none"===S(mt,"transform")&&mt!==document;)mt=mt.parentNode;mt!==document.body&&mt!==document.documentElement?(mt===document&&(mt=O()),n.top+=mt.scrollTop,n.left+=mt.scrollLeft):mt=O(),yt=C(mt)}y(V=Y.cloneNode(!0),i.ghostClass,!1),y(V,i.fallbackClass,!0),y(V,i.dragClass,!0),S(V,"transition",""),S(V,"transform",""),S(V,"box-sizing","border-box"),S(V,"margin",0),S(V,"top",n.top),S(V,"left",n.left),S(V,"width",n.width),S(V,"height",n.height),S(V,"opacity","0.8"),S(V,"position",Ot?"absolute":"fixed"),S(V,"zIndex","100000"),S(V,"pointerEvents","none"),Nt.ghost=V,t.appendChild(V),S(V,"transform-origin",lt/parseInt(V.style.width)*100+"% "+ct/parseInt(V.style.height)*100+"%")}},_onDragStart:function(t,n){var i=this,e=t.dataTransfer,o=i.options;W("dragStart",this,{evt:t}),Nt.eventCanceled?this._onDrop():(W("setupClone",this),Nt.eventCanceled||((J=F(Y)).removeAttribute("id"),J.draggable=!1,J.style["will-change"]="",this._hideClone(),y(J,this.options.chosenClass,!1),Nt.clone=J),i.cloneId=Gt((function(){W("clone",i),Nt.eventCanceled||(i.options.removeCloneOnHide||Z.insertBefore(J,Y),i._hideClone(),X({sortable:i,name:"clone"}))})),!n&&y(Y,o.dragClass,!0),n?(gt=!0,i._loopId=setInterval(i._emulateDragOver,50)):(m(document,"mouseup",i._onDrop),m(document,"touchend",i._onDrop),m(document,"touchcancel",i._onDrop),e&&(e.effectAllowed="move",o.setData&&o.setData.call(i,e,Y)),v(document,"drop",i),S(Y,"transform","translateZ(0)")),pt=!0,i._dragStartId=Gt(i._dragStarted.bind(i,n,t)),v(document,"selectstart",i),ft=!0,window.getSelection().removeAllRanges(),c&&S(document.body,"user-select","none"))},_onDragOver:function(t){var i,e,o,r,a=this.el,u=t.target,s=this.options,l=s.group,c=Nt.active,f=et===l,h=s.sort,d=ot||c,v=this,m=!1;if(!St){if(void 0!==t.preventDefault&&t.cancelable&&t.preventDefault(),u=b(u,s.draggable,a,!0),L("dragOver"),Nt.eventCanceled)return m;if(Y.contains(t.target)||u.animated&&u.animatingX&&u.animatingY||v._ignoreWhileAnimating===u)return q(!1);if(gt=!1,c&&!s.disabled&&(f?h||(o=U!==Z):ot===this||(this.lastPutMode=et.checkPull(this,c,Y,t))&&l.checkPut(this,c,Y,t))){if(r="vertical"===this._getDirection(t,u),i=I(Y),L("dragOverValid"),Nt.eventCanceled)return m;if(o)return U=Z,R(),this._hideClone(),L("revert"),Nt.eventCanceled||($?Z.insertBefore(Y,$):Z.appendChild(Y)),q(!0);var p=D(a,s.draggable);if(!p||function(t,n,i){var e=I(D(i.el,i.options.draggable)),o=P(i.el,i.options,V);return n?t.clientX>o.right+10||t.clientY>e.bottom&&t.clientX>e.left:t.clientY>o.bottom+10||t.clientX>e.right&&t.clientY>e.top}(t,r,this)&&!p.animated){if(p===Y)return q(!1);if(p&&a===t.target&&(u=p),u&&(e=I(u)),!1!==Ft(Z,a,Y,i,u,e,t,!!u))return R(),p&&p.nextSibling?a.insertBefore(Y,p.nextSibling):a.appendChild(Y),U=a,J(),q(!0)}else if(p&&function(t,n,i){var e=I(_(i.el,0,i.options,!0)),o=P(i.el,i.options,V);return n?t.clientX<o.left-10||t.clientY<e.top&&t.clientX<e.right:t.clientY<o.top-10||t.clientY<e.bottom&&t.clientX<e.left}(t,r,this)){var g=_(a,0,s,!0);if(g===Y)return q(!1);if(e=I(u=g),!1!==Ft(Z,a,Y,i,u,e,t,!1))return R(),a.insertBefore(Y,g),U=a,J(),q(!0)}else if(u.parentNode===a){e=I(u);var w,E,M,T=Y.parentNode!==a,O=!function(t,n,i){var e=i?t.left:t.top,o=i?n.left:n.top;return e===o||(i?t.right:t.bottom)===(i?n.right:n.bottom)||e+(i?t.width:t.height)/2===o+(i?n.width:n.height)/2}(Y.animated&&Y.toRect||i,u.animated&&u.toRect||e,r),C=r?"top":"left",j=x(u,"top","top")||x(Y,"top","top"),A=j?j.scrollTop:void 0;if(ht!==u&&(E=e[C],wt=!1,Et=!O&&s.invertSwap||T),w=function(t,n,i,e,o,r,a,u){var s=e?t.clientY:t.clientX,l=e?i.height:i.width,c=e?i.top:i.left,f=e?i.bottom:i.right,h=!1;if(!a)if(u&&vt<l*o){if(!wt&&(1===dt?s>c+l*r/2:s<f-l*r/2)&&(wt=!0),wt)h=!0;else if(1===dt?s<c+vt:s>f-vt)return-dt}else if(s>c+l*(1-o)/2&&s<f-l*(1-o)/2)return function(t){return k(Y)<k(t)?1:-1}(n);return(h=h||a)&&(s<c+l*r/2||s>f-l*r/2)?s>c+l/2?1:-1:0}(t,u,e,r,O?1:s.swapThreshold,null==s.invertedSwapThreshold?s.swapThreshold:s.invertedSwapThreshold,Et,ht===u),0!==w){var z=k(Y);do{M=U.children[z-=w]}while(M&&("none"===S(M,"display")||M===V))}if(0===w||M===u)return q(!1);ht=u,dt=w;var F=u.nextElementSibling,H=!1,G=Ft(Z,a,Y,i,u,e,t,H=1===w);if(!1!==G)return 1!==G&&-1!==G||(H=1===G),St=!0,setTimeout(Bt,30),R(),H&&!F?a.appendChild(Y):u.parentNode.insertBefore(Y,H?F:u),j&&N(j,0,A-j.scrollTop),U=Y.parentNode,void 0===E||Et||(vt=Math.abs(E-I(u)[C])),J(),q(!0)}if(a.contains(Y))return q(!1)}return!1}function L(s,l){W(s,v,n({evt:t,isOwner:f,axis:r?"vertical":"horizontal",revert:o,dragRect:i,targetRect:e,canSort:h,fromSortable:d,target:u,completed:q,onMove:function(n,e){return Ft(Z,a,Y,i,n,I(n),t,e)},changed:J},l))}function R(){L("dragOverAnimationCapture"),v.captureAnimationState(),v!==d&&d.captureAnimationState()}function q(n){return L("dragOverCompleted",{insertion:n}),n&&(f?c._hideClone():c._showClone(v),v!==d&&(y(Y,ot?ot.options.ghostClass:c.options.ghostClass,!1),y(Y,s.ghostClass,!0)),ot!==v&&v!==Nt.active?ot=v:v===Nt.active&&ot&&(ot=null),d===v&&(v._ignoreWhileAnimating=u),v.animateAll((function(){L("dragOverAnimationComplete"),v._ignoreWhileAnimating=null})),v!==d&&(d.animateAll(),d._ignoreWhileAnimating=null)),(u===Y&&!Y.animated||u===a&&!u.animated)&&(ht=null),s.dragoverBubble||t.rootEl||u===document||(Y.parentNode[B]._isOutsideThisEl(t.target),!n&&At(t)),!s.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),m=!0}function J(){tt=k(Y),it=k(Y,s.draggable),X({sortable:v,name:"change",toEl:a,newIndex:tt,newDraggableIndex:it,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){m(document,"mousemove",this._onTouchMove),m(document,"touchmove",this._onTouchMove),m(document,"pointermove",this._onTouchMove),m(document,"dragover",At),m(document,"mousemove",At),m(document,"touchmove",At)},_offUpEvents:function(){var t=this.el.ownerDocument;m(t,"mouseup",this._onDrop),m(t,"touchend",this._onDrop),m(t,"pointerup",this._onDrop),m(t,"pointercancel",this._onDrop),m(t,"touchcancel",this._onDrop),m(document,"selectstart",this)},_onDrop:function(t){var n=this.el,i=this.options;tt=k(Y),it=k(Y,i.draggable),W("drop",this,{evt:t}),U=Y&&Y.parentNode,tt=k(Y),it=k(Y,i.draggable),Nt.eventCanceled||(pt=!1,Et=!1,wt=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Lt(this.cloneId),Lt(this._dragStartId),this.nativeDraggable&&(m(document,"drop",this),m(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),c&&S(document.body,"user-select",""),S(Y,"transform",""),t&&(ft&&(t.cancelable&&t.preventDefault(),!i.dropBubble&&t.stopPropagation()),V&&V.parentNode&&V.parentNode.removeChild(V),(Z===U||ot&&"clone"!==ot.lastPutMode)&&J&&J.parentNode&&J.parentNode.removeChild(J),Y&&(this.nativeDraggable&&m(Y,"dragend",this),Pt(Y),Y.style["will-change"]="",ft&&!pt&&y(Y,ot?ot.options.ghostClass:this.options.ghostClass,!1),y(Y,this.options.chosenClass,!1),X({sortable:this,name:"unchoose",toEl:U,newIndex:null,newDraggableIndex:null,originalEvent:t}),Z!==U?(tt>=0&&(X({rootEl:U,name:"add",toEl:U,fromEl:Z,originalEvent:t}),X({sortable:this,name:"remove",toEl:U,originalEvent:t}),X({rootEl:U,name:"sort",toEl:U,fromEl:Z,originalEvent:t}),X({sortable:this,name:"sort",toEl:U,originalEvent:t})),ot&&ot.save()):tt!==Q&&tt>=0&&(X({sortable:this,name:"update",toEl:U,originalEvent:t}),X({sortable:this,name:"sort",toEl:U,originalEvent:t})),Nt.active&&(null!=tt&&-1!==tt||(tt=Q,it=nt),X({sortable:this,name:"end",toEl:U,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){W("nulling",this),Z=Y=U=V=$=J=q=K=rt=at=ft=tt=it=Q=nt=ht=dt=ot=et=Nt.dragged=Nt.ghost=Nt.clone=Nt.active=null,Mt.forEach((function(t){t.checked=!0})),Mt.length=ut=st=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":Y&&(this._onDragOver(t),function(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.cancelable&&t.preventDefault()}(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t,n=[],i=this.el.children,e=0,o=i.length,r=this.options;e<o;e++)b(t=i[e],r.draggable,this.el,!1)&&n.push(t.getAttribute(r.dataIdAttr)||Ht(t));return n},sort:function(t,n){var i={},e=this.el;this.toArray().forEach((function(t,n){var o=e.children[n];b(o,this.options.draggable,e,!1)&&(i[t]=o)}),this),n&&this.captureAnimationState(),t.forEach((function(t){i[t]&&(e.removeChild(i[t]),e.appendChild(i[t]))})),n&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,n){return b(t,n||this.options.draggable,this.el,!1)},option:function(t,n){var i=this.options;if(void 0===n)return i[t];var e=L.modifyOption(this,t,n);i[t]=void 0!==e?e:n,"group"===t&&kt(i)},destroy:function(){W("destroy",this);var t=this.el;t[B]=null,m(t,"mousedown",this._onTapStart),m(t,"touchstart",this._onTapStart),m(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(m(t,"dragover",this),m(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),(function(t){t.removeAttribute("draggable")})),this._onDrop(),this._disableDelayedDragEvents(),bt.splice(bt.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!K){if(W("hideClone",this),Nt.eventCanceled)return;S(J,"display","none"),this.options.removeCloneOnHide&&J.parentNode&&J.parentNode.removeChild(J),K=!0}},_showClone:function(t){if("clone"===t.lastPutMode){if(K){if(W("showClone",this),Nt.eventCanceled)return;Y.parentNode!=Z||this.options.group.revertClone?$?Z.insertBefore(J,$):Z.appendChild(J):Z.insertBefore(J,Y),this.options.group.revertClone&&this.animate(Y,J),S(J,"display",""),K=!1}}else this._hideClone()}},Tt&&v(document,"touchmove",(function(t){(Nt.active||pt)&&t.cancelable&&t.preventDefault()})),Nt.utils={on:v,off:m,css:S,find:T,is:function(t,n){return!!b(t,n,t,!1)},extend:function(t,n){if(t&&n)for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i]);return t},throttle:z,closest:b,toggleClass:y,clone:F,index:k,nextTick:Gt,cancelNextTick:Lt,detectDirection:Dt,getChild:_,expando:B},Nt.get=function(t){return t[B]},Nt.mount=function(){for(var t=arguments.length,i=new Array(t),e=0;e<t;e++)i[e]=arguments[e];i[0].constructor===Array&&(i=i[0]),i.forEach((function(t){if(!t.prototype||!t.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(t));t.utils&&(Nt.utils=n(n({},Nt.utils),t.utils)),L.mount(t)}))},Nt.create=function(t,n){return new Nt(t,n)},Nt.version="1.15.6";var Rt,Wt,Xt,Yt,Ut,Vt,Zt=[],$t=!1;function qt(){Zt.forEach((function(t){clearInterval(t.pid)})),Zt=[]}function Jt(){clearInterval(Vt)}var Kt=z((function(t,n,i,e){if(n.scroll){var o,r=(t.touches?t.touches[0]:t).clientX,a=(t.touches?t.touches[0]:t).clientY,u=n.scrollSensitivity,s=n.scrollSpeed,l=O(),c=!1;Wt!==i&&(Wt=i,qt(),o=n.scrollFn,!0===(Rt=n.scroll)&&(Rt=j(i,!0)));var f=0,h=Rt;do{var d=h,v=I(d),m=v.top,p=v.bottom,g=v.left,b=v.right,w=v.width,E=v.height,y=void 0,M=void 0,T=d.scrollWidth,x=d.scrollHeight,_=S(d),D=d.scrollLeft,k=d.scrollTop;d===l?(y=w<T&&("auto"===_.overflowX||"scroll"===_.overflowX||"visible"===_.overflowX),M=E<x&&("auto"===_.overflowY||"scroll"===_.overflowY||"visible"===_.overflowY)):(y=w<T&&("auto"===_.overflowX||"scroll"===_.overflowX),M=E<x&&("auto"===_.overflowY||"scroll"===_.overflowY));var C=y&&(Math.abs(b-r)<=u&&D+w<T)-(Math.abs(g-r)<=u&&!!D),A=M&&(Math.abs(p-a)<=u&&k+E<x)-(Math.abs(m-a)<=u&&!!k);if(!Zt[f])for(var z=0;z<=f;z++)Zt[z]||(Zt[z]={});Zt[f].vx==C&&Zt[f].vy==A&&Zt[f].el===d||(Zt[f].el=d,Zt[f].vx=C,Zt[f].vy=A,clearInterval(Zt[f].pid),0==C&&0==A||(c=!0,Zt[f].pid=setInterval(function(){e&&0===this.layer&&Nt.active._onTouchMove(Ut);var n=Zt[this.layer].vy?Zt[this.layer].vy*s:0,i=Zt[this.layer].vx?Zt[this.layer].vx*s:0;"function"==typeof o&&"continue"!==o.call(Nt.dragged.parentNode[B],i,n,t,Ut,Zt[this.layer].el)||N(Zt[this.layer].el,i,n)}.bind({layer:f}),24))),f++}while(n.bubbleScroll&&h!==l&&(h=j(h,!1)));$t=c}}),30),Qt=function(t){var n=t.originalEvent,i=t.putSortable,e=t.dragEl,o=t.dispatchSortableEvent,r=t.unhideGhostForTarget;if(n){var a=i||t.activeSortable;(0,t.hideGhostForTarget)();var u=n.changedTouches&&n.changedTouches.length?n.changedTouches[0]:n,s=document.elementFromPoint(u.clientX,u.clientY);r(),a&&!a.el.contains(s)&&(o("spill"),this.onSpill({dragEl:e,putSortable:i}))}};function tn(){}function nn(){}tn.prototype={startIndex:null,dragStart:function(t){this.startIndex=t.oldDraggableIndex},onSpill:function(t){var n=t.dragEl,i=t.putSortable;this.sortable.captureAnimationState(),i&&i.captureAnimationState();var e=_(this.sortable.el,this.startIndex,this.options);e?this.sortable.el.insertBefore(n,e):this.sortable.el.appendChild(n),this.sortable.animateAll(),i&&i.animateAll()},drop:Qt},o(tn,{pluginName:"revertOnSpill"}),nn.prototype={onSpill:function(t){var n=t.dragEl,i=t.putSortable||this.sortable;i.captureAnimationState(),n.parentNode&&n.parentNode.removeChild(n),i.animateAll()},drop:Qt},o(nn,{pluginName:"removeOnSpill"}),Nt.mount(new function(){function t(){for(var t in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)"_"===t.charAt(0)&&"function"==typeof this[t]&&(this[t]=this[t].bind(this))}return t.prototype={dragStarted:function(t){var n=t.originalEvent;this.sortable.nativeDraggable?v(document,"dragover",this._handleAutoScroll):v(document,this.options.supportPointer?"pointermove":n.touches?"touchmove":"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var n=t.originalEvent;this.options.dragOverBubble||n.rootEl||this._handleAutoScroll(n)},drop:function(){this.sortable.nativeDraggable?m(document,"dragover",this._handleAutoScroll):(m(document,"pointermove",this._handleFallbackAutoScroll),m(document,"touchmove",this._handleFallbackAutoScroll),m(document,"mousemove",this._handleFallbackAutoScroll)),Jt(),qt(),clearTimeout(w),w=void 0},nulling:function(){Ut=Wt=Rt=$t=Vt=Xt=Yt=null,Zt.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(t,n){var i=this,e=(t.touches?t.touches[0]:t).clientX,o=(t.touches?t.touches[0]:t).clientY,r=document.elementFromPoint(e,o);if(Ut=t,n||this.options.forceAutoScrollFallback||s||u||c){Kt(t,this.options,r,n);var a=j(r,!0);!$t||Vt&&e===Xt&&o===Yt||(Vt&&Jt(),Vt=setInterval((function(){var r=j(document.elementFromPoint(e,o),!0);r!==a&&(a=r,qt()),Kt(t,i.options,r,n)}),10),Xt=e,Yt=o)}else{if(!this.options.bubbleScroll||j(r,!0)===O())return void qt();Kt(t,this.options,j(r,!1),!1)}}},o(t,{pluginName:"scroll",initializeByDefault:!0})}),Nt.mount(nn,tn);export{Nt as S}
@@ -1,60 +0,0 @@
1
- import{ObjectUtils as t,DataUnit as e,DataUnitInMemoryLoader as n,ApplicationContext as r,StringUtils as a,UserInterface as i,DataUnitStorage as o,DataType as s,ChangeOperation as c}from"@sankhyalabs/core";import{D as l,S as u,d}from"./p-bb2f5f38.js";import{DISTINCT_FILTER_NAME_PREFIX as m}from"@sankhyalabs/ezui/dist/collection/utils/constants";import{DataUnitTransient as h}from"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import{ColumnFilterManager as f}from"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import p from"@sankhyalabs/core/dist/utils/SortingUtils";import{R as g}from"./p-688dcb4c.js";class _{constructor(t){this._list=[],this._listCopy=[],this._listLastUpdate=0,this._listCopyLastUpdate=0,this._equalsFunction=t}async load(t,e,n,r){let a=[].concat(this._list);null!=t&&(a=this._list.filter((e=>t(e)))),null!=e&&(a=a.sort(e));const i=a.length;if(null!=r){const t=n||0;a=a.slice(t,r?t+r:a.length)}return Promise.resolve({result:a,count:i})}async distict(t){const e=[];let n=!1;for(const r of this._list){const a=t(r);null!=a&&(null!=a.value?e.push(a):n=!0)}return n&&e.push({key:"",value:null}),Promise.resolve(new Map(e.map((t=>[t.key,t.value]))))}async push(t){this.updateList([...this._list,...t])}async clear(){this.updateList([])}async delete(t){const e=this._list.filter((e=>{for(const n of t)if(this._equalsFunction(e,n))return!1;return!0}));this.updateList(e)}async update(t){const e=this._list.map((e=>{const n=t.find((t=>this._equalsFunction(e,t)));return null==n?e:n}));this.updateList(e)}async insert(t,e){const n=this._list.indexOf(t);if(-1==n)return void this.push(e);const r=this._list.slice(0,n).concat(e).concat(this._list.slice(n));this.updateList(r)}isOperating(){return!0}async isEmpty(){return Promise.resolve(0===this._list.length)}async count(){return Promise.resolve(this._list.length)}getFromCache(){return this._listLastUpdate>this._listCopyLastUpdate&&(this._listCopyLastUpdate=this._listLastUpdate,this._listCopy=t.copy(this._list)),this._listCopy}updateList(t){this._list=t,this._listLastUpdate=Date.now()}}class b{static setLoadingStatus(t,e){this._loadingStatus.set(t.name,e)}static isCacheEnabled(t){return!0}static cacheRecords(t,e,n,r){b.setLoadingStatus(t,r),b.isCacheEnabled(t)?this.getRepository(t).push(e):n&&this._repositories.delete(t.name)}static getSortingFunction(t,e){return p.getSortingFunction(t,e)}static async getDistinct(t,e,n=!1){if(!b.isCacheEnabled(t))return Promise.resolve(f.compileDistinct(e,t));let r;const a=t.getLastLoadRequest();if(null!=a){const n=f.getColumnFilters(a.filters,e);r=f.getFilterFunction(t,Array.from(n.values()))}return new Promise(((a,i)=>{b.getRepository(t).distict((a=>{if(null!=r&&!r(a))return;const i=a[e];if(null==i)return{key:null,value:null};let o=null!=i.value?i.value:i;return(null==i?void 0:i.label)&&n?{key:null==i?void 0:i.label,value:t.getFormattedValue(e,o)}:{key:t.getFormattedValue(e,i),value:o}})).then((t=>{a(null!=t?Array.from(t.entries()).map((([t,e])=>({label:t,value:e,check:!0}))):void 0)})).catch((t=>i(t)))}))}static async loadData(t,n,r){try{if(b.isCacheEnabled(t)){if(["EZ_GRID_LOADING_SOURCE",e.CHANGING_PAGE_LOADING_SOURCE,e.ALL_RECORDS_SELECTION_SOURCE].includes(n.source)&&!await b.getRepository(t).isEmpty())return b.loadFromCache(t,n);b.getRepository(t).clear().catch((()=>{}))}return r(t,n)}catch(t){return console.error(t),Promise.reject(t)}}static insertRecords(t,e,n){b.isCacheEnabled(t)&&b.getRepository(t).insert(e,n)}static updateRecords(t,e){b.isCacheEnabled(t)&&b.getRepository(t).update(e)}static removeRecords(t,e){b.isCacheEnabled(t)&&b.getRepository(t).delete(e)}static async countRecords(t){return b.isCacheEnabled(t)?b.getRepository(t).count():Promise.resolve(0)}static getRepository(t){const e=t.name;return b._repositories.has(e)||b._repositories.set(e,new _(((t,e)=>t.__record__id__===e.__record__id__))),b._repositories.get(e)}static async loadFromCache(t,e){return new Promise(((n,r)=>{const a=f.getColumnFilters(e.filters,""),{limit:i,offset:o,sort:s}=e;b.getRepository(t).load(f.getFilterFunction(t,Array.from(a.values())),b.getSortingFunction(t,s),o,i).then((e=>{const r=b._loadingStatus.get(t.name),{count:a,result:s}=e,c=0==a?0:o+1,l=o+Math.min(s.length,i);n({records:s,paginationInfo:{count:a,currentPage:o/i,firstRecord:c,lastRecord:l,hasMore:r||l<a,total:r?void 0:a}})})).catch((t=>r(t)))}))}static getCachedRecords(t){return b.getRepository(t).getFromCache()}}b._repositories=new Map,b._loadingStatus=new Map;class v{constructor(t,e,r){this._dataUnitInMemoryLoader=new n(t,e,r)}get dataUnit(){return this._dataUnitInMemoryLoader.dataUnit}get records(){return this._dataUnitInMemoryLoader.records}set records(t){this._dataUnitInMemoryLoader.records=t}get metadata(){return this._dataUnitInMemoryLoader.metadata}set metadata(t){this._dataUnitInMemoryLoader.metadata=t}removeLoader(t,e){return this._dataUnitInMemoryLoader.removeLoader(t,e)}static getConvertedValue(t,e,r){return n.getConvertedValue(t,e,r)}}function y(t,e){var n,r;return void 0!==(null===(n=t[e])||void 0===n?void 0:n.value)?null===(r=t[e])||void 0===r?void 0:r.value:t[e]}v.IN_MEMORY_DATA_UNIT_NAME=n.IN_MEMORY_DATA_UNIT_NAME;class D{canSlice(){return!1}processSortingSide(t,e,n){var r;const a=[],o=[];if(null!=t.sort){if(0===n.length)return{localSorting:t.sort,serverSorting:[]};for(const n of t.sort){const t=e.getField(n.field);"true"===(null===(r=null==t?void 0:t.properties)||void 0===r?void 0:r.calculated)||(null==t?void 0:t.userInterface)===i.LONGTEXT?a.push(n):o.push(n)}}return{localSorting:a,serverSorting:o}}async load(t,e,n){var r,a;if(null==t.metadata)return Promise.resolve({records:[],loadingInfo:n});try{const i=null!==(a=null===(r=e.filters)||void 0===r?void 0:r.filter((t=>!t.name.startsWith("FILTRO_COLUNA_"))))&&void 0!==a?a:[],{localSorting:o,serverSorting:s}=this.processSortingSide(e,t,i),c=this.getFieldsList(t),u="DatasetSP.loadRecords",d=this.buildRequestBody(u,c,t,e,n,s,i),m=n.quiet?{urlParams:{quietMode:"true"}}:void 0,{result:h,pagerID:f,askRowsLimit:p}=await l.get().callServiceBroker(u,d,m),g=this.processRecords(t,c,h),_=null!=f,b=n.count+g.length,v=t.hasNewRecord(),y=o.length>0,D=!_&&y;return D&&v&&t.setWaitingToReload(!0),Promise.resolve({records:g,loadingInfo:Object.assign(Object.assign({},n),{pagerId:f,loadingInProgress:_,total:_?void 0:b,count:b,needReload:D&&!v,askRowsLimit:p,hasLocalSorting:y})})}catch(t){return console.error(t),Promise.reject(t)}}async loadRowMetadata(t,e,n,r={}){try{const a="DatasetSP.loadRowMetadata",i=await this.buildRequestBodyLoadRowMetadata({snkDataUnit:t,fieldName:e,metadataName:n,serviceName:a,updatedFields:r});return await l.get().callServiceBroker(a,i)}catch(t){return console.error(t),Promise.reject(t)}}async buildRequestBodyLoadRowMetadata({snkDataUnit:t,serviceName:e,fieldName:n,metadataName:r,updatedFields:a}){const i=t.dataUnit,o=O.parseDataUnitName(i.name).entityName,s=(await t.getSelectedRecordsIDsInfo()).reduce(((t,e)=>(t[e.name]=e.value,t)),{}),c=i.getSelectedRecord(),l=i.metadata.fields.filter((({standAlone:t,name:e})=>!t&&!e.includes("."))).map((({name:t})=>t)),u=l.reduce(((t,e,n)=>{const r=y(c,e),i=y(a,e);return t[n]=void 0!==i?i:r,t}),{});return JSON.stringify({serviceName:e,requestBody:{dataSetID:i.dataUnitId,entityName:o,standAlone:!1,metadataName:r,fieldName:n,fields:l,record:{pk:s,oldPk:s,values:u}}})}getFieldsList(t){let e=["__record__id__","__record__label__"];return t.metadata.fields.forEach((t=>{t.standAlone||(e=e.concat(this.getFieldNames(t)))})),e}getStandAloneFieldsList(t){let e={};return t.metadata.fields.forEach((t=>{t.standAlone&&(e=Object.assign(Object.assign({},e),{[t.name]:{fieldType:t.dataType,userType:t.userInterface}}))})),e}getFieldNames(t){const e=this.getSearchDescriptionField(t);return null==e?t.name:[t.name,e]}buildRequestBody(t,e,n,r,a,i,o){const s=n.dataUnitId,c=O.parseDataUnitName(n.name).entityName,l=!(!r.limit&&!r.offset),u={serviceName:t,requestBody:{dataSetID:s,fields:e,entityName:c,pageNumber:a.pageNumber,totalRecordsCount:a.count,pagerID:a.pagerId,standAlone:!1,standAloneFieldsMD:Object.assign({__record__id__:{fieldType:"S",userType:"P"},__record__label__:{fieldType:"S",userType:"P"}},this.getStandAloneFieldsList(n)),tryJoinedFields:!0,parallelLoader:l,crudListener:`br.com.sankhya.bff.${this.getModuleName()}.BFFDataUnitDatasetAdapter`,txProperties:this.getTxProperties(n,r,i,o),useDefaultRowsLimit:!1}};return JSON.stringify(u)}getModuleName(){return r.getContextValue("__SNK__APPLICATION__").getModuleName().replace("-bff","")}getTxProperties(t,e,n,r){const a={"__DATA_UNIT_ADAPTER__[dataUnitName]":t.name};0!==r.length&&(a["__DATA_UNIT_ADAPTER__[criteria]"]=JSON.stringify(r)),null!=n&&0!==n.length&&(a["__DATA_UNIT_ADAPTER__[sorting]"]=JSON.stringify(n)),null!=e.parentRecordId&&(a["__DATA_UNIT_ADAPTER__[parentRecordId]"]=e.parentRecordId);const i=t.getGlobalLoaderProps();return null==i||0===i.size||Array.from(i.entries()).forEach((([t,e])=>{a[t]=e})),a}processRecords(t,e,n){return n.map((n=>{const r={__record__id__:n[0],__record__label__:n[1],__record__metadata__:n[n.length-1]._rmd};return t.metadata.fields.forEach((t=>{r[t.name]=this.buildFieldValue(t,e,n)})),r}))}buildFieldValue(t,e,n){const r=e.indexOf(t.name);if(r<0)return null;const o=n[r];if(a.isEmpty(o))return null;const s=this.getSearchDescriptionField(t);if(null!=s){const t=e.indexOf(s);if(t>=0)return{value:o,label:n[t]}}return t.userInterface===i.SEARCH?isNaN(Number(o))?o:Number(o):v.getConvertedValue(t,o)}getSearchDescriptionField(t){if(![i.SEARCH,i.SEARCHPLUS].includes(t.userInterface))return;if(!t.properties)return;const{ENTITYNAME:e,mergedFrom:n,DESCRIPTIONFIELD:r}=t.properties;return a.isEmpty(r)?void 0:null!=n?`${n}.${e}.${r}`:`${e}.${r}`}}var P;!function(t){t.CANCEL="CANCEL",t.CONTINUE="CONTINUE",t.LOAD_ALL="LOAD_ALL"}(P||(P={}));class R{constructor(){}static async debounce(t,e){const n=t.name;R._debouncingTimeouts[n]&&(clearTimeout(R._debouncingTimeouts[n]),delete R._debouncingTimeouts[n]),R._debouncingTimeouts[n]=setTimeout((()=>{delete R._debouncingTimeouts[n],e()}),100)}static async loadData(t,e){return new Promise(((n,r)=>{R.debounce(t,(()=>{b.loadData(t,e,this.loadFromServer).then((t=>n(t))).catch((t=>r(t)))}))}))}static getCachedRecords(t){return b.getCachedRecords(t)}static async loadFromServer(t,e,n){try{n=R.registryLoading(t,n);const r=await R.callLoader(t,e,n);if(null==r)return;const a=r.records,i=R.buildPaginationInfo(a.length,e,r.loadingInfo),o=null==i?a:a.slice(0,i.lastRecord);return Promise.resolve({records:o,paginationInfo:i})}catch(t){return console.error(t),Promise.reject(t)}}static async callLoader(t,e,n,r){null==r&&(r=new D);const a=await r.load(t,e,n),i=a.loadingInfo;if(R.isOldRequest(t,i))return Promise.resolve(void 0);if(this.handleCache(r,i,t,a.records),t.cancelPagination)return this.handlePaginationCanceled(t,a);if(this.canFinishPagination(t,i))return Promise.resolve(a);const o=Object.assign(Object.assign({},e),{offset:i.count});let s=this.buildNewLoadingInfo(i);if(this.canProceedPagination(i))return this.recallLoader(t,o,s,r,a);const c=await async function(){return new Promise((t=>{const e=new u,{checkboxContainer:n,checkbox:r}=function(t){const e=document.createElement("div");e.style.marginBottom="14px",e.style.display="flex",e.style.alignItems="center";const{checkbox:n,checkboxLabel:r}=function(t){const e=document.createElement("input");e.type="checkbox",e.id="loadAll";const n=document.createElement("label");return n.htmlFor="loadAll",n.textContent=null==t?void 0:t.getMessage("dataUnitDataLoaderHelper.checkbox.loadAll"),n.style.marginLeft="5px",{checkbox:e,checkboxLabel:n}}(t);return e.appendChild(n),e.appendChild(r),{checkboxContainer:e,checkbox:n}}(e),a=function(t,e,n){const r=document.createElement("ez-popup");return r.opened=!0,r.size="x-small",r.ezTitle=null==n?void 0:n.getMessage("dataUnitDataLoaderHelper.pagination.title"),r.heightMode="auto",r.addEventListener("ezClosePopup",(()=>{document.body.removeChild(r),t(e.checked?P.LOAD_ALL:P.CONTINUE)}),{once:!0}),r.addEventListener("ezPopupAction",(()=>{document.body.removeChild(r),t(P.CANCEL)}),{once:!0}),r}(t,r,e),i=function(){const t=document.createElement("div");return t.style.display="flex",t.style.flexDirection="column",t.style.fontFamily="var(--font-pattern, Roboto)",t.style.fontSize="var(--text--medium)",t}(),o=function(){const t=document.createElement("div");return t.style.display="flex",t.style.flexDirection="row",t.style.justifyContent="end",t.style.gap="5px",t}();i.appendChild(n),i.appendChild(function(t){const e=document.createElement("div"),n=document.createElement("p"),r=document.createElement("p"),a=document.createElement("p");return a.style.fontWeight="var(--text-weight--large, 600)",n.textContent=null==t?void 0:t.getMessage("dataUnitDataLoaderHelper.pagination.line1"),r.textContent=null==t?void 0:t.getMessage("dataUnitDataLoaderHelper.pagination.line2"),a.textContent=null==t?void 0:t.getMessage("dataUnitDataLoaderHelper.pagination.line3"),e.appendChild(n),e.appendChild(r),e.appendChild(a),e}(e)),o.appendChild(function(t,e,n,r){const a=document.createElement("ez-button");return a.label=null==r?void 0:r.getMessage("dataUnitDataLoaderHelper.buttons.continue"),a.size="medium",a.onclick=()=>{document.body.removeChild(t),n(e.checked?P.LOAD_ALL:P.CONTINUE)},a}(a,r,t,e)),o.appendChild(function(t,e,n){const r=document.createElement("ez-button");return r.label=null==n?void 0:n.getMessage("dataUnitDataLoaderHelper.buttons.cancel"),r.size="medium",r.classList.add("ez-button--primary"),r.onclick=()=>{document.body.removeChild(t),e(P.CANCEL)},r}(a,t,e)),i.appendChild(o),a.appendChild(i),document.body.appendChild(a)}))}();return c===P.CANCEL?this.handlePaginationCanceled(t,a):(c===P.LOAD_ALL&&(s=Object.assign(Object.assign({},s),{loadAllRecords:!0})),s=Object.assign(Object.assign({},s),{lastRowLimitAsked:s.count}),this.recallLoader(t,o,s,r,a))}static buildNewLoadingInfo(t){return Object.assign(Object.assign({},t),{pageNumber:(t.pageNumber||0)+1,quiet:!0})}static handleCache(t,e,n,r){const a=!t.canSlice()||0===e.count;b.cacheRecords(n,r,a,e.loadingInProgress)}static recallLoader(t,e,n,r,a){return this.callLoader(t,e,n,r).then((e=>R.afterLoadingPage(t,e.loadingInfo))).catch((t=>console.error(t))),Promise.resolve(a)}static canFinishPagination(t,e){return!b.isCacheEnabled(t)||!e.loadingInProgress}static canProceedPagination(t){const{count:e,askRowsLimit:n,loadAllRecords:r,lastRowLimitAsked:a}=t;if(r)return!0;if(!e||!n)return!0;const i=Number(n);return e<i||e<i+(a||0)}static handlePaginationCanceled(t,e){t.cancelPagination=!1;let n=e.loadingInfo;return n=Object.assign(Object.assign({},n),{total:n.count,loadingInProgress:!1,pagerId:void 0,needReload:n.hasLocalSorting}),Promise.resolve({records:e.records,loadingInfo:n})}static afterLoadingPage(t,e){b.setLoadingStatus(t,e.loadingInProgress);const n=t.getPaginationInfo();if(null==n)return;const r=e.count;e.loadingInProgress?t.updatePagination(Object.assign(Object.assign({},n),{count:r,loadingInProgress:!0})):e.needReload?t.gotoPage(0):t.updatePagination(Object.assign(Object.assign({},n),{total:r,count:r,loadingInProgress:!1}))}static registryLoading(t,e){return null==e&&(e={requestTime:(new Date).getTime(),count:0}),R._requestTimeByDataUnit.set(t.name,e.requestTime),e}static isOldRequest(t,e){return R._requestTimeByDataUnit.get(t.name)>e.requestTime}static buildPaginationInfo(t,e,n){let{limit:r,offset:a}=e;if(!r)return;1===n.pageNumber&&(a=0);const{total:i,count:o,loadingInProgress:s,askRowsLimit:c}=n,l=0===o||0===t?0:a+1,u=a+Math.min(t,r);return{total:i,count:o,lastRecord:u,firstRecord:l,currentPage:a/r,hasMore:u<o||s,askRowsLimit:c}}}R._requestTimeByDataUnit=new Map,R._debouncingTimeouts={};const N=/dd:\/\/([^/]+)\/([^/?]+)/;class O{constructor(){this.templateByQuery=new Map,this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchDataUnit",d.gql`query($name: String!) {
2
- $queryAlias$: fetchDataUnit(name: $name){
3
- name
4
- fields{
5
- name
6
- defaultValue
7
- label
8
- visible
9
- standAlone
10
- readOnly
11
- required
12
- dataType
13
- userInterface
14
- calculated
15
- group
16
- order
17
- properties{
18
- name
19
- value
20
- }
21
- dependencies{
22
- masterFields
23
- type
24
- expression
25
- }
26
- }
27
- children{
28
- name
29
- label
30
- links{
31
- source
32
- target
33
- }
34
- }
35
- }
36
- }`),this.templateByQuery.set("saveData",d.gql`mutation($changes: [InputBatchChange!]!) {
37
- $queryAlias$: batchOperationDataUnit(changes: $changes){
38
- oldId
39
- id
40
- label
41
- ownerDataUnitName
42
- fields {
43
- name
44
- value
45
- }
46
- }
47
- }`),this.templateByQuery.set("fetchDataRecord",d.gql`query($dataunit: String! $recordID: [String!]) {
48
- $queryAlias$: fetchDataUnit(name: $dataunit){
49
- record(id: $recordID){
50
- id
51
- label
52
- fields {
53
- name
54
- value
55
- }
56
- }
57
- }
58
- }`),this.templateByQuery.set("fetchDistinctColumn",d.gql`query($dataUnit: String!, $fieldName: String!, $argument: String, $filters: [InputFilter], $parentRecordId: String) {
59
- $queryAlias$: selectDistinct(dataUnit: $dataUnit, fieldName: $fieldName, argument: $argument, filters: $filters, parentRecordId: $parentRecordId)
60
- }`)}static parseDataUnitName(t){if(null==t)return;const e=N.exec(t);return e?{entityName:e[1],resourceID:e[2]}:void 0}getDataUnit(t,n,r,a){null==b.applicationResourceID&&g.getResourceID().then((t=>b.applicationResourceID=t));const i=`dd://${t}/${n}${a?"/"+a:""}`,o=null!=r?r.getChildDataunit(i):new e(i);return o.metadataLoader=t=>this.loadMetadata(t),o.dataLoader=(t,e)=>R.loadData(t,e),o.saveLoader=(t,e)=>this.saveData(o,e),o.removeLoader=(t,e)=>this.removeRecords(t,e),o.recordLoader=(t,e)=>this.loadRecord(t,e),o.allRecordsLoader=t=>R.getCachedRecords(t),o}loadMetadata(t){return new Promise(((e,n)=>{l.get().callGraphQL({values:{name:t.name},query:this.templateByQuery.get("fetchDataUnit")}).then((t=>{var n;const r={name:t.name,label:t.name,children:[...t.children],fields:[]};null===(n=t.fields)||void 0===n||n.forEach((t=>{let e;Array.isArray(t.properties)&&(e={},t.calculated&&(e.gridHeaderTooltip="Campos calculados não podem ser ordenados"),t.properties.forEach((t=>e[t.name]=t.value))),r.fields.push(Object.assign(Object.assign({},t),{properties:e}))})),r.fields.sort(((t,e)=>t.order-e.order)),e(r)})).catch((t=>{n(t)}))}))}loadSelectDistinct(t,e,n){const{parentRecordId:r,filters:a}=t.getLastLoadRequest()||{},i=a.filter((t=>t.name!==`${m}${e}`)),o={dataUnit:t.name,argument:n,fieldName:e,parentRecordId:r,filters:i};return new Promise(((t,e)=>{l.get().callGraphQL({values:o,query:this.templateByQuery.get("fetchDistinctColumn")}).then((e=>{t(e)})).catch((t=>{e(t)}))}))}addTransientProperties(t,e){const n=t.getGlobalLoaderProps();return null==n||0===n.size||(null==e&&(e={}),Array.from(n.entries()).forEach((([t,n])=>{e[`transient.${t}`]=n}))),e}getUpdatingFields(t,e){if(null==e)return;const n=Object.assign({},e);return Object.keys(n).forEach((e=>{const r=t.getField(e);null!=r&&r.standAlone&&delete n[e]})),this.addTransientProperties(t,n)}saveData(t,e){const n=[],r=[],a=e.map((e=>{const{dataUnit:a,record:i,operation:l}=e,u=o.get(a),d=this.getUpdatingFields(u,e.updatingFields);let m;null!=d&&(m=Object.entries(d).map((([t,e])=>{const n=u.getField(t);return{fieldName:t,dataType:n?n.dataType:s.TEXT,value:u.valueToString(t,e)}}))),a===t.name&&(l===c.INSERT||l===c.COPY?r.push(i.__record__id__):n.push(i.__record__id__));const h={dataUnit:a,fields:m,operation:l,recordId:i.__record__id__};return e.sourceId&&(h.sourceId=e.sourceId),i.__parent__record__id__&&(h.parentRecordId=i.__parent__record__id__),h}));return new Promise(((e,i)=>{const s=a.map((t=>function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(t);a<r.length;a++)e.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(t,r[a])&&(n[r[a]]=t[r[a]])}return n}(t,[])));l.get().callGraphQL({values:{changes:s},query:this.templateByQuery.get("saveData")}).then((a=>{const i=[];null==a||a.forEach((e=>{const n={__record__id__:e.id,__record__label__:e.label,__owner__dataunit__name__:e.ownerDataUnitName},r=o.get(n.__owner__dataunit__name__)||t;e.oldId&&(n.__old__id__=e.oldId),e.fields.forEach((({name:t,value:e})=>{var a;const i=null===(a=null==r?void 0:r.valueFromString)||void 0===a?void 0:a.call(r,t,e);n[t]=void 0!==i?i:e})),i.push(n)})),this.updateCache(t,i,n,r),e(i)})).catch((t=>{i(t)}))}))}updateCache(t,e,n,r){const a=new Map(e.map((t=>[t.__old__id__||t.__record__id__,t]))),i=r.map((t=>{const e=Object.assign({},a.get(t));return delete e.__old__id__,e}));i.length>0&&b.insertRecords(t,t.records[0],i);const o=n.map((t=>Object.assign({},a.get(t))));b.updateRecords(t,o)}getTransientInfo(t,e){const{records:n}=t.getSelectionInfo();return Object.entries(n.filter((t=>t.__record__id__==e))[0]).filter((([t])=>t.startsWith(h.DATA_UNIT_TRANSIENT_PREFIX_NAME))).map((([t,e])=>({fieldName:t,value:e,dataType:s.TEXT})))}removeRecords(t,e){const n=e.map((e=>({dataUnit:t.name,operation:c.DELETE,recordId:e,fields:this.getTransientInfo(t,e)})));return new Promise(((r,a)=>{l.get().callGraphQL({values:{changes:n},query:this.templateByQuery.get("saveData")}).then((()=>{b.removeRecords(t,t.records.filter((t=>e.includes(t.__record__id__)))),r(e)})).catch((t=>{a(t)}))}))}loadRecord(t,e){return new Promise(((n,r)=>{l.get().callGraphQL({values:{recordID:e,dataunit:t.name},query:this.templateByQuery.get("fetchDataRecord")}).then((e=>{const r=[];e.record.forEach((e=>{const n={__record__id__:e.id,__record__label__:e.label};e.fields.forEach((({name:e,value:r})=>{n[e]=t.valueFromString(e,r)})),r.push(n)})),n(r)})).catch((t=>{r(t)}))}))}}export{O as D,v as I,b as P,D as a,y as g}
@@ -1 +0,0 @@
1
- import{r as t,c as s,h as i,H as e,g as a}from"./p-d8d8169b.js";import{Action as h,LockManager as n,LockManagerOperation as r,SilentException as o,StringUtils as l,ApplicationContext as d,OVERFLOWED_CLASS_NAME as v,OverflowWatcher as u,OverflowDirection as c,ElementIDUtils as k}from"@sankhyalabs/core";import{A as m}from"./p-dc36cfbf.js";import{T as b,V as p,A as T,b as f,a as g}from"./p-b987e15d.js";import{P as w}from"./p-0f3698af.js";import"./p-55798617.js";const A=class{constructor(i){t(this,i),this.actionClick=s(this,"actionClick",7),this.taskbarSaveLocker=s(this,"taskbarSaveLocker",7),this.taskbarSaveUnlocker=s(this,"taskbarSaveUnlocker",7),this.TASKBAR_ITEM_ID_PREFIX="TASKBAR_ITEM_",this.TASKBAR_CUSTOM_ELEMENTS_CONTAINER_CLASS_NAME="taskbar-custom-elements-container",this.NOT_OVERFLOW_ELEMENTS=["moreOptions","dataExporter_snkDataExporter","actionsButton_snkActionsButton"],this.TASKBAR_CUSTOM_ELEMENTS="taskbar-custom-elements-container",this.TASKBAR_ADDITIONAL_SLOT_CONTAINER_CLASS_NAME="taskbar-additional-slot-container",this.TASKBAR_ADDITIONAL_SLOT="taskbar-additional-slot-container",this._titleKeyByElement={[b.UPDATE_MULTIPLE]:"snkTaskbar.titleUpdateMultiple",[b.UPDATE]:"snkTaskbar.titleUpdate",[b.PREVIOUS]:"snkTaskbar.titlePrevious",[b.NEXT]:"snkTaskbar.titleNext",[b.REFRESH]:"snkTaskbar.titleRefresh",[b.CLONE]:"snkTaskbar.titleClone",[b.REMOVE]:"snkTaskbar.titleRemove",[b.MORE_OPTIONS]:"snkTaskbar.titleMoreOptions",[b.INSERT]:"snkTaskbar.titleInsert",[b.CANCEL]:"snkTaskbar.titleCancel",[b.SAVE]:"snkTaskbar.titleSave",[b.GRID_MODE]:"snkTaskbar.titleGridMode",[b.FORM_MODE]:"snkTaskbar.titleFormMode",[b.CONFIGURATOR]:"snkTaskbar.titleConfigurator",[b.ATTACH]:"snkTaskbar.titleAttach"},this.onSaveEvent=t=>{switch(t.type){case h.FIELD_INVALIDATED:case h.INVALIDATE_CLEAN:case h.DATA_SAVED:case h.SAVING_ERROR:case h.SAVING_CANCELED:this._isWaitingForSave=!1;break;case h.SAVING_DATA:this._isWaitingForSave=!0}},this._permissions=void 0,this._overFlowedElements=[],this._customElements=void 0,this._customElementsId=void 0,this._slotContainer=void 0,this._hiddenActionsList=[],this._lastWidth=void 0,this._hasToUpdateOverFlow=!1,this._isWaitingForSave=!1,this.alignRigth=!1,this.customSlotId="TASKBAR_CUSTOM_ELEMENTS",this.additionalSlotId="TASKBAR_ADDITIONAL_SLOT",this.customContainerId=void 0,this.overflowStrategy="hiddenItems",this.configName=void 0,this.resourceID=void 0,this.buttons=void 0,this.customButtons=void 0,this.actionsList=void 0,this.actionsSettingsList=void 0,this.primaryButton=void 0,this.disabledButtons=void 0,this.dataUnit=void 0,this.presentationMode=w.PRIMARY,this.messagesBuilder=void 0}handleCustomSlotElementsLoaded(t){this.hasToSearchCustomElements(t)&&this.getCustomElements(!0)}handleTaskbarSaveLocker(){!0!==this._isWaitingForSave&&(this._isWaitingForSave=!0)}handleTaskbarSaveUnlocker(){!0===this._isWaitingForSave&&(this._isWaitingForSave=!1)}hasToSearchCustomElements(t){return this.customSlotId===t.detail&&!this._slotContainer}observeButtons(){this._definitions=void 0,requestAnimationFrame((()=>{requestAnimationFrame((()=>{var t;return null===(t=this._overFlowWatcher)||void 0===t?void 0:t.forceUpdate()}))}))}observeDisabledButtons(){var t;null===(t=this._overFlowWatcher)||void 0===t||t.forceUpdate()}observeLastWidth(t,s){0===s&&0!==t&&(this._hasToUpdateOverFlow=!0)}observeIsWaitingForSave(t,s){1==t&&0==s&&this.taskbarSaveLocker.emit(),0==t&&1==s&&this.taskbarSaveUnlocker.emit()}elementsFromString(t){const s=[];return null==t||t.split(",").forEach((t=>{t=t.trim(),(p[t]||this.isAllowed(t))&&s.push(t.trim())})),s}isAllowed(t){return t===T.CONFIGURATOR?!!this._permissions&&(this._permissions.isSup||this._permissions[m.CONFIG_GRID]||this._permissions[m.CONFIG]):!T[t]||!!this._permissions&&(this._permissions.isSup||this._permissions[t])}getTitle(t){var s;let i;return i=this.isAllowed(t)?this._titleKeyByElement[t]:"snkTaskbar.forbidden",i?null===(s=this.messagesBuilder)||void 0===s?void 0:s.getMessage(i,{}):""}elementClick(t){n.whenResolve(this._element,r.TASKBAR_CLICK).then((()=>{if(this.dataUnit)switch(t){case b.PREVIOUS:this.dataUnit.previousRecord();break;case b.NEXT:this.dataUnit.nextRecord();break;case b.REFRESH:this.dataUnit.loadData();break;case b.CLONE:this.dataUnit.copySelected();break;case b.REMOVE:this.dataUnit.removeSelectedRecords();break;case b.INSERT:this.dataUnit.addRecord();break;case b.CANCEL:this.dataUnit.cancelEdition();break;case b.SAVE:this._isWaitingForSave||(this._isWaitingForSave=!0,this.dataUnit.saveData().catch((t=>{if(!(t instanceof o))throw t})).finally((()=>{this._isWaitingForSave=!1})))}this.isEnabled(t)&&this.actionClick.emit(t)}))}isEnabled(t){return!(!this.isAllowed(t)||this.disabledButtons&&this.disabledButtons.includes(t))}validatePresentationMode(){Object.values(w).includes(this.presentationMode)||(this.presentationMode=w.PRIMARY)}getElement(t,s){let i=s===this.primaryButton?"ez-button--primary ":"";t>1&&(i+="ez-padding-left--medium");const e=b[s.toString()],a=this._element.dataset.exporterStoreKey||this.configName;return e?f(s,i,this.getIdElemBtnNative(s),(t=>this.getTitle(t)),(t=>this.elementClick(t)),(t=>this.isEnabled(t)),s!==b.CONFIGURATOR?this.buildDynamicActionsList():this.buildActionsSettingsList(),a,this.presentationMode):g(s,i,this.getIdElemBtnCustom(s),(t=>this.elementClick(t)),(t=>this.isEnabled(t)))}buildDynamicActionsList(){var t;return this._hiddenActionsList.length?[...null!==(t=this.actionsList)&&void 0!==t?t:[],...this._hiddenActionsList]:this.actionsList}buildActionsSettingsList(){return this.actionsSettingsList}getIdElemBtnNative(t){return l.toCamelCase(t)}getIdElemBtnCustom(t){return l.toCamelCase(t.name)}isDivider(t){var s;return void 0!==t&&(null===(s=t.t)||void 0===s?void 0:s["data-taskbar-divider"])}removeEmpty(t){let s;return t.filter((t=>!(null==t||this.isDivider(s)&&this.isDivider(t)||(s=t,0))))}appendCustomElementsInTaskbar(){this._customElementsId.forEach((t=>{const s=t.replace(this.TASKBAR_ITEM_ID_PREFIX,""),i=this._customElements.get(s),e=this._element.querySelector(`#${t}`);e?null==e||e.appendChild(i):this.unlinkCustomElementFromTaskbar(i)}))}addCustomElementContainer(t){var s;const e=`${this.TASKBAR_ITEM_ID_PREFIX}${t}`;return this._customElementsId.includes(e)||(this._customElementsId.push(e),null===(s=this._overFlowWatcher)||void 0===s||s.addNotOverFlowElement(e)),i("span",{class:"ez-padding-left--medium",key:e,id:e})}getCustomElements(t){var s,i;this._customElementsId=[],this._customElements=new Map,this._slotContainer=this.buildSlotContainer(t),Array.from(null!==(i=null===(s=this._slotContainer)||void 0===s?void 0:s.children)&&void 0!==i?i:[]).forEach((t=>this._customElements.set(t.id,t)))}buildSlotContainer(t){let s;if(this.customContainerId){const t=document.querySelector(`#${this.customContainerId}`);s=null==t?void 0:t.querySelector(`#${this.customSlotId}`)}else s=this._element.querySelector(`#${this.customSlotId}`);return t&&!s&&(s=document.querySelector(`#${this.customSlotId}`)),s}componentWillLoad(){this._application=d.getContextValue("__SNK__APPLICATION__"),this._application?this._application.getAllAccess(this.resourceID).then((t=>this._permissions=t)):this._permissions={},this.getCustomElements()}componentWillRender(){this.handleDefinitions(),this.validatePresentationMode(),this.updateOverFlowIfNeeded()}handleDefinitions(){null==this._definitions&&this._permissions&&(this._definitions=this.elementsFromString(this.buttons))}updateOverFlowIfNeeded(){this._hasToUpdateOverFlow&&(requestAnimationFrame((()=>{var t;return null===(t=this._overFlowWatcher)||void 0===t?void 0:t.forceUpdate()})),this._hasToUpdateOverFlow=!1)}handleOverFlow(t){const s=t.filter((t=>!this.hasToIgnoreOverFlow(t)));this.resetOverFlowedElements(),this.doOverFlowElements(s)}resetOverFlowedElements(){this._overFlowedElements.forEach((t=>{t.classList.remove(v)})),this._hiddenActionsList=[],this._overFlowedElements=[]}doOverFlowElements(t){t.forEach((t=>{t.classList.add(v),this._overFlowedElements.push(t),this.addItemToActionList(t)}))}addItemToActionList(t){const s=this.getTaskbarElementName(t);if(s&&this.isEnabled(s)&&this.isAllowed(s)){const i={value:s,label:this.getTaskbarElementLabel(t),iconName:this.getTaskbarElementIcon(t)};this._hiddenActionsList.push(i)}}getTaskbarElementName(t){var s;return null!==(s=t.getAttribute("data-taskbar-element"))&&void 0!==s?s:""}getTaskbarElementIcon(t){var s;return null!==(s=t.getAttribute("data-taskbar-icon"))&&void 0!==s?s:""}getTaskbarElementLabel(t){var s;return null!==(s=t.getAttribute("data-taskbar-label"))&&void 0!==s?s:""}hasToIgnoreOverFlow(t){return t.classList.contains(this.TASKBAR_CUSTOM_ELEMENTS_CONTAINER_CLASS_NAME)||t.classList.contains(this.TASKBAR_ADDITIONAL_SLOT_CONTAINER_CLASS_NAME)}handleOverFlowStrategy(){"hiddenItems"===this.overflowStrategy&&(this._overFlowWatcher=new u(this.buildOverFlowWatcherParams()))}buildOverFlowWatcherParams(){return{element:this._element,callback:this.handleOverFlow.bind(this),overFlowDirection:c.HORIZONTAL,notOverFlow:this.NOT_OVERFLOW_ELEMENTS}}componentDidLoad(){k.addIDInfo(this._element,null,{dataUnit:this.dataUnit}),this.handleOverFlowStrategy(),this.dataUnit.subscribe(this.onSaveEvent)}componentDidRender(){this.appendCustomElementsInTaskbar(),this.updateLastWidth()}updateLastWidth(){this._lastWidth=this._element.getBoundingClientRect().width}disconnectedCallback(){var t,s;null===(t=this.dataUnit)||void 0===t||t.unsubscribe(this.onSaveEvent),this.unlinkAllCustomElements(),null===(s=this._overFlowWatcher)||void 0===s||s.destroy()}unlinkAllCustomElements(){var t;null===(t=this._customElementsId)||void 0===t||t.forEach((t=>{const s=t.replace(this.TASKBAR_ITEM_ID_PREFIX,""),i=this._customElements.get(s);this.unlinkCustomElementFromTaskbar(i)}))}unlinkCustomElementFromTaskbar(t){this._slotContainer.appendChild(t)}render(){var t,s;if(void 0===this._definitions)return;let a=0;return i(e,{class:this.getHostClasses()},this.removeEmpty(this._definitions.map((t=>{var s,e;return a++,b[t]?this.getElement(a,b[t]):(null===(s=this.customButtons)||void 0===s?void 0:s.has(t))?this.getElement(a,this.customButtons.get(t)):this._customElements.has(t)?this.addCustomElementContainer(t):(null===(e=this._overFlowWatcher)||void 0===e||e.addNotOverFlowElement(t),i("slot",{name:t}))}))),i("div",{id:this.TASKBAR_CUSTOM_ELEMENTS,class:this.TASKBAR_CUSTOM_ELEMENTS_CONTAINER_CLASS_NAME},i("slot",{name:this.customSlotId}),null===(t=this._overFlowWatcher)||void 0===t?void 0:t.addNotOverFlowElement(this.TASKBAR_CUSTOM_ELEMENTS)),i("div",{id:this.TASKBAR_ADDITIONAL_SLOT,class:this.TASKBAR_ADDITIONAL_SLOT_CONTAINER_CLASS_NAME},i("slot",{name:this.additionalSlotId}),null===(s=this._overFlowWatcher)||void 0===s?void 0:s.addNotOverFlowElement(this.TASKBAR_ADDITIONAL_SLOT)))}getHostClasses(){return"hiddenItems"!==this.overflowStrategy?"no-wrap":"full-width "+(this.alignRigth?"align-right":"")}get _element(){return a(this)}static get watchers(){return{buttons:["observeButtons"],disabledButtons:["observeDisabledButtons"],_lastWidth:["observeLastWidth"],_isWaitingForSave:["observeIsWaitingForSave"]}}};A.style=".sc-snk-taskbar-h{display:flex;flex-wrap:wrap}.no-wrap.sc-snk-taskbar-h{flex-wrap:nowrap}.full-width.sc-snk-taskbar-h{width:100%}.align-right.sc-snk-taskbar-h{justify-content:flex-end}.overflowed.sc-snk-taskbar{display:none}";export{A as snk_taskbar}
@@ -1 +0,0 @@
1
- import{a as e,f as t}from"./p-d8d8169b.js";const s=e=>!("isConnected"in e)||e.isConnected,o=(()=>{let e;return(...t)=>{e&&clearTimeout(e),e=setTimeout((()=>{e=0,(e=>{for(let t of e.keys())e.set(t,e.get(t).filter(s))})(...t)}),2e3)}})(),r=e=>"function"==typeof e?e():e,n=(e,t)=>{const s=e.indexOf(t);s>=0&&(e[s]=e[e.length-1],e.length--)},c=(()=>{const s=((e,t=((e,t)=>e!==t))=>{const s=r(e);let o=new Map(Object.entries(s??{}));const c={dispose:[],get:[],set:[],reset:[]},a=new Map,i=()=>{o=new Map(Object.entries(r(e)??{})),c.reset.forEach((e=>e()))},p=e=>(c.get.forEach((t=>t(e))),o.get(e)),d=(e,s)=>{const r=o.get(e);t(s,r,e)&&(o.set(e,s),c.set.forEach((t=>t(e,s,r))))},u="undefined"==typeof Proxy?{}:new Proxy(s,{get:(e,t)=>p(t),ownKeys:()=>Array.from(o.keys()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),has:(e,t)=>o.has(t),set:(e,t,s)=>(d(t,s),!0)}),f=(e,t)=>(c[e].push(t),()=>{n(c[e],t)});return{state:u,get:p,set:d,on:f,onChange:(t,s)=>{const o=(e,o)=>{e===t&&s(o)},n=()=>s(r(e)[t]),c=f("set",o),i=f("reset",n);return a.set(s,{setHandler:o,resetHandler:n,propName:t}),()=>{c(),i(),a.delete(s)}},use:(...e)=>{const t=e.reduce(((e,t)=>(t.set&&e.push(f("set",t.set)),t.get&&e.push(f("get",t.get)),t.reset&&e.push(f("reset",t.reset)),t.dispose&&e.push(f("dispose",t.dispose)),e)),[]);return()=>t.forEach((e=>e()))},dispose:()=>{c.dispose.forEach((e=>e())),i()},reset:i,forceUpdate:e=>{const t=o.get(e);c.set.forEach((s=>s(e,t,t)))},removeListener:(e,t)=>{const s=a.get(t);s&&s.propName===e&&(n(c.set,s.setHandler),n(c.reset,s.resetHandler),a.delete(t))}}})({exporterProviders:{},filterFieldsDataSource:void 0},void 0);return s.use((()=>{if("function"!=typeof e)return{};const s=new Map;return{dispose:()=>s.clear(),get:t=>{const o=e();o&&((e,t,s)=>{const o=e.get(t);o?o.includes(s)||o.push(s):e.set(t,[s])})(s,t,o)},set:e=>{const r=s.get(e);r&&s.set(e,r.filter(t)),o(s)},reset:()=>{s.forEach((e=>e.forEach(t))),o(s)}}})()),s})();export{c as s}
@@ -1 +0,0 @@
1
- export{S as snk_guides_viewer}from"./p-0e279e7a.js";import"./p-d8d8169b.js";import"@sankhyalabs/core";import"@sankhyalabs/core/dist/dataunit/DataUnit";import"@sankhyalabs/ezui/dist/collection/utils";import"@sankhyalabs/ezui/dist/collection/utils/form";import"./p-bb2f5f38.js";import"./p-8d884fab.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-53599b26.js";import"./p-0f3698af.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"./p-5304753a.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";import"./p-ff1990ad.js";import"./p-9317942f.js";import"./p-9019a32f.js";import"./p-a644a956.js";import"./p-78ff8734.js";import"./p-b987e15d.js";import"./p-55798617.js";import"./p-1a0caadb.js";
@@ -1 +0,0 @@
1
- import{r as t,c as e,h as i,H as s}from"./p-d8d8169b.js";import{A as r}from"./p-6a4b21dd.js";const l=class{constructor(i){t(this,i),this.actionSelected=e(this,"actionSelected",7),this.OFFSET_HEIGHT=5,this.getMessage=void 0,this.hasDefaultFilter=!1,this._opened=!1}repositionDropDown(){if(!this._refIcon||!this._refDropdown)return;const t=this._refIcon.getBoundingClientRect(),e=this._refDropdown.getBoundingClientRect();this._refDropdown.style.top=t.y+t.height+this.OFFSET_HEIGHT+"px",this._refDropdown.style.left=t.x+t.width/2-e.width+"px"}toggleDropdown(){this._opened=!this._opened}closeDropdown(t){const e=null==t?void 0:t.target;e&&(e.closest("#dropdown-parent-demo")||(this._opened=!1))}buildItems(){return[{id:r.EDIT,label:this.getMessage("defaultFilter.edit")},{id:r.REMOVE,label:this.getMessage("defaultFilter.remove")}]}onValueSelected({detail:t}){this._opened=!1,this.actionSelected.emit(t.id)}openCreateNewFilter(){this.actionSelected.emit(r.CREATE)}componentDidRender(){this.repositionDropDown()}componentWillLoad(){this._items=this.buildItems(),document.removeEventListener("scroll",this.repositionDropDown.bind(this)),document.addEventListener("scroll",this.repositionDropDown.bind(this))}render(){return this.hasDefaultFilter?i(s,null,i("button",{class:"default_container",onClick:this.toggleDropdown.bind(this)},i("span",null,this.getMessage("defaultFilter.title")),i("ez-icon",{ref:t=>this._refIcon=t,iconName:"dots-vertical"})),this._opened&&i("ez-dropdown",{ref:t=>this._refDropdown=t,items:this._items,onEzClick:this.onValueSelected.bind(this),onEzOutsideClick:this.closeDropdown.bind(this)})):i(s,null,i("button",{class:"default_container new_filter",onClick:this.openCreateNewFilter.bind(this)},i("span",null,this.getMessage("defaultFilter.create"))))}};l.style=".sc-snk-default-filter-h{display:flex;justify-content:flex-end}.default_container.sc-snk-default-filter{border:none;background:none;display:flex;align-items:center;gap:var(--space--3xs, 4px);font-family:var(--font-pattern);color:var(--title--primary, #2b3a54);font-size:var(--text--medium, 14px);padding:0;outline:none}.default_container.sc-snk-default-filter ez-icon.sc-snk-default-filter{cursor:pointer}.default_container.sc-snk-default-filter ez-icon.sc-snk-default-filter:hover{color:var(--color--primary-600)}.new_filter.sc-snk-default-filter{cursor:pointer;margin:0 var(--space--3xs, 4px)}.new_filter.sc-snk-default-filter:hover{color:var(--color--primary-600)}";export{l as snk_default_filter}
@@ -1 +0,0 @@
1
- import{r as i,c as t,h as e,F as s,H as n}from"./p-d8d8169b.js";import{StringUtils as l,ObjectUtils as a,ApplicationContext as r,ElementIDUtils as o}from"@sankhyalabs/core";import{P as h}from"./p-988afe78.js";import{P as d,C as c}from"./p-78ff8734.js";import{ApplicationUtils as f}from"@sankhyalabs/ezui/dist/collection/utils";import{a as p,D as z}from"./p-84345e7a.js";import{s as u}from"./p-55798617.js";import"./p-ff1990ad.js";import"./p-9317942f.js";import"./p-bb2f5f38.js";import"./p-8d884fab.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";const m=class{constructor(e){i(this,e),this.ezCancel=t(this,"ezCancel",7),this.ezSave=t(this,"ezSave",7),this.ezAfterSave=t(this,"ezAfterSave",7),this._personalizedFilterFetcher=new d,this._filterMetadataStorage=new Map,this._dataSourceFetcher={fetchData:async i=>{let t=null==i?void 0:i.uri;if(l.isEmpty(t)&&(t=this.entityUri),!this._filterMetadataStorage.has(t)){const i=await this._personalizedFilterFetcher.loadFields(t);this._filterMetadataStorage.set(t,i)}return this._filterMetadataStorage.get(t)}},this._filterAssistentMode=!0,this._filterAssistent=void 0,this.messagesBuilder=void 0,this.entityUri=void 0,this.filterId=void 0,this.configName=void 0,this.resourceID=void 0,this.isDefaultFilter=!1}async createPersonalizedFilter(){const i={name:"",active:!0,expression:"",parameters:[],assistent:{id:l.generateUUID(),items:[{id:l.generateUUID(),entityName:"",fieldName:"",description:"",fieldLabel:this.getMessage("snkPersonalizedFilter.info.labelDefaultValue"),type:void 0,expression:void 0,operand:void 0,paramVariable:!1,value:void 0,systemConfig:null,userConfig:null}],childrenGroups:[],operand:p.AND}};this.isDefaultFilter&&this.buildDataDefaultFilter(i),this._originalFilterAssistent=a.copy(i),this._filterAssistent=a.copy(i)}loadFilter(i,t){null!=i&&t!=i&&null!=this.resourceID&&(i!==z.id?c.loadPersonalizedFilter(i,this.resourceID,this.configName).then((i=>{const t=this.applyDefaultValues(i);this._filterAssistent=t,this._originalFilterAssistent=a.copy(t),this._filterAssistentMode=this._filterAssistent.hasOwnProperty("assistent")&&null!=this._filterAssistent.assistent})):c.loadDefaultFilter(i,this.resourceID,this.configName).then((i=>{const t=this.applyDefaultValues(i);this._filterAssistent=t,this._originalFilterAssistent=a.copy(t),this._filterAssistentMode=this._filterAssistent.hasOwnProperty("assistent")&&null!=this._filterAssistent.assistent})))}componentWillLoad(){var i;null==u.get(`filterFieldsDataSource.${this.entityUri}`)&&u.set(`filterFieldsDataSource.${this.entityUri}`,this._dataSourceFetcher),this.messagesBuilder||(this._application=r.getContextValue("__SNK__APPLICATION__"),this.messagesBuilder=null===(i=this._application)||void 0===i?void 0:i.messagesBuilder),this.loadFilter(this.filterId,void 0)}componentDidRender(){var i;null===(i=this._viewStackRef)||void 0===i||i.show(this._filterAssistentMode?0:1),this._elButtonMode&&this._elButtonMode.setAttribute(o.DATA_ELEMENT_ID_ATTRIBUTE_NAME,o.getInternalIDInfo(this._filterAssistentMode?"advancedMode_ezButton":"assistentMode_ezButton"))}buildDataDefaultFilter(i){i.name=z.name,i.id=z.id}getMessage(i,t){return this._application.messagesBuilder.getMessage(i,t)}async saveFilter(){let i;i=this.isDefaultFilter?await c.saveDefaultFilter(this._filterAssistent,this.resourceID,this.configName):await c.savePersonalizedFilter(this._filterAssistent,this.resourceID,this.configName),this._elButtonSave.enabled=!1,f.info(this.getMessage(`snkPersonalizedFilter.${this._filterAssistent.id?"confirmEdit":"confirmSave"}.title`),{iconName:"check"});const t=Object.assign(Object.assign({},i),this._filterAssistent);t.parameters=h.buildVariableParameters(this._filterAssistent.assistent),this._originalFilterAssistent=a.copy(t),this._filterAssistent=a.copy(t),this.ezAfterSave.emit()}removeFilter(){c.removePersonalizedFilter(this._filterAssistent,this.resourceID,this.configName)}hasChangesToSave(){return JSON.stringify(this._filterAssistent)===JSON.stringify(this._originalFilterAssistent)}async handleSave(){if(this._filterAssistentMode){if(!h.validateFields(this._filterAssistent.assistent)||!this._filterAssistent.name)return this._application.error(this.getMessage("snkPersonalizedFilter.error.title"),this.getMessage("snkPersonalizedFilter.error.description"));this.saveAssistentMode()}else{if(!this._filterAssistent.expression||!this._filterAssistent.name)return this._application.error(this.getMessage("snkPersonalizedFilter.error.title"),this.getMessage("snkPersonalizedFilter.error.description"));if(!await this.validateExpressionBeforeSaving())return;this.saveAdvancedMode()}}saveAssistentMode(){const{assistent:i,expression:t}=this._filterAssistent,e=i?h.buildGroupExpression(i):t;this._filterAssistent.expression=e,this.ezSave.emit(e),this.saveFilter()}saveAdvancedMode(){this._originalFilterAssistent.expression!==this._filterAssistent.expression&&this._filterAssistent.assistent?f.confirm(this.getMessage("snkPersonalizedFilter.confirmSaveModeAdvanced.title"),this.getMessage("snkPersonalizedFilter.confirmSaveModeAdvanced.description")).then((i=>{i&&this.saveAndTransformToAdvancedMode()})):this._filterAssistent.assistent?this.saveAssistentMode():this.saveAndTransformToAdvancedMode()}saveAndTransformToAdvancedMode(){this._filterAssistent.assistent=void 0,this.ezSave.emit(this._filterAssistent.expression),this.saveFilter()}async validateExpressionBeforeSaving(){const{valid:i,message:t=""}=await this._personalizedFilterFetcher.validatePersonalizedFilter(this.entityUri,this._filterAssistent.expression);return i||this._application.error(this.getMessage("snkPersonalizedFilter.errorValidation.title"),t.replace(/.*Exception: /,"")),i}handleCancel(){if(this.hasChangesToSave())return this.ezCancel.emit();f.confirm(this.getMessage("snkPersonalizedFilter.confirmCancel.title"),this.getMessage("snkPersonalizedFilter.confirmCancel.description")).then((i=>{var t;i&&(this._filterAssistent=a.copy(null!==(t=this._originalFilterAssistent)&&void 0!==t?t:{}),this.ezCancel.emit(),this._elButtonSave.enabled=!1)}))}handleTitleChange(i){this._filterAssistent=Object.assign(Object.assign({},this._filterAssistent),{name:i}),this._elButtonSave.enabled=!this.hasChangesToSave()}applyDefaultValues(i){return this.addLabelToItems(i),this.addFilterGroupCondition(i),i}addFilterGroupCondition(i){i.assistent&&!i.assistent.operand&&(i.assistent.operand=p.AND)}addLabelToItems(i){i.assistent&&i.assistent.items&&i.assistent.items.length>0&&i.assistent.items.forEach((t=>{if(null==t.fieldLabel){const e=(i.parameters||[]).find((i=>i.fieldName===t.fieldName));e&&(t.fieldLabel=e.label)}}))}handleExpressionChangeAdvancedMode(i){this._filterAssistent=Object.assign(Object.assign({},this._filterAssistent),{expression:i}),this._elButtonSave.enabled=!this.hasChangesToSave()}handleChangeFilterAssistentMode(i){this._elButtonSave.enabled=!this.hasChangesToSave(),this._filterAssistent=Object.assign({},i)}selectField(i){if(!("name"in i))return;const t=this.buildExpression(i.entityName,i.name,i.entityPath);this._elAdvancedMode.querySelector("ez-text-area").appendTextToSelection(t)}buildExpression(i,t,e){return e.length>0&&e.shift(),e.length>0?`${e.join("->")}->${t}`:`${i}.${t}`}onAddField(i){this._elAdvancedMode.querySelector("ez-text-area").setFocus(),i.setBlur(),this._elFilterFieldSearch&&this._elFilterFieldSearch.show(i,{horizontalGap:0,verticalGap:12,fromRight:!0})}renderButtonAddField(){if(!this._filterAssistentMode)return e(s,null,e("ez-button",{class:"snk-personalized-filter__button-mode",label:this.getMessage("snkPersonalizedFilter.info.addField"),enabled:!0,onClick:i=>this.onAddField(i.target)},e("ez-icon",{class:"ez-padding-right--small",slot:"leftIcon",iconName:"plus"})),e("snk-filter-field-search",{class:"ez-padding-left--medium",ref:i=>this._elFilterFieldSearch=i,onEzSelectFilterItem:i=>this.selectField(i.detail),fieldsDataSource:this._dataSourceFetcher}))}buildContainerPersonalizedFilter(){return e("ez-view-stack",{ref:i=>this._viewStackRef=i},e("stack-item",null,this._filterAssistentMode&&e("snk-filter-assistent-mode",{filterAssistent:this._filterAssistent,messagesBuilder:this.messagesBuilder,filterId:this.filterId,entityUri:this.entityUri,application:this._application,onEzChangeFilter:i=>this.handleChangeFilterAssistentMode(i.detail),isDefaultFilter:this.isDefaultFilter})),e("stack-item",null,e("snk-filter-advanced-mode",{ref:i=>this._elAdvancedMode=i,filterAssistent:this._filterAssistent,application:this._application,onEzExpressionChange:i=>this.handleExpressionChangeAdvancedMode(i.detail)})))}handleModeChange(){var i,t;if(this._filterAssistentMode)f.confirm(this.getMessage("snkPersonalizedFilter.confirmChangeModeAssistent.title"),this.getMessage("snkPersonalizedFilter.confirmChangeModeAssistent.description")).then((i=>{if(i&&(this._filterAssistentMode=!this._filterAssistentMode,!this.hasChangesToSave())){const i=h.buildGroupExpression(this._filterAssistent.assistent);this._filterAssistent.expression=i,this._elButtonSave.enabled=!this.hasChangesToSave()}}));else if((null===(i=this._filterAssistent)||void 0===i?void 0:i.expression)===(null===(t=this._originalFilterAssistent)||void 0===t?void 0:t.expression))this._filterAssistentMode=!this._filterAssistentMode;else{const i=this._filterAssistent.expression,t=h.buildGroupExpression(this._filterAssistent.assistent);i!==t?f.confirm(this.getMessage("snkPersonalizedFilter.confirmChangeModeAdvanced.title"),this.getMessage("snkPersonalizedFilter.confirmChangeModeAdvanced.description")).then((i=>{i&&(this._filterAssistent=Object.assign(Object.assign({},this._filterAssistent),{expression:t}),this._filterAssistentMode=!this._filterAssistentMode)})):this._filterAssistentMode=!this._filterAssistentMode}}buildTitle(){return this.getMessage(this.isDefaultFilter&&!this.filterId?"snkPersonalizedFilter.info.titleCreateDefault":this.isDefaultFilter&&this.filterId?"snkPersonalizedFilter.info.titleEditDefault":this.filterId?"snkPersonalizedFilter.info.titleEdit":"snkPersonalizedFilter.info.titleAdd")}render(){var i,t,s,l;if((null===(i=this._filterAssistent)||void 0===i?void 0:i.assistent)||!this._filterAssistentMode)return e(n,null,e("div",{class:"snk-personalized-filter"},e("div",null,e("snk-simple-bar",{label:this.buildTitle(),onExit:()=>this.handleCancel()},e("div",{class:"snk-personalized-filter__header-actions",slot:"rightSlot"},e("ez-button",{size:"small",label:this.getMessage("snkPersonalizedFilter.info.labelCancel"),onClick:()=>this.handleCancel()}),e("ez-button",{size:"small",ref:i=>this._elButtonSave=i,enabled:!1,class:"ez-button--primary",label:this.getMessage("snkPersonalizedFilter.info.labelSave"),onClick:this.handleSave.bind(this)})))),e("div",{class:"ez-box ez-margin-bottom--medium ez-box__main"},e("div",{class:"ez-box__container"},e("div",{class:"ez-flex ez-flex--column ez-size-width--full"},e("div",{class:"ez-flex"},e("ez-tooltip",{message:this.getMessage("snkPersonalizedFilter.info.textInputDisabled"),active:this.isDefaultFilter},e("ez-text-input",{class:"ez-padding-right--medium",label:this.getMessage("snkPersonalizedFilter.info.labelNameFilter"),value:null===(t=this._filterAssistent)||void 0===t?void 0:t.name,onEzChange:i=>this.handleTitleChange(i.detail),enabled:!this.isDefaultFilter})),this.renderButtonAddField(),e("ez-button",{ref:i=>this._elButtonMode=i,class:"snk-personalized-filter__button-mode",label:this.getMessage(this._filterAssistentMode?"snkPersonalizedFilter.info.activeModeAdvanced":"snkPersonalizedFilter.info.activeModeAssistent"),onClick:()=>this.handleModeChange(),"data-tooltip":this._filterAssistentMode||(null===(s=this._filterAssistent)||void 0===s?void 0:s.assistent)?void 0:this.getMessage("snkPersonalizedFilter.info.tooltipDisabledAssistentMode"),"data-flow":"bottom",enabled:!this._filterAssistent.name||Boolean(this._filterAssistentMode||(null===(l=this._filterAssistent)||void 0===l?void 0:l.assistent))})),this.buildContainerPersonalizedFilter())))))}static get watchers(){return{filterId:["loadFilter"]}}};m.style=".sc-snk-personalized-filter-h{display:flex;height:100%;padding:var(--space--large, 24px);--snk-personalized-filter--width:100%;--snk-personalized-filter--height:100%;--snk-personalized-filter--background-color-line:var(--color--disable-secondary);--snk-personalized-filter--margin-line:var(--border--radius-medium, 12px)}.snk-personalized-filter.sc-snk-personalized-filter{height:var(--snk-personalized-filter--width);width:var(--snk-personalized-filter--height)}.snk-personalized-filter__header-actions.sc-snk-personalized-filter{display:flex;gap:var(--space--medium)}.snk-personalized-filter__group.sc-snk-personalized-filter{flex:1}.snk-personalized-filter__expression-input--line.sc-snk-personalized-filter{width:100%;height:2px;background-color:var(--snk-personalized-filter--background-color-line);margin-top:var(--snk-personalized-filter--margin-line);margin-bottom:var(--snk-personalized-filter--margin-line)}.ez-box__main.sc-snk-personalized-filter{height:90%}.snk-personalized-filter__button-mode.sc-snk-personalized-filter{height:35px}";export{m as snk_personalized_filter}
@@ -1 +0,0 @@
1
- import{r as t,c as s,h as i,H as e,F as a}from"./p-d8d8169b.js";import{I as o}from"./p-5304753a.js";import"./p-bb2f5f38.js";import{P as r}from"./p-53599b26.js";import"@sankhyalabs/core";import"./p-0f3698af.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-ff1990ad.js";import"./p-9317942f.js";import"./p-9019a32f.js";import{ApplicationUtils as n}from"@sankhyalabs/ezui/dist/collection/utils";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";import"./p-8d884fab.js";const h=class{constructor(i){t(this,i),this.pesquisaGridSelectItem=s(this,"pesquisaGridSelectItem",7),this._pesquisaFetcher=new r,this.metadata=void 0,this.dataSource=[],this.pkField=void 0,this.descriptionField=void 0,this.entityName=void 0,this.shouldLoadConfig=!1,this._gridConfig=void 0,this._inMemoryLoader=void 0,this._dataunit=void 0}observeDataSource(t){this._inMemoryLoader&&this._dataunit&&t&&(this._inMemoryLoader.records=[...t])}observeMetadata(){this.initializeDataUnit()}async observeShouldLoadConfig(t){t&&!this._gridConfig&&await this.loadGridConfig()}async loadGridConfig(){this._gridConfig=await this._pesquisaFetcher.loadPesquisaGridConfig(this.entityName)}initializeDataUnit(){var t;this.metadata&&!this._dataunit&&(this._inMemoryLoader=new o(this.metadata,null!==(t=this.dataSource)&&void 0!==t?t:[]),this._dataunit=this._inMemoryLoader.dataUnit,this._dataunit.pageSize=0)}handleDbClick(t){this.pesquisaGridSelectItem.emit({value:t[this.pkField],label:t[this.descriptionField]})}async handleConfigChanged({detail:t}){var s;const i=null!==(s=null==t?void 0:t.columns)&&void 0!==s?s:[];await this._pesquisaFetcher.savePesquisaGridConfig(this.entityName,i)}render(){if(this.metadata&&this._dataunit)return i(e,null,i("ez-grid",{dataUnit:this._dataunit,config:this._gridConfig,mode:"simple",autoFocus:!1,onEzDoubleClick:({detail:t})=>this.handleDbClick(t),onConfigChange:async t=>this.handleConfigChanged(t)}))}static get watchers(){return{dataSource:["observeDataSource"],metadata:["observeMetadata"],shouldLoadConfig:["observeShouldLoadConfig"]}}};h.style=".sc-pesquisa-grid-h{background:var(--background--xlight, #FFF);overflow-x:auto}ez-grid.sc-pesquisa-grid{--ez-grid__container--shadow:none;--ez-grid__header--shadow:none}";const l=class{constructor(i){t(this,i),this.pesquisaTreeSelectItem=s(this,"pesquisaTreeSelectItem",7),this.treeLoader=void 0,this.argument=void 0,this.allowsNonAnalytic=!1,this.shouldLoadTree=!1,this.messagesBuilder=void 0,this.items=[]}async applyFilter(){await this._tree.applyFilter(this.argument)}async observeShouldLoadTree(t){!t||this.items.length>0||await this.loadTree()}async loadTree(){if(!this.shouldLoadTree)return;if(!this.treeLoader||"function"!=typeof this.treeLoader)return;const t=await this.treeLoader((this.argument||"").trim());this.items=[...t]}expandOrCloseAllItems(t,s){return t.map((t=>Object.assign(Object.assign({},t),{expanded:s,children:t.children?this.expandOrCloseAllItems(t.children,s):void 0})))}handleExpandAll(){this.items=[...this.expandOrCloseAllItems(this.items,!0)]}handleCloseAll(){this.items=[...this.expandOrCloseAllItems(this.items,!1)]}handleDbClick(t){var s;if(this.allowsNonAnalytic||(null===(s=t.props)||void 0===s?void 0:s.analitico))this.pesquisaTreeSelectItem.emit({value:t.id,label:t.label});else{const t=this.getMessage("snkPesquisa.tree.errorTitle"),s=this.getMessage("snkPesquisa.tree.nonAnalyticError");n.error(t,s)}}renderEmptyMessage(){return i("div",{class:"ez-flex ez-flex--justify-center ez-flex--align-items-center ez-margin--large ez-text ez-text--xlarge ez-text--secondary"},i("span",null,this.getMessage("snkPesquisa.tree.emptyMessage")))}getMessage(t,s){return this.messagesBuilder.getMessage(t,s)}render(){var t;return i(e,null,(null===(t=this.items)||void 0===t?void 0:t.length)?i(a,null,i("div",{class:"actions-container"},i("ez-button",{size:"small",mode:"icon",class:"ez-margin-right--small",iconName:"show-list",title:this.getMessage("snkPesquisa.tree.expandButton"),onClick:()=>this.handleExpandAll()}),i("ez-button",{size:"small",mode:"icon",iconName:"hide-list",title:this.getMessage("snkPesquisa.tree.collapseButton"),onClick:()=>this.handleCloseAll()})),i("ez-tree",{ref:t=>this._tree=t,onEzDbClickItem:({detail:t})=>this.handleDbClick(t),items:this.items})):this.renderEmptyMessage())}static get watchers(){return{shouldLoadTree:["observeShouldLoadTree"]}}};l.style=".sc-pesquisa-tree-h{--snk-pesquisa--tree__action-container--top:var(--space--sm);--snk-pesquisa--tree__action-container--right:var(--space--small);--snk-pesquisa--tree__min-height:var(--space--extra-large);background:var(--background--xlight, #FFF);position:relative;min-height:var(--snk-pesquisa--tree__min-height);height:100%;display:block;overflow-y:auto}.sc-pesquisa-tree-h:hover .actions-container.sc-pesquisa-tree{display:flex}.actions-container.sc-pesquisa-tree{flex-direction:row;position:absolute;top:var(--snk-pesquisa--tree__action-container--top);right:var(--snk-pesquisa--tree__action-container--right);display:none}";export{h as pesquisa_grid,l as pesquisa_tree}
@@ -1 +0,0 @@
1
- import{UserInterface as n,DataType as t}from"@sankhyalabs/core";import{a as o,G as e,D as r}from"./p-9019a32f.js";const u=new Map([[n.DATE,"calendar"],[n.DATETIME,"calendar-clock"],[n.ELAPSEDTIME,"timer-outline"],[n.TIME,"timer-outline"],[n.DECIMALNUMBER,"number"],[n.INTEGERNUMBER,"number"],[n.FILE,"zip"],[n.IMAGE,"pdf"],[n.HTML,"tag_code"],[n.SEARCH,"search"],[n.SEARCHPLUS,"search"],[n.OPTIONSELECTOR,"list"],[n.CHECKBOX,"list"],[n.SWITCH,"boolean"],[n.PASSWORD,"eye-off"]]),i="container-available-fields";var l;function c(n,t,o,e){var r;const u=null===(r=null==n?void 0:n[t])||void 0===r?void 0:r.children;return u?Array.from(u).map((({fieldConfig:n})=>Object.assign(Object.assign({},n),{group:o,tab:e}))):[]}function a(n,t){return n.map((n=>Object.assign(Object.assign({},n),{fields:n.fields.map((n=>Object.assign(Object.assign({},n),{tab:t})))})))}function f(n,o,e){var r;if(null==n||!o||!e)return;const u=null===(r=o.getField(e))||void 0===r?void 0:r.dataType;if(null==u)return;if(void 0!==(null==n?void 0:n.waitmessage))return;const i=u!==t.OBJECT&&u!==t.DATE&&"object"==typeof n?n.value:n;return u===t.OBJECT?JSON.stringify(i):i}function s(n,t,o){if(!o)return!0;const e=o.properties||{},r=!0!==o[n];return e.hasOwnProperty(t)?"S"!==e[t]:r}function d(n,t,o){return!(!t||!0!==t[n])||o}function v(n){return u.get(n)||"text"}function b(n,t){var o,e;const r=t("snkFormConfig.form.newGuide"),u=null!==(e=null===(o=n.filter((n=>n.name.includes(r))))||void 0===o?void 0:o.length)&&void 0!==e?e:0;return 0===u?r:`${r} (${u})`}function m(n){const t=[];return n.forEach((n=>{n.forEach((({fields:n})=>{null==n||n.forEach((n=>{t.push(function(n){const t={cleanOnCopy:n.cleanOnCopy||!1,group:n.group===e.noGroup?void 0:n.group,label:n.label,name:n.name,required:n.required,readOnly:n.readOnly,tab:n.tab};return null!=n.defaultValue&&(t.defaultValue=null==n.defaultValue.type?{type:r.fixed,value:n.defaultValue}:n.defaultValue),t}(n))}))}))})),t}function p(n,t,e,r){const u=n.map((n=>{const t=n.tab;return Object.assign(Object.assign({},n),{tab:t&&t!==o.general?n.tab:o.main})})),i=function(n){const t=new Map;return j(n).forEach((n=>{t.set(n.name,[])})),t}(t);if(null==u?void 0:u.length){for(let n of i.keys()){const t=M(k(C(u,n,r),e,r));i.set(n,t)}return i}}function O(n,t){let e=n.tabs?[...n.tabs]:function(n){const t=[];let o=1;return null==n||n.forEach((n=>{const e=n.tab;(function(n,t){return n&&!t.map((n=>n.name)).includes(n)})(e,t)&&(t.push({name:e,label:e,visible:!0,order:o}),o+=1)})),t}(null==n?void 0:n.fields);return e=j(e),e=function(n){return n.map((n=>Object.assign(Object.assign({},n),{name:n.name?n.name:n.label})))}(e),function(n,t){const e={name:o.main,label:t,visible:!0};return n.some((n=>n.name===o.main))?n=n.map((n=>n.name===o.main?e:n)):n.unshift(e),n}(e,t)}function j(n){return[...n.filter((n=>n.label!==o.general))]}function y(n,t){n.label||(n.label=t.label)}function g(n,t){n.tab||(n.tab=t)}function h(n){n.group||(n.group=e.noGroup)}function w(n){var t;return!0===(null===(t=null==n?void 0:n.properties)||void 0===t?void 0:t.visibleOnConfig)&&!1===(null==n?void 0:n.visible)}function k(n,t,o){const r=new Map;r.set(e.noGroup,[]);for(let e of n){const n=t.getField(e.name);((null==n?void 0:n.visible)||w(n))&&(y(e,n),g(e,o),h(e),r.has(e.group)?r.get(e.group).push(e):r.set(e.group,[e]))}return r}function C(n,t,o){return n.filter((n=>{const e=function(n,t){var o;return"string"==typeof n?n:null!==(o=null==n?void 0:n.label)&&void 0!==o?o:t}(n.tab,o);return e===t}))}function M(n){const t=[];for(let o of n.keys())t.push({name:o,fields:n.get(o)});return t}!function(n){n.FROM="from",n.TO="to"}(l||(l={}));export{i as I,l as S,p as a,O as b,b as c,c as d,f as e,s as f,m as g,d as h,v as i,a as u}
@@ -1 +0,0 @@
1
- import{r as i,c as s,h as e,g as t}from"./p-d8d8169b.js";import{ElementIDUtils as l,ApplicationContext as a}from"@sankhyalabs/core";const r=class{constructor(e){i(this,e),this.clickBreadcrumbItem=s(this,"clickBreadcrumbItem",3),this.exit=s(this,"exit",3),this.label=void 0,this.breadcrumbItens=void 0,this.messagesBuilder=void 0}getMessage(i,s){var e;return this.messagesBuilder?this.messagesBuilder.getMessage(i,s):(null===(e=this._application)||void 0===e?void 0:e.messagesBuilder)?this._application.messagesBuilder.getMessage(i,s):void 0}componentDidLoad(){this._element&&(l.addIDInfo(this._element),this._application=a.getContextValue("__SNK__APPLICATION__"))}render(){return e("div",{class:"simple-bar__container ez-margin-vertical--small ez-padding--extra-small"},e("div",{class:"simple-bar__left-slot"},e("ez-button",{class:"ez-padding-right--medium",title:this.getMessage("snkSimpleBar.backTitle"),mode:"icon",iconName:"arrow_back",size:"medium",onClick:()=>this.exit.emit()}),e("div",{class:"simple-bar__column"},e("h1",{class:"ez-title ez-title--primary ez-title--extra-large"},this.label),e("ez-breadcrumb",{items:this.breadcrumbItens,onSelectedItem:({detail:i})=>this.clickBreadcrumbItem.emit(i)}))),e("div",{class:"simple-bar__right-slot"},e("slot",{name:"rightSlot"})))}get _element(){return t(this)}};r.style=".sc-snk-simple-bar-h{display:flex;height:100%;width:100%}.simple-bar__container.sc-snk-simple-bar{flex:1;display:flex;align-items:stretch;gap:var(--space--small)}.simple-bar__left-slot.sc-snk-simple-bar{min-width:280px;flex:1;display:flex;align-items:center}.simple-bar__right-slot.sc-snk-simple-bar{flex:1;display:flex;align-items:center;justify-content:flex-end}.simple-bar__column.sc-snk-simple-bar{flex:1;display:flex;flex-direction:column}";export{r as snk_simple_bar}
@@ -1,26 +0,0 @@
1
- import{d as e,D as t}from"./p-bb2f5f38.js";import{ObjectUtils as n}from"@sankhyalabs/core";class o{constructor(){this.templateByQuery=new Map,this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchResource",e.gql`query($name: String!) {
2
- $queryAlias$: fetchResource(name: $name){
3
- resource
4
- }
5
- }`),this.templateByQuery.set("saveResource",e.gql`mutation($resource: InputResource!) {
6
- $queryAlias$: saveResource(resource: $resource){
7
- name
8
- resource
9
- }
10
- }`)}loadResource(e){if(o._loadingResource.has(e))return o._loadingResource.get(e);const n=new Promise(((n,r)=>{t.get().callGraphQL({values:{name:e},query:this.templateByQuery.get("fetchResource")}).then((t=>{n(null==t?void 0:t.resource),o._loadingResource.delete(e)})).catch((t=>{r(t),o._loadingResource.delete(e)}))}));return o._loadingResource.set(e,n),n}saveResource(e,n){return new Promise(((o,r)=>{t.get().callGraphQL({values:{resource:{name:n,resource:JSON.stringify(e)}},query:this.templateByQuery.get("saveResource")}).then((e=>{o(e)})).catch((e=>{r(e)}))}))}}o._loadingResource=new Map;class r extends o{constructor(){super(),this.queryConfig=new Map,this.buildTemplatesConfig()}buildTemplatesConfig(){this.queryConfig.set("fetchUserAvailableConfigs",e.gql`query($name: String!) {
11
- $queryAlias$: fetchUserAvailableConfigs(name: $name){
12
- name
13
- origin
14
- key
15
- }
16
- }`),this.queryConfig.set("fetchLegacyConfig",e.gql`query($name: String!) {
17
- $queryAlias$: fetchLegacyConfig(name: $name){
18
- name
19
- resource
20
- }
21
- }`),this.queryConfig.set("fetchDefaultConfig",e.gql`query($name: String!) {
22
- $queryAlias$: fetchDefaultConfig(name: $name){
23
- name
24
- resource
25
- }
26
- }`)}loadFormConfig(e,t){return new Promise(((n,o)=>{Promise.all([this.loadResource(this.getPath(t,e)),this.loadResource(this.getPath(`FormCardState:${t}`,e,"form-card")),this.loadResource(this.getPath(t,e,"summary")),this.loadResource(this.getPath(t,e,"defaultValues"))]).then((([e,t,o,r])=>{let i;if(null!=e){i=Object.assign(Object.assign({},JSON.parse(e)),{emptyConfig:!1});const{tabs:t,fields:n}=i;if(t){const e=new Map(t.map((e=>[e.label,e])));null==n||n.forEach((t=>{var n;return t.tab=(null===(n=e.get(this.getTabName(t.tab)))||void 0===n?void 0:n.label)||e.get(this.getTabName(t.tab))}))}i.fields=null==n?void 0:n.map((e=>{if("readonly"in e){const t=!0===e.readonly;delete e.readonly,e.readOnly=t}return e}))}null!=t&&(null==i&&(i={emptyConfig:!0,fields:[]}),i.cardsState=new Map(JSON.parse(t))),null!=o&&(null==i&&(i={emptyConfig:!0,fields:[]}),i.summary=new Map(Object.entries(JSON.parse(o)))),null!=r&&(null==i&&(i={emptyConfig:!0,fields:[]}),i.defaultVars=new Map(Object.entries(JSON.parse(r)))),n(i)})).catch((e=>{o(e)}))}))}getTabName(e){return"object"==typeof e?e.label:e}saveCardState(e,t,n){const o=this.getPath(`FormCardState:${n}`,t,"form-card");return new Promise(((t,n)=>{this.saveResource(Array.from(e.entries()),o).then((e=>{t(new Map(JSON.parse(e.resource)))})).catch((e=>{n(e)}))}))}saveConfig(e,t,n){delete e.cardsState,delete e.defaultVars,delete e.summary;const o=this.getPath(n,t);return new Promise(((t,n)=>{this.saveResource(e,o).then((e=>{t(JSON.parse(e.resource))})).catch((e=>{n(e)}))}))}fetchUserAvailableConfigs(e,n){const o=this.getPath(n,e);return new Promise(((e,n)=>{t.get().callGraphQL({values:{name:o},query:this.queryConfig.get("fetchUserAvailableConfigs")}).then((t=>{e(t)})).catch((e=>{n(e)}))}))}fetchLegacyConfig(e,o){const r=this.getPath(o,e);return new Promise(((e,o)=>{t.get().callGraphQL({values:{name:r},query:this.queryConfig.get("fetchLegacyConfig")}).then((t=>{e(n.stringToObject((null==t?void 0:t.resource)||""))})).catch((e=>{o(e)}))}))}fetchDefaultConfig(e,o){const r=this.getPath(o,e);return new Promise(((e,o)=>{t.get().callGraphQL({values:{name:r},query:this.queryConfig.get("fetchDefaultConfig")}).then((t=>{(null==t?void 0:t.resource)||e(null),e(n.stringToObject(null==t?void 0:t.resource))})).catch((e=>{o(e)}))}))}getPath(e,t,n="form"){return t?`cfg://${n}/${e}/${t}`:`cfg://${n}/${e}`}async fetchLegacyConfigurableForm(e){const o={requestBody:{config:{chave:e,tipo:"T"}}},r=await t.get().callServiceBroker("SystemUtilsSP.getConf",JSON.stringify(o));if(!n.isEmpty(r))return this.buildLegacyConfigurableForm(r)}async fetchSimpleFormConfig(e){const n={requestBody:{formConfig:{configName:e}}},o=await t.get().callServiceBroker("FormConfig.getFormConfig",JSON.stringify(n));return this.processConfig(o)}async saveSimpleFormConfig(e,n){const o=this.buildSaveSimpleFormConfigPayload(e,n),r=await t.get().callServiceBroker("FormConfig.saveFormConfig",JSON.stringify(o));this.processConfig(r)}processConfig(e){return n.isEmpty(e)?[]:this.getResponseAsArray(e).map((e=>e.name))}getResponseAsArray(e){var t,n,o;const r=null!==(o=null===(n=null===(t=null==e?void 0:e.formConfig)||void 0===t?void 0:t.layout)||void 0===n?void 0:n.field)&&void 0!==o?o:[];return Array.isArray(r)?r:[r]}buildSaveSimpleFormConfigPayload(e,t){return{formConfig:{configName:e,layout:{field:t.map((e=>({name:e})))},metadata:{field:[]}}}}async restoreFormConfig(e){const n={requestBody:{formConfig:{configName:e}}};await t.get().callServiceBroker("FormConfig.restoreFormConfig",JSON.stringify(n))}buildLegacyConfigurableForm(e){var t,n,o;const r=null!==(o=null===(n=null===(t=null==e?void 0:e.formConfig)||void 0===t?void 0:t.layout)||void 0===n?void 0:n.field)&&void 0!==o?o:[];return{emptyConfig:!1,fields:Array.isArray(r)?r:[r]}}async fetchLayoutFormConfig(e){const o={requestBody:{config:{chave:e,tipo:"T"}}},r=await t.get().callServiceBroker("SystemUtilsSP.getConf",JSON.stringify(o));if(!n.isEmpty(r))return r.config}async saveLayoutFormConfig(e,o){const r={requestBody:{config:Object.assign(Object.assign({},o),{chave:e,tipo:"T"})}},i=await t.get().callServiceBroker("SystemUtilsSP.saveConf",JSON.stringify(r));if(!n.isEmpty(i))return i}}var i;!function(e){e.USER="USER",e.DEFAULT="DEFAULT",e.SHARED="SHARED"}(i||(i={}));export{r as F,o as R,i as U}
@@ -1 +0,0 @@
1
- import{DataType as r,NumberUtils as t,DateUtils as e,UserInterface as i}from"@sankhyalabs/core";import{F as a}from"./p-ff1990ad.js";import{F as n}from"./p-84345e7a.js";class l{static buildFilterExpression(r){var t;if(null==r)return;let e=null!==(t=this.buildVariableParameterValue(r))&&void 0!==t?t:void 0,i=r.expression||"",a="'";switch(r.paramVariable&&(a=""),r.operand){case"IN":i+=` ${n[r.operand]} (${e})`;break;case"NULL":case"NOT_NULL":i+=` IS ${n[r.operand]}`;break;case"LIKE":i+=` LIKE '%${e}%'`;break;case"START_WITH":i+=` LIKE '${e}%'`;break;case"FINISHED_WITH":i+=` LIKE '%${e}'`;break;default:r.operand&&(i+=` ${n[r.operand]}`),["string","number"].includes(typeof e)&&(e=isNaN(e)?`${a}${e}${a}`:e,i+=` ${e}`)}return i}static buildVariableParameterValue(e){var a;if(null!=e){if(e.paramVariable)return this.proccessVarialbeParameter(e);if(e.operand!==n.NULL&&"NOT_NULL"!==e.operand){let n=e.value;const l=e.type;return i.SEARCH!==e.userInterface&&e.userInterface!==i.OPTIONSELECTOR&&r.OBJECT!=l||(n=null!==(a=null==n?void 0:n.value)&&void 0!==a?a:n),r.NUMBER==l&&null!=n?(n=t.stringToNumber(n),this.checkIsValidNumber(n)):r.DATE==l?n=this.convertDataValue(n):r.BOOLEAN==l&&(n=n?"S":"N"),n}return e.operand}}static checkIsValidNumber(r){if(isNaN(r))throw new Error("O valor informado não é um número válido.")}static proccessVarialbeParameter(r){if(null!=r.systemConfig){const t=r.systemConfig;return`?:{entidade=${t.entity||""};campo=${t.fieldName||""}}`}if(null!=r.userConfig){const t=r.userConfig;return`?:{desc=${t.description||""};tipo=${t.type||""}}`}return`?:{entidade=${r.entityName||""};campo=${r.fieldName||""}}`}static convertDataValue(r){return"string"==typeof r&&(r=new Date(r)),e.formatDate(r)}static buildGroupExpression(r){var t,e;if(!(null===(t=null==r?void 0:r.items)||void 0===t?void 0:t.length))return"";const i=r.items.map((r=>this.buildFilterExpression(r))).join(` ${r.operand} `);if((null===(e=null==r?void 0:r.childrenGroups)||void 0===e?void 0:e.length)>0){const t=r.childrenGroups.map((r=>this.buildGroupExpression(r))).join(` ${r.operand} `);return`(${i} ${r.operand} (${t}))`}return`(${i})`}static validateFields(r){const t=this.buildPlainExpressionItems(r);for(const r of t)if(!this.validateExpressionItem(r))return!1;return!0}static buildPlainExpressionItems(r){const{items:t=[],childrenGroups:e=[]}=r||{},i=r=>r.reduce(((r,t)=>{var e;return t.items&&(r=r.concat(t.items)),(null===(e=t.childrenGroups)||void 0===e?void 0:e.length)&&(r=r.concat(i(t.childrenGroups))),r}),[]);return t.concat(i(e))}static validateExpressionItem(r){return Object.entries({fieldName:r=>!!r,value:(r,t)=>!!t||null!=r,operand:r=>!!r}).every((t=>{const[e,i]=t,a=r.paramVariable||"SWITCH"===r.userInterface||["NULL","NOT_NULL"].includes(r.operand);return i(r[e],a)}))}static getNormalizedValue(t,e){return t.reduce(((t,e,i)=>(e.dataType!==r.BOOLEAN||null!=t&&null!=t[i]||((t=t&&!Array.isArray(t)?[t]:t||[])[i]=!1),t)),e)}static validateVariableValues(t,e){if(!t)return!0;let i=e||t.value,n=!0;if(t.type===a.PERSONALIZED){const e=(t.groupedItems||[]).filter((r=>r.visible)).filter((r=>{var t,e,i;return!!(null===(i=null===(e=null===(t=r.props)||void 0===t?void 0:t.personalizedFilter)||void 0===e?void 0:e.parameters)||void 0===i?void 0:i.length)})),a=e.flatMap((r=>{var t;return null===(t=r.props.personalizedFilter)||void 0===t?void 0:t.parameters})),l=e.flatMap((t=>t.props.personalizedFilter.parameters.flatMap(((e,i)=>t.value?(void 0!==t.value[i]||e.dataType!==r.BOOLEAN)&&t.value[i]:null))));i=this.getNormalizedValue(a,i),n=a.length===l.length&&l.every((r=>null!=r))}return n}static buildVariableParameters(r){const t=this.buildPlainExpressionItems(r),e=[];for(const r of t)r.paramVariable&&e.push({entityName:r.entityName,fieldName:r.fieldName});return e}}export{l as P}
@@ -1 +0,0 @@
1
- import{r as t,c as i,h as s,H as e,g as h}from"./p-d8d8169b.js";import{Action as n,StringUtils as a,ElementIDUtils as o,ApplicationContext as r,KeyboardManager as d}from"@sankhyalabs/core";import"./p-bb2f5f38.js";import"./p-53599b26.js";import{P as c,E as l}from"./p-0f3698af.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-5304753a.js";import"./p-ff1990ad.js";import"./p-9317942f.js";import{V as u}from"./p-9019a32f.js";import{A as m}from"./p-1c2971e4.js";import{S as f}from"./p-cad964b5.js";import{T as p}from"./p-b987e15d.js";import"./p-8d884fab.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";import"./p-55798617.js";const g=class{constructor(s){t(this,s),this.actionClick=i(this,"actionClick",7),this.configuratorSave=i(this,"configuratorSave",7),this.configuratorCancel=i(this,"configuratorCancel",7),this.formItemsReady=i(this,"formItemsReady",7),this.viewModeChanged=i(this,"viewModeChanged",7),this.numberingConfigChanged=i(this,"numberingConfigChanged",7),this._viewHistory=[],this._customEditors=new Map,this._customRenders=new Map,this.loadEntitySuggestions=async t=>{var i;const s=null!==(i=null==t?void 0:t.argument)&&void 0!==i?i:"",e=(null==t?void 0:t.mode)||"PREDICTIVE";if(!s||0===s.trim().length)return[];try{this._showMoreOnSearch=!1;const t=this._snkDataUnit.entityName;return"PREDICTIVE"===e?await this.handlePredictiveSearch(s,t):await this._application.executePreparedSearch(e,s,this.buildSearchOptions(t))}catch(t){return console.error("Erro ao carregar sugestões de entidades:",t),[]}},this.searchEntitySelect=async t=>{if(this._entityPKField&&t)try{const i=[{name:this._entityPKField,value:t.value}];await this.refreshDataUnitByPk(i)}catch(t){console.error("Erro ao selecionar entidade:",t)}},this.dataUnitInterceptor={interceptAction:t=>(t.type===n.DATA_SAVED&&(t=this.interceptDataSaved(t)),t)},this._dataUnit=void 0,this._dataState=void 0,this.attachmentRegisterKey=void 0,this._currentViewMode=u.GRID,this._canEdit=void 0,this._resourceID=void 0,this.customContainerId=`SNK-CRUD-CUSTOM-CONTAINER-${a.generateUUID()}`,this.numberingConfig=void 0,this._showMoreOnSearch=!1,this._entityPKField=void 0,this.enableLockManagerLoadingComp=!1,this.enableLockManagerTaskbarClick=!1,this.configName=void 0,this.filterBarTitle=void 0,this.selectionToastConfig=void 0,this.showActionButtons=!1,this.actionsList=void 0,this.taskbarManager=void 0,this.recordsValidator=void 0,this.statusResolver=void 0,this.multipleSelection=!0,this.presentationMode=c.PRIMARY,this.messagesBuilder=void 0,this.useEnterLikeTab=!1,this.gridLegacyConfigName=void 0,this.filterBarLegacyConfigName=void 0,this.formLegacyConfigName=void 0,this.disablePersonalizedFilter=void 0,this.autoLoad=void 0,this.autoFocus=!0,this.enableGridInsert=!1,this.domainMessagesBuilder=void 0,this.ignoreReadOnlyFormFields=void 0,this.setCustomFormTitle=void 0,this.strategyExporter=l.SERVER_SIDE,this.layoutFormConfig=!0,this.multipleEditionEnabled=!0,this.paginationCounterMode="auto",this.showEntitySearch=!0,this.disableNumberingConfig=!1}async goToView(t){this.executeAction(t)}async openConfigurator(){var t;null===(t=this._snkConfigurator)||void 0===t||t.open()}async closeConfigurator(){var t;null===(t=this._snkConfigurator)||void 0===t||t.close()}async reloadFilterBar(){var t;null===(t=this._snkGrid)||void 0===t||t.reloadFilterBar()}async getFilterBar(){return await this._snkGrid.getFilterBar()}async addCustomEditor(t,i){if(this._guidesViewer&&this._snkGrid)return this._guidesViewer.addCustomEditor(t,i),void this._snkGrid.addCustomEditor(t,i);const s=new Map(this._customEditors);s.set(t,i),this._customEditors=s}async addGridCustomRender(t,i){if(this._snkGrid)return void this._snkGrid.addGridCustomRender(t,i);const s=new Map(this._customRenders);s.set(t,i),this._customRenders=s}async addCustomValueFormatter(t,i){this._snkGrid.addCustomValueFormatter(t,i)}async removeCustomValueFormatter(t){this._snkGrid.removeCustomValueFormatter(t)}async setFieldProp(t,i,s){await this._guidesViewer.setFieldProp(t,i,s)}async getNumberingConfig(){return this.numberingConfig}async updateNumberingConfig(t){this.numberingConfig=t,this.applyNumberingConfigToFields()}currentViewModeWatcher(t){this._viewHistory=[...this._viewHistory.slice(-1),t]}async gridToForm(t=!1){this._backToGrid=!t&&await this._viewStack.getSelectedIndex()===u.GRID,this.setViewMode(u.FORM)}async executeAction(t){switch(t){case p.GRID_MODE:return this.setViewMode(u.GRID);case p.FORM_MODE:case p.UPDATE:return this.gridToForm(t!==p.UPDATE);case p.UPDATE_MULTIPLE:return this._dataUnit.isMultipleEdition=!0,this.setViewMode(u.FORM);case p.CONFIGURATOR:return this._snkConfigurator.open();case p.ATTACH:return this.setViewMode(u.ATTACHMENT)}}backView(){const t=this._viewHistory.at(-2)||u.GRID;this.setViewMode(t)}setViewMode(t){this._viewStack.show(t),this._currentViewMode=t,t===u.GRID?(this._dataUnit.isMultipleEdition=!1,this._snkGrid.setFocus()):t===u.FORM&&this._guidesViewer.setFocus(),this.viewModeChanged.emit(t)}openConfig(t){this._snkConfigurator.close(),t===u.GRID?this._snkGrid.showConfig():t===u.FORM&&this._guidesViewer.showFormConfig()}addDataElementID(){o.addIDInfo(this._element,null,{dataUnit:this._dataUnit})}insertionModeHandler(){this.enableGridInsert||this.gridToForm()}cancelHandler(){this._backToGrid&&this.setViewMode(u.GRID)}async getAttachmentRegisterKey(){if(this._snkDataUnit)return(await this._snkDataUnit.getSelectedRecordsIDsInfo()).map((({value:t})=>t)).join("_")}setCustomRenders(){if(this._snkGrid)for(const[t,i]of this._customRenders)this._snkGrid.addGridCustomRender(t,i),this._customRenders.delete(t)}setCustomEditors(){if(this._snkGrid&&this._guidesViewer)for(const[t,i]of this._customEditors)this._guidesViewer.addCustomEditor(t,i),this._snkGrid.addCustomEditor(t,i),this._customEditors.delete(t)}componentDidRender(){this.setCustomRenders(),this.setCustomEditors()}componentWillLoad(){this._application=r.getContextValue("__SNK__APPLICATION__");let t=this._element.parentElement;for(this._application.hasAccess(m.UPDATE,this._resourceID).then((t=>this._canEdit=t));t;){if("SNK-DATA-UNIT"===t.tagName.toUpperCase()){this._snkDataUnit=t,this._snkDataUnit.addEventListener("insertionMode",(()=>this.insertionModeHandler())),this._snkDataUnit.addEventListener("cancelEdition",(()=>this.cancelHandler())),this._snkDataUnit.domainMessagesBuilder=this.domainMessagesBuilder,this._dataUnit=this._snkDataUnit.dataUnit,this._dataState=this._snkDataUnit.dataState,this._dataUnit?this.initDataUnit():this._snkDataUnit.addEventListener("dataUnitReady",(t=>{this._dataUnit=t.detail,this.initDataUnit()})),this._snkDataUnit.addEventListener("dataStateChange",this.handleDataStateChange.bind(this));break}t=t.parentElement}this.configName||(this.configName=this._application.configName)}componentDidLoad(){this.initKeyboardManager()}disconnectedCallback(){var t;this.removeShortcuts(),null===(t=this._dataUnit)||void 0===t||t.removeInterceptor(this.dataUnitInterceptor)}async handleDataStateChange(t){var i;this._dataState=t.detail,void 0!==this._dataState.selectedRecord&&(this.attachmentRegisterKey=await this.getAttachmentRegisterKey());const s=await this._snkDataUnit.getFieldsWithRmPrecision();for(const t of s||[]){if(!t)continue;const s=null===(i=this._dataState.rowMetadata)||void 0===i?void 0:i.getProp("rm_precision",t);(s||0===s)&&(await this.setFieldProp(t,"precision",s),await this.setFieldProp(t,"prettyPrecision",s))}}async initKeyboardManager(){this._keyboardManager=new d({propagate:!1,element:this._element});const t=this._dataUnit||await this._snkDataUnit.getDataUnit();async function i(){const i=document.activeElement,s=i==document.body;s||i.blur(),await t.saveData(),s||null==i.setFocus?s||i.focus():i.setFocus()}this._keyboardManager&&this._keyboardManager.bind("F6",this.toggleView.bind(this),{description:this.getMessage("snkCrud.shortcuts.toggleView"),element:this._element}).bind("F7",i.bind(this),{description:this.getMessage("snkCrud.shortcuts.saveData"),element:this._element}).bind("ctrl + \\",i.bind(this),{description:this.getMessage("snkCrud.shortcuts.addRecord"),element:this._element}).bind("F8",async function(){t.hasNewRecord()||t.addRecord()}.bind(this),{description:this.getMessage("snkCrud.shortcuts.addRecord"),element:this._element}).bind("F9",t.removeSelectedRecords.bind(t),{description:this.getMessage("snkCrud.shortcuts.removeRecord"),element:this._element}).bind("ctrl + F9",t.removeSelectedRecords.bind(t),{description:this.getMessage("snkCrud.shortcuts.removeRecord"),element:this._element}).bind("F5",(async()=>{const i=await this._viewStack.getSelectedIndex();u.GRID===i&&t.loadData()}),{description:this.getMessage("snkCrud.shortcuts.refreshData"),element:this._element}).bind("Escape",(()=>{t.isDirty()&&t.cancelEdition()}),{debounceTime:1e3,description:this.getMessage("snkCrud.shortcuts.cancelAction"),element:this._element})}getMessage(t,i){if(this.messagesBuilder)return this.messagesBuilder.getMessage(t,i)}async removeShortcuts(){var t;null===(t=this._keyboardManager)||void 0===t||t.unbindAllShortcutKeys()}async handlePredictiveSearch(t,i){var s,e;const h=await this._application.executePreparedSearchWithFullResponse(t,this.buildSearchOptions(i,5));return this._showMoreOnSearch=null!==(s=null==h?void 0:h.hasMore)&&void 0!==s&&s,this._entityPKField=null==h?void 0:h.pkField,null!==(e=null==h?void 0:h.data)&&void 0!==e?e:[]}async refreshDataUnitByPk(t){try{const i={term:"",filter:{name:"",params:[],expression:`(${t[0].name} = ${t[0].value})`}};await this._dataUnit.loadData(i),1===this._dataUnit.records.length&&(this._dataUnit.selectFirst(),this.gridToForm(!0))}catch(t){console.error("Erro ao atualizar dataset:",t)}}buildSearchOptions(t,i){return{entity:t,entityDescription:t,executeOnOpen:!0,searchOptions:{localEntityName:t,limit:i}}}async toggleView(){const t=await this._viewStack.getSelectedIndex();this.setViewMode(u.GRID===t?u.FORM:u.GRID)}getLastRecordSaved(t){var i;return(null===(i=t.payload)||void 0===i?void 0:i.records.length)?t.payload.records[t.payload.records.length-1]:null}async saveNumberingConfig(){const t={entityName:this._snkDataUnit.entityName,isAutoNum:this.numberingConfig.isAutoNumbering,numInicial:this.numberingConfig.initialNumber};await this._servicesNumberingConfig.saveConfig(t)}updateNumberingConfigAfterInsert(t){var i,s;if(!(null===(i=t.payload)||void 0===i?void 0:i.changes.length)||this.disableNumberingConfig||!(null===(s=this.numberingConfig)||void 0===s?void 0:s.isAutoNumbering)||!this._fieldAutoNum)return t;if(!t.payload.changes.some((t=>"INSERT"===t.operation||"COPY"===t.operation)))return t;const e=this.getLastRecordSaved(t);if(e&&e.hasOwnProperty(this._fieldAutoNum)){const t=Number(e[this._fieldAutoNum]);this.numberingConfig.initialNumber=t,this.saveNumberingConfig()}else this.numberingConfig.initialNumber=this.numberingConfig.initialNumber+1;return this.numberingConfigChanged.emit(this.numberingConfig),t}interceptDataSaved(t){return this.updateNumberingConfigAfterInsert(t),t}onDataUnitReady(){var t;null===(t=this._dataUnit)||void 0===t||t.addInterceptor(this.dataUnitInterceptor),this.loadNumberingConfig()}async initDataUnit(){this.addDataElementID(),this.messagesBuilder||(this.messagesBuilder=this._snkDataUnit.messagesBuilder),null==this._resourceID&&(this._resourceID=this._snkDataUnit.resourceID,null==this._resourceID&&(this._resourceID=await this._application.getResourceID())),this.onDataUnitReady()}async loadNumberingConfig(){if(!this.numberingConfig&&this._snkDataUnit&&this._snkDataUnit.entityName&&!this.disableNumberingConfig){this._servicesNumberingConfig||(this._servicesNumberingConfig=new f(this._application,this._resourceID));try{this.numberingConfig=await this._servicesNumberingConfig.getConfig(this._snkDataUnit.entityName),this.getFieldAutoNum(),this.applyNumberingConfigToFields()}catch(t){console.error("Error loading numbering config in snk-crud:",t),this.numberingConfig={isAutoNumbering:!1,initialNumber:null}}}}getFieldAutoNum(){if(this._fieldAutoNum)return;const t=this._dataUnit.metadata.fields.find((t=>{var i;return"true"===(null===(i=t.properties)||void 0===i?void 0:i.isAutoNumField)}));this._fieldAutoNum=(null==t?void 0:t.name)||null}async applyNumberingConfigToFields(){if(!this.numberingConfig||!this._snkDataUnit||!this._fieldAutoNum)return;const t=this._dataUnit.getField(this._fieldAutoNum);t.readOnly=this.numberingConfig.isAutoNumbering,t.required=!this.numberingConfig.isAutoNumbering}handleConfiguratorEvent(t,i){if(t.stopImmediatePropagation(),"SAVE"===i)return this._guidesViewer.reloadGuides(),void this.configuratorSave.emit();this.configuratorCancel.emit()}renderDynamicSearch(t){var i;if(this.showEntitySearch&&!0!==(null===(i=this._dataState)||void 0===i?void 0:i.insertionMode))return s("div",{slot:t,class:"entity-search-container",style:{position:"relative",display:"inline-block",marginLeft:"10px",minWidth:"200px"}},s("ez-search",{label:"Buscar registros",optionLoader:this.loadEntitySuggestions,onEzChange:t=>this.searchEntitySelect(t.detail),mode:"slim",showMore:this._showMoreOnSearch,suppressEmptyOption:!0,suppressInputPersist:!0}))}render(){if(null!=this._resourceID)return this._snkDataUnit.ignoreSaveMessage=this._currentViewMode===u.GRID&&!this.enableGridInsert,s(e,null,s("ez-view-stack",{ref:t=>this._viewStack=t,"data-element-id":"crud"},s("stack-item",{class:"ez-flex ez-flex--column ez-size-height--full ez-size-width--full ez-padding--medium"},s("snk-grid",{ref:t=>this._snkGrid=t,class:"ez-flex ez-flex--column ez-size-height--full ez-size-width--full",filterBarTitle:this.filterBarTitle,"data-element-id":"crud_grid",configName:this.configName,onGridDoubleClick:()=>this.gridToForm(!0),taskbarManager:this.taskbarManager,onActionClick:t=>this.executeAction(t.detail),messagesBuilder:this.messagesBuilder,actionsList:this.actionsList,statusResolver:this.statusResolver,multipleSelection:this.multipleSelection,presentationMode:this.presentationMode,recordsValidator:this.recordsValidator,selectionToastConfig:this.selectionToastConfig,useEnterLikeTab:this.useEnterLikeTab,canEdit:this._canEdit,resourceID:this._resourceID,disablePersonalizedFilter:this.disablePersonalizedFilter,gridLegacyConfigName:this.gridLegacyConfigName,filterBarLegacyConfigName:this.filterBarLegacyConfigName,autoLoad:this.autoLoad,autoFocus:this.autoFocus,enableGridInsert:this.enableGridInsert,enableLockManagerTaskbarClick:this.enableLockManagerTaskbarClick,enableLockManagerLoadingComp:this.enableLockManagerLoadingComp,strategyExporter:this.strategyExporter,multipleEditionEnabled:this.multipleEditionEnabled,paginationCounterMode:this.paginationCounterMode},s("slot",{name:"GRID_TASKBAR_CUSTOM_ELEMENTS"}),s("slot",{name:"GRID_HEADER_CUSTOM_ELEMENTS"}),s("slot",{name:"SnkGridHeader"}),s("slot",{name:"SnkGridFooter"}),s("slot",{name:"SnkGridTaskBar"}),this.renderDynamicSearch("GRID_HEADER_DYNAMIC_SEARCH"))),s("stack-item",null,s("snk-guides-viewer",{ref:t=>this._guidesViewer=t,entityPath:this._snkDataUnit.entityName,messagesBuilder:this.messagesBuilder,onExit:()=>this.setViewMode(u.GRID),dataState:this._dataState,dataUnit:this._dataUnit,actionsList:this.actionsList,taskbarManager:this.taskbarManager,configName:this.configName,onActionClick:t=>this.executeAction(t.detail),presentationMode:this.presentationMode,"data-element-id":"crud_form",canEdit:this._canEdit,recordsValidator:this.recordsValidator,resourceID:this._resourceID,detailTaskbarCustomContainerId:this.customContainerId,formLegacyConfigName:this.formLegacyConfigName,enableGridInsert:this.enableGridInsert,getCustomTitle:this.setCustomFormTitle,ignoreReadOnlyFormFields:this.ignoreReadOnlyFormFields},s("slot",{name:"GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS"}),this.renderDynamicSearch("GUIDES_VIEWER_DYNAMIC_SEARCH"),s("slot",{name:"SnkFormTaskBar"}))),s("stack-item",{tabIndex:"0"},s("snk-attach",{registerKey:this.attachmentRegisterKey,messagesBuilder:this.messagesBuilder,entityName:this._snkDataUnit.entityName,onBack:this.backView.bind(this)})),s("snk-configurator",{ref:t=>this._snkConfigurator=t,entityName:this._snkDataUnit.entityName,viewMode:this._currentViewMode,messagesBuilder:this.messagesBuilder,onConfigSelected:t=>this.setViewMode(t.detail),onOpenConfig:t=>this.openConfig(t.detail),showActionButtons:this.showActionButtons,onSave:t=>this.handleConfiguratorEvent(t,"SAVE"),onCancel:t=>this.handleConfiguratorEvent(t,"CANCEL"),resourceID:this._resourceID,customContainerId:this.customContainerId,layoutFormConfig:this.layoutFormConfig})),s("div",{id:`${this.customContainerId}`},s("slot",{name:"SnkConfigContainerSlot"}),s("slot",{name:"DETAIL_GRID_HEADER_CUSTOM_ELEMENTS"}),s("slot",{name:"DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS"}),s("slot",{name:"DETAIL_TASKBAR_CUSTOM_ELEMENTS"})))}get _element(){return h(this)}static get watchers(){return{_currentViewMode:["currentViewModeWatcher"]}}};g.style=".sc-snk-crud-h{display:flex;flex-direction:column;height:100%;width:100%}";export{g as snk_crud}
@@ -1 +0,0 @@
1
- import{r as i,c as e,h as t,g as s}from"./p-d8d8169b.js";import{S as o}from"./p-51833248.js";import{ObjectUtils as n,ArrayUtils as a}from"@sankhyalabs/core";import{ApplicationUtils as r}from"@sankhyalabs/ezui/dist/collection/utils";import{a as d}from"./p-9019a32f.js";const l=class{constructor(t){i(this,t),this.guideSelected=e(this,"guideSelected",7),this.guideListChanged=e(this,"guideListChanged",7),this.guideDeleted=e(this,"guideDeleted",7),this.createNewGuide=e(this,"createNewGuide",7),this.ID_VISIBLE_GUIDES="container-visible-guides",this.ID_HIDDEN_GUIDES="container-hidden-guides",this.sortLogic=(i,e)=>{var t,s;return(null!==(t=i.order)&&void 0!==t?t:Number.MAX_VALUE)-(null!==(s=e.order)&&void 0!==s?s:Number.MAX_VALUE)},this.mainGuide=void 0,this.filterTerm="",this.visibleGuides=[],this.hiddenGuides=[],this.guidesList=[],this.selectedGuide=void 0,this.messagesBuilder=void 0}onMessagesBuilderChange(){this.setCustomCSSProperties()}observeVisibleGuides(i){this.initGuidesConfig(i)}observeSelectedGuide(i){this.guideSelected.emit(i)}getMessage(i,e){return this.messagesBuilder.getMessage(i,e)}initGuidesConfig(i){const e=[...i.filter((i=>i.visible&&i.name!==d.main))],t=[...i.filter((i=>!i.visible&&i.name!==d.main))];this.visibleGuides=[...e.sort(this.sortLogic)],this.hiddenGuides=[...t.sort(this.sortLogic)],this.mainGuide=i.find((i=>i.name===d.main))}handleAddGuide(){this.createNewGuide.emit()}handleSelectGuide(i,e){e.stopPropagation(),this.selectedGuide=i}toggleGuideVisibility(i,e){e.stopPropagation();const t=Object.assign(Object.assign({},i),{visible:!i.visible});let s,o;i.visible?(s=[...this.visibleGuides.filter((e=>e.name!==i.name))],o=[...this.hiddenGuides,t]):(s=[...this.visibleGuides,t],o=[...this.hiddenGuides.filter((e=>e.name!==i.name))]);const n=[...s,...o];this.applyGuidesUpdate(n)}adjustListOrder(i){return i.map(((i,e)=>Object.assign(Object.assign({},i),{order:e})))}applyGuidesUpdate(i){let e=this.adjustListOrder(i);e=[this.mainGuide,...e],n.equals(e,this.guidesList)||this.guideListChanged.emit(e)}async handleDeleteGuide(i,e){e.stopPropagation();const t=this.getMessage("snkFormConfig.confirm.title"),s=this.getMessage("snkFormConfig.confirm.deleteGuide").replace("{0}",i.label);if(!await r.confirm(t,s))return;this.guideDeleted.emit(i);const o=this.getMessage("snkFormConfig.info.successfullyGuideDeleted").replace("{0}",i.label);r.info(o)}renderItems(i){return a.applyStringFilter(this.filterTerm,i).map((i=>{var e;return t("div",{key:i.name,"data-guide-name":i.name,title:i.label,class:`guide-item ${(null===(e=this.selectedGuide)||void 0===e?void 0:e.label)===i.label?"selected":""} ${this.filterTerm.length?"disable-sort":""}`,onClick:e=>this.handleSelectGuide(i,e)},t("span",null,t("ez-icon",{iconName:"drag-indicator",class:"ez-margin-right--small"})),t("span",{class:"item-label"},i.label),t("div",{class:"actions"},t("ez-button",{mode:"icon",class:"ez-button--tertiary",onClick:e=>this.toggleGuideVisibility(i,e),size:"medium",iconName:i.visible?"eye-off":"eye",title:this.getMessage(i.visible?"snkFormConfig.guidesConfigurator.actions.hide":"snkFormConfig.guidesConfigurator.actions.show")}),t("ez-button",{mode:"icon",class:"ez-button--tertiary",onClick:e=>this.handleDeleteGuide(i,e),size:"medium",iconName:"delete",title:this.getMessage("snkFormConfig.guidesConfigurator.actions.delete")})))}))}getContainerElement(i){return this.el.querySelector(`[id="${i}"]`)}handleSortGuide(){const i=[...this.getGuidesFromStatus(!0),...this.getGuidesFromStatus(!1)];this.applyGuidesUpdate(i)}getGuidesFromStatus(i){let e=[];return this.getOrderedGuideNames(i?this.ID_VISIBLE_GUIDES:this.ID_HIDDEN_GUIDES).forEach((t=>{const s=this.guidesList.find((i=>i.name===t));s&&e.push(Object.assign(Object.assign({},s),{visible:i}))})),e}getOrderedGuideNames(i){var e;const t=null===(e=this.getContainerElement(i))||void 0===e?void 0:e.children;return Array.from(t).map((i=>i.getAttribute("data-guide-name")))}initializeDraggableContainers(){this._sortableVisibleGuides=new o(this.getContainerElement(this.ID_VISIBLE_GUIDES),{group:"guides",ghostClass:"ghost",direction:"vertical",filter:".disable-sort",animation:15,onSort:()=>this.handleSortGuide()}),this._sortableInvisibleGuides=new o(this.getContainerElement(this.ID_HIDDEN_GUIDES),{group:"guides",ghostClass:"ghost",animation:15,filter:".disable-sort",onSort:()=>this.handleSortGuide()})}handleSelectMainGuide(){this.guideSelected.emit(this.mainGuide)}setCustomCSSProperties(){document.documentElement.style.setProperty("--no-hidden-guides-message",`"${this.getMessage("snkFormConfig.guidesConfigurator.noHiddenGuides")}"`),document.documentElement.style.setProperty("--no-visible-guides-message",`"${this.getMessage("snkFormConfig.guidesConfigurator.noVisibleGuides")}"`)}componentDidLoad(){this.initializeDraggableContainers(),this.initGuidesConfig(this.guidesList),this.setCustomCSSProperties()}render(){var i,e,s;return t("ez-sidebar-navigator",{class:"ezSidebarNavigator",type:"fixed",size:"md",titleMenu:this.getMessage("snkFormConfig.guidesConfigurator.title")},t("div",{class:"navigator-container"},t("ez-filter-input",{slot:"content",mode:"slim",label:this.getMessage("snkFormConfig.guidesConfigurator.searchGuide"),onEzChange:i=>this.filterTerm=i.detail}),t("div",{onClick:this.handleSelectMainGuide.bind(this),class:"main-guide "+((null===(i=this.selectedGuide)||void 0===i?void 0:i.name)===(null===(e=this.mainGuide)||void 0===e?void 0:e.name)?"selected":"")},t("span",null,null===(s=this.mainGuide)||void 0===s?void 0:s.label)),t("div",{class:"collapsible-container"},t("div",{class:"collapsible-item"},t("ez-collapsible-box",{label:this.getMessage("snkFormConfig.guidesConfigurator.visibleGuides"),headerSize:"large"},t("div",{id:this.ID_VISIBLE_GUIDES,class:"guide-list "+(this.visibleGuides.length?"":"visible-empty-content")},this.renderItems(this.visibleGuides)))),t("div",{class:"collapsible-item"},t("ez-collapsible-box",{label:this.getMessage("snkFormConfig.guidesConfigurator.hiddenGuides"),headerSize:"large"},t("div",{id:this.ID_HIDDEN_GUIDES,class:"guide-list "+(this.hiddenGuides.length?"":"hidden-empty-content")},this.renderItems(this.hiddenGuides))))),t("div",{class:"add-button-container",onClick:this.handleAddGuide.bind(this)},t("ez-icon",{slot:"leftIcon",iconName:"plus"}),t("span",null,this.getMessage("snkFormConfig.guidesConfigurator.createNewGuide")))))}get el(){return s(this)}static get watchers(){return{messagesBuilder:["onMessagesBuilderChange"],guidesList:["observeVisibleGuides"],selectedGuide:["observeSelectedGuide"]}}};l.style='.ezSidebarNavigator.sc-guides-configurator{--ez-sidebar-navigator--height:calc(100vh - 118px)}.navigator-container.sc-guides-configurator{height:calc(100vh - 175px);display:flex;flex-direction:column;justify-content:space-between}.collapsible-container.sc-guides-configurator{display:flex;flex-direction:column;gap:12px;flex-grow:1;max-height:calc(100vh - 240px);overflow:auto}.collapsible-item.sc-guides-configurator{padding:6px;border-radius:6px;border:1px solid #dce0e8}.add-button-container.sc-guides-configurator{display:flex;align-items:center;border-top:1px solid #dce0e8;padding-top:22px;gap:6px;cursor:pointer;justify-content:center}.add-button-container.sc-guides-configurator span.sc-guides-configurator{display:block}.guide-list.sc-guides-configurator{display:flex;flex-direction:column;width:100%;min-height:10px}.guide-list.hidden-empty-content.sc-guides-configurator::before{content:var(--no-hidden-guides-message, "Nenhuma guia oculta");display:block;font-size:16px;font-weight:400;color:#AFB6C0;margin:auto;padding:8px}.guide-list.visible-empty-content.sc-guides-configurator::before{content:var(--no-visible-guides-message, "Nenhuma guia visível");display:block;font-size:16px;font-weight:400;color:#AFB6C0;margin:auto;padding:8px}.item-label.sc-guides-configurator{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex-grow:1}.guide-item.sc-guides-configurator{margin:0 3px;display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:5px 10px;border-radius:6px;transition:all 0.2s ease-in-out;height:32px}.guide-item.sc-guides-configurator .actions.sc-guides-configurator{display:flex;gap:8px;transition:0.2s ease-in-out;visibility:hidden;opacity:0}.guide-item.sc-guides-configurator:hover .actions.sc-guides-configurator{visibility:visible;opacity:1}ez-button.sc-guides-configurator{width:24px;align-items:center;justify-content:center;display:flex}.ghost.sc-guides-configurator{opacity:.5;background:#e2eaf4}.main-guide.sc-guides-configurator{padding:12px;margin:12px 0;border:1px solid #dce0e8;border-radius:6px;transition:all 0.2s ease-in-out}.guide-item.selected.sc-guides-configurator,.main-guide.selected.sc-guides-configurator{background:#E2F4EF}.guide-item.sc-guides-configurator:hover,.main-guide.sc-guides-configurator:hover{background:#f5fcfa}';export{l as guides_configurator}
@@ -1 +0,0 @@
1
- import{C as t}from"./p-78ff8734.js";import{ObjectUtils as i,StringUtils as e}from"@sankhyalabs/core";import{F as s}from"./p-9317942f.js";import{a as r}from"./p-9019a32f.js";class n{constructor(t,i,e,s){this._resourceID=i,this._configName=t,this._onConfigChange=e,this._dataUnit=s}addFormLegacyConfig(i){this._configName&&t.addFormLegacyConfig(this._configName,i)}async loadConfig(){return new Promise((i=>{t.loadFormConfig(this._configName,this._resourceID).then((t=>{t=this.buildFormMetadataUITabs(t),this.setConfig(t),i(t)})).catch((t=>{console.warn(t)}))}))}getEmptyConfig(){return this.buildFormMetadataUITabs({fields:[],emptyConfig:!0},!0)}saveConfig(e){const s=i.copy(e);return new Promise((i=>{t.saveFormConfig(e,this._configName,this._resourceID).then((t=>{this.setConfig(Object.assign(Object.assign({},s),t)),i(Object.assign(Object.assign({},s),t))}))}))}saveCardState(i,e,s){return new Promise((r=>{var n;const l=(null===(n=this._config)||void 0===n?void 0:n.cardsState)||new Map,o=l.get(i);l.set(i,"fixed"===s?this.updateFixSequence(Object.assign(Object.assign({},o),{fixed:e.fixed}),l):Object.assign(Object.assign({},o),{[s]:e[s]})),t.saveCardState(l,this._configName,this._resourceID).then((t=>{this._config=Object.assign(Object.assign({},this._config),{cardsState:l}),r(t)}))}))}updateFixSequence(t,i){let e=-1;return Array.from(i.values()).forEach((i=>{i.fixed||delete t.fixSequence,null!=i.fixSequence&&(e=Math.max(e,i.fixSequence))})),t.fixed?t.fixSequence=e+1:delete t.fixSequence,t}hasConfig(t){var i;const e=null!=t?t:this._config;return!(!e||!(null===(i=e.fields)||void 0===i?void 0:i.length))}getFieldsList(t,i=!1){var e;const s=null===(e=this._config)||void 0===e?void 0:e.fields;return this.hasConfig()&&!i?s.map((({label:t,name:i,readOnly:e,visible:s,required:r,tab:n,group:l})=>{var o;if(null==t){const t=null===(o=this._dataUnit)||void 0===o?void 0:o.getField(i);if(!t)return;return Object.assign(Object.assign({},t),{name:null!=i?i:t.name,readOnly:null!=e?e:t.readOnly,visible:null!=s?s:t.visible,required:null!=r?r:t.required,tab:n,group:l})}return{name:i,label:t,readOnly:e,visible:s,required:r,tab:n,group:l}})).filter((i=>this.isFieldVisible(i,t))):this._dataUnit?this._dataUnit.metadata.fields.filter((i=>this.isFieldVisible(i,t))).map((({label:t,name:i,readOnly:e,visible:s,required:r,properties:n})=>({label:t,name:i,readOnly:e,visible:s,required:r,tab:null==n?void 0:n.UITabName}))):[]}isFieldVisible(t,i){if(void 0===t||!1===t.visible)return!1;if(null==i)return!0;const s=e.replaceAccentuatedCharsLower((t.label||t.name).toLocaleLowerCase()),r=e.replaceAccentuatedCharsLower(i.toLocaleLowerCase());return s.includes(r)}getFormConfig(t,i,e=!1){let s=this.getFieldsList(void 0,e);return i&&(s=s.filter((i=>{if(t){const e=t.getField(i.name);if(e&&e.readOnly)return!1}return!i.readOnly}))),Object.assign(Object.assign({},this._config),{fields:s})}setConfig(t){this.isLoaded=!0;const{cardsState:i,summary:e,defaultVars:s}=this._config||{};this._config=Object.assign({},t),i&&(this._config.cardsState=i),e&&(this._config.summary=e),s&&(this._config.defaultVars=s),this._onConfigChange&&this._onConfigChange(Object.assign({},this._config))}getConfig(t,i){return this.getFormConfig(t,i)}getFormConfigFetcher(){return null==this._formConfigFetcher&&(this._formConfigFetcher=new s),this._formConfigFetcher}async fetchUserAvailableConfigs(){return null!=this._configName?Promise.resolve(void 0):this.getFormConfigFetcher().fetchUserAvailableConfigs(this._configName,this._resourceID)}async fetchLegacyConfig(){return this.getFormConfigFetcher().fetchLegacyConfig(this._configName,this._resourceID)}async fetchDefaultConfig(){return this.getFormConfigFetcher().fetchDefaultConfig(this._configName,this._resourceID)}parseObjectList(t){return t?Array.isArray(t)?t:[t]:[]}buildFormMetadataUITabs(t,i=!1){var e;const s=this.hasConfig(t);if(!i&&(!this._dataUnit||s))return t;(t=this.getFormConfig(this._dataUnit,!1,!0)).tabs=this.parseObjectList(t.tabs),t.emptyConfig=!1,t.defaultConfiguration=!0;const n=this._dataUnit.metadata.fields;for(const i of n){const s=t.fields.find((t=>t.name===i.name)),n=null===(e=i.properties)||void 0===e?void 0:e.UITabName;n&&n!==r.main&&(t.tabs.some((t=>t.label===n))||t.tabs.push({label:n,name:n,order:0,visible:!0}),s&&(s.tab=n))}return t}}export{n as S}
@@ -1,11 +0,0 @@
1
- import{r as t,c as e,h as i,H as s,g as n}from"./p-d8d8169b.js";import{DateUtils as r,StringUtils as a,ObjectUtils as o,WaitingChangeException as h,SilentException as l,WarningException as c,ErrorException as d,ElementIDUtils as u,SearchUtils as p,ArrayUtils as m,KeyboardManager as g,OnboardingUtils as w,DependencyType as y,DataType as v,ApplicationContext as f,ErrorTracking as P,UserAgentUtils as k,LockManager as z,LockManagerOperation as _}from"@sankhyalabs/core";import{ApplicationUtils as x}from"@sankhyalabs/ezui/dist/collection/utils";import{C as A}from"./p-78ff8734.js";import{d as S,D as b,U as I,S as T}from"./p-bb2f5f38.js";import{A as O,a as L}from"./p-1c2971e4.js";import{P as N,D as C}from"./p-5304753a.js";import{P as E}from"./p-53599b26.js";import{T as D}from"./p-9019a32f.js";import"./p-0f3698af.js";import"./p-ff1990ad.js";import{F as R}from"./p-9317942f.js";import"./p-8d884fab.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";class F{static webConnectionCaller(t,e,i){var s;null===(s=window.AppletCaller)||void 0===s||s.webConnectionCaller(t,e,i)}}const M=U;function U(t,e){const i=j();return(U=function(t){return i[t-=378]})(t,e)}function j(){const t=["true","863GKWjmo","parse","56355fjjjAm","isSup","putAccess","4324480sjuCdS","hasOwnProperty","239748okvJLB","name","6055770tXeRaU","actions","forEach","7RPRvzn","1042CHxkUw","2988126NIwRMm","20MTNzmH","authorizationSf","item","string","hasAccess","isArray","Objeto não pode ser indefinido.","3071943fWslZp","parseFromJSON"];return(j=function(){return t})()}!function(){const t=U,e=j();for(;;)try{if(281287==parseInt(t(399))/1*(-parseInt(t(387))/2)+-parseInt(t(401))/3+parseInt(t(381))/4*(-parseInt(t(389))/5)+parseInt(t(388))/6*(-parseInt(t(386))/7)+parseInt(t(379))/8+parseInt(t(396))/9+parseInt(t(383))/10)break;e.push(e.shift())}catch(t){e.push(e.shift())}}();class ${[M(397)](t){const e=M;if(typeof(t=utxt(t[e(390)]))==e(392)&&(t=JSON[e(400)](t)),null==t)throw Error(e(395));const i=new H("S"===t[e(402)]||!0===t[e(402)]);return Array[e(394)](t[e(391)])&&t[e(391)][e(385)]((t=>i.putAccess(t[e(382)],String(t.status)==e(398)))),i}}class H{constructor(t){const e=M;this.isSup=t,this[e(384)]={}}[M(378)](t,e){this[M(384)][t]=e}[M(393)](t){const e=M;if(this[e(402)])return!0;let i=!0;return this[e(384)][e(380)](t)&&(i=this.actions[t]),i}isUserSup(){return this.isSup}}class B{constructor(){this._embeddedParams=new Map,this._cachedParams=new Map,this.templateByQuery=new Map;try{if(null!=window.MGE_PARAMS){atob(window.MGE_PARAMS).split("__;__").forEach((t=>{const[e,i]=t.split("__=__");this._embeddedParams.set(e,i)}))}}catch(t){console.error("Problemas ao obter parâmetros embarcados"),console.error(t)}this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchParam",S.gql`query($name: String!) {
2
- $queryAlias$: fetchResource(name: $name){
3
- name
4
- resource
5
- }
6
- }`)}async getParam(t){if(this._embeddedParams.has(t))return Promise.resolve(this._embeddedParams.get(t));if(this._cachedParams.has(t))return this._cachedParams.get(t);const e=`param://application?params=${t}`,i=await b.get().callGraphQL({values:{name:e},query:this.templateByQuery.get("fetchParam")});return this._cachedParams.set(t,i),i}async asString(t){const e=await this.getParam(t);return this.getValue(e)}async asInteger(t){const e=await this.getParam(t);return parseInt(this.getValue(e))}async asFloat(t){const e=await this.getParam(t);return parseFloat(this.getValue(e))}async asBoolean(t){const e=await this.getParam(t);return"S"===this.getValue(e)}async asDate(t){const e=await this.getParam(t);return r.strToDate(this.getValue(e))}async getBatchParams(t){const e=await this.getParam(t.join(",")),i={};return e.forEach((t=>i[t.name]=t.resource)),i}getValue(t={}){if(Array.isArray(t)&&t.length>0&&(t=t[0]),"string"==typeof t)return t;if(a.isEmpty(t.resource))return"";try{const e=o.stringToObject(t.resource),[i]=Object.keys(e);return e[i]}catch(t){console.warn("Erro ao converter string JSON.")}}}class q{constructor(){this.templateByQuery=new Map,this.cancel=[],this.buildTemplates()}buildTemplates(){this.templateByQuery.set("fetchTotals",S.gql`query($filters: [InputFilter!] $name: String!) {
7
- $queryAlias$: fetchTotals(name: $name, filters: $filters ){
8
- name
9
- value
10
- }
11
- }`)}fetchTotals(t,e,i=[]){const s=`${t}_${e}`,n=this.cancel.findIndex((t=>t[s]));return n>=0&&(this.cancel[n][s](),this.cancel.splice(n,1)),Promise.race([new Promise((t=>this.cancel.push({[s]:t}))),this.getTotals(t,e,i)]).then((t=>{let e=new Map;if(t){e=t;const i=this.cancel.findIndex((t=>t[s]));i>=0&&this.cancel.splice(i,1)}return e}))}getTotals(t,e,i=[]){return new Promise(((s,n)=>{b.get().callGraphQL({query:this.templateByQuery.get("fetchTotals"),values:{name:`totals://${t}/${e}`,filters:i}}).then((t=>{if(t.length>0){const e=new Map;return t.forEach((t=>e.set(t.name,parseFloat(t.value)))),s(e)}return n("Não foi possível recuperar os totalizadores")})).catch(n)}))}}var K;class V{static openAppActivity(t,e){var i;null===(i=window.workspace)||void 0===i||i.openAppActivity(t,e)}static getAppLabel(t){if(null!=(null===window||void 0===window?void 0:window.workspace))return null==window.workspace.getAppLabel&&(window.workspace.getAppLabel=t=>(t||"").split(".").pop()),window.workspace.getAppLabel(t)}static setScreenToUseV3Layout(){var t;null===(t=window.workspace)||void 0===t||t.setScreenToUseV3Layout()}static setScreenToUseOldLayout(){var t;null===(t=window.workspace)||void 0===t||t.setScreenToUseOldLayout()}static showDesktop(){var t,e;null===(e=null===(t=window.workspace)||void 0===t?void 0:t.showDesktop)||void 0===e||e.call(t)}static searchApp(){var t,e;null===(e=null===(t=window.workspace)||void 0===t?void 0:t.searchApp)||void 0===e||e.call(t)}static openHelp(){var t,e;null===(e=null===(t=window.workspace)||void 0===t?void 0:t.openHelp)||void 0===e||e.call(t)}static applicationClick(){var t,e;(null===(t=window.workspace)||void 0===t?void 0:t.applicationClick)&&(null===(e=window.workspace)||void 0===e||e.applicationClick())}}V.resourceID=null===(K=window.workspace)||void 0===K?void 0:K.resourceID;class W{constructor(t){this._app=t,window.addEventListener("error",(t=>this.errorHandler(t))),window.addEventListener("unhandledrejection",(t=>this.rejectionHandler(t)))}getMessage(t,e){return this._app.messagesBuilder.getMessage(t,e)}rejectionHandler(t){const e=t.reason;e instanceof h||(e?this.processException(e):this._app.isDebugMode().then((t=>{t&&this._app.error(this.getMessage("snkErrorHandler.title.promiseRejected"),this.getMessage("snkErrorHandler.message.undeterminedPromiseRejection"))})))}errorHandler(t){this.processException(t.error)}buildErrorCodeHTML(t){return`<br><a href="#" onclick="try{window.workspace.openHelp('_tbcode:${t}')} catch(e){alert('${this.getMessage("snkErrorHandler.message.cannotOpenHelp")}');}">${this.getMessage("snkErrorHandler.errorCode.label")}${t}</a>`}processException(t){t.errorCode&&(t.message+=this.buildErrorCodeHTML(t.errorCode)),t instanceof l?console.warn(this.getMessage("snkErrorHandler.message.silentExceptionIgnored"),t):t instanceof h||t instanceof c?this._app.alert(t.title,t.message):t instanceof d?this._app.error(t.title,t.message):this._app.isDebugMode().then((e=>{if(e)if(t instanceof Error)this._app.error(t.name,t.message);else{const e=(null==t?void 0:t.title)||this.getMessage("snkErrorHandler.title.errorDetected",void 0),i="string"==typeof t?t:t.message||`${this.getMessage("snkErrorHandler.error.internal")} "${o.objectToString(t)}"`;this._app.error(e,i)}}))}}class G{constructor(){this._debounceTime=1500,this.requests=new Map,this.requestsLoadingBar=[]}onRequestStart(t){if(t.url.includes("quietMode=true"))return;this.requestsLoadingBar.push(t.requestId);const e=setTimeout((()=>{this.ezLoadingBar.show()}),this._debounceTime);this.requests.set(t.requestId,e)}onRequestEnd(t){var e,i,s;const n=this.requests.get(t.requestId);clearTimeout(n),(null===(e=this.requestsLoadingBar)||void 0===e?void 0:e.includes(t.requestId))&&(this.requestsLoadingBar=null===(i=this.requestsLoadingBar)||void 0===i?void 0:i.filter((e=>e!==t.requestId)),!this.requestsLoadingBar.length&&(null===(s=this.ezLoadingBar)||void 0===s||s.hide()))}}class J{constructor(){this._debounceTime=1e3,this._ignoredNameTypes=["totals"],this._countRequest=0}onRequestStart(t){this.isIgnoreLoadingOnRequest(t)||(this._countRequest++,this.ezLoadingBar.show(),this._timerLoading&&clearTimeout(this._timerLoading))}onRequestEnd(t){this.isIgnoreLoadingOnRequest(t)||(this._countRequest--,this._timerLoading=setTimeout((()=>{this._countRequest<=0&&this.ezLoadingBar.hide()}),this._debounceTime))}isIgnoreLoadingOnRequest(t){if(null==t)return!1;if(t.url.includes("quietMode=true"))return!0;if(null==t.requestBody)return!1;if(1==t.requestBody.length){const{name:e}=t.requestBody[0].variables;if(e){const t=e.split(":");return this._ignoredNameTypes.indexOf(t[0])>=0}}return!1}}class Y{static create({strategy:t}){switch(t){case"request_name":return new J;case"request_time":return new G;default:throw new Error("Strategy not found")}}}const Z=async(t,e,i,s)=>{const{entity:n,entityDescription:r,criteria:a,searchOptions:o,isHierarchyEntity:h,allowsNonAnalytic:l,executeOnOpen:c}=e;return new Promise(((e,d)=>{const p=document.createElement("snk-pesquisa");p[u.DATA_ELEMENT_ID_ATTRIBUTE_NAME]=`entity_${n}`,p.entityName=n,p.argument=t,p.searchLoader=t=>s.loadAdvancedSearch(n,t,a,o),p.isHierarchyEntity=h,h&&(p.treeLoader=t=>s.loadTree(n,t,a,o),p.allowsNonAnalytic=l),p.selectItem=t=>{e(t),i.clearPopUpTitle(),i.closePopUp()},i.setPopUpTitle(r),i.showPopUp(p,void 0,void 0,d),c&&p.executeSearch(t)}))},X=["<img","<svg"];class Q{constructor(){this._config=null,this.listeners=[]}static getInstance(){return Q.instance||(Q.instance=new Q),Q.instance}get config(){return this._config}setConfig(t){this._config=t,this.notifyListeners()}onConfigChange(t){this.listeners.push(t)}notifyListeners(){this.listeners.forEach((t=>t(this._config)))}}const tt=class{constructor(i){t(this,i),this.applicationLoaded=e(this,"applicationLoaded",7),this.applicationLoading=e(this,"applicationLoading",7),this.NEW_VERSION_POPUP_LOCKER="NEW_VERSION_POPUP_LOCKER",this.FEATURE_FLAG_CACHE_DURATION=36e5,this._authPromises=[],this._keyboardManager=new g,this._waitingAppReady=new Array,this._duCache=new Map,this._duPromises=new Map,this._requestListener=Y.create({strategy:"request_time"}),this._maxTimerAppLoading=1e4,this._featureFlagsCache=new Map,this._isBrowserTypeElectron=!1,this._pendingActions=new Map,this._loadPkParameter=null,this._isLoadedByPk=!1,this._formConfigFetcher=new R,this._LayoutFormConfigSingleton=Q.getInstance(),this._applicationReady=!1,this._templateSkeleton=D.GRID,this._activeScrimWindow=!1,this.enableLockManagerLoadingApp=void 0,this.messagesBuilder=void 0,this.configName=void 0,this.gridLegacyConfigName=void 0,this.formLegacyConfigName=void 0,this.loadByPK=void 0}async processPendingActions(t){const e=this._pendingActions.get(t);e&&e.length&&(e.forEach((t=>t())),this._pendingActions.set(t,[]))}get parameters(){return this._parameters||(this._parameters=new B),this._parameters}async getAuth(t){return null==t?this.getApplicationAuth():new Promise(((e,i)=>{this.authFetcher.getData(t).then((t=>{e(t)})).catch((t=>{i(t)}))}))}async getApplicationAuth(){return this._auth?Promise.resolve(this._auth):new Promise(((t,e)=>{const i=this._authPromises.length>0;this._authPromises.push(new et(t,e)),i||this.authFetcher.getData(this.applicationResourceID).then((t=>{for(this._auth=t;this._authPromises.length>0;)this._authPromises.pop().resolve(this._auth)})).catch((t=>{for(;this._authPromises.length>0;)this._authPromises.pop().reject(t)}))}))}watchPropHandler(t,e){t&&this._loadPkParameter&&(this.loadByPK(this._loadPkParameter.pk,this._loadPkParameter.redirect),this._loadPkParameter=null)}async getKeyboardManager(){return Promise.resolve(this._keyboardManager)}async getLayoutFormConfig(){return Promise.resolve(this._LayoutFormConfigSingleton)}async isUserSup(){return new Promise(((t,e)=>{this.getAuth().then((i=>{this.getAuthList(i).then((e=>{t(e.isSup)})).catch((t=>e(t)))}))}))}async addPendingAction(t,e){var i;const s=null!==(i=this._pendingActions.get(t))&&void 0!==i?i:[];this._pendingActions.set(t,[...s,e])}async callServiceBroker(t,e,i){return b.get().callServiceBroker(t,e,i)}async initOnboarding(t){this.hasToShowNewVersionPopup()?await this.addPendingAction(this.NEW_VERSION_POPUP_LOCKER,(()=>this.doInitOnboarding(t))):this.doInitOnboarding(t)}doInitOnboarding(t){w.getInstance().init(t,window.envContext)}async hasAccess(t,e){return new Promise(((i,s)=>{this.getAuth(e).then((e=>{this.getAuthList(e).then((e=>{i(e.isSup||e.actions[t])})).catch((t=>s(t)))}))}))}async getAllAccess(t){return new Promise(((e,i)=>{this.getAuth(t).then((t=>{this.getAuthList(t).then((t=>{const i={};i.isSup=t.isSup,Object.entries(O).forEach((e=>{i[e[0]]=e[1]===O.CLONE?t.actions[O.INSERT]&&t.actions[O.CLONE]||!1:t.actions[e[1]]||!1})),e(i)})).catch((t=>i(t)))}))}))}async getStringParam(t){return this.parameters.asString(t)}async getIntParam(t){return this.parameters.asInteger(t)}async getFloatParam(t){return this.parameters.asFloat(t)}async getBooleanParam(t){return this.parameters.asBoolean(t)}async getDateParam(t){return this.parameters.asDate(t)}async showPopUp(t,e="full",i=!0,s){this.clearContent(this._popUp),this._popUp.addEventListener("ezClosePopup",(()=>{s()}),{once:!0}),this._popUp.appendChild(t),this._popUp.opened=!0,this._popUp.heightMode=e,this._popUp.useHeader=i,"EZ-MODAL-CONTAINER"===t.tagName&&(this._popUp.useHeader=!1)}async showModal(t){this.clearContent(this._rightModal),this._rightModal.appendChild(t),this._rightModal.opened=!0}showAlerts(t){return x.showAlerts({alerts:t})}async closeModal(){this.clearContent(this._rightModal),this._rightModal.opened=!1}async closePopUp(){this.clearContent(this._popUp),this._popUp.opened=!1,this._popUp.useHeader=!0,this._popUp.heightMode="full"}async temOpcional(t){const e=t.split(",");return new Promise(((t,i)=>{this.getAttributeFromHTMLWrapper("opc0009").then((s=>{"1"===s?t(!0):Promise.all(e.map((t=>this.getAttributeFromHTMLWrapper("opc"+t)))).then((e=>{t(e.includes("1"))})).catch((t=>{i(t)}))})).catch((t=>{i(t)}))}))}async getConfig(t){let e={serviceName:"SystemUtilsSP.getConf",requestBody:{config:{chave:t,tipo:"T"}}};return new Promise(((t,i)=>{b.get().callServiceBroker("SystemUtilsSP.getConf",JSON.stringify(e)).then((e=>{var i;return t(null===(i=e.config)||void 0===i?void 0:i.data)})).catch((t=>i(t)))}))}async isFeatureActive(t){const e=Date.now();let i={serviceName:"SystemUtilsSP.featureIsActive",requestBody:{featureName:t}};if(this._featureFlagsCache.get(t)&&e<this._featureFlagsCache.get(t).expires)return Promise.resolve(this._featureFlagsCache.get(t).isActive);const s=(await b.get().callServiceBroker("SystemUtilsSP.featureIsActive",JSON.stringify(i))).isActive;return this._featureFlagsCache.set(t,{isActive:s,expires:e+this.FEATURE_FLAG_CACHE_DURATION}),s}async saveConfig(t,e){let i={serviceName:"SystemUtilsSP.saveConf",requestBody:{config:{chave:t,tipo:"T",data:e}}};return new Promise(((t,e)=>{b.get().callServiceBroker("SystemUtilsSP.saveConf",JSON.stringify(i)).then((e=>t(e))).catch((t=>e(t)))}))}async getAttributeFromHTMLWrapper(t){return Promise.resolve(window[t])}async openApp(t,e){V.openAppActivity(t,e)}async webConnection(t,e,i){this.getStringParam(t).then((t=>{F.webConnectionCaller(t,e,i)}))}getDuPromissesStack(t){let e;return t&&(e=this._duPromises.get(t),e||(e=[],this._duPromises.set(t,e))),e||[]}async createDataunit(t,e,i,s,n){return null==n&&(n=this.applicationResourceID),new Promise(((r,a)=>{const o=this.getDuPromissesStack(e),h=o.length>0;if(o.push(new et(r,a)),!h){const r=this.dataUnitFetcher.getDataUnit(t,n,i,s);r.loadMetadata().then((()=>{this.processResolveDataUnit(r,e,o)})).catch((t=>{for(;o.length>0;)o.pop().reject(t)}))}}))}processResolveDataUnit(t,e,i){for(e&&this.updateDataunitCache(void 0,e,t);i.length>0;)i.pop().resolve(t)}async updateDataunitCache(t,e,i){t&&this._duCache.delete(t),this._duCache.set(e,i)}async getDataUnit(t,e,i,s,n){return new Promise(((r,a)=>{const o=this._duCache.get(e);o?r(o):this.createDataunit(t,e,i,s,n).then((t=>{r(t)})).catch((t=>a(t)))}))}async addClientEvent(t,e){return new Promise((i=>{b.addClientEvent(t,e),i()}))}async removeClientEvent(t){return new Promise((e=>{b.removeClientEvent(t),e()}))}async hasClientEvent(t){return new Promise((e=>{e(b.hasClientEvent(t))}))}get applicationResourceID(){return this._applicationResourceID||(this._applicationResourceID=this.urlParams.get("workspaceResourceID")||this.urlParams.get("resourceID")||V.resourceID||"unknown.resource.id"),this._applicationResourceID}async getResourceID(){return Promise.resolve(this.applicationResourceID)}async getUserID(){return Promise.resolve(window.UID)}async alert(t,e,i,s){return x.alert(t,e,i,s)}async error(t,e,i,s){return x.error(t,e,i,s)}async success(t,e,i,s){return x.success(t,e,i,s)}async message(t,e,i,s){return x.message(t,e,i,s)}async confirm(t,e,i,s,n){return x.confirm(t,e,i,s,n)}async info(t,e){return x.info(t,e)}async loadTotals(t,e,i){return this.totalsFetcher.fetchTotals(t,e,i)}async isLoadedByPk(){return Promise.resolve(this._isLoadedByPk)}async preloadMangerRemoveRecord(t,e){const i=e.map((t=>({__record__id__:t})));N.removeRecords(t,i)}getCountSkeleton(t,e,i){i=i||160;const s=window.innerHeight-i;return Math.floor(s/(t+(e||10)))-1||1}getSkeletonRandomWidth(){return`${Math.floor(71*Math.random())+30}%`}async getAuthList(t){return await(new $).parseFromJSON(t)}get urlParams(){return this._urlParams||(this._urlParams=I.getQueryParams(location.search)),this._urlParams}getMessage(t,e){var i;return null===(i=this.messagesBuilder)||void 0===i?void 0:i.getMessage(t,e)}get dataUnitFetcher(){return this._dataUnitFetcher||(this._dataUnitFetcher=new C),this._dataUnitFetcher}get totalsFetcher(){return this._totalsFetcher||(this._totalsFetcher=new q),this._totalsFetcher}get pesquisaFetcher(){return this._pesquisaFetcher||(this._pesquisaFetcher=new E),this._pesquisaFetcher}get authFetcher(){return this._authFetcher||(this._authFetcher=new L),this._authFetcher}async executeSearch(t,e,i,s){const n=null==i?void 0:i.getField(e);if(n){const{mode:e,argument:a}=t,{ENTITYNAME:o,CODEFIELD:h,DESCRIPTIONFIELD:l,ROOTENTITY:c,DESCRIPTIONENTITY:d,ISHIERARCHYENTITY:u}=n.properties,p=n.dependencies;let m;const g={rootEntity:c,descriptionFieldName:l,codeFieldName:h,showInactives:!1,dataUnitId:i.dataUnitId};null==p||p.filter((t=>t.masterFields)).forEach((t=>{var e;t.type===y.SEARCHING&&(null===(e=t.masterFields)||void 0===e?void 0:e.length)>0&&(m={expression:t.expression,params:t.masterFields.map((t=>{const e=i.getField(t),s=(null==e?void 0:e.dataType)||v.TEXT,n=s===v.DATE?r.formatDate(new Date(null==e?void 0:e.defaultValue)):null==e?void 0:e.defaultValue,a=i.getFieldValue(t)||n;if(null==a)throw this.alert(this.getMessage("snkApplication.search.error.title"),this.getMessage("snkApplication.search.error.requiredField",{fieldLabel:e.label})),new Error(this.getMessage("snkApplication.search.error.requiredField",{fieldLabel:e.label}));return{name:t,value:a,dataType:s}}))})}));const w={entity:o,entityDescription:d,isHierarchyEntity:u,criteria:m,searchOptions:g,allowsNonAnalytic:null==s?void 0:s.allowsNonAnalytic};return(null==s?void 0:s.useSearchPlus)?this.executePreparedSearchPlus(e,a,w):this.executePreparedSearch(e,a,w)}}filterInvalidFields(t,e,i){return t.fieldsMetadata.filter((s=>{let n=!a.isEmpty(e[s.fieldName])&&!1!==s.visible&&"B"!==s.type&&t.pkField!==s.fieldName&&t.descriptionField!==s.fieldName&&(s.isPrimaryKey||!s.isLinkField)&&!("S"===s.type&&"H"===s.presentationType);return n&&(i[s.fieldName]=s),("string"!=typeof e[s.fieldName]||!(e[s.fieldName].indexOf("<img")>-1||e[s.fieldName].indexOf("<svg")>-1))&&n}))}filterMathFields(t,e,i,s){return t&&Array.isArray(t)&&t.forEach((t=>{let i=m.removeReference(e,s[t]);i&&e.unshift(i)})),e=e.slice(0,i)}builOptionItem(t,e,i,s,n){var r;return{value:a.highlightValue(t,e.__matchFields,null===(r=e[n])||void 0===r?void 0:r.toString(),i,!0),label:s?a.highlightValue(t,e.__matchFields,e[s],i,!0):"",details:p.buildDetails(t,i,e)}}async executePreparedSearchPlus(t,e,i){return await this.executePreparedSearch(t,e,Object.assign(Object.assign({},i),{useSearchPlus:!0}))}async executePreparedSearch(t,e,i){const s={},{entity:n,criteria:r,searchOptions:h,useSearchPlus:l}=i;return l?(async(t,e,i,s,n)=>{var r;const h={},{entity:l,criteria:c,searchOptions:d}=i;if("ADVANCED"===t)return Z(e,i,s,n);if("LOAD_DESCRIPTION"===t){let t=await n.loadByCode(l,e,c,d);t=o.stringToObject(t.json.$);const i=null===(r=t.data)||void 0===r?void 0:r[0];return i?{value:e,label:i[t.descriptionField]}:{value:e,label:""}}{let t,i=await n.loadAdvancedSearch(l,e,c,d,t);i=o.stringToObject(i.json.$);let s=i.descriptionField,r=i.pkField;return i.data.map((t=>{let n=((t,e,i)=>t.fieldsMetadata.filter((s=>{let n=!a.isEmpty(e[s.fieldName])&&!1!==s.visible&&"B"!==s.type&&t.pkField!==s.fieldName&&t.descriptionField!==s.fieldName&&(s.isPrimaryKey||!s.isLinkField)&&!("S"===s.type&&"H"===s.presentationType);return n&&(i[s.fieldName]=s),("string"!=typeof e[s.fieldName]||!X.some((t=>e[s.fieldName].includes(t))))&&n})))(i,t,h),o=((t,e,i,s)=>(t&&Array.isArray(t)&&t.forEach((t=>{let i=m.removeReference(e,s[t]);i&&e.unshift(i)})),e=e.slice(0,i)))(t.__matchFields,n,6,h);return((t,e,i,s,n)=>{var r;const o=e.__matchFields,h=null!==(r=e[s])&&void 0!==r?r:"",l=e[n];return{value:l,label:h,presentationValue:a.highlightValue(t,o,l,i,!0),presentationLabel:s?a.highlightValue(t,o,h,i,!0):"",details:p.buildDetails(t,i,e)}})(e,t,o,s,r)}))}})(t,e,i,this,this.pesquisaFetcher):"ADVANCED"===t?Z(e,i,this,this.pesquisaFetcher):new Promise(((t,i)=>{this.pesquisaFetcher.loadAdvancedSearch(n,e,r,h).then((i=>{i=o.stringToObject(i.json.$),t(this.buildSearchResultList(i,s,e))})).catch((t=>{i(t)}))}))}async executePreparedSearchWithFullResponse(t,e){const i={},{entity:s,criteria:n,searchOptions:r}=e;return new Promise(((e,a)=>{this.pesquisaFetcher.loadAdvancedSearch(s,t,n,r).then((s=>{(s=o.stringToObject(s.json.$)).data=this.buildSearchResultList(s,i,t),e(s)})).catch((t=>{a(t)}))}))}buildSearchResultList(t,e,i){let s=t.descriptionField,n=t.pkField;const r=[];return t.data.forEach((a=>{let o=this.filterInvalidFields(t,a,e),h=this.filterMathFields(a.__matchFields,o,6,e);r.push(this.builOptionItem(i,a,h,s,n))})),r}async isDebugMode(){return new Promise((t=>{t(window.isDebugMode)}))}async getAppLabel(){return V.getAppLabel(this.applicationResourceID)}addSearchListener(t,e,i){return new Promise((s=>{s(this.pesquisaFetcher.addSearchListener(t,e.dataUnitId,i))}))}importScript(t){return new Promise((e=>{this.getApplicationPath().then((i=>{let s=[];Array.isArray(t)||(s=[t]),s.forEach((t=>{const e=document.createElement("script");e.src=`${i}/${t}`,e.async=!0,document.body.appendChild(e)})),e()}))}))}async getApplicationPath(){return new Promise((t=>{"dev"===window.applicationenv?t(""):t(`/${this.getModuleName()}/labsApps/${window.APPLICATION_NAME}/build`)}))}getModuleName(){return window.MGE_MODULE_NAME||"mgefin-bff"}executeSelectDistinct(t,e,i){return this.dataUnitFetcher.loadSelectDistinct(t,e,i)}getDataFetcher(){return Promise.resolve(b.get())}async whenApplicationReady(){return f.getContextValue("__SNK__APPLICATION__LOADING__")?Promise.resolve(this):new Promise((t=>{this._waitingAppReady.push((()=>t(this)))}))}async setSearchFilterContext(t,e){f.setContextValue(`__SNK__APPLICATION__FILTER__CONTEXT(${t})__`,e)}clearContent(t){t&&Array.from(t.children).forEach((e=>{t.removeChild(e)}))}async clearPopUpTitle(){this._popUp.ezTitle=""}async setPopUpTitle(t){this._popUp.ezTitle=t}async pkChangeListener(){const t=top.window.location.hash.split("/")[2];if(this._currentPkParameter===t)return;const e=this.getResourceIdFromToken(),i=I.getPkObjectFromUrlToken(top.window.location.hash),s=window.redirectFrom;if(void 0===i)return;if((!s||-1===s.split("_")[0].indexOf(e.split("_")[0]))&&e!==this.applicationResourceID)return;const n={pk:i};if(this._isLoadedByPk=!0,this.loadByPK)return this.loadByPK(n,s),void(this._currentPkParameter=t);this._loadPkParameter={pk:n,redirect:s},this.defaultLoadByPK(n,t)}getResourceIdFromToken(){var t;return(null===(t=top.window.location.pathname)||void 0===t?void 0:t.indexOf("tabContent.jsp"))>-1&&window.location.generateHash?I.getResourceIdFromUrlToken(window.location.generateHash(window.location.hash)):I.getResourceIdFromUrlToken(top.window.location.hash)}defaultLoadByPK(t,e){if(!(null==t?void 0:t.pk))return;const i=this.getFirstDataUnitFromDOM(),s=i.dataUnit;if(!s)return console.warn(this.getMessage("snkApplication.dataUnit.initDataUnitError")),void i.addEventListener("dataUnitReady",(i=>{this.loadDataWithPKFilter(t,i.detail),this._currentPkParameter=e}));this.loadDataWithPKFilter(t,s),this._currentPkParameter=e}loadDataWithPKFilter(t,e){const i={term:"",filter:{name:"LOAD_BY_PK_FILTER",expression:this.buildFilterExpressionByPkObject(t),params:this.getFilterParamsFromPkObject(t,e)}};e.loadData(i)}getFirstDataUnitFromDOM(){let t=this._element.querySelector("snk-data-unit[data-load-by-pk]");if(t||(t=this._element.querySelector("snk-data-unit")),t)return t}getFilterParamsFromPkObject(t,e){var i;const s=[];for(const n in t.pk)t.pk.hasOwnProperty(n)&&!Array.isArray(t.pk[n])&&s.push({name:n,dataType:(null===(i=e.getField(n))||void 0===i?void 0:i.dataType)||this.getDefaultDataTypeLoadByPK(t.pk[n]),value:t.pk[n]});return s}getDefaultDataTypeLoadByPK(t){return"number"==typeof t||t instanceof Number?v.NUMBER:"boolean"==typeof t||t instanceof Boolean?v.BOOLEAN:t instanceof Date?v.DATE:v.TEXT}buildFilterExpressionByPkObject(t){let e="";for(const i in t.pk)a.isEmpty(e)||(e+=" AND "),Array.isArray(t.pk[i])?e+=`${i} IN (${t.pk[i].toString()})`:e+=`${i} = :${i}`;return e}async showNewVersionPopup(){const t=document.createElement("ez-modal-container"),e=await this.getAppLabel();t.modalTitle=this.getMessage("snkApplication.newVersionPopup.title",{screenName:e}),t.okButtonLabel=this.getMessage("snkApplication.newVersionPopup.okButton"),t.cancelButtonLabel=this.getMessage("snkApplication.newVersionPopup.cancelButton");const i=document.createElement("p");i.innerText=this.getMessage("snkApplication.newVersionPopup.info"),i.className="ez-text",t.appendChild(i),t.addEventListener("ezModalAction",this.newVersionPopupEventListener.bind(this));const s=await x.showPopup({content:t});this._removeVersionLayoutPopup=async()=>{await s(),await this.processPendingActions(this.NEW_VERSION_POPUP_LOCKER)}}async newVersionPopupEventListener(t){"LOAD"!==t.detail&&("OK"===t.detail&&V.setScreenToUseV3Layout(),"CANCEL"===t.detail&&V.setScreenToUseOldLayout(),this._popUp.opened=!1,this._removeVersionLayoutPopup&&await this._removeVersionLayoutPopup())}async handleShowNewVersionPopup(){this.hasToShowNewVersionPopup()&&await this.showNewVersionPopup()}hasToShowNewVersionPopup(){const t=new URLSearchParams(window.location.search).get("firstLoadConv");return t&&"S"===t}registerPkChangeListener(){window.hasOwnProperty("onhashchange")?window.onhashchange=this.pkChangeListener.bind(this):setInterval(this.pkChangeListener.bind(this),100)}componentWillLoad(){f.setContextValue("__SNK__APPLICATION__LOADING__",!0),this._errorHandler=new W(this),this.messagesBuilder=new T,f.setContextValue("__EZUI__UPLOAD__ADD__URL__",`${I.getUrlBase()}/mge/upload/file`),f.setContextValue("__EZUI__SEARCH__OPTION__LOADER__",((t,e,i,s)=>this.executeSearch(t,e,i,s))),f.setContextValue("__EZUI__SEARCH__PLUS__OPTION__LOADER__",((t,e,i,s)=>this.executeSearch(t,e,i,Object.assign(Object.assign({},s),{useSearchPlus:!0})))),this.registerPkChangeListener(),P.init(),A.preload(this.applicationResourceID,this.configName,{gridLegacyConfig:this.gridLegacyConfigName,formLegacyConfig:this.formLegacyConfigName}),document.addEventListener("click",(()=>V.applicationClick())),this._waitingAppReady.forEach((t=>t())),this.setLayoutFormConfig()}async setLayoutFormConfig(){const t=await this._formConfigFetcher.fetchLayoutFormConfig("formColCfg."+this.applicationResourceID),e=isNaN(Number(null==t?void 0:t.config))?null:Number(null==t?void 0:t.config);this._LayoutFormConfigSingleton.setConfig(e)}connectedCallback(){this._isBrowserTypeElectron=k.isElectron(),f.setContextValue("__SNK__APPLICATION__",this),b.addRequestListener(this._requestListener)}disconnectedCallback(){null==b||b.removeRequestListener(this._requestListener),this.removeShortcuts(),this._lockManagerTimer&&clearTimeout(this._lockManagerTimer),this._scrimWindowTimer&&clearTimeout(this._scrimWindowTimer)}async componentDidLoad(){this.applicationLoading.emit(!0),window.requestAnimationFrame((()=>{f.setContextValue("__SNK__APPLICATION__LOADING__",!1),this.applicationLoaded.emit(!0),this.pkChangeListener()})),u.addIDInfo(this._element,`resource_${this.applicationResourceID}`),await this.handleShowNewVersionPopup(),this.initKeyboardManager(),this.enableLockManagerLoadingApp?(z.addLockManagerCtxId(this._element),this.resolveApplicationReady()):this._applicationReady=!0}async showScrimApp(t){if(!this.enableLockManagerLoadingApp||!this._applicationReady||!t)return this._activeScrimWindow=!1,void(this._scrimWindowTimer&&clearTimeout(this._scrimWindowTimer));this._activeScrimWindow=!0,this._scrimWindowTimer=setTimeout((async()=>{this._activeScrimWindow&&(this._activeScrimWindow=!1,clearTimeout(this._scrimWindowTimer))}),this._maxTimerAppLoading)}async changeTemplateSkeleton(t){this._templateSkeleton=t||this._templateSkeleton}async markToReload(t){this.enableLockManagerLoadingApp&&(await this.changeTemplateSkeleton(t),this._applicationReady=!1,await z.resetLocks(this._element,_.APP_LOADING),this.resolveApplicationReady())}async addLoadingLock(t=!1,e){if(this.enableLockManagerLoadingApp)return await this.changeTemplateSkeleton(e),t&&(this._applicationReady=!1,this._activeScrimWindow=!!this._applicationReady,await z.resetLocks(this._element,_.APP_LOADING)),this.resolveApplicationReady(),await z.lock(this._element,_.APP_LOADING)}async resolveApplicationReady(){if(!this._applicationReady)try{await this.checkTimeoutLimitLockManager(),await z.whenHasLock(this._element,_.APP_LOADING),await z.whenResolve(this._element,_.APP_LOADING,200),await z.resetLocks(this._element,_.APP_LOADING),this._applicationReady=!0}catch(t){console.warn(t),this._applicationReady=!0}}stopTimeoutLockManager(){this._lockManagerTimer&&clearTimeout(this._lockManagerTimer)}async checkTimeoutLimitLockManager(){this.stopTimeoutLockManager(),this._applicationReady||(this._lockManagerTimer=setTimeout((async()=>{this._applicationReady||(await z.resetLocks(this._element,_.APP_LOADING),this.stopTimeoutLockManager(),this._applicationReady=!0)}),this._maxTimerAppLoading))}initKeyboardManager(){this._keyboardManager.bind("ctrl + g",V.searchApp.bind(this),{description:this.getMessage("snkApplication.keyboard.shortcuts.searchApp")}).bind("ctrl + d",V.showDesktop.bind(this),{description:this.getMessage("snkApplication.keyboard.shortcuts.showDesktop")}).bind("F1",V.openHelp.bind(this),{description:this.getMessage("snkApplication.keyboard.shortcuts.openHelp")})}removeShortcuts(){this._keyboardManager.unbindAllShortcutKeys()}renderLoadingSkeleton(){if(this.enableLockManagerLoadingApp){if(this._isBrowserTypeElectron)return this.getSpinnerLoadingDefault();switch(this._templateSkeleton){case D.CUSTOM_TEMPLATE:case D.GRID:return this.getSkeletonTemplateGrid();case D.GRID_WITH_SIDEBAR:return this.getSkeletonTemplateGridWithSidebar();case D.GRID_WITH_PANEL:return this.getSkeletonTemplateGridWithPanel();case D.FORM_WITH_SIDEBAR:return this.getSkeletonTemplateFormWithSidebar();default:return this.getSkeletonTemplateGrid()}}}getLoadingVisibilityStyle(){return{visibility:this._applicationReady?"hidden":"initial",display:this._applicationReady?"none":"unset"}}getSkeletonTemplateGrid(){return i("div",{class:"loading-hidden",style:this.getLoadingVisibilityStyle()},i("div",{class:"ez-flex ez-flex--column ez-margin--large ez-margin-top--medium"},i("div",{class:"ez-margin-bottom--medium"},i("ez-skeleton",{count:1,variant:"text",width:"20%",height:"35px",animation:"progress"})),i("div",{class:""},i("ez-skeleton",{count:1,variant:"text",width:"70%",height:"25px",animation:"progress"}))),i("div",{class:"ez-flex ez-flex--justify-start skeleton-content-column ez-margin-horizontal--large",style:{height:"calc(-105px + 100vh)"}},[1,2,3,4].map(((t,e)=>i("div",{class:"ez-margin-right--large",key:e,style:{width:"25%"}},i("ez-skeleton",{count:this.getCountSkeleton(50,10),variant:"text",width:"100%",height:"50px",animation:"progress",marginBottom:"10px"}))))))}getSkeletonTemplateGridWithSidebar(){return i("div",{class:"loading-hidden",style:this.getLoadingVisibilityStyle()},i("div",{class:"ez-flex ez-flex--column ez-margin--large ez-margin-top--medium"},i("div",{class:"ez-margin-bottom--medium"},i("ez-skeleton",{count:1,variant:"text",width:"20%",height:"35px",animation:"progress"})),i("div",{class:""},i("ez-skeleton",{count:1,variant:"text",width:"70%",height:"25px",animation:"progress"}))),i("div",{class:"ez-flex ez-flex--justify-start skeleton-content-column ez-margin-horizontal--large",style:{height:"calc(100vh - 160px)"}},i("div",{class:"ez-flex ez-flex--column ez-margin-right--large",style:{width:"25%",overflow:"hidden"}},Array(this.getCountSkeleton(30,6)).fill(null).map(((t,e)=>i("ez-skeleton",{key:e,count:1,variant:"text",width:this.getSkeletonRandomWidth(),height:"30px",animation:"progress",marginBottom:"10px"})))),i("div",{class:"ez-margin-right--large",style:{width:"75%"}},i("ez-skeleton",{count:this.getCountSkeleton(50,10),variant:"text",width:"100%",height:"50px",animation:"progress",marginBottom:"10px"}))))}getSkeletonTemplateGridWithPanel(){return i("div",{class:"loading-hidden",style:this.getLoadingVisibilityStyle()},i("div",{class:"ez-margin--medium ez-margin-top--medium ez-padding--medium"},i("ez-skeleton",{count:1,variant:"text",width:"70%",height:"25px",animation:"progress"})),i("div",{class:"ez-flex ez-margin--medium ez-margin-top--medium",style:{maxHeight:"calc(-105px + 100vh)",overflow:"hidden"}},i("div",{class:"",style:{width:"70%",overflow:"hidden"}},i("div",{class:"ez-padding--medium",style:{height:"50%"}},i("ez-skeleton",{count:1,variant:"text",width:"100%",height:"100%",animation:"progress"})),i("div",{class:"ez-padding--medium",style:{}},i("ez-skeleton",{count:1,variant:"text",width:"250px",height:"25px",animation:"progress"})),i("div",{class:"ez-flex ez-padding--medium",style:{height:"45%"}},[1,2].map((()=>i("div",{style:{width:"50%"}},i("ez-skeleton",{count:1,variant:"text",width:"100%",height:"100%",animation:"progress"})))))),i("div",{class:"ez-flex ez-flex--column ez-padding--medium",style:{width:"30%",overflow:"hidden"}},Array(this.getCountSkeleton(30,10)).fill(null).map(((t,e)=>i("ez-skeleton",{key:e,count:1,variant:"text",width:"100%",height:"50px",animation:"progress",marginBottom:"10px"}))))))}getSkeletonTemplateFormWithSidebar(){return i("div",{class:"loading-hidden",style:this.getLoadingVisibilityStyle()},i("div",{class:"ez-margin--medium ez-margin-top--medium ez-padding--medium"},i("ez-skeleton",{count:1,variant:"text",width:"70%",height:"25px",animation:"progress"})),i("div",{class:"ez-flex ez-margin--medium ez-margin-top--medium",style:{maxHeight:"calc(-105px + 100vh)",overflow:"hidden"}},i("div",{class:"ez-flex ez-flex--column ez-margin-right--large",style:{width:"25%",overflow:"hidden"}},Array(this.getCountSkeleton(30,6)).fill(null).map(((t,e)=>i("ez-skeleton",{key:e,count:1,variant:"text",width:this.getSkeletonRandomWidth(),height:"30px",animation:"progress",marginBottom:"10px"})))),i("div",{class:"ez-flex ez-flex--column",style:{width:"75%"}},i("div",{class:"ez-padding--medium",style:{width:"100%"}},i("ez-skeleton",{count:1,variant:"text",width:"30%",height:"25px",animation:"progress"})),i("div",{class:"ez-padding--medium",style:{height:"45%"}},i("div",{class:"ez-flex",style:{width:"100%",height:"100%"}},[1,2,3,4].map(((t,e)=>i("div",{key:e,class:"ez-padding-right--large",style:{width:"25%",overflow:"hidden"}},Array(this.getCountSkeleton(50,20)).fill(null).map(((t,e)=>i("ez-skeleton",{key:e,count:1,variant:"text",width:"100%",height:"50px",animation:"progress",marginBottom:"10px"})))))))),i("div",{class:"ez-padding--medium",style:{width:"100%"}},i("ez-skeleton",{count:1,variant:"text",width:"30%",height:"25px",animation:"progress"})),i("div",{class:"ez-padding--medium",style:{height:"45%"}},i("div",{class:"ez-flex",style:{width:"100%",height:"100%"}},[1,2,3,4].map(((t,e)=>i("div",{key:e,class:"ez-padding-right--large",style:{width:"25%",overflow:"hidden"}},Array(this.getCountSkeleton(50,20)).fill(null).map(((t,e)=>i("ez-skeleton",{key:e,count:1,variant:"text",width:"100%",height:"50px",animation:"progress",marginBottom:"10px"})))))))))))}getSpinnerLoadingDefault(){return i("div",{class:"loading-hidden",style:this.getLoadingVisibilityStyle()},i("div",{class:"ez-flex ez-size-height--full ez-size-width--full ez-flex--justify-center ez-flex--align-items-center spinner"},i("ez-icon",{iconName:"sync",size:"x-large",class:"spin"}),i("span",{class:"ez-title ez-title--secondary ez-title--extra-large"},this.getMessage("snkApplication.loading.text"))))}render(){return i(s,{style:{visibility:!this.enableLockManagerLoadingApp||this._applicationReady?"unset":"hidden",overflow:!this.enableLockManagerLoadingApp||this._applicationReady?"unset":"hidden"}},i("div",null,i("ez-loading-bar",{ref:t=>this._requestListener.ezLoadingBar=t}),i("ez-popup",{opened:!1,ref:t=>this._popUp=t,onEzClosePopup:()=>this.closePopUp()}),i("ez-modal",{opened:!1,ref:t=>this._rightModal=t,"modal-size":"small",closeOutsideClick:!0,closeEsc:!0}),this.renderLoadingSkeleton(),this._activeScrimWindow&&i("div",{class:"ez-scrim ez-scrim--light",style:{cursor:"progress",zIndex:"var(--scrim-z-index)"}})))}get _element(){return n(this)}static get watchers(){return{loadByPK:["watchPropHandler"]}}};class et{constructor(t,e){this.resolve=t,this.reject=e}}tt.style=".sc-snk-application-h{--scrim-z-index:var(--elevation--100, 100);display:flex;flex-direction:column;height:100%}.sc-snk-application-h>.loading-hidden.sc-snk-application{display:none;pointer-events:none}.skeleton-content-left.sc-snk-application{width:300px;padding-right:5px}.skeleton-content.sc-snk-application{height:calc(100vh - 310px)}.spinner.sc-snk-application{height:100vh;gap:10px}.spinner.sc-snk-application>.spin.sc-snk-application{animation-name:spin;animation-duration:5000ms;animation-iteration-count:infinite;animation-timing-function:linear}@keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}";export{tt as snk_application}