@sankhyalabs/sankhyablocks 10.0.2 → 10.0.4

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 (942) hide show
  1. package/dist/cjs/AuthorizationConfig-79ffae4b.js.gz +0 -0
  2. package/dist/cjs/{ConfigStorage-8b6def32.js → ConfigStorage-2b412ac9.js} +2 -2
  3. package/dist/cjs/ConfigStorage-2b412ac9.js.gz +0 -0
  4. package/dist/cjs/{DataFetcher-2c37b6a1.js → DataFetcher-a1d986da.js} +21 -0
  5. package/dist/cjs/{DataFetcher-2c37b6a1.js.gz → DataFetcher-a1d986da.js.gz} +0 -0
  6. package/dist/cjs/{FormConfigHelper-ebb77625.js → FormConfigHelper-1e8bb464.js} +24 -0
  7. package/dist/cjs/FormConfigHelper-1e8bb464.js.gz +0 -0
  8. package/dist/cjs/GetSelectedRecordsIDsInfo-bd50caf1.js.gz +0 -0
  9. package/dist/cjs/IFetchDataExporterParams-e78ec415.js.gz +0 -0
  10. package/dist/cjs/{ISave-b22b3cf0.js → ISave-4c4f7231.js} +1 -1
  11. package/dist/cjs/ISave-4c4f7231.js.gz +0 -0
  12. package/dist/cjs/ParamType-90b440a0.js.gz +0 -0
  13. package/dist/cjs/PersonalizedFilterUtils-7259cf65.js.gz +0 -0
  14. package/dist/cjs/PrintUtils-bcaeb82f.js.gz +0 -0
  15. package/dist/cjs/ResourceIDUtils-5ff86aa7.js.gz +0 -0
  16. package/dist/cjs/{SnkFormConfigManager-477a27de.js → SnkFormConfigManager-cfb6323a.js} +7 -7
  17. package/dist/cjs/SnkFormConfigManager-cfb6323a.js.gz +0 -0
  18. package/dist/cjs/{SnkMultiSelectionListDataSource-b7ab26ba.js → SnkMultiSelectionListDataSource-99a82236.js} +4 -4
  19. package/dist/cjs/SnkMultiSelectionListDataSource-99a82236.js.gz +0 -0
  20. package/dist/cjs/{auth-fetcher-78a90b36.js → auth-fetcher-3dda805e.js} +1 -1
  21. package/dist/cjs/auth-fetcher-3dda805e.js.gz +0 -0
  22. package/dist/cjs/config-header.cjs.entry.js.gz +0 -0
  23. package/dist/cjs/configs-button.cjs.entry.js.gz +0 -0
  24. package/dist/cjs/constants-6d82e405.js.gz +0 -0
  25. package/dist/cjs/{dataunit-fetcher-877944a9.js → dataunit-fetcher-434d8c8d.js} +1 -1
  26. package/dist/cjs/dataunit-fetcher-434d8c8d.js.gz +0 -0
  27. package/dist/cjs/default-filters-a09bf82b.js.gz +0 -0
  28. package/dist/cjs/field-config_2.cjs.entry.js +1 -1
  29. package/dist/cjs/field-config_2.cjs.entry.js.gz +0 -0
  30. package/dist/cjs/fields-layout.cjs.entry.js +6 -3
  31. package/dist/cjs/fields-layout.cjs.entry.js.gz +0 -0
  32. package/dist/cjs/fields-selector.cjs.entry.js +1 -1
  33. package/dist/cjs/fields-selector.cjs.entry.js.gz +0 -0
  34. package/dist/cjs/filter-item-type.enum-a7ffdaa6.js.gz +0 -0
  35. package/dist/cjs/filter-type.enum-2bb46d2a.js.gz +0 -0
  36. package/dist/cjs/filter-validate-cb4ed41a.js.gz +0 -0
  37. package/dist/cjs/filterNumberVariation-d65332da.js.gz +0 -0
  38. package/dist/cjs/{form-config-fetcher-dee08eb4.js → form-config-fetcher-0e6f36d9.js} +1 -1
  39. package/dist/cjs/form-config-fetcher-0e6f36d9.js.gz +0 -0
  40. package/dist/cjs/guides-configurator.cjs.entry.js +5 -3
  41. package/dist/cjs/guides-configurator.cjs.entry.js.gz +0 -0
  42. package/dist/cjs/index-13d05f03.js.gz +0 -0
  43. package/dist/cjs/index-1cf293c1.js.gz +0 -0
  44. package/dist/cjs/index-62760a9c.js.gz +0 -0
  45. package/dist/cjs/index-8d94b7e0.js.gz +0 -0
  46. package/dist/cjs/index-e3e39724.js.gz +0 -0
  47. package/dist/cjs/index.cjs.js.gz +0 -0
  48. package/dist/cjs/loader.cjs.js +1 -1
  49. package/dist/cjs/loader.cjs.js.gz +0 -0
  50. package/dist/cjs/pesquisa-grid_2.cjs.entry.js +4 -4
  51. package/dist/cjs/pesquisa-grid_2.cjs.entry.js.gz +0 -0
  52. package/dist/cjs/presentationMode-52ec3bdd.js.gz +0 -0
  53. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  54. package/dist/cjs/sankhyablocks.cjs.js.gz +0 -0
  55. package/dist/cjs/snk-actions-button_8.cjs.entry.js +5 -5
  56. package/dist/cjs/snk-actions-button_8.cjs.entry.js.gz +0 -0
  57. package/dist/cjs/snk-actions-form.cjs.entry.js.gz +0 -0
  58. package/dist/cjs/snk-application.cjs.entry.js +6 -6
  59. package/dist/cjs/snk-application.cjs.entry.js.gz +0 -0
  60. package/dist/cjs/snk-attach.cjs.entry.js +5 -5
  61. package/dist/cjs/snk-attach.cjs.entry.js.gz +0 -0
  62. package/dist/cjs/snk-client-confirm.cjs.entry.js.gz +0 -0
  63. package/dist/cjs/snk-configurator.cjs.entry.js.gz +0 -0
  64. package/dist/cjs/snk-crud.cjs.entry.js +5 -5
  65. package/dist/cjs/snk-crud.cjs.entry.js.gz +0 -0
  66. package/dist/cjs/snk-custom-slot-elements.cjs.entry.js.gz +0 -0
  67. package/dist/cjs/snk-data-exporter.cjs.entry.js +5 -5
  68. package/dist/cjs/snk-data-exporter.cjs.entry.js.gz +0 -0
  69. package/dist/cjs/{snk-data-unit-0cfa7622.js → snk-data-unit-323a507f.js} +2 -2
  70. package/dist/cjs/snk-data-unit-323a507f.js.gz +0 -0
  71. package/dist/cjs/snk-data-unit.cjs.entry.js +3 -3
  72. package/dist/cjs/snk-data-unit.cjs.entry.js.gz +0 -0
  73. package/dist/cjs/snk-default-filter.cjs.entry.js.gz +0 -0
  74. package/dist/cjs/snk-detail-view.cjs.entry.js +7 -7
  75. package/dist/cjs/snk-detail-view.cjs.entry.js.gz +0 -0
  76. package/dist/cjs/snk-entity-list.cjs.entry.js.gz +0 -0
  77. package/dist/cjs/snk-exporter-email-sender.cjs.entry.js.gz +0 -0
  78. package/dist/cjs/snk-expression-group_2.cjs.entry.js.gz +0 -0
  79. package/dist/cjs/snk-filter-advanced-mode_2.cjs.entry.js.gz +0 -0
  80. package/dist/cjs/snk-filter-bar_4.cjs.entry.js +3 -3
  81. package/dist/cjs/snk-filter-bar_4.cjs.entry.js.gz +0 -0
  82. package/dist/cjs/snk-filter-binary-select.cjs.entry.js.gz +0 -0
  83. package/dist/cjs/snk-filter-checkbox-list.cjs.entry.js.gz +0 -0
  84. package/dist/cjs/snk-filter-detail.cjs.entry.js.gz +0 -0
  85. package/dist/cjs/snk-filter-field-search_2.cjs.entry.js.gz +0 -0
  86. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
  87. package/dist/cjs/snk-filter-modal-item.cjs.entry.js.gz +0 -0
  88. package/dist/cjs/snk-filter-multi-select.cjs.entry.js.gz +0 -0
  89. package/dist/cjs/snk-filter-number.cjs.entry.js.gz +0 -0
  90. package/dist/cjs/snk-filter-period.cjs.entry.js.gz +0 -0
  91. package/dist/cjs/snk-filter-search.cjs.entry.js.gz +0 -0
  92. package/dist/cjs/snk-filter-text.cjs.entry.js.gz +0 -0
  93. package/dist/cjs/snk-form-summary.cjs.entry.js.gz +0 -0
  94. package/dist/cjs/snk-form-view.cjs.entry.js.gz +0 -0
  95. package/dist/cjs/snk-form_2.cjs.entry.js +28 -7
  96. package/dist/cjs/snk-form_2.cjs.entry.js.gz +0 -0
  97. package/dist/cjs/snk-grid.cjs.entry.js +6 -6
  98. package/dist/cjs/snk-grid.cjs.entry.js.gz +0 -0
  99. package/dist/cjs/{snk-guides-viewer-38277265.js → snk-guides-viewer-57624b79.js} +5 -5
  100. package/dist/cjs/snk-guides-viewer-57624b79.js.gz +0 -0
  101. package/dist/cjs/snk-guides-viewer.cjs.entry.js +7 -7
  102. package/dist/cjs/snk-guides-viewer.cjs.entry.js.gz +0 -0
  103. package/dist/cjs/snk-personalized-filter-editor.cjs.entry.js.gz +0 -0
  104. package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
  105. package/dist/cjs/snk-personalized-filter.cjs.entry.js.gz +0 -0
  106. package/dist/cjs/snk-pesquisa.cjs.entry.js +4 -4
  107. package/dist/cjs/snk-pesquisa.cjs.entry.js.gz +0 -0
  108. package/dist/cjs/snk-print-selector.cjs.entry.js.gz +0 -0
  109. package/dist/cjs/snk-simple-bar.cjs.entry.js.gz +0 -0
  110. package/dist/cjs/snk-simple-crud.cjs.entry.js +7 -7
  111. package/dist/cjs/snk-simple-crud.cjs.entry.js.gz +0 -0
  112. package/dist/cjs/snk-taskbar.cjs.entry.js +56 -44
  113. package/dist/cjs/snk-taskbar.cjs.entry.js.gz +0 -0
  114. package/dist/cjs/sortable.esm-9a110bb7.js.gz +0 -0
  115. package/dist/cjs/taskbar-elements-fb5d1e08.js.gz +0 -0
  116. package/dist/cjs/taskbar-processor-2fba34a8.js.gz +0 -0
  117. package/dist/cjs/teste-pesquisa.cjs.entry.js.gz +0 -0
  118. package/dist/collection/components/snk-actions-button/actions/enum/ActionsType.js.gz +0 -0
  119. package/dist/collection/components/snk-actions-button/actions/enum/ParamType.js.gz +0 -0
  120. package/dist/collection/components/snk-actions-button/actions/enum/RefreshType.js.gz +0 -0
  121. package/dist/collection/components/snk-actions-button/actions/executor/java.executor.js.gz +0 -0
  122. package/dist/collection/components/snk-actions-button/actions/executor/javascript.executor.js.gz +0 -0
  123. package/dist/collection/components/snk-actions-button/actions/executor/launch-screen.executor.js.gz +0 -0
  124. package/dist/collection/components/snk-actions-button/actions/executor/procedure.executor.js.gz +0 -0
  125. package/dist/collection/components/snk-actions-button/actions/factory/executor.factory.js.gz +0 -0
  126. package/dist/collection/components/snk-actions-button/actions/index.js.gz +0 -0
  127. package/dist/collection/components/snk-actions-button/actions/interfaces/IAction.js.gz +0 -0
  128. package/dist/collection/components/snk-actions-button/actions/interfaces/IExecSource.js.gz +0 -0
  129. package/dist/collection/components/snk-actions-button/actions/interfaces/IExecuteActions.js.gz +0 -0
  130. package/dist/collection/components/snk-actions-button/actions/interfaces/IExecuteActionsProps.js.gz +0 -0
  131. package/dist/collection/components/snk-actions-button/actions/interfaces/IResultParam.js.gz +0 -0
  132. package/dist/collection/components/snk-actions-button/clientEvent/index.js.gz +0 -0
  133. package/dist/collection/components/snk-actions-button/clientEvent/interfaces/IClientEventConfirm.js.gz +0 -0
  134. package/dist/collection/components/snk-actions-button/interfaces/index.js.gz +0 -0
  135. package/dist/collection/components/snk-actions-button/snk-actions-button.css.gz +0 -0
  136. package/dist/collection/components/snk-actions-button/snk-actions-button.js.gz +0 -0
  137. package/dist/collection/components/snk-actions-button/subcomponents/snk-actions-form.js.gz +0 -0
  138. package/dist/collection/components/snk-actions-button/subcomponents/snk-client-confirm.js.gz +0 -0
  139. package/dist/collection/components/snk-application/__mocks__/snk-application.js.gz +0 -0
  140. package/dist/collection/components/snk-application/errorhandler/snk-error-handler.js.gz +0 -0
  141. package/dist/collection/components/snk-application/request-listener/DebouncedRequestListener.js.gz +0 -0
  142. package/dist/collection/components/snk-application/request-listener/RequestListenerFactory.js.gz +0 -0
  143. package/dist/collection/components/snk-application/request-listener/RequestListenerLoadingBar.js.gz +0 -0
  144. package/dist/collection/components/snk-application/search-strategy/exec-prepared-search-plus.js.gz +0 -0
  145. package/dist/collection/components/snk-application/snk-application.css.gz +0 -0
  146. package/dist/collection/components/snk-application/snk-application.js.gz +0 -0
  147. package/dist/collection/components/snk-attach/interfaces/ICrudConfig.js.gz +0 -0
  148. package/dist/collection/components/snk-attach/interfaces/TFetcherType.js.gz +0 -0
  149. package/dist/collection/components/snk-attach/interfaces/index.js.gz +0 -0
  150. package/dist/collection/components/snk-attach/snk-attach.css.gz +0 -0
  151. package/dist/collection/components/snk-attach/snk-attach.js +1 -1
  152. package/dist/collection/components/snk-attach/snk-attach.js.gz +0 -0
  153. package/dist/collection/components/snk-attach/structure/builder/anexo-sistema-crud-config.builder.js.gz +0 -0
  154. package/dist/collection/components/snk-attach/structure/builder/attach-crud-config.builder.js.gz +0 -0
  155. package/dist/collection/components/snk-attach/structure/builder/taskbar-builder.js.gz +0 -0
  156. package/dist/collection/components/snk-attach/structure/fetcher/facade/fetcher.facade.js.gz +0 -0
  157. package/dist/collection/components/snk-attach/structure/fetcher/factory/anexo-sistema-data-unit.factory.js.gz +0 -0
  158. package/dist/collection/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.js.gz +0 -0
  159. package/dist/collection/components/snk-attach/structure/index.js.gz +0 -0
  160. package/dist/collection/components/snk-configurator/AuthorizationConfig.js.gz +0 -0
  161. package/dist/collection/components/snk-configurator/snk-configurator.css.gz +0 -0
  162. package/dist/collection/components/snk-configurator/snk-configurator.js.gz +0 -0
  163. package/dist/collection/components/snk-crud/interfaces/PropsCustomEditor.js.gz +0 -0
  164. package/dist/collection/components/snk-crud/interfaces/PropsCustomRender.js.gz +0 -0
  165. package/dist/collection/components/snk-crud/snk-crud.css.gz +0 -0
  166. package/dist/collection/components/snk-crud/snk-crud.js.gz +0 -0
  167. package/dist/collection/components/snk-crud/subcomponents/CardFormResizeObserver.js.gz +0 -0
  168. package/dist/collection/components/snk-crud/subcomponents/GuideBuilder.js.gz +0 -0
  169. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.css.gz +0 -0
  170. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js.gz +0 -0
  171. package/dist/collection/components/snk-crud/subcomponents/snk-form-summary.css.gz +0 -0
  172. package/dist/collection/components/snk-crud/subcomponents/snk-form-summary.js.gz +0 -0
  173. package/dist/collection/components/snk-crud/subcomponents/snk-form-view.css.gz +0 -0
  174. package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js.gz +0 -0
  175. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.css.gz +0 -0
  176. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +1 -1
  177. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js.gz +0 -0
  178. package/dist/collection/components/snk-custom-slot-elements/snk-custom-slot-elements.css.gz +0 -0
  179. package/dist/collection/components/snk-custom-slot-elements/snk-custom-slot-elements.js.gz +0 -0
  180. package/dist/collection/components/snk-data-exporter/data/attachment.js.gz +0 -0
  181. package/dist/collection/components/snk-data-exporter/data/email.js.gz +0 -0
  182. package/dist/collection/components/snk-data-exporter/data/export-config.js.gz +0 -0
  183. package/dist/collection/components/snk-data-exporter/data/export-result.js.gz +0 -0
  184. package/dist/collection/components/snk-data-exporter/data/report.js.gz +0 -0
  185. package/dist/collection/components/snk-data-exporter/exporter-email-sender/email-info-step.js.gz +0 -0
  186. package/dist/collection/components/snk-data-exporter/exporter-email-sender/options-step.js.gz +0 -0
  187. package/dist/collection/components/snk-data-exporter/exporter-email-sender/snk-exporter-email-sender.js.gz +0 -0
  188. package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js.gz +0 -0
  189. package/dist/collection/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.js.gz +0 -0
  190. package/dist/collection/components/snk-data-exporter/interfaces/IExporterProvider.js.gz +0 -0
  191. package/dist/collection/components/snk-data-exporter/interfaces/IExporterStrategy.js.gz +0 -0
  192. package/dist/collection/components/snk-data-exporter/interfaces/IRecordID.js.gz +0 -0
  193. package/dist/collection/components/snk-data-exporter/interfaces/ISelectedID.js.gz +0 -0
  194. package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js.gz +0 -0
  195. package/dist/collection/components/snk-data-exporter/providers/ServerSideExporterProvider.js.gz +0 -0
  196. package/dist/collection/components/snk-data-exporter/snk-data-exporter.css.gz +0 -0
  197. package/dist/collection/components/snk-data-exporter/snk-data-exporter.js.gz +0 -0
  198. package/dist/collection/components/snk-data-exporter/structure/ItemBuilder.js.gz +0 -0
  199. package/dist/collection/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.js.gz +0 -0
  200. package/dist/collection/components/snk-data-exporter/utils/ParserExport.js.gz +0 -0
  201. package/dist/collection/components/snk-data-unit/MultipleUpdateHelper.js.gz +0 -0
  202. package/dist/collection/components/snk-data-unit/snk-data-unit.js.gz +0 -0
  203. package/dist/collection/components/snk-data-unit/test/resources/metadataMock.js.gz +0 -0
  204. package/dist/collection/components/snk-data-unit/test/resources/parentMetadataMock.js.gz +0 -0
  205. package/dist/collection/components/snk-entity-list/snk-entity-list.css.gz +0 -0
  206. package/dist/collection/components/snk-entity-list/snk-entity-list.js.gz +0 -0
  207. package/dist/collection/components/snk-filter-bar/filter-item/dataunitfilter/data-unit-filter-builder.js.gz +0 -0
  208. package/dist/collection/components/snk-filter-bar/filter-item/editors/enum/filterNumberVariation.js.gz +0 -0
  209. package/dist/collection/components/snk-filter-bar/filter-item/editors/enum/presentationMode.js.gz +0 -0
  210. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.js.gz +0 -0
  211. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-checkbox-list.js.gz +0 -0
  212. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.js.gz +0 -0
  213. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js +1 -1
  214. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js.gz +0 -0
  215. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js.gz +0 -0
  216. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-search.js.gz +0 -0
  217. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js.gz +0 -0
  218. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-personalized-filter-editor/snk-personalized-filter-editor.css.gz +0 -0
  219. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-personalized-filter-editor/snk-personalized-filter-editor.js.gz +0 -0
  220. package/dist/collection/components/snk-filter-bar/filter-item/filter-item-type-mask.enum.js.gz +0 -0
  221. package/dist/collection/components/snk-filter-bar/filter-item/filter-item-type.enum.js.gz +0 -0
  222. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js.gz +0 -0
  223. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.css.gz +0 -0
  224. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js.gz +0 -0
  225. package/dist/collection/components/snk-filter-bar/filter-list/snk-filter-list.js.gz +0 -0
  226. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.css.gz +0 -0
  227. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js.gz +0 -0
  228. package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-default-filter/snk-default-filter.css.gz +0 -0
  229. package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-default-filter/snk-default-filter.js.gz +0 -0
  230. package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.css.gz +0 -0
  231. package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js.gz +0 -0
  232. package/dist/collection/components/snk-filter-bar/snk-filter-bar.css.gz +0 -0
  233. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js.gz +0 -0
  234. package/dist/collection/components/snk-filter-bar/types/custom-element-filter.js.gz +0 -0
  235. package/dist/collection/components/snk-filter-bar/types/default-filters.js.gz +0 -0
  236. package/dist/collection/components/snk-filter-bar/types/filter-type.enum.js.gz +0 -0
  237. package/dist/collection/components/snk-filter-bar/utils/SnkFilterModalFactory.js.gz +0 -0
  238. package/dist/collection/components/snk-filter-bar/utils/filter-validate.js.gz +0 -0
  239. package/dist/collection/components/snk-filter-bar/utils/filters-mock.js.gz +0 -0
  240. package/dist/collection/components/snk-filter-field-search/interfaces/index.js.gz +0 -0
  241. package/dist/collection/components/snk-filter-field-search/snk-filter-field-search.css.gz +0 -0
  242. package/dist/collection/components/snk-filter-field-search/snk-filter-field-search.js.gz +0 -0
  243. package/dist/collection/components/snk-filter-field-search/subcomponents/index.js.gz +0 -0
  244. package/dist/collection/components/snk-filter-field-search/subcomponents/list-item.js.gz +0 -0
  245. package/dist/collection/components/snk-form/snk-form.css.gz +0 -0
  246. package/dist/collection/components/snk-form/snk-form.js.gz +0 -0
  247. package/dist/collection/components/snk-form-config/FormConfigHelper.js +23 -0
  248. package/dist/collection/components/snk-form-config/FormConfigHelper.js.gz +0 -0
  249. package/dist/collection/components/snk-form-config/SnkFormConfigManager.js +6 -6
  250. package/dist/collection/components/snk-form-config/SnkFormConfigManager.js.gz +0 -0
  251. package/dist/collection/components/snk-form-config/config-header/config-header.css.gz +0 -0
  252. package/dist/collection/components/snk-form-config/config-header/config-header.js.gz +0 -0
  253. package/dist/collection/components/snk-form-config/config-header/configs-button/configs-button.css.gz +0 -0
  254. package/dist/collection/components/snk-form-config/config-header/configs-button/configs-button.js.gz +0 -0
  255. package/dist/collection/components/snk-form-config/field-item/field-config/field-config.css.gz +0 -0
  256. package/dist/collection/components/snk-form-config/field-item/field-config/field-config.js.gz +0 -0
  257. package/dist/collection/components/snk-form-config/field-item/field-item.css.gz +0 -0
  258. package/dist/collection/components/snk-form-config/field-item/field-item.js.gz +0 -0
  259. package/dist/collection/components/snk-form-config/fields-layout/fields-layout.css +16 -0
  260. package/dist/collection/components/snk-form-config/fields-layout/fields-layout.css.gz +0 -0
  261. package/dist/collection/components/snk-form-config/fields-layout/fields-layout.js +6 -3
  262. package/dist/collection/components/snk-form-config/fields-layout/fields-layout.js.gz +0 -0
  263. package/dist/collection/components/snk-form-config/fields-selector/fields-selector.css.gz +0 -0
  264. package/dist/collection/components/snk-form-config/fields-selector/fields-selector.js.gz +0 -0
  265. package/dist/collection/components/snk-form-config/guides-configurator/guides-configurator.css +3 -3
  266. package/dist/collection/components/snk-form-config/guides-configurator/guides-configurator.css.gz +0 -0
  267. package/dist/collection/components/snk-form-config/guides-configurator/guides-configurator.js +5 -3
  268. package/dist/collection/components/snk-form-config/guides-configurator/guides-configurator.js.gz +0 -0
  269. package/dist/collection/components/snk-form-config/snk-form-config.css.gz +0 -0
  270. package/dist/collection/components/snk-form-config/snk-form-config.js +25 -4
  271. package/dist/collection/components/snk-form-config/snk-form-config.js.gz +0 -0
  272. package/dist/collection/components/snk-grid/filtercolumn/SnkMultiSelectionListDataSource.js.gz +0 -0
  273. package/dist/collection/components/snk-grid/snk-grid.css.gz +0 -0
  274. package/dist/collection/components/snk-grid/snk-grid.js.gz +0 -0
  275. package/dist/collection/components/snk-grid-config/snk-grid-config.css.gz +0 -0
  276. package/dist/collection/components/snk-grid-config/snk-grid-config.js.gz +0 -0
  277. package/dist/collection/components/snk-grid-config/snk-select-box/snk-select-box.css.gz +0 -0
  278. package/dist/collection/components/snk-grid-config/snk-select-box/snk-select-box.js.gz +0 -0
  279. package/dist/collection/components/snk-layout-form-config/snk-layout-form-config.css.gz +0 -0
  280. package/dist/collection/components/snk-layout-form-config/snk-layout-form-config.js.gz +0 -0
  281. package/dist/collection/components/snk-layout-form-config/snk-view-representation/snk-view-representation.css.gz +0 -0
  282. package/dist/collection/components/snk-layout-form-config/snk-view-representation/snk-view-representation.js.gz +0 -0
  283. package/dist/collection/components/snk-personalized-filter/interfaces/IExpressionGroup.js.gz +0 -0
  284. package/dist/collection/components/snk-personalized-filter/interfaces/IExpressionItem.js.gz +0 -0
  285. package/dist/collection/components/snk-personalized-filter/interfaces/IParameter.js.gz +0 -0
  286. package/dist/collection/components/snk-personalized-filter/interfaces/IPersonalizedFilter.js.gz +0 -0
  287. package/dist/collection/components/snk-personalized-filter/interfaces/ISystemFilterConfig.js.gz +0 -0
  288. package/dist/collection/components/snk-personalized-filter/interfaces/IUserFilterConfig.js.gz +0 -0
  289. package/dist/collection/components/snk-personalized-filter/interfaces/index.js.gz +0 -0
  290. package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.css.gz +0 -0
  291. package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js.gz +0 -0
  292. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-group/snk-expression-group.css.gz +0 -0
  293. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-group/snk-expression-group.js.gz +0 -0
  294. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/filter-operands/filter-operands.js.gz +0 -0
  295. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.css.gz +0 -0
  296. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.js.gz +0 -0
  297. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-advanced-mode/snk-filter-advanced-mode.css.gz +0 -0
  298. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-advanced-mode/snk-filter-advanced-mode.js.gz +0 -0
  299. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-assistent-mode/snk-filter-assistent-mode.css.gz +0 -0
  300. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-assistent-mode/snk-filter-assistent-mode.js.gz +0 -0
  301. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/snk-filter-param-config.css.gz +0 -0
  302. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/snk-filter-param-config.js.gz +0 -0
  303. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/utils/PersonalizedFilterUtils.js.gz +0 -0
  304. package/dist/collection/components/snk-pesquisa/pesquisa-grid/pesquisa-grid.css.gz +0 -0
  305. package/dist/collection/components/snk-pesquisa/pesquisa-grid/pesquisa-grid.js.gz +0 -0
  306. package/dist/collection/components/snk-pesquisa/pesquisa-tree/pesquisa-tree.css.gz +0 -0
  307. package/dist/collection/components/snk-pesquisa/pesquisa-tree/pesquisa-tree.js.gz +0 -0
  308. package/dist/collection/components/snk-pesquisa/pesquisaHelper.js.gz +0 -0
  309. package/dist/collection/components/snk-pesquisa/snk-pesquisa.css.gz +0 -0
  310. package/dist/collection/components/snk-pesquisa/snk-pesquisa.js.gz +0 -0
  311. package/dist/collection/components/snk-print-selector/snk-print-selector.css.gz +0 -0
  312. package/dist/collection/components/snk-print-selector/snk-print-selector.js.gz +0 -0
  313. package/dist/collection/components/snk-simple-bar/snk-simple-bar.css.gz +0 -0
  314. package/dist/collection/components/snk-simple-bar/snk-simple-bar.js.gz +0 -0
  315. package/dist/collection/components/snk-simple-crud/snk-simple-crud.constants.js.gz +0 -0
  316. package/dist/collection/components/snk-simple-crud/snk-simple-crud.css.gz +0 -0
  317. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +1 -1
  318. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js.gz +0 -0
  319. package/dist/collection/components/snk-simple-form-config/snk-simple-form-config.css.gz +0 -0
  320. package/dist/collection/components/snk-simple-form-config/snk-simple-form-config.js.gz +0 -0
  321. package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.css.gz +0 -0
  322. package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.js.gz +0 -0
  323. package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js.gz +0 -0
  324. package/dist/collection/components/snk-taskbar/elements/taskbar-split-button/taskbar-split-button.css.gz +0 -0
  325. package/dist/collection/components/snk-taskbar/elements/taskbar-split-button/taskbar-split-button.js.gz +0 -0
  326. package/dist/collection/components/snk-taskbar/processor/taskbar-processor.js.gz +0 -0
  327. package/dist/collection/components/snk-taskbar/snk-taskbar.css.gz +0 -0
  328. package/dist/collection/components/snk-taskbar/snk-taskbar.js +58 -44
  329. package/dist/collection/components/snk-taskbar/snk-taskbar.js.gz +0 -0
  330. package/dist/collection/components/teste-pesquisa/teste-pesquisa.css.gz +0 -0
  331. package/dist/collection/components/teste-pesquisa/teste-pesquisa.js.gz +0 -0
  332. package/dist/collection/index.js.gz +0 -0
  333. package/dist/collection/lib/@types/index.js.gz +0 -0
  334. package/dist/collection/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.js.gz +0 -0
  335. package/dist/collection/lib/applet-caller/applet-caller.js.gz +0 -0
  336. package/dist/collection/lib/auth/mgeauthorization.module.js.gz +0 -0
  337. package/dist/collection/lib/configs/ConfigStorage.js.gz +0 -0
  338. package/dist/collection/lib/configs/LayoutFormConfig.js.gz +0 -0
  339. package/dist/collection/lib/dataUnit/InMemoryLoader.js.gz +0 -0
  340. package/dist/collection/lib/dataUnit/ValueFormatter.js.gz +0 -0
  341. package/dist/collection/lib/dataUnit/dataUnitInMemoryUtils.js.gz +0 -0
  342. package/dist/collection/lib/dataUnit/interfaces/InMemoryLoaderConfig.js.gz +0 -0
  343. package/dist/collection/lib/http/data-fetcher/DataFetcher.js.gz +0 -0
  344. package/dist/collection/lib/http/data-fetcher/custom-xhr-override.js.gz +0 -0
  345. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/anexo-sistema-fetcher.js.gz +0 -0
  346. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/attach-fetcher.js.gz +0 -0
  347. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/facade/attach-fetcher.facade.js.gz +0 -0
  348. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/index.js.gz +0 -0
  349. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/IDelete.js.gz +0 -0
  350. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/IDownloadKey.js.gz +0 -0
  351. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/ISave.js.gz +0 -0
  352. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/index.js.gz +0 -0
  353. package/dist/collection/lib/http/data-fetcher/fetchers/application-config-fetcher.js.gz +0 -0
  354. package/dist/collection/lib/http/data-fetcher/fetchers/auth-fetcher.js.gz +0 -0
  355. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.js.gz +0 -0
  356. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.js.gz +0 -0
  357. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.js.gz +0 -0
  358. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.js.gz +0 -0
  359. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/helpers/DataUnitDataLoaderHelper.js.gz +0 -0
  360. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IBuildRequestBodyLoadRowMetadata.js.gz +0 -0
  361. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadDataResult.js.gz +0 -0
  362. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadDataStrategy.js.gz +0 -0
  363. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadingInfo.js.gz +0 -0
  364. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRecordField.js.gz +0 -0
  365. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IResponseRecord.js.gz +0 -0
  366. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRowMetadata.js.gz +0 -0
  367. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DataUnitStrategy.js.gz +0 -0
  368. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js.gz +0 -0
  369. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/test/resources/metadataMock.js.gz +0 -0
  370. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IExporterColumnMetadata.js.gz +0 -0
  371. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams.js.gz +0 -0
  372. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterResponse.js.gz +0 -0
  373. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IPersonalizedReport.js.gz +0 -0
  374. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/permission-export-pdf.js.gz +0 -0
  375. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/personalized-reports-fetcher.js.gz +0 -0
  376. package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js.gz +0 -0
  377. package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js.gz +0 -0
  378. package/dist/collection/lib/http/data-fetcher/fetchers/grid-config-fetcher.js.gz +0 -0
  379. package/dist/collection/lib/http/data-fetcher/fetchers/parameters-fecher.js.gz +0 -0
  380. package/dist/collection/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.js.gz +0 -0
  381. package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js.gz +0 -0
  382. package/dist/collection/lib/http/data-fetcher/fetchers/resource-fetcher.js.gz +0 -0
  383. package/dist/collection/lib/http/data-fetcher/fetchers/totals-fetcher.js.gz +0 -0
  384. package/dist/collection/lib/http/data-fetcher/interfaces/IClientEventResponse.js.gz +0 -0
  385. package/dist/collection/lib/http/data-fetcher/recaller/GraphQLRecaller.js.gz +0 -0
  386. package/dist/collection/lib/http/data-fetcher/recaller/IDataFetcherRecaller.js.gz +0 -0
  387. package/dist/collection/lib/http/data-fetcher/recaller/ServiceBrokerRecaller.js.gz +0 -0
  388. package/dist/collection/lib/http/data-fetcher/state/LoadStateManager.js.gz +0 -0
  389. package/dist/collection/lib/index.js.gz +0 -0
  390. package/dist/collection/lib/message/SnkMessageBuilder.js.gz +0 -0
  391. package/dist/collection/lib/message/messageResourceEnUSUtils.js.gz +0 -0
  392. package/dist/collection/lib/message/messageResourceEsESUtils.js.gz +0 -0
  393. package/dist/collection/lib/message/messageResourcePtBRUtils.js.gz +0 -0
  394. package/dist/collection/lib/message/resources/en-us/continuousInsertUtils.msg.js.gz +0 -0
  395. package/dist/collection/lib/message/resources/en-us/crud-utils.msg.js.gz +0 -0
  396. package/dist/collection/lib/message/resources/en-us/dataFetcher.msg.js.gz +0 -0
  397. package/dist/collection/lib/message/resources/en-us/dataUnitDataLoaderHelper.msg.js.gz +0 -0
  398. package/dist/collection/lib/message/resources/en-us/file-viewer.msg.js.gz +0 -0
  399. package/dist/collection/lib/message/resources/en-us/snk-actions-button.msg.js.gz +0 -0
  400. package/dist/collection/lib/message/resources/en-us/snk-application.msg.js.gz +0 -0
  401. package/dist/collection/lib/message/resources/en-us/snk-attach.msg.js.gz +0 -0
  402. package/dist/collection/lib/message/resources/en-us/snk-configurator.msg.js.gz +0 -0
  403. package/dist/collection/lib/message/resources/en-us/snk-crud.msg.js.gz +0 -0
  404. package/dist/collection/lib/message/resources/en-us/snk-data-exporter.msg.js.gz +0 -0
  405. package/dist/collection/lib/message/resources/en-us/snk-data-unit.msg.js.gz +0 -0
  406. package/dist/collection/lib/message/resources/en-us/snk-entity-list.msg.js.gz +0 -0
  407. package/dist/collection/lib/message/resources/en-us/snk-error-handler.msg.js.gz +0 -0
  408. package/dist/collection/lib/message/resources/en-us/snk-exporter.msg.js.gz +0 -0
  409. package/dist/collection/lib/message/resources/en-us/snk-filter-bar.msg.js.gz +0 -0
  410. package/dist/collection/lib/message/resources/en-us/snk-filter-field-search.msg.js.gz +0 -0
  411. package/dist/collection/lib/message/resources/en-us/snk-filter-list.msg.js.gz +0 -0
  412. package/dist/collection/lib/message/resources/en-us/snk-filter-param-config.msg.js.gz +0 -0
  413. package/dist/collection/lib/message/resources/en-us/snk-form.msg.js +7 -0
  414. package/dist/collection/lib/message/resources/en-us/snk-form.msg.js.gz +0 -0
  415. package/dist/collection/lib/message/resources/en-us/snk-grid.msg.js.gz +0 -0
  416. package/dist/collection/lib/message/resources/en-us/snk-layout-form-config.msg.js.gz +0 -0
  417. package/dist/collection/lib/message/resources/en-us/snk-personalized-filter.msg.js.gz +0 -0
  418. package/dist/collection/lib/message/resources/en-us/snk-pesquisa.msg.js.gz +0 -0
  419. package/dist/collection/lib/message/resources/en-us/snk-print-selector.msg.js.gz +0 -0
  420. package/dist/collection/lib/message/resources/en-us/snk-simple-bar.msg.js.gz +0 -0
  421. package/dist/collection/lib/message/resources/en-us/snk-simple-crud.msg.js.gz +0 -0
  422. package/dist/collection/lib/message/resources/en-us/snk-simple-form-config.msg.js.gz +0 -0
  423. package/dist/collection/lib/message/resources/en-us/snk-taskbar.msg.js.gz +0 -0
  424. package/dist/collection/lib/message/resources/es-es/continuousInsertUtils.msg.js.gz +0 -0
  425. package/dist/collection/lib/message/resources/es-es/crud-utils.msg.js.gz +0 -0
  426. package/dist/collection/lib/message/resources/es-es/dataFetcher.msg.js.gz +0 -0
  427. package/dist/collection/lib/message/resources/es-es/dataUnitDataLoaderHelper.msg.js.gz +0 -0
  428. package/dist/collection/lib/message/resources/es-es/file-viewer.msg.js.gz +0 -0
  429. package/dist/collection/lib/message/resources/es-es/snk-actions-button.msg.js.gz +0 -0
  430. package/dist/collection/lib/message/resources/es-es/snk-application.msg.js.gz +0 -0
  431. package/dist/collection/lib/message/resources/es-es/snk-attach.msg.js.gz +0 -0
  432. package/dist/collection/lib/message/resources/es-es/snk-configurator.msg.js.gz +0 -0
  433. package/dist/collection/lib/message/resources/es-es/snk-crud.msg.js.gz +0 -0
  434. package/dist/collection/lib/message/resources/es-es/snk-data-exporter.msg.js.gz +0 -0
  435. package/dist/collection/lib/message/resources/es-es/snk-data-unit.msg.js.gz +0 -0
  436. package/dist/collection/lib/message/resources/es-es/snk-entity-list.msg.js.gz +0 -0
  437. package/dist/collection/lib/message/resources/es-es/snk-error-handler.msg.js.gz +0 -0
  438. package/dist/collection/lib/message/resources/es-es/snk-exporter.msg.js.gz +0 -0
  439. package/dist/collection/lib/message/resources/es-es/snk-filter-bar.msg.js.gz +0 -0
  440. package/dist/collection/lib/message/resources/es-es/snk-filter-field-search.msg.js.gz +0 -0
  441. package/dist/collection/lib/message/resources/es-es/snk-filter-list.msg.js.gz +0 -0
  442. package/dist/collection/lib/message/resources/es-es/snk-filter-param-config.msg.js.gz +0 -0
  443. package/dist/collection/lib/message/resources/es-es/snk-form.msg.js +7 -0
  444. package/dist/collection/lib/message/resources/es-es/snk-form.msg.js.gz +0 -0
  445. package/dist/collection/lib/message/resources/es-es/snk-grid.msg.js.gz +0 -0
  446. package/dist/collection/lib/message/resources/es-es/snk-layout-form-config.msg.js.gz +0 -0
  447. package/dist/collection/lib/message/resources/es-es/snk-personalized-filter.msg.js.gz +0 -0
  448. package/dist/collection/lib/message/resources/es-es/snk-pesquisa.msg.js.gz +0 -0
  449. package/dist/collection/lib/message/resources/es-es/snk-print-selector.msg.js.gz +0 -0
  450. package/dist/collection/lib/message/resources/es-es/snk-simple-bar.msg.js.gz +0 -0
  451. package/dist/collection/lib/message/resources/es-es/snk-simple-crud.msg.js.gz +0 -0
  452. package/dist/collection/lib/message/resources/es-es/snk-simple-form-config.msg.js.gz +0 -0
  453. package/dist/collection/lib/message/resources/es-es/snk-taskbar.msg.js.gz +0 -0
  454. package/dist/collection/lib/message/resources/pt-br/continuousInsertUtils.msg.js.gz +0 -0
  455. package/dist/collection/lib/message/resources/pt-br/crud-utils.msg.js.gz +0 -0
  456. package/dist/collection/lib/message/resources/pt-br/dataFetcher.msg.js.gz +0 -0
  457. package/dist/collection/lib/message/resources/pt-br/dataUnitDataLoaderHelper.msg.js.gz +0 -0
  458. package/dist/collection/lib/message/resources/pt-br/file-viewer.msg.js.gz +0 -0
  459. package/dist/collection/lib/message/resources/pt-br/snk-actions-button.msg.js.gz +0 -0
  460. package/dist/collection/lib/message/resources/pt-br/snk-application.msg.js.gz +0 -0
  461. package/dist/collection/lib/message/resources/pt-br/snk-attach.msg.js.gz +0 -0
  462. package/dist/collection/lib/message/resources/pt-br/snk-configurator.msg.js.gz +0 -0
  463. package/dist/collection/lib/message/resources/pt-br/snk-crud.msg.js.gz +0 -0
  464. package/dist/collection/lib/message/resources/pt-br/snk-data-exporter.msg.js.gz +0 -0
  465. package/dist/collection/lib/message/resources/pt-br/snk-data-unit.msg.js.gz +0 -0
  466. package/dist/collection/lib/message/resources/pt-br/snk-entity-list.msg.js.gz +0 -0
  467. package/dist/collection/lib/message/resources/pt-br/snk-error-handler.msg.js.gz +0 -0
  468. package/dist/collection/lib/message/resources/pt-br/snk-exporter.msg.js.gz +0 -0
  469. package/dist/collection/lib/message/resources/pt-br/snk-filter-bar.msg.js.gz +0 -0
  470. package/dist/collection/lib/message/resources/pt-br/snk-filter-field-search.msg.js.gz +0 -0
  471. package/dist/collection/lib/message/resources/pt-br/snk-filter-list.msg.js.gz +0 -0
  472. package/dist/collection/lib/message/resources/pt-br/snk-filter-param-config.msg.js.gz +0 -0
  473. package/dist/collection/lib/message/resources/pt-br/snk-form.msg.js +7 -0
  474. package/dist/collection/lib/message/resources/pt-br/snk-form.msg.js.gz +0 -0
  475. package/dist/collection/lib/message/resources/pt-br/snk-grid.msg.js.gz +0 -0
  476. package/dist/collection/lib/message/resources/pt-br/snk-layout-form-config.msg.js.gz +0 -0
  477. package/dist/collection/lib/message/resources/pt-br/snk-personalized-filter.msg.js.gz +0 -0
  478. package/dist/collection/lib/message/resources/pt-br/snk-pesquisa.msg.js.gz +0 -0
  479. package/dist/collection/lib/message/resources/pt-br/snk-print-selector.msg.js.gz +0 -0
  480. package/dist/collection/lib/message/resources/pt-br/snk-simple-bar.msg.js.gz +0 -0
  481. package/dist/collection/lib/message/resources/pt-br/snk-simple-crud.msg.js.gz +0 -0
  482. package/dist/collection/lib/message/resources/pt-br/snk-simple-form-config.msg.js.gz +0 -0
  483. package/dist/collection/lib/message/resources/pt-br/snk-taskbar.msg.js.gz +0 -0
  484. package/dist/collection/lib/resourceid/ResourceIDUtils.js.gz +0 -0
  485. package/dist/collection/lib/store/index.js.gz +0 -0
  486. package/dist/collection/lib/utils/ContinuousInsertUtils.js.gz +0 -0
  487. package/dist/collection/lib/utils/CrudUtils.js.gz +0 -0
  488. package/dist/collection/lib/utils/GetSelectedRecordsIDsInfo.js.gz +0 -0
  489. package/dist/collection/lib/utils/PrintUtils.js.gz +0 -0
  490. package/dist/collection/lib/utils/constants.js.gz +0 -0
  491. package/dist/collection/lib/utils/fileViewer/index.js.gz +0 -0
  492. package/dist/collection/lib/utils/fileViewer/interfaces/IFileViewerParams.js.gz +0 -0
  493. package/dist/collection/lib/utils/pesquisa.js.gz +0 -0
  494. package/dist/collection/lib/utils/urlutils.js.gz +0 -0
  495. package/dist/collection/lib/workspace/workspace.js.gz +0 -0
  496. package/dist/collection/sw.js.gz +0 -0
  497. package/dist/components/AuthorizationConfig.js.gz +0 -0
  498. package/dist/components/ConfigStorage.js.gz +0 -0
  499. package/dist/components/ContinuousInsertUtils.js.gz +0 -0
  500. package/dist/components/DataFetcher.js +21 -0
  501. package/dist/components/DataFetcher.js.gz +0 -0
  502. package/dist/components/GetSelectedRecordsIDsInfo.js.gz +0 -0
  503. package/dist/components/ISave.js.gz +0 -0
  504. package/dist/components/ParamType.js.gz +0 -0
  505. package/dist/components/PersonalizedFilterUtils.js.gz +0 -0
  506. package/dist/components/PrintUtils.js.gz +0 -0
  507. package/dist/components/ResourceIDUtils.js.gz +0 -0
  508. package/dist/components/SnkFormConfigManager.js +6 -6
  509. package/dist/components/SnkFormConfigManager.js.gz +0 -0
  510. package/dist/components/auth-fetcher.js.gz +0 -0
  511. package/dist/components/config-header.js.gz +0 -0
  512. package/dist/components/config-header2.js.gz +0 -0
  513. package/dist/components/configs-button.js.gz +0 -0
  514. package/dist/components/configs-button2.js.gz +0 -0
  515. package/dist/components/constants.js.gz +0 -0
  516. package/dist/components/dataunit-fetcher.js.gz +0 -0
  517. package/dist/components/field-config.js.gz +0 -0
  518. package/dist/components/field-config2.js +24 -1
  519. package/dist/components/field-config2.js.gz +0 -0
  520. package/dist/components/field-item.js.gz +0 -0
  521. package/dist/components/field-item2.js.gz +0 -0
  522. package/dist/components/fields-layout.js.gz +0 -0
  523. package/dist/components/fields-layout2.js +6 -3
  524. package/dist/components/fields-layout2.js.gz +0 -0
  525. package/dist/components/fields-selector.js.gz +0 -0
  526. package/dist/components/fields-selector2.js.gz +0 -0
  527. package/dist/components/filter-item-type.enum.js.gz +0 -0
  528. package/dist/components/filterNumberVariation.js.gz +0 -0
  529. package/dist/components/form-config-fetcher.js.gz +0 -0
  530. package/dist/components/guides-configurator.js.gz +0 -0
  531. package/dist/components/guides-configurator2.js +5 -3
  532. package/dist/components/guides-configurator2.js.gz +0 -0
  533. package/dist/components/index.js.gz +0 -0
  534. package/dist/components/index2.js.gz +0 -0
  535. package/dist/components/pesquisa-grid.js.gz +0 -0
  536. package/dist/components/pesquisa-grid2.js.gz +0 -0
  537. package/dist/components/pesquisa-tree.js.gz +0 -0
  538. package/dist/components/pesquisa-tree2.js.gz +0 -0
  539. package/dist/components/presentationMode.js.gz +0 -0
  540. package/dist/components/snk-actions-button.js.gz +0 -0
  541. package/dist/components/snk-actions-button2.js.gz +0 -0
  542. package/dist/components/snk-actions-form.js.gz +0 -0
  543. package/dist/components/snk-application.js.gz +0 -0
  544. package/dist/components/snk-application2.js.gz +0 -0
  545. package/dist/components/snk-attach.js.gz +0 -0
  546. package/dist/components/snk-attach2.js +1 -1
  547. package/dist/components/snk-attach2.js.gz +0 -0
  548. package/dist/components/snk-client-confirm.js.gz +0 -0
  549. package/dist/components/snk-configurator.js.gz +0 -0
  550. package/dist/components/snk-configurator2.js.gz +0 -0
  551. package/dist/components/snk-crud.js.gz +0 -0
  552. package/dist/components/snk-custom-slot-elements.js.gz +0 -0
  553. package/dist/components/snk-data-exporter.js.gz +0 -0
  554. package/dist/components/snk-data-exporter2.js.gz +0 -0
  555. package/dist/components/snk-data-unit.js.gz +0 -0
  556. package/dist/components/snk-data-unit2.js.gz +0 -0
  557. package/dist/components/snk-default-filter.js.gz +0 -0
  558. package/dist/components/snk-default-filter2.js.gz +0 -0
  559. package/dist/components/snk-detail-view.js.gz +0 -0
  560. package/dist/components/snk-detail-view2.js +1 -1
  561. package/dist/components/snk-detail-view2.js.gz +0 -0
  562. package/dist/components/snk-entity-list.js.gz +0 -0
  563. package/dist/components/snk-exporter-email-sender.js.gz +0 -0
  564. package/dist/components/snk-exporter-email-sender2.js.gz +0 -0
  565. package/dist/components/snk-expression-group.js.gz +0 -0
  566. package/dist/components/snk-expression-group2.js.gz +0 -0
  567. package/dist/components/snk-expression-item.js.gz +0 -0
  568. package/dist/components/snk-expression-item2.js.gz +0 -0
  569. package/dist/components/snk-filter-advanced-mode.js.gz +0 -0
  570. package/dist/components/snk-filter-advanced-mode2.js.gz +0 -0
  571. package/dist/components/snk-filter-assistent-mode.js.gz +0 -0
  572. package/dist/components/snk-filter-assistent-mode2.js.gz +0 -0
  573. package/dist/components/snk-filter-bar.js.gz +0 -0
  574. package/dist/components/snk-filter-bar2.js.gz +0 -0
  575. package/dist/components/snk-filter-binary-select.js.gz +0 -0
  576. package/dist/components/snk-filter-checkbox-list.js.gz +0 -0
  577. package/dist/components/snk-filter-detail.js.gz +0 -0
  578. package/dist/components/snk-filter-detail2.js.gz +0 -0
  579. package/dist/components/snk-filter-field-search.js.gz +0 -0
  580. package/dist/components/snk-filter-field-search2.js.gz +0 -0
  581. package/dist/components/snk-filter-item.js.gz +0 -0
  582. package/dist/components/snk-filter-item2.js.gz +0 -0
  583. package/dist/components/snk-filter-list.js.gz +0 -0
  584. package/dist/components/snk-filter-modal-item.js.gz +0 -0
  585. package/dist/components/snk-filter-modal-item2.js.gz +0 -0
  586. package/dist/components/snk-filter-modal.js.gz +0 -0
  587. package/dist/components/snk-filter-modal2.js.gz +0 -0
  588. package/dist/components/snk-filter-multi-select.js.gz +0 -0
  589. package/dist/components/snk-filter-number.js +1 -1
  590. package/dist/components/snk-filter-number.js.gz +0 -0
  591. package/dist/components/snk-filter-param-config.js.gz +0 -0
  592. package/dist/components/snk-filter-param-config2.js.gz +0 -0
  593. package/dist/components/snk-filter-period.js.gz +0 -0
  594. package/dist/components/snk-filter-search.js.gz +0 -0
  595. package/dist/components/snk-filter-text.js.gz +0 -0
  596. package/dist/components/snk-form-config.js.gz +0 -0
  597. package/dist/components/snk-form-config2.js +24 -3
  598. package/dist/components/snk-form-config2.js.gz +0 -0
  599. package/dist/components/snk-form-summary.js.gz +0 -0
  600. package/dist/components/snk-form-summary2.js.gz +0 -0
  601. package/dist/components/snk-form-view.js.gz +0 -0
  602. package/dist/components/snk-form-view2.js.gz +0 -0
  603. package/dist/components/snk-form.js.gz +0 -0
  604. package/dist/components/snk-grid-config.js.gz +0 -0
  605. package/dist/components/snk-grid-config2.js.gz +0 -0
  606. package/dist/components/snk-grid.js.gz +0 -0
  607. package/dist/components/snk-grid2.js.gz +0 -0
  608. package/dist/components/snk-guides-viewer.js.gz +0 -0
  609. package/dist/components/snk-layout-form-config.js.gz +0 -0
  610. package/dist/components/snk-layout-form-config2.js.gz +0 -0
  611. package/dist/components/snk-personalized-filter-editor.js.gz +0 -0
  612. package/dist/components/snk-personalized-filter.js.gz +0 -0
  613. package/dist/components/snk-personalized-filter2.js.gz +0 -0
  614. package/dist/components/snk-pesquisa.js.gz +0 -0
  615. package/dist/components/snk-pesquisa2.js.gz +0 -0
  616. package/dist/components/snk-print-selector.js.gz +0 -0
  617. package/dist/components/snk-select-box.js.gz +0 -0
  618. package/dist/components/snk-select-box2.js.gz +0 -0
  619. package/dist/components/snk-simple-bar.js.gz +0 -0
  620. package/dist/components/snk-simple-bar2.js.gz +0 -0
  621. package/dist/components/snk-simple-crud.js.gz +0 -0
  622. package/dist/components/snk-simple-crud2.js +1 -1
  623. package/dist/components/snk-simple-crud2.js.gz +0 -0
  624. package/dist/components/snk-simple-form-config.js.gz +0 -0
  625. package/dist/components/snk-simple-form-config2.js.gz +0 -0
  626. package/dist/components/snk-taskbar.js.gz +0 -0
  627. package/dist/components/snk-taskbar2.js +57 -45
  628. package/dist/components/snk-taskbar2.js.gz +0 -0
  629. package/dist/components/snk-view-representation.js.gz +0 -0
  630. package/dist/components/snk-view-representation2.js.gz +0 -0
  631. package/dist/components/sortable.esm.js.gz +0 -0
  632. package/dist/components/taskbar-actions-button.js.gz +0 -0
  633. package/dist/components/taskbar-actions-button2.js.gz +0 -0
  634. package/dist/components/taskbar-split-button.js.gz +0 -0
  635. package/dist/components/taskbar-split-button2.js.gz +0 -0
  636. package/dist/components/teste-pesquisa.js.gz +0 -0
  637. package/dist/esm/AuthorizationConfig-dcbd207a.js.gz +0 -0
  638. package/dist/esm/{ConfigStorage-22eace3a.js → ConfigStorage-a60b12c2.js} +2 -2
  639. package/dist/esm/ConfigStorage-a60b12c2.js.gz +0 -0
  640. package/dist/esm/{DataFetcher-f6b2961a.js → DataFetcher-9a1709a3.js} +21 -0
  641. package/dist/esm/{DataFetcher-f6b2961a.js.gz → DataFetcher-9a1709a3.js.gz} +0 -0
  642. package/dist/esm/{FormConfigHelper-4e42f0b6.js → FormConfigHelper-b9cf7758.js} +24 -1
  643. package/dist/esm/FormConfigHelper-b9cf7758.js.gz +0 -0
  644. package/dist/esm/GetSelectedRecordsIDsInfo-9fa41508.js.gz +0 -0
  645. package/dist/esm/IFetchDataExporterParams-d73bed3d.js.gz +0 -0
  646. package/dist/esm/{ISave-6b7b0423.js → ISave-b9c9188b.js} +1 -1
  647. package/dist/esm/ISave-b9c9188b.js.gz +0 -0
  648. package/dist/esm/ParamType-d5152b06.js.gz +0 -0
  649. package/dist/esm/PersonalizedFilterUtils-2db38ff2.js.gz +0 -0
  650. package/dist/esm/PrintUtils-3e4ff0f5.js.gz +0 -0
  651. package/dist/esm/ResourceIDUtils-a114189a.js.gz +0 -0
  652. package/dist/esm/{SnkFormConfigManager-968b97e7.js → SnkFormConfigManager-1548dc73.js} +7 -7
  653. package/dist/esm/SnkFormConfigManager-1548dc73.js.gz +0 -0
  654. package/dist/esm/{SnkMultiSelectionListDataSource-1136c4e7.js → SnkMultiSelectionListDataSource-65764464.js} +4 -4
  655. package/dist/esm/SnkMultiSelectionListDataSource-65764464.js.gz +0 -0
  656. package/dist/esm/{auth-fetcher-cf39e42b.js → auth-fetcher-566bad7c.js} +1 -1
  657. package/dist/esm/auth-fetcher-566bad7c.js.gz +0 -0
  658. package/dist/esm/config-header.entry.js.gz +0 -0
  659. package/dist/esm/configs-button.entry.js.gz +0 -0
  660. package/dist/esm/constants-7b422de0.js.gz +0 -0
  661. package/dist/esm/{dataunit-fetcher-6314b19d.js → dataunit-fetcher-eba36247.js} +1 -1
  662. package/dist/esm/dataunit-fetcher-eba36247.js.gz +0 -0
  663. package/dist/esm/default-filters-50105e43.js.gz +0 -0
  664. package/dist/esm/field-config_2.entry.js +1 -1
  665. package/dist/esm/field-config_2.entry.js.gz +0 -0
  666. package/dist/esm/fields-layout.entry.js +6 -3
  667. package/dist/esm/fields-layout.entry.js.gz +0 -0
  668. package/dist/esm/fields-selector.entry.js +1 -1
  669. package/dist/esm/fields-selector.entry.js.gz +0 -0
  670. package/dist/esm/filter-item-type.enum-d45e026f.js.gz +0 -0
  671. package/dist/esm/filter-type.enum-f6a8fe23.js.gz +0 -0
  672. package/dist/esm/filter-validate-faf51fa9.js.gz +0 -0
  673. package/dist/esm/filterNumberVariation-8cee02ea.js.gz +0 -0
  674. package/dist/esm/{form-config-fetcher-bc6f0f1f.js → form-config-fetcher-cf8c52d0.js} +1 -1
  675. package/dist/esm/form-config-fetcher-cf8c52d0.js.gz +0 -0
  676. package/dist/esm/guides-configurator.entry.js +5 -3
  677. package/dist/esm/guides-configurator.entry.js.gz +0 -0
  678. package/dist/esm/index-446f9341.js.gz +0 -0
  679. package/dist/esm/index-479e1293.js.gz +0 -0
  680. package/dist/esm/index-620ac460.js.gz +0 -0
  681. package/dist/esm/index-8acbae97.js.gz +0 -0
  682. package/dist/esm/index-b40568ff.js.gz +0 -0
  683. package/dist/esm/index.js.gz +0 -0
  684. package/dist/esm/loader.js +1 -1
  685. package/dist/esm/loader.js.gz +0 -0
  686. package/dist/esm/pesquisa-grid_2.entry.js +4 -4
  687. package/dist/esm/pesquisa-grid_2.entry.js.gz +0 -0
  688. package/dist/esm/polyfills/core-js.js.gz +0 -0
  689. package/dist/esm/polyfills/css-shim.js.gz +0 -0
  690. package/dist/esm/polyfills/dom.js.gz +0 -0
  691. package/dist/esm/polyfills/es5-html-element.js.gz +0 -0
  692. package/dist/esm/polyfills/index.js.gz +0 -0
  693. package/dist/esm/polyfills/system.js.gz +0 -0
  694. package/dist/esm/presentationMode-783bbf9d.js.gz +0 -0
  695. package/dist/esm/sankhyablocks.js +1 -1
  696. package/dist/esm/sankhyablocks.js.gz +0 -0
  697. package/dist/esm/snk-actions-button_8.entry.js +5 -5
  698. package/dist/esm/snk-actions-button_8.entry.js.gz +0 -0
  699. package/dist/esm/snk-actions-form.entry.js.gz +0 -0
  700. package/dist/esm/snk-application.entry.js +6 -6
  701. package/dist/esm/snk-application.entry.js.gz +0 -0
  702. package/dist/esm/snk-attach.entry.js +5 -5
  703. package/dist/esm/snk-attach.entry.js.gz +0 -0
  704. package/dist/esm/snk-client-confirm.entry.js.gz +0 -0
  705. package/dist/esm/snk-configurator.entry.js.gz +0 -0
  706. package/dist/esm/snk-crud.entry.js +5 -5
  707. package/dist/esm/snk-crud.entry.js.gz +0 -0
  708. package/dist/esm/snk-custom-slot-elements.entry.js.gz +0 -0
  709. package/dist/esm/snk-data-exporter.entry.js +5 -5
  710. package/dist/esm/snk-data-exporter.entry.js.gz +0 -0
  711. package/dist/esm/{snk-data-unit-4acf4781.js → snk-data-unit-693849e3.js} +2 -2
  712. package/dist/esm/snk-data-unit-693849e3.js.gz +0 -0
  713. package/dist/esm/snk-data-unit.entry.js +3 -3
  714. package/dist/esm/snk-data-unit.entry.js.gz +0 -0
  715. package/dist/esm/snk-default-filter.entry.js.gz +0 -0
  716. package/dist/esm/snk-detail-view.entry.js +7 -7
  717. package/dist/esm/snk-detail-view.entry.js.gz +0 -0
  718. package/dist/esm/snk-entity-list.entry.js.gz +0 -0
  719. package/dist/esm/snk-exporter-email-sender.entry.js.gz +0 -0
  720. package/dist/esm/snk-expression-group_2.entry.js.gz +0 -0
  721. package/dist/esm/snk-filter-advanced-mode_2.entry.js.gz +0 -0
  722. package/dist/esm/snk-filter-bar_4.entry.js +3 -3
  723. package/dist/esm/snk-filter-bar_4.entry.js.gz +0 -0
  724. package/dist/esm/snk-filter-binary-select.entry.js.gz +0 -0
  725. package/dist/esm/snk-filter-checkbox-list.entry.js.gz +0 -0
  726. package/dist/esm/snk-filter-detail.entry.js.gz +0 -0
  727. package/dist/esm/snk-filter-field-search_2.entry.js.gz +0 -0
  728. package/dist/esm/snk-filter-modal-item.entry.js +3 -3
  729. package/dist/esm/snk-filter-modal-item.entry.js.gz +0 -0
  730. package/dist/esm/snk-filter-multi-select.entry.js.gz +0 -0
  731. package/dist/esm/snk-filter-number.entry.js.gz +0 -0
  732. package/dist/esm/snk-filter-period.entry.js.gz +0 -0
  733. package/dist/esm/snk-filter-search.entry.js.gz +0 -0
  734. package/dist/esm/snk-filter-text.entry.js.gz +0 -0
  735. package/dist/esm/snk-form-summary.entry.js.gz +0 -0
  736. package/dist/esm/snk-form-view.entry.js.gz +0 -0
  737. package/dist/esm/snk-form_2.entry.js +28 -7
  738. package/dist/esm/snk-form_2.entry.js.gz +0 -0
  739. package/dist/esm/snk-grid.entry.js +6 -6
  740. package/dist/esm/snk-grid.entry.js.gz +0 -0
  741. package/dist/esm/{snk-guides-viewer-19cb7f1f.js → snk-guides-viewer-8d6067b5.js} +5 -5
  742. package/dist/esm/snk-guides-viewer-8d6067b5.js.gz +0 -0
  743. package/dist/esm/snk-guides-viewer.entry.js +7 -7
  744. package/dist/esm/snk-guides-viewer.entry.js.gz +0 -0
  745. package/dist/esm/snk-personalized-filter-editor.entry.js.gz +0 -0
  746. package/dist/esm/snk-personalized-filter.entry.js +3 -3
  747. package/dist/esm/snk-personalized-filter.entry.js.gz +0 -0
  748. package/dist/esm/snk-pesquisa.entry.js +4 -4
  749. package/dist/esm/snk-pesquisa.entry.js.gz +0 -0
  750. package/dist/esm/snk-print-selector.entry.js.gz +0 -0
  751. package/dist/esm/snk-simple-bar.entry.js.gz +0 -0
  752. package/dist/esm/snk-simple-crud.entry.js +7 -7
  753. package/dist/esm/snk-simple-crud.entry.js.gz +0 -0
  754. package/dist/esm/snk-taskbar.entry.js +57 -45
  755. package/dist/esm/snk-taskbar.entry.js.gz +0 -0
  756. package/dist/esm/sortable.esm-842f85a3.js.gz +0 -0
  757. package/dist/esm/taskbar-elements-faaf5d8f.js.gz +0 -0
  758. package/dist/esm/taskbar-processor-3436124c.js.gz +0 -0
  759. package/dist/esm/teste-pesquisa.entry.js.gz +0 -0
  760. package/dist/index.cjs.js.gz +0 -0
  761. package/dist/index.js.gz +0 -0
  762. package/dist/sankhyablocks/index.esm.js.gz +0 -0
  763. package/dist/sankhyablocks/{p-11346b8d.entry.js → p-07c5289b.entry.js} +1 -1
  764. package/dist/sankhyablocks/p-07c5289b.entry.js.gz +0 -0
  765. package/dist/sankhyablocks/p-093f58fa.entry.js.gz +0 -0
  766. package/dist/sankhyablocks/{p-4c935ff5.entry.js → p-09b05075.entry.js} +1 -1
  767. package/dist/sankhyablocks/p-09b05075.entry.js.gz +0 -0
  768. package/dist/sankhyablocks/p-0f3698af.js.gz +0 -0
  769. package/dist/sankhyablocks/p-13596651.js +1 -0
  770. package/dist/sankhyablocks/p-13596651.js.gz +0 -0
  771. package/dist/sankhyablocks/p-162bddae.entry.js.gz +0 -0
  772. package/dist/sankhyablocks/p-180716b2.entry.js.gz +0 -0
  773. package/dist/sankhyablocks/p-1a0caadb.js.gz +0 -0
  774. package/dist/sankhyablocks/p-1a68fb59.js.gz +0 -0
  775. package/dist/sankhyablocks/{p-f8f29e1a.entry.js → p-1e9c546e.entry.js} +1 -1
  776. package/dist/sankhyablocks/p-1e9c546e.entry.js.gz +0 -0
  777. package/dist/sankhyablocks/p-21107f0d.entry.js.gz +0 -0
  778. package/dist/sankhyablocks/p-27482793.entry.js.gz +0 -0
  779. package/dist/sankhyablocks/p-279f1ef9.entry.js +1 -0
  780. package/dist/sankhyablocks/p-279f1ef9.entry.js.gz +0 -0
  781. package/dist/sankhyablocks/p-2ec52b7e.entry.js +1 -0
  782. package/dist/sankhyablocks/p-2ec52b7e.entry.js.gz +0 -0
  783. package/dist/sankhyablocks/p-2fdac5e6.entry.js.gz +0 -0
  784. package/dist/sankhyablocks/{p-8d256def.js → p-31b0d523.js} +1 -1
  785. package/dist/sankhyablocks/p-31b0d523.js.gz +0 -0
  786. package/dist/sankhyablocks/p-3b167a03.entry.js +1 -0
  787. package/dist/sankhyablocks/p-3b167a03.entry.js.gz +0 -0
  788. package/dist/sankhyablocks/p-3d41f5a8.entry.js.gz +0 -0
  789. package/dist/sankhyablocks/p-3ed04f0d.entry.js.gz +0 -0
  790. package/dist/sankhyablocks/{p-6a56582c.entry.js → p-3f8c436b.entry.js} +1 -1
  791. package/dist/sankhyablocks/p-3f8c436b.entry.js.gz +0 -0
  792. package/dist/sankhyablocks/{p-d75a732c.js → p-42dde1ec.js} +1 -1
  793. package/dist/sankhyablocks/p-42dde1ec.js.gz +0 -0
  794. package/dist/sankhyablocks/p-471b34f4.entry.js.gz +0 -0
  795. package/dist/sankhyablocks/p-49ddc27a.entry.js.gz +0 -0
  796. package/dist/sankhyablocks/{p-b7f5caf6.js → p-4b2523df.js} +1 -1
  797. package/dist/sankhyablocks/p-4b2523df.js.gz +0 -0
  798. package/dist/sankhyablocks/p-4b286a64.entry.js +1 -0
  799. package/dist/sankhyablocks/p-4b286a64.entry.js.gz +0 -0
  800. package/dist/sankhyablocks/p-4c763b10.entry.js.gz +0 -0
  801. package/dist/sankhyablocks/{p-bf017a1f.js → p-4db51d85.js} +1 -1
  802. package/dist/sankhyablocks/p-4db51d85.js.gz +0 -0
  803. package/dist/sankhyablocks/{p-b2d7f4cd.entry.js → p-4e3fc788.entry.js} +1 -1
  804. package/dist/sankhyablocks/p-4e3fc788.entry.js.gz +0 -0
  805. package/dist/sankhyablocks/{p-95c471d8.entry.js → p-5095f811.entry.js} +1 -1
  806. package/dist/sankhyablocks/p-5095f811.entry.js.gz +0 -0
  807. package/dist/sankhyablocks/p-51833248.js.gz +0 -0
  808. package/dist/sankhyablocks/{p-7b3ca294.entry.js → p-5340c04e.entry.js} +1 -1
  809. package/dist/sankhyablocks/p-5340c04e.entry.js.gz +0 -0
  810. package/dist/sankhyablocks/p-55798617.js.gz +0 -0
  811. package/dist/sankhyablocks/p-60dd1d27.entry.js.gz +0 -0
  812. package/dist/sankhyablocks/{p-701b024c.entry.js → p-6471a791.entry.js} +1 -1
  813. package/dist/sankhyablocks/p-6471a791.entry.js.gz +0 -0
  814. package/dist/sankhyablocks/p-667cab42.entry.js.gz +0 -0
  815. package/dist/sankhyablocks/p-688dcb4c.js.gz +0 -0
  816. package/dist/sankhyablocks/{p-df7979fd.entry.js → p-6902c5ee.entry.js} +1 -1
  817. package/dist/sankhyablocks/p-6902c5ee.entry.js.gz +0 -0
  818. package/dist/sankhyablocks/{p-c71dcb2d.js → p-69885aaa.js} +1 -1
  819. package/dist/sankhyablocks/p-69885aaa.js.gz +0 -0
  820. package/dist/sankhyablocks/p-6a4b21dd.js.gz +0 -0
  821. package/dist/sankhyablocks/p-7345782c.entry.js.gz +0 -0
  822. package/dist/sankhyablocks/p-75af335e.entry.js.gz +0 -0
  823. package/dist/sankhyablocks/p-76e66fd9.js.gz +0 -0
  824. package/dist/sankhyablocks/{p-0e1f0344.entry.js → p-7b3269e9.entry.js} +1 -1
  825. package/dist/sankhyablocks/p-7b3269e9.entry.js.gz +0 -0
  826. package/dist/sankhyablocks/p-7dd49d15.js.gz +0 -0
  827. package/dist/sankhyablocks/p-7e250432.entry.js.gz +0 -0
  828. package/dist/sankhyablocks/p-7f7fe6c4.entry.js.gz +0 -0
  829. package/dist/sankhyablocks/{p-aed983f8.entry.js → p-81466555.entry.js} +1 -1
  830. package/dist/sankhyablocks/p-81466555.entry.js.gz +0 -0
  831. package/dist/sankhyablocks/p-825098c1.entry.js.gz +0 -0
  832. package/dist/sankhyablocks/p-84345e7a.js.gz +0 -0
  833. package/dist/sankhyablocks/{p-c95f20d9.entry.js → p-88c12985.entry.js} +1 -1
  834. package/dist/sankhyablocks/p-88c12985.entry.js.gz +0 -0
  835. package/dist/sankhyablocks/{p-ada32f94.entry.js → p-8b24836e.entry.js} +1 -1
  836. package/dist/sankhyablocks/p-8b24836e.entry.js.gz +0 -0
  837. package/dist/sankhyablocks/p-8d884fab.js.gz +0 -0
  838. package/dist/sankhyablocks/p-8f3f2306.js.gz +0 -0
  839. package/dist/sankhyablocks/p-9019a32f.js.gz +0 -0
  840. package/dist/sankhyablocks/p-91a9abb6.entry.js.gz +0 -0
  841. package/dist/sankhyablocks/{p-16c1c209.entry.js → p-94b15408.entry.js} +1 -1
  842. package/dist/sankhyablocks/p-94b15408.entry.js.gz +0 -0
  843. package/dist/sankhyablocks/{p-0a317e81.js → p-95888078.js} +1 -1
  844. package/dist/sankhyablocks/p-95888078.js.gz +0 -0
  845. package/dist/sankhyablocks/p-96d45943.entry.js.gz +0 -0
  846. package/dist/sankhyablocks/p-988afe78.js.gz +0 -0
  847. package/dist/sankhyablocks/p-9a63f3f7.entry.js.gz +0 -0
  848. package/dist/sankhyablocks/{p-9062d640.js → p-9fa79997.js} +1 -1
  849. package/dist/sankhyablocks/p-9fa79997.js.gz +0 -0
  850. package/dist/sankhyablocks/p-b568c1d4.js.gz +0 -0
  851. package/dist/sankhyablocks/p-b7e891cc.entry.js.gz +0 -0
  852. package/dist/sankhyablocks/p-b987e15d.js.gz +0 -0
  853. package/dist/sankhyablocks/{p-505172c8.entry.js → p-bcf5692d.entry.js} +1 -1
  854. package/dist/sankhyablocks/p-bcf5692d.entry.js.gz +0 -0
  855. package/dist/sankhyablocks/p-c3dbf441.entry.js.gz +0 -0
  856. package/dist/sankhyablocks/p-cb4343c4.entry.js.gz +0 -0
  857. package/dist/sankhyablocks/{p-88b7bc09.js → p-ce77774e.js} +1 -1
  858. package/dist/sankhyablocks/p-ce77774e.js.gz +0 -0
  859. package/dist/sankhyablocks/p-d68904a9.js +1 -0
  860. package/dist/sankhyablocks/p-d68904a9.js.gz +0 -0
  861. package/dist/sankhyablocks/p-d8d8169b.js.gz +0 -0
  862. package/dist/sankhyablocks/{p-d725b0c7.entry.js → p-dafee02c.entry.js} +1 -1
  863. package/dist/sankhyablocks/p-dafee02c.entry.js.gz +0 -0
  864. package/dist/sankhyablocks/p-dc36cfbf.js.gz +0 -0
  865. package/dist/sankhyablocks/p-e258de96.entry.js.gz +0 -0
  866. package/dist/sankhyablocks/p-eaad0aa8.js.gz +0 -0
  867. package/dist/sankhyablocks/p-f4184ce7.js.gz +0 -0
  868. package/dist/sankhyablocks/p-f68aab71.js +1 -0
  869. package/dist/sankhyablocks/p-f68aab71.js.gz +0 -0
  870. package/dist/sankhyablocks/p-fa80e546.js.gz +0 -0
  871. package/dist/sankhyablocks/{p-519f74be.entry.js → p-febb03ba.entry.js} +1 -1
  872. package/dist/sankhyablocks/p-febb03ba.entry.js.gz +0 -0
  873. package/dist/sankhyablocks/p-ff1990ad.js.gz +0 -0
  874. package/dist/sankhyablocks/p-ff52b422.entry.js.gz +0 -0
  875. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  876. package/dist/sankhyablocks/sankhyablocks.esm.js.gz +0 -0
  877. package/dist/types/components/snk-form-config/FormConfigHelper.d.ts +4 -1
  878. package/dist/types/components/snk-form-config/SnkFormConfigManager.d.ts +1 -1
  879. package/dist/types/components/snk-form-config/fields-layout/fields-layout.d.ts +2 -2
  880. package/dist/types/components/snk-form-config/guides-configurator/guides-configurator.d.ts +1 -1
  881. package/dist/types/components/snk-form-config/snk-form-config.d.ts +4 -2
  882. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +6 -3
  883. package/package.json +1 -1
  884. package/dist/cjs/ConfigStorage-8b6def32.js.gz +0 -0
  885. package/dist/cjs/FormConfigHelper-ebb77625.js.gz +0 -0
  886. package/dist/cjs/ISave-b22b3cf0.js.gz +0 -0
  887. package/dist/cjs/SnkFormConfigManager-477a27de.js.gz +0 -0
  888. package/dist/cjs/SnkMultiSelectionListDataSource-b7ab26ba.js.gz +0 -0
  889. package/dist/cjs/auth-fetcher-78a90b36.js.gz +0 -0
  890. package/dist/cjs/dataunit-fetcher-877944a9.js.gz +0 -0
  891. package/dist/cjs/form-config-fetcher-dee08eb4.js.gz +0 -0
  892. package/dist/cjs/snk-data-unit-0cfa7622.js.gz +0 -0
  893. package/dist/cjs/snk-guides-viewer-38277265.js.gz +0 -0
  894. package/dist/esm/ConfigStorage-22eace3a.js.gz +0 -0
  895. package/dist/esm/FormConfigHelper-4e42f0b6.js.gz +0 -0
  896. package/dist/esm/ISave-6b7b0423.js.gz +0 -0
  897. package/dist/esm/SnkFormConfigManager-968b97e7.js.gz +0 -0
  898. package/dist/esm/SnkMultiSelectionListDataSource-1136c4e7.js.gz +0 -0
  899. package/dist/esm/auth-fetcher-cf39e42b.js.gz +0 -0
  900. package/dist/esm/dataunit-fetcher-6314b19d.js.gz +0 -0
  901. package/dist/esm/form-config-fetcher-bc6f0f1f.js.gz +0 -0
  902. package/dist/esm/snk-data-unit-4acf4781.js.gz +0 -0
  903. package/dist/esm/snk-guides-viewer-19cb7f1f.js.gz +0 -0
  904. package/dist/sankhyablocks/p-0a317e81.js.gz +0 -0
  905. package/dist/sankhyablocks/p-0e1f0344.entry.js.gz +0 -0
  906. package/dist/sankhyablocks/p-11346b8d.entry.js.gz +0 -0
  907. package/dist/sankhyablocks/p-16c1c209.entry.js.gz +0 -0
  908. package/dist/sankhyablocks/p-4c935ff5.entry.js.gz +0 -0
  909. package/dist/sankhyablocks/p-505172c8.entry.js.gz +0 -0
  910. package/dist/sankhyablocks/p-519f74be.entry.js.gz +0 -0
  911. package/dist/sankhyablocks/p-658f67a5.js +0 -1
  912. package/dist/sankhyablocks/p-658f67a5.js.gz +0 -0
  913. package/dist/sankhyablocks/p-6a56582c.entry.js.gz +0 -0
  914. package/dist/sankhyablocks/p-701b024c.entry.js.gz +0 -0
  915. package/dist/sankhyablocks/p-72a9285d.entry.js +0 -1
  916. package/dist/sankhyablocks/p-72a9285d.entry.js.gz +0 -0
  917. package/dist/sankhyablocks/p-7b3ca294.entry.js.gz +0 -0
  918. package/dist/sankhyablocks/p-88b7bc09.js.gz +0 -0
  919. package/dist/sankhyablocks/p-8d256def.js.gz +0 -0
  920. package/dist/sankhyablocks/p-8f73da95.js +0 -1
  921. package/dist/sankhyablocks/p-8f73da95.js.gz +0 -0
  922. package/dist/sankhyablocks/p-9062d640.js.gz +0 -0
  923. package/dist/sankhyablocks/p-95c471d8.entry.js.gz +0 -0
  924. package/dist/sankhyablocks/p-95c71f5e.entry.js +0 -1
  925. package/dist/sankhyablocks/p-95c71f5e.entry.js.gz +0 -0
  926. package/dist/sankhyablocks/p-a5108625.entry.js +0 -1
  927. package/dist/sankhyablocks/p-a5108625.entry.js.gz +0 -0
  928. package/dist/sankhyablocks/p-ada32f94.entry.js.gz +0 -0
  929. package/dist/sankhyablocks/p-aed983f8.entry.js.gz +0 -0
  930. package/dist/sankhyablocks/p-b2d7f4cd.entry.js.gz +0 -0
  931. package/dist/sankhyablocks/p-b7f5caf6.js.gz +0 -0
  932. package/dist/sankhyablocks/p-bf017a1f.js.gz +0 -0
  933. package/dist/sankhyablocks/p-c71dcb2d.js.gz +0 -0
  934. package/dist/sankhyablocks/p-c95f20d9.entry.js.gz +0 -0
  935. package/dist/sankhyablocks/p-c98e2085.js +0 -1
  936. package/dist/sankhyablocks/p-c98e2085.js.gz +0 -0
  937. package/dist/sankhyablocks/p-d03ae54e.entry.js +0 -1
  938. package/dist/sankhyablocks/p-d03ae54e.entry.js.gz +0 -0
  939. package/dist/sankhyablocks/p-d725b0c7.entry.js.gz +0 -0
  940. package/dist/sankhyablocks/p-d75a732c.js.gz +0 -0
  941. package/dist/sankhyablocks/p-df7979fd.entry.js.gz +0 -0
  942. package/dist/sankhyablocks/p-f8f29e1a.entry.js.gz +0 -0
@@ -1 +1 @@
1
- import{r as i,c as t,h as e,F as s,g as r}from"./p-d8d8169b.js";import{ObjectUtils as n,StringUtils as a,Action as d,KeyboardManager as o,ElementIDUtils as h}from"@sankhyalabs/core";import{S as l}from"./p-658f67a5.js";import{buildFormMetadata as u,FormMetadata as v}from"@sankhyalabs/ezui/dist/collection/utils/form";import{T as c}from"./p-1a0caadb.js";import{T as g}from"./p-b987e15d.js";import{V as m}from"./p-9019a32f.js";import"./p-d75a732c.js";import"./p-bf017a1f.js";import{P as k}from"./p-0f3698af.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-9062d640.js";import"./p-ff1990ad.js";import"./p-8d256def.js";import{SelectionMode as p}from"@sankhyalabs/core/dist/dataunit/DataUnit";import{buildFieldSearch as f,SHORTCUT_SEARCH_FIELD as w}from"@sankhyalabs/ezui/dist/collection/utils";const b="__FORM:",_=class{constructor(e){i(this,e),this.snkMasterFormConfigChange=t(this,"snkMasterFormConfigChange",7),this.exit=t(this,"exit",7),this.actionClick=t(this,"actionClick",7),this.formItemsReady=t(this,"formItemsReady",7),this._guideBuilders=new Map,this.dataUnit=void 0,this.dataState=void 0,this.configName=void 0,this.entityPath=void 0,this.actionsList=void 0,this.recordsValidator=void 0,this.masterFormConfig=void 0,this.selectedGuide=void 0,this.taskbarManager=void 0,this.messagesBuilder=void 0,this.canEdit=!0,this.presentationMode=void 0,this.resourceID=void 0,this.detailTaskbarCustomContainerId=void 0,this.formLegacyConfigName=void 0,this.enableGridInsert=!1,this.ignoreReadOnlyFormFields=void 0,this.getCustomTitle=void 0,this._hasToCreateFieldSearch=!0,this._breadcrumbItems=[],this._guides=void 0,this._formEditorConfigManager=void 0,this._formEditorDataUnit=void 0,this._fieldToGetFocus=void 0,this._customEditors=void 0,this._customRenders=void 0,this._fieldsProps={},this._mainForm=void 0}observeDataUnit(){this.loadGuides(!0)}observeDataState(i,t){var e,s,r,a,d,o;const h=null!==(s=null===(e=null==i?void 0:i.selectionInfo)||void 0===e?void 0:e.recordIds)&&void 0!==s?s:null===(r=null==i?void 0:i.selectedRecord)||void 0===r?void 0:r.__record__id__,l=null!==(d=null===(a=null==t?void 0:t.selectionInfo)||void 0===a?void 0:a.recordIds)&&void 0!==d?d:null===(o=null==t?void 0:t.selectedRecord)||void 0===o?void 0:o.__record__id__;n.equals(h,l)||this.loadGuides((null==t?void 0:t.insertionMode)!=(null==i?void 0:i.insertionMode))}observeMasterFormConfig(){this.loadGuides(this.noGuideSelected()),this.snkMasterFormConfigChange.emit(this.masterFormConfig)}async showFormConfig(i=!1){const t=!i||null==this._currentDetail;this._formEditorConfigManager=t?this._configManager:this._currentDetail.formConfigManager,this._formEditorDataUnit=t?this.dataUnit:this._currentDetail.dataUnit}async addCustomEditor(i,t){this._customEditors=Object.assign(Object.assign({},this._customEditors),{[i]:t})}async addGridCustomRender(i,t){this._customRenders=Object.assign(Object.assign({},this._customRenders),{[i]:t})}async setFieldProp(i,t,e){const s={[i]:Object.assign(Object.assign({},this._fieldsProps[i]),{[t]:e})};this._fieldsProps=Object.assign(Object.assign({},this._fieldsProps),s)}async setFocus(){this._container.focus()}exitViewer(){!this.enableGridInsert&&this.dataUnit.isDirty()?this.dataUnit.cancelEdition({after:()=>this.exit.emit()}):this.exit.emit()}onActionClick(i){i.detail===g.CONFIGURATOR&&"master"!=i.target.dataset.taskbarOwner&&(this._snkConfigurator.open(),i.stopImmediatePropagation(),i.stopPropagation())}onContentCardChanged(i){_.updateContentCard(i.detail.formName,i.detail.cardConfig,i.detail.propertyChanged,this._configManager).then((()=>this.masterFormConfig=this._configManager.getConfig(this.dataUnit)))}getMessage(i){var t,e;if(this.dataUnit.isMultipleEdition){const i=null!==(e=null===(t=this.dataUnit.getSelectionInfo())||void 0===t?void 0:t.records)&&void 0!==e?e:[];return this.messagesBuilder.getMessage("snkCrud.multipleEdition.editing",{COUNT:i.length})}return this.messagesBuilder.getMessage(i,this.dataUnit.getSelectedRecord())}loadGuides(i){if(!this.dataUnit)return;if(!this._configManager.isLoaded)return;this._masterFormMetadata=u(this.masterFormConfig,this.dataUnit,!0);const t=this._masterFormMetadata.getAllSheets(),e=this.dataUnit.getSelectedRecord(),s=this.hasToDisableDetails(e),r=[];Array.from(t.values()).forEach((i=>{const t={id:i.name,label:i.label};this.isDetail(i.name)&&s&&(t.tooltip=this.getMessage("snkCrud.detail.tooltip.needSingleSelection"),t.disabled=!0),r.push(t)})),this._guides=r,this._guideNavigator&&this._guideNavigator.updateItem(this._guides),i&&(this.selectedGuide=this._guides.length>0?this._guides[0]:void 0)}hasToDisableDetails(i){return!i||this.dataUnit.isNewRecord(i.__record__id__)||this.dataUnit.isMultipleEdition}isDetail(i){return null!=v.getDetailName(i)}updateGuide(i){this._guideBuilders.set(i.id,i);const t=i.buildGuideItem(this._guideBuilders);this._guideNavigator&&(this._guideNavigator.updateItem(t).then((()=>{this._guideNavigator.getCurrentPath().then((i=>{this._breadcrumbItems=i}))})),this._guides=this._guides.map((i=>i.id===t.id?Object.assign(Object.assign(Object.assign({},i),t),void 0!==t.children?{}:{children:void 0}):i)))}getTaskBarId(){var i;return(null===(i=this.dataState)||void 0===i?void 0:i.isDirty)?C.FINISH_EDITION:this.dataUnit.isMultipleEdition?C.MUTIPLE_EDITION:C.REGULAR}loadTaskbarProcessor(){const i={};i[C.REGULAR]=this.buildBtnsRegularMode(),i[C.FINISH_EDITION]=[g.CANCEL,g.SAVE,this.handleAddGridMode()],i[C.MUTIPLE_EDITION]=[g.CANCEL],this._taskbarProcessor=new c(i),this._taskbarProcessor.process(this.getTaskBarId(),this.taskbarManager,this.dataState,this.buildDisabledButtons(),this.buildInvisibleButtons())}buildBtnsRegularMode(){var i,t;const e=[g.ATTACH,g.CLONE,g.REMOVE,g.MORE_OPTIONS,g.ACTIONS_BUTTON,g.DIVIDER,g.GRID_MODE,g.CONFIGURATOR];return(null===(t=null===(i=this.dataState)||void 0===i?void 0:i.selectionInfo)||void 0===t?void 0:t.length)<=1&&e.unshift(g.PREVIOUS,g.NEXT,g.DIVIDER),this.presentationMode==k.SECONDARY?e.unshift(g.INSERT):e.push(g.INSERT),e}buildDisabledButtons(){var i,t,e,s,r,n;const a=[];return(null===(i=this.dataState)||void 0===i?void 0:i.hasPrevious)||a.push(g.PREVIOUS),(null===(t=this.dataState)||void 0===t?void 0:t.hasNext)||a.push(g.NEXT),(null===(s=null===(e=this.dataState)||void 0===e?void 0:e.selectionInfo)||void 0===s?void 0:s.length)>1&&a.push(g.CLONE),(null===(n=null===(r=this.dataState)||void 0===r?void 0:r.selectionInfo)||void 0===n?void 0:n.isAllRecords())&&a.push(g.REMOVE),a}handleAddGridMode(){return this.enableGridInsert?g.GRID_MODE:""}buildInvisibleButtons(){const i=[];return this.dataState&&this.dataState.selectionInfo.mode===p.ALL_RECORDS&&i.push(g.ACTIONS_BUTTON),i}static updateContentCard(i,t,e,s){return s.saveCardState(i,t,e)}static buildFixedForms(i){var t;const r=null===(t=i.formConfig)||void 0===t?void 0:t.cardsState;if(null!=r)return e(s,null,Array.from(r.entries()).filter((([t,e])=>(null==e?void 0:e.fixed)&&t!=i.selectedForm)).sort((([,i],[,t])=>((null==i?void 0:i.fixSequence)||0)-((null==t?void 0:t.fixSequence)||0))).map((([t,s])=>{var r,n;const a=i.formMetadata.getSheet(t);if(null!=a)return e("snk-form-view",{levelPath:i.levelPath,label:a.label,name:t,fields:a.fields,formMetadata:i.formMetadata,dataUnit:i.dataUnit,recordsValidator:i.recordsValidator,contracted:"CONTRACTED"===(null==s?void 0:s.presentation),fixed:null==s?void 0:s.fixed,summaryFields:null===(n=null===(r=i.formConfig)||void 0===r?void 0:r.summary)||void 0===n?void 0:n.get(t),fieldToFocus:i.fieldToFocus,key:t,onSnkRequestClearFieldToFocus:()=>{var t;return null===(t=i.onRequestClearFieldToFocus)||void 0===t?void 0:t.call(i)},customEditors:i.propsCustomEditor,fieldsProps:i.fieldsProps})})))}wrapDetail(i,t){if(0===i.length)return t;const s=i.pop(),r=v.getDetailName(s);return r?this.wrapDetail(i,e("snk-data-unit",{dataUnitName:`${this.getDataUnitName(i,r)}`,entityName:r},t)):void 0}getDataUnitName(i,t){if(i.length>0){const e=i.map((i=>v.getDetailName(i)));return`${this.entityPath}/${e.join("/")}/${t}`}return`${this.entityPath}/${t}`}getContent(){var i,t,s,r,n;if(!this.selectedGuide)return;const a=this.selectedGuide.id;let d;const o=a.split("::"),h=o.pop(),l=v.getDetailName(h);let u=a;if(l||o.length>0){let t,s;if(a.includes(b)){[u,t]=a.split(b);const e=(null===(i=this._breadcrumbItems)||void 0===i?void 0:i.length)||0;s=e>1?this._breadcrumbItems[e-2]:this.selectedGuide}else s=this.selectedGuide;d=this.wrapDetail(o,e("snk-detail-view",{ref:i=>this._currentDetail=i,dataUnitName:this.getDataUnitName(o,l),onSnkDetailGuidesChange:i=>this.updateGuide(i.detail),entityName:l,selectedForm:t,branchGuide:s,guideItemPath:this._breadcrumbItems,key:`detail${u}`,canEdit:this.canEdit,onSnkSwitchGuide:i=>this._guideNavigator.selectGuide(i.detail),resourceID:this.resourceID,taskbarCustomContainerId:this.detailTaskbarCustomContainerId,customEditors:this._customEditors,customRenders:this._customRenders,presentationMode:this.presentationMode}))}else{const i=this.selectedGuide.id,o=this._masterFormMetadata.getSheet(i);if(o){const h=null===(s=null===(t=this.masterFormConfig)||void 0===t?void 0:t.cardsState)||void 0===s?void 0:s.get(i);d=e("snk-form-view",{ref:i=>this._mainForm=i,fixed:null==h?void 0:h.fixed,summaryFields:null===(n=null===(r=this.masterFormConfig)||void 0===r?void 0:r.summary)||void 0===n?void 0:n.get(i),name:i,label:o.label,fields:o.fields,dataUnit:this.dataUnit,formMetadata:this._masterFormMetadata,recordsValidator:this.recordsValidator,fieldToFocus:this._fieldToGetFocus,key:a,onSnkRequestClearFieldToFocus:()=>this.clearFieldToFocusHandler(),customEditors:this._customEditors,fieldsProps:this._fieldsProps,fieldSearch:this._fieldSearch},this.presentationMode==k.SECONDARY&&this.buildTaskBar())}}return d}onBreadcrumbClickHandler(i){null!=(null==i?void 0:i.id)&&this._guideNavigator.selectGuide(i.id)}updateSelectedGuideHandler(i){this._guideHasChanged=this.selectedGuide!=i,this.selectedGuide=i,this._guideNavigator.getCurrentPath().then((i=>{this._breadcrumbItems=i})),this.resetGuideBadge(i)}changeGuideHandler(i){var t;null===(t=this._guideNavigator)||void 0===t||t.selectGuide(i)}clearFieldToFocusHandler(){this._fieldToGetFocus=void 0}resetGuideBadge(i){var t;this._guides=[...null===(t=this._guides)||void 0===t?void 0:t.map((t=>this.canClearGuideBadge(t,i.id)?Object.assign(Object.assign({},t),{badge:null}):t))]}canClearGuideBadge(i,t){return i.id===t||this.isIncludedInChildrenList(i,t)}isIncludedInChildrenList(i,t){return this.hasChildren(i)&&this.getChildrenIdList(i).includes(t)}hasChildren(i){return i.children&&Array.isArray(i.children)}getChildrenIdList(i){return i.children.map((i=>i.id))}getConfigViewMode(){return m.GRID}changeConfigViewMode(i){this._currentDetail&&this._currentDetail.changeViewMode(i)}openConfig(i){this._snkConfigurator.close(),this._currentDetail&&(i===m.FORM?this.showFormConfig(!0):this._currentDetail.configGrid())}noGuideSelected(){var i;return void 0===this.selectedGuide||"__main"===(null===(i=this.selectedGuide)||void 0===i?void 0:i.id)}addFormLegacyConfigName(){this.formLegacyConfigName&&this._configManager.addFormLegacyConfig(this.formLegacyConfigName)}setMasterFormConfig(i){this.masterFormConfig=i}componentWillLoad(){if(null==this.resourceID)throw new Error(this.getMessage("snkCrud.errors.resourceIDNotProvided"));this._configManager=new l(this.configName,this.resourceID,this.setMasterFormConfig.bind(this),this.dataUnit),this.addFormLegacyConfigName(),this._configManager.loadConfig()}componentDidRender(){this._guideHasChanged&&(this._currentDetail?this._currentDetail.showUp():this._mainForm&&this._mainForm.showUp(),this._guideHasChanged=!1)}getFieldsSearch(i){return(null==this._fieldSearch||this._hasToCreateFieldSearch)&&(this._hasToCreateFieldSearch=!1,this._fieldSearch=f(i,(({argument:i})=>this.fieldsOptionLoader(i)),(i=>this.onSelectField(i)))),this._fieldSearch}fieldsOptionLoader(i){return Promise.resolve(this._configManager.getFieldsList(i).map((i=>({value:i.name,label:i.label}))))}onSelectField(i){if(null==i)return;this._fieldToGetFocus=i.value;const t=this.getGuideName(i.value);t!==this.selectedGuide.id&&this.changeGuideHandler(t)}getActionsList(){var i;return[].concat(null!=this.taskbarManager&&null!=this.taskbarManager.getMoreOptions?null!==(i=this.taskbarManager.getMoreOptions(this.getTaskBarId(),this.configName,this.dataState,this.actionsList))&&void 0!==i?i:[]:this.actionsList)}getSettingsListForm(){return[{value:a.generateUUID(),label:this.getMessage("snkCrud.findColumn"),disableCloseOnSelect:!0,eagerInitialize:!0,itemBuilder:(i,t)=>this.getFieldsSearch(t)}]}buildTaskBar(){var i;return e("div",{class:"snk-guides-viewer__header-taskbar "+(this.presentationMode!=k.SECONDARY?"ez-align--right":"ez-padding-bottom--medium")},e("snk-taskbar",{key:"guideViewerTaskbar","data-element-id":"guideViewer",configName:this.configName,buttons:this._taskbarProcessor.buttons,disabledButtons:this._taskbarProcessor.disabledButtons,customButtons:this._taskbarProcessor.customButtons,actionsList:this.getActionsList(),actionsSettingsList:this.getSettingsListForm(),messagesBuilder:this.messagesBuilder,presentationMode:this.presentationMode,primaryButton:(null===(i=this.dataState)||void 0===i?void 0:i.isDirty)?g.SAVE:g.INSERT,"data-taskbar-owner":"master",dataUnit:this.dataUnit,resourceID:this.resourceID,customSlotId:"GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS",alignRigth:!0},e("slot",{name:"GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS"})))}async dataUnitActionHandler(i){var t;switch(i.type){case d.EDITION_CANCELED:case d.DATA_SAVED:this.dataUnit.isMultipleEdition&&(this.exitViewer(),this.dataUnit.isMultipleEdition=!1);break;case d.FIELD_INVALIDATED:const e=this.getGuideName(null===(t=i.payload)||void 0===t?void 0:t.fieldName);await this.addErrorBadgeToGuide(e),await this.openGuideNavigator(e);break;case d.METADATA_LOADED:case d.MULTIPLE_EDITION_CHANGED:this.loadGuides(this.noGuideSelected())}}async addErrorBadgeToGuide(i){var t;this._guides=[...null===(t=this._guides)||void 0===t?void 0:t.map((t=>Object.assign(Object.assign({},t),{badge:this.getBadge(t,i)})))]}async openGuideNavigator(i){this.selectedGuide.id!==i&&await this._guideNavigator.openGuideNavidator()}getBadge(i,t){var e;return this.selectedGuide.id===t?null:t===i.id?"error":null!==(e=i.badge)&&void 0!==e?e:null}getGuideName(i){var t;for(const e of this._masterFormMetadata.getAllSheets()){const s=null===(t=e[1])||void 0===t?void 0:t.fields;for(const t of s)if(t.name===i)return e[0]}return""}getTitle(){var i,t;return null!==(t=null===(i=this.getCustomTitle)||void 0===i?void 0:i.call(this))&&void 0!==t?t:this.getMessage("snkCrud.title")}getTitleTooltip(){if(this.dataUnit.isMultipleEdition)return this.buildRecordIdsArray()}buildRecordIdsArray(){var i,t;const e=null!==(t=null===(i=this.dataUnit.getSelectionInfo())||void 0===i?void 0:i.records)&&void 0!==t?t:[];return 0===e.length?"[]":`[${e.map((i=>this.messagesBuilder.getMessage("snkCrud.title",i))).join(", ")}]`}componentDidLoad(){this.dataUnit.subscribe(this.dataUnitActionHandler.bind(this)),this.initKeyboardManager()}disconnectedCallback(){var i;null===(i=this._keyboardManager)||void 0===i||i.unbindAllShortcutKeys()}async initKeyboardManager(){this._keyboardManager=new o({propagate:!1,element:this._element}),this._keyboardManager.bind(w,(async()=>{this._mainForm&&await this._mainForm.showSearchField()}),{description:this.getMessage("snkSimpleCrud.findFields"),element:this._element})}render(){var i,t;if(null!=this._formEditorConfigManager)return e("snk-form-config",{ref:i=>this._container=i,tabindex:-1,dataUnit:this._formEditorDataUnit,messagesBuilder:this.messagesBuilder,configManager:this._formEditorConfigManager,onConfigClose:()=>this._formEditorConfigManager=null});if(!this.dataUnit||!this._configManager.isLoaded)return;this.loadTaskbarProcessor();const s=this._guides&&this._guides.length>1;return e("section",{class:"snk-guides-viewer",ref:i=>this._container=i,tabindex:-1},e("div",{class:"ez-row snk-guides-viewer__header"},e("div",{class:"snk-guides-viewer__header-breadcrumb ez-flex--align-items-center ez-flex-item--align-center ez-padding-left--large",key:"header"},e("ez-button",{onClick:()=>this.exitViewer(),title:this.getMessage("snkCrud.goBackTitle"),mode:"icon",iconName:"arrow_back",class:"ez-padding-right--medium",size:"small"}),e("div",{class:"ez-flex ez-flex--column ez-flex-item--auto"},e("h1",{class:"ez-title ez-title--primary ez-title--xlarge",title:this.getTitleTooltip()},this.getTitle()),(null===(i=this._breadcrumbItems)||void 0===i?void 0:i.length)>1&&e("div",{class:"ez-margin-top--extra-small"},e("ez-breadcrumb",Object.assign({items:this._breadcrumbItems,onSelectedItem:i=>this.onBreadcrumbClickHandler(null==i?void 0:i.detail)},{[h.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:`${h.getInternalIDInfo("breadcrumb")}`}))))),this.presentationMode!=k.SECONDARY&&this.buildTaskBar()),e("div",{class:"snk-guides-viewer__container"},s?e("ez-guide-navigator",{ref:i=>this._guideNavigator=i,class:"snk-guides-viewer__guide-navigator",items:this._guides,selectedId:this.selectedGuide?this.selectedGuide.id:void 0,onEzSelectionChange:i=>this.updateSelectedGuideHandler(i.detail)}):e("div",null),e("div",{class:"snk-guides-viewer__detail-container"},_.buildFixedForms({formConfig:this.masterFormConfig,formMetadata:this._masterFormMetadata,selectedForm:null===(t=this.selectedGuide)||void 0===t?void 0:t.id,dataUnit:this.dataUnit,recordsValidator:this.recordsValidator,fieldToFocus:this._fieldToGetFocus,onRequestClearFieldToFocus:this.clearFieldToFocusHandler.bind(this),propsCustomEditor:this._customEditors,fieldsProps:this._fieldsProps}),this.getContent())),e("snk-configurator",{ref:i=>this._snkConfigurator=i,viewMode:this.getConfigViewMode(),onConfigSelected:i=>this.changeConfigViewMode(i.detail),messagesBuilder:this.messagesBuilder,onOpenConfig:i=>this.openConfig(i.detail),resourceID:this.resourceID}))}get _element(){return r(this)}static get watchers(){return{dataUnit:["observeDataUnit"],dataState:["observeDataState"],masterFormConfig:["observeMasterFormConfig"]}}};var C;!function(i){i.FINISH_EDITION="snkGuideViewer.finish_edition",i.MUTIPLE_EDITION="snkGuideViewer.multiple_edition",i.REGULAR="snkGuideViewer.regular"}(C||(C={})),_.style=".sc-snk-guides-viewer-h{--snk-guides-viewer--space-large:var(--space--large, 24px);--snk-guides-viewer--space-small:var(--space--2xs, 8px);--snk-guides-viewer__header--min-height:68px;--snk-guides-viewer__header--z-index:var(--more-visible, 2);--snk-guides-viewer__header--background-color:var(--background--body, #fafcff);--snk-guides-viewer__guide-navigator--width:340px;display:block}snk-form-view.sc-snk-guides-viewer{width:100%}.snk-guides-viewer.sc-snk-guides-viewer{position:relative;padding-left:0px;padding-top:0px;padding-right:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__detail-container.sc-snk-guides-viewer{display:flex;row-gap:24px;flex-direction:column}.snk-guides-viewer__header.sc-snk-guides-viewer{position:sticky;align-items:center;top:0;z-index:var(--snk-guides-viewer__header--z-index);background-color:var(--snk-guides-viewer__header--background-color);min-height:var(--snk-guides-viewer__header--min-height);width:calc(100% + (var(--snk-guides-viewer--space-large) * 2));padding-left:var(--snk-guides-viewer--space-large);padding-right:var(--snk-guides-viewer--space-large);padding-top:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-small);margin-left:calc(var(--snk-guides-viewer--space-large) * -1);margin-right:calc(var(--snk-guides-viewer--space-large) * -1);margin-bottom:var(--snk-guides-viewer--space-small)}.snk-guides-viewer__header-breadcrumb.sc-snk-guides-viewer{width:25%;display:flex}.snk-guides-viewer__header-taskbar.sc-snk-guides-viewer{width:75%}.snk-guides-viewer__container.sc-snk-guides-viewer{display:grid;grid-template-columns:minmax(0, auto) minmax(0, 100%);height:100%;column-gap:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__guide-navigator.sc-snk-guides-viewer{position:sticky;top:calc(var(--snk-guides-viewer__header--min-height) + var(--snk-guides-viewer--space-small));height:calc(100vh - var(--snk-guides-viewer__header--min-height) - var(--snk-guides-viewer--space-large) - var(--snk-guides-viewer--space-small))}.snk-guides-viewer__guide-navigator[open].sc-snk-guides-viewer{width:var(--snk-guides-viewer__guide-navigator--width);max-width:var(--snk-guides-viewer__guide-navigator--width);min-width:var(--snk-guides-viewer__guide-navigator--width)}.snk-guides-viewer__detail-content.sc-snk-guides-viewer{min-height:100%;align-items:flex-start;align-content:flex-start}";export{_ as S}
1
+ import{r as i,c as t,h as e,F as s,g as r}from"./p-d8d8169b.js";import{ObjectUtils as n,StringUtils as a,Action as d,KeyboardManager as o,ElementIDUtils as h}from"@sankhyalabs/core";import{S as l}from"./p-13596651.js";import{buildFormMetadata as u,FormMetadata as v}from"@sankhyalabs/ezui/dist/collection/utils/form";import{T as c}from"./p-1a0caadb.js";import{T as g}from"./p-b987e15d.js";import{V as m}from"./p-9019a32f.js";import"./p-42dde1ec.js";import"./p-4db51d85.js";import{P as k}from"./p-0f3698af.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-9fa79997.js";import"./p-ff1990ad.js";import"./p-31b0d523.js";import{SelectionMode as p}from"@sankhyalabs/core/dist/dataunit/DataUnit";import{buildFieldSearch as f,SHORTCUT_SEARCH_FIELD as w}from"@sankhyalabs/ezui/dist/collection/utils";const b="__FORM:",_=class{constructor(e){i(this,e),this.snkMasterFormConfigChange=t(this,"snkMasterFormConfigChange",7),this.exit=t(this,"exit",7),this.actionClick=t(this,"actionClick",7),this.formItemsReady=t(this,"formItemsReady",7),this._guideBuilders=new Map,this.dataUnit=void 0,this.dataState=void 0,this.configName=void 0,this.entityPath=void 0,this.actionsList=void 0,this.recordsValidator=void 0,this.masterFormConfig=void 0,this.selectedGuide=void 0,this.taskbarManager=void 0,this.messagesBuilder=void 0,this.canEdit=!0,this.presentationMode=void 0,this.resourceID=void 0,this.detailTaskbarCustomContainerId=void 0,this.formLegacyConfigName=void 0,this.enableGridInsert=!1,this.ignoreReadOnlyFormFields=void 0,this.getCustomTitle=void 0,this._hasToCreateFieldSearch=!0,this._breadcrumbItems=[],this._guides=void 0,this._formEditorConfigManager=void 0,this._formEditorDataUnit=void 0,this._fieldToGetFocus=void 0,this._customEditors=void 0,this._customRenders=void 0,this._fieldsProps={},this._mainForm=void 0}observeDataUnit(){this.loadGuides(!0)}observeDataState(i,t){var e,s,r,a,d,o;const h=null!==(s=null===(e=null==i?void 0:i.selectionInfo)||void 0===e?void 0:e.recordIds)&&void 0!==s?s:null===(r=null==i?void 0:i.selectedRecord)||void 0===r?void 0:r.__record__id__,l=null!==(d=null===(a=null==t?void 0:t.selectionInfo)||void 0===a?void 0:a.recordIds)&&void 0!==d?d:null===(o=null==t?void 0:t.selectedRecord)||void 0===o?void 0:o.__record__id__;n.equals(h,l)||this.loadGuides((null==t?void 0:t.insertionMode)!=(null==i?void 0:i.insertionMode))}observeMasterFormConfig(){this.loadGuides(this.noGuideSelected()),this.snkMasterFormConfigChange.emit(this.masterFormConfig)}async showFormConfig(i=!1){const t=!i||null==this._currentDetail;this._formEditorConfigManager=t?this._configManager:this._currentDetail.formConfigManager,this._formEditorDataUnit=t?this.dataUnit:this._currentDetail.dataUnit}async addCustomEditor(i,t){this._customEditors=Object.assign(Object.assign({},this._customEditors),{[i]:t})}async addGridCustomRender(i,t){this._customRenders=Object.assign(Object.assign({},this._customRenders),{[i]:t})}async setFieldProp(i,t,e){const s={[i]:Object.assign(Object.assign({},this._fieldsProps[i]),{[t]:e})};this._fieldsProps=Object.assign(Object.assign({},this._fieldsProps),s)}async setFocus(){this._container.focus()}exitViewer(){!this.enableGridInsert&&this.dataUnit.isDirty()?this.dataUnit.cancelEdition({after:()=>this.exit.emit()}):this.exit.emit()}onActionClick(i){i.detail===g.CONFIGURATOR&&"master"!=i.target.dataset.taskbarOwner&&(this._snkConfigurator.open(),i.stopImmediatePropagation(),i.stopPropagation())}onContentCardChanged(i){_.updateContentCard(i.detail.formName,i.detail.cardConfig,i.detail.propertyChanged,this._configManager).then((()=>this.masterFormConfig=this._configManager.getConfig(this.dataUnit)))}getMessage(i){var t,e;if(this.dataUnit.isMultipleEdition){const i=null!==(e=null===(t=this.dataUnit.getSelectionInfo())||void 0===t?void 0:t.records)&&void 0!==e?e:[];return this.messagesBuilder.getMessage("snkCrud.multipleEdition.editing",{COUNT:i.length})}return this.messagesBuilder.getMessage(i,this.dataUnit.getSelectedRecord())}loadGuides(i){if(!this.dataUnit)return;if(!this._configManager.isLoaded)return;this._masterFormMetadata=u(this.masterFormConfig,this.dataUnit,!0);const t=this._masterFormMetadata.getAllSheets(),e=this.dataUnit.getSelectedRecord(),s=this.hasToDisableDetails(e),r=[];Array.from(t.values()).forEach((i=>{const t={id:i.name,label:i.label};this.isDetail(i.name)&&s&&(t.tooltip=this.getMessage("snkCrud.detail.tooltip.needSingleSelection"),t.disabled=!0),r.push(t)})),this._guides=r,this._guideNavigator&&this._guideNavigator.updateItem(this._guides),i&&(this.selectedGuide=this._guides.length>0?this._guides[0]:void 0)}hasToDisableDetails(i){return!i||this.dataUnit.isNewRecord(i.__record__id__)||this.dataUnit.isMultipleEdition}isDetail(i){return null!=v.getDetailName(i)}updateGuide(i){this._guideBuilders.set(i.id,i);const t=i.buildGuideItem(this._guideBuilders);this._guideNavigator&&(this._guideNavigator.updateItem(t).then((()=>{this._guideNavigator.getCurrentPath().then((i=>{this._breadcrumbItems=i}))})),this._guides=this._guides.map((i=>i.id===t.id?Object.assign(Object.assign(Object.assign({},i),t),void 0!==t.children?{}:{children:void 0}):i)))}getTaskBarId(){var i;return(null===(i=this.dataState)||void 0===i?void 0:i.isDirty)?C.FINISH_EDITION:this.dataUnit.isMultipleEdition?C.MUTIPLE_EDITION:C.REGULAR}loadTaskbarProcessor(){const i={};i[C.REGULAR]=this.buildBtnsRegularMode(),i[C.FINISH_EDITION]=[g.CANCEL,g.SAVE,this.handleAddGridMode()],i[C.MUTIPLE_EDITION]=[g.CANCEL],this._taskbarProcessor=new c(i),this._taskbarProcessor.process(this.getTaskBarId(),this.taskbarManager,this.dataState,this.buildDisabledButtons(),this.buildInvisibleButtons())}buildBtnsRegularMode(){var i,t;const e=[g.ATTACH,g.CLONE,g.REMOVE,g.MORE_OPTIONS,g.ACTIONS_BUTTON,g.DIVIDER,g.GRID_MODE,g.CONFIGURATOR];return(null===(t=null===(i=this.dataState)||void 0===i?void 0:i.selectionInfo)||void 0===t?void 0:t.length)<=1&&e.unshift(g.PREVIOUS,g.NEXT,g.DIVIDER),this.presentationMode==k.SECONDARY?e.unshift(g.INSERT):e.push(g.INSERT),e}buildDisabledButtons(){var i,t,e,s,r,n;const a=[];return(null===(i=this.dataState)||void 0===i?void 0:i.hasPrevious)||a.push(g.PREVIOUS),(null===(t=this.dataState)||void 0===t?void 0:t.hasNext)||a.push(g.NEXT),(null===(s=null===(e=this.dataState)||void 0===e?void 0:e.selectionInfo)||void 0===s?void 0:s.length)>1&&a.push(g.CLONE),(null===(n=null===(r=this.dataState)||void 0===r?void 0:r.selectionInfo)||void 0===n?void 0:n.isAllRecords())&&a.push(g.REMOVE),a}handleAddGridMode(){return this.enableGridInsert?g.GRID_MODE:""}buildInvisibleButtons(){const i=[];return this.dataState&&this.dataState.selectionInfo.mode===p.ALL_RECORDS&&i.push(g.ACTIONS_BUTTON),i}static updateContentCard(i,t,e,s){return s.saveCardState(i,t,e)}static buildFixedForms(i){var t;const r=null===(t=i.formConfig)||void 0===t?void 0:t.cardsState;if(null!=r)return e(s,null,Array.from(r.entries()).filter((([t,e])=>(null==e?void 0:e.fixed)&&t!=i.selectedForm)).sort((([,i],[,t])=>((null==i?void 0:i.fixSequence)||0)-((null==t?void 0:t.fixSequence)||0))).map((([t,s])=>{var r,n;const a=i.formMetadata.getSheet(t);if(null!=a)return e("snk-form-view",{levelPath:i.levelPath,label:a.label,name:t,fields:a.fields,formMetadata:i.formMetadata,dataUnit:i.dataUnit,recordsValidator:i.recordsValidator,contracted:"CONTRACTED"===(null==s?void 0:s.presentation),fixed:null==s?void 0:s.fixed,summaryFields:null===(n=null===(r=i.formConfig)||void 0===r?void 0:r.summary)||void 0===n?void 0:n.get(t),fieldToFocus:i.fieldToFocus,key:t,onSnkRequestClearFieldToFocus:()=>{var t;return null===(t=i.onRequestClearFieldToFocus)||void 0===t?void 0:t.call(i)},customEditors:i.propsCustomEditor,fieldsProps:i.fieldsProps})})))}wrapDetail(i,t){if(0===i.length)return t;const s=i.pop(),r=v.getDetailName(s);return r?this.wrapDetail(i,e("snk-data-unit",{dataUnitName:`${this.getDataUnitName(i,r)}`,entityName:r},t)):void 0}getDataUnitName(i,t){if(i.length>0){const e=i.map((i=>v.getDetailName(i)));return`${this.entityPath}/${e.join("/")}/${t}`}return`${this.entityPath}/${t}`}getContent(){var i,t,s,r,n;if(!this.selectedGuide)return;const a=this.selectedGuide.id;let d;const o=a.split("::"),h=o.pop(),l=v.getDetailName(h);let u=a;if(l||o.length>0){let t,s;if(a.includes(b)){[u,t]=a.split(b);const e=(null===(i=this._breadcrumbItems)||void 0===i?void 0:i.length)||0;s=e>1?this._breadcrumbItems[e-2]:this.selectedGuide}else s=this.selectedGuide;d=this.wrapDetail(o,e("snk-detail-view",{ref:i=>this._currentDetail=i,dataUnitName:this.getDataUnitName(o,l),onSnkDetailGuidesChange:i=>this.updateGuide(i.detail),entityName:l,selectedForm:t,branchGuide:s,guideItemPath:this._breadcrumbItems,key:`detail${u}`,canEdit:this.canEdit,onSnkSwitchGuide:i=>this._guideNavigator.selectGuide(i.detail),resourceID:this.resourceID,taskbarCustomContainerId:this.detailTaskbarCustomContainerId,customEditors:this._customEditors,customRenders:this._customRenders,presentationMode:this.presentationMode}))}else{const i=this.selectedGuide.id,o=this._masterFormMetadata.getSheet(i);if(o){const h=null===(s=null===(t=this.masterFormConfig)||void 0===t?void 0:t.cardsState)||void 0===s?void 0:s.get(i);d=e("snk-form-view",{ref:i=>this._mainForm=i,fixed:null==h?void 0:h.fixed,summaryFields:null===(n=null===(r=this.masterFormConfig)||void 0===r?void 0:r.summary)||void 0===n?void 0:n.get(i),name:i,label:o.label,fields:o.fields,dataUnit:this.dataUnit,formMetadata:this._masterFormMetadata,recordsValidator:this.recordsValidator,fieldToFocus:this._fieldToGetFocus,key:a,onSnkRequestClearFieldToFocus:()=>this.clearFieldToFocusHandler(),customEditors:this._customEditors,fieldsProps:this._fieldsProps,fieldSearch:this._fieldSearch},this.presentationMode==k.SECONDARY&&this.buildTaskBar())}}return d}onBreadcrumbClickHandler(i){null!=(null==i?void 0:i.id)&&this._guideNavigator.selectGuide(i.id)}updateSelectedGuideHandler(i){this._guideHasChanged=this.selectedGuide!=i,this.selectedGuide=i,this._guideNavigator.getCurrentPath().then((i=>{this._breadcrumbItems=i})),this.resetGuideBadge(i)}changeGuideHandler(i){var t;null===(t=this._guideNavigator)||void 0===t||t.selectGuide(i)}clearFieldToFocusHandler(){this._fieldToGetFocus=void 0}resetGuideBadge(i){var t;this._guides=[...null===(t=this._guides)||void 0===t?void 0:t.map((t=>this.canClearGuideBadge(t,i.id)?Object.assign(Object.assign({},t),{badge:null}):t))]}canClearGuideBadge(i,t){return i.id===t||this.isIncludedInChildrenList(i,t)}isIncludedInChildrenList(i,t){return this.hasChildren(i)&&this.getChildrenIdList(i).includes(t)}hasChildren(i){return i.children&&Array.isArray(i.children)}getChildrenIdList(i){return i.children.map((i=>i.id))}getConfigViewMode(){return m.GRID}changeConfigViewMode(i){this._currentDetail&&this._currentDetail.changeViewMode(i)}openConfig(i){this._snkConfigurator.close(),this._currentDetail&&(i===m.FORM?this.showFormConfig(!0):this._currentDetail.configGrid())}noGuideSelected(){var i;return void 0===this.selectedGuide||"__main"===(null===(i=this.selectedGuide)||void 0===i?void 0:i.id)}addFormLegacyConfigName(){this.formLegacyConfigName&&this._configManager.addFormLegacyConfig(this.formLegacyConfigName)}setMasterFormConfig(i){this.masterFormConfig=i}componentWillLoad(){if(null==this.resourceID)throw new Error(this.getMessage("snkCrud.errors.resourceIDNotProvided"));this._configManager=new l(this.configName,this.resourceID,this.setMasterFormConfig.bind(this),this.dataUnit),this.addFormLegacyConfigName(),this._configManager.loadConfig()}componentDidRender(){this._guideHasChanged&&(this._currentDetail?this._currentDetail.showUp():this._mainForm&&this._mainForm.showUp(),this._guideHasChanged=!1)}getFieldsSearch(i){return(null==this._fieldSearch||this._hasToCreateFieldSearch)&&(this._hasToCreateFieldSearch=!1,this._fieldSearch=f(i,(({argument:i})=>this.fieldsOptionLoader(i)),(i=>this.onSelectField(i)))),this._fieldSearch}fieldsOptionLoader(i){return Promise.resolve(this._configManager.getFieldsList(i).map((i=>({value:i.name,label:i.label}))))}onSelectField(i){if(null==i)return;this._fieldToGetFocus=i.value;const t=this.getGuideName(i.value);t!==this.selectedGuide.id&&this.changeGuideHandler(t)}getActionsList(){var i;return[].concat(null!=this.taskbarManager&&null!=this.taskbarManager.getMoreOptions?null!==(i=this.taskbarManager.getMoreOptions(this.getTaskBarId(),this.configName,this.dataState,this.actionsList))&&void 0!==i?i:[]:this.actionsList)}getSettingsListForm(){return[{value:a.generateUUID(),label:this.getMessage("snkCrud.findColumn"),disableCloseOnSelect:!0,eagerInitialize:!0,itemBuilder:(i,t)=>this.getFieldsSearch(t)}]}buildTaskBar(){var i;return e("div",{class:"snk-guides-viewer__header-taskbar "+(this.presentationMode!=k.SECONDARY?"ez-align--right":"ez-padding-bottom--medium")},e("snk-taskbar",{key:"guideViewerTaskbar","data-element-id":"guideViewer",configName:this.configName,buttons:this._taskbarProcessor.buttons,disabledButtons:this._taskbarProcessor.disabledButtons,customButtons:this._taskbarProcessor.customButtons,actionsList:this.getActionsList(),actionsSettingsList:this.getSettingsListForm(),messagesBuilder:this.messagesBuilder,presentationMode:this.presentationMode,primaryButton:(null===(i=this.dataState)||void 0===i?void 0:i.isDirty)?g.SAVE:g.INSERT,"data-taskbar-owner":"master",dataUnit:this.dataUnit,resourceID:this.resourceID,customSlotId:"GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS",alignRigth:!0},e("slot",{name:"GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS"})))}async dataUnitActionHandler(i){var t;switch(i.type){case d.EDITION_CANCELED:case d.DATA_SAVED:this.dataUnit.isMultipleEdition&&(this.exitViewer(),this.dataUnit.isMultipleEdition=!1);break;case d.FIELD_INVALIDATED:const e=this.getGuideName(null===(t=i.payload)||void 0===t?void 0:t.fieldName);await this.addErrorBadgeToGuide(e),await this.openGuideNavigator(e);break;case d.METADATA_LOADED:case d.MULTIPLE_EDITION_CHANGED:this.loadGuides(this.noGuideSelected())}}async addErrorBadgeToGuide(i){var t;this._guides=[...null===(t=this._guides)||void 0===t?void 0:t.map((t=>Object.assign(Object.assign({},t),{badge:this.getBadge(t,i)})))]}async openGuideNavigator(i){this.selectedGuide.id!==i&&await this._guideNavigator.openGuideNavidator()}getBadge(i,t){var e;return this.selectedGuide.id===t?null:t===i.id?"error":null!==(e=i.badge)&&void 0!==e?e:null}getGuideName(i){var t;for(const e of this._masterFormMetadata.getAllSheets()){const s=null===(t=e[1])||void 0===t?void 0:t.fields;for(const t of s)if(t.name===i)return e[0]}return""}getTitle(){var i,t;return null!==(t=null===(i=this.getCustomTitle)||void 0===i?void 0:i.call(this))&&void 0!==t?t:this.getMessage("snkCrud.title")}getTitleTooltip(){if(this.dataUnit.isMultipleEdition)return this.buildRecordIdsArray()}buildRecordIdsArray(){var i,t;const e=null!==(t=null===(i=this.dataUnit.getSelectionInfo())||void 0===i?void 0:i.records)&&void 0!==t?t:[];return 0===e.length?"[]":`[${e.map((i=>this.messagesBuilder.getMessage("snkCrud.title",i))).join(", ")}]`}componentDidLoad(){this.dataUnit.subscribe(this.dataUnitActionHandler.bind(this)),this.initKeyboardManager()}disconnectedCallback(){var i;null===(i=this._keyboardManager)||void 0===i||i.unbindAllShortcutKeys()}async initKeyboardManager(){this._keyboardManager=new o({propagate:!1,element:this._element}),this._keyboardManager.bind(w,(async()=>{this._mainForm&&await this._mainForm.showSearchField()}),{description:this.getMessage("snkSimpleCrud.findFields"),element:this._element})}render(){var i,t;if(null!=this._formEditorConfigManager)return e("snk-form-config",{ref:i=>this._container=i,tabindex:-1,dataUnit:this._formEditorDataUnit,messagesBuilder:this.messagesBuilder,configManager:this._formEditorConfigManager,onConfigClose:()=>this._formEditorConfigManager=null});if(!this.dataUnit||!this._configManager.isLoaded)return;this.loadTaskbarProcessor();const s=this._guides&&this._guides.length>1;return e("section",{class:"snk-guides-viewer",ref:i=>this._container=i,tabindex:-1},e("div",{class:"ez-row snk-guides-viewer__header"},e("div",{class:"snk-guides-viewer__header-breadcrumb ez-flex--align-items-center ez-flex-item--align-center ez-padding-left--large",key:"header"},e("ez-button",{onClick:()=>this.exitViewer(),title:this.getMessage("snkCrud.goBackTitle"),mode:"icon",iconName:"arrow_back",class:"ez-padding-right--medium",size:"small"}),e("div",{class:"ez-flex ez-flex--column ez-flex-item--auto"},e("h1",{class:"ez-title ez-title--primary ez-title--xlarge",title:this.getTitleTooltip()},this.getTitle()),(null===(i=this._breadcrumbItems)||void 0===i?void 0:i.length)>1&&e("div",{class:"ez-margin-top--extra-small"},e("ez-breadcrumb",Object.assign({items:this._breadcrumbItems,onSelectedItem:i=>this.onBreadcrumbClickHandler(null==i?void 0:i.detail)},{[h.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:`${h.getInternalIDInfo("breadcrumb")}`}))))),this.presentationMode!=k.SECONDARY&&this.buildTaskBar()),e("div",{class:"snk-guides-viewer__container"},s?e("ez-guide-navigator",{ref:i=>this._guideNavigator=i,class:"snk-guides-viewer__guide-navigator",items:this._guides,selectedId:this.selectedGuide?this.selectedGuide.id:void 0,onEzSelectionChange:i=>this.updateSelectedGuideHandler(i.detail)}):e("div",null),e("div",{class:"snk-guides-viewer__detail-container"},_.buildFixedForms({formConfig:this.masterFormConfig,formMetadata:this._masterFormMetadata,selectedForm:null===(t=this.selectedGuide)||void 0===t?void 0:t.id,dataUnit:this.dataUnit,recordsValidator:this.recordsValidator,fieldToFocus:this._fieldToGetFocus,onRequestClearFieldToFocus:this.clearFieldToFocusHandler.bind(this),propsCustomEditor:this._customEditors,fieldsProps:this._fieldsProps}),this.getContent())),e("snk-configurator",{ref:i=>this._snkConfigurator=i,viewMode:this.getConfigViewMode(),onConfigSelected:i=>this.changeConfigViewMode(i.detail),messagesBuilder:this.messagesBuilder,onOpenConfig:i=>this.openConfig(i.detail),resourceID:this.resourceID}))}get _element(){return r(this)}static get watchers(){return{dataUnit:["observeDataUnit"],dataState:["observeDataState"],masterFormConfig:["observeMasterFormConfig"]}}};var C;!function(i){i.FINISH_EDITION="snkGuideViewer.finish_edition",i.MUTIPLE_EDITION="snkGuideViewer.multiple_edition",i.REGULAR="snkGuideViewer.regular"}(C||(C={})),_.style=".sc-snk-guides-viewer-h{--snk-guides-viewer--space-large:var(--space--large, 24px);--snk-guides-viewer--space-small:var(--space--2xs, 8px);--snk-guides-viewer__header--min-height:68px;--snk-guides-viewer__header--z-index:var(--more-visible, 2);--snk-guides-viewer__header--background-color:var(--background--body, #fafcff);--snk-guides-viewer__guide-navigator--width:340px;display:block}snk-form-view.sc-snk-guides-viewer{width:100%}.snk-guides-viewer.sc-snk-guides-viewer{position:relative;padding-left:0px;padding-top:0px;padding-right:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__detail-container.sc-snk-guides-viewer{display:flex;row-gap:24px;flex-direction:column}.snk-guides-viewer__header.sc-snk-guides-viewer{position:sticky;align-items:center;top:0;z-index:var(--snk-guides-viewer__header--z-index);background-color:var(--snk-guides-viewer__header--background-color);min-height:var(--snk-guides-viewer__header--min-height);width:calc(100% + (var(--snk-guides-viewer--space-large) * 2));padding-left:var(--snk-guides-viewer--space-large);padding-right:var(--snk-guides-viewer--space-large);padding-top:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-small);margin-left:calc(var(--snk-guides-viewer--space-large) * -1);margin-right:calc(var(--snk-guides-viewer--space-large) * -1);margin-bottom:var(--snk-guides-viewer--space-small)}.snk-guides-viewer__header-breadcrumb.sc-snk-guides-viewer{width:25%;display:flex}.snk-guides-viewer__header-taskbar.sc-snk-guides-viewer{width:75%}.snk-guides-viewer__container.sc-snk-guides-viewer{display:grid;grid-template-columns:minmax(0, auto) minmax(0, 100%);height:100%;column-gap:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__guide-navigator.sc-snk-guides-viewer{position:sticky;top:calc(var(--snk-guides-viewer__header--min-height) + var(--snk-guides-viewer--space-small));height:calc(100vh - var(--snk-guides-viewer__header--min-height) - var(--snk-guides-viewer--space-large) - var(--snk-guides-viewer--space-small))}.snk-guides-viewer__guide-navigator[open].sc-snk-guides-viewer{width:var(--snk-guides-viewer__guide-navigator--width);max-width:var(--snk-guides-viewer__guide-navigator--width);min-width:var(--snk-guides-viewer__guide-navigator--width)}.snk-guides-viewer__detail-content.sc-snk-guides-viewer{min-height:100%;align-items:flex-start;align-content:flex-start}";export{_ as S}
@@ -0,0 +1 @@
1
+ import{r as i,c as t,h as s,g as e,H as h}from"./p-d8d8169b.js";import{ElementIDUtils as o,ObjectUtils as a,ApplicationContext as n}from"@sankhyalabs/core";import{S as d}from"./p-13596651.js";import{R as l}from"./p-688dcb4c.js";import{buildFormConfigFromDataUnit as r}from"@sankhyalabs/ezui/dist/collection/utils/form";import{ApplicationUtils as c}from"@sankhyalabs/ezui/dist/collection/utils";import{U as f}from"./p-31b0d523.js";import{a as g,G as m}from"./p-9019a32f.js";import{b as u,a as v,c as p,g as C,u as b,d as y}from"./p-d68904a9.js";import"./p-69885aaa.js";import"./p-42dde1ec.js";import"./p-8d884fab.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-ff1990ad.js";const k=class{constructor(s){i(this,s),this.exit=t(this,"exit",7),this.actionClick=t(this,"actionClick",7),this.formItemsReady=t(this,"formItemsReady",7),this._customEditors=new Map,this._dataUnit=void 0,this._dataState=void 0,this._showFormConfig=!1,this._configManager=void 0,this.configName=void 0,this.recordsValidator=void 0,this.messagesBuilder=void 0,this.formLegacyConfigName=void 0,this.resourceID=void 0}async showConfig(){this._showFormConfig=!0}async hideConfig(){this._showFormConfig=!1}async addCustomEditor(i,t){if(this._form)return void this._form.addCustomEditor(i,t);const s=new Map(this._customEditors);s.set(i,t),this._customEditors=s}async setFieldProp(i,t,s){await this._form.setFieldProp(i,t,s)}async validate(){await this._form.validate()}closeConfig(){this.hideConfig()}dataunitReady(){o.addIDInfo(this._element,null,{dataUnit:this._dataUnit})}setCustomEditors(){if(this._form)for(const[i,t]of this._customEditors)this._form.addCustomEditor(i,t),this._customEditors.delete(i)}async componentDidRender(){this.setCustomEditors()}async componentWillLoad(){let i=this._element.parentElement;for(;i;){if("SNK-DATA-UNIT"===i.tagName.toUpperCase()){this._snkDataUnit=i,this._dataUnit=this._snkDataUnit.dataUnit,this._dataState=this._snkDataUnit.dataState,this._dataUnit?this.dataunitReady():this._snkDataUnit.addEventListener("dataUnitReady",(i=>{this._dataUnit=i.detail})),this._snkDataUnit.addEventListener("dataStateChange",this.handleDataStateChange.bind(this));break}i=i.parentElement}null==this.resourceID&&(this.resourceID=await l.getResourceID()),this._configManager=new d(this.configName,this.resourceID,void 0,this._dataUnit),this.addFormLegacyConfig(),await this._configManager.loadConfig()}async handleDataStateChange(i){var t;this._dataState=i.detail;const s=await this._snkDataUnit.getFieldsWithRmPrecision();for(const i of s||[]){if(!i)continue;const s=null===(t=this._dataState.rowMetadata)||void 0===t?void 0:t.getProp("rm_precision",i);(s||0===s)&&(await this.setFieldProp(i,"precision",s),await this.setFieldProp(i,"prettyPrecision",s))}}addFormLegacyConfig(){this.formLegacyConfigName&&this._configManager.addFormLegacyConfig(this.formLegacyConfigName)}render(){if(this._dataUnit&&this._dataState)return s("section",null,s("div",{class:"ez-row"},s("div",{class:"ez-col ez-col--sd-12"},s("ez-form",{ref:i=>this._form=i,key:"ezForm"+this._snkDataUnit.entityName,"data-element-id":"embedded",dataUnit:this._dataUnit,config:this._configManager.getConfig(this._dataUnit),recordsValidator:this.recordsValidator,class:this._showFormConfig?"snk-form__form--hidden":""}),this._showFormConfig&&s("snk-form-config",{messagesBuilder:this.messagesBuilder,dataUnit:this._dataUnit,configManager:this._configManager,onConfigClose:()=>this.closeConfig()}))))}get _element(){return e(this)}};k.style=".sc-snk-form-h{--snk-form__header--min-height:94px;display:block}.snk-form__form--hidden.sc-snk-form{display:none}";const w=class{constructor(s){i(this,s),this.configClose=t(this,"configClose",7),this.configChange=t(this,"configChange",7),this.guidesMap=new Map,this.availableFields=[],this.guidesList=[],this.groupsList=[],this.selectedGuide=void 0,this._formConfig={},this.configOptions=[],this.originalConfigSelected=void 0,this.configSelected=void 0,this.hasChanges=!1,this.optionConfigChanged=!1,this.dataUnit=void 0,this.configManager=void 0,this.ignoreReadOnlyFormFields=void 0,this.messagesBuilder=void 0}handleFieldConfigChanged(){this.hasChanges=!0}async handleFormConfigOptionSelected({detail:i}){this.configSelected=i,await this.loadConfigByUser(),this.selectedGuide=void 0,this.optionConfigChanged=!a.equals(this.configSelected,this.originalConfigSelected),this.configSelected.origin===f.DEFAULT&&(this.hasChanges=!1)}async handleAddFieldToGuide({detail:i}){var t;this.selectedGuide?this.selectedGuide.isCustom||this.selectedGuide.isDetail?this.showCanNotAddFieldToGuideDialog():(this.availableFields=[...this.availableFields.filter((t=>t.name!==i.name))],await(null===(t=this.refFieldsLayout)||void 0===t?void 0:t.addFieldToLayout(i))):this.showNoGuideSelectedDialog()}async handleSetFieldAsAvailable({detail:i}){this.availableFields.some((t=>t.name===i.name))||(this.availableFields=[...this.availableFields,i])}async handleRemoveFieldFromAvailable({detail:i}){this.availableFields=this.availableFields.filter((t=>t.name!==i.name))}observeSelectedGuide(i){var t;const s=null!==(t=this.guidesMap.get(null==i?void 0:i.name))&&void 0!==t?t:[];this.groupsList=[...s]}observeConfigManager(){this.loadFormConfig()}showNoGuideSelectedDialog(){const i=this.getMessage("snkFormConfig.noGuideSelected.title"),t=this.getMessage("snkFormConfig.noGuideSelected.message");c.alert(i,t)}showCanNotAddFieldToGuideDialog(){const i=this.getMessage("snkFormConfig.canNotAddFieldToGuide.title"),t=this.getMessage("snkFormConfig.canNotAddFieldToGuide.message");c.alert(i,t)}getMessage(i,t){return this.messagesBuilder.getMessage(i,t)}async initializeUserConfig(){if(null!=this.configManager)try{const i=await this.configManager.fetchUserAvailableConfigs();this.configOptions=i;const t=null==this._formConfig||this._formConfig.defaultConfiguration?f.DEFAULT:f.USER;this.configSelected=i.find((i=>i.origin===t)),this.originalConfigSelected=i.find((i=>i.origin===t))}catch(i){console.error(this.getMessage("snkFormConfig.errors.failFetchUserConfig")),console.error(i)}}async loadConfigByUser(){this.configManager&&this.configSelected&&(this.isConfigDefaultSelected()?await this.handleLoadDefaultConfig():this.loadFormConfig())}async handleLoadDefaultConfig(){const i=await this.configManager.fetchDefaultConfig();if(i)return void this.loadFormConfig(i);const t=this.configManager.getEmptyConfig();t&&this.loadFormConfig(t)}isConfigDefaultSelected(){return this.configSelected.origin===f.DEFAULT}loadFormConfig(i){this._formConfig=i||this.getConfig(),this.loadGuides(),this.initializeAvailableFields()}initializeAvailableFields(){var i;if(null==(null===(i=this._formConfig)||void 0===i?void 0:i.fields))return;const t=[...this._formConfig.fields];this.availableFields=this.dataUnit.metadata.fields.filter((({name:i,visible:s,properties:e})=>{const h=t.some((({name:t})=>t===i));return h||!0!==e.visibleOnConfig||s?!0===s&&!1===h:e.visibleOnConfig}))}getInitialOrder(i){var t,s;return Array.isArray(null===(t=this._formConfig)||void 0===t?void 0:t.tabs)?null===(s=this._formConfig.tabs)||void 0===s?void 0:s.length:i.length>0?Math.max(...i.map((i=>i.order))):0}loadGuides(){var i;this.guidesList=[],this.guidesList.push(...u(this._formConfig,this.getMessage("snkFormConfig.form.mainArea"))),this.guidesList.push(...v(this.dataUnit,this.getInitialOrder(this.guidesList),this.guidesList)),this.guidesMap=p(null===(i=this._formConfig)||void 0===i?void 0:i.fields,this.guidesList,this.dataUnit,this.getMessage("snkFormConfig.form.tabGeneral"))}getConfig(){let i=this.configManager.getConfig(this.dataUnit,!1);return i.fields&&0===i.fields.length&&(i=void 0),null==i&&(i=r(this.dataUnit)),a.copy(i)}handleSelectGuide({detail:i}){this.selectedGuide=i}handleLayoutChanged({detail:i}){this.hasChanges=!0,this.groupsList=[...i],this.guidesMap.set(this.selectedGuide.name,[...i])}getIsDefaultConfig(){var i;return(null===(i=this.configSelected)||void 0===i?void 0:i.origin)===f.DEFAULT&&!0===this.optionConfigChanged&&!1===this.hasChanges}getTabsToSave(){return this.guidesList.map((i=>({name:i.name,label:i.name===g.main?i.name:i.label,order:i.name===g.main?0:i.order,visible:i.visible})))}async handleSaveConfig(){var i;const t=await this.configManager.saveConfig(this.buildConfigToSave());this.configSelected=null===(i=this.configOptions)||void 0===i?void 0:i.find((i=>i.origin===(this.hasChanges?f.USER:f.DEFAULT))),this.originalConfigSelected=this.configSelected,this.hasChanges=!1,this.optionConfigChanged=!1,c.info(this.getMessage("snkFormConfig.info.successfullyConfigSaved"),{iconName:"check"}),this.configChange.emit(t)}buildConfigToSave(){if(this.getIsDefaultConfig()){const i=this._formConfig;return i.defaultConfiguration=!0,i}const i=a.copy(this._formConfig);return i.tabs=this.getTabsToSave(),i.fields=C(this.guidesMap),i.defaultConfiguration=!1,i}handleAvailableFieldListChanged({detail:i}){this.availableFields=[...i]}handleSetFieldListAsAvailable({detail:i}){this.availableFields=[...this.availableFields,...i]}handleGuideDeleted({detail:i}){var t,s;const e=i.name,h=null!==(t=this.guidesMap.get(e))&&void 0!==t?t:[],o=[];h.forEach((i=>o.push(...i.fields))),this.availableFields=[...this.availableFields,...o],this.guidesList=[...this.guidesList.filter((i=>i.name!==e))],this.guidesMap.delete(e),(null===(s=this.selectedGuide)||void 0===s?void 0:s.name)===e&&(this.selectedGuide=void 0),this.hasChanges=!0}handleGuideListChanged({detail:i}){this.hasChanges=!0,this.guidesList=[...i]}handleGuideRenamed({detail:i}){var t;const s=null!==(t=this.guidesMap.get(this.selectedGuide.name))&&void 0!==t?t:[],e=b(s,i);this.guidesMap.delete(this.selectedGuide.name),this.guidesMap.set(i,e);const h={name:i,label:i,visible:this.selectedGuide.visible,order:this.selectedGuide.order};this.guidesList=[...this.guidesList.map((i=>i.name===this.selectedGuide.name?h:i))],this.groupsList=[...e],this.selectedGuide=h,this.hasChanges=!0}handleCreateNewGuide(){const i=y(this.guidesList,this.getMessage.bind(this)),t={name:i,label:i,visible:!0,order:this.guidesList.length+1},s={name:m.noGroup,fields:[]};this.guidesList=[...this.guidesList,t],this.guidesMap.set(i,[s]),this.selectedGuide=t,this.hasChanges=!0}getGuideNames(){return[...this.guidesList.map((i=>i.name.toLowerCase())),this.getMessage("snkFormConfig.form.mainArea").toLowerCase()]}async componentWillRender(){if(null==this.messagesBuilder){const i=n.getContextValue("__SNK__APPLICATION__");this.messagesBuilder=i.messagesBuilder}}async componentWillLoad(){this.loadFormConfig(),await this.initializeUserConfig()}render(){return s(h,null,s("config-header",{configOptions:this.configOptions,selectedConfig:this.configSelected,messagesBuilder:this.messagesBuilder,hasChanges:this.hasChanges,optionConfigChanged:this.optionConfigChanged,onConfigClose:()=>this.configClose.emit(),onSaveConfig:async()=>await this.handleSaveConfig()}),s("div",{class:"ez-padding--medium"},s("div",{class:"ez-flex sidebarNavigator__container"},s("guides-configurator",{messagesBuilder:this.messagesBuilder,guidesList:this.guidesList,selectedGuide:this.selectedGuide,onGuideSelected:this.handleSelectGuide.bind(this),onGuideListChanged:this.handleGuideListChanged.bind(this),onCreateNewGuide:this.handleCreateNewGuide.bind(this),onGuideDeleted:this.handleGuideDeleted.bind(this)}),s("fields-layout",{ref:i=>this.refFieldsLayout=i,selectedGuide:this.selectedGuide,guideNames:this.getGuideNames(),groupsList:this.groupsList,messagesBuilder:this.messagesBuilder,dataUnit:this.dataUnit,onGuideRenamed:this.handleGuideRenamed.bind(this),onLayoutChanged:this.handleLayoutChanged.bind(this),onSetFieldListAsAvailable:this.handleSetFieldListAsAvailable.bind(this)}),s("fields-selector",{dataUnit:this.dataUnit,availableFields:this.availableFields,onFieldListChanged:this.handleAvailableFieldListChanged.bind(this),messagesBuilder:this.messagesBuilder}))))}static get watchers(){return{selectedGuide:["observeSelectedGuide"],configManager:["observeConfigManager"]}}};w.style='.sc-snk-form-config-h{display:flex;flex-direction:column;height:100vh;width:100vw;font-family:var(--font-pattern, "Roboto");background:white;color:#2b3a54;--snk-form-config-container-height:calc(100vh - 95px);outline:none}.sidebarNavigator__container.sc-snk-form-config{height:var(--snk-form-config-container-height);gap:20px;align-items:flex-start}.guide-header.sc-snk-form-config{display:flex;width:100%;padding-bottom:12px;border-bottom:1px solid #dce0e8;height:30px;font-weight:500;font-size:16px}';export{k as snk_form,w as snk_form_config}
@@ -1,4 +1,4 @@
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-d75a732c.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-42dde1ec.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
@@ -1 +1 @@
1
- import{r as t,c as s,h as i,H as e,F as a}from"./p-d8d8169b.js";import{I as o}from"./p-9062d640.js";import"./p-d75a732c.js";import{P as r}from"./p-bf017a1f.js";import"@sankhyalabs/core";import"./p-0f3698af.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-ff1990ad.js";import"./p-8d256def.js";import"./p-9019a32f.js";import{ApplicationUtils as n}from"@sankhyalabs/ezui/dist/collection/utils";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";import"./p-8d884fab.js";const h=class{constructor(i){t(this,i),this.pesquisaGridSelectItem=s(this,"pesquisaGridSelectItem",7),this._pesquisaFetcher=new r,this.metadata=void 0,this.dataSource=[],this.pkField=void 0,this.descriptionField=void 0,this.entityName=void 0,this.shouldLoadConfig=!1,this._gridConfig=void 0,this._inMemoryLoader=void 0,this._dataunit=void 0}observeDataSource(t){this._inMemoryLoader&&this._dataunit&&t&&(this._inMemoryLoader.records=[...t])}observeMetadata(){this.initializeDataUnit()}async observeShouldLoadConfig(t){t&&!this._gridConfig&&await this.loadGridConfig()}async loadGridConfig(){this._gridConfig=await this._pesquisaFetcher.loadPesquisaGridConfig(this.entityName)}initializeDataUnit(){var t;this.metadata&&!this._dataunit&&(this._inMemoryLoader=new o(this.metadata,null!==(t=this.dataSource)&&void 0!==t?t:[]),this._dataunit=this._inMemoryLoader.dataUnit,this._dataunit.pageSize=0)}handleDbClick(t){this.pesquisaGridSelectItem.emit({value:t[this.pkField],label:t[this.descriptionField]})}async handleConfigChanged({detail:t}){var s;const i=null!==(s=null==t?void 0:t.columns)&&void 0!==s?s:[];await this._pesquisaFetcher.savePesquisaGridConfig(this.entityName,i)}render(){if(this.metadata&&this._dataunit)return i(e,null,i("ez-grid",{dataUnit:this._dataunit,config:this._gridConfig,mode:"simple",autoFocus:!1,onEzDoubleClick:({detail:t})=>this.handleDbClick(t),onConfigChange:async t=>this.handleConfigChanged(t)}))}static get watchers(){return{dataSource:["observeDataSource"],metadata:["observeMetadata"],shouldLoadConfig:["observeShouldLoadConfig"]}}};h.style=".sc-pesquisa-grid-h{background:var(--background--xlight, #FFF);overflow-x:auto}ez-grid.sc-pesquisa-grid{--ez-grid__container--shadow:none;--ez-grid__header--shadow:none}";const l=class{constructor(i){t(this,i),this.pesquisaTreeSelectItem=s(this,"pesquisaTreeSelectItem",7),this.treeLoader=void 0,this.argument=void 0,this.allowsNonAnalytic=!1,this.shouldLoadTree=!1,this.messagesBuilder=void 0,this.items=[]}async applyFilter(){await this._tree.applyFilter(this.argument)}async observeShouldLoadTree(t){!t||this.items.length>0||await this.loadTree()}async loadTree(){if(!this.shouldLoadTree)return;if(!this.treeLoader||"function"!=typeof this.treeLoader)return;const t=await this.treeLoader((this.argument||"").trim());this.items=[...t]}expandOrCloseAllItems(t,s){return t.map((t=>Object.assign(Object.assign({},t),{expanded:s,children:t.children?this.expandOrCloseAllItems(t.children,s):void 0})))}handleExpandAll(){this.items=[...this.expandOrCloseAllItems(this.items,!0)]}handleCloseAll(){this.items=[...this.expandOrCloseAllItems(this.items,!1)]}handleDbClick(t){var s;if(this.allowsNonAnalytic||(null===(s=t.props)||void 0===s?void 0:s.analitico))this.pesquisaTreeSelectItem.emit({value:t.id,label:t.label});else{const t=this.getMessage("snkPesquisa.tree.errorTitle"),s=this.getMessage("snkPesquisa.tree.nonAnalyticError");n.error(t,s)}}renderEmptyMessage(){return i("div",{class:"ez-flex ez-flex--justify-center ez-flex--align-items-center ez-margin--large ez-text ez-text--xlarge ez-text--secondary"},i("span",null,this.getMessage("snkPesquisa.tree.emptyMessage")))}getMessage(t,s){return this.messagesBuilder.getMessage(t,s)}render(){var t;return i(e,null,(null===(t=this.items)||void 0===t?void 0:t.length)?i(a,null,i("div",{class:"actions-container"},i("ez-button",{size:"small",mode:"icon",class:"ez-margin-right--small",iconName:"show-list",title:this.getMessage("snkPesquisa.tree.expandButton"),onClick:()=>this.handleExpandAll()}),i("ez-button",{size:"small",mode:"icon",iconName:"hide-list",title:this.getMessage("snkPesquisa.tree.collapseButton"),onClick:()=>this.handleCloseAll()})),i("ez-tree",{ref:t=>this._tree=t,onEzDbClickItem:({detail:t})=>this.handleDbClick(t),items:this.items})):this.renderEmptyMessage())}static get watchers(){return{shouldLoadTree:["observeShouldLoadTree"]}}};l.style=".sc-pesquisa-tree-h{--snk-pesquisa--tree__action-container--top:var(--space--sm);--snk-pesquisa--tree__action-container--right:var(--space--small);--snk-pesquisa--tree__min-height:var(--space--extra-large);background:var(--background--xlight, #FFF);position:relative;min-height:var(--snk-pesquisa--tree__min-height);height:100%;display:block;overflow-y:auto}.sc-pesquisa-tree-h:hover .actions-container.sc-pesquisa-tree{display:flex}.actions-container.sc-pesquisa-tree{flex-direction:row;position:absolute;top:var(--snk-pesquisa--tree__action-container--top);right:var(--snk-pesquisa--tree__action-container--right);display:none}";export{h as pesquisa_grid,l as pesquisa_tree}
1
+ import{r as t,c as s,h as i,H as e,F as a}from"./p-d8d8169b.js";import{I as o}from"./p-9fa79997.js";import"./p-42dde1ec.js";import{P as r}from"./p-4db51d85.js";import"@sankhyalabs/core";import"./p-0f3698af.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-ff1990ad.js";import"./p-31b0d523.js";import"./p-9019a32f.js";import{ApplicationUtils as n}from"@sankhyalabs/ezui/dist/collection/utils";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";import"./p-8d884fab.js";const h=class{constructor(i){t(this,i),this.pesquisaGridSelectItem=s(this,"pesquisaGridSelectItem",7),this._pesquisaFetcher=new r,this.metadata=void 0,this.dataSource=[],this.pkField=void 0,this.descriptionField=void 0,this.entityName=void 0,this.shouldLoadConfig=!1,this._gridConfig=void 0,this._inMemoryLoader=void 0,this._dataunit=void 0}observeDataSource(t){this._inMemoryLoader&&this._dataunit&&t&&(this._inMemoryLoader.records=[...t])}observeMetadata(){this.initializeDataUnit()}async observeShouldLoadConfig(t){t&&!this._gridConfig&&await this.loadGridConfig()}async loadGridConfig(){this._gridConfig=await this._pesquisaFetcher.loadPesquisaGridConfig(this.entityName)}initializeDataUnit(){var t;this.metadata&&!this._dataunit&&(this._inMemoryLoader=new o(this.metadata,null!==(t=this.dataSource)&&void 0!==t?t:[]),this._dataunit=this._inMemoryLoader.dataUnit,this._dataunit.pageSize=0)}handleDbClick(t){this.pesquisaGridSelectItem.emit({value:t[this.pkField],label:t[this.descriptionField]})}async handleConfigChanged({detail:t}){var s;const i=null!==(s=null==t?void 0:t.columns)&&void 0!==s?s:[];await this._pesquisaFetcher.savePesquisaGridConfig(this.entityName,i)}render(){if(this.metadata&&this._dataunit)return i(e,null,i("ez-grid",{dataUnit:this._dataunit,config:this._gridConfig,mode:"simple",autoFocus:!1,onEzDoubleClick:({detail:t})=>this.handleDbClick(t),onConfigChange:async t=>this.handleConfigChanged(t)}))}static get watchers(){return{dataSource:["observeDataSource"],metadata:["observeMetadata"],shouldLoadConfig:["observeShouldLoadConfig"]}}};h.style=".sc-pesquisa-grid-h{background:var(--background--xlight, #FFF);overflow-x:auto}ez-grid.sc-pesquisa-grid{--ez-grid__container--shadow:none;--ez-grid__header--shadow:none}";const l=class{constructor(i){t(this,i),this.pesquisaTreeSelectItem=s(this,"pesquisaTreeSelectItem",7),this.treeLoader=void 0,this.argument=void 0,this.allowsNonAnalytic=!1,this.shouldLoadTree=!1,this.messagesBuilder=void 0,this.items=[]}async applyFilter(){await this._tree.applyFilter(this.argument)}async observeShouldLoadTree(t){!t||this.items.length>0||await this.loadTree()}async loadTree(){if(!this.shouldLoadTree)return;if(!this.treeLoader||"function"!=typeof this.treeLoader)return;const t=await this.treeLoader((this.argument||"").trim());this.items=[...t]}expandOrCloseAllItems(t,s){return t.map((t=>Object.assign(Object.assign({},t),{expanded:s,children:t.children?this.expandOrCloseAllItems(t.children,s):void 0})))}handleExpandAll(){this.items=[...this.expandOrCloseAllItems(this.items,!0)]}handleCloseAll(){this.items=[...this.expandOrCloseAllItems(this.items,!1)]}handleDbClick(t){var s;if(this.allowsNonAnalytic||(null===(s=t.props)||void 0===s?void 0:s.analitico))this.pesquisaTreeSelectItem.emit({value:t.id,label:t.label});else{const t=this.getMessage("snkPesquisa.tree.errorTitle"),s=this.getMessage("snkPesquisa.tree.nonAnalyticError");n.error(t,s)}}renderEmptyMessage(){return i("div",{class:"ez-flex ez-flex--justify-center ez-flex--align-items-center ez-margin--large ez-text ez-text--xlarge ez-text--secondary"},i("span",null,this.getMessage("snkPesquisa.tree.emptyMessage")))}getMessage(t,s){return this.messagesBuilder.getMessage(t,s)}render(){var t;return i(e,null,(null===(t=this.items)||void 0===t?void 0:t.length)?i(a,null,i("div",{class:"actions-container"},i("ez-button",{size:"small",mode:"icon",class:"ez-margin-right--small",iconName:"show-list",title:this.getMessage("snkPesquisa.tree.expandButton"),onClick:()=>this.handleExpandAll()}),i("ez-button",{size:"small",mode:"icon",iconName:"hide-list",title:this.getMessage("snkPesquisa.tree.collapseButton"),onClick:()=>this.handleCloseAll()})),i("ez-tree",{ref:t=>this._tree=t,onEzDbClickItem:({detail:t})=>this.handleDbClick(t),items:this.items})):this.renderEmptyMessage())}static get watchers(){return{shouldLoadTree:["observeShouldLoadTree"]}}};l.style=".sc-pesquisa-tree-h{--snk-pesquisa--tree__action-container--top:var(--space--sm);--snk-pesquisa--tree__action-container--right:var(--space--small);--snk-pesquisa--tree__min-height:var(--space--extra-large);background:var(--background--xlight, #FFF);position:relative;min-height:var(--snk-pesquisa--tree__min-height);height:100%;display:block;overflow-y:auto}.sc-pesquisa-tree-h:hover .actions-container.sc-pesquisa-tree{display:flex}.actions-container.sc-pesquisa-tree{flex-direction:row;position:absolute;top:var(--snk-pesquisa--tree__action-container--top);right:var(--snk-pesquisa--tree__action-container--right);display:none}";export{h as pesquisa_grid,l as pesquisa_tree}
@@ -1 +1 @@
1
- import{r as t,c as i,h as e,H as s,g as r}from"./p-d8d8169b.js";import{DataType as l,StringUtils as a,ObjectUtils as n,ElementIDUtils as o,ErrorException as h,ApplicationContext as d,LockManager as c,LockManagerOperation as u,DateUtils as f,MaskFormatter as m,KeyboardManager as p,FloatingManager as v,ArrayUtils as b}from"@sankhyalabs/core";import{EzScrollDirection as g}from"@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection";import{C as k}from"./p-c71dcb2d.js";import{P as _}from"./p-988afe78.js";import{toString as F}from"@sankhyalabs/core/dist/dataunit/metadata/DataType";import{F as y}from"./p-ff1990ad.js";import{F as z,D as x}from"./p-84345e7a.js";import{F as w}from"./p-fa80e546.js";import{ModalAction as C}from"@sankhyalabs/ezui/dist/collection/components/ez-modal-container";import{ApplicationUtils as I}from"@sankhyalabs/ezui/dist/collection/utils";import{A as $}from"./p-6a4b21dd.js";import{F as N}from"./p-b568c1d4.js";import{g as T}from"./p-76e66fd9.js";import"./p-8d256def.js";import"./p-d75a732c.js";import"./p-8d884fab.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";function L(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 A=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){return null!=t.value&&(!Array.isArray(t.value)||t.value.some((t=>!0===t.check)))}observeFilterConfig(t,i){n.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||n.objectToString(i)!=n.objectToString(t),this._loadingPending=this._loadingPending||n.objectToString(i.value)!==n.objectToString(t.value),!this._loadingPending){const e=n.objectToString(i.groupedItems)!=n.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(n.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&&o.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=!_.validateVariableValues(t),this._pendingVariables)return;this._loadingPending=!1,this.doLoadData()}this._configUpdated&&(this._configUpdated=!1,k.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:l.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==(a=e)?void 0:a.elements)&&void 0!==n?n:null==a?void 0:a.members)&&void 0!==o?o:a).filter((t=>null==t?void 0:t.check)).map((({id:t})=>Number.isNaN(+t)?String(t):Number(t)));var a,n,o;if(r.length>0)return{name:i,expression:s.expression,params:[{name:i,dataType:l.TEXT,value:JSON.stringify(r)}]}}(t);case y.PERIOD:return function(t){const{id:i,value:e,props:s}=t;let{end:r,start:a}=e;"string"==typeof r&&(r=new Date(r)),"string"==typeof a&&(a=new Date(a));const n=[];let o;return r&&a?(o=s.expression.fullfill,n.push({name:`${i}.START`,dataType:l.DATE,value:F(l.DATE,a)},{name:`${i}.END`,dataType:l.DATE,value:F(l.DATE,r)})):a?(o=s.expression.onlystart,n.push({name:i,dataType:l.DATE,value:F(l.DATE,a)})):(o=s.expression.onlyend,n.push({name:i,dataType:l.DATE,value:F(l.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:l.TEXT,value:F(l.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 n,o;return a.isEmpty(s.likeAs)||(n=e,e="CONTANIS"===(o=s.likeAs)?`%${n}%`:"STARTS_WITH"===o?`${n}%`:"ENDS_WITH"===o?`%${n}`:n),{name:i,expression:r,params:[{name:i,dataType:l.TEXT,value:F(l.TEXT,e)}]}}(t);case y.NUMBER:return function(t){const{id:i,value:e,props:s}=t;if(s.variation===w.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:l.NUMBER,value:F(l.NUMBER,t)},{name:`${i}.END`,dataType:l.NUMBER,value:F(l.NUMBER,r)}]};if(!isNaN(t))return{name:i,expression:s.intervalExpression.onlystart,params:[{name:i,dataType:l.NUMBER,value:F(l.NUMBER,t)}]};if(!isNaN(r))return{name:i,expression:s.intervalExpression.onlyend,params:[{name:i,dataType:l.NUMBER,value:F(l.NUMBER,r)}]}}return{name:i,expression:s.expression,params:[{name:i,dataType:l.NUMBER,value:F(l.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 a=e>=0&&e<s.length?s[e]:null;return null!=a&&"object"==typeof a&&"value"in a&&(a=a.value),null==a&&r===l.BOOLEAN&&(a=!1),{name:i.name,dataType:r,value:"string"==typeof a?a:F(r,a)}}));return{expression:e,name:t.id,params:s}}));return{name:i,expression:s.map((t=>`(${t.expression})`)).join(` ${z.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:L(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)&&(t.groupedItems||null!=t.value)}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=n.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);return["props","value","hardFixed","fixed"].forEach((t=>{null==i[t]&&delete i[t]})),""===t.value&&delete t.value,i}updateFilter(t){let i=this.filterConfig.map((i=>(t=this.normalizeItem(t),i.id===t.id?(n.objectToString(i)!=n.objectToString(t)&&this.calculateUpdateSequence(t),t):i))).sort(((t,i)=>this._filtersComparator(t,i)));this.filterCustomConfigInterceptor&&(i=this.filterCustomConfigInterceptor(i)),this.filterConfig=i}loadPermitions(){this._application.isUserSup().then((t=>this.allowDefault=t))}addFilterBarLegacyConfigName(){this.filterBarLegacyConfigName&&k.addFilterBarLegacyConfig(this.configName,this.filterBarLegacyConfigName)}async loadConfigFromStorage(t){try{let i;t&&await k.deleteFilterBarConfigCache(this.configName,this.resourceID),i=this.customFilterBarConfig?await this.customFilterBarConfig(this.configName,this.resourceID,{contextURI:this.dataUnit.name}):await k.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 h(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 k.removeDefaultFilter(t,this.resourceID,e),void(this._isDefaultFilter=!1);i===y.PERSONALIZED&&k.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=d.getContextValue("__SNK__APPLICATION__"),await this.attachDataUnit(),this._application){if(this._application.enableLockManagerLoadingApp&&this.enableLockManagerLoadingComp){const t=c.addLockManagerCtxId(this._element);this._resolveLoading=c.lock(t,u.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=n.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",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:g.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"]}}};A.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 P=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(){this.hideDetail()}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=f.formatDate(e,r),n=f.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===w.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 m(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&&(o.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){return 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 p({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"]}}};P.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)}";const D="__SHOWMORE__",S=class{constructor(e){t(this,e),this.snkItemSelected=i(this,"snkItemSelected",7),this._preselection=-1,this.innerClickCheck=(t,i)=>i.id!=v.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=v.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&&v.close(this._floatingID)}onListCloseCallback(){this._floatingID=void 0,this._detailIsVisible=!1}buttonClick(){this._detailIsVisible?this.hideDetail():this.showDetail()}componentDidLoad(){this._element&&o.addIDInfo(this._element)}componentDidRender(){null==this._floatingID&&this._popover&&this._popover.remove()}buildIdElement(t,i){if(!t)return;const e={id:i};t.removeAttribute(o.DATA_ELEMENT_ID_ATTRIBUTE_NAME),o.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===D?this._showAll=!0:(this.hideDetail(),this.snkItemSelected.emit(t))}getFilterItems(){const t=this.items?b.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:D,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)}},B=class{constructor(i){t(this,i),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=n.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===N.QUICK_FILTER?(t.quickFilters.push(i),t):i.filterType===N.CUSTOM_FILTER?(t.customFilters.push(i),t):i.filterType===N.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)))}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===N.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 n.objectToString(this.filters)!=n.objectToString(this.filters)}handleClose(){if(this.hasChangeToSave())return I.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===N.CUSTOM_FILTER||t.filterType===N.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!!_.validateVariableValues(t)||(I.alert(this.getCustomMessage("validations.notFullFilled.title"),this.getCustomMessage("validations.notFullFilled.message")),!1)}modalActionListener(t){switch(t.detail){case C.CANCEL:this.handleClearAll();break;case C.OK:this.handleApplyFilters();break;case C.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=n.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=n.copy(t);this.uncheckFilterValues(i.value);const e=n.copy(this.filters),s=e.findIndex((i=>i.id===t.id));return e.splice(s,1,i),void(this.filters=n.copy(e))}if(y.CHECK_BOX_LIST===t.type){const i=n.copy(this.filters);return i.find((i=>i.id===t.id)).value=void 0,void(this.filters=n.copy(i))}this.filters.find((i=>i.id===t.id)).value=void 0,this.filters=n.copy(this.filters)}uncheckFilterValues(t){return t.forEach((t=>{t&&(t.check=!1)})),t}validateFilters(){const t=T(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)===w.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;const o=this.filterConfig.find((i=>i.id===t.id));y.MULTI_LIST!==o.type?y.CHECK_BOX_LIST!==o.type?null==o.groupedItems?o.value&&i++:i=o.groupedItems.filter((t=>t.visible)).length:i+=Object.entries(null!==(n=o.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=o.value)||void 0===e?void 0:e.elements)&&void 0!==s?s:o.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!==N.DEFAULT_FILTER)))}))}handleActionSelectedDefaultFilter({detail:t}){switch(t){case $.CREATE:this.addPersonalizedFilter(!0);break;case $.EDIT:this.editPersonalizedFilter(this._defaultFilter.id,!0);break;case $.REMOVE:this.handleDeleteFilter()}}getCustomFilter(t){return t.filter((t=>t.filterType===N.CUSTOM_FILTER))}getDefaultFilter(t){return t.find((t=>t.id===x.id))}componentWillLoad(){this._application=d.getContextValue("__SNK__APPLICATION__"),this.filters=n.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.getDefaultFilter(this.filters);const t=this.getCustomFilter(this.filters),i=this.filters.filter((t=>t.filterType===N.QUICK_FILTER)),s=this.filters.filter((t=>t.filterType===N.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"},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"]}}};B.style="ez-modal{--ez-modal-content-padding:24px 12px}.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{A as snk_filter_bar,P as snk_filter_item,S as snk_filter_list,B as snk_filter_modal}
1
+ import{r as t,c as i,h as e,H as s,g as r}from"./p-d8d8169b.js";import{DataType as l,StringUtils as a,ObjectUtils as n,ElementIDUtils as o,ErrorException as h,ApplicationContext as d,LockManager as c,LockManagerOperation as u,DateUtils as f,MaskFormatter as m,KeyboardManager as p,FloatingManager as v,ArrayUtils as b}from"@sankhyalabs/core";import{EzScrollDirection as g}from"@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection";import{C as k}from"./p-69885aaa.js";import{P as _}from"./p-988afe78.js";import{toString as F}from"@sankhyalabs/core/dist/dataunit/metadata/DataType";import{F as y}from"./p-ff1990ad.js";import{F as z,D as x}from"./p-84345e7a.js";import{F as w}from"./p-fa80e546.js";import{ModalAction as C}from"@sankhyalabs/ezui/dist/collection/components/ez-modal-container";import{ApplicationUtils as I}from"@sankhyalabs/ezui/dist/collection/utils";import{A as $}from"./p-6a4b21dd.js";import{F as N}from"./p-b568c1d4.js";import{g as T}from"./p-76e66fd9.js";import"./p-31b0d523.js";import"./p-42dde1ec.js";import"./p-8d884fab.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";function L(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 A=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){return null!=t.value&&(!Array.isArray(t.value)||t.value.some((t=>!0===t.check)))}observeFilterConfig(t,i){n.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||n.objectToString(i)!=n.objectToString(t),this._loadingPending=this._loadingPending||n.objectToString(i.value)!==n.objectToString(t.value),!this._loadingPending){const e=n.objectToString(i.groupedItems)!=n.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(n.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&&o.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=!_.validateVariableValues(t),this._pendingVariables)return;this._loadingPending=!1,this.doLoadData()}this._configUpdated&&(this._configUpdated=!1,k.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:l.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==(a=e)?void 0:a.elements)&&void 0!==n?n:null==a?void 0:a.members)&&void 0!==o?o:a).filter((t=>null==t?void 0:t.check)).map((({id:t})=>Number.isNaN(+t)?String(t):Number(t)));var a,n,o;if(r.length>0)return{name:i,expression:s.expression,params:[{name:i,dataType:l.TEXT,value:JSON.stringify(r)}]}}(t);case y.PERIOD:return function(t){const{id:i,value:e,props:s}=t;let{end:r,start:a}=e;"string"==typeof r&&(r=new Date(r)),"string"==typeof a&&(a=new Date(a));const n=[];let o;return r&&a?(o=s.expression.fullfill,n.push({name:`${i}.START`,dataType:l.DATE,value:F(l.DATE,a)},{name:`${i}.END`,dataType:l.DATE,value:F(l.DATE,r)})):a?(o=s.expression.onlystart,n.push({name:i,dataType:l.DATE,value:F(l.DATE,a)})):(o=s.expression.onlyend,n.push({name:i,dataType:l.DATE,value:F(l.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:l.TEXT,value:F(l.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 n,o;return a.isEmpty(s.likeAs)||(n=e,e="CONTANIS"===(o=s.likeAs)?`%${n}%`:"STARTS_WITH"===o?`${n}%`:"ENDS_WITH"===o?`%${n}`:n),{name:i,expression:r,params:[{name:i,dataType:l.TEXT,value:F(l.TEXT,e)}]}}(t);case y.NUMBER:return function(t){const{id:i,value:e,props:s}=t;if(s.variation===w.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:l.NUMBER,value:F(l.NUMBER,t)},{name:`${i}.END`,dataType:l.NUMBER,value:F(l.NUMBER,r)}]};if(!isNaN(t))return{name:i,expression:s.intervalExpression.onlystart,params:[{name:i,dataType:l.NUMBER,value:F(l.NUMBER,t)}]};if(!isNaN(r))return{name:i,expression:s.intervalExpression.onlyend,params:[{name:i,dataType:l.NUMBER,value:F(l.NUMBER,r)}]}}return{name:i,expression:s.expression,params:[{name:i,dataType:l.NUMBER,value:F(l.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 a=e>=0&&e<s.length?s[e]:null;return null!=a&&"object"==typeof a&&"value"in a&&(a=a.value),null==a&&r===l.BOOLEAN&&(a=!1),{name:i.name,dataType:r,value:"string"==typeof a?a:F(r,a)}}));return{expression:e,name:t.id,params:s}}));return{name:i,expression:s.map((t=>`(${t.expression})`)).join(` ${z.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:L(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)&&(t.groupedItems||null!=t.value)}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=n.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);return["props","value","hardFixed","fixed"].forEach((t=>{null==i[t]&&delete i[t]})),""===t.value&&delete t.value,i}updateFilter(t){let i=this.filterConfig.map((i=>(t=this.normalizeItem(t),i.id===t.id?(n.objectToString(i)!=n.objectToString(t)&&this.calculateUpdateSequence(t),t):i))).sort(((t,i)=>this._filtersComparator(t,i)));this.filterCustomConfigInterceptor&&(i=this.filterCustomConfigInterceptor(i)),this.filterConfig=i}loadPermitions(){this._application.isUserSup().then((t=>this.allowDefault=t))}addFilterBarLegacyConfigName(){this.filterBarLegacyConfigName&&k.addFilterBarLegacyConfig(this.configName,this.filterBarLegacyConfigName)}async loadConfigFromStorage(t){try{let i;t&&await k.deleteFilterBarConfigCache(this.configName,this.resourceID),i=this.customFilterBarConfig?await this.customFilterBarConfig(this.configName,this.resourceID,{contextURI:this.dataUnit.name}):await k.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 h(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 k.removeDefaultFilter(t,this.resourceID,e),void(this._isDefaultFilter=!1);i===y.PERSONALIZED&&k.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=d.getContextValue("__SNK__APPLICATION__"),await this.attachDataUnit(),this._application){if(this._application.enableLockManagerLoadingApp&&this.enableLockManagerLoadingComp){const t=c.addLockManagerCtxId(this._element);this._resolveLoading=c.lock(t,u.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=n.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",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:g.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"]}}};A.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 P=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(){this.hideDetail()}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=f.formatDate(e,r),n=f.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===w.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 m(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&&(o.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){return 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 p({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"]}}};P.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)}";const D="__SHOWMORE__",S=class{constructor(e){t(this,e),this.snkItemSelected=i(this,"snkItemSelected",7),this._preselection=-1,this.innerClickCheck=(t,i)=>i.id!=v.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=v.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&&v.close(this._floatingID)}onListCloseCallback(){this._floatingID=void 0,this._detailIsVisible=!1}buttonClick(){this._detailIsVisible?this.hideDetail():this.showDetail()}componentDidLoad(){this._element&&o.addIDInfo(this._element)}componentDidRender(){null==this._floatingID&&this._popover&&this._popover.remove()}buildIdElement(t,i){if(!t)return;const e={id:i};t.removeAttribute(o.DATA_ELEMENT_ID_ATTRIBUTE_NAME),o.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===D?this._showAll=!0:(this.hideDetail(),this.snkItemSelected.emit(t))}getFilterItems(){const t=this.items?b.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:D,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)}},B=class{constructor(i){t(this,i),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=n.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===N.QUICK_FILTER?(t.quickFilters.push(i),t):i.filterType===N.CUSTOM_FILTER?(t.customFilters.push(i),t):i.filterType===N.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)))}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===N.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 n.objectToString(this.filters)!=n.objectToString(this.filters)}handleClose(){if(this.hasChangeToSave())return I.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===N.CUSTOM_FILTER||t.filterType===N.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!!_.validateVariableValues(t)||(I.alert(this.getCustomMessage("validations.notFullFilled.title"),this.getCustomMessage("validations.notFullFilled.message")),!1)}modalActionListener(t){switch(t.detail){case C.CANCEL:this.handleClearAll();break;case C.OK:this.handleApplyFilters();break;case C.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=n.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=n.copy(t);this.uncheckFilterValues(i.value);const e=n.copy(this.filters),s=e.findIndex((i=>i.id===t.id));return e.splice(s,1,i),void(this.filters=n.copy(e))}if(y.CHECK_BOX_LIST===t.type){const i=n.copy(this.filters);return i.find((i=>i.id===t.id)).value=void 0,void(this.filters=n.copy(i))}this.filters.find((i=>i.id===t.id)).value=void 0,this.filters=n.copy(this.filters)}uncheckFilterValues(t){return t.forEach((t=>{t&&(t.check=!1)})),t}validateFilters(){const t=T(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)===w.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;const o=this.filterConfig.find((i=>i.id===t.id));y.MULTI_LIST!==o.type?y.CHECK_BOX_LIST!==o.type?null==o.groupedItems?o.value&&i++:i=o.groupedItems.filter((t=>t.visible)).length:i+=Object.entries(null!==(n=o.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=o.value)||void 0===e?void 0:e.elements)&&void 0!==s?s:o.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!==N.DEFAULT_FILTER)))}))}handleActionSelectedDefaultFilter({detail:t}){switch(t){case $.CREATE:this.addPersonalizedFilter(!0);break;case $.EDIT:this.editPersonalizedFilter(this._defaultFilter.id,!0);break;case $.REMOVE:this.handleDeleteFilter()}}getCustomFilter(t){return t.filter((t=>t.filterType===N.CUSTOM_FILTER))}getDefaultFilter(t){return t.find((t=>t.id===x.id))}componentWillLoad(){this._application=d.getContextValue("__SNK__APPLICATION__"),this.filters=n.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.getDefaultFilter(this.filters);const t=this.getCustomFilter(this.filters),i=this.filters.filter((t=>t.filterType===N.QUICK_FILTER)),s=this.filters.filter((t=>t.filterType===N.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"},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"]}}};B.style="ez-modal{--ez-modal-content-padding:24px 12px}.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{A as snk_filter_bar,P as snk_filter_item,S as snk_filter_list,B as snk_filter_modal}
Binary file
@@ -1 +1 @@
1
- import{r as e,c as i,f as t,h as s,H as o,g as n}from"./p-d8d8169b.js";import{StringUtils as r,ObjectUtils as a}from"@sankhyalabs/core";import{S as l}from"./p-51833248.js";import{S as d,d as h,I as u}from"./p-8f73da95.js";import{a as c,G as p}from"./p-9019a32f.js";import{ApplicationUtils as g}from"@sankhyalabs/ezui/dist/collection/utils";const m=class{constructor(t){e(this,t),this.isEditingGuideName=i(this,"isEditingGuideName",7),this.isEditingGroupName=i(this,"isEditingGroupName",7),this.layoutChanged=i(this,"layoutChanged",7),this.setFieldListAsAvailable=i(this,"setFieldListAsAvailable",7),this.guideRenamed=i(this,"guideRenamed",7),this.ID_GROUPS="container-groups",this.ID_FIELDS="container-fields",this.reservedGuideNames=[c.main.toLowerCase(),c.general.toLocaleLowerCase()],this.groupsListMemory=[],this.groupsRefList=[],this.isEditGuideNameActive=!1,this.selectedGuide=void 0,this.groupsList=[],this.guideNames=[],this.dataUnit=void 0,this.messagesBuilder=void 0}onMessagesBuilderChange(){this.setCustomCSSProperties()}handleFieldConfigChanged({detail:e}){const i=this.groupsListMemory.find((i=>i.name===e.group));if(!i)return;const t=i.fields.map((i=>i.name===e.name?e:i)),s=this.groupsListMemory.map((e=>e.name===i.name?{name:e.name,fields:t}:e));this.applyGroupUpdate(s)}observeSelectedGuide(){this.isEditGuideNameActive=!1,t(this),this.isEditingGroupName.emit(!1)}observeGroupList(e){this.groupsListMemory=[...e]}observeIsEditGuideNameActive(e){this.isEditingGuideName.emit(e)}async addFieldToLayout(e){e.group=p.noGroup,e.tab=this.selectedGuide.name;const i=this.getFixedFieldsGroup(),t={name:p.noGroup,fields:i?[...i.fields,e]:[e]},s=i?[t,...this.groupsListMemory.slice(1)]:[t,...this.groupsListMemory];this.applyGroupUpdate(s)}getFixedFieldsGroup(){return this.groupsListMemory.find((e=>e.name===p.noGroup))}getMessage(e,i){return this.messagesBuilder.getMessage(e,i)}handleAddGroup(){const e={name:this.buildNewGroupName(),fields:[]},i=[...this.groupsListMemory,e];this.applyGroupUpdate(i)}buildNewGroupName(){var e,i;const t=this.getMessage("snkFormConfig.form.newGroup"),s=null!==(i=null===(e=this.groupsListMemory.filter((e=>e.name.includes(t))))||void 0===e?void 0:e.length)&&void 0!==i?i:0;return 0===s?t:`${t} (${s})`}makeDynamicFieldsContainersDraggable(){this.groupsList.filter((e=>e.name!==p.noGroup)).forEach((e=>{this.makeFieldContainerDraggable(this.getFieldsContainerId(e.name))}))}getFieldsContainerId(e){return`${this.ID_FIELDS}-${r.replaceBlankCharacters(e)}`}handleSortGroups(e){var i;const t=null===(i=e.to)||void 0===i?void 0:i.children;if(!t)return;const s=Array.from(t).map((e=>e.getAttribute("data-group-name"))),o=[],n=this.getFixedFieldsGroup();n&&o.push(n),s.forEach((e=>{const i=this.groupsListMemory.find((i=>i.name===e));i&&o.push(i)})),this.applyGroupUpdate(o)}handleFieldsChanged(e){let i=[...this.groupsListMemory];i=[...this.handleFieldsOnGroupUpdate(i,e,d.FROM)],i=[...this.handleFieldsOnGroupUpdate(i,e,d.TO)],this.applyGroupUpdate(i)}applyGroupUpdate(e){var i;return null===(i=this.groupsRefList)||void 0===i||i.forEach((e=>null==e?void 0:e.cancelEdition())),!a.equals(e,this.groupsListMemory)&&(this.groupsListMemory=[...e],this.layoutChanged.emit(this.groupsListMemory),!0)}handleFieldsOnGroupUpdate(e,i,t){const s=i[t];return s.id===u?e:this.updateGroupList(e,s,t,i)}updateGroupList(e,i,t,s){const o=i.getAttribute("data-group-name"),n={name:o,fields:h(s,t,o,this.selectedGuide.name)};return this.replaceGroup(e,n)}replaceGroup(e,i){return e.map((e=>e.name===i.name?i:e))}makeGroupsDraggable(){try{const e=this.getContainerElement(this.ID_GROUPS);if(!e)return;new l(e,{group:"groups",ghostClass:"ghost",direction:"horizontal",animation:15,onSort:e=>this.handleSortGroups(e)})}catch(e){console.error(this.getMessage("snkFormConfig.errors.failMakeGroupsDraggable"),this.ID_GROUPS)}}makeFieldContainerDraggable(e){try{const i=this.getContainerElement(e);if(!i)return;new l(i,{group:"fields",ghostClass:"ghost",direction:"vertical",animation:15,onAdd:e=>this.handleFieldsChanged(e),onRemove:e=>this.handleFieldsChanged(e),onSort:e=>this.handleFieldsChanged(e)})}catch(i){console.error(this.getMessage("snkFormConfig.errors.failMakeFieldContainerDraggable"),e)}}getContainerElement(e){return this.el.querySelector(`[id="${e}"]`)}handleSetFieldAsAvailable(e){var i;const t=null!==(i=e.group)&&void 0!==i?i:p.noGroup,s=this.groupsListMemory.find((e=>e.name===t)).fields.filter((i=>i.name!==e.name)),o=[...this.replaceGroup(this.groupsListMemory,{name:t,fields:s})];this.applyGroupUpdate(o)}removeGroup(e){var i,t;const s=null!==(t=null===(i=this.groupsListMemory.find((i=>i.name===e.name)))||void 0===i?void 0:i.fields)&&void 0!==t?t:[],o=[...this.groupsListMemory.filter((i=>i.name!==e.name))];this.applyGroupUpdate(o)&&this.setFieldListAsAvailable.emit(s)}handleRenameGroup(e){const{value:i,newValue:t}=e.detail,s=this.groupsListMemory.map((e=>{if(e.name!==i)return Object.assign({},e);const s=e.fields.map((e=>Object.assign(Object.assign({},e),{group:t})));return{name:t,fields:s}}));this.applyGroupUpdate(s)}canSaveGroup(e,i){if(!this.groupsList.some((i=>{var t;return(null!==(t=i.name)&&void 0!==t?t:"").toLocaleLowerCase()===(null!=e?e:"").toLocaleLowerCase()})))return!0;const t=this.getMessage("snkFormConfig.confirm.title"),s=this.buildDuplicatedGroupNameContent(e);return g.alert(t,s).then((()=>{var e;return null===(e=this.groupsRefList[i])||void 0===e?void 0:e.applyFocusTextEdit()})),!1}buildDuplicatedGroupNameContent(e){const i=this.selectedGuide.name;return`\n ${this.getMessage("snkFormConfig.alert.titleGroupExists")}\n <b>${e}</b>\n ${this.getMessage("snkFormConfig.alert.inTab")}\n <b>${i===c.main?this.getMessage("snkFormConfig.form.mainArea"):i}</b>.\n <br/><br/>\n ${this.getMessage("snkFormConfig.alert.infoValidTitle")}\n `}buildDuplicatedTabNameContent(e){return`\n ${this.getMessage("snkFormConfig.alert.titleGuideExists")}\n <b>${e}</b>.\n <br/><br/>\n ${this.getMessage("snkFormConfig.alert.infoValidTitle")}\n `}buildReservedTabNameContent(e){return`\n ${this.getMessage("snkFormConfig.alert.titleGuideReservedName")}\n <br/><br/>\n <b>${e}</b>.\n <br/><br/>\n ${this.getMessage("snkFormConfig.alert.infoValidTitle")}\n `}renderFields(e){if(0!==e.length)return e.map((e=>s("field-item",{key:e.name,fieldConfig:e,onLayoutConfig:!0,dataUnit:this.dataUnit,messagesBuilder:this.messagesBuilder,onSetFieldAsAvailable:e=>this.handleSetFieldAsAvailable(e.detail)})))}renderDraggableGroups(){return this.groupsList.filter((e=>e.name!==p.noGroup)).map(((e,i)=>{var t;return s("div",{key:e.name,class:"group-config","data-group-name":e.name},s("ez-collapsible-box",{ref:e=>this.groupsRefList[i]=e,label:e.name,headerSize:"large",editable:!0,removable:!0,"icon-placement":"left",onEzRemove:()=>this.removeGroup(e),onEzSaveEditLabel:e=>this.handleRenameGroup(e),onEzEditLabelMode:({detail:e})=>this.isEditingGroupName.emit(e),conditionalSave:e=>this.canSaveGroup(e,i)},s("div",{id:this.getFieldsContainerId(e.name),class:"group-content "+((null===(t=e.fields)||void 0===t?void 0:t.length)?"":"empty-content"),"data-group-name":e.name},this.renderFields(e.fields))))}))}renderFixedFields(){var e,i;const t=null!==(i=null===(e=this.groupsList.find((e=>e.name===p.noGroup)))||void 0===e?void 0:e.fields)&&void 0!==i?i:[];return this.renderFields(t)}handleRenameGuide(e){const{value:i,newValue:t}=e.detail;if(this.isEditGuideNameActive=!1,t===i)return;const s=this.guideNames.includes(t.toLowerCase()),o=this.reservedGuideNames.includes(t.toLowerCase());if(o||s){const e=this.getMessage("snkFormConfig.confirm.title"),i=o?this.buildReservedTabNameContent(t):this.buildDuplicatedTabNameContent(t);g.alert(e,i).then((()=>this._refTextEdit.applyFocusSelect()))}else this.guideRenamed.emit(t)}cancelEditGuideName(){this.isEditGuideNameActive=!1}async startGuideNameEdition(){this.isEditGuideNameActive=!0,setTimeout((async()=>{await this._refTextEdit.applyFocusSelect()}),200)}getTextEditStyle(){return{fontSize:"20px",fontWeight:"500",fontFamily:"Roboto"}}renderGuideName(){var e,i;return this.isEditGuideNameActive?s("div",{class:"guide-header"},s("ez-text-edit",{class:"collapsible-box__text-edit",ref:e=>this._refTextEdit=e,value:null===(e=this.selectedGuide)||void 0===e?void 0:e.label,styled:this.getTextEditStyle(),onSaveEdition:e=>this.handleRenameGuide(e),onCancelEdition:()=>this.cancelEditGuideName()})):s("div",{class:"guide-header"},s("span",{class:"guide-header-label"},null===(i=this.selectedGuide)||void 0===i?void 0:i.label),this.renderEditGuideNameButton())}renderEditGuideNameButton(){var e;if((null===(e=this.selectedGuide)||void 0===e?void 0:e.name)!==c.main)return s("ez-button",{mode:"icon",class:"ez-button--tertiary",onClick:()=>this.startGuideNameEdition(),size:"medium",iconName:"edit",title:this.getMessage("snkFormConfig.buttons.rename")})}setCustomCSSProperties(){document.documentElement.style.setProperty("--empty-content-message",`"${this.getMessage("snkFormConfig.form.labelDropField")}"`),document.documentElement.style.setProperty("--no-group-message",`"${this.getMessage("snkFormConfig.form.subTitleInfo")}"`)}componentDidRender(){this.makeGroupsDraggable(),this.makeDynamicFieldsContainersDraggable(),this.makeFieldContainerDraggable(p.noGroup),this.setCustomCSSProperties()}render(){return this.selectedGuide?s(o,{class:"ez-flex-item--auto ez-size-height--full ez-box ez-padding--medium content-container"},this.renderGuideName(),s("div",{class:"layout-container"},s("ez-scroller",{direction:"vertical",activeShadow:!0},s("div",{class:"no-group-container"},s("div",{id:p.noGroup,class:"group-content","data-group-name":p.noGroup},this.renderFixedFields())),s("hr",null),s("div",{id:this.ID_GROUPS,class:"groups-container"},this.renderDraggableGroups()))),s("div",{class:"add-group-container",onClick:this.handleAddGroup.bind(this)},s("ez-icon",{slot:"leftIcon",iconName:"plus"}),s("span",null,this.getMessage("snkFormConfig.form.createNewGroup")))):s(o,{class:"ez-flex-item--auto ez-size-height--full ez-box ez-padding--medium content-container"},s("span",{class:"no-guide-selected"},this.getMessage("snkFormConfig.form.noGuideSelected")))}get el(){return n(this)}static get watchers(){return{messagesBuilder:["onMessagesBuilderChange"],selectedGuide:["observeSelectedGuide"],groupsList:["observeGroupList"],isEditGuideNameActive:["observeIsEditGuideNameActive"]}}};m.style='.sc-fields-layout-h{display:flex;padding:12px;box-shadow:var(--shadow--small, 0 0 16px rgba(0, 38, 111, 0.07));border-radius:var(--border--radius-medium, 6px);height:var(--snk-form-config-container-height);flex-direction:column}.layout-container.sc-fields-layout{container-type:inline-size;display:flex;flex-direction:column;overflow:auto;height:calc(100vh - 225px)}.guide-header.sc-fields-layout{display:flex;width:100%;font-size:20px;border-bottom:1px solid #dce0e8;margin-bottom:6px;align-items:center;height:45px}.guide-header.sc-fields-layout ez-button.sc-fields-layout{transition:all 0.2s ease-in-out;visibility:hidden;opacity:0}.guide-header.sc-fields-layout:hover ez-button.sc-fields-layout{visibility:visible;opacity:1}.guide-header-label.sc-fields-layout{display:block;padding:10px 0}.group-config.sc-fields-layout{padding:12px 0;display:flex;flex-direction:column;width:100%}.group-content.sc-fields-layout{display:grid;gap:12px;min-height:65px;width:100%;padding:6px 0;grid-template-columns:repeat(auto-fill, minmax(250px, 1fr))}.group-content.empty-content.sc-fields-layout{position:relative}.group-content.empty-content.sc-fields-layout::before{content:var(--empty-content-message, "Arraste e solte um campo aqui");color:#cbcfd7;font-size:16px;font-weight:500;text-align:center;position:absolute;inset:0;display:flex;align-items:center;justify-content:center;pointer-events:none;transition:opacity 0.3s;height:100%;box-sizing:border-box;padding:10px;background:#f9f9f9;border:1px dashed #dce0e8;border-radius:6px}.no-group-container.sc-fields-layout{padding:12px 0;width:100%;border-bottom:1px solid #dce0e8}.no-group-container.sc-fields-layout::before{content:var(--no-group-message, "Inclua estes campos nos grupos ou deixe-os separados no topo do formulário");width:100%;display:block;font-size:16px;font-weight:400;color:#AFB6C0;padding-bottom:12px}.add-group-container.sc-fields-layout{display:flex;align-items:center;border-top:1px solid #dce0e8;padding-top:22px;padding-bottom:12px;gap:6px;cursor:pointer;justify-content:center;width:100%;height:55px}.no-guide-selected.sc-fields-layout{display:block;margin:auto;font-size:24px;color:#AFB6C0;font-weight:500}.ghost.sc-fields-layout{opacity:.5;background:#c8fbe2}';export{m as fields_layout}
1
+ import{r as e,c as i,f as t,h as s,H as o,g as n}from"./p-d8d8169b.js";import{StringUtils as a,ObjectUtils as r}from"@sankhyalabs/core";import{ApplicationUtils as l}from"@sankhyalabs/ezui/dist/collection/utils";import{S as d}from"./p-51833248.js";import{a as h,G as u}from"./p-9019a32f.js";import{S as c,e as g,I as p}from"./p-d68904a9.js";const m=class{constructor(t){e(this,t),this.isEditingGuideName=i(this,"isEditingGuideName",7),this.isEditingGroupName=i(this,"isEditingGroupName",7),this.layoutChanged=i(this,"layoutChanged",7),this.setFieldListAsAvailable=i(this,"setFieldListAsAvailable",7),this.guideRenamed=i(this,"guideRenamed",7),this.ID_GROUPS="container-groups",this.ID_FIELDS="container-fields",this.reservedGuideNames=[h.main.toLowerCase(),h.general.toLocaleLowerCase()],this.groupsListMemory=[],this.groupsRefList=[],this.isEditGuideNameActive=!1,this.selectedGuide=void 0,this.groupsList=[],this.guideNames=[],this.dataUnit=void 0,this.messagesBuilder=void 0}onMessagesBuilderChange(){this.setCustomCSSProperties()}handleFieldConfigChanged({detail:e}){const i=this.groupsListMemory.find((i=>i.name===e.group));if(!i)return;const t=i.fields.map((i=>i.name===e.name?e:i)),s=this.groupsListMemory.map((e=>e.name===i.name?{name:e.name,fields:t}:e));this.applyGroupUpdate(s)}observeSelectedGuide(){this.isEditGuideNameActive=!1,t(this),this.isEditingGroupName.emit(!1)}observeGroupList(e){this.groupsListMemory=[...e]}observeIsEditGuideNameActive(e){this.isEditingGuideName.emit(e)}async addFieldToLayout(e){e.group=u.noGroup,e.tab=this.selectedGuide.name;const i=this.getFixedFieldsGroup(),t={name:u.noGroup,fields:i?[...i.fields,e]:[e]},s=i?[t,...this.groupsListMemory.slice(1)]:[t,...this.groupsListMemory];this.applyGroupUpdate(s)}getFixedFieldsGroup(){return this.groupsListMemory.find((e=>e.name===u.noGroup))}getMessage(e,i){return this.messagesBuilder.getMessage(e,i)}handleAddGroup(){const e={name:this.buildNewGroupName(),fields:[]},i=[...this.groupsListMemory,e];this.applyGroupUpdate(i)}buildNewGroupName(){var e,i;const t=this.getMessage("snkFormConfig.form.newGroup"),s=null!==(i=null===(e=this.groupsListMemory.filter((e=>e.name.includes(t))))||void 0===e?void 0:e.length)&&void 0!==i?i:0;return 0===s?t:`${t} (${s})`}makeDynamicFieldsContainersDraggable(){this.groupsList.filter((e=>e.name!==u.noGroup)).forEach((e=>{this.makeFieldContainerDraggable(this.getFieldsContainerId(e.name))}))}getFieldsContainerId(e){return`${this.ID_FIELDS}-${a.replaceBlankCharacters(e)}`}handleSortGroups(e){var i;const t=null===(i=e.to)||void 0===i?void 0:i.children;if(!t)return;const s=Array.from(t).map((e=>e.getAttribute("data-group-name"))),o=[],n=this.getFixedFieldsGroup();n&&o.push(n),s.forEach((e=>{const i=this.groupsListMemory.find((i=>i.name===e));i&&o.push(i)})),this.applyGroupUpdate(o)}handleFieldsChanged(e){let i=[...this.groupsListMemory];i=[...this.handleFieldsOnGroupUpdate(i,e,c.FROM)],i=[...this.handleFieldsOnGroupUpdate(i,e,c.TO)],this.applyGroupUpdate(i)}applyGroupUpdate(e){var i;return null===(i=this.groupsRefList)||void 0===i||i.forEach((e=>null==e?void 0:e.cancelEdition())),!r.equals(e,this.groupsListMemory)&&(this.groupsListMemory=[...e],this.layoutChanged.emit(this.groupsListMemory),!0)}handleFieldsOnGroupUpdate(e,i,t){const s=i[t];return s.id===p?e:this.updateGroupList(e,s,t,i)}updateGroupList(e,i,t,s){const o=i.getAttribute("data-group-name"),n={name:o,fields:g(s,t,o,this.selectedGuide.name)};return this.replaceGroup(e,n)}replaceGroup(e,i){return e.map((e=>e.name===i.name?i:e))}makeGroupsDraggable(){try{const e=this.getContainerElement(this.ID_GROUPS);if(!e)return;new d(e,{group:"groups",ghostClass:"ghost",direction:"horizontal",animation:15,onSort:e=>this.handleSortGroups(e)})}catch(e){console.error(this.getMessage("snkFormConfig.errors.failMakeGroupsDraggable"),this.ID_GROUPS)}}makeFieldContainerDraggable(e){try{const i=this.getContainerElement(e);if(!i)return;new d(i,{group:"fields",ghostClass:"ghost",direction:"vertical",animation:15,onAdd:e=>this.handleFieldsChanged(e),onRemove:e=>this.handleFieldsChanged(e),onSort:e=>this.handleFieldsChanged(e)})}catch(i){console.error(this.getMessage("snkFormConfig.errors.failMakeFieldContainerDraggable"),e)}}getContainerElement(e){return this.el.querySelector(`[id="${e}"]`)}handleSetFieldAsAvailable(e){var i;const t=null!==(i=e.group)&&void 0!==i?i:u.noGroup,s=this.groupsListMemory.find((e=>e.name===t)).fields.filter((i=>i.name!==e.name)),o=[...this.replaceGroup(this.groupsListMemory,{name:t,fields:s})];this.applyGroupUpdate(o)}removeGroup(e){var i,t;const s=null!==(t=null===(i=this.groupsListMemory.find((i=>i.name===e.name)))||void 0===i?void 0:i.fields)&&void 0!==t?t:[],o=[...this.groupsListMemory.filter((i=>i.name!==e.name))];this.applyGroupUpdate(o)&&this.setFieldListAsAvailable.emit(s)}handleRenameGroup(e){const{value:i,newValue:t}=e.detail,s=this.groupsListMemory.map((e=>{if(e.name!==i)return Object.assign({},e);const s=e.fields.map((e=>Object.assign(Object.assign({},e),{group:t})));return{name:t,fields:s}}));this.applyGroupUpdate(s)}canSaveGroup(e,i){if(!this.groupsList.some((i=>{var t;return(null!==(t=i.name)&&void 0!==t?t:"").toLocaleLowerCase()===(null!=e?e:"").toLocaleLowerCase()})))return!0;const t=this.getMessage("snkFormConfig.confirm.title"),s=this.buildDuplicatedGroupNameContent(e);return l.alert(t,s).then((()=>{var e;return null===(e=this.groupsRefList[i])||void 0===e?void 0:e.applyFocusTextEdit()})),!1}buildDuplicatedGroupNameContent(e){const i=this.selectedGuide.name;return`\n ${this.getMessage("snkFormConfig.alert.titleGroupExists")}\n <b>${e}</b>\n ${this.getMessage("snkFormConfig.alert.inTab")}\n <b>${i===h.main?this.getMessage("snkFormConfig.form.mainArea"):i}</b>.\n <br/><br/>\n ${this.getMessage("snkFormConfig.alert.infoValidTitle")}\n `}buildDuplicatedTabNameContent(e){return`\n ${this.getMessage("snkFormConfig.alert.titleGuideExists")}\n <b>${e}</b>.\n <br/><br/>\n ${this.getMessage("snkFormConfig.alert.infoValidTitle")}\n `}buildReservedTabNameContent(e){return`\n ${this.getMessage("snkFormConfig.alert.titleGuideReservedName")}\n <br/><br/>\n <b>${e}</b>.\n <br/><br/>\n ${this.getMessage("snkFormConfig.alert.infoValidTitle")}\n `}renderFields(e){if(0!==e.length)return e.map((e=>s("field-item",{key:e.name,fieldConfig:e,onLayoutConfig:!0,dataUnit:this.dataUnit,messagesBuilder:this.messagesBuilder,onSetFieldAsAvailable:e=>this.handleSetFieldAsAvailable(e.detail)})))}renderDraggableGroups(){return this.groupsList.filter((e=>e.name!==u.noGroup)).map(((e,i)=>{var t;return s("div",{key:e.name,class:"group-config","data-group-name":e.name},s("ez-collapsible-box",{ref:e=>this.groupsRefList[i]=e,label:e.name,headerSize:"large",editable:!0,removable:!0,"icon-placement":"left",onEzRemove:()=>this.removeGroup(e),onEzSaveEditLabel:e=>this.handleRenameGroup(e),onEzEditLabelMode:({detail:e})=>this.isEditingGroupName.emit(e),conditionalSave:e=>this.canSaveGroup(e,i)},s("div",{id:this.getFieldsContainerId(e.name),class:"group-content "+((null===(t=e.fields)||void 0===t?void 0:t.length)?"":"empty-content"),"data-group-name":e.name},this.renderFields(e.fields))))}))}renderFixedFields(){var e,i;const t=null!==(i=null===(e=this.groupsList.find((e=>e.name===u.noGroup)))||void 0===e?void 0:e.fields)&&void 0!==i?i:[];return this.renderFields(t)}handleRenameGuide(e){const{value:i,newValue:t}=e.detail;if(this.isEditGuideNameActive=!1,t===i)return;const s=this.guideNames.includes(t.toLowerCase()),o=this.reservedGuideNames.includes(t.toLowerCase());if(o||s){const e=this.getMessage("snkFormConfig.confirm.title"),i=o?this.buildReservedTabNameContent(t):this.buildDuplicatedTabNameContent(t);l.alert(e,i).then((()=>this._refTextEdit.applyFocusSelect()))}else this.guideRenamed.emit(t)}cancelEditGuideName(){this.isEditGuideNameActive=!1}async startGuideNameEdition(){this.isEditGuideNameActive=!0,setTimeout((async()=>{await this._refTextEdit.applyFocusSelect()}),200)}getTextEditStyle(){return{fontSize:"20px",fontWeight:"500",fontFamily:"Roboto"}}renderGuideName(){var e,i;return this.isEditGuideNameActive?s("div",{class:"guide-header"},s("ez-text-edit",{class:"collapsible-box__text-edit",ref:e=>this._refTextEdit=e,value:null===(e=this.selectedGuide)||void 0===e?void 0:e.label,styled:this.getTextEditStyle(),onSaveEdition:e=>this.handleRenameGuide(e),onCancelEdition:()=>this.cancelEditGuideName()})):s("div",{class:"guide-header"},s("span",{class:"guide-header-label"},null===(i=this.selectedGuide)||void 0===i?void 0:i.label),this.renderEditGuideNameButton())}renderEditGuideNameButton(){var e;if((null===(e=this.selectedGuide)||void 0===e?void 0:e.name)!==h.main)return s("ez-button",{mode:"icon",class:"ez-button--tertiary",onClick:()=>this.startGuideNameEdition(),size:"medium",iconName:"edit",title:this.getMessage("snkFormConfig.buttons.rename")})}setCustomCSSProperties(){document.documentElement.style.setProperty("--empty-content-message",`"${this.getMessage("snkFormConfig.form.labelDropField")}"`),document.documentElement.style.setProperty("--no-group-message",`"${this.getMessage("snkFormConfig.form.subTitleInfo")}"`)}componentDidRender(){this.makeGroupsDraggable(),this.makeDynamicFieldsContainersDraggable(),this.makeFieldContainerDraggable(u.noGroup),this.setCustomCSSProperties()}render(){return this.selectedGuide?this.selectedGuide.isCustom||this.selectedGuide.isDetail?s(o,{class:"ez-flex-item--auto ez-size-height--full ez-box ez-padding--medium content-container"},s("div",{class:"message-container"},s("h1",{class:"no-guide-selected"},this.getMessage("snkFormConfig.form.canNotEditCustomGuide")),s("span",{class:"message-config-detail"},this.getMessage("snkFormConfig.form.canNotEditDetailGuide")))):s(o,{class:"ez-flex-item--auto ez-size-height--full ez-box ez-padding--medium content-container"},this.renderGuideName(),s("div",{class:"layout-container"},s("ez-scroller",{direction:"vertical",activeShadow:!0},s("div",{class:"no-group-container"},s("div",{id:u.noGroup,class:"group-content","data-group-name":u.noGroup},this.renderFixedFields())),s("hr",null),s("div",{id:this.ID_GROUPS,class:"groups-container"},this.renderDraggableGroups()))),s("div",{class:"add-group-container",onClick:this.handleAddGroup.bind(this)},s("ez-icon",{slot:"leftIcon",iconName:"plus"}),s("span",null,this.getMessage("snkFormConfig.form.createNewGroup")))):s(o,{class:"ez-flex-item--auto ez-size-height--full ez-box ez-padding--medium content-container"},s("span",{class:"no-guide-selected"},this.getMessage("snkFormConfig.form.noGuideSelected")))}get el(){return n(this)}static get watchers(){return{messagesBuilder:["onMessagesBuilderChange"],selectedGuide:["observeSelectedGuide"],groupsList:["observeGroupList"],isEditGuideNameActive:["observeIsEditGuideNameActive"]}}};m.style='.sc-fields-layout-h{display:flex;padding:12px;box-shadow:var(--shadow--small, 0 0 16px rgba(0, 38, 111, 0.07));border-radius:var(--border--radius-medium, 6px);height:var(--snk-form-config-container-height);flex-direction:column}.layout-container.sc-fields-layout{container-type:inline-size;display:flex;flex-direction:column;overflow:auto;height:calc(100vh - 225px)}.guide-header.sc-fields-layout{display:flex;width:100%;font-size:20px;border-bottom:1px solid #dce0e8;margin-bottom:6px;align-items:center;height:45px}.guide-header.sc-fields-layout ez-button.sc-fields-layout{transition:all 0.2s ease-in-out;visibility:hidden;opacity:0}.guide-header.sc-fields-layout:hover ez-button.sc-fields-layout{visibility:visible;opacity:1}.guide-header-label.sc-fields-layout{display:block;padding:10px 0}.group-config.sc-fields-layout{padding:12px 0;display:flex;flex-direction:column;width:100%}.group-content.sc-fields-layout{display:grid;gap:12px;min-height:65px;width:100%;padding:6px 0;grid-template-columns:repeat(auto-fill, minmax(250px, 1fr))}.group-content.empty-content.sc-fields-layout{position:relative}.group-content.empty-content.sc-fields-layout::before{content:var(--empty-content-message, "Arraste e solte um campo aqui");color:#cbcfd7;font-size:16px;font-weight:500;text-align:center;position:absolute;inset:0;display:flex;align-items:center;justify-content:center;pointer-events:none;transition:opacity 0.3s;height:100%;box-sizing:border-box;padding:10px;background:#f9f9f9;border:1px dashed #dce0e8;border-radius:6px}.no-group-container.sc-fields-layout{padding:12px 0;width:100%;border-bottom:1px solid #dce0e8}.no-group-container.sc-fields-layout::before{content:var(--no-group-message, "Inclua estes campos nos grupos ou deixe-os separados no topo do formulário");width:100%;display:block;font-size:16px;font-weight:400;color:#AFB6C0;padding-bottom:12px}.add-group-container.sc-fields-layout{display:flex;align-items:center;border-top:1px solid #dce0e8;padding-top:22px;padding-bottom:12px;gap:6px;cursor:pointer;justify-content:center;width:100%;height:55px}.no-guide-selected.sc-fields-layout{display:block;margin:auto;font-size:24px;color:#AFB6C0;font-weight:500}.message-container.sc-fields-layout{margin:auto;display:flex;flex-direction:column;justify-content:center;align-items:center}.message-config-detail.sc-fields-layout{display:block;margin:auto;font-size:var(--font-size--medium, 16px);color:#AFB6C0;font-weight:var(--font-weight--medium, 500)}.ghost.sc-fields-layout{opacity:.5;background:#c8fbe2}';export{m as fields_layout}
Binary file