@sankhyalabs/sankhyablocks 10.1.0-dev.2 → 10.1.0-dev.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (318) hide show
  1. package/dist/cjs/{ConfigStorage-5a73e979.js → ConfigStorage-a4e1e518.js} +2 -2
  2. package/dist/cjs/{DataFetcher-eeb3b0b7.js → DataFetcher-0b6aa084.js} +34 -24
  3. package/dist/cjs/{FormConfigHelper-ebb77625.js → FormConfigHelper-28fe4668.js} +44 -0
  4. package/dist/cjs/{ISave-861e9d6d.js → ISave-2c455a77.js} +4 -4
  5. package/dist/cjs/{PersonalizedFilterUtils-7259cf65.js → PersonalizedFilterUtils-eccb267a.js} +13 -0
  6. package/dist/cjs/{SnkFormConfigManager-8d4fded8.js → SnkFormConfigManager-b8c81493.js} +7 -7
  7. package/dist/cjs/{SnkMultiSelectionListDataSource-3b93f6a6.js → SnkMultiSelectionListDataSource-03b58f5a.js} +5 -5
  8. package/dist/cjs/{auth-fetcher-8d8acd69.js → auth-fetcher-7e7796c9.js} +1 -1
  9. package/dist/cjs/config-header.cjs.entry.js +1 -1
  10. package/dist/cjs/configs-button.cjs.entry.js +1 -1
  11. package/dist/cjs/css-shim-a27d231b.js +6 -0
  12. package/dist/cjs/{dataunit-fetcher-1cea0695.js → dataunit-fetcher-8dffbcdf.js} +1 -1
  13. package/dist/cjs/dom-ff96a4bc.js +75 -0
  14. package/dist/cjs/field-config_2.cjs.entry.js +3 -3
  15. package/dist/cjs/fields-layout.cjs.entry.js +7 -4
  16. package/dist/cjs/fields-selector.cjs.entry.js +2 -2
  17. package/dist/cjs/{form-config-fetcher-f347f884.js → form-config-fetcher-5516d68a.js} +1 -1
  18. package/dist/cjs/guides-configurator.cjs.entry.js +6 -4
  19. package/dist/cjs/{index-1cf293c1.js → index-1894343a.js} +1515 -171
  20. package/dist/cjs/{index-13d05f03.js → index-f0fe7e6e.js} +90 -21
  21. package/dist/cjs/loader.cjs.js +16 -2
  22. package/dist/cjs/pesquisa-grid_2.cjs.entry.js +5 -5
  23. package/dist/cjs/sankhyablocks.cjs.js +132 -4
  24. package/dist/cjs/shadow-css-7e3e0ab1.js +389 -0
  25. package/dist/cjs/snk-actions-button_9.cjs.entry.js +6 -6
  26. package/dist/cjs/snk-actions-form.cjs.entry.js +1 -1
  27. package/dist/cjs/snk-application.cjs.entry.js +100 -70
  28. package/dist/cjs/snk-attach.cjs.entry.js +8 -8
  29. package/dist/cjs/snk-client-confirm.cjs.entry.js +1 -1
  30. package/dist/cjs/snk-configurator.cjs.entry.js +1 -1
  31. package/dist/cjs/snk-crud.cjs.entry.js +100 -9
  32. package/dist/cjs/snk-custom-slot-elements.cjs.entry.js +1 -1
  33. package/dist/cjs/snk-custom-slot-guide.cjs.entry.js +40 -0
  34. package/dist/cjs/snk-data-exporter.cjs.entry.js +6 -6
  35. package/dist/cjs/{snk-data-unit-de248308.js → snk-data-unit-036ce58c.js} +12 -3
  36. package/dist/cjs/snk-data-unit.cjs.entry.js +4 -4
  37. package/dist/cjs/snk-default-filter.cjs.entry.js +1 -1
  38. package/dist/cjs/snk-detail-view.cjs.entry.js +10 -10
  39. package/dist/cjs/snk-entity-list.cjs.entry.js +1 -1
  40. package/dist/cjs/snk-exporter-email-sender.cjs.entry.js +1 -1
  41. package/dist/cjs/snk-expression-group_2.cjs.entry.js +2 -2
  42. package/dist/cjs/snk-filter-advanced-mode_2.cjs.entry.js +2 -2
  43. package/dist/cjs/snk-filter-bar_4.cjs.entry.js +58 -25
  44. package/dist/cjs/snk-filter-binary-select.cjs.entry.js +1 -1
  45. package/dist/cjs/snk-filter-checkbox-list.cjs.entry.js +1 -1
  46. package/dist/cjs/snk-filter-detail.cjs.entry.js +2 -2
  47. package/dist/cjs/snk-filter-field-search_2.cjs.entry.js +2 -2
  48. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +4 -4
  49. package/dist/cjs/snk-filter-multi-select.cjs.entry.js +1 -1
  50. package/dist/cjs/snk-filter-number.cjs.entry.js +2 -2
  51. package/dist/cjs/snk-filter-period.cjs.entry.js +11 -6
  52. package/dist/cjs/snk-filter-search.cjs.entry.js +1 -1
  53. package/dist/cjs/snk-filter-text.cjs.entry.js +2 -2
  54. package/dist/cjs/snk-form-summary.cjs.entry.js +1 -1
  55. package/dist/cjs/snk-form-view.cjs.entry.js +1 -1
  56. package/dist/cjs/snk-form_2.cjs.entry.js +33 -10
  57. package/dist/cjs/snk-grid.cjs.entry.js +28 -19
  58. package/dist/cjs/{snk-guides-viewer-4ec3e7e1.js → snk-guides-viewer-164c063e.js} +86 -40
  59. package/dist/cjs/snk-guides-viewer.cjs.entry.js +10 -10
  60. package/dist/cjs/snk-personalized-filter-editor.cjs.entry.js +1 -1
  61. package/dist/cjs/snk-personalized-filter.cjs.entry.js +6 -6
  62. package/dist/cjs/snk-pesquisa.cjs.entry.js +17 -6
  63. package/dist/cjs/snk-print-selector.cjs.entry.js +1 -1
  64. package/dist/cjs/snk-simple-bar.cjs.entry.js +1 -1
  65. package/dist/cjs/snk-simple-crud.cjs.entry.js +14 -21
  66. package/dist/cjs/snk-taskbar.cjs.entry.js +67 -51
  67. package/dist/cjs/{taskbar-elements-fb5d1e08.js → taskbar-elements-8a80420e.js} +2 -2
  68. package/dist/cjs/teste-pesquisa.cjs.entry.js +1 -1
  69. package/dist/collection/collection-manifest.json +2 -1
  70. package/dist/collection/components/snk-application/search-strategy/exec-prepared-search-advaced-mode.js +27 -0
  71. package/dist/collection/components/snk-application/search-strategy/exec-prepared-search-plus.js +5 -25
  72. package/dist/collection/components/snk-application/snk-application.js +105 -44
  73. package/dist/collection/components/snk-attach/snk-attach.js +1 -1
  74. package/dist/collection/components/snk-crud/snk-crud.js +151 -2
  75. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +133 -34
  76. package/dist/collection/components/snk-custom-slot-guide/snk-custom-slot-guide.css +3 -0
  77. package/dist/collection/components/snk-custom-slot-guide/snk-custom-slot-guide.js +95 -0
  78. package/dist/collection/components/snk-data-unit/snk-data-unit.js +9 -0
  79. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js +2 -2
  80. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js +11 -6
  81. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js +1 -1
  82. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.css +4 -0
  83. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +7 -1
  84. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.css +1 -0
  85. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +15 -4
  86. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +30 -13
  87. package/dist/collection/components/snk-form-config/FormConfigHelper.js +42 -0
  88. package/dist/collection/components/snk-form-config/SnkFormConfigManager.js +6 -6
  89. package/dist/collection/components/snk-form-config/field-item/field-config/field-config.css +1 -0
  90. package/dist/collection/components/snk-form-config/fields-layout/fields-layout.css +16 -0
  91. package/dist/collection/components/snk-form-config/fields-layout/fields-layout.js +6 -3
  92. package/dist/collection/components/snk-form-config/guides-configurator/guides-configurator.css +3 -3
  93. package/dist/collection/components/snk-form-config/guides-configurator/guides-configurator.js +5 -3
  94. package/dist/collection/components/snk-form-config/snk-form-config.js +53 -6
  95. package/dist/collection/components/snk-grid/snk-grid.css +12 -0
  96. package/dist/collection/components/snk-grid/snk-grid.js +39 -12
  97. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/utils/PersonalizedFilterUtils.js +13 -0
  98. package/dist/collection/components/snk-pesquisa/snk-pesquisa.css +5 -1
  99. package/dist/collection/components/snk-pesquisa/snk-pesquisa.js +43 -0
  100. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +23 -12
  101. package/dist/collection/components/snk-taskbar/snk-taskbar.js +87 -48
  102. package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +3 -3
  103. package/dist/collection/lib/message/SnkMessageBuilder.js +11 -2
  104. package/dist/collection/lib/message/resources/en-us/snk-form.msg.js +7 -0
  105. package/dist/collection/lib/message/resources/es-es/snk-form.msg.js +7 -0
  106. package/dist/collection/lib/message/resources/pt-br/snk-form.msg.js +8 -1
  107. package/dist/collection/lib/message/resources/pt-br/snk-pesquisa.msg.js +1 -1
  108. package/dist/components/DataFetcher.js +34 -4
  109. package/dist/components/ISave.js +3 -3
  110. package/dist/components/PersonalizedFilterUtils.js +13 -0
  111. package/dist/components/SnkFormConfigManager.js +6 -6
  112. package/dist/components/field-config2.js +44 -2
  113. package/dist/components/fields-layout2.js +6 -3
  114. package/dist/components/guides-configurator2.js +5 -3
  115. package/dist/components/index.d.ts +1 -0
  116. package/dist/components/index.js +1 -0
  117. package/dist/components/index2.js +90 -21
  118. package/dist/components/snk-application2.js +94 -63
  119. package/dist/components/snk-attach2.js +1 -1
  120. package/dist/components/snk-crud.js +96 -1
  121. package/dist/components/snk-custom-slot-guide.d.ts +11 -0
  122. package/dist/components/snk-custom-slot-guide.js +55 -0
  123. package/dist/components/snk-data-unit2.js +9 -0
  124. package/dist/components/snk-detail-view2.js +81 -34
  125. package/dist/components/snk-filter-bar2.js +30 -13
  126. package/dist/components/snk-filter-item2.js +8 -2
  127. package/dist/components/snk-filter-modal2.js +16 -6
  128. package/dist/components/snk-filter-number.js +2 -2
  129. package/dist/components/snk-filter-period.js +10 -5
  130. package/dist/components/snk-filter-text.js +1 -1
  131. package/dist/components/snk-form-config2.js +29 -5
  132. package/dist/components/snk-grid2.js +22 -11
  133. package/dist/components/snk-pesquisa2.js +14 -2
  134. package/dist/components/snk-simple-crud2.js +6 -12
  135. package/dist/components/snk-taskbar2.js +66 -49
  136. package/dist/esm/{ConfigStorage-568dc227.js → ConfigStorage-39ac8fef.js} +2 -2
  137. package/dist/esm/{DataFetcher-743feb3b.js → DataFetcher-0b9da57d.js} +34 -4
  138. package/dist/esm/{FormConfigHelper-4e42f0b6.js → FormConfigHelper-d09669f3.js} +43 -1
  139. package/dist/esm/{ISave-345481c1.js → ISave-f1c9269b.js} +4 -4
  140. package/dist/esm/{PersonalizedFilterUtils-2db38ff2.js → PersonalizedFilterUtils-d2439a9a.js} +13 -0
  141. package/dist/esm/{SnkFormConfigManager-d61df0c8.js → SnkFormConfigManager-a87566c8.js} +7 -7
  142. package/dist/esm/{SnkMultiSelectionListDataSource-ca8d7a09.js → SnkMultiSelectionListDataSource-01b3744b.js} +5 -5
  143. package/dist/esm/{auth-fetcher-c353127d.js → auth-fetcher-acdc1cb4.js} +1 -1
  144. package/dist/esm/config-header.entry.js +1 -1
  145. package/dist/esm/configs-button.entry.js +1 -1
  146. package/dist/esm/css-shim-9f2d321e.js +4 -0
  147. package/dist/esm/{dataunit-fetcher-7f2c61ca.js → dataunit-fetcher-4c312b43.js} +1 -1
  148. package/dist/esm/dom-64053c71.js +73 -0
  149. package/dist/esm/field-config_2.entry.js +3 -3
  150. package/dist/esm/fields-layout.entry.js +7 -4
  151. package/dist/esm/fields-selector.entry.js +2 -2
  152. package/dist/esm/{form-config-fetcher-898d2dd1.js → form-config-fetcher-7cda6254.js} +1 -1
  153. package/dist/esm/guides-configurator.entry.js +6 -4
  154. package/dist/esm/{index-479e1293.js → index-04f73a26.js} +1507 -171
  155. package/dist/esm/{index-446f9341.js → index-ea250be6.js} +90 -21
  156. package/dist/esm/loader.js +17 -3
  157. package/dist/esm/pesquisa-grid_2.entry.js +5 -5
  158. package/dist/esm/sankhyablocks.js +133 -5
  159. package/dist/esm/shadow-css-98135883.js +387 -0
  160. package/dist/esm/snk-actions-button_9.entry.js +6 -6
  161. package/dist/esm/snk-actions-form.entry.js +1 -1
  162. package/dist/esm/snk-application.entry.js +100 -70
  163. package/dist/esm/snk-attach.entry.js +8 -8
  164. package/dist/esm/snk-client-confirm.entry.js +1 -1
  165. package/dist/esm/snk-configurator.entry.js +1 -1
  166. package/dist/esm/snk-crud.entry.js +100 -9
  167. package/dist/esm/snk-custom-slot-elements.entry.js +1 -1
  168. package/dist/esm/snk-custom-slot-guide.entry.js +36 -0
  169. package/dist/esm/snk-data-exporter.entry.js +6 -6
  170. package/dist/esm/{snk-data-unit-60b338c5.js → snk-data-unit-130021b3.js} +12 -3
  171. package/dist/esm/snk-data-unit.entry.js +4 -4
  172. package/dist/esm/snk-default-filter.entry.js +1 -1
  173. package/dist/esm/snk-detail-view.entry.js +10 -10
  174. package/dist/esm/snk-entity-list.entry.js +1 -1
  175. package/dist/esm/snk-exporter-email-sender.entry.js +1 -1
  176. package/dist/esm/snk-expression-group_2.entry.js +2 -2
  177. package/dist/esm/snk-filter-advanced-mode_2.entry.js +2 -2
  178. package/dist/esm/snk-filter-bar_4.entry.js +58 -25
  179. package/dist/esm/snk-filter-binary-select.entry.js +1 -1
  180. package/dist/esm/snk-filter-checkbox-list.entry.js +1 -1
  181. package/dist/esm/snk-filter-detail.entry.js +2 -2
  182. package/dist/esm/snk-filter-field-search_2.entry.js +2 -2
  183. package/dist/esm/snk-filter-modal-item.entry.js +4 -4
  184. package/dist/esm/snk-filter-multi-select.entry.js +1 -1
  185. package/dist/esm/snk-filter-number.entry.js +2 -2
  186. package/dist/esm/snk-filter-period.entry.js +11 -6
  187. package/dist/esm/snk-filter-search.entry.js +1 -1
  188. package/dist/esm/snk-filter-text.entry.js +2 -2
  189. package/dist/esm/snk-form-summary.entry.js +1 -1
  190. package/dist/esm/snk-form-view.entry.js +1 -1
  191. package/dist/esm/snk-form_2.entry.js +33 -10
  192. package/dist/esm/snk-grid.entry.js +28 -19
  193. package/dist/esm/{snk-guides-viewer-339e10b3.js → snk-guides-viewer-3fd18298.js} +86 -40
  194. package/dist/esm/snk-guides-viewer.entry.js +10 -10
  195. package/dist/esm/snk-personalized-filter-editor.entry.js +1 -1
  196. package/dist/esm/snk-personalized-filter.entry.js +6 -6
  197. package/dist/esm/snk-pesquisa.entry.js +17 -6
  198. package/dist/esm/snk-print-selector.entry.js +1 -1
  199. package/dist/esm/snk-simple-bar.entry.js +1 -1
  200. package/dist/esm/snk-simple-crud.entry.js +14 -21
  201. package/dist/esm/snk-taskbar.entry.js +68 -52
  202. package/dist/esm/{taskbar-elements-faaf5d8f.js → taskbar-elements-d1e63fb2.js} +2 -2
  203. package/dist/esm/teste-pesquisa.entry.js +1 -1
  204. package/dist/sankhyablocks/{p-7f7fe6c4.entry.js → p-0a160fb5.entry.js} +1 -1
  205. package/dist/sankhyablocks/{p-144da1d1.entry.js → p-12f595a6.entry.js} +1 -1
  206. package/dist/sankhyablocks/{p-162bddae.entry.js → p-175c9576.entry.js} +1 -1
  207. package/dist/sankhyablocks/p-18d66638.entry.js +1 -0
  208. package/dist/sankhyablocks/{p-1788d191.js → p-1f310bc6.js} +1 -1
  209. package/dist/sankhyablocks/{p-c4fcf1fb.entry.js → p-27e0cd68.entry.js} +1 -1
  210. package/dist/sankhyablocks/p-2a33d4cf.entry.js +1 -0
  211. package/dist/sankhyablocks/p-2ac55a5d.js +1 -0
  212. package/dist/sankhyablocks/{p-9a63f3f7.entry.js → p-2b882835.entry.js} +1 -1
  213. package/dist/sankhyablocks/{p-1f8cb438.entry.js → p-2c6be187.entry.js} +1 -1
  214. package/dist/sankhyablocks/p-2c9d0870.js +2 -0
  215. package/dist/sankhyablocks/{p-cb4343c4.entry.js → p-2cc2526e.entry.js} +1 -1
  216. package/dist/sankhyablocks/{p-75af335e.entry.js → p-2ebda226.entry.js} +1 -1
  217. package/dist/sankhyablocks/{p-093f58fa.entry.js → p-2f94cf87.entry.js} +1 -1
  218. package/dist/sankhyablocks/p-3a35917e.entry.js +1 -0
  219. package/dist/sankhyablocks/p-3a443150.entry.js +1 -0
  220. package/dist/sankhyablocks/{p-c90f337a.entry.js → p-3b6d8d33.entry.js} +1 -1
  221. package/dist/sankhyablocks/p-3db72758.entry.js +1 -0
  222. package/dist/sankhyablocks/{p-e8c49c12.js → p-48a5c311.js} +2 -2
  223. package/dist/sankhyablocks/p-52691b42.js +1 -0
  224. package/dist/sankhyablocks/{p-27482793.entry.js → p-5aae5c74.entry.js} +1 -1
  225. package/dist/sankhyablocks/p-6564180d.entry.js +1 -0
  226. package/dist/sankhyablocks/{p-6d241415.js → p-6768f176.js} +1 -1
  227. package/dist/sankhyablocks/p-68c1a093.js +1 -0
  228. package/dist/sankhyablocks/p-6d322b0a.js +1 -0
  229. package/dist/sankhyablocks/{p-7b3ca294.entry.js → p-7150eacf.entry.js} +1 -1
  230. package/dist/sankhyablocks/{p-825098c1.entry.js → p-752c57f4.entry.js} +1 -1
  231. package/dist/sankhyablocks/{p-49ddc27a.entry.js → p-752f4e29.entry.js} +1 -1
  232. package/dist/sankhyablocks/{p-e258de96.entry.js → p-76729994.entry.js} +1 -1
  233. package/dist/sankhyablocks/{p-7fc46290.js → p-7ee6b1bf.js} +1 -1
  234. package/dist/sankhyablocks/{p-27005fac.entry.js → p-877d9614.entry.js} +1 -1
  235. package/dist/sankhyablocks/p-8b4d6719.js +1 -0
  236. package/dist/sankhyablocks/{p-3d41f5a8.entry.js → p-8d946600.entry.js} +1 -1
  237. package/dist/sankhyablocks/{p-96d45943.entry.js → p-90ae6c2e.entry.js} +1 -1
  238. package/dist/sankhyablocks/p-94267a30.entry.js +1 -0
  239. package/dist/sankhyablocks/{p-59b8f277.js → p-998a9d6f.js} +1 -1
  240. package/dist/sankhyablocks/{p-21107f0d.entry.js → p-9c1ff75e.entry.js} +1 -1
  241. package/dist/sankhyablocks/{p-2fdac5e6.entry.js → p-9e109f5e.entry.js} +1 -1
  242. package/dist/sankhyablocks/{p-88ed2793.js → p-9e4555ab.js} +1 -1
  243. package/dist/sankhyablocks/p-a46ac091.js +1 -0
  244. package/dist/sankhyablocks/p-a73b6b00.js +1 -0
  245. package/dist/sankhyablocks/{p-164c822d.entry.js → p-acd2ba28.entry.js} +1 -1
  246. package/dist/sankhyablocks/{p-180716b2.entry.js → p-ae326d06.entry.js} +1 -1
  247. package/dist/sankhyablocks/p-b471bfab.entry.js +1 -0
  248. package/dist/sankhyablocks/p-b533edab.entry.js +1 -0
  249. package/dist/sankhyablocks/p-b555ce38.entry.js +1 -0
  250. package/dist/sankhyablocks/p-c2d33fc8.entry.js +1 -0
  251. package/dist/sankhyablocks/p-c3ec6642.js +19 -0
  252. package/dist/sankhyablocks/{p-91a9abb6.entry.js → p-c8043a53.entry.js} +1 -1
  253. package/dist/sankhyablocks/{p-c3dbf441.entry.js → p-cc64239c.entry.js} +1 -1
  254. package/dist/sankhyablocks/{p-b987e15d.js → p-cc9935af.js} +1 -1
  255. package/dist/sankhyablocks/{p-471b34f4.entry.js → p-cd00a3d1.entry.js} +1 -1
  256. package/dist/sankhyablocks/{p-b7e891cc.entry.js → p-cd40c8cf.entry.js} +1 -1
  257. package/dist/sankhyablocks/{p-bd203e8d.entry.js → p-cd412add.entry.js} +1 -1
  258. package/dist/sankhyablocks/{p-4c763b10.entry.js → p-d657f71f.entry.js} +1 -1
  259. package/dist/sankhyablocks/{p-e6b1c769.entry.js → p-d6dad5e4.entry.js} +1 -1
  260. package/dist/sankhyablocks/p-d714b6ca.js +1 -0
  261. package/dist/sankhyablocks/p-da455c82.js +12 -0
  262. package/dist/sankhyablocks/p-e30acdca.entry.js +1 -0
  263. package/dist/sankhyablocks/p-ec9027a7.entry.js +1 -0
  264. package/dist/sankhyablocks/p-ef9343c3.entry.js +1 -0
  265. package/dist/sankhyablocks/{p-667cab42.entry.js → p-f152ef98.entry.js} +1 -1
  266. package/dist/sankhyablocks/{p-7e250432.entry.js → p-f7170e10.entry.js} +1 -1
  267. package/dist/sankhyablocks/p-f8c5395a.entry.js +1 -0
  268. package/dist/sankhyablocks/{p-7345782c.entry.js → p-f921270b.entry.js} +1 -1
  269. package/dist/sankhyablocks/p-fa087ab2.entry.js +11 -0
  270. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  271. package/dist/types/components/snk-application/search-strategy/exec-prepared-search-advaced-mode.d.ts +5 -0
  272. package/dist/types/components/snk-application/snk-application.d.ts +9 -0
  273. package/dist/types/components/snk-crud/snk-crud.d.ts +22 -0
  274. package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +23 -0
  275. package/dist/types/components/snk-custom-slot-guide/snk-custom-slot-guide.d.ts +16 -0
  276. package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +1 -0
  277. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-period.d.ts +1 -0
  278. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +1 -1
  279. package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +2 -1
  280. package/dist/types/components/snk-form-config/FormConfigHelper.d.ts +6 -1
  281. package/dist/types/components/snk-form-config/SnkFormConfigManager.d.ts +1 -1
  282. package/dist/types/components/snk-form-config/fields-layout/fields-layout.d.ts +2 -2
  283. package/dist/types/components/snk-form-config/guides-configurator/guides-configurator.d.ts +1 -1
  284. package/dist/types/components/snk-form-config/snk-form-config.d.ts +9 -2
  285. package/dist/types/components/snk-grid/snk-grid.d.ts +6 -0
  286. package/dist/types/components/snk-personalized-filter/interfaces/IParameter.d.ts +1 -0
  287. package/dist/types/components/snk-pesquisa/snk-pesquisa.d.ts +8 -0
  288. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +4 -1
  289. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +12 -4
  290. package/dist/types/components.d.ts +113 -0
  291. package/dist/types/lib/http/data-fetcher/fetchers/pesquisa-fetcher.d.ts +1 -0
  292. package/package.json +1 -1
  293. package/react/components.d.ts +1 -0
  294. package/react/components.js +1 -0
  295. package/react/components.js.map +1 -1
  296. package/dist/sankhyablocks/p-0cf9aa38.js +0 -1
  297. package/dist/sankhyablocks/p-11346b8d.entry.js +0 -1
  298. package/dist/sankhyablocks/p-1649f51e.entry.js +0 -1
  299. package/dist/sankhyablocks/p-1d585081.js +0 -1
  300. package/dist/sankhyablocks/p-3ed04f0d.entry.js +0 -1
  301. package/dist/sankhyablocks/p-4759912d.entry.js +0 -1
  302. package/dist/sankhyablocks/p-55798617.js +0 -1
  303. package/dist/sankhyablocks/p-56948f00.entry.js +0 -11
  304. package/dist/sankhyablocks/p-60dd1d27.entry.js +0 -1
  305. package/dist/sankhyablocks/p-626b7a17.js +0 -1
  306. package/dist/sankhyablocks/p-8f73da95.js +0 -1
  307. package/dist/sankhyablocks/p-95c71f5e.entry.js +0 -1
  308. package/dist/sankhyablocks/p-988afe78.js +0 -1
  309. package/dist/sankhyablocks/p-9f2cdaab.entry.js +0 -1
  310. package/dist/sankhyablocks/p-9fe91526.js +0 -1
  311. package/dist/sankhyablocks/p-a5108625.entry.js +0 -1
  312. package/dist/sankhyablocks/p-aae4258d.entry.js +0 -1
  313. package/dist/sankhyablocks/p-af9d79e0.entry.js +0 -1
  314. package/dist/sankhyablocks/p-bb0de89c.entry.js +0 -1
  315. package/dist/sankhyablocks/p-d8d8169b.js +0 -2
  316. package/dist/sankhyablocks/p-e64958ba.entry.js +0 -1
  317. package/dist/sankhyablocks/p-f25c50f7.entry.js +0 -1
  318. package/dist/sankhyablocks/p-f8f29e1a.entry.js +0 -1
@@ -1 +1 @@
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-1788d191.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-7fc46290.js";import"./p-6d241415.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
+ import{r as i,e as t,h as e,F as s,f as n}from"./p-2c9d0870.js";import{StringUtils as l,ObjectUtils as a,ApplicationContext as r,ElementIDUtils as o}from"@sankhyalabs/core";import{P as h}from"./p-68c1a093.js";import{P as d,C as c}from"./p-1f310bc6.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-a73b6b00.js";import"./p-ff1990ad.js";import"./p-7ee6b1bf.js";import"./p-6768f176.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}
@@ -0,0 +1,2 @@
1
+ const e="sankhyablocks",t={allRenderFn:!0,appendChildSlotFix:!1,asyncLoading:!0,asyncQueue:!1,attachStyles:!0,cloneNodeFix:!1,cmpDidLoad:!0,cmpDidRender:!0,cmpDidUnload:!1,cmpDidUpdate:!0,cmpShouldUpdate:!0,cmpWillLoad:!0,cmpWillRender:!0,cmpWillUpdate:!0,connectedCallback:!0,constructableCSS:!0,cssAnnotations:!0,cssVarShim:!1,devTools:!1,disconnectedCallback:!0,dynamicImportShim:!1,element:!1,event:!0,hasRenderFn:!0,hostListener:!0,hostListenerTarget:!0,hostListenerTargetBody:!0,hostListenerTargetDocument:!1,hostListenerTargetParent:!1,hostListenerTargetWindow:!0,hotModuleReplacement:!1,hydrateClientSide:!1,hydrateServerSide:!1,hydratedAttribute:!1,hydratedClass:!0,initializeNextTick:!1,invisiblePrehydration:!1,isDebug:!1,isDev:!1,isTesting:!1,lazyLoad:!0,lifecycle:!0,lifecycleDOMEvents:!1,member:!0,method:!0,mode:!1,observeAttribute:!0,profile:!1,prop:!0,propBoolean:!0,propMutable:!0,propNumber:!0,propString:!0,reflect:!0,safari10:!1,scoped:!0,scopedSlotTextContentFix:!1,scriptDataOpts:!1,shadowDelegatesFocus:!1,shadowDom:!0,shadowDomShim:!1,slot:!0,slotChildNodesFix:!1,slotRelocation:!0,state:!0,style:!0,svg:!1,taskQueue:!0,transformTagName:!1,updatable:!0,vdomAttribute:!0,vdomClass:!0,vdomFunctional:!0,vdomKey:!0,vdomListener:!0,vdomPropOrAttr:!0,vdomRef:!0,vdomRender:!0,vdomStyle:!0,vdomText:!0,vdomXlink:!0,watchCallback:!0};let n,o,s,l,r=0,i=!1,c=!1,a=!1,d=!1,u=null,f=0,p=!1;const m={isDev:!!t.isDev,isBrowser:!0,isServer:!1,isTesting:!!t.isTesting},h={},$=e=>{const t=new URL(e,ht.t);return t.origin!==ut.location.origin?t.href:t.pathname},y=(e,n="")=>{if(t.profile&&performance.mark){const t=`st:${e}:${n}:${r++}`;return performance.mark(t),()=>performance.measure(`[Stencil] ${e}() <${n}>`,t)}return()=>{}},b="s-id",v="sty-id",g="c-id",w="http://www.w3.org/1999/xlink",C={},S=e=>"object"==(e=typeof e)||"function"===e;function k(e){var t,n,o;return null!==(o=null===(n=null===(t=e.head)||void 0===t?void 0:t.querySelector('meta[name="csp-nonce"]'))||void 0===n?void 0:n.getAttribute("content"))&&void 0!==o?o:void 0}const x=(e,n,...o)=>{let s=null,l=null,r=null,i=!1,c=!1;const a=[],d=n=>{for(let o=0;o<n.length;o++)s=n[o],Array.isArray(s)?d(s):null!=s&&"boolean"!=typeof s&&((i="function"!=typeof e&&!S(s))?s+="":t.isDev&&"function"!=typeof e&&void 0===s.o&&st("vNode passed as children has unexpected type.\nMake sure it's using the correct h() function.\nEmpty objects can also be the cause, look for JSX comments that became objects."),i&&c?a[a.length-1].l+=s:a.push(i?T(null,s):s),c=i)};if(d(o),n&&(t.isDev&&"input"===e&&D(n),t.vdomKey&&n.key&&(l=n.key),t.slotRelocation&&n.name&&(r=n.name),t.vdomClass)){const e=n.className||n.class;e&&(n.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}if(t.isDev&&a.some(R)&&st("The <Host> must be the single root component. Make sure:\n- You are NOT using hostData() and <Host> in the same component.\n- <Host> is used once, and it's the single root component of the render() function."),t.vdomFunctional&&"function"==typeof e)return e(null===n?{}:n,a,j);const u=T(e,null);return u.i=n,a.length>0&&(u.u=a),t.vdomKey&&(u.p=l),t.slotRelocation&&(u.m=r),u},T=(e,n)=>{const o={o:0,$:e,l:n,v:null,u:null};return t.vdomAttribute&&(o.i=null),t.vdomKey&&(o.p=null),t.slotRelocation&&(o.m=null),o},L={},R=e=>e&&e.$===L,j={forEach:(e,t)=>e.map(E).forEach(t),map:(e,t)=>e.map(E).map(t).map(O)},E=e=>({vattrs:e.i,vchildren:e.u,vkey:e.p,vname:e.m,vtag:e.$,vtext:e.l}),O=e=>{if("function"==typeof e.vtag){const t=Object.assign({},e.vattrs);return e.vkey&&(t.key=e.vkey),e.vname&&(t.name=e.vname),x(e.vtag,t,...e.vchildren||[])}const t=T(e.vtag,e.vtext);return t.i=e.vattrs,t.u=e.vchildren,t.p=e.vkey,t.m=e.vname,t},D=e=>{const t=Object.keys(e),n=t.indexOf("value");if(-1===n)return;const o=t.indexOf("type"),s=t.indexOf("min"),l=t.indexOf("max"),r=t.indexOf("step");(n<o||n<s||n<l||n<r)&&lt('The "value" prop of <input> should be set after "min", "max", "type" and "step"')},M=(e,n,o,s,l,r,i)=>{let c,a,d,u;if(1===r.nodeType){for(c=r.getAttribute(g),c&&(a=c.split("."),a[0]!==i&&"0"!==a[0]||(d={o:0,g:a[0],C:a[1],S:a[2],k:a[3],$:r.tagName.toLowerCase(),v:r,i:null,u:null,p:null,m:null,l:null},n.push(d),r.removeAttribute(g),e.u||(e.u=[]),e.u[d.k]=d,e=d,s&&"0"===d.S&&(s[d.k]=d.v))),u=r.childNodes.length-1;u>=0;u--)M(e,n,o,s,l,r.childNodes[u],i);if(r.shadowRoot)for(u=r.shadowRoot.childNodes.length-1;u>=0;u--)M(e,n,o,s,l,r.shadowRoot.childNodes[u],i)}else if(8===r.nodeType)a=r.nodeValue.split("."),a[1]!==i&&"0"!==a[1]||(c=a[0],d={o:0,g:a[1],C:a[2],S:a[3],k:a[4],v:r,i:null,u:null,p:null,m:null,$:null,l:null},"t"===c?(d.v=r.nextSibling,d.v&&3===d.v.nodeType&&(d.l=d.v.textContent,n.push(d),r.remove(),e.u||(e.u=[]),e.u[d.k]=d,s&&"0"===d.S&&(s[d.k]=d.v))):d.g===i&&("s"===c?(d.$="slot",r["s-sn"]=a[5]?d.m=a[5]:"",r["s-sr"]=!0,t.shadowDom&&s&&(d.v=pt.createElement(d.$),d.m&&d.v.setAttribute("name",d.m),r.parentNode.insertBefore(d.v,r),r.remove(),"0"===d.S&&(s[d.k]=d.v)),o.push(d),e.u||(e.u=[]),e.u[d.k]=d):"r"===c&&(t.shadowDom&&s?r.remove():t.slotRelocation&&(l["s-cr"]=r,r["s-cn"]=!0))));else if(e&&"style"===e.$){const t=T(null,r.textContent);t.v=r,t.k="0",e.u=[t]}},N=(e,t)=>{if(1===e.nodeType){let n=0;for(;n<e.childNodes.length;n++)N(e.childNodes[n],t);if(e.shadowRoot)for(n=0;n<e.shadowRoot.childNodes.length;n++)N(e.shadowRoot.childNodes[n],t)}else if(8===e.nodeType){const n=e.nodeValue.split(".");"o"===n[0]&&(t.set(n[1]+"."+n[2],e),e.nodeValue="",e["s-en"]=n[3])}},P=e=>dt.map((t=>t(e))).find((e=>!!e)),I=(e,n)=>null==e||S(e)?e:t.propBoolean&&4&n?"false"!==e&&(""===e||!!e):t.propNumber&&2&n?parseFloat(e):t.propString&&1&n?e+"":e,U=e=>t.lazyLoad?Ge(e).T:e,H=(e,n,o)=>{const s=U(e);return{emit:e=>(t.isDev&&!s.isConnected&&lt(`The "${n}" event was emitted, but the dispatcher node is no longer connected to the dom.`),F(s,n,{bubbles:!!(4&o),composed:!!(2&o),cancelable:!!(1&o),detail:e}))}},F=(e,t,n)=>{const o=ht.ce(t,n);return e.dispatchEvent(o),o},W=new WeakMap,A=(e,t,n)=>{let o=at.get(e);bt&&n?(o=o||new CSSStyleSheet,"string"==typeof o?o=t:o.replaceSync(t)):o=t,at.set(e,o)},_=(e,n,o)=>{var s;let l=z(n,o);const r=at.get(l);if(!t.attachStyles)return l;if(e=11===e.nodeType?e:pt,r)if("string"==typeof r){let n,o=W.get(e=e.head||e);if(o||W.set(e,o=new Set),!o.has(l)){if(t.hydrateClientSide&&e.host&&(n=e.querySelector(`[${v}="${l}"]`)))n.innerHTML=r;else{n=pt.createElement("style"),n.innerHTML=r;const o=null!==(s=ht.L)&&void 0!==s?s:k(pt);null!=o&&n.setAttribute("nonce",o),(t.hydrateServerSide||t.hotModuleReplacement)&&n.setAttribute(v,l),e.insertBefore(n,e.querySelector("link"))}o&&o.add(l)}}else t.constructableCSS&&!e.adoptedStyleSheets.includes(r)&&(e.adoptedStyleSheets=[...e.adoptedStyleSheets,r]);return l},V=e=>{const n=e.R,o=e.T,s=n.o,l=y("attachStyles",n.j),r=_(t.shadowDom&&$t&&o.shadowRoot?o.shadowRoot:o.getRootNode(),n,e.O);(t.shadowDom||t.scoped)&&t.cssAnnotations&&10&s&&(o["s-sc"]=r,o.classList.add(r+"-h"),t.scoped&&2&s&&o.classList.add(r+"-s")),l()},z=(e,n)=>"sc-"+(t.mode&&n&&32&e.o?e.j+"-"+n:e.j),B=e=>e.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g,"$1{"),X=(e,n,o,s,l,r)=>{if(o!==s){let i=tt(e,n),c=n.toLowerCase();if(t.vdomClass&&"class"===n){const t=e.classList,n=J(o),l=J(s);t.remove(...n.filter((e=>e&&!l.includes(e)))),t.add(...l.filter((e=>e&&!n.includes(e))))}else if(t.vdomStyle&&"style"===n){if(t.updatable)for(const n in o)s&&null!=s[n]||(!t.hydrateServerSide&&n.includes("-")?e.style.removeProperty(n):e.style[n]="");for(const n in s)o&&s[n]===o[n]||(!t.hydrateServerSide&&n.includes("-")?e.style.setProperty(n,s[n]):e.style[n]=s[n])}else if(t.vdomKey&&"key"===n);else if(t.vdomRef&&"ref"===n)s&&s(e);else if(!t.vdomListener||(t.lazyLoad?i:e.__lookupSetter__(n))||"o"!==n[0]||"n"!==n[1]){if(t.vdomPropOrAttr){const a=S(s);if((i||a&&null!==s)&&!l)try{if(e.tagName.includes("-"))e[n]=s;else{const t=null==s?"":s;"list"===n?i=!1:null!=o&&e[n]==t||(e[n]=t)}}catch(e){}let d=!1;t.vdomXlink&&c!==(c=c.replace(/^xlink\:?/,""))&&(n=c,d=!0),null==s||!1===s?!1===s&&""!==e.getAttribute(n)||(t.vdomXlink&&d?e.removeAttributeNS(w,n):e.removeAttribute(n)):(!i||4&r||l)&&!a&&(s=!0===s?"":s,t.vdomXlink&&d?e.setAttributeNS(w,n,s):e.setAttribute(n,s))}}else n="-"===n[2]?n.slice(3):tt(ut,c)?c.slice(2):c[2]+n.slice(3),o&&ht.rel(e,n,o,!1),s&&ht.ael(e,n,s,!1)}},q=/\s/,J=e=>e?e.split(q):[],Q=(e,n,o,s)=>{const l=11===n.v.nodeType&&n.v.host?n.v.host:n.v,r=e&&e.i||C,i=n.i||C;if(t.updatable)for(s in r)s in i||X(l,s,r[s],void 0,o,n.o);for(s in i)X(l,s,r[s],i[s],o,n.o)},Y=(e,l,r,c)=>{const u=l.u[r];let f,p,m,h=0;if(t.slotRelocation&&!i&&(a=!0,"slot"===u.$&&(n&&c.classList.add(n+"-s"),u.o|=u.u?2:1)),t.isDev&&u.v&&st(`The JSX ${null!==u.l?`"${u.l}" text`:`"${u.$}" element`} node should not be shared within the same renderer. The renderer caches element lookups in order to improve performance. However, a side effect from this is that the exact same JSX node should not be reused. For more information please see https://stenciljs.com/docs/templating-jsx#avoid-shared-jsx-nodes`),t.vdomText&&null!==u.l)f=u.v=pt.createTextNode(u.l);else if(t.slotRelocation&&1&u.o)f=u.v=t.isDebug||t.hydrateServerSide?de(u):pt.createTextNode("");else{if(t.svg&&!d&&(d="svg"===u.$),f=u.v=t.svg?pt.createElementNS(d?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",t.slotRelocation&&2&u.o?"slot-fb":u.$):pt.createElement(t.slotRelocation&&2&u.o?"slot-fb":u.$),t.svg&&d&&"foreignObject"===u.$&&(d=!1),t.vdomAttribute&&Q(null,u,d),(t.shadowDom||t.scoped)&&null!=n&&f["s-si"]!==n&&f.classList.add(f["s-si"]=n),u.u)for(h=0;h<u.u.length;++h)p=Y(e,u,h,f),p&&f.appendChild(p);t.svg&&("svg"===u.$?d=!1:"foreignObject"===f.tagName&&(d=!0))}return t.slotRelocation&&(f["s-hn"]=s,3&u.o&&(f["s-sr"]=!0,f["s-cr"]=o,f["s-sn"]=u.m||"",m=e&&e.u&&e.u[r],m&&m.$===u.$&&e.v&&K(e.v,!1))),f},K=(e,t)=>{ht.o|=1;const n=e.childNodes;for(let e=n.length-1;e>=0;e--){const o=n[e];o["s-hn"]!==s&&o["s-ol"]&&(ne(o).insertBefore(o,te(o)),o["s-ol"].remove(),o["s-ol"]=void 0,a=!0),t&&K(o,t)}ht.o&=-2},G=(e,n,o,l,r,i)=>{let c,a=t.slotRelocation&&e["s-cr"]&&e["s-cr"].parentNode||e;for(t.shadowDom&&a.shadowRoot&&a.tagName===s&&(a=a.shadowRoot);r<=i;++r)l[r]&&(c=Y(null,o,r,e),c&&(l[r].v=c,a.insertBefore(c,t.slotRelocation?te(n):n)))},Z=(e,n,o,s,l)=>{for(;n<=o;++n)(s=e[n])&&(l=s.v,ce(s),t.slotRelocation&&(c=!0,l["s-ol"]?l["s-ol"].remove():K(l,!0)),l.remove())},ee=(e,n)=>e.$===n.$&&(t.slotRelocation&&"slot"===e.$?e.m===n.m:!t.vdomKey||e.p===n.p),te=e=>e&&e["s-ol"]||e,ne=e=>(e["s-ol"]?e["s-ol"]:e).parentNode,oe=(e,n)=>{const o=n.v=e.v,s=e.u,l=n.u,r=n.$,i=n.l;let c;t.vdomText&&null!==i?t.vdomText&&t.slotRelocation&&(c=o["s-cr"])?c.parentNode.textContent=i:t.vdomText&&e.l!==i&&(o.data=i):(t.svg&&(d="svg"===r||"foreignObject"!==r&&d),(t.vdomAttribute||t.reflect)&&(t.slot&&"slot"===r||Q(e,n,d)),t.updatable&&null!==s&&null!==l?((e,n,o,s)=>{let l,r,i=0,c=0,a=0,d=0,u=n.length-1,f=n[0],p=n[u],m=s.length-1,h=s[0],$=s[m];for(;i<=u&&c<=m;)if(null==f)f=n[++i];else if(null==p)p=n[--u];else if(null==h)h=s[++c];else if(null==$)$=s[--m];else if(ee(f,h))oe(f,h),f=n[++i],h=s[++c];else if(ee(p,$))oe(p,$),p=n[--u],$=s[--m];else if(ee(f,$))!t.slotRelocation||"slot"!==f.$&&"slot"!==$.$||K(f.v.parentNode,!1),oe(f,$),e.insertBefore(f.v,p.v.nextSibling),f=n[++i],$=s[--m];else if(ee(p,h))!t.slotRelocation||"slot"!==f.$&&"slot"!==$.$||K(p.v.parentNode,!1),oe(p,h),e.insertBefore(p.v,f.v),p=n[--u],h=s[++c];else{if(a=-1,t.vdomKey)for(d=i;d<=u;++d)if(n[d]&&null!==n[d].p&&n[d].p===h.p){a=d;break}t.vdomKey&&a>=0?(r=n[a],r.$!==h.$?l=Y(n&&n[c],o,a,e):(oe(r,h),n[a]=void 0,l=r.v),h=s[++c]):(l=Y(n&&n[c],o,c,e),h=s[++c]),l&&(t.slotRelocation?ne(f.v).insertBefore(l,te(f.v)):f.v.parentNode.insertBefore(l,f.v))}i>u?G(e,null==s[m+1]?null:s[m+1].v,o,s,c,m):t.updatable&&c>m&&Z(n,i,u)})(o,s,n,l):null!==l?(t.updatable&&t.vdomText&&null!==e.l&&(o.textContent=""),G(o,null,n,l,0,l.length-1)):t.updatable&&null!==s&&Z(s,0,s.length-1),t.svg&&d&&"svg"===r&&(d=!1))},se=e=>{const t=e.childNodes;let n,o,s,l,r,i;for(o=0,s=t.length;o<s;o++)if(n=t[o],1===n.nodeType){if(n["s-sr"])for(r=n["s-sn"],n.hidden=!1,l=0;l<s;l++)if(i=t[l].nodeType,t[l]["s-hn"]!==n["s-hn"]||""!==r){if(1===i&&r===t[l].getAttribute("slot")){n.hidden=!0;break}}else if(1===i||3===i&&""!==t[l].textContent.trim()){n.hidden=!0;break}se(n)}},le=[],re=e=>{let t,n,o,s,l,r,i=0;const a=e.childNodes,d=a.length;for(;i<d;i++){if(t=a[i],t["s-sr"]&&(n=t["s-cr"])&&n.parentNode)for(o=n.parentNode.childNodes,s=t["s-sn"],r=o.length-1;r>=0;r--)n=o[r],n["s-cn"]||n["s-nr"]||n["s-hn"]===t["s-hn"]||(ie(n,s)?(l=le.find((e=>e.D===n)),c=!0,n["s-sn"]=n["s-sn"]||s,l?l.M=t:le.push({M:t,D:n}),n["s-sr"]&&le.map((e=>{ie(e.D,n["s-sn"])&&(l=le.find((e=>e.D===n)),l&&!e.M&&(e.M=l.M))}))):le.some((e=>e.D===n))||le.push({D:n}));1===t.nodeType&&re(t)}},ie=(e,t)=>1===e.nodeType?null===e.getAttribute("slot")&&""===t||e.getAttribute("slot")===t:e["s-sn"]===t||""===t,ce=e=>{t.vdomRef&&(e.i&&e.i.ref&&e.i.ref(null),e.u&&e.u.map(ce))},ae=(e,l)=>{const r=e.T,d=e.R,u=e.N||T(null,null),f=R(l)?l:x(null,null,l);if(s=r.tagName,t.isDev&&Array.isArray(l)&&l.some(R))throw Error(`The <Host> must be the single root component.\nLooks like the render() function of "${s.toLowerCase()}" is returning an array that contains the <Host>.\n\nThe render() function should look like this instead:\n\nrender() {\n // Do not return an array\n return (\n <Host>{content}</Host>\n );\n}\n `);if(t.reflect&&d.P&&(f.i=f.i||{},d.P.map((([e,t])=>f.i[t]=r[e]))),f.$=null,f.o|=4,e.N=f,f.v=u.v=t.shadowDom&&r.shadowRoot||r,(t.scoped||t.shadowDom)&&(n=r["s-sc"]),t.slotRelocation&&(o=r["s-cr"],i=$t&&0!=(1&d.o),c=!1),oe(u,f),t.slotRelocation){if(ht.o|=1,a){let e,n,o,s,l,r;re(f.v);let i=0;for(;i<le.length;i++)e=le[i],n=e.D,n["s-ol"]||(o=t.isDebug||t.hydrateServerSide?ue(n):pt.createTextNode(""),o["s-nr"]=n,n.parentNode.insertBefore(n["s-ol"]=o,n));for(i=0;i<le.length;i++)if(e=le[i],n=e.D,e.M){for(s=e.M.parentNode,l=e.M.nextSibling,o=n["s-ol"];o=o.previousSibling;)if(r=o["s-nr"],r&&r["s-sn"]===n["s-sn"]&&s===r.parentNode&&(r=r.nextSibling,!r||!r["s-nr"])){l=r;break}(!l&&s!==n.parentNode||n.nextSibling!==l)&&n!==l&&(!n["s-hn"]&&n["s-ol"]&&(n["s-hn"]=n["s-ol"].parentNode.nodeName),s.insertBefore(n,l))}else 1===n.nodeType&&(n.hidden=!0)}c&&se(f.v),ht.o&=-2,le.length=0}},de=e=>pt.createComment(`<slot${e.m?' name="'+e.m+'"':""}> (host=${s.toLowerCase()})`),ue=e=>pt.createComment("org-location for "+(e.localName?`<${e.localName}> (host=${e["s-hn"]})`:`[${e.textContent}]`)),fe=(e,n)=>{t.asyncLoading&&n&&!e.I&&n["s-p"]&&n["s-p"].push(new Promise((t=>e.I=t)))},pe=(e,n)=>{if(t.taskQueue&&t.updatable&&(e.o|=16),t.asyncLoading&&4&e.o)return void(e.o|=512);fe(e,e.U);const o=()=>me(e,n);return t.taskQueue?Rt(o):o()},me=(e,n)=>{const o=e.T,s=y("scheduleUpdate",e.R.j),l=t.lazyLoad?e.F:o;let r;return n?(t.lazyLoad&&t.hostListener&&(e.o|=256,e.W&&(e.W.map((([e,t])=>ge(l,e,t))),e.W=null)),Ce(o,"componentWillLoad"),t.cmpWillLoad&&(r=ge(l,"componentWillLoad"))):(Ce(o,"componentWillUpdate"),t.cmpWillUpdate&&(r=ge(l,"componentWillUpdate"))),Ce(o,"componentWillRender"),t.cmpWillRender&&(r=we(r,(()=>ge(l,"componentWillRender")))),s(),we(r,(()=>he(e,l,n)))},he=async(e,n,o)=>{const s=e.T,l=y("update",e.R.j),r=s["s-rc"];t.style&&o&&V(e);const i=y("render",e.R.j);if(t.isDev&&(e.o|=1024),t.hydrateServerSide?await $e(e,n,s):$e(e,n,s),t.isDev&&(e.A++,e.o&=-1025),t.hydrateServerSide)try{ke(s),o&&(1&e.R.o?s["s-en"]="":2&e.R.o&&(s["s-en"]="c"))}catch(e){nt(e,s)}if(t.asyncLoading&&r&&(r.map((e=>e())),s["s-rc"]=void 0),i(),l(),t.asyncLoading){const t=s["s-p"],n=()=>ye(e);0===t.length?n():(Promise.all(t).then(n),e.o|=4,t.length=0)}else ye(e)},$e=(e,n,o)=>{const s=!!t.allRenderFn,l=!!t.lazyLoad,r=!!t.taskQueue,i=!!t.updatable;try{if(u=n,n=(s||n.render)&&n.render(),i&&r&&(e.o&=-17),(i||l)&&(e.o|=2),t.hasRenderFn||t.reflect)if(t.vdomRender||t.reflect){if(t.hydrateServerSide)return Promise.resolve(n).then((t=>ae(e,t)));ae(e,n)}else o.textContent=n}catch(t){nt(t,e.T)}return u=null,null},ye=e=>{const n=e.R.j,o=e.T,s=y("postUpdate",n),l=t.lazyLoad?e.F:o,r=e.U;t.cmpDidRender&&(t.isDev&&(e.o|=1024),ge(l,"componentDidRender"),t.isDev&&(e.o&=-1025)),Ce(o,"componentDidRender"),64&e.o?(t.cmpDidUpdate&&(t.isDev&&(e.o|=1024),ge(l,"componentDidUpdate"),t.isDev&&(e.o&=-1025)),Ce(o,"componentDidUpdate"),s()):(e.o|=64,t.asyncLoading&&t.cssAnnotations&&Se(o),t.cmpDidLoad&&(t.isDev&&(e.o|=2048),ge(l,"componentDidLoad"),t.isDev&&(e.o&=-2049)),Ce(o,"componentDidLoad"),s(),t.asyncLoading&&(e._(o),r||ve(n))),t.hotModuleReplacement&&o["s-hmr-load"]&&o["s-hmr-load"](),t.method&&t.lazyLoad&&e.V(o),t.asyncLoading&&(e.I&&(e.I(),e.I=void 0),512&e.o&&Tt((()=>pe(e,!1))),e.o&=-517)},be=e=>{if(t.updatable){const t=Ge(e),n=t.T.isConnected;return n&&2==(18&t.o)&&pe(t,!1),n}return!1},ve=n=>{t.cssAnnotations&&Se(pt.documentElement),t.asyncQueue&&(ht.o|=2),Tt((()=>F(ut,"appload",{detail:{namespace:e}}))),t.profile&&performance.measure&&performance.measure(`[Stencil] ${e} initial load (by ${n})`,"st:app:start")},ge=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){nt(e)}},we=(e,t)=>e&&e.then?e.then(t):t(),Ce=(n,o)=>{t.lifecycleDOMEvents&&F(n,"stencil_"+o,{bubbles:!0,composed:!0,detail:{namespace:e}})},Se=e=>t.hydratedClass?e.classList.add("hydrated"):t.hydratedAttribute?e.setAttribute("hydrated",""):void 0,ke=e=>{const t=e.children;if(null!=t)for(let e=0,n=t.length;e<n;e++){const n=t[e];"function"==typeof n.connectedCallback&&n.connectedCallback(),ke(n)}},xe=(e,t)=>Ge(e).B.get(t),Te=(e,n,o,s)=>{const l=Ge(e),r=t.lazyLoad?l.T:e,i=l.B.get(n),c=l.o,a=t.lazyLoad?l.F:r;if(o=I(o,s.X[n][0]),(!t.lazyLoad||!(8&c)||void 0===i)&&o!==i&&(!Number.isNaN(i)||!Number.isNaN(o))&&(l.B.set(n,o),t.isDev&&(1024&l.o?lt(`The state/prop "${n}" changed during rendering. This can potentially lead to infinite-loops and other bugs.`,"\nElement",r,"\nNew value",o,"\nOld value",i):2048&l.o&&lt(`The state/prop "${n}" changed during "componentDidLoad()", this triggers extra re-renders, try to setup on "componentWillLoad()"`,"\nElement",r,"\nNew value",o,"\nOld value",i)),!t.lazyLoad||a)){if(t.watchCallback&&s.q&&128&c){const e=s.q[n];e&&e.map((e=>{try{a[e](o,i,n)}catch(e){nt(e,r)}}))}if(t.updatable&&2==(18&c)){if(t.cmpShouldUpdate&&a.componentShouldUpdate&&!1===a.componentShouldUpdate(o,i,n))return;pe(l,!1)}}},Le=(e,n,o)=>{if(t.member&&n.X){t.watchCallback&&e.watchers&&(n.q=e.watchers);const s=Object.entries(n.X),l=e.prototype;if(s.map((([e,[s]])=>{(t.prop||t.state)&&(31&s||(!t.lazyLoad||2&o)&&32&s)?Object.defineProperty(l,e,{get(){return xe(this,e)},set(l){t.isDev&&0==(1&o)&&0==(8&Ge(this).o)&&0!=(31&s)&&0==(1024&s)&&lt(`@Prop() "${e}" on <${n.j}> is immutable but was modified from within the component.\nMore information: https://stenciljs.com/docs/properties#prop-mutability`),Te(this,e,l,n)},configurable:!0,enumerable:!0}):t.lazyLoad&&t.method&&1&o&&64&s&&Object.defineProperty(l,e,{value(...t){const n=Ge(this);return n.J.then((()=>n.F[e](...t)))}})})),t.observeAttribute&&(!t.lazyLoad||1&o)){const o=new Map;l.attributeChangedCallback=function(e,t,n){ht.jmp((()=>{const t=o.get(e);if(this.hasOwnProperty(t))n=this[t],delete this[t];else if(l.hasOwnProperty(t)&&"number"==typeof this[t]&&this[t]==n)return;this[t]=(null!==n||"boolean"!=typeof this[t])&&n}))},e.observedAttributes=s.filter((([e,t])=>15&t[0])).map((([e,s])=>{const l=s[1]||e;return o.set(l,e),t.reflect&&512&s[0]&&n.P.push([e,l]),l}))}}return e},Re=async(e,n,o,s,l)=>{if((t.lazyLoad||t.hydrateServerSide||t.style)&&0==(32&n.o)){if(t.lazyLoad||t.hydrateClientSide){if(n.o|=32,(l=ct(o,n,s)).then){const e=((e,n)=>t.profile&&performance.mark?(0===performance.getEntriesByName(e,"mark").length&&performance.mark(e),()=>{0===performance.getEntriesByName(n,"measure").length&&performance.measure(n,e)}):()=>{})(`st:load:${o.j}:${n.O}`,`[Stencil] Load module for <${o.j}>`);l=await l,e()}if((t.isDev||t.isDebug)&&!l)throw Error(`Constructor for "${o.j}#${n.O}" was not found`);t.member&&!l.isProxied&&(t.watchCallback&&(o.q=l.watchers),Le(l,o,2),l.isProxied=!0);const e=y("createInstance",o.j);t.member&&(n.o|=8);try{new l(n)}catch(e){nt(e)}t.member&&(n.o&=-9),t.watchCallback&&(n.o|=128),e(),je(n.F)}else l=e.constructor,n.o|=32,customElements.whenDefined(o.j).then((()=>n.o|=128));if(t.style&&l.style){let s=l.style;t.mode&&"string"!=typeof s&&(s=s[n.O=P(e)],t.hydrateServerSide&&n.O&&e.setAttribute("s-mode",n.O));const r=z(o,n.O);if(!at.has(r)){const e=y("registerStyles",o.j);!t.hydrateServerSide&&t.shadowDom&&t.shadowDomShim&&8&o.o&&(s=await import("./p-da455c82.js").then((e=>e.scopeCss(s,r,!1)))),A(r,s,!!(1&o.o)),e()}}}const r=n.U,i=()=>pe(n,!0);t.asyncLoading&&r&&r["s-rc"]?r["s-rc"].push(i):i()},je=e=>{t.lazyLoad&&t.connectedCallback&&ge(e,"connectedCallback")},Ee=e=>{if(0==(1&ht.o)){const n=Ge(e),o=n.R,s=y("connectedCallback",o.j);if(t.hostListenerTargetParent&&Ve(e,n,o.Y,!0),1&n.o)Ve(e,n,o.Y,!1),je(n.F);else{let s;if(n.o|=1,t.hydrateClientSide&&(s=e.getAttribute(b),s)){if(t.shadowDom&&$t&&1&o.o){const n=t.mode?_(e.shadowRoot,o,e.getAttribute("s-mode")):_(e.shadowRoot,o);e.classList.remove(n+"-h",n+"-s")}((e,n,o,s)=>{const l=y("hydrateClient",n),r=e.shadowRoot,i=[],c=t.shadowDom&&r?[]:null,a=s.N=T(n,null);ht.K||N(pt.body,ht.K=new Map),e[b]=o,e.removeAttribute(b),M(a,i,[],c,e,e,o),i.map((e=>{const t=e.g+"."+e.C,o=ht.K.get(t),s=e.v;o&&$t&&""===o["s-en"]&&o.parentNode.insertBefore(s,o.nextSibling),r||(s["s-hn"]=n,o&&(s["s-ol"]=o,s["s-ol"]["s-nr"]=s)),ht.K.delete(t)})),t.shadowDom&&r&&c.map((e=>{e&&r.appendChild(e)})),l()})(e,o.j,s,n)}if(t.slotRelocation&&!s&&(t.hydrateServerSide||(t.slot||t.shadowDom)&&12&o.o)&&Oe(e),t.asyncLoading){let o=e;for(;o=o.parentNode||o.host;)if(t.hydrateClientSide&&1===o.nodeType&&o.hasAttribute("s-id")&&o["s-p"]||o["s-p"]){fe(n,n.U=o);break}}t.prop&&!t.hydrateServerSide&&o.X&&Object.entries(o.X).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),t.initializeNextTick?Tt((()=>Re(e,n,o))):Re(e,n,o)}s()}},Oe=e=>{const n=e["s-cr"]=pt.createComment(t.isDebug?`content-ref (host=${e.localName})`:"");n["s-cn"]=!0,e.insertBefore(n,e.firstChild)},De=e=>{if(0==(1&ht.o)){const n=Ge(e),o=t.lazyLoad?n.F:e;t.hostListener&&n.G&&(n.G.map((e=>e())),n.G=void 0),t.lazyLoad&&t.disconnectedCallback&&ge(o,"disconnectedCallback"),t.cmpDidUnload&&ge(o,"componentDidUnload")}},Me=(e,n)=>{const o={o:n[0],j:n[1]};t.member&&(o.X=n[2]),t.hostListener&&(o.Y=n[3]),t.watchCallback&&(o.q=e.q),t.reflect&&(o.P=[]),t.shadowDom&&!$t&&1&o.o&&(o.o|=8);const s=e.prototype.connectedCallback,l=e.prototype.disconnectedCallback;return Object.assign(e.prototype,{__registerHost(){et(this,o)},connectedCallback(){Ee(this),t.connectedCallback&&s&&s.call(this)},disconnectedCallback(){De(this),t.disconnectedCallback&&l&&l.call(this)},__attachShadow(){$t?this.attachShadow(t.shadowDelegatesFocus?{mode:"open",delegatesFocus:!!(16&o.o)}:{mode:"open"}):this.shadowRoot=this}}),e.is=o.j,Le(e,o,3)},Ne=e=>{const n=e.cloneNode;e.cloneNode=function(e){const o=this,s=!!t.shadowDom&&o.shadowRoot&&$t,l=n.call(o,!!s&&e);if(t.slot&&!s&&e){let e,n,s=0;const r=["s-id","s-cr","s-lr","s-rc","s-sc","s-p","s-cn","s-sr","s-sn","s-hn","s-ol","s-nr","s-si"];for(;s<o.childNodes.length;s++)e=o.childNodes[s]["s-nr"],n=r.every((e=>!o.childNodes[s][e])),e&&(t.appendChildSlotFix&&l.__appendChild?l.__appendChild(e.cloneNode(!0)):l.appendChild(e.cloneNode(!0))),n&&l.appendChild(o.childNodes[s].cloneNode(!0))}return l}},Pe=e=>{e.__appendChild=e.appendChild,e.appendChild=function(e){const t=e["s-sn"]=He(e),n=Fe(this.childNodes,t);if(n){const o=We(n,t),s=o[o.length-1];return s.parentNode.insertBefore(e,s.nextSibling)}return this.__appendChild(e)}},Ie=(e,n)=>{if(t.scoped&&2&n.o){const t=Object.getOwnPropertyDescriptor(Node.prototype,"textContent");Object.defineProperty(e,"__textContent",t),Object.defineProperty(e,"textContent",{get(){var e;const t=Fe(this.childNodes,"");return 3===(null===(e=null==t?void 0:t.nextSibling)||void 0===e?void 0:e.nodeType)?t.nextSibling.textContent:t?t.textContent:this.__textContent},set(e){var t;const n=Fe(this.childNodes,"");if(3===(null===(t=null==n?void 0:n.nextSibling)||void 0===t?void 0:t.nodeType))n.nextSibling.textContent=e;else if(n)n.textContent=e;else{this.__textContent=e;const t=this["s-cr"];t&&this.insertBefore(t,this.firstChild)}}})}},Ue=(e,t)=>{class n extends Array{item(e){return this[e]}}if(8&t.o){const t=e.__lookupGetter__("childNodes");Object.defineProperty(e,"children",{get(){return this.childNodes.map((e=>1===e.nodeType))}}),Object.defineProperty(e,"childElementCount",{get:()=>e.children.length}),Object.defineProperty(e,"childNodes",{get(){const e=t.call(this);if(0==(1&ht.o)&&2&Ge(this).o){const t=new n;for(let n=0;n<e.length;n++){const o=e[n]["s-nr"];o&&t.push(o)}return t}return n.from(e)}})}},He=e=>e["s-sn"]||1===e.nodeType&&e.getAttribute("slot")||"",Fe=(e,t)=>{let n,o=0;for(;o<e.length;o++){if(n=e[o],n["s-sr"]&&n["s-sn"]===t)return n;if(n=Fe(n.childNodes,t),n)return n}return null},We=(e,t)=>{const n=[e];for(;(e=e.nextSibling)&&e["s-sn"]===t;)n.push(e);return n},Ae=(e,n={})=>{var o;t.profile&&performance.mark&&performance.mark("st:app:start"),(()=>{if(t.devTools){const e=ut.stencil=ut.stencil||{},t=e.inspect;e.inspect=e=>{let n=(e=>{const t=Ge(e);if(!t)return;const n=t.o,o=t.T;return{renderCount:t.A,flags:{hasRendered:!!(2&n),hasConnected:!!(1&n),isWaitingForChildren:!!(4&n),isConstructingInstance:!!(8&n),isQueuedForUpdate:!!(16&n),hasInitializedComponent:!!(32&n),hasLoadedComponent:!!(64&n),isWatchReady:!!(128&n),isListenReady:!!(256&n),needsRerender:!!(512&n)},instanceValues:t.B,ancestorComponent:t.U,hostElement:o,lazyInstance:t.F,vnode:t.N,modeName:t.O,onReadyPromise:t.Z,onReadyResolve:t._,onInstancePromise:t.J,onInstanceResolve:t.V,onRenderResolve:t.I,queuedListeners:t.W,rmListeners:t.G,"s-id":o["s-id"],"s-cr":o["s-cr"],"s-lr":o["s-lr"],"s-p":o["s-p"],"s-rc":o["s-rc"],"s-sc":o["s-sc"]}})(e);return n||"function"!=typeof t||(n=t(e)),n}}})();const s=y("bootstrapLazy"),l=[],r=n.exclude||[],i=ut.customElements,c=pt.head,a=c.querySelector("meta[charset]"),d=pt.createElement("style"),u=[],f=pt.querySelectorAll(`[${v}]`);let p,m=!0,h=0;if(Object.assign(ht,n),ht.t=new URL(n.resourcesUrl||"./",pt.baseURI).href,t.asyncQueue&&n.syncQueue&&(ht.o|=4),t.hydrateClientSide&&(ht.o|=2),t.hydrateClientSide&&t.shadowDom)for(;h<f.length;h++)A(f[h].getAttribute(v),B(f[h].innerHTML),!0);if(e.map((e=>{e[1].map((o=>{const s={o:o[0],j:o[1],X:o[2],Y:o[3]};t.member&&(s.X=o[2]),t.hostListener&&(s.Y=o[3]),t.reflect&&(s.P=[]),t.watchCallback&&(s.q={}),t.shadowDom&&!$t&&1&s.o&&(s.o|=8);const c=t.transformTagName&&n.transformTagName?n.transformTagName(s.j):s.j,a=class extends HTMLElement{constructor(e){super(e),et(e=this,s),t.shadowDom&&1&s.o&&($t?e.attachShadow(t.shadowDelegatesFocus?{mode:"open",delegatesFocus:!!(16&s.o)}:{mode:"open"}):t.hydrateServerSide||"shadowRoot"in e||(e.shadowRoot=e)),t.slotChildNodesFix&&Ue(e,s)}connectedCallback(){p&&(clearTimeout(p),p=null),m?u.push(this):ht.jmp((()=>Ee(this)))}disconnectedCallback(){ht.jmp((()=>De(this)))}componentOnReady(){return Ge(this).Z}};t.cloneNodeFix&&Ne(a.prototype),t.appendChildSlotFix&&Pe(a.prototype),t.hotModuleReplacement&&(a.prototype["s-hmr"]=function(e){((e,t,n)=>{const o=Ge(e);o.o=1,e["s-hmr-load"]=()=>{delete e["s-hmr-load"]},Re(e,o,t,n)})(this,s,e)}),t.scopedSlotTextContentFix&&Ie(a.prototype,s),s.ee=e[0],r.includes(c)||i.get(c)||(l.push(c),i.define(c,Le(a,s,1)))}))})),t.invisiblePrehydration&&(t.hydratedClass||t.hydratedAttribute)){d.innerHTML=l+"{visibility:hidden}.hydrated{visibility:inherit}",d.setAttribute("data-styles","");const e=null!==(o=ht.L)&&void 0!==o?o:k(pt);null!=e&&d.setAttribute("nonce",e),c.insertBefore(d,a?a.nextSibling:c.firstChild)}m=!1,u.length?u.map((e=>e.connectedCallback())):ht.jmp(t.profile?()=>p=setTimeout(ve,30,"timeout"):()=>p=setTimeout(ve,30)),s()},_e=(e,t)=>t,Ve=(e,n,o,s)=>{t.hostListener&&o&&(t.hostListenerTargetParent&&(o=o.filter(s?([e])=>32&e:([e])=>!(32&e))),o.map((([o,s,l])=>{const r=t.hostListenerTarget?Be(e,o):e,i=ze(n,l),c=Xe(o);ht.ael(r,s,i,c),(n.G=n.G||[]).push((()=>ht.rel(r,s,i,c)))})))},ze=(e,n)=>o=>{try{t.lazyLoad?256&e.o?e.F[n](o):(e.W=e.W||[]).push([n,o]):e.T[n](o)}catch(e){nt(e)}},Be=(e,n)=>t.hostListenerTargetDocument&&4&n?pt:t.hostListenerTargetWindow&&8&n?ut:t.hostListenerTargetBody&&16&n?pt.body:t.hostListenerTargetParent&&32&n?e.parentElement:e,Xe=e=>({passive:0!=(1&e),capture:0!=(2&e)}),qe=e=>ht.L=e,Je=(e,t,n,o)=>{null!=t&&(null!=t["s-nr"]&&o.push(t),1===t.nodeType&&t.childNodes.forEach((t=>{const s=Ge(t);null==s||n.staticComponents.has(t.nodeName.toLowerCase())||Qe(e,t,s.N,n,{nodeIds:0}),Je(e,t,n,o)})))},Qe=(e,t,n,o,s)=>{if(null!=n){const l=++o.hostIds;if(t.setAttribute(b,l),null!=t["s-cr"]&&(t["s-cr"].nodeValue="r."+l),null!=n.u){const t=0;n.u.forEach(((n,o)=>{Ye(e,n,s,l,t,o)}))}if(t&&n&&n.v&&!t.hasAttribute("c-id")){const e=t.parentElement;if(e&&e.childNodes){const o=Array.from(e.childNodes),s=o.find((e=>8===e.nodeType&&e["s-sr"]));if(s){const e=o.indexOf(t)-1;n.v.setAttribute(g,`${s["s-host-id"]}.${s["s-node-id"]}.0.${e}`)}}}}},Ye=(e,t,n,o,s,l)=>{const r=t.v;if(null==r)return;const i=n.nodeIds++,c=`${o}.${i}.${s}.${l}`;if(r["s-host-id"]=o,r["s-node-id"]=i,1===r.nodeType)r.setAttribute(g,c);else if(3===r.nodeType){const t=r.parentNode,n=t.nodeName;if("STYLE"!==n&&"SCRIPT"!==n){const n=e.createComment("t."+c);t.insertBefore(n,r)}}else 8===r.nodeType&&r["s-sr"]&&(r.nodeValue=`s.${c}.${r["s-sn"]||""}`);if(null!=t.u){const l=s+1;t.u.forEach(((t,s)=>{Ye(e,t,n,o,l,s)}))}},Ke=new WeakMap,Ge=e=>Ke.get(e),Ze=(e,t)=>Ke.set(t.F=e,t),et=(e,n)=>{const o={o:0,T:e,R:n,B:new Map};return t.isDev&&(o.A=0),t.method&&t.lazyLoad&&(o.J=new Promise((e=>o.V=e))),t.asyncLoading&&(o.Z=new Promise((e=>o._=e)),e["s-p"]=[],e["s-rc"]=[]),Ve(e,o,n.Y,!1),Ke.set(e,o)},tt=(e,t)=>t in e,nt=(e,t)=>(l||console.error)(e,t),ot=t.isTesting?["STENCIL:"]:["%cstencil","color: white;background:#4c47ff;font-weight: bold; font-size:10px; padding:2px 6px; border-radius: 5px"],st=(...e)=>console.error(...ot,...e),lt=(...e)=>console.warn(...ot,...e),rt=(...e)=>console.info(...ot,...e),it=new Map,ct=(e,n,o)=>{const s=e.j.replace(/-/g,"_"),l=e.ee;if(t.isDev&&"string"!=typeof l)return void st(`Trying to lazily load component <${e.j}> with style mode "${n.O}", but it does not exist.`);const r=!t.hotModuleReplacement&&it.get(l);return r?r[s]:import(`./${l}.entry.js${t.hotModuleReplacement&&o?"?s-hmr="+o:""}`).then((e=>(t.hotModuleReplacement||it.set(l,e),e[s])),nt)
2
+ /*!__STENCIL_STATIC_IMPORT_SWITCH__*/},at=new Map,dt=[],ut="undefined"!=typeof window?window:{},ft=t.cssVarShim?ut.CSS:null,pt=ut.document||{head:{}},mt=ut.HTMLElement||class{},ht={o:0,t:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,o)=>e.addEventListener(t,n,o),rel:(e,t,n,o)=>e.removeEventListener(t,n,o),ce:(e,t)=>new CustomEvent(e,t)},$t=!t.shadowDomShim||!t.shadowDom||(()=>(pt.head.attachShadow+"").indexOf("[native")>-1)(),yt=e=>Promise.resolve(e),bt=!!t.constructableCSS&&(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),vt=[],gt=[],wt=[],Ct=(e,t)=>n=>{e.push(n),p||(p=!0,t&&4&ht.o?Tt(xt):ht.raf(xt))},St=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){nt(e)}e.length=0},kt=(e,t)=>{let n=0,o=0;for(;n<e.length&&(o=performance.now())<t;)try{e[n++](o)}catch(e){nt(e)}n===e.length?e.length=0:0!==n&&e.splice(0,n)},xt=()=>{if(t.asyncQueue&&f++,St(vt),t.asyncQueue){const e=2==(6&ht.o)?performance.now()+14*Math.ceil(.1*f):1/0;kt(gt,e),kt(wt,e),gt.length>0&&(wt.push(...gt),gt.length=0),(p=vt.length+gt.length+wt.length>0)?ht.raf(xt):f=0}else St(gt),(p=vt.length>0)&&ht.raf(xt)},Tt=e=>yt().then(e),Lt=Ct(vt,!1),Rt=Ct(gt,!0),jt=Object.freeze({__proto__:null,Build:m,CSS:ft,Context:h,Fragment:_e,H:mt,HTMLElement:mt,Host:L,STENCIL_DEV_MODE:ot,addHostEventListeners:Ve,bootstrapLazy:Ae,cmpModules:it,connectedCallback:Ee,consoleDevError:st,consoleDevInfo:rt,consoleDevWarn:lt,consoleError:nt,createEvent:H,defineCustomElement:(e,t)=>{customElements.define(t[1],Me(e,t))},disconnectedCallback:De,doc:pt,forceModeUpdate:e=>{if(t.style&&t.mode&&!t.lazyLoad){const t=P(e),n=Ge(e);if(n.O!==t){const o=n.R,s=e["s-sc"],l=z(o,t),r=e.constructor.style[t],i=o.o;r&&(at.has(l)||A(l,r,!!(1&i)),n.O=t,e.classList.remove(s+"-h",s+"-s"),V(n),be(e))}}},forceUpdate:be,getAssetPath:$,getConnect:(e,t)=>{const n=()=>{let e=pt.querySelector(t);return e||(e=pt.createElement(t),pt.body.appendChild(e)),"function"==typeof e.componentOnReady?e.componentOnReady():Promise.resolve(e)};return{create:(...e)=>n().then((t=>t.create(...e))),componentOnReady:n}},getContext:(e,n)=>n in h?h[n]:"window"===n?ut:"document"===n?pt:"isServer"===n||"isPrerender"===n?!!t.hydrateServerSide:"isClient"===n?!t.hydrateServerSide:"resourcesUrl"===n||"publicPath"===n?$("."):"queue"===n?{write:Rt,read:Lt,tick:{then:e=>Tt(e)}}:void 0,getElement:U,getHostRef:Ge,getMode:e=>Ge(e).O,getRenderingRef:()=>u,getValue:xe,h:x,insertVdomAnnotations:(e,t)=>{if(null!=e){const n={hostIds:0,rootLevelIds:0,staticComponents:new Set(t)},o=[];Je(e,e.body,n,o),o.forEach((t=>{if(null!=t){const o=t["s-nr"];let s=o["s-host-id"],l=o["s-node-id"],r=`${s}.${l}`;if(null==s)if(s=0,n.rootLevelIds++,l=n.rootLevelIds,r=`${s}.${l}`,1===o.nodeType)o.setAttribute(g,r);else if(3===o.nodeType){if(0===s&&""===o.nodeValue.trim())return void t.remove();const n=e.createComment(r);n.nodeValue="t."+r,o.parentNode.insertBefore(n,o)}let i="o."+r;const c=t.parentElement;c&&(""===c["s-en"]?i+=".":"c"===c["s-en"]&&(i+=".c")),t.nodeValue=i}}))}},isMemberInElement:tt,loadModule:ct,modeResolutionChain:dt,nextTick:Tt,parsePropertyValue:I,plt:ht,postUpdateComponent:ye,promiseResolve:yt,proxyComponent:Le,proxyCustomElement:Me,readTask:Lt,registerHost:et,registerInstance:Ze,renderVdom:ae,setAssetPath:e=>ht.t=e,setErrorHandler:e=>l=e,setMode:e=>dt.push(e),setNonce:qe,setPlatformHelpers:e=>{Object.assign(ht,e)},setPlatformOptions:e=>Object.assign(ht,e),setValue:Te,styles:at,supportsConstructableStylesheets:bt,supportsListenerOptions:!0,supportsShadow:$t,win:ut,writeTask:Rt,BUILD:t,Env:{},NAMESPACE:e});export{t as B,ft as C,_e as F,mt as H,e as N,jt as S,ht as a,Ae as b,rt as c,pt as d,H as e,L as f,U as g,x as h,be as i,yt as p,Ze as r,qe as s,ut as w}
@@ -1 +1 @@
1
- import{r as t,c as s,h as i,g as e}from"./p-d8d8169b.js";import{ElementIDUtils as h,ApplicationContext as r}from"@sankhyalabs/core";import{F as a}from"./p-ff1990ad.js";const o=class{constructor(i){t(this,i),this.valueChanged=s(this,"valueChanged",7),this._isSearchPlus=!1,this.config=void 0,this.value=void 0,this.errorMessage=void 0}async ezChangeListener(t){this.errorMessage=void 0,this.value=this._isSearchPlus?await this._searchInput.getValueAsync():this._searchInput.value,this.valueChanged.emit(this.value)}componentDidLoad(){this._element&&h.addIDInfo(this._element,"filterContentEditor")}doSearch(t,s,i=!1){const e=r.getContextValue("__SNK__APPLICATION__"),h=i?e.executePreparedSearchPlus:e.executePreparedSearch;return new Promise(((i,r)=>{h.bind(e)(t,s,this.config.props.searchContext).then((t=>{i(t)})).catch((t=>{r(t)}))}))}async setFocus(){this._searchInput.setFocus()}async clearValue(){this.value=this.config.value,this._searchInput&&(this._searchInput.value=this.config.value)}getInputItem(){var t;return this._isSearchPlus=1==(null===(t=this.config.props)||void 0===t?void 0:t.useSearchPlus),i("ez-tooltip",{active:!1===this.config.enabled,message:this.config.disabledMessage,type:"warning"},i(this._isSearchPlus?"ez-search-plus":"ez-search",{id:this.config.id,suppressEmptyOption:!0,value:this.config.value,label:this.config.label,enabled:this.config.enabled,ref:t=>this._searchInput=t,optionLoader:({mode:t,argument:s})=>this.doSearch(t,s,this._isSearchPlus),errorMessage:this.errorMessage}))}render(){if(this.config&&this.config.type===a.SEARCH)return this.getInputItem()}get _element(){return e(this)}};export{o as snk_filter_search}
1
+ import{r as t,e as s,h as i,g as e}from"./p-2c9d0870.js";import{ElementIDUtils as h,ApplicationContext as r}from"@sankhyalabs/core";import{F as a}from"./p-ff1990ad.js";const o=class{constructor(i){t(this,i),this.valueChanged=s(this,"valueChanged",7),this._isSearchPlus=!1,this.config=void 0,this.value=void 0,this.errorMessage=void 0}async ezChangeListener(t){this.errorMessage=void 0,this.value=this._isSearchPlus?await this._searchInput.getValueAsync():this._searchInput.value,this.valueChanged.emit(this.value)}componentDidLoad(){this._element&&h.addIDInfo(this._element,"filterContentEditor")}doSearch(t,s,i=!1){const e=r.getContextValue("__SNK__APPLICATION__"),h=i?e.executePreparedSearchPlus:e.executePreparedSearch;return new Promise(((i,r)=>{h.bind(e)(t,s,this.config.props.searchContext).then((t=>{i(t)})).catch((t=>{r(t)}))}))}async setFocus(){this._searchInput.setFocus()}async clearValue(){this.value=this.config.value,this._searchInput&&(this._searchInput.value=this.config.value)}getInputItem(){var t;return this._isSearchPlus=1==(null===(t=this.config.props)||void 0===t?void 0:t.useSearchPlus),i("ez-tooltip",{active:!1===this.config.enabled,message:this.config.disabledMessage,type:"warning"},i(this._isSearchPlus?"ez-search-plus":"ez-search",{id:this.config.id,suppressEmptyOption:!0,value:this.config.value,label:this.config.label,enabled:this.config.enabled,ref:t=>this._searchInput=t,optionLoader:({mode:t,argument:s})=>this.doSearch(t,s,this._isSearchPlus),errorMessage:this.errorMessage}))}render(){if(this.config&&this.config.type===a.SEARCH)return this.getInputItem()}get _element(){return e(this)}};export{o as snk_filter_search}
@@ -1 +1 @@
1
- import{r as i,c as t,h as s,H as n}from"./p-d8d8169b.js";import{ApplicationUtils as e}from"@sankhyalabs/ezui/dist/collection/utils";const o=class{constructor(s){i(this,s),this.configClose=t(this,"configClose",7),this.saveConfig=t(this,"saveConfig",7),this.isEditingGuide=!1,this.isEditingGroup=!1,this.configOptions=[],this.selectedConfig=void 0,this.messagesBuilder=void 0,this.hasChanges=!1,this.optionConfigChanged=!1}handleIsEditingGuideName({detail:i}){this.isEditingGuide=i}handleIsEditingGroupName({detail:i}){this.isEditingGroup=i}saveFormConfig(){if(this.isEditingGuide||this.isEditingGroup){const i=this.getMessage("snkFormConfig.confirm.title"),t=this.getMessage(this.isEditingGuide?"snkFormConfig.alert.titleGuideEditing":"snkFormConfig.alert.titleGroupEditing");e.alert(i,t)}else this.saveConfig.emit()}async closeFormConfig(){if(this.hasChanges){const i=this.getMessage("snkFormConfig.confirm.title"),t=this.getMessage("snkFormConfig.confirm.cancel");if(!await e.confirm(i,t))return}this.configClose.emit()}getMessage(i,t){return this.messagesBuilder.getMessage(i,t)}openConfirmDialog(i="",t=this.getMessage("snkFormConfig.confirm.title")){return e.confirm(t,i)}async applyOptionConfig(){var i,t;const s=null!==(t=null===(i=this.selectedConfig)||void 0===i?void 0:i.name)&&void 0!==t?t:this.getMessage("snkFormConfig.configs.selectedConfig"),n=this.getMessage("snkFormConfig.confirm.apply").replace("{0}",s);await this.openConfirmDialog(n)&&this.saveConfig.emit()}renderSaveActions(){if(this.hasChanges||this.optionConfigChanged)return s("div",{class:"right-group"},s("ez-button",{title:this.getMessage("snkFormConfig.actions.cancel"),label:this.getMessage("snkFormConfig.actions.cancel"),onClick:this.closeFormConfig.bind(this),size:"medium"}),s("ez-button",this.hasChanges?{title:this.getMessage("snkFormConfig.actions.save"),label:this.getMessage("snkFormConfig.actions.save"),class:"ez-button--primary ez-padding-left--medium",onClick:()=>this.saveFormConfig(),size:"medium"}:{title:this.getMessage("snkFormConfig.actions.save"),label:this.getMessage("snkFormConfig.applyConfig"),class:"ez-button--primary ez-padding-left--medium",onClick:async()=>await this.applyOptionConfig(),size:"medium"}))}render(){return s(n,null,s("div",{class:"left-group"},s("ez-button",{mode:"icon",title:this.getMessage("snkFormConfig.goBackTitle"),iconName:"arrow_back",class:"ez-padding--small",size:"small",onClick:this.closeFormConfig.bind(this),id:"formConfigToBack"}),s("h1",{class:"ez-title ez-title--primary ez-title--extra-large ez-padding--small"},this.getMessage("snkFormConfig.title")),s("configs-button",{hasChanges:this.hasChanges,configOptions:this.configOptions,selectedConfig:this.selectedConfig,messagesBuilder:this.messagesBuilder})),this.renderSaveActions())}};o.style=".sc-config-header-h{display:flex;padding-top:12px;padding-left:12px;align-items:center;width:100%;justify-content:space-between}.left-group.sc-config-header{display:flex;gap:8px}.right-group.sc-config-header{padding-right:18px;display:flex}";export{o as config_header}
1
+ import{r as i,e as t,h as s,f as n}from"./p-2c9d0870.js";import{ApplicationUtils as e}from"@sankhyalabs/ezui/dist/collection/utils";const o=class{constructor(s){i(this,s),this.configClose=t(this,"configClose",7),this.saveConfig=t(this,"saveConfig",7),this.isEditingGuide=!1,this.isEditingGroup=!1,this.configOptions=[],this.selectedConfig=void 0,this.messagesBuilder=void 0,this.hasChanges=!1,this.optionConfigChanged=!1}handleIsEditingGuideName({detail:i}){this.isEditingGuide=i}handleIsEditingGroupName({detail:i}){this.isEditingGroup=i}saveFormConfig(){if(this.isEditingGuide||this.isEditingGroup){const i=this.getMessage("snkFormConfig.confirm.title"),t=this.getMessage(this.isEditingGuide?"snkFormConfig.alert.titleGuideEditing":"snkFormConfig.alert.titleGroupEditing");e.alert(i,t)}else this.saveConfig.emit()}async closeFormConfig(){if(this.hasChanges){const i=this.getMessage("snkFormConfig.confirm.title"),t=this.getMessage("snkFormConfig.confirm.cancel");if(!await e.confirm(i,t))return}this.configClose.emit()}getMessage(i,t){return this.messagesBuilder.getMessage(i,t)}openConfirmDialog(i="",t=this.getMessage("snkFormConfig.confirm.title")){return e.confirm(t,i)}async applyOptionConfig(){var i,t;const s=null!==(t=null===(i=this.selectedConfig)||void 0===i?void 0:i.name)&&void 0!==t?t:this.getMessage("snkFormConfig.configs.selectedConfig"),n=this.getMessage("snkFormConfig.confirm.apply").replace("{0}",s);await this.openConfirmDialog(n)&&this.saveConfig.emit()}renderSaveActions(){if(this.hasChanges||this.optionConfigChanged)return s("div",{class:"right-group"},s("ez-button",{title:this.getMessage("snkFormConfig.actions.cancel"),label:this.getMessage("snkFormConfig.actions.cancel"),onClick:this.closeFormConfig.bind(this),size:"medium"}),s("ez-button",this.hasChanges?{title:this.getMessage("snkFormConfig.actions.save"),label:this.getMessage("snkFormConfig.actions.save"),class:"ez-button--primary ez-padding-left--medium",onClick:()=>this.saveFormConfig(),size:"medium"}:{title:this.getMessage("snkFormConfig.actions.save"),label:this.getMessage("snkFormConfig.applyConfig"),class:"ez-button--primary ez-padding-left--medium",onClick:async()=>await this.applyOptionConfig(),size:"medium"}))}render(){return s(n,null,s("div",{class:"left-group"},s("ez-button",{mode:"icon",title:this.getMessage("snkFormConfig.goBackTitle"),iconName:"arrow_back",class:"ez-padding--small",size:"small",onClick:this.closeFormConfig.bind(this),id:"formConfigToBack"}),s("h1",{class:"ez-title ez-title--primary ez-title--extra-large ez-padding--small"},this.getMessage("snkFormConfig.title")),s("configs-button",{hasChanges:this.hasChanges,configOptions:this.configOptions,selectedConfig:this.selectedConfig,messagesBuilder:this.messagesBuilder})),this.renderSaveActions())}};o.style=".sc-config-header-h{display:flex;padding-top:12px;padding-left:12px;align-items:center;width:100%;justify-content:space-between}.left-group.sc-config-header{display:flex;gap:8px}.right-group.sc-config-header{padding-right:18px;display:flex}";export{o as config_header}
@@ -1 +1 @@
1
- import{r as i,c as t,h as s,g as e}from"./p-d8d8169b.js";import{ElementIDUtils as h}from"@sankhyalabs/core";import{F as a}from"./p-ff1990ad.js";import{F as r}from"./p-fa80e546.js";import{E as l}from"./p-1a68fb59.js";const n=class{constructor(s){i(this,s),this.valueChanged=t(this,"valueChanged",7),this._startIntervalLabel="Inicial",this._endIntervalLabel="Final",this._toLabel="até",this.config=void 0,this.getMessage=void 0,this.value=void 0,this.presentationMode=l.CHIP,this.errorMessage=void 0}ezChangeListener(i){if(this.errorMessage=void 0,this.getVariation()===r.INTERVAL){const i=this._startInterval.value,t=this._endInterval.value;return this.value=isNaN(i)&&isNaN(t)?void 0:{start:i,end:t},void this.valueChanged.emit(this.value)}this.value=i.detail,this.valueChanged.emit(this.value)}async show(){this.getVariation()!==r.INTERVAL?this._numberElement.setFocus():this._startInterval.setFocus()}async setFocus(){this.getVariation()!==r.INTERVAL?await this._numberElement.setFocus():await this._startInterval.setFocus()}async clearValue(){var i,t;if(this.value=this.config.value,this.getVariation()===r.INTERVAL){const s=this.config.value;this._startInterval&&(this._startInterval.value=null!==(i=null==s?void 0:s.start)&&void 0!==i?i:null),this._endInterval&&(this._endInterval.value=null!==(t=null==s?void 0:s.end)&&void 0!==t?t:null)}else this._numberElement&&(this._numberElement.value=this.config.value)}getIntervalValue(i){const t=this.value?this.value[i]:null;return null!=t?t:null}buildLabel(){if(this.presentationMode===l.CHIP)return s("label",{class:"ez-text ez-text--medium ez-text--primary ez-margin--medium"},this._toLabel)}getVariation(){var i,t;return null!==(t=null===(i=this.config.props)||void 0===i?void 0:i.variation)&&void 0!==t?t:r.DEFAULT}componentWillLoad(){this.getMessage&&(this._startIntervalLabel=this.getMessage("snkFilterBar.labelStart"),this._endIntervalLabel=this.getMessage("snkFilterBar.labelEnd"),this._toLabel=this.getMessage("snkFilterBar.labelTo"))}componentDidLoad(){this._element&&h.addIDInfo(this._element,"filterContentEditor")}render(){var i,t,e;if(this.config&&this.config.type===a.NUMBER)return this.getVariation()===r.INTERVAL?s("ez-tooltip",{active:!1===this.config.enabled,message:this.config.disabledMessage,type:"warning"},s("div",{class:"ez-col ez-col--nowrap"},s("ez-number-input",{id:`${this.config.id}_start`,class:this.presentationMode===l.MODAL?"ez-padding-right--medium":"",label:this._startIntervalLabel,ref:i=>this._startInterval=i,value:this.getIntervalValue("start"),enabled:this.config.enabled,precision:null===(i=this.config.props)||void 0===i?void 0:i.precision,errorMessage:this.errorMessage}),this.buildLabel(),s("ez-number-input",{id:`${this.config.id}_end`,label:this._endIntervalLabel,ref:i=>this._endInterval=i,value:this.getIntervalValue("end"),enabled:this.config.enabled,precision:null===(t=this.config.props)||void 0===t?void 0:t.precision,errorMessage:this.errorMessage}))):s("ez-tooltip",{active:!1===this.config.enabled,message:this.config.disabledMessage,type:"warning"},s("ez-number-input",{id:this.config.id,ref:i=>this._numberElement=i,value:this.config.value,precision:null===(e=this.config.props)||void 0===e?void 0:e.precision,enabled:this.config.enabled,errorMessage:this.errorMessage}))}get _element(){return e(this)}};export{n as snk_filter_number}
1
+ import{r as i,e as t,h as s,g as e}from"./p-2c9d0870.js";import{ElementIDUtils as h}from"@sankhyalabs/core";import{F as a}from"./p-ff1990ad.js";import{F as l}from"./p-fa80e546.js";import{E as r}from"./p-1a68fb59.js";const n=class{constructor(s){i(this,s),this.valueChanged=t(this,"valueChanged",7),this._startIntervalLabel="Inicial",this._endIntervalLabel="Final",this._toLabel="até",this.config=void 0,this.getMessage=void 0,this.value=void 0,this.presentationMode=r.CHIP,this.errorMessage=void 0}ezChangeListener(i){if(this.errorMessage=void 0,this.getVariation()===l.INTERVAL){const i=this._startInterval.value,t=this._endInterval.value;return this.value=isNaN(i)&&isNaN(t)?void 0:{start:i,end:t},void this.valueChanged.emit(this.value)}this.value=i.detail,this.valueChanged.emit(this.value)}async show(){this.getVariation()!==l.INTERVAL?this._numberElement.setFocus():this._startInterval.setFocus()}async setFocus(){this.getVariation()!==l.INTERVAL?await this._numberElement.setFocus():await this._startInterval.setFocus()}async clearValue(){var i,t;if(this.value=this.config.value,this.getVariation()===l.INTERVAL){const s=this.config.value;this._startInterval&&(this._startInterval.value=null!==(i=null==s?void 0:s.start)&&void 0!==i?i:null),this._endInterval&&(this._endInterval.value=null!==(t=null==s?void 0:s.end)&&void 0!==t?t:null)}else this._numberElement&&(this._numberElement.value=this.config.value)}getIntervalValue(i){const t=this.value?this.value[i]:null;return null!=t?t:null}buildLabel(){if(this.presentationMode===r.CHIP)return s("label",{class:"ez-text ez-text--medium ez-text--primary ez-margin--medium"},this._toLabel)}getVariation(){var i,t;return null!==(t=null===(i=this.config.props)||void 0===i?void 0:i.variation)&&void 0!==t?t:l.DEFAULT}componentWillLoad(){this.getMessage&&(this._startIntervalLabel=this.getMessage("snkFilterBar.labelStart"),this._endIntervalLabel=this.getMessage("snkFilterBar.labelEnd"),this._toLabel=this.getMessage("snkFilterBar.labelTo"))}componentDidLoad(){this._element&&h.addIDInfo(this._element,"filterContentEditor")}render(){var i,t,e;if(this.config&&this.config.type===a.NUMBER)return this.getVariation()===l.INTERVAL?s("ez-tooltip",{active:!1===this.config.enabled,message:this.config.disabledMessage,type:"warning"},s("div",{class:"ez-col ez-col--nowrap"},s("ez-number-input",{id:`${this.config.id}_start`,class:this.presentationMode===r.MODAL?"ez-padding-right--medium":"",label:this._startIntervalLabel,ref:i=>this._startInterval=i,value:this.getIntervalValue("start"),enabled:this.config.enabled,precision:null===(i=this.config.props)||void 0===i?void 0:i.precision,errorMessage:this.errorMessage}),this.buildLabel(),s("ez-number-input",{id:`${this.config.id}_end`,label:this._endIntervalLabel,ref:i=>this._endInterval=i,value:this.getIntervalValue("end"),enabled:this.config.enabled,precision:null===(t=this.config.props)||void 0===t?void 0:t.precision,errorMessage:this.errorMessage}))):s("ez-tooltip",{active:!1===this.config.enabled,message:this.config.disabledMessage,type:"warning"},s("ez-number-input",{id:this.config.id,label:this.config.label,ref:i=>this._numberElement=i,value:this.config.value,precision:null===(e=this.config.props)||void 0===e?void 0:e.precision,enabled:this.config.enabled,errorMessage:this.errorMessage}))}get _element(){return e(this)}};export{n as snk_filter_number}
@@ -0,0 +1 @@
1
+ import{r as s,e as t,h as i,f as o,g as n}from"./p-2c9d0870.js";const e=class{constructor(i){s(this,i),this.snkCustomSlotGuideLoaded=t(this,"snkCustomSlotGuideLoaded",7),this.slotName="CUSTOM_SLOT_GUIDE"}onGuideChange(s){this._element.style.setProperty("display",s.detail===this.slotName?"block":"none")}onFormConfigVisibilityChange(s){s.detail&&this._element.style.setProperty("display","none")}componentDidLoad(){this.snkCustomSlotGuideLoaded.emit(this.slotName)}render(){return i(o,{slot:this.slotName,id:this.slotName,class:"custom-slot-guide-container"},i("slot",null))}get _element(){return n(this)}};e.style=".sc-snk-custom-slot-guide-h{display:none}";export{e as snk_custom_slot_guide}
@@ -0,0 +1 @@
1
+ import{r as t,e as i,h as e,f as s,g as r,i as l}from"./p-2c9d0870.js";import{DataType as a,StringUtils as n,ObjectUtils as o,ElementIDUtils as h,ErrorException as d,ApplicationContext as c,LockManager as u,LockManagerOperation as f,DateUtils as m,MaskFormatter as p,KeyboardManager as v,FloatingManager as b,ArrayUtils as g}from"@sankhyalabs/core";import{EzScrollDirection as k}from"@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection";import{C as _}from"./p-1f310bc6.js";import{P as F}from"./p-68c1a093.js";import{toString as z}from"@sankhyalabs/core/dist/dataunit/metadata/DataType";import{F as y}from"./p-ff1990ad.js";import{F as x,D as w}from"./p-84345e7a.js";import{F as C}from"./p-fa80e546.js";import{ModalAction as I}from"@sankhyalabs/ezui/dist/collection/components/ez-modal-container";import{ApplicationUtils as $}from"@sankhyalabs/ezui/dist/collection/utils";import{A as N}from"./p-6a4b21dd.js";import{F as T}from"./p-b568c1d4.js";import{g as L}from"./p-76e66fd9.js";import"./p-7ee6b1bf.js";import"./p-6768f176.js";import"./p-8d884fab.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";function A(t){let i="";return t.forEach(((t,e)=>{var s;i+=` ${e>0?null!==(s=t.operand)&&void 0!==s?s:"OR":""} ${t.expression}`})),i.trim()}const P=class{constructor(e){t(this,e),this.configUpdated=i(this,"configUpdated",7),this._updateSequence=[],this._loadingPending=!1,this._configUpdated=!1,this._firstLoad=!0,this._pendingVariables=!1,this._isDefaultFilter=!1,this._customfiltersToBeUpdated=[],this._resolveLoading=void 0,this._calculateSortIndex=t=>{if(!t.visible)return 0;if(t.hardFixed)return 1e6;let i=t.fixed?1e5:0;return i+=this.hasValidValue(t)?1e4:0,i+=this._updateSequence.lastIndexOf(t.id)+1,i},this._filtersComparator=(t,i)=>this._calculateSortIndex(i)-this._calculateSortIndex(t),this.enableLockManagerLoadingComp=!1,this.customFilterBarConfig=void 0,this.dataUnit=void 0,this.title=void 0,this.configName=void 0,this.resourceID=void 0,this.mode="regular",this.filterConfig=void 0,this.messagesBuilder=void 0,this.disablePersonalizedFilter=void 0,this.filterBarLegacyConfigName=void 0,this.autoLoad=void 0,this.afterApplyConfig=void 0,this.filterCustomConfig=void 0,this.filterCustomConfigInterceptor=void 0,this.allowDefault=void 0,this.scrollerLocked=!1,this.showPersonalizedFilter=!1,this.personalizedFilterId=void 0,this.isFilterModalOpen=!1}hasValidValue(t){var i,e;return null!=t.value&&(t.type===y.PERIOD?!!(null===(i=t.value)||void 0===i?void 0:i.start)||!!(null===(e=t.value)||void 0===e?void 0:e.end):!!t.groupedItems||!Array.isArray(t.value)||t.value.some((t=>!0===t.check)))}observeFilterConfig(t,i){o.equals(t,i)||this.handleFilterConfigsChanged(i,t)}handleFilterConfigsChanged(t,i){if(null!=t&&null==i)this._loadingPending=!0,this._configUpdated=!0;else{const e=new Map(t?t.map((t=>[t.id,t])):void 0);0===e.size&&i.length>0?(this._loadingPending=!0,this._configUpdated=!1):i.forEach((t=>{const i=e.get(t.id);if(null!=i){if(this._configUpdated=this._configUpdated||o.objectToString(i)!=o.objectToString(t),this._loadingPending=this._loadingPending||o.objectToString(i.value)!==o.objectToString(t.value),!this._loadingPending){const e=o.objectToString(i.groupedItems)!=o.objectToString(t.groupedItems);this._configUpdated=this._configUpdated||e,this._loadingPending=this._loadingPending||e}}else this._configUpdated=!0,this._loadingPending=this._loadingPending||null!=t.value}))}(this._loadingPending||this._configUpdated)&&this.configUpdated.emit(i),this.processAfterUpdateConfig()}async reload(){this.loadConfigFromStorage(!0)}async getFilterItem(t){const i=this.filterConfig.find((i=>i.id===t));return Promise.resolve(o.copy(i))}async updateFilterItem(t){return-1==this.filterConfig.findIndex((i=>i.id===t.id))?(console.warn("[SnkFilterBar.updateFilterItem] "+this.getMessage("snkFilterBar.filterItem.updateFilterItemNotFound")),Promise.resolve()):(this._loadingPending=!0,this.updateFilter(t),Promise.resolve())}async addFilterItem(t){return this.filterConfig.findIndex((i=>i.id===t.id))>-1?(console.warn("[SnkFilterBar.addFilterItem] "+this.getMessage("snkFilterBar.filterItem.addFilterItemExists")),Promise.resolve()):(this.filterConfig.push(t),this._loadingPending=!0,this.updateFilter(t),Promise.resolve())}async removeFilterItem(t){const i=this.filterConfig.findIndex((i=>i.id===t));if(-1==i)return console.warn("[SnkFilterBar.removeFilterItem] "+this.getMessage("snkFilterBar.filterItem.removeFilterItemNotFound")),Promise.resolve(void 0);const e=this.filterConfig[i];return this.filterConfig=this.filterConfig.filter((i=>i.id!==t)),Promise.resolve(e)}componentDidLoad(){this._element&&h.addIDInfo(this._element,null,{dataUnit:this.dataUnit})}processPendingFilter(){if(this._pendingVariables){const t=this._element.querySelector("#filter-PERSONALIZED_FILTER_GROUP");t&&t.showUp(!0).then((()=>{this.processAfterUpdateConfig()}))}else this.processAfterUpdateConfig()}getPersonalizedFilterItem(){return this.filterConfig.find((t=>t.type===y.PERSONALIZED))}async processAfterUpdateConfig(){var t;if(this._loadingPending){if(await this._application.isLoadedByPk()&&!this._configUpdated)return;const t=this.getPersonalizedFilterItem();if(this._pendingVariables=!F.validateVariableValues(t),this._pendingVariables)return;this._loadingPending=!1,this.doLoadData()}this._configUpdated&&(this._configUpdated=!1,_.saveFilterBarConfig(this.filterConfig,this.configName,this.resourceID),null===(t=this.afterApplyConfig)||void 0===t||t.call(this))}async doLoadData(t=!1){try{if(this._firstLoad&&!1===this.autoLoad)return;if(this._firstLoad&&!t&&void 0===this.autoLoad&&!await this._application.getBooleanParam("global.carregar.registros.iniciar.tela"))return;this.dataUnit.loadData(void 0,void 0,!0)}finally{this._firstLoad=!1}}getMessage(t,i,e){var s;return null==this.messagesBuilder&&this._application&&(this.messagesBuilder=this._application.messagesBuilder),(null===(s=this.messagesBuilder)||void 0===s?void 0:s.getMessage(t,i))||e}async getFilters(){return this.getFilter(null)}getFilter(t){var i;const e=[];return null===(i=this.filterConfig)||void 0===i||i.filter((t=>this.isActiveFilter(t))).forEach((t=>{const i=(t=>{switch(t.type){case y.DEFAULT_FILTER:return function(t){return{name:t.id,expression:t.props.expression,params:[]}}(t);case y.BINARY_SELECT:return function(t){const{id:i,value:e,props:s}=t;return{name:i,expression:s.options.find((t=>t.name===e)).expression,params:[]}}(t);case y.MULTI_SELECT:return function(t){const{id:i,value:e,props:s}=t;return{name:i,expression:s.expression,params:[{name:i,dataType:a.TEXT,value:e}]}}(t);case y.MULTI_LIST:return function(t){const{id:i,value:e,props:s}=t,r=(null!==(o=null!==(n=null==(l=e)?void 0:l.elements)&&void 0!==n?n:null==l?void 0:l.members)&&void 0!==o?o:l).filter((t=>null==t?void 0:t.check)).map((({id:t})=>Number.isNaN(+t)?String(t):Number(t)));var l,n,o;if(r.length>0)return{name:i,expression:s.expression,params:[{name:i,dataType:a.TEXT,value:JSON.stringify(r)}]}}(t);case y.PERIOD:return function(t){const{id:i,value:e,props:s}=t;let{end:r,start:l}=e;"string"==typeof r&&(r=new Date(r)),"string"==typeof l&&(l=new Date(l));const n=[];let o;return r&&l?(o=s.expression.fullfill,n.push({name:`${i}.START`,dataType:a.DATE,value:z(a.DATE,l)},{name:`${i}.END`,dataType:a.DATE,value:z(a.DATE,r)})):l?(o=s.expression.onlystart,n.push({name:i,dataType:a.DATE,value:z(a.DATE,l)})):(o=s.expression.onlyend,n.push({name:i,dataType:a.DATE,value:z(a.DATE,r)})),{name:i,expression:o,params:n}}(t);case y.SEARCH:return function(t){const{id:i,value:e,props:s}=t;return{name:i,expression:s.expression,params:[{name:i,dataType:a.TEXT,value:z(a.TEXT,null==e?void 0:e.value)}]}}(t);case y.TEXT:return function(t){let{id:i,value:e,props:s}=t;const r=s.expression;var l,o;return n.isEmpty(s.likeAs)||(l=e,e="CONTANIS"===(o=s.likeAs)?`%${l}%`:"STARTS_WITH"===o?`${l}%`:"ENDS_WITH"===o?`%${l}`:l),{name:i,expression:r,params:[{name:i,dataType:a.TEXT,value:z(a.TEXT,e)}]}}(t);case y.NUMBER:return function(t){const{id:i,value:e,props:s}=t;if(s.variation===C.INTERVAL){const{start:t,end:r}=null!=e?e:{start:0,end:0};if(!isNaN(t)&&!isNaN(r))return{name:i,expression:s.intervalExpression.fullfill,params:[{name:`${i}.START`,dataType:a.NUMBER,value:z(a.NUMBER,t)},{name:`${i}.END`,dataType:a.NUMBER,value:z(a.NUMBER,r)}]};if(!isNaN(t))return{name:i,expression:s.intervalExpression.onlystart,params:[{name:i,dataType:a.NUMBER,value:z(a.NUMBER,t)}]};if(!isNaN(r))return{name:i,expression:s.intervalExpression.onlyend,params:[{name:i,dataType:a.NUMBER,value:z(a.NUMBER,r)}]}}return{name:i,expression:s.expression,params:[{name:i,dataType:a.NUMBER,value:z(a.NUMBER,e)}]}}(t);case y.PERSONALIZED:return function(t){const{id:i,groupedItems:e=[]}=t,s=e.filter((t=>!!t.visible)).map((t=>{var i;const e=t.props.expression,s=((null===(i=t.props.personalizedFilter)||void 0===i?void 0:i.parameters)||[]).map(((i,e)=>{const s=Array.from(t.value||0),r=i.dataType;let l=e>=0&&e<s.length?s[e]:null;return null!=l&&"object"==typeof l&&"value"in l&&(l=l.value),null==l&&r===a.BOOLEAN&&(l=!1),{name:i.name,dataType:r,value:"string"==typeof l?l:z(r,l)}}));return{expression:e,name:t.id,params:s}}));return{name:i,expression:s.map((t=>`(${t.expression})`)).join(` ${x.AND} `),params:s.flatMap((t=>t.params))}}(t);case y.CHECK_BOX_LIST:return function(t){var i;const{id:e,value:s,props:r}=t,l=Object.entries(null!=s?s:{}).filter((([t,i])=>!0===i)).map((([t,i])=>t));return{name:e,expression:A(null===(i=r.options)||void 0===i?void 0:i.filter((t=>l.includes(t.name)))),params:[]}}(t);default:return}})(t);i&&e.push(i)})),e}isActiveFilter(t){return t.type===y.DEFAULT_FILTER||this.filterActiveFilter(t)&&this.hasValidValue(t)}async registryFilterProvider(){this.dataUnit.addFilterProvider(this),this.filterConfig&&await this.doLoadData()}itemFocused(t){this._element.querySelectorAll("snk-filter-item,snk-filter-list").forEach((i=>{i.id===t?"snk-filter-item"===i.tagName.toLowerCase()&&i.getClientRects()[0].x<0&&i.scrollIntoView({behavior:"auto",inline:"nearest"}):i.hideDetail()}))}filterActiveFilter(t){return t.visible||t.removalBlocked}filterPersonalizedItems(t){return t.type===y.PERSONALIZED}getPersonalizedFilterVariableItems(){return this.filterConfig.filter(this.filterPersonalizedItems).map((t=>{const i=`filter-${t.id}`;return e("snk-filter-item",{key:t.id,id:i,config:Object.assign({},t),onFocusin:()=>this.itemFocused(i),onVisibleChanged:t=>this.scrollerLocked=t.detail,onFilterChange:t=>this.updateFilter(t.detail),getMessage:(t,i)=>this.getMessage(t,i),showChips:!1})}))}getFilterItems(){const t=[],i=[];this.filterConfig.sort(((t,i)=>this._filtersComparator(t,i))).filter(this.filterActiveFilter).forEach((s=>{const r=`filter-${(s=o.copy(s)).id}`,l=e("snk-filter-item",{onVisibleChanged:t=>this.scrollerLocked=t.detail,onFilterChange:t=>this.updateFilter(t.detail),onFocusin:()=>this.itemFocused(r),id:r,config:s,class:"ez-margin-horizontal--extra-small",getMessage:(t,i)=>this.getMessage(t,i),key:s.id});return s.fixed||s.hardFixed||s.required?t.push(l):i.push(l),l}));const s=[];return s.push(...t.reverse()),t.length>0&&i.length>0&&s.push(e("hr",{class:"ez-margin-horizontal--small ez-margin-vertical--auto ez-divider-vertical ez-divider--dark snk-filter-bar__divider"})),s.push(...i),s}calculateUpdateSequence(t){t&&(this._updateSequence=this._updateSequence.filter((i=>t.id!==i)),this._updateSequence.push(t.id))}normalizeItem(t){const i=Object.assign({},t),e=t.type===y.PERSONALIZED;return e&&void 0===i.value&&i.groupedItems&&(i.value=i.groupedItems.filter((t=>!!t.visible)).length),["props","value","hardFixed","fixed"].forEach((t=>{"value"===t&&e||null==i[t]&&delete i[t]})),""!==i.value||e||delete i.value,i}updateFilter(t){const i=this.normalizeItem(t);let e=this.filterConfig.map((t=>t.id!==i.id?t:(o.objectToString(t)==o.objectToString(i)&&this.calculateUpdateSequence(i),i))).sort(((t,i)=>this._filtersComparator(t,i)));this.filterCustomConfigInterceptor&&(e=this.filterCustomConfigInterceptor(e)),this.filterConfig=e}loadPermitions(){this._application.isUserSup().then((t=>this.allowDefault=t))}addFilterBarLegacyConfigName(){this.filterBarLegacyConfigName&&_.addFilterBarLegacyConfig(this.configName,this.filterBarLegacyConfigName)}async loadConfigFromStorage(t){try{let i;t&&await _.deleteFilterBarConfigCache(this.configName,this.resourceID),i=this.customFilterBarConfig?await this.customFilterBarConfig(this.configName,this.resourceID,{contextURI:this.dataUnit.name}):await _.loadFilterBarConfig(this.configName,this.resourceID,{contextURI:this.dataUnit.name}),this.filterCustomConfig&&(i=[...this.filterCustomConfig,...i]),this.filterCustomConfigInterceptor&&(i=this.filterCustomConfigInterceptor(i)),this.filterConfig=i.map((t=>this.normalizeItem(t))),this.filterConfig.sort(((t,i)=>this._filtersComparator(t,i)))}catch(t){throw new d(this.getMessage("snkFilterBar.failToLoadConfig"),t)}}async attachDataUnit(){if(null==this.dataUnit){let t=this._element.parentElement;for(;t;)if("SNK-DATA-UNIT"===t.tagName.toUpperCase()){const i=t;this.dataUnit=i.dataUnit,this.dataUnit?await this.registryFilterProvider():i.addEventListener("dataUnitReady",(async t=>{this.dataUnit=t.detail,await this.registryFilterProvider()}));break}t=t.parentElement}else await this.registryFilterProvider()}filterChangeListener(t){this.updateFilter(t.detail)}async showFilterModal(){this.isFilterModalOpen||(this.isFilterModalOpen=!0)}addPersonalizedFilter(t=!1){this.isFilterModalOpen=!1,this._isDefaultFilter=t,this.personalizedFilterId=void 0,this.showPersonalizedFilter=!0,window.requestAnimationFrame((()=>{this._elPersonalizedFilter.createPersonalizedFilter()}))}editPersonalizedFilter(t,i=!1){this.isFilterModalOpen=!1,this._isDefaultFilter=i,this.showPersonalizedFilter=!0,this.personalizedFilterId=t}deletePersonalizedFilter(t,i,e,s=!1){if(s)return _.removeDefaultFilter(t,this.resourceID,e),void(this._isDefaultFilter=!1);i===y.PERSONALIZED&&_.removePersonalizedFilter(t,this.resourceID,e)}closeFilterModal(){this.isFilterModalOpen=!1}applyFiltersFromModal(t){var i;this.filterConfig=t.map(this.normalizeItem).sort(((t,i)=>this._filtersComparator(t,i))),null===(i=this.afterApplyConfig)||void 0===i||i.call(this),this.isFilterModalOpen=!1}handleHidePersonalizedFilter(t){t?this.loadConfigFromStorage().then((()=>{this.hidePersonalizedFilter()})):this.hidePersonalizedFilter()}hidePersonalizedFilter(){this.personalizedFilterId=void 0,this.showPersonalizedFilter=!1,this._isDefaultFilter=!1}async componentWillLoad(){var t;try{if(this._application=c.getContextValue("__SNK__APPLICATION__"),await this.attachDataUnit(),this._application){if(this._application.enableLockManagerLoadingApp&&this.enableLockManagerLoadingComp){const t=u.addLockManagerCtxId(this._element);this._resolveLoading=u.lock(t,f.APP_LOADING)}await Promise.all([this.loadPermitions(),this.addFilterBarLegacyConfigName(),this.loadConfigFromStorage()])}}finally{null===(t=this._resolveLoading)||void 0===t||t.call(this)}}componentDidRender(){this.processPendingFilter()}render(){if(!this.dataUnit||!this.filterConfig||0===this.filterConfig.length)return;if(this.showPersonalizedFilter)return e("snk-personalized-filter",{class:"filter-bar__personalized-filter",filterId:this.personalizedFilterId,ref:t=>this._elPersonalizedFilter=t,isDefaultFilter:this._isDefaultFilter,onEzCancel:()=>this.handleHidePersonalizedFilter(!1),onEzAfterSave:()=>this.handleHidePersonalizedFilter(!0),entityUri:this.dataUnit.name,configName:this.configName,resourceID:this.resourceID});let t=o.copy(this.filterConfig);return t=t.sort(((t,i)=>t.originOrder-i.originOrder)),"regular"!==this.mode?e(s,{"data-mode":this.mode},this.getPersonalizedFilterVariableItems(),"button"===this.mode&&e("ez-button",{class:"ez-margin-left--medium ez-margin-top--extra-small",size:"small",label:this.getMessage("snkFilterBar.filters",void 0,this.getMessage("snkFilterBar.filters")),onClick:this.showFilterModal.bind(this)}),e("snk-filter-modal",{opened:this.isFilterModalOpen,filterConfig:this.filterConfig,configName:this.configName,disablePersonalizedFilter:this.disablePersonalizedFilter,getMessage:(t,i)=>this.getMessage(t,i),applyFilters:t=>this.applyFiltersFromModal(t),closeModal:()=>this.closeFilterModal(),addPersonalizedFilter:t=>this.addPersonalizedFilter(t),editPersonalizedFilter:(t,i)=>this.editPersonalizedFilter(t,i),deletePersonalizedFilter:(t,i,e)=>this.deletePersonalizedFilter(t,y.PERSONALIZED,i,e),filterCustomConfigInterceptor:this.filterCustomConfigInterceptor})):e(s,null,e("div",null,e("span",{class:"snk-filter-bar__title",title:this.title,"data-tooltip":this.title,"data-flow":"bottom"},this.title)),e("ez-scroller",{class:"snk-filter-bar__scroller",direction:k.HORIZONTAL,activeShadow:!0,locked:this.scrollerLocked},e("section",{class:"snk-filter-bar__filter-item-container"},this.getFilterItems())),e("ez-button",{class:"ez-padding-left--medium ez-margin-top--extra-small",size:"small",label:this.getMessage("snkFilterBar.filters",void 0,this.getMessage("snkFilterBar.filters")),onClick:this.showFilterModal.bind(this)},e("ez-icon",{slot:"leftIcon",iconName:"plus",class:"ez-padding-right--small"})),e("snk-filter-modal",{opened:this.isFilterModalOpen,filterConfig:this.filterConfig,configName:this.configName,disablePersonalizedFilter:this.disablePersonalizedFilter,getMessage:(t,i)=>this.getMessage(t,i),applyFilters:t=>this.applyFiltersFromModal(t),closeModal:()=>this.closeFilterModal(),addPersonalizedFilter:t=>this.addPersonalizedFilter(t),editPersonalizedFilter:(t,i)=>this.editPersonalizedFilter(t,i),deletePersonalizedFilter:(t,i,e)=>this.deletePersonalizedFilter(t,y.PERSONALIZED,i,e),filterCustomConfigInterceptor:this.filterCustomConfigInterceptor}))}get _element(){return r(this)}static get watchers(){return{filterConfig:["observeFilterConfig"]}}};P.style='.sc-snk-filter-bar-h{display:grid;grid-template-columns:1fr minmax(100px, 100%) 1fr 1fr;--snk-personalized-filter--z-index:var(--elevation--20, 20);--snk-personalized-filter--background-color:var(--background--xlight, #fff)}.snk-filter-bar__title.sc-snk-filter-bar{max-width:260px;display:inline-block;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-size:16px;font-family:var(--font-pattern, Arial);font-weight:var(--text-weight--large, 600);color:var(--color--title-primary, #2B3A54);margin-top:12px}[data-mode="hidden"].sc-snk-filter-bar-h{width:0px;height:0px}[data-mode="button"].sc-snk-filter-bar-h{grid-template-columns:1fr;width:fit-content}.snk-filter__popover-container.sc-snk-filter-bar{display:flex;cursor:auto}.filter-bar__personalized-filter.sc-snk-filter-bar{display:flex;flex-direction:column;position:fixed;top:0;left:0;width:100%;height:100%;overflow:auto;z-index:var(--snk-personalized-filter--z-index);background-color:var(--snk-personalized-filter--background-color)}.snk-filter__popover.sc-snk-filter-bar{display:flex;flex-direction:column;position:absolute;width:fit-content;height:fit-content;min-width:265px;background-color:var(--background--xlight, #fff);border-radius:var(--border--radius-medium, 12px);box-shadow:var(--shadow, 0px 0px 16px 0px #000)}.snk-filter-item__editor-header.sc-snk-filter-bar{flex-grow:1;font-weight:var(--text-weight--medium, 400);color:var(--color--title-primary, #2B3A54)}.snk-filter__popover-rule.sc-snk-filter-bar{border-style:solid;border-color:var(--color--disable-secondary, #F2F5F8);border-radius:1px;border-width:1px;width:100%}.editor__ez-check.sc-snk-filter-bar{--ez-check__label--padding-left:0}.snk-filter-item__editor-header-button.sc-snk-filter-bar{cursor:pointer;background-color:transparent;border:none;padding:3px;outline-color:var(--color--primary)}.snk-filter-bar__divider.sc-snk-filter-bar{margin-bottom:var(--space--small);height:80%}.snk-filter-bar__filter-item-container.sc-snk-filter-bar{display:flex;align-items:start;margin:var(--space--2, 2px) 0}.snk-filter-bar__scroller.sc-snk-filter-bar .sc-snk-filter-bar:first-child{margin-left:var(--space-extra-small, 3px)}.snk-filter-bar__filter-list-items-container.sc-snk-filter-bar{overflow-y:auto;max-height:360px;margin-top:var(--space--small, 6px)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar{cursor:pointer;border-radius:var(--border--radius-small, 6px);border:none;background-color:transparent}.snk-filter-bar__filter-list-item__label.sc-snk-filter-bar{color:var(--title--primary)}.snk-filter-bar__filter-list-item__label--secondary.sc-snk-filter-bar{color:var(--text--primary)}.snk-filter-bar__filter-list-item__icon.sc-snk-filter-bar{--ez-icon--color:var(--title--primary)}.snk-filter-bar__filter-list-item__icon--secondary.sc-snk-filter-bar{--ez-icon--color:var(--text--secondary)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar:focus-visible{outline:none;background-color:var(--background--medium)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar:hover{background-color:var(--background--medium)}.snk-filter-bar__filter-list-items-container--empty.sc-snk-filter-bar{width:100%;height:100px;display:flex;justify-content:center;align-self:center;align-items:center}.snk-filter-bar__filter-list-items-button--active.sc-snk-filter-bar{position:relative}.snk-filter-bar__filter-list-items-button--active.sc-snk-filter-bar::after{display:flex;position:absolute;content:"";width:8px;height:8px;top:7px;left:17px;background-color:var(--icon--alert--color, #008561);border-radius:50%}.snk-filter-bar__filter-modal-item.sc-snk-filter-bar{--modal-item-border-width:2px;display:flex;flex-direction:row;margin-left:var(--modal-item-border-width);border-radius:var(--border--radius-medium, 12px);background-color:var(--background--medium, #f0f3f7);border:none;width:100%}.snk-filter-bar__filter-modal-item.sc-snk-filter-bar:focus-visible{outline:var(--color--primary) solid var(--modal-item-border-width)}.snk-filter-bar__filter-modal-item__check.sc-snk-filter-bar{width:auto}.snk-filter-bar__filter-modal-item__label.sc-snk-filter-bar{font-weight:var(--text-weight--medium)}.snk-filter-bar__filter-modal-content.sc-snk-filter-bar{display:grid;grid-template-rows:auto auto 1fr auto;width:99%;height:100%}';const D=class{constructor(e){t(this,e),this.visibleChanged=i(this,"visibleChanged",7),this.filterChange=i(this,"filterChange",3),this._keyboardManager=void 0,this.detailIsVisible=void 0,this.config=void 0,this.getMessage=void 0,this.showChips=!0}observeDetailIsVisible(t){this.visibleChanged.emit(t)}filterChangeListener(t){this.hideDetail(),this.filterChange.emit(t.detail)}async showUp(t=!1){var i;this._filterItemElement.scrollIntoView({behavior:"auto",block:"nearest",inline:"nearest"}),t&&(await(null===(i=this._chipElement)||void 0===i?void 0:i.setBlur()),await this._popover.showUnder(this._chipElement),await this._filterDetail.setFocusField())}async hideDetail(){var t;await(null===(t=this._popover)||void 0===t?void 0:t.hide())}getConfigChanges(){var t;const i=this.config;(null===(t=i.groupedItems)||void 0===t?void 0:t.length)&&(i.visible=!1,i.groupedItems=i.groupedItems.map((t=>Object.assign(Object.assign({},t),{visible:!1}))));const e=i.type===y.MULTI_LIST&&Array.isArray(i.value)?i.value.map((t=>Object.assign(Object.assign({},t),{check:!1}))):void 0;return Object.assign(Object.assign({},i),{value:e})}clearFilter(t){if(null==t||t.stopPropagation(),this.canClearFilter()){const t=this.getConfigChanges();this.filterChange.emit(t)}else this.togglePopover(t)}async togglePopover(t){null==t||t.preventDefault(),null==t||t.stopPropagation(),!1!==this.config.enabled&&(this.detailIsVisible?await this.hideDetail():await this.showUp(!0))}getLabel(t=!1){var i,e;const{type:s,value:r,label:l,props:a,groupedItems:n=[]}=this.config;if(r||n.length){if(s===y.BINARY_SELECT){const[i,e]=a.options,s=this.getMessage("snkFilterBar.binarySelectTooltip");if(i.name===r)return t?`${s} ${String(i.label).toLowerCase()}`:i.label;if(e.name===r)return t?`${s} ${String(e.label).toLowerCase()}`:e.label}if(s===y.MULTI_SELECT)return`${l}: ${a.options.find((t=>t.value===r)).label}`;if(s===y.PERIOD){let{end:i,start:e}=r;"string"==typeof i&&(i=new Date(i),i.setMinutes(i.getMinutes()+i.getTimezoneOffset())),"string"==typeof e&&(e=new Date(e),e.setMinutes(e.getMinutes()+e.getTimezoneOffset()));const s=new Intl.DateTimeFormat("pt-BR");if(i&&e){const s=e.getFullYear()===i.getFullYear(),r=Object.assign({day:"2-digit",month:"2-digit"},(!s||t)&&{year:"2-digit"}),a=m.formatDate(e,r),n=m.formatDate(i,r);return t?this.getMessage("snkFilterBar.fullPeriodTooltip",{LABEL:l,START_LABEL:a,END_LABEL:n}):`${l}: ${a} → ${n}`}return e?`${l}: ${this.getMessage("snkFilterBar.onlyStartToltip")} ${s.format(e)}`:i?`${l}: ${this.getMessage("snkFilterBar.onlyEndToltip")} ${s.format(i)}`:l}if(s===y.SEARCH)return`${l}: ${r.value} - ${r.label}`;if(s===y.PERSONALIZED){const t=this.calculateActiveCount(n);return t<=0?l:`${l}: ${this.getMessage("snkFilterBar.personalizedCount",{activeCount:t})}`}if(s===y.MULTI_LIST){const e=(null!==(i=r.elements)&&void 0!==i?i:r).filter((t=>null==t?void 0:t.check));return this.getLabelFromCheckedOptions(e,l,t)}if(s===y.CHECK_BOX_LIST){const i=Object.entries(null!=r?r:{}).filter((([t,i])=>!0===i)).map((([t,i])=>t)),s=(null!==(e=a.options)&&void 0!==e?e:[]).filter((t=>i.includes(t.name)));return this.getLabelFromCheckedOptions(s,l,t)}if(s===y.NUMBER&&a.variation===C.INTERVAL){const{start:t,end:i}=r;if(!isNaN(t)&&!isNaN(i))return this.getMessage("snkFilterBar.fullIntervalTooltip",{LABEL:l,START_LABEL:t,END_LABEL:i});if(!isNaN(t))return`${l}: ${this.getMessage("snkFilterBar.onlyStartToltip")} ${Number(t)}`;if(!isNaN(i))return`${l}: ${this.getMessage("snkFilterBar.onlyEndToltip")} ${Number(i)}`}return this.config.mask?`${l}: ${new p(this.config.mask).format(r)}`:`${l}: ${r}`}return l}getLabelFromCheckedOptions(t,i,e){const s=t.length;return 0===s?`${i}`:s>1?e?`${i}: ${t.map((t=>t.label)).join(",")}`:`${i}: ${s} ${this.getMessage("snkFilterBar.multiListToltip")}`:`${i}: ${t[0].label}`}calculateActiveCount(t){return t.reduce(((t,i)=>i.visible?t+1:t),0)}componentDidLoad(){this._filterItemElement&&(h.addIDInfo(this._filterItemElement),this._idSnkFilterDetail=`filterDetail_${this.config.id}`)}canClearFilter(){const{value:t,groupedItems:i=[]}=this.config;return null!=t&&this.config.type===y.MULTI_LIST?t.some((t=>t.check)):void 0!==t||i.some((t=>t.visible))}getRightIconName(){return this.canClearFilter()?"close":this.detailIsVisible?"chevron-up":"chevron-down"}getLeftIconName(){switch(this.config.type){case y.PERIOD:return"calendar";case y.PERSONALIZED:return"tune"}}hasActiveElements(t){var i;const e=Array.isArray(t)?t:null==t?void 0:t.elements;return(null===(i=null==e?void 0:e.filter((t=>null==t?void 0:t.check)))||void 0===i?void 0:i.length)>0}hasActiveValue(t){var i,e;return t.type===y.PERIOD?!!(null===(i=t.value)||void 0===i?void 0:i.start)||!!(null===(e=t.value)||void 0===e?void 0:e.end):t.type!==y.MULTI_LIST&&void 0!==t.value||this.hasActiveElements(t.value)}getEnabledChip(){if(this.detailIsVisible)return!0;if(this.config.type===y.PERSONALIZED){const{groupedItems:t=[]}=this.config;return t.some((t=>t.visible))}return this.hasActiveValue(this.config)}async handleVisibilityPopover(t){this.detailIsVisible=t.detail,this.detailIsVisible||await this._filterDetail.clearValue()}getCustomMessage(t,i){var e;return null===(e=this.getMessage)||void 0===e?void 0:e.call(this,`snkFilterBar.filterModal.${t}`,i)}hasValue(){return this.config.type===y.MULTI_LIST?this.hasActiveElements(this.config.value):null!=this.config.value}getTooltipMessage(){var t,i;return this.config.required&&!this.hasValue()?{message:null!==(t=this.config.requiredMessage)&&void 0!==t?t:this.getCustomMessage("validations.requiredFilter"),type:"error"}:!1===this.config.enabled&&this.config.disabledMessage?{message:this.config.disabledMessage,type:"warning"}:{message:null!==(i=this.config.defaultMessage)&&void 0!==i?i:this.getLabel(!0),type:"default"}}getTypeChip(t){switch(t){case"default":return"secondary";case"warning":return"warning-light";case"error":return"error-light";case"success":return"success-light";default:return t}}initKeyboardManager(){this._keyboardManager=new v({element:this._filterItemElement,propagate:!0}),this._keyboardManager.bind("Escape",(()=>this.hideDetail()))}connectedCallback(){this.initKeyboardManager()}disconnectedCallback(){this._keyboardManager.unbindAllShortcutKeys()}render(){const t=this.getLeftIconName(),{type:i,message:r}=this.getTooltipMessage();return e(s,null,this.showChips&&e("ez-tooltip",{id:this.config.id,message:r,type:i,active:!this.detailIsVisible,strategy:"fixed"},e("ez-chip",{id:this.config.id,ref:t=>this._chipElement=t,label:this.getLabel(),value:this.getEnabledChip(),onClick:t=>this.togglePopover(t),disableAutoUpdateValue:!0,type:this.getTypeChip(i),enabled:this.config.enabled},t&&e("ez-icon",{ref:t=>this._leftIconElement=t,iconName:t,slot:"leftIcon"}),e("ez-icon",{ref:t=>this._rightIconElement=t,iconName:this.getRightIconName(),slot:"rightIcon",id:"removeFilter",onClick:t=>this.clearFilter(t)}))),e("ez-popover-core",{ref:t=>this._popover=t,onEzVisibilityChange:t=>this.handleVisibilityPopover(t)},e("snk-filter-detail",{ref:t=>this._filterDetail=t,key:this.config.id,config:this.config,getMessage:this.getMessage,class:"sc-snk-filter-bar snk-filter__popover ez-padding--small ez-elevation--16","data-element-id":this._idSnkFilterDetail,showHardFixed:this.showChips&&!this.config.required,removalBlocked:this.config.required})))}get _filterItemElement(){return r(this)}static get watchers(){return{detailIsVisible:["observeDetailIsVisible"]}}};D.style="ez-popover-core.sc-snk-filter-item{--ez-popover__box--z-index:var(--elevation--20, 20);--ez-popover__box--overlay-z-index:var(--elevation--16, 16)}ez-chip.sc-snk-filter-item{--ez-label-chip__label__container--margin:var(--space--2, 2px)}";const S="__SHOWMORE__",B=class{constructor(e){t(this,e),this.snkItemSelected=i(this,"snkItemSelected",7),this._preselection=-1,this.innerClickCheck=(t,i)=>i.id!=b.MODAL_ELEMENT_ID||(this._detailIsVisible=!1,!1),this._filterArgument=void 0,this._showAll=void 0,this.label=void 0,this.iconName=void 0,this.items=void 0,this.getMessage=void 0,this.emptyText=void 0,this.findFilterText=void 0,this.buttonClass=void 0}showDetail(){this._preselection=-1,this._floatingID=b.float(this._popover,this._popoverContainer,{autoClose:!0,innerClickTest:this.innerClickCheck,backClickListener:()=>this.onListCloseCallback(),useOverlay:!0}),this._detailIsVisible=!0,this._showAll=!1,this._filterArgument="",this._filterInput.setFocus()}async hideDetail(){null!=this._floatingID&&b.close(this._floatingID)}onListCloseCallback(){this._floatingID=void 0,this._detailIsVisible=!1}buttonClick(){this._detailIsVisible?this.hideDetail():this.showDetail()}componentDidLoad(){this._element&&h.addIDInfo(this._element)}componentDidRender(){null==this._floatingID&&this._popover&&this._popover.remove()}buildIdElement(t,i){if(!t)return;const e={id:i};t.removeAttribute(h.DATA_ELEMENT_ID_ATTRIBUTE_NAME),h.addIDInfoIfNotExists(t,"filterItemList",e)}buildItemElement(t){const i=++this._selectableItemsCount;return e("button",{ref:i=>i&&this.buildIdElement(i,t.label),id:`filter-item${i}`,onFocusin:()=>this._preselection=i,class:"ez-col ez-col--sd-12 ez-align--middle ez-padding--small sc-snk-filter-bar snk-filter-bar__filter-list-item",onClick:()=>this.itemSelected(t.name),name:t.label,key:i},t.iconName?e("ez-icon",{iconName:t.iconName,size:"small",class:`ez-padding-right--extra-small sc-snk-filter-bar snk-filter-bar__filter-list-item__icon ${t.iconClass||""}`}):void 0,e("div",{class:`ez-text ez-text--medium ez-text--primary ez-padding--extra-small sc-snk-filter-bar snk-filter-bar__filter-list-item__label ${t.labelClass||""}`},t.label))}itemSelected(t){t===S?this._showAll=!0:(this.hideDetail(),this.snkItemSelected.emit(t))}getFilterItems(){const t=this.items?g.applyStringFilter(this._filterArgument,this.items.filter((t=>"FILTER"===t.kind))):[];return 0===t.length?e("div",{class:"ez-text ez-text--medium ez-text--primary ez-padding--extra-small sc-snk-filter-bar snk-filter-bar__filter-list-items-container--empty"},this.emptyText):(!this._filterArgument&&!this._showAll&&t.length>6&&(t.splice(5),t.push({kind:"INTERNAL",label:this.getMessage("snkFilterList.showMore"),iconName:"dots-horizontal",name:S,iconClass:"snk-filter-bar__filter-list-item__icon--secondary",labelClass:"snk-filter-bar__filter-list-item__label--secondary"})),this._selectableItemsCount=0,e("div",{class:"sc-snk-filter-bar snk-filter-bar__filter-list-items-container"},t.map((t=>this.buildItemElement(t)))))}getFooterItems(){return this.items.filter((t=>"FOOTER"===t.kind))}keyDownHandler(t){switch(t.key){case"ArrowDown":this.changePreselection(this._preselection+1),t.stopImmediatePropagation(),t.stopPropagation(),t.preventDefault();break;case"ArrowUp":this.changePreselection(this._preselection-1),t.stopImmediatePropagation(),t.stopPropagation(),t.preventDefault()}}changePreselection(t){if(t<0&&(t=this._selectableItemsCount),this._preselection=t>this._selectableItemsCount?0:t,0===this._preselection)this._filterInput.setFocus();else{const t=this._element.querySelector(`#filter-item${this._preselection}`);t&&t.focus()}}render(){return e(s,{class:"ez-flex ez-flex--column"},e("ez-button",{class:this.buttonClass,label:this.label,onClick:()=>this.buttonClick(),mode:this.iconName?"icon":void 0,iconName:this.iconName,size:"small"},e("slot",{name:"leftIcon"})),e("section",{class:"ez-margin-top--small sc-snk-filter-bar snk-filter__popover-container",ref:t=>this._popoverContainer=t},e("div",{class:"sc-snk-filter-bar snk-filter__popover ez-padding--small ez-elevation--4",ref:t=>this._popover=t},e("ez-filter-input",{ref:t=>this._filterInput=t,"data-element-id":"serachFilters",mode:"slim",label:this.findFilterText,value:this._filterArgument,onEzChange:t=>this._filterArgument=t.detail,onFocus:()=>this._preselection=0}),this.getFilterItems(),e("hr",{class:"sc-snk-filter-bar snk-filter__popover-rule"}),this.items?this.getFooterItems().map((t=>this.buildItemElement(t))):void 0)))}get _element(){return r(this)}},E=class{constructor(i){t(this,i),this._isUserSup=!1,this.filters=[],this.filtersWithError=[],this.getMessage=void 0,this.configName=void 0,this.filterConfig=void 0,this.opened=!1,this.applyFilters=void 0,this.closeModal=void 0,this.addPersonalizedFilter=void 0,this.editPersonalizedFilter=void 0,this.deletePersonalizedFilter=void 0,this.filtersToDelete=[],this.filterDefaultToDelete=void 0,this.disablePersonalizedFilter=void 0,this.filterCustomConfigInterceptor=void 0}filterConfigChangeHandler(t){this.filters=o.copy(t),this.validateFilters()}deletePersonalizedFilterListener(t){this.filtersToDelete.push(t.detail)}getCustomMessage(t,i){var e;return null===(e=this.getMessage)||void 0===e?void 0:e.call(this,`snkFilterBar.filterModal.${t}`,i)}handleClearAll(){const{customFilters:t,quickFilters:i,otherFilters:e,multiListFilters:s}=this.filters.reduce(((t,i)=>i.type===y.MULTI_LIST?(t.multiListFilters.push(i),t):i.filterType===T.QUICK_FILTER?(t.quickFilters.push(i),t):i.filterType===T.CUSTOM_FILTER?(t.customFilters.push(i),t):i.filterType===T.OTHER_FILTERS?(t.otherFilters.push(i),t):t),{quickFilters:[],customFilters:[],otherFilters:[],multiListFilters:[]});this.handleClearFilterList(i),this.handleClearCustomFilters(t),this.handleClearOthersFilters(e),s.forEach((t=>this.handleClearSigleFilter(t))),l(this)}handleClearOthersFilters(t){this.filters=this.filters.map((i=>t.includes(i)?Object.assign(Object.assign({},i),{value:void 0}):i))}handleClearCustomFilters(t){this.filters.forEach(((i,e)=>{i.filterType===T.CUSTOM_FILTER&&(this.filters[e]=this.clearAllCustomFilter(t).shift())}))}clearAllCustomFilter(t){return t.map((t=>{const i=Object.assign({},t);return delete i.value,i.visible=!1,i.groupedItems&&(i.groupedItems=this.clearAllCustomFilter(i.groupedItems)),i}))}hasChangeToSave(){return o.objectToString(this.filters)!=o.objectToString(this.filters)}handleClose(){if(this.hasChangeToSave())return $.confirm(this.getCustomMessage("validations.notSaved.title"),this.getCustomMessage("validations.notSaved.message")).then((t=>{t&&this.closeModal()}));this.closeModal()}handleApplyFilters(){if(!this.validateFilters())return;const t=this.filters.find((t=>t.filterType===T.CUSTOM_FILTER||t.filterType===T.DEFAULT_FILTER));this.isValidCustomFilter(t)&&this.applyFilters(this.filters),this.filtersToDelete.length>0&&(this.filtersToDelete.forEach((t=>{this.deletePersonalizedFilter(t,this.configName)})),this.filtersToDelete=[]),this.filterDefaultToDelete&&(this.deletePersonalizedFilter(this.filterDefaultToDelete,this.configName,!0),this._defaultFilter=void 0,this.filterDefaultToDelete=void 0)}isValidCustomFilter(t){return!!F.validateVariableValues(t)||($.alert(this.getCustomMessage("validations.notFullFilled.title"),this.getCustomMessage("validations.notFullFilled.message")),!1)}modalActionListener(t){switch(t.detail){case I.CANCEL:this.handleClearAll();break;case I.OK:this.handleApplyFilters();break;case I.CLOSE:this.handleClose()}}handleFilterChange(t){t.stopPropagation();const i=t.detail;let e=this.filters.map((t=>t.id===i.id?i:t));this.filterCustomConfigInterceptor&&(e=this.filterCustomConfigInterceptor(e)),this.filters=o.copy(e)}handleClearFilterList(t){this.filters=this.filters.map((i=>t.includes(i)?Object.assign(Object.assign({},i),{value:void 0}):i))}handleClearSigleFilter(t){if(y.MULTI_LIST===t.type){let i=o.copy(t);this.uncheckFilterValues(i.value);const e=o.copy(this.filters),s=e.findIndex((i=>i.id===t.id));return e.splice(s,1,i),void(this.filters=o.copy(e))}if(y.CHECK_BOX_LIST===t.type){const i=o.copy(this.filters);return i.find((i=>i.id===t.id)).value=void 0,void(this.filters=o.copy(i))}this.filters.find((i=>i.id===t.id)).value=void 0,this.filters=o.copy(this.filters)}uncheckFilterValues(t){return t.forEach((t=>{t&&(t.check=!1)})),t}validateFilters(){const t=L(this.filters);return this.filtersWithError=t.map((t=>t.id)),0===t.length||(t.forEach((t=>{const i=this._element.querySelector(`#filter-item-${t.id}`);i&&(i.errorMessage=t.requiredMessage||this.getCustomMessage("validations.requiredFilter"))})),!1)}renderFilterItem(t,i){return e("snk-filter-modal-item",{key:`modal-item-${t.id}`,class:i?"ez-col ez-col--sd-12":"ez-col ez-col--sd-6 ez-padding--small",filterItem:t,configName:this.configName,onFilterChange:t=>this.handleFilterChange(t),onEditPersonalizedFilter:t=>this.editPersonalizedFilter(t.detail),onAddPersonalizedFilter:()=>this.addPersonalizedFilter()})}isDefaultFilterNumberVariation(t){var i;return t.type===y.NUMBER&&(!t.props.variation||(null===(i=t.props)||void 0===i?void 0:i.variation)===C.DEFAULT)}mountFiltersLines(t){let i=0,e=!1;const s={};for(let r=0;r<t.length;r++){s[i]=s[i]||[];const l=t[r],a=r===t.length-1,n=l.type===y.TEXT||this.isDefaultFilterNumberVariation(l),o=!a&&(t[r+1].type===y.TEXT||this.isDefaultFilterNumberVariation(t[r+1]));n&&o||e?(s[i].push(l),e=s[i].length<2,2===s[i].length&&++i):(s[i]=s[i]||[],s[i].push(l),++i)}return Object.values(s)}renderFilterLine(t){const i=1===t.length;return t.map((t=>this.renderFilterItem(t,i)))}getIformedFiltersCount(t){let i=0;return t.forEach((t=>{var e,s,r,l,a,n,o,h;const d=this.filterConfig.find((i=>i.id===t.id));y.MULTI_LIST!==d.type?y.CHECK_BOX_LIST!==d.type?y.PERIOD!==d.type?null==d.groupedItems?d.value&&i++:i=d.groupedItems.filter((t=>t.visible)).length:((null===(o=d.value)||void 0===o?void 0:o.start)||(null===(h=d.value)||void 0===h?void 0:h.end))&&i++:i+=Object.entries(null!==(n=d.value)&&void 0!==n?n:{}).filter((([t,i])=>!0===i)).map((([t,i])=>t)).length:i+=null!==(a=null===(l=null===(r=null!==(s=null===(e=d.value)||void 0===e?void 0:e.elements)&&void 0!==s?s:d.value)||void 0===r?void 0:r.filter((t=>null==t?void 0:t.check)))||void 0===l?void 0:l.length)&&void 0!==a?a:0})),i}renderCollapsibleFilterBox(t,i,s,r=!0){if(!i.length)return null;const l=this.getIformedFiltersCount(i),a=this.mountFiltersLines(i),n=this.filtersWithError.filter((t=>i.some((i=>i.id===t)))).length;return e("ez-collapsible-box",{class:"snk-filter-modal__collapsible-box",headerSize:"medium",value:!0,label:t},e("div",{class:"ez-flex ez-flex--justify-end grow",slot:"rightSlot"},!!l&&e("ez-badge",{class:"ez-badge--primary-subtle",label:null==l?void 0:l.toString()}),!!n&&e("ez-badge",{class:"ez-badge--error-subtle",label:null==n?void 0:n.toString()})),e("div",{class:"ez-row snk-filter-modal__rendered-items"},a.map(this.renderFilterLine.bind(this))),r&&e("div",{class:"ez-flex ez-flex--justify-end grow"},e("ez-button",{class:"ez-button--tertiary",size:"medium",label:this.getCustomMessage("clearModal"),onClick:()=>s?this.handleClearSigleFilter(i[0]):this.handleClearFilterList(i)})))}handleDeleteFilter(){this._application.confirm(this.getMessage("snkPersonalizedFilter.deleteConfirm.title"),this.getMessage("snkPersonalizedFilter.info.deleteDefaultFilterConfirm"),"alert-circle-inverted","critical").then((t=>{t&&(this.filterDefaultToDelete=this._defaultFilter,this.filters=this.filters.filter((t=>t.id!==T.DEFAULT_FILTER)))}))}handleActionSelectedDefaultFilter({detail:t}){switch(t){case N.CREATE:this.addPersonalizedFilter(!0);break;case N.EDIT:this.editPersonalizedFilter(this._defaultFilter.id,!0);break;case N.REMOVE:this.handleDeleteFilter()}}getCustomFilter(t){return t.filter((t=>t.filterType===T.CUSTOM_FILTER))}getDefaultFilter(t){return t.find((t=>t.id===w.id))}async componentWillLoad(){this._application=c.getContextValue("__SNK__APPLICATION__"),this._isUserSup=await this._application.isUserSup(),this.filters=o.copy(this.filterConfig)}componentWillRender(){this._modalTitle=this.getCustomMessage("title"),this._okButtonLabel=this.getCustomMessage("okButtonLabel"),this._cancelButtonLabel=this.getCustomMessage("cancelButtonLabel")}componentDidLoad(){this.validateFilters()}render(){this._defaultFilter=this._isUserSup?this.getDefaultFilter(this.filters):void 0;const t=this.getCustomFilter(this.filters),i=this.filters.filter((t=>t.filterType===T.QUICK_FILTER)),s=this.filters.filter((t=>t.filterType===T.OTHER_FILTERS));return e("ez-modal",{opened:this.opened,modalSize:"col--sd-3",align:"right",heightMode:"full",closeEsc:!0},e("ez-modal-container",{class:"snk-filter-modal__container",modalTitle:this._modalTitle,cancelButtonLabel:this._cancelButtonLabel,okButtonLabel:this._okButtonLabel,onEzModalAction:this.modalActionListener.bind(this)},e("div",{class:"snk-filter-modal__content ez-col--sd-12"},this._isUserSup&&e("snk-default-filter",{getMessage:this.getCustomMessage.bind(this),hasDefaultFilter:!!this._defaultFilter,onActionSelected:this.handleActionSelectedDefaultFilter.bind(this)}),!this.disablePersonalizedFilter&&this.renderCollapsibleFilterBox(this.getCustomMessage("customFilters"),t,!1,!1),this.renderCollapsibleFilterBox(this.getCustomMessage("quickFilters"),i,!1),s.map((t=>this.renderCollapsibleFilterBox(t.label,[t],!0))))))}get _element(){return r(this)}static get watchers(){return{filterConfig:["filterConfigChangeHandler"]}}};E.style="ez-modal{--ez-modal-content-padding:24px 12px;--ez-modal-content-min-width:370px}.snk-filter-modal__container{min-width:344px;overflow:hidden}.snk-filter-modal__content{display:flex;flex-direction:column;gap:var(--space--medium, 12px);padding-right:var(--space--3xs, 4px)}.snk-filter-modal__collapsible-box{border:var(--border--small, 1px solid) var(--color--strokes, #DCE0E8);border-radius:var(--border--radius-medium);padding:var(--space--medium, 12px) var(--space--small, 6px)}.snk-filter-modal__rendered-items{max-height:760px}.snk-filter-modal__rendered-items::-webkit-scrollbar{width:var(--space--small);min-width:var(--space--small);max-width:var(--space--small)}";export{P as snk_filter_bar,D as snk_filter_item,B as snk_filter_list,E as snk_filter_modal}
@@ -1 +1 @@
1
- import{r as t,h as e,H as i,g as s}from"./p-d8d8169b.js";import{ApplicationContext as o,ObjectUtils as r,UserInterface as n,DataType as l,ElementIDUtils as a}from"@sankhyalabs/core";import{ApplicationUtils as d,DialogType as h}from"@sankhyalabs/ezui/dist/collection/utils";import{I as c}from"./p-8f3f2306.js";import{D as u,a as p,b as m}from"./p-0f3698af.js";import{R as v}from"./p-9019a32f.js";import{D as x}from"./p-6d241415.js";import{S as g}from"./p-626b7a17.js";import"./p-e8c49c12.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-88ed2793.js";import"./p-ff1990ad.js";import"./p-7fc46290.js";import"./p-8d884fab.js";import"@sankhyalabs/core/dist/dataunit/metadata/DataType";import"./p-7dd49d15.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";class f{constructor(t,e){this._selectedNumber=0,this._getMessage=t,this._selectedNumber=e}setExportOption(t,e){const i=this.getExportGroupName();t===u.EXPORT_TO_PDF&&e.push(this.getExportToPDF(i)),t===u.EXPORT_TO_XLS&&e.push(this.getExportToXLS(i)),this.setExportCurrentPage(t,e),this._selectedNumber>0&&this.setExportAllRecords(t,e),this.setExportByEmail(t,e)}setExportCurrentPage(t,e){var i;const s=[u.EXPORT_PAGE_TO_PDF,u.EXPORT_PAGE_TO_XLS];if(t===u.EXPORT_CURRENT_PAGE&&e.push(this.getCurrentPage()),s.includes(t)){let s=e.find((t=>t.id===u.EXPORT_CURRENT_PAGE));null==s&&(e.push(this.getCurrentPage()),s=e.find((t=>t.id===u.EXPORT_CURRENT_PAGE))),(null===(i=null==s?void 0:s.children)||void 0===i?void 0:i.length)||(s.children=[]),t===u.EXPORT_PAGE_TO_PDF&&s.children.push(this.getExportPageToPDF()),t===u.EXPORT_PAGE_TO_XLS&&s.children.push(this.getExportPageToXLS())}}setExportAllRecords(t,e){var i;const s=[u.EXPORT_ALL_RECORDS_TO_PDF,u.EXPORT_ALL_RECORDS_TO_XLS];if(t===u.EXPORT_ALL_RECORDS&&e.push(this.getAllRecords()),s.includes(t)){let s=e.find((t=>t.id===u.EXPORT_ALL_RECORDS));null==s&&(e.push(this.getAllRecords()),s=e.find((t=>t.id===u.EXPORT_ALL_RECORDS))),(null===(i=s.children)||void 0===i?void 0:i.length)||(s.children=[]),t===u.EXPORT_ALL_RECORDS_TO_PDF&&s.children.push(this.getExportAllRecordsToPDF()),t===u.EXPORT_ALL_RECORDS_TO_XLS&&s.children.push(this.getExportAllRecordsToXLS())}}setExportByEmail(t,e){t===u.EXPORT_BY_EMAIL&&e.push(this.getExportByEmail())}getExportToPDF(t){return{id:u.EXPORT_TO_PDF,label:"PDF (.pdf)",group:t}}getExportToXLS(t){return{id:u.EXPORT_TO_XLS,label:`${this._getMessage("snkDataExporter.label.spreadsheet")} (.xls)`,group:t}}getCurrentPage(){return{id:u.EXPORT_CURRENT_PAGE,label:this._getMessage("snkDataExporter.label.currentPage"),group:this._getMessage("snkDataExporter.group.custom")}}getAllRecords(){return{id:u.EXPORT_ALL_RECORDS,label:this._getMessage("snkDataExporter.label.allRecords"),group:this._getMessage("snkDataExporter.group.custom")}}getExportPageToPDF(){return{id:u.EXPORT_PAGE_TO_PDF,label:"PDF (.pdf)"}}getExportPageToXLS(){return{id:u.EXPORT_PAGE_TO_XLS,label:`${this._getMessage("snkDataExporter.label.spreadsheet")} (.xls)`}}getExportAllRecordsToPDF(){return{id:u.EXPORT_ALL_RECORDS_TO_PDF,label:"PDF (.pdf)"}}getExportAllRecordsToXLS(){return{id:u.EXPORT_ALL_RECORDS_TO_XLS,label:`${this._getMessage("snkDataExporter.label.spreadsheet")} (.xlsx)`}}getExportByEmail(){return{id:u.EXPORT_BY_EMAIL,label:`${this._getMessage("snkDataExporter.label.sendByEmail")}...`}}getExportGroupName(){return 1===this._selectedNumber?this._getMessage("snkDataExporter.group.export.selectedLine"):this._selectedNumber>1?this._getMessage("snkDataExporter.group.export.multiSelected").replace("{0}",this._selectedNumber.toString()):this._getMessage("snkDataExporter.group.export.default")}}function b(t){const e=[];let i=0;for(const s of t){if(i+=s.width,i>=860)break;e.push(s)}return e}function E(t){return Object.keys(u).find((e=>u[e]===t))}class w{constructor(t){this._provider=t}async getParsedColumns(){return b(await this._provider.getColumnsMetadata())}async getColumns(t){var e;return(null===(e=E(null==t?void 0:t.exportOption))||void 0===e?void 0:e.includes("PDF"))?await this.getParsedColumns():await this._provider.getColumnsMetadata()}async getParams(t){var e,i,s,o,r,n;const l=null===(i=(e=this._provider).getFilters)||void 0===i?void 0:i.call(e),a=await this.getColumns(t),d=null===(o=(s=this._provider).getOrders)||void 0===o?void 0:o.call(s),h=null===(n=(r=this._provider).getResourceURI)||void 0===n?void 0:n.call(r),c=this._provider.getSelectedIDs(),p=t.exportOption,m=[u.EXPORT_PAGE_TO_PDF,u.EXPORT_PAGE_TO_XLS];delete t.exportOption;let v=Object.assign({filters:l,columns:a,sort:d,resourceURI:h,selectedIDs:c.slice(0,this._provider.getExportLimit())},t);if(m.includes(p)||"page"==t.type){const t=this._provider.getOffset(),e=this._provider.getPageSize();v=Object.assign(Object.assign({},v),{offset:t,limit:e,selectedIDs:[]})}else"all"==t.type&&(v=Object.assign(Object.assign({},v),{offset:0,limit:this._provider.getExportLimit(),selectedIDs:[]}));return Promise.resolve(v)}async executeExport(t){const e=await this.getParams(t),{methodName:i}=e,s=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(s=Object.getOwnPropertySymbols(t);o<s.length;o++)e.indexOf(s[o])<0&&Object.prototype.propertyIsEnumerable.call(t,s[o])&&(i[s[o]]=t[s[o]])}return i}(e,["methodName"]),n=`${o.getContextValue("__SNK__APPLICATION__").getModuleName()}@DataExporterSPBean.${i}`,l={serviceName:n,requestBody:s};return new Promise(((t,e)=>{x.get().callServiceBroker(n,r.objectToString(l)).then((e=>t(this.getFormatResponse(e)))).catch((t=>e(t)))}))}getFormatResponse(t){var e;const i=null===(e=null==t?void 0:t.json)||void 0===e?void 0:e.$;if(null!=i)return r.stringToObject(i)}}class D{constructor(t){this._provider=t}async getParsedColumns(){return b(await this._provider.getColumnsMetadata())}async executeExport(t){var e;const{methodName:i,gridTitle:s}=t,o=await this._provider.getRecords(t.type),r=(null===(e=E(null==t?void 0:t.exportOption))||void 0===e?void 0:e.includes("PDF"))?await this.getParsedColumns():await this._provider.getColumnsMetadata(),[n,l]=this.getExecutor(i),a={serviceName:n,requestBody:{grid:{gridTitle:s,columns:this.buildColumnsObject(r),rows:this.buildRowsObject(r,o),customOptions:{xlsxExtension:!1}}}};return new Promise(((t,e)=>{x.get().callServiceBroker(n,a).then((e=>t(l(e)))).catch((t=>e(t)))}))}getExecutor(t){return"exportToPDF"===t?["GridPDFBuilderSP.buildPDFFromJson",t=>({fileSessionKey:t.chavePDF.valor,canPrint:"S"===t.permiteImprimir.valor,canExport:"S"===t.permiteExportar.valor,canSendEmail:"S"===t.canSendEmail.valor,useAppPrint:!0})]:["GridXLSBuilderSP.buildXLSFromJson",t=>({fileSessionKey:t.chaveXLS.valor,canPrint:!0,canExport:!0,canSendEmail:!0,useAppPrint:!1})]}buildColumnsObject(t){return{column:t.map(((t,e)=>{const{label:i,id:s,width:o,userInterface:r}=t;return Object.assign({index:e+1,id:s,label:i,width:o,presentationType:"P"},k[r]||{type:"S",align:"left"})}))}}buildRowsObject(t,e){return{row:e.map((e=>{const i={};return t.forEach(((t,s)=>i["c"+(s+1)]={$:this.formatValue(e,t)})),i}))}}formatValue(t,e){return null!=this._provider.formatValue?this._provider.formatValue(t,e):t[e.id]||""}}const k={[n.DATE]:{type:"D",align:"center"},[n.DATETIME]:{type:"H",align:"center"},[n.TIME]:{type:"I",align:"right"},[n.ELAPSEDTIME]:{type:"I",align:"right"},[n.DECIMALNUMBER]:{type:"F",align:"right"},[n.INTEGERNUMBER]:{type:"I",align:"right"},[n.SEARCH]:{type:"S",align:"right"}},y=class{constructor(e){t(this,e),this._selectedNumber=0,this._customPrefix="$custom$",this._releasedToExport=[u.EXPORT_TO_PDF,u.EXPORT_TO_XLS,u.EXPORT_BY_EMAIL,u.EXPORT_PDF_TO_EMAIL,u.EXPORT_XLS_TO_EMAIL,u.EXPORT_PAGE_TO_PDF,u.EXPORT_PAGE_TO_XLS,u.EXPORT_ALL_RECORDS_TO_PDF,u.EXPORT_ALL_RECORDS_TO_XLS],this._items=[],this._showDropdown=!1,this.provider=null,this.messagesBuilder=void 0}async exportByEmail(){const t=this._selectedNumber;this._snkEmailSender.open({type:t>0?"selection":"all",selectedRows:t,email:{attachments:[{name:this._appLabel}]},resolver:({type:t,format:e,email:{to:i,subject:s,message:o}})=>{var r;const n=null!==(r=m[null==e?void 0:e.toUpperCase()])&&void 0!==r?r:m.PDF;this.resolveExporter({type:t,methodName:n,to:i,subject:s,message:o,fileName:this._appLabel,gridTitle:this._appLabel},(()=>{this._snkEmailSender.close(),d.info(this.getMessage("snkDataExporter.message.emailSuccess"),{iconName:"check"})}))}})}getMessage(t,e){if(null==this.messagesBuilder){const t=g.getNearestInstance(this._element);t&&(this.messagesBuilder=t.messagesBuilder)}return this.messagesBuilder.getMessage(t,e)}positionDropdown(){var t;const e=null===(t=this._ezButton)||void 0===t?void 0:t.getBoundingClientRect();null!=e&&null!=this._dropdownParent&&(this._dropdownParent.style.top=e.y+e.height+5+"px",this._dropdownParent.style.left=e.x+"px")}closeDropdown(t){const e=null==t?void 0:t.target;null!=e&&(e.closest(".snk-data-exporter")||(this._showDropdown=!1))}setEvents(){document.removeEventListener("click",this.closeDropdown.bind(this)),document.addEventListener("click",this.closeDropdown.bind(this)),document.removeEventListener("scroll",this.positionDropdown.bind(this)),document.addEventListener("scroll",this.positionDropdown.bind(this))}controlDropdown(){this._showDropdown=!this._showDropdown}async resolveExporter(t,e){null!=this.provider&&null!=t&&null!=e&&this.getExporterStrategy().executeExport(t).then((t=>e(t))).catch((t=>{console.error(t);let{title:e,message:i,statusMessage:s}=t||{};d.error(e||this.getMessage("snkDataExporter.message.exportError"),s||i||this.getMessage("snkDataExporter.message.unknownFailure"))}))}getExporterStrategy(){return null==this.provider.getRecords?new w(this.provider):new D(this.provider)}getOptionKey(t){return Object.keys(u).find((e=>u[e]===t))}getExportType(t){return t===u.EXPORT_ALL_RECORDS_TO_PDF||t===u.EXPORT_ALL_RECORDS_TO_XLS?c.ALL:t===u.EXPORT_PAGE_TO_PDF||t===u.EXPORT_PAGE_TO_XLS?c.PAGE:c.SELECTION}async dispatchExporter(t){var e,i,s;const r=this.getOptionKey(t),n=null!==(e=p[r])&&void 0!==e?e:p.EXPORT_TO_PDF,l={methodName:u[`EXPORT_TO_${n}`],fileName:this._appLabel,gridTitle:this._appLabel,exportOption:t,limit:null===(s=null===(i=this.provider)||void 0===i?void 0:i.getExportLimit)||void 0===s?void 0:s.call(i),type:this.getExportType(t)};await this.resolveExporter(l,(t=>{t.canExport||n===p.EXPORT_TO_PDF?function({fileSessionKey:t,isDownload:e}){const i=o.getContextValue("__SNK__APPLICATION__");window.open(`${window.location.protocol}//${window.location.hostname}:${window.location.port}/mge/visualizadorArquivos.mge?chaveArquivo=${t}${e?"&download=S":""}`),d.info(function(t){var e;return null===(e=null==t?void 0:t.messagesBuilder)||void 0===e?void 0:e.getMessage("fileViewer.message.exportSuccess",void 0)}(i),{iconName:"check"})}(Object.assign(Object.assign({},t),{fileType:n})):d.error(this.getMessage("snkDataExporter.title.permission"),this.getMessage("snkDataExporter.message.exportPermission"))}))}async processExporter(t){var e,i,s,o,r,n,l;const a=null==t?void 0:t.detail,c=[u.EXPORT_PAGE_TO_PDF,u.EXPORT_PAGE_TO_XLS],p=null===(e=null==a?void 0:a.id)||void 0===e?void 0:e.includes(this._customPrefix);if((null==a?void 0:a.id)===u.EXPORT_CURRENT_PAGE)return;const m=null===(i=this.provider)||void 0===i?void 0:i.getSelectedIDs(),v=null===(s=this.provider)||void 0===s?void 0:s.getTotalRecords(),x=null===(r=null===(o=this.provider)||void 0===o?void 0:o.getPageSize)||void 0===r?void 0:r.call(o),g=null===(l=null===(n=this.provider)||void 0===n?void 0:n.getExportLimit)||void 0===l?void 0:l.call(n);let f=!1;if(c.includes(null==a?void 0:a.id)&&x<=g||p?f=!1:(null==m?void 0:m.length)?f=m.length>g:v>g&&(f=!0),f){const t=g.toLocaleString("pt-BR",{minimumFractionDigits:0}),e={title:this.getMessage("snkDataExporter.limitExceeded.title"),description:`\n ${this.getMessage("snkDataExporter.limitExceeded.description",{limit:t})}\n <br/><br/>\n <b>\n ${this.getMessage("snkDataExporter.limitExceeded.subdescription")}\n </b>\n `,cancel:this.getMessage("snkDataExporter.limitExceeded.cancel"),confirm:this.getMessage("snkDataExporter.limitExceeded.continue")};if(!await d.confirm(e.title,e.description,null,h.WARN,{labelCancel:e.cancel,labelConfirm:e.confirm}))return}if(p)return this.openPersonalizedReports(a.id),void(this._showDropdown=!1);this.getFilteredReleasedToExport().includes(null==a?void 0:a.id)&&(a.id===u.EXPORT_BY_EMAIL?this.exportByEmail():this.dispatchExporter(a.id),this._showDropdown=!1)}getFilteredReleasedToExport(){var t,e;if(null==this.provider)return this._releasedToExport;const i=null===(e=(t=this.provider).getHiddenOptions)||void 0===e?void 0:e.call(t);return null==i?this._releasedToExport:this._releasedToExport.filter((t=>!i.includes(t)))}loadItems(){const t=[];this.getFilteredReleasedToExport().forEach((e=>{var i;null===(i=this._itemBuilder)||void 0===i||i.setExportOption(e,t)})),this.loadPersonalizedItems(t)}async loadPersonalizedItems(t){var e,i;const s=null===(i=null===(e=this.provider)||void 0===e?void 0:e.getRecordID)||void 0===i?void 0:i.call(e);if(null==s)return void(this._items=t);const n=await function(t){const e=`${o.getContextValue("__SNK__APPLICATION__").getModuleName()}@DataExporterSPBean.getPersonalizedReports`,i={serviceName:e,requestBody:t};return new Promise(((t,s)=>x.get().callServiceBroker(e,r.objectToString(i)).then((e=>t(function(t){var e;const i=null===(e=null==t?void 0:t.json)||void 0===e?void 0:e.$;if(null!=i)return r.stringToObject(i)}(e)))).catch((t=>s(t)))))}({recordID:s});null==n||n.forEach((e=>{t.push({id:`${this._customPrefix}_${e.ID}`,label:e.label,group:this.getMessage("snkDataExporter.group.custom")})})),this._items=t}openPersonalizedReports(t){var e,i;const s=[],o=(null==t?void 0:t.replace(this._customPrefix,""))||"";null===(i=null===(e=this.provider)||void 0===e?void 0:e.getSelectedIDs)||void 0===i||i.call(e).forEach((({name:t,type:e,value:i},o)=>{const r={fields:[]};0===o&&(s[`PK_${t}`]={type:this.parseDataType(e),value:i},s.pks=[]);const n={nome:`PK_${t}`,tipo:this.parseDataType(e),valor:i};r.fields.push(n),s.pks.push(r)})),this._application.openApp(`${v}${o}`,s)}parseDataType(t){switch(t){case l.NUMBER:return"I";case l.DATE:return"D";default:return"S"}}loadDropdown(){var t;this._selectedNumber=(null===(t=this.provider)||void 0===t?void 0:t.getSelectedNumber())||0,this._itemBuilder=new f(this.getMessage.bind(this),this._selectedNumber),this.loadItems()}getElementID(t){return{[a.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:a.getInternalIDInfo(t)}}canShowDropdown(){var t;return this._showDropdown&&(null===(t=this._items)||void 0===t?void 0:t.length)>0}componentWillLoad(){var t;this._application=o.getContextValue("__SNK__APPLICATION__"),null===(t=this._application)||void 0===t||t.getAppLabel().then((t=>this._appLabel=t)),this.setEvents()}componentDidLoad(){null!=this._element&&(a.addIDInfo(this._element),this.positionDropdown())}componentWillUpdate(){var t;this._showDropdown&&!(null===(t=this._items)||void 0===t?void 0:t.length)&&this.loadDropdown()}componentDidUpdate(){var t;this._showDropdown?this.positionDropdown():(null===(t=this._items)||void 0===t?void 0:t.length)>0&&(this._items=[])}render(){return e(i,null,e("div",{class:`snk-data-exporter\n ${this.canShowDropdown()?" ez-elevation--16":""}\n `},e("ez-button",Object.assign({ref:t=>this._ezButton=t,iconName:"file-download",size:"small",mode:"icon",title:this.getMessage("snkDataExporter.group.export.title"),onClick:()=>this.controlDropdown()},this.getElementID("button"))),e("div",Object.assign({ref:t=>this._dropdownParent=t,class:`snk-data-exporter__dropdown\n ${this.canShowDropdown()?"snk-data-exporter__dropdown--show":""}\n `},this.getElementID("dropdown")),this.canShowDropdown()&&e("ez-dropdown",Object.assign({items:this._items,onEzClick:t=>this.processExporter(t)},this.getElementID("dropdown"))))),this.canShowDropdown()&&e("div",Object.assign({class:"ez-scrim ez-scrim--light"},this.getElementID("ezScrim"))),e("snk-exporter-email-sender",Object.assign({ref:t=>this._snkEmailSender=t,getMessage:(t,e)=>this.getMessage(t,e)},this.getElementID("snkExporterEmailSender"))))}get _element(){return s(this)}};y.style=".sc-snk-data-exporter-h{display:flex;width:fit-content;height:fit-content}.snk-data-exporter.sc-snk-data-exporter{display:flex;width:fit-content;height:fit-content}.snk-data-exporter__dropdown.sc-snk-data-exporter{display:none}.snk-data-exporter__dropdown--show.sc-snk-data-exporter{display:flex;flex-direction:column;position:fixed}.snk-data-exporter__dropdown.sc-snk-data-exporter>ez-dropdown.sc-snk-data-exporter{position:relative}";export{y as snk_data_exporter}
1
+ import{r as t,h as e,f as i,g as s}from"./p-2c9d0870.js";import{ApplicationContext as o,ObjectUtils as r,UserInterface as n,DataType as l,ElementIDUtils as a}from"@sankhyalabs/core";import{ApplicationUtils as d,DialogType as h}from"@sankhyalabs/ezui/dist/collection/utils";import{I as c}from"./p-8f3f2306.js";import{D as u,a as p,b as m}from"./p-0f3698af.js";import{R as v}from"./p-9019a32f.js";import{D as x}from"./p-6768f176.js";import{S as f}from"./p-d714b6ca.js";import"./p-48a5c311.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-9e4555ab.js";import"./p-ff1990ad.js";import"./p-7ee6b1bf.js";import"./p-8d884fab.js";import"@sankhyalabs/core/dist/dataunit/metadata/DataType";import"./p-7dd49d15.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";class g{constructor(t,e){this._selectedNumber=0,this._getMessage=t,this._selectedNumber=e}setExportOption(t,e){const i=this.getExportGroupName();t===u.EXPORT_TO_PDF&&e.push(this.getExportToPDF(i)),t===u.EXPORT_TO_XLS&&e.push(this.getExportToXLS(i)),this.setExportCurrentPage(t,e),this._selectedNumber>0&&this.setExportAllRecords(t,e),this.setExportByEmail(t,e)}setExportCurrentPage(t,e){var i;const s=[u.EXPORT_PAGE_TO_PDF,u.EXPORT_PAGE_TO_XLS];if(t===u.EXPORT_CURRENT_PAGE&&e.push(this.getCurrentPage()),s.includes(t)){let s=e.find((t=>t.id===u.EXPORT_CURRENT_PAGE));null==s&&(e.push(this.getCurrentPage()),s=e.find((t=>t.id===u.EXPORT_CURRENT_PAGE))),(null===(i=null==s?void 0:s.children)||void 0===i?void 0:i.length)||(s.children=[]),t===u.EXPORT_PAGE_TO_PDF&&s.children.push(this.getExportPageToPDF()),t===u.EXPORT_PAGE_TO_XLS&&s.children.push(this.getExportPageToXLS())}}setExportAllRecords(t,e){var i;const s=[u.EXPORT_ALL_RECORDS_TO_PDF,u.EXPORT_ALL_RECORDS_TO_XLS];if(t===u.EXPORT_ALL_RECORDS&&e.push(this.getAllRecords()),s.includes(t)){let s=e.find((t=>t.id===u.EXPORT_ALL_RECORDS));null==s&&(e.push(this.getAllRecords()),s=e.find((t=>t.id===u.EXPORT_ALL_RECORDS))),(null===(i=s.children)||void 0===i?void 0:i.length)||(s.children=[]),t===u.EXPORT_ALL_RECORDS_TO_PDF&&s.children.push(this.getExportAllRecordsToPDF()),t===u.EXPORT_ALL_RECORDS_TO_XLS&&s.children.push(this.getExportAllRecordsToXLS())}}setExportByEmail(t,e){t===u.EXPORT_BY_EMAIL&&e.push(this.getExportByEmail())}getExportToPDF(t){return{id:u.EXPORT_TO_PDF,label:"PDF (.pdf)",group:t}}getExportToXLS(t){return{id:u.EXPORT_TO_XLS,label:`${this._getMessage("snkDataExporter.label.spreadsheet")} (.xls)`,group:t}}getCurrentPage(){return{id:u.EXPORT_CURRENT_PAGE,label:this._getMessage("snkDataExporter.label.currentPage"),group:this._getMessage("snkDataExporter.group.custom")}}getAllRecords(){return{id:u.EXPORT_ALL_RECORDS,label:this._getMessage("snkDataExporter.label.allRecords"),group:this._getMessage("snkDataExporter.group.custom")}}getExportPageToPDF(){return{id:u.EXPORT_PAGE_TO_PDF,label:"PDF (.pdf)"}}getExportPageToXLS(){return{id:u.EXPORT_PAGE_TO_XLS,label:`${this._getMessage("snkDataExporter.label.spreadsheet")} (.xls)`}}getExportAllRecordsToPDF(){return{id:u.EXPORT_ALL_RECORDS_TO_PDF,label:"PDF (.pdf)"}}getExportAllRecordsToXLS(){return{id:u.EXPORT_ALL_RECORDS_TO_XLS,label:`${this._getMessage("snkDataExporter.label.spreadsheet")} (.xlsx)`}}getExportByEmail(){return{id:u.EXPORT_BY_EMAIL,label:`${this._getMessage("snkDataExporter.label.sendByEmail")}...`}}getExportGroupName(){return 1===this._selectedNumber?this._getMessage("snkDataExporter.group.export.selectedLine"):this._selectedNumber>1?this._getMessage("snkDataExporter.group.export.multiSelected").replace("{0}",this._selectedNumber.toString()):this._getMessage("snkDataExporter.group.export.default")}}function b(t){const e=[];let i=0;for(const s of t){if(i+=s.width,i>=860)break;e.push(s)}return e}function E(t){return Object.keys(u).find((e=>u[e]===t))}class w{constructor(t){this._provider=t}async getParsedColumns(){return b(await this._provider.getColumnsMetadata())}async getColumns(t){var e;return(null===(e=E(null==t?void 0:t.exportOption))||void 0===e?void 0:e.includes("PDF"))?await this.getParsedColumns():await this._provider.getColumnsMetadata()}async getParams(t){var e,i,s,o,r,n;const l=null===(i=(e=this._provider).getFilters)||void 0===i?void 0:i.call(e),a=await this.getColumns(t),d=null===(o=(s=this._provider).getOrders)||void 0===o?void 0:o.call(s),h=null===(n=(r=this._provider).getResourceURI)||void 0===n?void 0:n.call(r),c=this._provider.getSelectedIDs(),p=t.exportOption,m=[u.EXPORT_PAGE_TO_PDF,u.EXPORT_PAGE_TO_XLS];delete t.exportOption;let v=Object.assign({filters:l,columns:a,sort:d,resourceURI:h,selectedIDs:c.slice(0,this._provider.getExportLimit())},t);if(m.includes(p)||"page"==t.type){const t=this._provider.getOffset(),e=this._provider.getPageSize();v=Object.assign(Object.assign({},v),{offset:t,limit:e,selectedIDs:[]})}else"all"==t.type&&(v=Object.assign(Object.assign({},v),{offset:0,limit:this._provider.getExportLimit(),selectedIDs:[]}));return Promise.resolve(v)}async executeExport(t){const e=await this.getParams(t),{methodName:i}=e,s=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(s=Object.getOwnPropertySymbols(t);o<s.length;o++)e.indexOf(s[o])<0&&Object.prototype.propertyIsEnumerable.call(t,s[o])&&(i[s[o]]=t[s[o]])}return i}(e,["methodName"]),n=`${o.getContextValue("__SNK__APPLICATION__").getModuleName()}@DataExporterSPBean.${i}`,l={serviceName:n,requestBody:s};return new Promise(((t,e)=>{x.get().callServiceBroker(n,r.objectToString(l)).then((e=>t(this.getFormatResponse(e)))).catch((t=>e(t)))}))}getFormatResponse(t){var e;const i=null===(e=null==t?void 0:t.json)||void 0===e?void 0:e.$;if(null!=i)return r.stringToObject(i)}}class D{constructor(t){this._provider=t}async getParsedColumns(){return b(await this._provider.getColumnsMetadata())}async executeExport(t){var e;const{methodName:i,gridTitle:s}=t,o=await this._provider.getRecords(t.type),r=(null===(e=E(null==t?void 0:t.exportOption))||void 0===e?void 0:e.includes("PDF"))?await this.getParsedColumns():await this._provider.getColumnsMetadata(),[n,l]=this.getExecutor(i),a={serviceName:n,requestBody:{grid:{gridTitle:s,columns:this.buildColumnsObject(r),rows:this.buildRowsObject(r,o),customOptions:{xlsxExtension:!1}}}};return new Promise(((t,e)=>{x.get().callServiceBroker(n,a).then((e=>t(l(e)))).catch((t=>e(t)))}))}getExecutor(t){return"exportToPDF"===t?["GridPDFBuilderSP.buildPDFFromJson",t=>({fileSessionKey:t.chavePDF.valor,canPrint:"S"===t.permiteImprimir.valor,canExport:"S"===t.permiteExportar.valor,canSendEmail:"S"===t.canSendEmail.valor,useAppPrint:!0})]:["GridXLSBuilderSP.buildXLSFromJson",t=>({fileSessionKey:t.chaveXLS.valor,canPrint:!0,canExport:!0,canSendEmail:!0,useAppPrint:!1})]}buildColumnsObject(t){return{column:t.map(((t,e)=>{const{label:i,id:s,width:o,userInterface:r}=t;return Object.assign({index:e+1,id:s,label:i,width:o,presentationType:"P"},k[r]||{type:"S",align:"left"})}))}}buildRowsObject(t,e){return{row:e.map((e=>{const i={};return t.forEach(((t,s)=>i["c"+(s+1)]={$:this.formatValue(e,t)})),i}))}}formatValue(t,e){return null!=this._provider.formatValue?this._provider.formatValue(t,e):t[e.id]||""}}const k={[n.DATE]:{type:"D",align:"center"},[n.DATETIME]:{type:"H",align:"center"},[n.TIME]:{type:"I",align:"right"},[n.ELAPSEDTIME]:{type:"I",align:"right"},[n.DECIMALNUMBER]:{type:"F",align:"right"},[n.INTEGERNUMBER]:{type:"I",align:"right"},[n.SEARCH]:{type:"S",align:"right"}},y=class{constructor(e){t(this,e),this._selectedNumber=0,this._customPrefix="$custom$",this._releasedToExport=[u.EXPORT_TO_PDF,u.EXPORT_TO_XLS,u.EXPORT_BY_EMAIL,u.EXPORT_PDF_TO_EMAIL,u.EXPORT_XLS_TO_EMAIL,u.EXPORT_PAGE_TO_PDF,u.EXPORT_PAGE_TO_XLS,u.EXPORT_ALL_RECORDS_TO_PDF,u.EXPORT_ALL_RECORDS_TO_XLS],this._items=[],this._showDropdown=!1,this.provider=null,this.messagesBuilder=void 0}async exportByEmail(){const t=this._selectedNumber;this._snkEmailSender.open({type:t>0?"selection":"all",selectedRows:t,email:{attachments:[{name:this._appLabel}]},resolver:({type:t,format:e,email:{to:i,subject:s,message:o}})=>{var r;const n=null!==(r=m[null==e?void 0:e.toUpperCase()])&&void 0!==r?r:m.PDF;this.resolveExporter({type:t,methodName:n,to:i,subject:s,message:o,fileName:this._appLabel,gridTitle:this._appLabel},(()=>{this._snkEmailSender.close(),d.info(this.getMessage("snkDataExporter.message.emailSuccess"),{iconName:"check"})}))}})}getMessage(t,e){if(null==this.messagesBuilder){const t=f.getNearestInstance(this._element);t&&(this.messagesBuilder=t.messagesBuilder)}return this.messagesBuilder.getMessage(t,e)}positionDropdown(){var t;const e=null===(t=this._ezButton)||void 0===t?void 0:t.getBoundingClientRect();null!=e&&null!=this._dropdownParent&&(this._dropdownParent.style.top=e.y+e.height+5+"px",this._dropdownParent.style.left=e.x+"px")}closeDropdown(t){const e=null==t?void 0:t.target;null!=e&&(e.closest(".snk-data-exporter")||(this._showDropdown=!1))}setEvents(){document.removeEventListener("click",this.closeDropdown.bind(this)),document.addEventListener("click",this.closeDropdown.bind(this)),document.removeEventListener("scroll",this.positionDropdown.bind(this)),document.addEventListener("scroll",this.positionDropdown.bind(this))}controlDropdown(){this._showDropdown=!this._showDropdown}async resolveExporter(t,e){null!=this.provider&&null!=t&&null!=e&&this.getExporterStrategy().executeExport(t).then((t=>e(t))).catch((t=>{console.error(t);let{title:e,message:i,statusMessage:s}=t||{};d.error(e||this.getMessage("snkDataExporter.message.exportError"),s||i||this.getMessage("snkDataExporter.message.unknownFailure"))}))}getExporterStrategy(){return null==this.provider.getRecords?new w(this.provider):new D(this.provider)}getOptionKey(t){return Object.keys(u).find((e=>u[e]===t))}getExportType(t){return t===u.EXPORT_ALL_RECORDS_TO_PDF||t===u.EXPORT_ALL_RECORDS_TO_XLS?c.ALL:t===u.EXPORT_PAGE_TO_PDF||t===u.EXPORT_PAGE_TO_XLS?c.PAGE:c.SELECTION}async dispatchExporter(t){var e,i,s;const r=this.getOptionKey(t),n=null!==(e=p[r])&&void 0!==e?e:p.EXPORT_TO_PDF,l={methodName:u[`EXPORT_TO_${n}`],fileName:this._appLabel,gridTitle:this._appLabel,exportOption:t,limit:null===(s=null===(i=this.provider)||void 0===i?void 0:i.getExportLimit)||void 0===s?void 0:s.call(i),type:this.getExportType(t)};await this.resolveExporter(l,(t=>{t.canExport||n===p.EXPORT_TO_PDF?function({fileSessionKey:t,isDownload:e}){const i=o.getContextValue("__SNK__APPLICATION__");window.open(`${window.location.protocol}//${window.location.hostname}:${window.location.port}/mge/visualizadorArquivos.mge?chaveArquivo=${t}${e?"&download=S":""}`),d.info(function(t){var e;return null===(e=null==t?void 0:t.messagesBuilder)||void 0===e?void 0:e.getMessage("fileViewer.message.exportSuccess",void 0)}(i),{iconName:"check"})}(Object.assign(Object.assign({},t),{fileType:n})):d.error(this.getMessage("snkDataExporter.title.permission"),this.getMessage("snkDataExporter.message.exportPermission"))}))}async processExporter(t){var e,i,s,o,r,n,l;const a=null==t?void 0:t.detail,c=[u.EXPORT_PAGE_TO_PDF,u.EXPORT_PAGE_TO_XLS],p=null===(e=null==a?void 0:a.id)||void 0===e?void 0:e.includes(this._customPrefix);if((null==a?void 0:a.id)===u.EXPORT_CURRENT_PAGE)return;const m=null===(i=this.provider)||void 0===i?void 0:i.getSelectedIDs(),v=null===(s=this.provider)||void 0===s?void 0:s.getTotalRecords(),x=null===(r=null===(o=this.provider)||void 0===o?void 0:o.getPageSize)||void 0===r?void 0:r.call(o),f=null===(l=null===(n=this.provider)||void 0===n?void 0:n.getExportLimit)||void 0===l?void 0:l.call(n);let g=!1;if(c.includes(null==a?void 0:a.id)&&x<=f||p?g=!1:(null==m?void 0:m.length)?g=m.length>f:v>f&&(g=!0),g){const t=f.toLocaleString("pt-BR",{minimumFractionDigits:0}),e={title:this.getMessage("snkDataExporter.limitExceeded.title"),description:`\n ${this.getMessage("snkDataExporter.limitExceeded.description",{limit:t})}\n <br/><br/>\n <b>\n ${this.getMessage("snkDataExporter.limitExceeded.subdescription")}\n </b>\n `,cancel:this.getMessage("snkDataExporter.limitExceeded.cancel"),confirm:this.getMessage("snkDataExporter.limitExceeded.continue")};if(!await d.confirm(e.title,e.description,null,h.WARN,{labelCancel:e.cancel,labelConfirm:e.confirm}))return}if(p)return this.openPersonalizedReports(a.id),void(this._showDropdown=!1);this.getFilteredReleasedToExport().includes(null==a?void 0:a.id)&&(a.id===u.EXPORT_BY_EMAIL?this.exportByEmail():this.dispatchExporter(a.id),this._showDropdown=!1)}getFilteredReleasedToExport(){var t,e;if(null==this.provider)return this._releasedToExport;const i=null===(e=(t=this.provider).getHiddenOptions)||void 0===e?void 0:e.call(t);return null==i?this._releasedToExport:this._releasedToExport.filter((t=>!i.includes(t)))}loadItems(){const t=[];this.getFilteredReleasedToExport().forEach((e=>{var i;null===(i=this._itemBuilder)||void 0===i||i.setExportOption(e,t)})),this.loadPersonalizedItems(t)}async loadPersonalizedItems(t){var e,i;const s=null===(i=null===(e=this.provider)||void 0===e?void 0:e.getRecordID)||void 0===i?void 0:i.call(e);if(null==s)return void(this._items=t);const n=await function(t){const e=`${o.getContextValue("__SNK__APPLICATION__").getModuleName()}@DataExporterSPBean.getPersonalizedReports`,i={serviceName:e,requestBody:t};return new Promise(((t,s)=>x.get().callServiceBroker(e,r.objectToString(i)).then((e=>t(function(t){var e;const i=null===(e=null==t?void 0:t.json)||void 0===e?void 0:e.$;if(null!=i)return r.stringToObject(i)}(e)))).catch((t=>s(t)))))}({recordID:s});null==n||n.forEach((e=>{t.push({id:`${this._customPrefix}_${e.ID}`,label:e.label,group:this.getMessage("snkDataExporter.group.custom")})})),this._items=t}openPersonalizedReports(t){var e,i;const s=[],o=(null==t?void 0:t.replace(this._customPrefix,""))||"";null===(i=null===(e=this.provider)||void 0===e?void 0:e.getSelectedIDs)||void 0===i||i.call(e).forEach((({name:t,type:e,value:i},o)=>{const r={fields:[]};0===o&&(s[`PK_${t}`]={type:this.parseDataType(e),value:i},s.pks=[]);const n={nome:`PK_${t}`,tipo:this.parseDataType(e),valor:i};r.fields.push(n),s.pks.push(r)})),this._application.openApp(`${v}${o}`,s)}parseDataType(t){switch(t){case l.NUMBER:return"I";case l.DATE:return"D";default:return"S"}}loadDropdown(){var t;this._selectedNumber=(null===(t=this.provider)||void 0===t?void 0:t.getSelectedNumber())||0,this._itemBuilder=new g(this.getMessage.bind(this),this._selectedNumber),this.loadItems()}getElementID(t){return{[a.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:a.getInternalIDInfo(t)}}canShowDropdown(){var t;return this._showDropdown&&(null===(t=this._items)||void 0===t?void 0:t.length)>0}componentWillLoad(){var t;this._application=o.getContextValue("__SNK__APPLICATION__"),null===(t=this._application)||void 0===t||t.getAppLabel().then((t=>this._appLabel=t)),this.setEvents()}componentDidLoad(){null!=this._element&&(a.addIDInfo(this._element),this.positionDropdown())}componentWillUpdate(){var t;this._showDropdown&&!(null===(t=this._items)||void 0===t?void 0:t.length)&&this.loadDropdown()}componentDidUpdate(){var t;this._showDropdown?this.positionDropdown():(null===(t=this._items)||void 0===t?void 0:t.length)>0&&(this._items=[])}render(){return e(i,null,e("div",{class:`snk-data-exporter\n ${this.canShowDropdown()?" ez-elevation--16":""}\n `},e("ez-button",Object.assign({ref:t=>this._ezButton=t,iconName:"file-download",size:"small",mode:"icon",title:this.getMessage("snkDataExporter.group.export.title"),onClick:()=>this.controlDropdown()},this.getElementID("button"))),e("div",Object.assign({ref:t=>this._dropdownParent=t,class:`snk-data-exporter__dropdown\n ${this.canShowDropdown()?"snk-data-exporter__dropdown--show":""}\n `},this.getElementID("dropdown")),this.canShowDropdown()&&e("ez-dropdown",Object.assign({items:this._items,onEzClick:t=>this.processExporter(t)},this.getElementID("dropdown"))))),this.canShowDropdown()&&e("div",Object.assign({class:"ez-scrim ez-scrim--light"},this.getElementID("ezScrim"))),e("snk-exporter-email-sender",Object.assign({ref:t=>this._snkEmailSender=t,getMessage:(t,e)=>this.getMessage(t,e)},this.getElementID("snkExporterEmailSender"))))}get _element(){return s(this)}};y.style=".sc-snk-data-exporter-h{display:flex;width:fit-content;height:fit-content}.snk-data-exporter.sc-snk-data-exporter{display:flex;width:fit-content;height:fit-content}.snk-data-exporter__dropdown.sc-snk-data-exporter{display:none}.snk-data-exporter__dropdown--show.sc-snk-data-exporter{display:flex;flex-direction:column;position:fixed}.snk-data-exporter__dropdown.sc-snk-data-exporter>ez-dropdown.sc-snk-data-exporter{position:relative}";export{y as snk_data_exporter}
@@ -0,0 +1 @@
1
+ import{r as s,h as i,f as e,g as t}from"./p-2c9d0870.js";import{ObjectUtils as a,StringUtils as r,ApplicationContext as n,ElementIDUtils as o}from"@sankhyalabs/core";import{P as l,b as c,a as h}from"./p-48a5c311.js";import"./p-6768f176.js";import"./p-0f3698af.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-9e4555ab.js";import"./p-ff1990ad.js";import"./p-7ee6b1bf.js";import"./p-9019a32f.js";import"./p-8d884fab.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";const u=class{constructor(i){s(this,i),this._mdByName={},this._startHighlightTag="<span class='card-item__highlight'>",this._endHighlightTag="</span>",this._specialCharsRegex=/[[.\-\$\+\*,_\&\(\)%\/\\#@!:\|\=\'\"]/gim,this._charsWithAccentuation="ÁÉÍÓÚ_ÃÕ_ÂÊÎÔÛ_ÀÈÌÒÙ_Ü_Ç_áéíóú_ãõ_âêîôû_àèìòù_ü_ç",this._charsWithoutAccentuation="AEIOU_AO_AEIOU_AEIOU_U_C_aeiou_ao_aeiou_aeiou_u_c",this._changeDeboucingTimeout=null,this._limitCharsToSearch=3,this._deboucingTime=450,this._gridDataSource=[],this.pesquisaFetcher=new l,this._itemList=void 0,this._startLoading=!1,this._presentationMode="list",this._currentView=void 0,this._valideDataSource=!1,this.searchLoader=void 0,this.treeLoader=void 0,this.selectItem=void 0,this.entityName=void 0,this.argument=void 0,this.isHierarchyEntity=!1,this.allowsNonAnalytic=!1}observeArgument(){this._textInput&&(this._textInput.value=this.argument)}async executeSearch(s){this.argument=s,this.onChangeValue({detail:s})}clearSearch(){this.argument="",this._itemList=void 0}buildDetails(s,i){let e={};for(let t=0;t<s.length;t++){const a=s[t],r=i[a.fieldName];e[a.description]=this.highlightValue(i.__matchFields,a.options&&a.options[r]||r,s,!0)}return e}buildFirstFields(s,i,e=6){return s&&Array.isArray(s)&&s.forEach((s=>{let e=this.removeReference(i,this._mdByName[s]);e&&i.unshift(e)})),i=i.slice(0,e)}doSearch(s){this.searchLoader&&"function"==typeof this.searchLoader&&(this._startLoading=!0,this.searchLoader(s).then((s=>{s&&this.processSearchResponse(s)})).finally((()=>{this._startLoading=!1})))}processSearchResponse(s){let i=(s=a.stringToObject(s.json.$)).descriptionField,e=s.pkField;e&&(this._gridMetadata=c(s),this._gridDataSource=[...s.data],this._pkField=e,this._descriptionField=i,this._itemList=this.buildCardItemList(s,e,i))}buildCardItemList(s,i,e){var t;return null===(t=s.data)||void 0===t?void 0:t.map((t=>{var a;let r=this.filterFieldsMetadata(s,t),n=this.buildFirstFields(t.__matchFields,r);return{key:this.highlightValue(t.__matchFields,null===(a=t[i])||void 0===a?void 0:a.toString(),n,!0),title:e?this.highlightValue(t.__matchFields,t[e],n,!0):"",details:this.buildDetails(n,t)}}))}filterFieldsMetadata(s,i){return s.fieldsMetadata.filter((e=>{let t=!r.isEmpty(i[e.fieldName])&&!1!==e.visible&&"B"!==e.type&&s.pkField!==e.fieldName&&s.descriptionField!==e.fieldName&&(e.isPrimaryKey||!e.isLinkField)&&!("S"===e.type&&"H"===e.presentationType);return t&&(this._mdByName[e.fieldName]=e),("string"!=typeof i[e.fieldName]||!(i[e.fieldName].indexOf("<img")>-1||i[e.fieldName].indexOf("<svg")>-1))&&t}))}removeAtIndex(s,i){if(i>=0&&i<s.length)return s.splice(i,1)[0]}removeReference(s,i){let e=this.indexOf(s,i);return this.removeAtIndex(s,e)}indexOf(s,i){let e=-1;return Array.isArray(s)&&this.find(s,((s,t)=>(e=t,this.equals(i,s)))),e}equals(s,i){return a.objectToString(s)===a.objectToString(i)}find(s,i){if(s)for(let e=0,t=s.length;e<t;e++)if(i(s[e],e,s))return s[e]}highlightValue(s,i,e,t){let a=this.replaceHtmlEntities(i);if(this.argument&&(t||this.isIn(s,e.fieldName))){const s=this.getArgumentNumber();let i=(isNaN(s)?this.argument:s.toString()).split(/%|,|\s+/),t=0,r=this.replaceAccentuatedChars(a);i.forEach((s=>{if(s){s=this.replaceAccentuatedChars(s);let i=this.getSpecialCharacters(s);null!=i&&i.length>0&&(s=this.removeSpecialCharacters(s)),(e.mask||"CGC_CPF"===e.uiType||"Phone"===e.uiType)&&(s=s.split("").join("\\.?\\-?\\/?\\(?\\)?"));let n=new RegExp(s,"ig");n.lastIndex=t;let o=n.exec(r);if(o&&o.length>0){t=o.index;let s=o[0].length,i=a.substring(t,t+s),e=(null==i?void 0:i.trim())?this._startHighlightTag+i+this._endHighlightTag:"",n=a.substring(0,t),l=a.substring(t+s);a=n+e+l,t+=e.length,r=this.replaceAccentuatedChars(a)}}}))}return a}replaceHtmlEntities(s){return null==s?s:String(s).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}replaceAccentuatedChars(s){return null==s?s:this.replaceToSpace(s,["&amp;","&lt;","&gt;","&quot;"]).replace(/[^\w ]/g,(s=>{let i=this._charsWithAccentuation.indexOf(s);return i>-1&&(s=this._charsWithoutAccentuation.charAt(i)),s||""}))}replaceToSpace(s,i=[]){return null==s||i.forEach((i=>{const e=new RegExp(i,"g");let t="";for(let s=0;s<i.length;s++)t+=" ";s=String(s).replace(e,t)})),s}isIn(s,i){return this.indexOf(s,i)>-1}getSpecialCharacters(s){let i,e=[];for(;i=this._specialCharsRegex.exec(s);)e.push(s[i.index]);return e}removeSpecialCharacters(s){return this.getSpecialCharacters(s).forEach((i=>{s=this.replaceAll(s,i,"")})),s}replaceAll(s,i,e){let t=(null!=s?s:"").indexOf(i);for(;t>-1;)t=(s=s.replace(i,e)).indexOf(i);return s}getArgumentNumber(){return Number(this.argument||void 0)}createOption(s){let{key:i,title:e}=s;const t=new RegExp(this._startHighlightTag,"g"),a=new RegExp(this._endHighlightTag,"g");e=r.decodeHtmlEntities(e);const n={value:null==i?void 0:i.replace(t,"").replace(a,""),label:null==e?void 0:e.replace(t,"").replace(a,"")};this.selectItem(n)}onChangeValue(s){var i;if(this.clearDeboucingTimeout(),this._startLoading)return void(this._changeDeboucingTimeout=setTimeout((()=>{this.onChangeValue(s)}),this._deboucingTime));if(this.argument=(s.detail||"").trim(),this.isHierarchyEntity&&"list"===this._presentationMode)return void(null===(i=this._pesquisaTree)||void 0===i||i.applyFilter());const e=this.getArgumentNumber();this.argument&&(!isNaN(e)||this.argument.length>=this._limitCharsToSearch)?this._changeDeboucingTimeout=setTimeout((()=>{this.doSearch(this.argument),this._valideDataSource=!0}),this._deboucingTime):(this._itemList=void 0,this._gridDataSource=[],this._valideDataSource=!1)}clearDeboucingTimeout(){this._changeDeboucingTimeout&&(clearTimeout(this._changeDeboucingTimeout),this._changeDeboucingTimeout=void 0)}onClickSearch(){this.doSearch((this.argument||"").trim()),this._valideDataSource=!0}getMessageView(){if(this._startLoading)return this.getMessage("snkPesquisa.search.waitMessage");if(!this._itemList)return this.getMessage("snkPesquisa.search.initialMessage");const s=this._itemList.length;return s<1?this.getMessage("snkPesquisa.search.noResultsMessage"):1===s?this.getMessage("snkPesquisa.search.resultsFoundSingular"):this.getMessage("snkPesquisa.search.resultsFoundPlural",{COUNT:s})}async componentWillLoad(){var s;this._application=n.getContextValue("__SNK__APPLICATION__"),this._messagesBuilder=null===(s=this._application)||void 0===s?void 0:s.messagesBuilder;const i=await this.pesquisaFetcher.loadPresentationConfig(this.entityName);this._presentationMode="list"===i?"list":"table"}async componentDidLoad(){o.addIDInfo(this._element),await this.chooseViewMode()}getMessage(s,i){return this._messagesBuilder.getMessage(s,i)}async handleChangeViewMode(){this._presentationMode="list"===this._presentationMode?"table":"list",await this.chooseViewMode(),await this.pesquisaFetcher.savePresentationConfig(this.entityName,this._presentationMode)}async chooseViewMode(){var s,i;if("list"!==this._presentationMode)return await(null===(s=this._viewStack)||void 0===s?void 0:s.show(h.GRID)),void(this._currentView=h.GRID);const e=this.isHierarchyEntity?h.TREE:h.CARDS;await(null===(i=this._viewStack)||void 0===i?void 0:i.show(e)),this._currentView=e}hideLimitMessage(){return!this._itemList||this._itemList.length<100}hideRecordsMessage(){return"list"===this._presentationMode&&this.isHierarchyEntity}getButtonModeInfo(){return"list"===this._presentationMode?{iconName:"table",title:this.getMessage("snkPesquisa.viewMode.tableMode")}:this.isHierarchyEntity?{iconName:"hierarchical-tree",title:this.getMessage("snkPesquisa.viewMode.tableMode")}:{iconName:"list",title:this.getMessage("snkPesquisa.viewMode.listMode")}}render(){var s,t;return i(e,null,i("div",{class:"snk-pesquisa"},i("div",{class:"snk-pesquisa__input"},i("ez-text-input",{label:this.getMessage("snkPesquisa.search.label"),class:"ez-margin-right--medium",canShowError:!1,ref:s=>this._textInput=s,onEzChange:s=>this.onChangeValue(s),value:this.argument,"data-element-id":"searchInput"},i("ez-icon",{slot:"leftIcon",iconName:"search"}),this.argument&&(null===(s=this._textInput)||void 0===s?void 0:s.value)?i("button",{slot:"rightIcon",class:"snk-pesquisa__btn",onClick:()=>this.clearSearch()},i("ez-icon",{iconName:"close"})):void 0),i("ez-button",{class:"ez-button--primary",label:this.getMessage("snkPesquisa.search.button"),onClick:()=>this.onClickSearch()}),i("ez-button",{class:"ez-margin-left--medium",mode:"icon",iconName:this.getButtonModeInfo().iconName,title:this.getButtonModeInfo().title,onClick:async()=>await this.handleChangeViewMode()})),i("div",{class:"snk-pesquisa__records-label "+(this._currentView===h.TREE?"hidden":"")},i("label",{class:"snk-pesquisa__records "+(this.hideRecordsMessage()?"hidden":"")},this.getMessageView()),i("label",{class:"snk-pesquisa__records-limit "+(this.hideLimitMessage()?"hidden":"")},this.getMessage("snkPesquisa.search.limitMessage"))),i("div",{class:"snk-pesquisa__content"},i("ez-view-stack",{ref:s=>this._viewStack=s,"data-element-id":"simple-crud"},i("stack-item",null,this._valideDataSource&&i("pesquisa-grid",{metadata:this._gridMetadata,dataSource:this._gridDataSource,pkField:this._pkField,descriptionField:this._descriptionField,entityName:this.entityName,shouldLoadConfig:this._currentView===h.GRID,onPesquisaGridSelectItem:({detail:s})=>this.selectItem(s)})),i("stack-item",null,i("div",{class:"snk-pesquisa__cards-container"},null===(t=this._itemList)||void 0===t?void 0:t.map((s=>i("ez-card-item",{onEzClick:s=>this.createOption(s.detail),item:s}))))),i("stack-item",null,i("pesquisa-tree",{ref:s=>this._pesquisaTree=s,argument:this.argument,treeLoader:this.treeLoader,allowsNonAnalytic:this.allowsNonAnalytic,shouldLoadTree:this._currentView===h.TREE,onPesquisaTreeSelectItem:({detail:s})=>this.selectItem(s),messagesBuilder:this._messagesBuilder}))))))}get _element(){return t(this)}static get watchers(){return{argument:["observeArgument"]}}};u.style=".sc-snk-pesquisa-h{--snk-pesquisa--font-size:var(--text--medium, 14px);--snk-pesquisa--font-family:var(--font-pattern, Arial);--snk-pesquisa--font-weight:var(--text-weight--medium, 400);--snk-pesquisa__records--color:var(--text--primary, #626e82);--snk-pesquisa__records--color-secondary:var(--text--secondary, #626e82);--snk-pesquisa__records--padding-vertical:var(--space--medium, 12px);--snk-pesquisa__content--padding-right:var(--space--small, 6px);--snk-pesquisa__btn--color:var(--title--primary, #2B3A54);--snk-pesquisa__btn-disabled--color:var(--text--disable, #AFB6C0);--snk-pesquisa__btn-hover--color:var(--color--primary, #4e4e4e);--snk-pesquisa__scrollbar--color-default:var(--scrollbar--default, #626e82);--snk-pesquisa__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--snk-pesquisa__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--snk-pesquisa__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--snk-pesquisa__scrollbar--border-radius:var(--border--radius-small, 6px);--snk-pesquisa__scrollbar--width:var(--space--small, 6px);--snk-pesquisa__scrollable-content--height:calc(100vh - 300px);height:100%;display:flex;flex-direction:column;overflow-y:auto}.snk-pesquisa.sc-snk-pesquisa{display:flex;flex-direction:column;height:100%}.snk-pesquisa__input.sc-snk-pesquisa{display:flex;width:100%;box-sizing:border-box;padding-top:4px;padding-right:4px}.snk-pesquisa__input.sc-snk-pesquisa ez-icon.sc-snk-pesquisa{--ez-icon--color:inherit;font-weight:var(--text-weight--large, 600)}.snk-pesquisa__content.sc-snk-pesquisa{display:flex;flex-direction:column;overflow-y:hidden;scrollbar-width:thin;scrollbar-color:var(--snk-pesquisa__scrollbar--color-clicked) var(--snk-pesquisa__scrollbar--color-background);padding-right:var(--snk-pesquisa__content--padding-right);height:var(--snk-pesquisa__scrollable-content--height)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar{background-color:var(--snk-pesquisa__scrollbar--color-background);width:var(--snk-pesquisa__scrollbar--width);max-width:var(--snk-pesquisa__scrollbar--width);min-width:var(--snk-pesquisa__scrollbar--width)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-track{background-color:var(--snk-pesquisa__scrollbar--color-background);border-radius:var(--snk-pesquisa__scrollbar--border-radius)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb{background-color:var(--snk-pesquisa__scrollbar--color-default);border-radius:var(--snk-pesquisa__scrollbar--border-radius)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:vertical:hover,.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--snk-pesquisa__scrollbar--color-hover)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:vertical:active,.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--snk-pesquisa__scrollbar--color-clicked)}.snk-pesquisa__records-label.sc-snk-pesquisa{display:flex;flex-direction:row;justify-content:space-between;font-family:var(--snk-pesquisa--font-family);font-weight:var(--snk-pesquisa--font-weight);font-size:var(--snk-pesquisa--font-size);padding-bottom:var(--snk-pesquisa__records--padding-vertical);padding-top:var(--snk-pesquisa__records--padding-vertical)}.snk-pesquisa__records-label.hidden.sc-snk-pesquisa{display:none}.snk-pesquisa__records.sc-snk-pesquisa{color:var(--snk-pesquisa__records--color)}.snk-pesquisa__records-limit.sc-snk-pesquisa{color:var(--snk-pesquisa__records--color-secondary)}.snk-pesquisa__records-limit.hidden.sc-snk-pesquisa,.snk-pesquisa__records.hidden.sc-snk-pesquisa{visibility:hidden}.snk-pesquisa__btn.sc-snk-pesquisa{outline:none;border:none;background:none;cursor:pointer;color:var(--snk-pesquisa__btn--color)}.snk-pesquisa__btn.sc-snk-pesquisa:disabled{cursor:unset;color:var(--snk-pesquisa__btn-disabled--color)}.snk-pesquisa__btn.sc-snk-pesquisa:disabled:hover{cursor:unset;color:var(--snk-pesquisa__btn-disabled--color)}.snk-pesquisa__btn.sc-snk-pesquisa:hover{color:var(--snk-pesquisa__btn-hover--color)}.snk-pesquisa__cards-container.sc-snk-pesquisa{height:100%;overflow-y:auto}";export{u as snk_pesquisa}
@@ -1,6 +1,6 @@
1
- import{UserInterface as e,DataType as t,ApplicationContext as n,ErrorException as i}from"@sankhyalabs/core";import{d as o,D as r}from"./p-6d241415.js";function a(e){const t=(n=e.fieldsMetadata)&&n.length?n.map((e=>({name:e.fieldName,label:e.description,dataType:u(e.type),userInterface:l(e),properties:s(e)}))):[];var n;return{label:e.entityDescription,name:e.descriptionField,fields:t}}function s(e){const t={};return t.options=function(e){const t=e.options;if(!t)return;const n=[];return Object.keys(t).forEach((e=>{n.push({label:e,value:t[e]})})),n}(e),t.mask=function(e){const t=e.uiType;return t?String(t).toLowerCase():void 0}(e),t}function l(t){const n=t.options;return n&&Object.keys(n).length>0?e.OPTIONSELECTOR:"D"===t.type?e.DATE:"H"===t.type?e.DATETIME:"T"===t.type?e.TIME:"I"===t.type?e.INTEGERNUMBER:void 0}function u(e){switch(e){case"F":case"I":return t.NUMBER;case"D":case"H":return t.DATE;case"B":return t.OBJECT;default:return t.TEXT}}function c(e){return Object.assign({id:e.codigo,label:`${e.caminho} - ${e.descricao}`,bold:"N"===e.analitico,props:{analitico:"S"===e.analitico}},e.no&&{children:e.no.map(c)})}var d,v,f;!function(e){e[e.GRID=0]="GRID",e[e.CARDS=1]="CARDS",e[e.TREE=2]="TREE"}(d||(d={}));class m{constructor(){this._defaultPageSize=100,this._templateByQuery=new Map,this._searchListenersByDataUnit=new Map,this.buldTemplates()}buldTemplates(){this._templateByQuery.set("search",o.gql`query($entityName: String! $argument: String $criteria: InputSearchCriteria $options: InputSearchOptions) {
1
+ import{UserInterface as e,DataType as t,ApplicationContext as n,ErrorException as i}from"@sankhyalabs/core";import{d as o,D as r}from"./p-6768f176.js";function a(e){const t=(n=e.fieldsMetadata)&&n.length?n.map((e=>({name:e.fieldName,label:e.description,dataType:u(e.type),userInterface:l(e),properties:s(e)}))):[];var n;return{label:e.entityDescription,name:e.descriptionField,fields:t}}function s(e){const t={};return t.options=function(e){const t=e.options;if(!t)return;const n=[];return Object.keys(t).forEach((e=>{n.push({label:e,value:t[e]})})),n}(e),t.mask=function(e){const t=e.uiType;return t?String(t).toLowerCase():void 0}(e),t}function l(t){const n=t.options;return n&&Object.keys(n).length>0?e.OPTIONSELECTOR:"D"===t.type?e.DATE:"H"===t.type?e.DATETIME:"T"===t.type?e.TIME:"I"===t.type?e.INTEGERNUMBER:void 0}function u(e){switch(e){case"F":case"I":return t.NUMBER;case"D":case"H":return t.DATE;case"B":return t.OBJECT;default:return t.TEXT}}function c(e){return Object.assign({id:e.codigo,label:`${e.caminho} - ${e.descricao}`,bold:"N"===e.analitico,props:{analitico:"S"===e.analitico}},e.no&&{children:e.no.map(c)})}var d,v,f;!function(e){e[e.GRID=0]="GRID",e[e.CARDS=1]="CARDS",e[e.TREE=2]="TREE"}(d||(d={}));class m{constructor(){this._defaultPageSize=100,this._templateByQuery=new Map,this._searchListenersByDataUnit=new Map,this.buldTemplates()}buldTemplates(){this._templateByQuery.set("search",o.gql`query($entityName: String! $argument: String $criteria: InputSearchCriteria $options: InputSearchOptions) {
2
2
  $queryAlias$: search(entityName: $entityName argument: $argument criteria: $criteria options: $options){
3
3
  value
4
4
  label
5
5
  }
6
- }`)}loadSearchOptions(e,n,i,o){var a;const s=(null==n?void 0:n.toString().trim())||void 0;n=isNaN(Number(s))&&s?`%${s}`:s,null==i||i.params.forEach((e=>{e.dataType===t.OBJECT&&(e.value=JSON.stringify(e.value))}));const l=this.applySearchListener(v.beforeSearch,e,n,i,o),u={argument:(null==l?void 0:l.argument)||n,entityName:e,criteria:(null==l?void 0:l.criteria)||i,options:(null==l?void 0:l.searchOptions)||o};return u.options&&(null===(a=u.options)||void 0===a||delete a.dataUnitId),new Promise(((e,t)=>{r.get().callGraphQL({values:u,query:this._templateByQuery.get("search")}).then((t=>{e(t)})).catch((e=>{t(e)}))}))}buildDescriptionCacheKey(e,t){return`${e}__${t}`}async loadByCode(e,t,n,i){const o=this.buildDescriptionCacheKey(e,t),r=m.DESCRIPTIONS_BY_CODE[o];if(r)return Promise.resolve(r);const a=await this.loadAdvancedSearch(e,void 0,n,i,t);return m.DESCRIPTIONS_BY_CODE[o]=a,a}loadAdvancedSearch(e,o,a,s,l){var u,c,d,f,m;const p=this.applySearchListener(v.beforeSearch,e,o,a,s),h={argument:(null==p?void 0:p.argument)||o,criteria:(null==p?void 0:p.criteria)||a,searchOptions:Object.assign(Object.assign({},s),null==p?void 0:p.searchOptions)},N={query:{$:null===(u=h.criteria)||void 0===u?void 0:u.expression}};(null===(d=null===(c=h.criteria)||void 0===c?void 0:c.params)||void 0===d?void 0:d.length)>0&&(N.params={param:h.criteria.params.map((e=>{let o=e.value;if("string"==typeof o){const e=/CTX\{([^}]+)\}/.exec(o);e&&(o=n.getContextValue(`__SNK__APPLICATION__FILTER__CONTEXT(${e[1]})__`))}if(e.dataType===t.NUMBER&&void 0===o)throw new i("Falha detectada",`O campo ${e.name} deve ser informado.`);let r=e.dataType;return r===t.OBJECT?(o=o.value,r="S"):r=g(e.dataType),{$:o,type:r}}))});const S=null!=s?Object.assign(Object.assign({},null==h?void 0:h.searchOptions),{pkFieldName:s.codeFieldName,label:s.descriptionFieldName,fieldName:s.codeFieldName,useDescriptionOptions:!1,enableRowsCounter:!0}):void 0,y={serviceName:"PesquisaSP.getSuggestion",requestBody:{criteria:Object.assign({entityName:e,compacted:!1,ignoreEntityCriteria:null!==(f=null==S?void 0:S.ignoreEntityCriteria)&&void 0!==f&&f,limit:this._defaultPageSize,orderByDesc:!1,externalCriteria:N,localEntityName:null===(m=h.searchOptions)||void 0===m?void 0:m.rootEntity},{options:S}),clientEventList:{clientEvent:[]}}};null==l?y.requestBody.criteria.query={$:o}:y.requestBody.criteria.pk={$:l};const O={urlParams:{quietMode:!0}};return new Promise(((e,t)=>{r.get().callServiceBroker("PesquisaSP.getSuggestion",JSON.stringify(y),O).then((t=>e(t))).catch((e=>t(e)))}))}addSearchListener(e,t,n){var i;const o=this._searchListenersByDataUnit.get(t)||[],r=o.find((t=>t.entity===e));if(r){for(const e of Object.keys(n))if(e in r.listener){if((null===(i=r.listener[e])||void 0===i?void 0:i.toString())===n[e].toString())continue;r.listener[e]=n[e]}}else this._searchListenersByDataUnit.set(t,[...o,{entity:e,listener:n}]);return()=>{const n=o.filter((t=>t.entity!==e));n.length?this._searchListenersByDataUnit.set(t,n):this._searchListenersByDataUnit.delete(t)}}applySearchListener(e,t,n,i,o){var r;const a=null==o?void 0:o.dataUnitId;if(!a)return;const s=null===(r=this._searchListenersByDataUnit.get(a))||void 0===r?void 0:r.find((({entity:e})=>e===t));if(!s)return;const{listener:l}=s;return e in l?l[e]({argument:n,criteria:i,searchOptions:o}):void 0}async loadPresentationConfig(e){var t,n;let i=function(e){return{config:{chave:`PesquisaContent:${e}`,tipo:"T"}}}(e);const o=await r.get().callServiceBroker("SystemUtilsSP.getConf",JSON.stringify(i));return null!==(n=null===(t=null==o?void 0:o.config)||void 0===t?void 0:t.lastUsedMode)&&void 0!==n?n:"list"}async savePresentationConfig(e,t){let n=function(e,t){return{config:{lastUsedMode:t,chave:`PesquisaContent:${e}`,tipo:"T"}}}(e,t);await r.get().callServiceBroker("SystemUtilsSP.saveConf",JSON.stringify(n))}async loadPesquisaGridConfig(e){const t=function(e){return{gridConfig:{configName:`GrdCfgHtml5:grdcfg.dynaform.pesquisa.${e}`}}}(e);return function(e){var t,n;const i=[],o=null!==(n=null===(t=null==e?void 0:e.gridConfig)||void 0===t?void 0:t.field)&&void 0!==n?n:{};if(Object.keys(o).forEach((e=>i.push(o[e]))),i.length)return{columns:i}}(await r.get().callServiceBroker("GridConfig.getGridConfigFromJson",JSON.stringify(t)))}async savePesquisaGridConfig(e,t){const n=function(e,t){const n={};return null==t||t.forEach(((e,t)=>n[`field${t}`]=e)),{gridConfig:{compactMode:!0,configName:`GrdCfgHtml5:grdcfg.dynaform.pesquisa.${e}`,field:n}}}(e,t);await r.get().callServiceBroker("GridConfig.saveGridConfigFromJSON",JSON.stringify(n))}async loadTree(e,t,n,i){const o=this.buildLoadTreeRequestBody(e,t,n,i);return(null!==(s=null===(a=(await r.get().callServiceBroker("Pesquisa.getStructuredData",JSON.stringify(o))).arvore)||void 0===a?void 0:a.no)&&void 0!==s?s:[]).map(c);var a,s}buildLoadTreeRequestBody(e,t,n,i){var o,r;const a=this.applySearchListener(v.beforeSearch,e,t,n,i),s=null!==(o=null==a?void 0:a.searchOptions)&&void 0!==o?o:i,l=null==s?void 0:s.rootEntity,u=null==s?void 0:s.codeFieldName,c=null===(r=null==a?void 0:a.criteria)||void 0===r?void 0:r.expression,d=this.buildParams(a),f={nome:e,nomeInstanciaLocal:l,codeFieldName:u};return c&&(f.criterioLiteral={expressao:{$:c},parametro:d}),{instancia:f}}buildParams(e){var t,n;let i=null!==(n=null===(t=null==e?void 0:e.criteria)||void 0===t?void 0:t.params)&&void 0!==n?n:[];return i=i.map((e=>Object.assign(Object.assign({},e),{tipo:g(e.dataType),$:e.value}))),i}}function g(e){switch(e){case t.NUMBER:return"I";case t.DATE:return"D";default:return"S"}}m.DESCRIPTIONS_BY_CODE={},function(e){e.beforeSearch="beforeSearch"}(v||(v={})),function(e){e.LINK_AND_FILE_AT_THE_SAME_TIME="LINK_AND_FILE_AT_THE_SAME_TIME",e.ANY_LINK_OR_FILE_FILLED="ANY_LINK_OR_FILE_FILLED",e.UNKNOWN="UNKNOWN",e.DESCRIPTION_CANNOT_BE_CHANGED="DESCRIPTION_CANNOT_BE_CHANGED"}(f||(f={}));export{m as P,f as S,d as a,a as b}
6
+ }`)}loadSearchOptions(e,n,i,o){var a;const s=(null==n?void 0:n.toString().trim())||void 0;n=isNaN(Number(s))&&s?`%${s}`:s,null==i||i.params.forEach((e=>{e.dataType===t.OBJECT&&(e.value=JSON.stringify(e.value))}));const l=this.applySearchListener(v.beforeSearch,e,n,i,o),u={argument:(null==l?void 0:l.argument)||n,entityName:e,criteria:(null==l?void 0:l.criteria)||i,options:(null==l?void 0:l.searchOptions)||o};return u.options&&(null===(a=u.options)||void 0===a||delete a.dataUnitId),new Promise(((e,t)=>{r.get().callGraphQL({values:u,query:this._templateByQuery.get("search")}).then((t=>{e(t)})).catch((e=>{t(e)}))}))}buildDescriptionCacheKey(e,t){return`${e}__${t}`}async loadByCode(e,t,n,i){const o=this.buildDescriptionCacheKey(e,t),r=m.DESCRIPTIONS_BY_CODE[o];if(r)return Promise.resolve(r);const a=await this.loadAdvancedSearch(e,void 0,n,i,t);return m.DESCRIPTIONS_BY_CODE[o]=a,a}loadAdvancedSearch(e,o,a,s,l){var u,c,d,f,m,p;const h=this.applySearchListener(v.beforeSearch,e,o,a,s),N={argument:(null==h?void 0:h.argument)||o,criteria:(null==h?void 0:h.criteria)||a,searchOptions:Object.assign(Object.assign({},s),null==h?void 0:h.searchOptions)},S={query:{$:null===(u=N.criteria)||void 0===u?void 0:u.expression}};(null===(d=null===(c=N.criteria)||void 0===c?void 0:c.params)||void 0===d?void 0:d.length)>0&&(S.params={param:N.criteria.params.map((e=>{let o=e.value;if("string"==typeof o){const e=/CTX\{([^}]+)\}/.exec(o);e&&(o=n.getContextValue(`__SNK__APPLICATION__FILTER__CONTEXT(${e[1]})__`))}if(e.dataType===t.NUMBER&&void 0===o)throw new i("Falha detectada",`O campo ${e.name} deve ser informado.`);let r=e.dataType;return r===t.OBJECT?(o=o.value,r="S"):r=g(e.dataType),{$:o,type:r}}))});const y=null!=s?Object.assign(Object.assign({},null==N?void 0:N.searchOptions),{pkFieldName:s.codeFieldName,label:s.descriptionFieldName,fieldName:s.codeFieldName,useDescriptionOptions:!1,enableRowsCounter:!0,limit:s.limit}):void 0,O={serviceName:"PesquisaSP.getSuggestion",requestBody:{criteria:Object.assign({entityName:e,compacted:!1,ignoreEntityCriteria:null!==(f=null==y?void 0:y.ignoreEntityCriteria)&&void 0!==f&&f,limit:null!==(m=null==y?void 0:y.limit)&&void 0!==m?m:this._defaultPageSize,orderByDesc:!1,externalCriteria:S,localEntityName:null===(p=N.searchOptions)||void 0===p?void 0:p.rootEntity},{options:y}),clientEventList:{clientEvent:[]}}};null==l?O.requestBody.criteria.query={$:o}:O.requestBody.criteria.pk={$:l};const C={urlParams:{quietMode:!0}};return new Promise(((e,t)=>{r.get().callServiceBroker("PesquisaSP.getSuggestion",JSON.stringify(O),C).then((t=>e(t))).catch((e=>t(e)))}))}addSearchListener(e,t,n){var i;const o=this._searchListenersByDataUnit.get(t)||[],r=o.find((t=>t.entity===e));if(r){for(const e of Object.keys(n))if(e in r.listener){if((null===(i=r.listener[e])||void 0===i?void 0:i.toString())===n[e].toString())continue;r.listener[e]=n[e]}}else this._searchListenersByDataUnit.set(t,[...o,{entity:e,listener:n}]);return()=>{const n=o.filter((t=>t.entity!==e));n.length?this._searchListenersByDataUnit.set(t,n):this._searchListenersByDataUnit.delete(t)}}applySearchListener(e,t,n,i,o){var r;const a=null==o?void 0:o.dataUnitId;if(!a)return;const s=null===(r=this._searchListenersByDataUnit.get(a))||void 0===r?void 0:r.find((({entity:e})=>e===t));if(!s)return;const{listener:l}=s;return e in l?l[e]({argument:n,criteria:i,searchOptions:o}):void 0}async loadPresentationConfig(e){var t,n;let i=function(e){return{config:{chave:`PesquisaContent:${e}`,tipo:"T"}}}(e);const o=await r.get().callServiceBroker("SystemUtilsSP.getConf",JSON.stringify(i));return null!==(n=null===(t=null==o?void 0:o.config)||void 0===t?void 0:t.lastUsedMode)&&void 0!==n?n:"list"}async savePresentationConfig(e,t){let n=function(e,t){return{config:{lastUsedMode:t,chave:`PesquisaContent:${e}`,tipo:"T"}}}(e,t);await r.get().callServiceBroker("SystemUtilsSP.saveConf",JSON.stringify(n))}async loadPesquisaGridConfig(e){const t=function(e){return{gridConfig:{configName:`GrdCfgHtml5:grdcfg.dynaform.pesquisa.${e}`}}}(e);return function(e){var t,n;const i=[],o=null!==(n=null===(t=null==e?void 0:e.gridConfig)||void 0===t?void 0:t.field)&&void 0!==n?n:{};if(Object.keys(o).forEach((e=>i.push(o[e]))),i.length)return{columns:i}}(await r.get().callServiceBroker("GridConfig.getGridConfigFromJson",JSON.stringify(t)))}async savePesquisaGridConfig(e,t){const n=function(e,t){const n={};return null==t||t.forEach(((e,t)=>n[`field${t}`]=e)),{gridConfig:{compactMode:!0,configName:`GrdCfgHtml5:grdcfg.dynaform.pesquisa.${e}`,field:n}}}(e,t);await r.get().callServiceBroker("GridConfig.saveGridConfigFromJSON",JSON.stringify(n))}async loadTree(e,t,n,i){const o=this.buildLoadTreeRequestBody(e,t,n,i);return(null!==(s=null===(a=(await r.get().callServiceBroker("Pesquisa.getStructuredData",JSON.stringify(o))).arvore)||void 0===a?void 0:a.no)&&void 0!==s?s:[]).map(c);var a,s}buildLoadTreeRequestBody(e,t,n,i){var o,r;const a=this.applySearchListener(v.beforeSearch,e,t,n,i),s=null!==(o=null==a?void 0:a.searchOptions)&&void 0!==o?o:i,l=null==s?void 0:s.rootEntity,u=null==s?void 0:s.codeFieldName,c=null===(r=null==a?void 0:a.criteria)||void 0===r?void 0:r.expression,d=this.buildParams(a),f={nome:e,nomeInstanciaLocal:l,codeFieldName:u};return c&&(f.criterioLiteral={expressao:{$:c},parametro:d}),{instancia:f}}buildParams(e){var t,n;let i=null!==(n=null===(t=null==e?void 0:e.criteria)||void 0===t?void 0:t.params)&&void 0!==n?n:[];return i=i.map((e=>Object.assign(Object.assign({},e),{tipo:g(e.dataType),$:e.value}))),i}}function g(e){switch(e){case t.NUMBER:return"I";case t.DATE:return"D";default:return"S"}}m.DESCRIPTIONS_BY_CODE={},function(e){e.beforeSearch="beforeSearch"}(v||(v={})),function(e){e.LINK_AND_FILE_AT_THE_SAME_TIME="LINK_AND_FILE_AT_THE_SAME_TIME",e.ANY_LINK_OR_FILE_FILLED="ANY_LINK_OR_FILE_FILLED",e.UNKNOWN="UNKNOWN",e.DESCRIPTION_CANNOT_BE_CHANGED="DESCRIPTION_CANNOT_BE_CHANGED"}(f||(f={}));export{m as P,f as S,d as a,a as b}
@@ -0,0 +1 @@
1
+ import{ObjectUtils as t}from"@sankhyalabs/core";import{R as e}from"./p-7ee6b1bf.js";class a extends e{getData(e){const a=`cfg://auth/${e}`;return new Promise(((e,s)=>{this.loadResource(a).then((a=>{let s=t.stringToObject(a);s&&"object"==typeof s&&e(s)})).catch((t=>{s(t)}))}))}}var s;!function(t){t.INSERT="I",t.UPDATE="A",t.REMOVE="E",t.SHOW="C",t.CONFIG="F",t.CONFIG_NUMBER="N",t.CLONE="D",t.CONFIG_GRID="G"}(s||(s={}));export{s as A,a}
@@ -1 +1 @@
1
- import{r as a,h as e}from"./p-d8d8169b.js";import{DataUnit as r,DataType as o,UserInterface as i}from"@sankhyalabs/core";const s=class{constructor(e){a(this,e)}componentWillLoad(){this.dataUnit=new r("testes_com_formulario"),this.dataUnit.metadata={name:"dd://br.com.sankhya.fin.cad.movimentacaoFinanceira/Financeiro",label:"Parceiro",fields:[{name:"CODPARC",label:"Parceiro",dataType:o.NUMBER,userInterface:i.SEARCH,required:!0,properties:{ENTITYNAME:"Parceiro"}}]}}render(){return e("snk-application",null,e("ez-form",{dataUnit:this.dataUnit}))}};s.style=":host{display:block}";export{s as teste_pesquisa}
1
+ import{r as a,h as e}from"./p-2c9d0870.js";import{DataUnit as r,DataType as o,UserInterface as i}from"@sankhyalabs/core";const s=class{constructor(e){a(this,e)}componentWillLoad(){this.dataUnit=new r("testes_com_formulario"),this.dataUnit.metadata={name:"dd://br.com.sankhya.fin.cad.movimentacaoFinanceira/Financeiro",label:"Parceiro",fields:[{name:"CODPARC",label:"Parceiro",dataType:o.NUMBER,userInterface:i.SEARCH,required:!0,properties:{ENTITYNAME:"Parceiro"}}]}}render(){return e("snk-application",null,e("ez-form",{dataUnit:this.dataUnit}))}};s.style=":host{display:block}";export{s as teste_pesquisa}
@@ -0,0 +1 @@
1
+ import{r as i,e,h as t,g as s}from"./p-2c9d0870.js";import{ObjectUtils as o,ArrayUtils as n}from"@sankhyalabs/core";import{ApplicationUtils as a}from"@sankhyalabs/ezui/dist/collection/utils";import{S as r}from"./p-51833248.js";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],o.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 a.confirm(t,s))return;this.guideDeleted.emit(i);const o=this.getMessage("snkFormConfig.info.successfullyGuideDeleted").replace("{0}",i.label);a.info(o)}renderItems(i){return n.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",isDisabled:i.isCustom||i.isDetail,iconName:"delete",title:this.getMessage(i.isCustom||i.isDetail?"snkFormConfig.guidesConfigurator.canNotDeleteCustomGuide":"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 r(this.getContainerElement(this.ID_VISIBLE_GUIDES),{group:"guides",ghostClass:"ghost",direction:"vertical",filter:".disable-sort",animation:15,onSort:()=>this.handleSortGuide()}),this._sortableInvisibleGuides=new r(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:opacity 0.2s ease-in-out;display:none;opacity:0}.guide-item.sc-guides-configurator:hover .actions.sc-guides-configurator{display:flex;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}