@sankhyalabs/sankhyablocks 10.0.6 → 10.0.8

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 (903) hide show
  1. package/dist/cjs/AuthorizationConfig-79ffae4b.js.gz +0 -0
  2. package/dist/cjs/{ConfigStorage-2b412ac9.js → ConfigStorage-b829def9.js} +2 -2
  3. package/dist/cjs/ConfigStorage-b829def9.js.gz +0 -0
  4. package/dist/cjs/{DataFetcher-a1d986da.js → DataFetcher-21f8c2dc.js} +11 -22
  5. package/dist/cjs/DataFetcher-21f8c2dc.js.gz +0 -0
  6. package/dist/cjs/FormConfigHelper-1e8bb464.js.gz +0 -0
  7. package/dist/cjs/GetSelectedRecordsIDsInfo-bd50caf1.js.gz +0 -0
  8. package/dist/cjs/IFetchDataExporterParams-e78ec415.js.gz +0 -0
  9. package/dist/cjs/{ISave-4c4f7231.js → ISave-f926fe9e.js} +1 -1
  10. package/dist/cjs/ISave-f926fe9e.js.gz +0 -0
  11. package/dist/cjs/ParamType-90b440a0.js.gz +0 -0
  12. package/dist/cjs/PersonalizedFilterUtils-7259cf65.js.gz +0 -0
  13. package/dist/cjs/PrintUtils-bcaeb82f.js.gz +0 -0
  14. package/dist/cjs/ResourceIDUtils-5ff86aa7.js.gz +0 -0
  15. package/dist/cjs/{SnkFormConfigManager-cfb6323a.js → SnkFormConfigManager-cf551c69.js} +2 -2
  16. package/dist/cjs/SnkFormConfigManager-cf551c69.js.gz +0 -0
  17. package/dist/cjs/{SnkMultiSelectionListDataSource-99a82236.js → SnkMultiSelectionListDataSource-62632a87.js} +4 -4
  18. package/dist/cjs/SnkMultiSelectionListDataSource-62632a87.js.gz +0 -0
  19. package/dist/cjs/{auth-fetcher-3dda805e.js → auth-fetcher-61e18ad2.js} +1 -1
  20. package/dist/cjs/auth-fetcher-61e18ad2.js.gz +0 -0
  21. package/dist/cjs/config-header.cjs.entry.js.gz +0 -0
  22. package/dist/cjs/configs-button.cjs.entry.js.gz +0 -0
  23. package/dist/cjs/constants-6d82e405.js.gz +0 -0
  24. package/dist/cjs/{dataunit-fetcher-434d8c8d.js → dataunit-fetcher-9d6cc3e8.js} +1 -1
  25. package/dist/cjs/dataunit-fetcher-9d6cc3e8.js.gz +0 -0
  26. package/dist/cjs/default-filters-a09bf82b.js.gz +0 -0
  27. package/dist/cjs/field-config_2.cjs.entry.js.gz +0 -0
  28. package/dist/cjs/fields-layout.cjs.entry.js.gz +0 -0
  29. package/dist/cjs/fields-selector.cjs.entry.js.gz +0 -0
  30. package/dist/cjs/filter-item-type.enum-a7ffdaa6.js.gz +0 -0
  31. package/dist/cjs/filter-type.enum-2bb46d2a.js.gz +0 -0
  32. package/dist/cjs/filter-validate-cb4ed41a.js.gz +0 -0
  33. package/dist/cjs/filterNumberVariation-d65332da.js.gz +0 -0
  34. package/dist/cjs/{form-config-fetcher-0e6f36d9.js → form-config-fetcher-fef79845.js} +1 -1
  35. package/dist/cjs/form-config-fetcher-fef79845.js.gz +0 -0
  36. package/dist/cjs/guides-configurator.cjs.entry.js.gz +0 -0
  37. package/dist/cjs/index-13d05f03.js.gz +0 -0
  38. package/dist/cjs/index-1cf293c1.js.gz +0 -0
  39. package/dist/cjs/index-62760a9c.js.gz +0 -0
  40. package/dist/cjs/index-8d94b7e0.js.gz +0 -0
  41. package/dist/cjs/index-e3e39724.js.gz +0 -0
  42. package/dist/cjs/index.cjs.js.gz +0 -0
  43. package/dist/cjs/loader.cjs.js.gz +0 -0
  44. package/dist/cjs/pesquisa-grid_2.cjs.entry.js +4 -4
  45. package/dist/cjs/pesquisa-grid_2.cjs.entry.js.gz +0 -0
  46. package/dist/cjs/presentationMode-52ec3bdd.js.gz +0 -0
  47. package/dist/cjs/sankhyablocks.cjs.js.gz +0 -0
  48. package/dist/cjs/snk-actions-button_8.cjs.entry.js +5 -5
  49. package/dist/cjs/snk-actions-button_8.cjs.entry.js.gz +0 -0
  50. package/dist/cjs/snk-actions-form.cjs.entry.js.gz +0 -0
  51. package/dist/cjs/snk-application.cjs.entry.js +6 -6
  52. package/dist/cjs/snk-application.cjs.entry.js.gz +0 -0
  53. package/dist/cjs/snk-attach.cjs.entry.js +5 -5
  54. package/dist/cjs/snk-attach.cjs.entry.js.gz +0 -0
  55. package/dist/cjs/snk-client-confirm.cjs.entry.js.gz +0 -0
  56. package/dist/cjs/snk-configurator.cjs.entry.js.gz +0 -0
  57. package/dist/cjs/snk-crud.cjs.entry.js +5 -5
  58. package/dist/cjs/snk-crud.cjs.entry.js.gz +0 -0
  59. package/dist/cjs/snk-custom-slot-elements.cjs.entry.js.gz +0 -0
  60. package/dist/cjs/snk-data-exporter.cjs.entry.js +5 -5
  61. package/dist/cjs/snk-data-exporter.cjs.entry.js.gz +0 -0
  62. package/dist/cjs/{snk-data-unit-323a507f.js → snk-data-unit-adc2aebd.js} +2 -2
  63. package/dist/cjs/snk-data-unit-adc2aebd.js.gz +0 -0
  64. package/dist/cjs/snk-data-unit.cjs.entry.js +3 -3
  65. package/dist/cjs/snk-data-unit.cjs.entry.js.gz +0 -0
  66. package/dist/cjs/snk-default-filter.cjs.entry.js.gz +0 -0
  67. package/dist/cjs/snk-detail-view.cjs.entry.js +7 -7
  68. package/dist/cjs/snk-detail-view.cjs.entry.js.gz +0 -0
  69. package/dist/cjs/snk-entity-list.cjs.entry.js.gz +0 -0
  70. package/dist/cjs/snk-exporter-email-sender.cjs.entry.js.gz +0 -0
  71. package/dist/cjs/snk-expression-group_2.cjs.entry.js.gz +0 -0
  72. package/dist/cjs/snk-filter-advanced-mode_2.cjs.entry.js.gz +0 -0
  73. package/dist/cjs/snk-filter-bar_4.cjs.entry.js +27 -7
  74. package/dist/cjs/snk-filter-bar_4.cjs.entry.js.gz +0 -0
  75. package/dist/cjs/snk-filter-binary-select.cjs.entry.js.gz +0 -0
  76. package/dist/cjs/snk-filter-checkbox-list.cjs.entry.js.gz +0 -0
  77. package/dist/cjs/snk-filter-detail.cjs.entry.js.gz +0 -0
  78. package/dist/cjs/snk-filter-field-search_2.cjs.entry.js.gz +0 -0
  79. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
  80. package/dist/cjs/snk-filter-modal-item.cjs.entry.js.gz +0 -0
  81. package/dist/cjs/snk-filter-multi-select.cjs.entry.js.gz +0 -0
  82. package/dist/cjs/snk-filter-number.cjs.entry.js +1 -1
  83. package/dist/cjs/snk-filter-number.cjs.entry.js.gz +0 -0
  84. package/dist/cjs/snk-filter-period.cjs.entry.js +10 -5
  85. package/dist/cjs/snk-filter-period.cjs.entry.js.gz +0 -0
  86. package/dist/cjs/snk-filter-search.cjs.entry.js.gz +0 -0
  87. package/dist/cjs/snk-filter-text.cjs.entry.js +1 -1
  88. package/dist/cjs/snk-filter-text.cjs.entry.js.gz +0 -0
  89. package/dist/cjs/snk-form-summary.cjs.entry.js.gz +0 -0
  90. package/dist/cjs/snk-form-view.cjs.entry.js.gz +0 -0
  91. package/dist/cjs/snk-form_2.cjs.entry.js +4 -4
  92. package/dist/cjs/snk-form_2.cjs.entry.js.gz +0 -0
  93. package/dist/cjs/snk-grid.cjs.entry.js +6 -6
  94. package/dist/cjs/snk-grid.cjs.entry.js.gz +0 -0
  95. package/dist/cjs/{snk-guides-viewer-57624b79.js → snk-guides-viewer-e135aa5c.js} +5 -5
  96. package/dist/cjs/snk-guides-viewer-e135aa5c.js.gz +0 -0
  97. package/dist/cjs/snk-guides-viewer.cjs.entry.js +7 -7
  98. package/dist/cjs/snk-guides-viewer.cjs.entry.js.gz +0 -0
  99. package/dist/cjs/snk-personalized-filter-editor.cjs.entry.js.gz +0 -0
  100. package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
  101. package/dist/cjs/snk-personalized-filter.cjs.entry.js.gz +0 -0
  102. package/dist/cjs/snk-pesquisa.cjs.entry.js +4 -4
  103. package/dist/cjs/snk-pesquisa.cjs.entry.js.gz +0 -0
  104. package/dist/cjs/snk-print-selector.cjs.entry.js.gz +0 -0
  105. package/dist/cjs/snk-simple-bar.cjs.entry.js.gz +0 -0
  106. package/dist/cjs/snk-simple-crud.cjs.entry.js +7 -7
  107. package/dist/cjs/snk-simple-crud.cjs.entry.js.gz +0 -0
  108. package/dist/cjs/snk-taskbar.cjs.entry.js.gz +0 -0
  109. package/dist/cjs/sortable.esm-9a110bb7.js.gz +0 -0
  110. package/dist/cjs/taskbar-elements-fb5d1e08.js.gz +0 -0
  111. package/dist/cjs/taskbar-processor-2fba34a8.js.gz +0 -0
  112. package/dist/cjs/teste-pesquisa.cjs.entry.js.gz +0 -0
  113. package/dist/collection/components/snk-actions-button/actions/enum/ActionsType.js.gz +0 -0
  114. package/dist/collection/components/snk-actions-button/actions/enum/ParamType.js.gz +0 -0
  115. package/dist/collection/components/snk-actions-button/actions/enum/RefreshType.js.gz +0 -0
  116. package/dist/collection/components/snk-actions-button/actions/executor/java.executor.js.gz +0 -0
  117. package/dist/collection/components/snk-actions-button/actions/executor/javascript.executor.js.gz +0 -0
  118. package/dist/collection/components/snk-actions-button/actions/executor/launch-screen.executor.js.gz +0 -0
  119. package/dist/collection/components/snk-actions-button/actions/executor/procedure.executor.js.gz +0 -0
  120. package/dist/collection/components/snk-actions-button/actions/factory/executor.factory.js.gz +0 -0
  121. package/dist/collection/components/snk-actions-button/actions/index.js.gz +0 -0
  122. package/dist/collection/components/snk-actions-button/actions/interfaces/IAction.js.gz +0 -0
  123. package/dist/collection/components/snk-actions-button/actions/interfaces/IExecSource.js.gz +0 -0
  124. package/dist/collection/components/snk-actions-button/actions/interfaces/IExecuteActions.js.gz +0 -0
  125. package/dist/collection/components/snk-actions-button/actions/interfaces/IExecuteActionsProps.js.gz +0 -0
  126. package/dist/collection/components/snk-actions-button/actions/interfaces/IResultParam.js.gz +0 -0
  127. package/dist/collection/components/snk-actions-button/clientEvent/index.js.gz +0 -0
  128. package/dist/collection/components/snk-actions-button/clientEvent/interfaces/IClientEventConfirm.js.gz +0 -0
  129. package/dist/collection/components/snk-actions-button/interfaces/index.js.gz +0 -0
  130. package/dist/collection/components/snk-actions-button/snk-actions-button.css.gz +0 -0
  131. package/dist/collection/components/snk-actions-button/snk-actions-button.js.gz +0 -0
  132. package/dist/collection/components/snk-actions-button/subcomponents/snk-actions-form.js.gz +0 -0
  133. package/dist/collection/components/snk-actions-button/subcomponents/snk-client-confirm.js.gz +0 -0
  134. package/dist/collection/components/snk-application/__mocks__/snk-application.js.gz +0 -0
  135. package/dist/collection/components/snk-application/errorhandler/snk-error-handler.js.gz +0 -0
  136. package/dist/collection/components/snk-application/request-listener/DebouncedRequestListener.js.gz +0 -0
  137. package/dist/collection/components/snk-application/request-listener/RequestListenerFactory.js.gz +0 -0
  138. package/dist/collection/components/snk-application/request-listener/RequestListenerLoadingBar.js.gz +0 -0
  139. package/dist/collection/components/snk-application/search-strategy/exec-prepared-search-plus.js.gz +0 -0
  140. package/dist/collection/components/snk-application/snk-application.css.gz +0 -0
  141. package/dist/collection/components/snk-application/snk-application.js.gz +0 -0
  142. package/dist/collection/components/snk-attach/interfaces/ICrudConfig.js.gz +0 -0
  143. package/dist/collection/components/snk-attach/interfaces/TFetcherType.js.gz +0 -0
  144. package/dist/collection/components/snk-attach/interfaces/index.js.gz +0 -0
  145. package/dist/collection/components/snk-attach/snk-attach.css.gz +0 -0
  146. package/dist/collection/components/snk-attach/snk-attach.js.gz +0 -0
  147. package/dist/collection/components/snk-attach/structure/builder/anexo-sistema-crud-config.builder.js.gz +0 -0
  148. package/dist/collection/components/snk-attach/structure/builder/attach-crud-config.builder.js.gz +0 -0
  149. package/dist/collection/components/snk-attach/structure/builder/taskbar-builder.js.gz +0 -0
  150. package/dist/collection/components/snk-attach/structure/fetcher/facade/fetcher.facade.js.gz +0 -0
  151. package/dist/collection/components/snk-attach/structure/fetcher/factory/anexo-sistema-data-unit.factory.js.gz +0 -0
  152. package/dist/collection/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.js.gz +0 -0
  153. package/dist/collection/components/snk-attach/structure/index.js.gz +0 -0
  154. package/dist/collection/components/snk-configurator/AuthorizationConfig.js.gz +0 -0
  155. package/dist/collection/components/snk-configurator/snk-configurator.css.gz +0 -0
  156. package/dist/collection/components/snk-configurator/snk-configurator.js.gz +0 -0
  157. package/dist/collection/components/snk-crud/interfaces/PropsCustomEditor.js.gz +0 -0
  158. package/dist/collection/components/snk-crud/interfaces/PropsCustomRender.js.gz +0 -0
  159. package/dist/collection/components/snk-crud/snk-crud.css.gz +0 -0
  160. package/dist/collection/components/snk-crud/snk-crud.js.gz +0 -0
  161. package/dist/collection/components/snk-crud/subcomponents/CardFormResizeObserver.js.gz +0 -0
  162. package/dist/collection/components/snk-crud/subcomponents/GuideBuilder.js.gz +0 -0
  163. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.css.gz +0 -0
  164. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js.gz +0 -0
  165. package/dist/collection/components/snk-crud/subcomponents/snk-form-summary.css.gz +0 -0
  166. package/dist/collection/components/snk-crud/subcomponents/snk-form-summary.js.gz +0 -0
  167. package/dist/collection/components/snk-crud/subcomponents/snk-form-view.css.gz +0 -0
  168. package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js.gz +0 -0
  169. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.css.gz +0 -0
  170. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js.gz +0 -0
  171. package/dist/collection/components/snk-custom-slot-elements/snk-custom-slot-elements.css.gz +0 -0
  172. package/dist/collection/components/snk-custom-slot-elements/snk-custom-slot-elements.js.gz +0 -0
  173. package/dist/collection/components/snk-data-exporter/data/attachment.js.gz +0 -0
  174. package/dist/collection/components/snk-data-exporter/data/email.js.gz +0 -0
  175. package/dist/collection/components/snk-data-exporter/data/export-config.js.gz +0 -0
  176. package/dist/collection/components/snk-data-exporter/data/export-result.js.gz +0 -0
  177. package/dist/collection/components/snk-data-exporter/data/report.js.gz +0 -0
  178. package/dist/collection/components/snk-data-exporter/exporter-email-sender/email-info-step.js.gz +0 -0
  179. package/dist/collection/components/snk-data-exporter/exporter-email-sender/options-step.js.gz +0 -0
  180. package/dist/collection/components/snk-data-exporter/exporter-email-sender/snk-exporter-email-sender.js.gz +0 -0
  181. package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js.gz +0 -0
  182. package/dist/collection/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.js.gz +0 -0
  183. package/dist/collection/components/snk-data-exporter/interfaces/IExporterProvider.js.gz +0 -0
  184. package/dist/collection/components/snk-data-exporter/interfaces/IExporterStrategy.js.gz +0 -0
  185. package/dist/collection/components/snk-data-exporter/interfaces/IRecordID.js.gz +0 -0
  186. package/dist/collection/components/snk-data-exporter/interfaces/ISelectedID.js.gz +0 -0
  187. package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js.gz +0 -0
  188. package/dist/collection/components/snk-data-exporter/providers/ServerSideExporterProvider.js.gz +0 -0
  189. package/dist/collection/components/snk-data-exporter/snk-data-exporter.css.gz +0 -0
  190. package/dist/collection/components/snk-data-exporter/snk-data-exporter.js.gz +0 -0
  191. package/dist/collection/components/snk-data-exporter/structure/ItemBuilder.js.gz +0 -0
  192. package/dist/collection/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.js.gz +0 -0
  193. package/dist/collection/components/snk-data-exporter/utils/ParserExport.js.gz +0 -0
  194. package/dist/collection/components/snk-data-unit/MultipleUpdateHelper.js.gz +0 -0
  195. package/dist/collection/components/snk-data-unit/snk-data-unit.js.gz +0 -0
  196. package/dist/collection/components/snk-data-unit/test/resources/metadataMock.js.gz +0 -0
  197. package/dist/collection/components/snk-data-unit/test/resources/parentMetadataMock.js.gz +0 -0
  198. package/dist/collection/components/snk-entity-list/snk-entity-list.css.gz +0 -0
  199. package/dist/collection/components/snk-entity-list/snk-entity-list.js.gz +0 -0
  200. package/dist/collection/components/snk-filter-bar/filter-item/dataunitfilter/data-unit-filter-builder.js.gz +0 -0
  201. package/dist/collection/components/snk-filter-bar/filter-item/editors/enum/filterNumberVariation.js.gz +0 -0
  202. package/dist/collection/components/snk-filter-bar/filter-item/editors/enum/presentationMode.js.gz +0 -0
  203. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.js.gz +0 -0
  204. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-checkbox-list.js.gz +0 -0
  205. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.js.gz +0 -0
  206. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js +1 -1
  207. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js.gz +0 -0
  208. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js +11 -6
  209. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js.gz +0 -0
  210. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-search.js.gz +0 -0
  211. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js +1 -1
  212. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js.gz +0 -0
  213. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-personalized-filter-editor/snk-personalized-filter-editor.css.gz +0 -0
  214. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-personalized-filter-editor/snk-personalized-filter-editor.js.gz +0 -0
  215. package/dist/collection/components/snk-filter-bar/filter-item/filter-item-type-mask.enum.js.gz +0 -0
  216. package/dist/collection/components/snk-filter-bar/filter-item/filter-item-type.enum.js.gz +0 -0
  217. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js.gz +0 -0
  218. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.css.gz +0 -0
  219. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +4 -0
  220. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js.gz +0 -0
  221. package/dist/collection/components/snk-filter-bar/filter-list/snk-filter-list.js.gz +0 -0
  222. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.css.gz +0 -0
  223. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +9 -1
  224. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js.gz +0 -0
  225. package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-default-filter/snk-default-filter.css.gz +0 -0
  226. package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-default-filter/snk-default-filter.js.gz +0 -0
  227. package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.css.gz +0 -0
  228. package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js.gz +0 -0
  229. package/dist/collection/components/snk-filter-bar/snk-filter-bar.css.gz +0 -0
  230. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +12 -3
  231. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js.gz +0 -0
  232. package/dist/collection/components/snk-filter-bar/types/custom-element-filter.js.gz +0 -0
  233. package/dist/collection/components/snk-filter-bar/types/default-filters.js.gz +0 -0
  234. package/dist/collection/components/snk-filter-bar/types/filter-type.enum.js.gz +0 -0
  235. package/dist/collection/components/snk-filter-bar/utils/SnkFilterModalFactory.js.gz +0 -0
  236. package/dist/collection/components/snk-filter-bar/utils/filter-validate.js.gz +0 -0
  237. package/dist/collection/components/snk-filter-bar/utils/filters-mock.js.gz +0 -0
  238. package/dist/collection/components/snk-filter-field-search/interfaces/index.js.gz +0 -0
  239. package/dist/collection/components/snk-filter-field-search/snk-filter-field-search.css.gz +0 -0
  240. package/dist/collection/components/snk-filter-field-search/snk-filter-field-search.js.gz +0 -0
  241. package/dist/collection/components/snk-filter-field-search/subcomponents/index.js.gz +0 -0
  242. package/dist/collection/components/snk-filter-field-search/subcomponents/list-item.js.gz +0 -0
  243. package/dist/collection/components/snk-form/snk-form.css.gz +0 -0
  244. package/dist/collection/components/snk-form/snk-form.js.gz +0 -0
  245. package/dist/collection/components/snk-form-config/FormConfigHelper.js.gz +0 -0
  246. package/dist/collection/components/snk-form-config/SnkFormConfigManager.js.gz +0 -0
  247. package/dist/collection/components/snk-form-config/config-header/config-header.css.gz +0 -0
  248. package/dist/collection/components/snk-form-config/config-header/config-header.js.gz +0 -0
  249. package/dist/collection/components/snk-form-config/config-header/configs-button/configs-button.css.gz +0 -0
  250. package/dist/collection/components/snk-form-config/config-header/configs-button/configs-button.js.gz +0 -0
  251. package/dist/collection/components/snk-form-config/field-item/field-config/field-config.css.gz +0 -0
  252. package/dist/collection/components/snk-form-config/field-item/field-config/field-config.js.gz +0 -0
  253. package/dist/collection/components/snk-form-config/field-item/field-item.css.gz +0 -0
  254. package/dist/collection/components/snk-form-config/field-item/field-item.js.gz +0 -0
  255. package/dist/collection/components/snk-form-config/fields-layout/fields-layout.css.gz +0 -0
  256. package/dist/collection/components/snk-form-config/fields-layout/fields-layout.js.gz +0 -0
  257. package/dist/collection/components/snk-form-config/fields-selector/fields-selector.css.gz +0 -0
  258. package/dist/collection/components/snk-form-config/fields-selector/fields-selector.js.gz +0 -0
  259. package/dist/collection/components/snk-form-config/guides-configurator/guides-configurator.css.gz +0 -0
  260. package/dist/collection/components/snk-form-config/guides-configurator/guides-configurator.js.gz +0 -0
  261. package/dist/collection/components/snk-form-config/snk-form-config.css.gz +0 -0
  262. package/dist/collection/components/snk-form-config/snk-form-config.js.gz +0 -0
  263. package/dist/collection/components/snk-grid/filtercolumn/SnkMultiSelectionListDataSource.js.gz +0 -0
  264. package/dist/collection/components/snk-grid/snk-grid.css.gz +0 -0
  265. package/dist/collection/components/snk-grid/snk-grid.js.gz +0 -0
  266. package/dist/collection/components/snk-grid-config/snk-grid-config.css.gz +0 -0
  267. package/dist/collection/components/snk-grid-config/snk-grid-config.js.gz +0 -0
  268. package/dist/collection/components/snk-grid-config/snk-select-box/snk-select-box.css.gz +0 -0
  269. package/dist/collection/components/snk-grid-config/snk-select-box/snk-select-box.js.gz +0 -0
  270. package/dist/collection/components/snk-layout-form-config/snk-layout-form-config.css.gz +0 -0
  271. package/dist/collection/components/snk-layout-form-config/snk-layout-form-config.js.gz +0 -0
  272. package/dist/collection/components/snk-layout-form-config/snk-view-representation/snk-view-representation.css.gz +0 -0
  273. package/dist/collection/components/snk-layout-form-config/snk-view-representation/snk-view-representation.js.gz +0 -0
  274. package/dist/collection/components/snk-personalized-filter/interfaces/IExpressionGroup.js.gz +0 -0
  275. package/dist/collection/components/snk-personalized-filter/interfaces/IExpressionItem.js.gz +0 -0
  276. package/dist/collection/components/snk-personalized-filter/interfaces/IParameter.js.gz +0 -0
  277. package/dist/collection/components/snk-personalized-filter/interfaces/IPersonalizedFilter.js.gz +0 -0
  278. package/dist/collection/components/snk-personalized-filter/interfaces/ISystemFilterConfig.js.gz +0 -0
  279. package/dist/collection/components/snk-personalized-filter/interfaces/IUserFilterConfig.js.gz +0 -0
  280. package/dist/collection/components/snk-personalized-filter/interfaces/index.js.gz +0 -0
  281. package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.css.gz +0 -0
  282. package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js.gz +0 -0
  283. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-group/snk-expression-group.css.gz +0 -0
  284. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-group/snk-expression-group.js.gz +0 -0
  285. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/filter-operands/filter-operands.js.gz +0 -0
  286. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.css.gz +0 -0
  287. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.js.gz +0 -0
  288. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-advanced-mode/snk-filter-advanced-mode.css.gz +0 -0
  289. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-advanced-mode/snk-filter-advanced-mode.js.gz +0 -0
  290. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-assistent-mode/snk-filter-assistent-mode.css.gz +0 -0
  291. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-assistent-mode/snk-filter-assistent-mode.js.gz +0 -0
  292. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/snk-filter-param-config.css.gz +0 -0
  293. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/snk-filter-param-config.js.gz +0 -0
  294. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/utils/PersonalizedFilterUtils.js.gz +0 -0
  295. package/dist/collection/components/snk-pesquisa/pesquisa-grid/pesquisa-grid.css.gz +0 -0
  296. package/dist/collection/components/snk-pesquisa/pesquisa-grid/pesquisa-grid.js.gz +0 -0
  297. package/dist/collection/components/snk-pesquisa/pesquisa-tree/pesquisa-tree.css.gz +0 -0
  298. package/dist/collection/components/snk-pesquisa/pesquisa-tree/pesquisa-tree.js.gz +0 -0
  299. package/dist/collection/components/snk-pesquisa/pesquisaHelper.js.gz +0 -0
  300. package/dist/collection/components/snk-pesquisa/snk-pesquisa.css.gz +0 -0
  301. package/dist/collection/components/snk-pesquisa/snk-pesquisa.js.gz +0 -0
  302. package/dist/collection/components/snk-print-selector/snk-print-selector.css.gz +0 -0
  303. package/dist/collection/components/snk-print-selector/snk-print-selector.js.gz +0 -0
  304. package/dist/collection/components/snk-simple-bar/snk-simple-bar.css.gz +0 -0
  305. package/dist/collection/components/snk-simple-bar/snk-simple-bar.js.gz +0 -0
  306. package/dist/collection/components/snk-simple-crud/snk-simple-crud.constants.js.gz +0 -0
  307. package/dist/collection/components/snk-simple-crud/snk-simple-crud.css.gz +0 -0
  308. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js.gz +0 -0
  309. package/dist/collection/components/snk-simple-form-config/snk-simple-form-config.css.gz +0 -0
  310. package/dist/collection/components/snk-simple-form-config/snk-simple-form-config.js.gz +0 -0
  311. package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.css.gz +0 -0
  312. package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.js.gz +0 -0
  313. package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js.gz +0 -0
  314. package/dist/collection/components/snk-taskbar/elements/taskbar-split-button/taskbar-split-button.css.gz +0 -0
  315. package/dist/collection/components/snk-taskbar/elements/taskbar-split-button/taskbar-split-button.js.gz +0 -0
  316. package/dist/collection/components/snk-taskbar/processor/taskbar-processor.js.gz +0 -0
  317. package/dist/collection/components/snk-taskbar/snk-taskbar.css.gz +0 -0
  318. package/dist/collection/components/snk-taskbar/snk-taskbar.js.gz +0 -0
  319. package/dist/collection/components/teste-pesquisa/teste-pesquisa.css.gz +0 -0
  320. package/dist/collection/components/teste-pesquisa/teste-pesquisa.js.gz +0 -0
  321. package/dist/collection/index.js.gz +0 -0
  322. package/dist/collection/lib/@types/index.js.gz +0 -0
  323. package/dist/collection/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.js.gz +0 -0
  324. package/dist/collection/lib/applet-caller/applet-caller.js.gz +0 -0
  325. package/dist/collection/lib/auth/mgeauthorization.module.js.gz +0 -0
  326. package/dist/collection/lib/configs/ConfigStorage.js.gz +0 -0
  327. package/dist/collection/lib/configs/LayoutFormConfig.js.gz +0 -0
  328. package/dist/collection/lib/dataUnit/InMemoryLoader.js.gz +0 -0
  329. package/dist/collection/lib/dataUnit/ValueFormatter.js.gz +0 -0
  330. package/dist/collection/lib/dataUnit/dataUnitInMemoryUtils.js.gz +0 -0
  331. package/dist/collection/lib/dataUnit/interfaces/InMemoryLoaderConfig.js.gz +0 -0
  332. package/dist/collection/lib/http/data-fetcher/DataFetcher.js.gz +0 -0
  333. package/dist/collection/lib/http/data-fetcher/custom-xhr-override.js.gz +0 -0
  334. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/anexo-sistema-fetcher.js.gz +0 -0
  335. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/attach-fetcher.js.gz +0 -0
  336. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/facade/attach-fetcher.facade.js.gz +0 -0
  337. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/index.js.gz +0 -0
  338. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/IDelete.js.gz +0 -0
  339. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/IDownloadKey.js.gz +0 -0
  340. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/ISave.js.gz +0 -0
  341. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/index.js.gz +0 -0
  342. package/dist/collection/lib/http/data-fetcher/fetchers/application-config-fetcher.js.gz +0 -0
  343. package/dist/collection/lib/http/data-fetcher/fetchers/auth-fetcher.js.gz +0 -0
  344. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.js.gz +0 -0
  345. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.js.gz +0 -0
  346. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.js.gz +0 -0
  347. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.js.gz +0 -0
  348. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/helpers/DataUnitDataLoaderHelper.js.gz +0 -0
  349. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IBuildRequestBodyLoadRowMetadata.js.gz +0 -0
  350. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadDataResult.js.gz +0 -0
  351. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadDataStrategy.js.gz +0 -0
  352. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadingInfo.js.gz +0 -0
  353. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRecordField.js.gz +0 -0
  354. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IResponseRecord.js.gz +0 -0
  355. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRowMetadata.js.gz +0 -0
  356. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DataUnitStrategy.js.gz +0 -0
  357. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js.gz +0 -0
  358. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/test/resources/metadataMock.js.gz +0 -0
  359. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IExporterColumnMetadata.js.gz +0 -0
  360. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams.js.gz +0 -0
  361. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterResponse.js.gz +0 -0
  362. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IPersonalizedReport.js.gz +0 -0
  363. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/permission-export-pdf.js.gz +0 -0
  364. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/personalized-reports-fetcher.js.gz +0 -0
  365. package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js.gz +0 -0
  366. package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js.gz +0 -0
  367. package/dist/collection/lib/http/data-fetcher/fetchers/grid-config-fetcher.js.gz +0 -0
  368. package/dist/collection/lib/http/data-fetcher/fetchers/parameters-fecher.js.gz +0 -0
  369. package/dist/collection/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.js.gz +0 -0
  370. package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js.gz +0 -0
  371. package/dist/collection/lib/http/data-fetcher/fetchers/resource-fetcher.js.gz +0 -0
  372. package/dist/collection/lib/http/data-fetcher/fetchers/totals-fetcher.js.gz +0 -0
  373. package/dist/collection/lib/http/data-fetcher/interfaces/IClientEventResponse.js.gz +0 -0
  374. package/dist/collection/lib/http/data-fetcher/recaller/GraphQLRecaller.js.gz +0 -0
  375. package/dist/collection/lib/http/data-fetcher/recaller/IDataFetcherRecaller.js.gz +0 -0
  376. package/dist/collection/lib/http/data-fetcher/recaller/ServiceBrokerRecaller.js.gz +0 -0
  377. package/dist/collection/lib/http/data-fetcher/state/LoadStateManager.js.gz +0 -0
  378. package/dist/collection/lib/index.js.gz +0 -0
  379. package/dist/collection/lib/message/SnkMessageBuilder.js +11 -2
  380. package/dist/collection/lib/message/SnkMessageBuilder.js.gz +0 -0
  381. package/dist/collection/lib/message/messageResourceEnUSUtils.js.gz +0 -0
  382. package/dist/collection/lib/message/messageResourceEsESUtils.js.gz +0 -0
  383. package/dist/collection/lib/message/messageResourcePtBRUtils.js.gz +0 -0
  384. package/dist/collection/lib/message/resources/en-us/continuousInsertUtils.msg.js.gz +0 -0
  385. package/dist/collection/lib/message/resources/en-us/crud-utils.msg.js.gz +0 -0
  386. package/dist/collection/lib/message/resources/en-us/dataFetcher.msg.js.gz +0 -0
  387. package/dist/collection/lib/message/resources/en-us/dataUnitDataLoaderHelper.msg.js.gz +0 -0
  388. package/dist/collection/lib/message/resources/en-us/file-viewer.msg.js.gz +0 -0
  389. package/dist/collection/lib/message/resources/en-us/snk-actions-button.msg.js.gz +0 -0
  390. package/dist/collection/lib/message/resources/en-us/snk-application.msg.js.gz +0 -0
  391. package/dist/collection/lib/message/resources/en-us/snk-attach.msg.js.gz +0 -0
  392. package/dist/collection/lib/message/resources/en-us/snk-configurator.msg.js.gz +0 -0
  393. package/dist/collection/lib/message/resources/en-us/snk-crud.msg.js.gz +0 -0
  394. package/dist/collection/lib/message/resources/en-us/snk-data-exporter.msg.js.gz +0 -0
  395. package/dist/collection/lib/message/resources/en-us/snk-data-unit.msg.js.gz +0 -0
  396. package/dist/collection/lib/message/resources/en-us/snk-entity-list.msg.js.gz +0 -0
  397. package/dist/collection/lib/message/resources/en-us/snk-error-handler.msg.js.gz +0 -0
  398. package/dist/collection/lib/message/resources/en-us/snk-exporter.msg.js.gz +0 -0
  399. package/dist/collection/lib/message/resources/en-us/snk-filter-bar.msg.js.gz +0 -0
  400. package/dist/collection/lib/message/resources/en-us/snk-filter-field-search.msg.js.gz +0 -0
  401. package/dist/collection/lib/message/resources/en-us/snk-filter-list.msg.js.gz +0 -0
  402. package/dist/collection/lib/message/resources/en-us/snk-filter-param-config.msg.js.gz +0 -0
  403. package/dist/collection/lib/message/resources/en-us/snk-form.msg.js.gz +0 -0
  404. package/dist/collection/lib/message/resources/en-us/snk-grid.msg.js.gz +0 -0
  405. package/dist/collection/lib/message/resources/en-us/snk-layout-form-config.msg.js.gz +0 -0
  406. package/dist/collection/lib/message/resources/en-us/snk-personalized-filter.msg.js.gz +0 -0
  407. package/dist/collection/lib/message/resources/en-us/snk-pesquisa.msg.js.gz +0 -0
  408. package/dist/collection/lib/message/resources/en-us/snk-print-selector.msg.js.gz +0 -0
  409. package/dist/collection/lib/message/resources/en-us/snk-simple-bar.msg.js.gz +0 -0
  410. package/dist/collection/lib/message/resources/en-us/snk-simple-crud.msg.js.gz +0 -0
  411. package/dist/collection/lib/message/resources/en-us/snk-simple-form-config.msg.js.gz +0 -0
  412. package/dist/collection/lib/message/resources/en-us/snk-taskbar.msg.js.gz +0 -0
  413. package/dist/collection/lib/message/resources/es-es/continuousInsertUtils.msg.js.gz +0 -0
  414. package/dist/collection/lib/message/resources/es-es/crud-utils.msg.js.gz +0 -0
  415. package/dist/collection/lib/message/resources/es-es/dataFetcher.msg.js.gz +0 -0
  416. package/dist/collection/lib/message/resources/es-es/dataUnitDataLoaderHelper.msg.js.gz +0 -0
  417. package/dist/collection/lib/message/resources/es-es/file-viewer.msg.js.gz +0 -0
  418. package/dist/collection/lib/message/resources/es-es/snk-actions-button.msg.js.gz +0 -0
  419. package/dist/collection/lib/message/resources/es-es/snk-application.msg.js.gz +0 -0
  420. package/dist/collection/lib/message/resources/es-es/snk-attach.msg.js.gz +0 -0
  421. package/dist/collection/lib/message/resources/es-es/snk-configurator.msg.js.gz +0 -0
  422. package/dist/collection/lib/message/resources/es-es/snk-crud.msg.js.gz +0 -0
  423. package/dist/collection/lib/message/resources/es-es/snk-data-exporter.msg.js.gz +0 -0
  424. package/dist/collection/lib/message/resources/es-es/snk-data-unit.msg.js.gz +0 -0
  425. package/dist/collection/lib/message/resources/es-es/snk-entity-list.msg.js.gz +0 -0
  426. package/dist/collection/lib/message/resources/es-es/snk-error-handler.msg.js.gz +0 -0
  427. package/dist/collection/lib/message/resources/es-es/snk-exporter.msg.js.gz +0 -0
  428. package/dist/collection/lib/message/resources/es-es/snk-filter-bar.msg.js.gz +0 -0
  429. package/dist/collection/lib/message/resources/es-es/snk-filter-field-search.msg.js.gz +0 -0
  430. package/dist/collection/lib/message/resources/es-es/snk-filter-list.msg.js.gz +0 -0
  431. package/dist/collection/lib/message/resources/es-es/snk-filter-param-config.msg.js.gz +0 -0
  432. package/dist/collection/lib/message/resources/es-es/snk-form.msg.js.gz +0 -0
  433. package/dist/collection/lib/message/resources/es-es/snk-grid.msg.js.gz +0 -0
  434. package/dist/collection/lib/message/resources/es-es/snk-layout-form-config.msg.js.gz +0 -0
  435. package/dist/collection/lib/message/resources/es-es/snk-personalized-filter.msg.js.gz +0 -0
  436. package/dist/collection/lib/message/resources/es-es/snk-pesquisa.msg.js.gz +0 -0
  437. package/dist/collection/lib/message/resources/es-es/snk-print-selector.msg.js.gz +0 -0
  438. package/dist/collection/lib/message/resources/es-es/snk-simple-bar.msg.js.gz +0 -0
  439. package/dist/collection/lib/message/resources/es-es/snk-simple-crud.msg.js.gz +0 -0
  440. package/dist/collection/lib/message/resources/es-es/snk-simple-form-config.msg.js.gz +0 -0
  441. package/dist/collection/lib/message/resources/es-es/snk-taskbar.msg.js.gz +0 -0
  442. package/dist/collection/lib/message/resources/pt-br/continuousInsertUtils.msg.js.gz +0 -0
  443. package/dist/collection/lib/message/resources/pt-br/crud-utils.msg.js.gz +0 -0
  444. package/dist/collection/lib/message/resources/pt-br/dataFetcher.msg.js.gz +0 -0
  445. package/dist/collection/lib/message/resources/pt-br/dataUnitDataLoaderHelper.msg.js.gz +0 -0
  446. package/dist/collection/lib/message/resources/pt-br/file-viewer.msg.js.gz +0 -0
  447. package/dist/collection/lib/message/resources/pt-br/snk-actions-button.msg.js.gz +0 -0
  448. package/dist/collection/lib/message/resources/pt-br/snk-application.msg.js.gz +0 -0
  449. package/dist/collection/lib/message/resources/pt-br/snk-attach.msg.js.gz +0 -0
  450. package/dist/collection/lib/message/resources/pt-br/snk-configurator.msg.js.gz +0 -0
  451. package/dist/collection/lib/message/resources/pt-br/snk-crud.msg.js.gz +0 -0
  452. package/dist/collection/lib/message/resources/pt-br/snk-data-exporter.msg.js.gz +0 -0
  453. package/dist/collection/lib/message/resources/pt-br/snk-data-unit.msg.js.gz +0 -0
  454. package/dist/collection/lib/message/resources/pt-br/snk-entity-list.msg.js.gz +0 -0
  455. package/dist/collection/lib/message/resources/pt-br/snk-error-handler.msg.js.gz +0 -0
  456. package/dist/collection/lib/message/resources/pt-br/snk-exporter.msg.js.gz +0 -0
  457. package/dist/collection/lib/message/resources/pt-br/snk-filter-bar.msg.js.gz +0 -0
  458. package/dist/collection/lib/message/resources/pt-br/snk-filter-field-search.msg.js.gz +0 -0
  459. package/dist/collection/lib/message/resources/pt-br/snk-filter-list.msg.js.gz +0 -0
  460. package/dist/collection/lib/message/resources/pt-br/snk-filter-param-config.msg.js.gz +0 -0
  461. package/dist/collection/lib/message/resources/pt-br/snk-form.msg.js.gz +0 -0
  462. package/dist/collection/lib/message/resources/pt-br/snk-grid.msg.js.gz +0 -0
  463. package/dist/collection/lib/message/resources/pt-br/snk-layout-form-config.msg.js.gz +0 -0
  464. package/dist/collection/lib/message/resources/pt-br/snk-personalized-filter.msg.js.gz +0 -0
  465. package/dist/collection/lib/message/resources/pt-br/snk-pesquisa.msg.js.gz +0 -0
  466. package/dist/collection/lib/message/resources/pt-br/snk-print-selector.msg.js.gz +0 -0
  467. package/dist/collection/lib/message/resources/pt-br/snk-simple-bar.msg.js.gz +0 -0
  468. package/dist/collection/lib/message/resources/pt-br/snk-simple-crud.msg.js.gz +0 -0
  469. package/dist/collection/lib/message/resources/pt-br/snk-simple-form-config.msg.js.gz +0 -0
  470. package/dist/collection/lib/message/resources/pt-br/snk-taskbar.msg.js.gz +0 -0
  471. package/dist/collection/lib/resourceid/ResourceIDUtils.js.gz +0 -0
  472. package/dist/collection/lib/store/index.js.gz +0 -0
  473. package/dist/collection/lib/utils/ContinuousInsertUtils.js.gz +0 -0
  474. package/dist/collection/lib/utils/CrudUtils.js.gz +0 -0
  475. package/dist/collection/lib/utils/GetSelectedRecordsIDsInfo.js.gz +0 -0
  476. package/dist/collection/lib/utils/PrintUtils.js.gz +0 -0
  477. package/dist/collection/lib/utils/constants.js.gz +0 -0
  478. package/dist/collection/lib/utils/fileViewer/index.js.gz +0 -0
  479. package/dist/collection/lib/utils/fileViewer/interfaces/IFileViewerParams.js.gz +0 -0
  480. package/dist/collection/lib/utils/pesquisa.js.gz +0 -0
  481. package/dist/collection/lib/utils/urlutils.js.gz +0 -0
  482. package/dist/collection/lib/workspace/workspace.js.gz +0 -0
  483. package/dist/collection/sw.js.gz +0 -0
  484. package/dist/components/AuthorizationConfig.js.gz +0 -0
  485. package/dist/components/ConfigStorage.js.gz +0 -0
  486. package/dist/components/ContinuousInsertUtils.js.gz +0 -0
  487. package/dist/components/DataFetcher.js +11 -2
  488. package/dist/components/DataFetcher.js.gz +0 -0
  489. package/dist/components/GetSelectedRecordsIDsInfo.js.gz +0 -0
  490. package/dist/components/ISave.js.gz +0 -0
  491. package/dist/components/ParamType.js.gz +0 -0
  492. package/dist/components/PersonalizedFilterUtils.js.gz +0 -0
  493. package/dist/components/PrintUtils.js.gz +0 -0
  494. package/dist/components/ResourceIDUtils.js.gz +0 -0
  495. package/dist/components/SnkFormConfigManager.js.gz +0 -0
  496. package/dist/components/auth-fetcher.js.gz +0 -0
  497. package/dist/components/config-header.js.gz +0 -0
  498. package/dist/components/config-header2.js.gz +0 -0
  499. package/dist/components/configs-button.js.gz +0 -0
  500. package/dist/components/configs-button2.js.gz +0 -0
  501. package/dist/components/constants.js.gz +0 -0
  502. package/dist/components/dataunit-fetcher.js.gz +0 -0
  503. package/dist/components/field-config.js.gz +0 -0
  504. package/dist/components/field-config2.js.gz +0 -0
  505. package/dist/components/field-item.js.gz +0 -0
  506. package/dist/components/field-item2.js.gz +0 -0
  507. package/dist/components/fields-layout.js.gz +0 -0
  508. package/dist/components/fields-layout2.js.gz +0 -0
  509. package/dist/components/fields-selector.js.gz +0 -0
  510. package/dist/components/fields-selector2.js.gz +0 -0
  511. package/dist/components/filter-item-type.enum.js.gz +0 -0
  512. package/dist/components/filterNumberVariation.js.gz +0 -0
  513. package/dist/components/form-config-fetcher.js.gz +0 -0
  514. package/dist/components/guides-configurator.js.gz +0 -0
  515. package/dist/components/guides-configurator2.js.gz +0 -0
  516. package/dist/components/index.js.gz +0 -0
  517. package/dist/components/index2.js.gz +0 -0
  518. package/dist/components/pesquisa-grid.js.gz +0 -0
  519. package/dist/components/pesquisa-grid2.js.gz +0 -0
  520. package/dist/components/pesquisa-tree.js.gz +0 -0
  521. package/dist/components/pesquisa-tree2.js.gz +0 -0
  522. package/dist/components/presentationMode.js.gz +0 -0
  523. package/dist/components/snk-actions-button.js.gz +0 -0
  524. package/dist/components/snk-actions-button2.js.gz +0 -0
  525. package/dist/components/snk-actions-form.js.gz +0 -0
  526. package/dist/components/snk-application.js.gz +0 -0
  527. package/dist/components/snk-application2.js.gz +0 -0
  528. package/dist/components/snk-attach.js.gz +0 -0
  529. package/dist/components/snk-attach2.js.gz +0 -0
  530. package/dist/components/snk-client-confirm.js.gz +0 -0
  531. package/dist/components/snk-configurator.js.gz +0 -0
  532. package/dist/components/snk-configurator2.js.gz +0 -0
  533. package/dist/components/snk-crud.js.gz +0 -0
  534. package/dist/components/snk-custom-slot-elements.js.gz +0 -0
  535. package/dist/components/snk-data-exporter.js.gz +0 -0
  536. package/dist/components/snk-data-exporter2.js.gz +0 -0
  537. package/dist/components/snk-data-unit.js.gz +0 -0
  538. package/dist/components/snk-data-unit2.js.gz +0 -0
  539. package/dist/components/snk-default-filter.js.gz +0 -0
  540. package/dist/components/snk-default-filter2.js.gz +0 -0
  541. package/dist/components/snk-detail-view.js.gz +0 -0
  542. package/dist/components/snk-detail-view2.js.gz +0 -0
  543. package/dist/components/snk-entity-list.js.gz +0 -0
  544. package/dist/components/snk-exporter-email-sender.js.gz +0 -0
  545. package/dist/components/snk-exporter-email-sender2.js.gz +0 -0
  546. package/dist/components/snk-expression-group.js.gz +0 -0
  547. package/dist/components/snk-expression-group2.js.gz +0 -0
  548. package/dist/components/snk-expression-item.js.gz +0 -0
  549. package/dist/components/snk-expression-item2.js.gz +0 -0
  550. package/dist/components/snk-filter-advanced-mode.js.gz +0 -0
  551. package/dist/components/snk-filter-advanced-mode2.js.gz +0 -0
  552. package/dist/components/snk-filter-assistent-mode.js.gz +0 -0
  553. package/dist/components/snk-filter-assistent-mode2.js.gz +0 -0
  554. package/dist/components/snk-filter-bar.js.gz +0 -0
  555. package/dist/components/snk-filter-bar2.js +12 -3
  556. package/dist/components/snk-filter-bar2.js.gz +0 -0
  557. package/dist/components/snk-filter-binary-select.js.gz +0 -0
  558. package/dist/components/snk-filter-checkbox-list.js.gz +0 -0
  559. package/dist/components/snk-filter-detail.js.gz +0 -0
  560. package/dist/components/snk-filter-detail2.js.gz +0 -0
  561. package/dist/components/snk-filter-field-search.js.gz +0 -0
  562. package/dist/components/snk-filter-field-search2.js.gz +0 -0
  563. package/dist/components/snk-filter-item.js.gz +0 -0
  564. package/dist/components/snk-filter-item2.js +4 -0
  565. package/dist/components/snk-filter-item2.js.gz +0 -0
  566. package/dist/components/snk-filter-list.js.gz +0 -0
  567. package/dist/components/snk-filter-modal-item.js.gz +0 -0
  568. package/dist/components/snk-filter-modal-item2.js.gz +0 -0
  569. package/dist/components/snk-filter-modal.js.gz +0 -0
  570. package/dist/components/snk-filter-modal2.js +9 -2
  571. package/dist/components/snk-filter-modal2.js.gz +0 -0
  572. package/dist/components/snk-filter-multi-select.js.gz +0 -0
  573. package/dist/components/snk-filter-number.js +1 -1
  574. package/dist/components/snk-filter-number.js.gz +0 -0
  575. package/dist/components/snk-filter-param-config.js.gz +0 -0
  576. package/dist/components/snk-filter-param-config2.js.gz +0 -0
  577. package/dist/components/snk-filter-period.js +10 -5
  578. package/dist/components/snk-filter-period.js.gz +0 -0
  579. package/dist/components/snk-filter-search.js.gz +0 -0
  580. package/dist/components/snk-filter-text.js +1 -1
  581. package/dist/components/snk-filter-text.js.gz +0 -0
  582. package/dist/components/snk-form-config.js.gz +0 -0
  583. package/dist/components/snk-form-config2.js.gz +0 -0
  584. package/dist/components/snk-form-summary.js.gz +0 -0
  585. package/dist/components/snk-form-summary2.js.gz +0 -0
  586. package/dist/components/snk-form-view.js.gz +0 -0
  587. package/dist/components/snk-form-view2.js.gz +0 -0
  588. package/dist/components/snk-form.js.gz +0 -0
  589. package/dist/components/snk-grid-config.js.gz +0 -0
  590. package/dist/components/snk-grid-config2.js.gz +0 -0
  591. package/dist/components/snk-grid.js.gz +0 -0
  592. package/dist/components/snk-grid2.js.gz +0 -0
  593. package/dist/components/snk-guides-viewer.js.gz +0 -0
  594. package/dist/components/snk-layout-form-config.js.gz +0 -0
  595. package/dist/components/snk-layout-form-config2.js.gz +0 -0
  596. package/dist/components/snk-personalized-filter-editor.js.gz +0 -0
  597. package/dist/components/snk-personalized-filter.js.gz +0 -0
  598. package/dist/components/snk-personalized-filter2.js.gz +0 -0
  599. package/dist/components/snk-pesquisa.js.gz +0 -0
  600. package/dist/components/snk-pesquisa2.js.gz +0 -0
  601. package/dist/components/snk-print-selector.js.gz +0 -0
  602. package/dist/components/snk-select-box.js.gz +0 -0
  603. package/dist/components/snk-select-box2.js.gz +0 -0
  604. package/dist/components/snk-simple-bar.js.gz +0 -0
  605. package/dist/components/snk-simple-bar2.js.gz +0 -0
  606. package/dist/components/snk-simple-crud.js.gz +0 -0
  607. package/dist/components/snk-simple-crud2.js.gz +0 -0
  608. package/dist/components/snk-simple-form-config.js.gz +0 -0
  609. package/dist/components/snk-simple-form-config2.js.gz +0 -0
  610. package/dist/components/snk-taskbar.js.gz +0 -0
  611. package/dist/components/snk-taskbar2.js.gz +0 -0
  612. package/dist/components/snk-view-representation.js.gz +0 -0
  613. package/dist/components/snk-view-representation2.js.gz +0 -0
  614. package/dist/components/sortable.esm.js.gz +0 -0
  615. package/dist/components/taskbar-actions-button.js.gz +0 -0
  616. package/dist/components/taskbar-actions-button2.js.gz +0 -0
  617. package/dist/components/taskbar-split-button.js.gz +0 -0
  618. package/dist/components/taskbar-split-button2.js.gz +0 -0
  619. package/dist/components/teste-pesquisa.js.gz +0 -0
  620. package/dist/esm/AuthorizationConfig-dcbd207a.js.gz +0 -0
  621. package/dist/esm/{ConfigStorage-a60b12c2.js → ConfigStorage-4eee53da.js} +2 -2
  622. package/dist/esm/ConfigStorage-4eee53da.js.gz +0 -0
  623. package/dist/esm/{DataFetcher-9a1709a3.js → DataFetcher-955ee53e.js} +11 -2
  624. package/dist/esm/{DataFetcher-9a1709a3.js.gz → DataFetcher-955ee53e.js.gz} +0 -0
  625. package/dist/esm/FormConfigHelper-b9cf7758.js.gz +0 -0
  626. package/dist/esm/GetSelectedRecordsIDsInfo-9fa41508.js.gz +0 -0
  627. package/dist/esm/IFetchDataExporterParams-d73bed3d.js.gz +0 -0
  628. package/dist/esm/{ISave-b9c9188b.js → ISave-c8bf12c4.js} +1 -1
  629. package/dist/esm/ISave-c8bf12c4.js.gz +0 -0
  630. package/dist/esm/ParamType-d5152b06.js.gz +0 -0
  631. package/dist/esm/PersonalizedFilterUtils-2db38ff2.js.gz +0 -0
  632. package/dist/esm/PrintUtils-3e4ff0f5.js.gz +0 -0
  633. package/dist/esm/ResourceIDUtils-a114189a.js.gz +0 -0
  634. package/dist/esm/{SnkFormConfigManager-1548dc73.js → SnkFormConfigManager-28deba35.js} +2 -2
  635. package/dist/esm/SnkFormConfigManager-28deba35.js.gz +0 -0
  636. package/dist/esm/{SnkMultiSelectionListDataSource-65764464.js → SnkMultiSelectionListDataSource-c1c667f6.js} +4 -4
  637. package/dist/esm/SnkMultiSelectionListDataSource-c1c667f6.js.gz +0 -0
  638. package/dist/esm/{auth-fetcher-566bad7c.js → auth-fetcher-46872d79.js} +1 -1
  639. package/dist/esm/auth-fetcher-46872d79.js.gz +0 -0
  640. package/dist/esm/config-header.entry.js.gz +0 -0
  641. package/dist/esm/configs-button.entry.js.gz +0 -0
  642. package/dist/esm/constants-7b422de0.js.gz +0 -0
  643. package/dist/esm/{dataunit-fetcher-eba36247.js → dataunit-fetcher-9e63998f.js} +1 -1
  644. package/dist/esm/dataunit-fetcher-9e63998f.js.gz +0 -0
  645. package/dist/esm/default-filters-50105e43.js.gz +0 -0
  646. package/dist/esm/field-config_2.entry.js.gz +0 -0
  647. package/dist/esm/fields-layout.entry.js.gz +0 -0
  648. package/dist/esm/fields-selector.entry.js.gz +0 -0
  649. package/dist/esm/filter-item-type.enum-d45e026f.js.gz +0 -0
  650. package/dist/esm/filter-type.enum-f6a8fe23.js.gz +0 -0
  651. package/dist/esm/filter-validate-faf51fa9.js.gz +0 -0
  652. package/dist/esm/filterNumberVariation-8cee02ea.js.gz +0 -0
  653. package/dist/esm/{form-config-fetcher-cf8c52d0.js → form-config-fetcher-baa89098.js} +1 -1
  654. package/dist/esm/form-config-fetcher-baa89098.js.gz +0 -0
  655. package/dist/esm/guides-configurator.entry.js.gz +0 -0
  656. package/dist/esm/index-446f9341.js.gz +0 -0
  657. package/dist/esm/index-479e1293.js.gz +0 -0
  658. package/dist/esm/index-620ac460.js.gz +0 -0
  659. package/dist/esm/index-8acbae97.js.gz +0 -0
  660. package/dist/esm/index-b40568ff.js.gz +0 -0
  661. package/dist/esm/index.js.gz +0 -0
  662. package/dist/esm/loader.js.gz +0 -0
  663. package/dist/esm/pesquisa-grid_2.entry.js +4 -4
  664. package/dist/esm/pesquisa-grid_2.entry.js.gz +0 -0
  665. package/dist/esm/polyfills/core-js.js.gz +0 -0
  666. package/dist/esm/polyfills/css-shim.js.gz +0 -0
  667. package/dist/esm/polyfills/dom.js.gz +0 -0
  668. package/dist/esm/polyfills/es5-html-element.js.gz +0 -0
  669. package/dist/esm/polyfills/index.js.gz +0 -0
  670. package/dist/esm/polyfills/system.js.gz +0 -0
  671. package/dist/esm/presentationMode-783bbf9d.js.gz +0 -0
  672. package/dist/esm/sankhyablocks.js.gz +0 -0
  673. package/dist/esm/snk-actions-button_8.entry.js +5 -5
  674. package/dist/esm/snk-actions-button_8.entry.js.gz +0 -0
  675. package/dist/esm/snk-actions-form.entry.js.gz +0 -0
  676. package/dist/esm/snk-application.entry.js +6 -6
  677. package/dist/esm/snk-application.entry.js.gz +0 -0
  678. package/dist/esm/snk-attach.entry.js +5 -5
  679. package/dist/esm/snk-attach.entry.js.gz +0 -0
  680. package/dist/esm/snk-client-confirm.entry.js.gz +0 -0
  681. package/dist/esm/snk-configurator.entry.js.gz +0 -0
  682. package/dist/esm/snk-crud.entry.js +5 -5
  683. package/dist/esm/snk-crud.entry.js.gz +0 -0
  684. package/dist/esm/snk-custom-slot-elements.entry.js.gz +0 -0
  685. package/dist/esm/snk-data-exporter.entry.js +5 -5
  686. package/dist/esm/snk-data-exporter.entry.js.gz +0 -0
  687. package/dist/esm/{snk-data-unit-693849e3.js → snk-data-unit-d249d72b.js} +2 -2
  688. package/dist/esm/snk-data-unit-d249d72b.js.gz +0 -0
  689. package/dist/esm/snk-data-unit.entry.js +3 -3
  690. package/dist/esm/snk-data-unit.entry.js.gz +0 -0
  691. package/dist/esm/snk-default-filter.entry.js.gz +0 -0
  692. package/dist/esm/snk-detail-view.entry.js +7 -7
  693. package/dist/esm/snk-detail-view.entry.js.gz +0 -0
  694. package/dist/esm/snk-entity-list.entry.js.gz +0 -0
  695. package/dist/esm/snk-exporter-email-sender.entry.js.gz +0 -0
  696. package/dist/esm/snk-expression-group_2.entry.js.gz +0 -0
  697. package/dist/esm/snk-filter-advanced-mode_2.entry.js.gz +0 -0
  698. package/dist/esm/snk-filter-bar_4.entry.js +28 -8
  699. package/dist/esm/snk-filter-bar_4.entry.js.gz +0 -0
  700. package/dist/esm/snk-filter-binary-select.entry.js.gz +0 -0
  701. package/dist/esm/snk-filter-checkbox-list.entry.js.gz +0 -0
  702. package/dist/esm/snk-filter-detail.entry.js.gz +0 -0
  703. package/dist/esm/snk-filter-field-search_2.entry.js.gz +0 -0
  704. package/dist/esm/snk-filter-modal-item.entry.js +3 -3
  705. package/dist/esm/snk-filter-modal-item.entry.js.gz +0 -0
  706. package/dist/esm/snk-filter-multi-select.entry.js.gz +0 -0
  707. package/dist/esm/snk-filter-number.entry.js +1 -1
  708. package/dist/esm/snk-filter-number.entry.js.gz +0 -0
  709. package/dist/esm/snk-filter-period.entry.js +10 -5
  710. package/dist/esm/snk-filter-period.entry.js.gz +0 -0
  711. package/dist/esm/snk-filter-search.entry.js.gz +0 -0
  712. package/dist/esm/snk-filter-text.entry.js +1 -1
  713. package/dist/esm/snk-filter-text.entry.js.gz +0 -0
  714. package/dist/esm/snk-form-summary.entry.js.gz +0 -0
  715. package/dist/esm/snk-form-view.entry.js.gz +0 -0
  716. package/dist/esm/snk-form_2.entry.js +4 -4
  717. package/dist/esm/snk-form_2.entry.js.gz +0 -0
  718. package/dist/esm/snk-grid.entry.js +6 -6
  719. package/dist/esm/snk-grid.entry.js.gz +0 -0
  720. package/dist/esm/{snk-guides-viewer-8d6067b5.js → snk-guides-viewer-3566ae8b.js} +5 -5
  721. package/dist/esm/snk-guides-viewer-3566ae8b.js.gz +0 -0
  722. package/dist/esm/snk-guides-viewer.entry.js +7 -7
  723. package/dist/esm/snk-guides-viewer.entry.js.gz +0 -0
  724. package/dist/esm/snk-personalized-filter-editor.entry.js.gz +0 -0
  725. package/dist/esm/snk-personalized-filter.entry.js +3 -3
  726. package/dist/esm/snk-personalized-filter.entry.js.gz +0 -0
  727. package/dist/esm/snk-pesquisa.entry.js +4 -4
  728. package/dist/esm/snk-pesquisa.entry.js.gz +0 -0
  729. package/dist/esm/snk-print-selector.entry.js.gz +0 -0
  730. package/dist/esm/snk-simple-bar.entry.js.gz +0 -0
  731. package/dist/esm/snk-simple-crud.entry.js +7 -7
  732. package/dist/esm/snk-simple-crud.entry.js.gz +0 -0
  733. package/dist/esm/snk-taskbar.entry.js.gz +0 -0
  734. package/dist/esm/sortable.esm-842f85a3.js.gz +0 -0
  735. package/dist/esm/taskbar-elements-faaf5d8f.js.gz +0 -0
  736. package/dist/esm/taskbar-processor-3436124c.js.gz +0 -0
  737. package/dist/esm/teste-pesquisa.entry.js.gz +0 -0
  738. package/dist/index.cjs.js.gz +0 -0
  739. package/dist/index.js.gz +0 -0
  740. package/dist/sankhyablocks/index.esm.js.gz +0 -0
  741. package/dist/sankhyablocks/p-07c5289b.entry.js.gz +0 -0
  742. package/dist/sankhyablocks/p-0f3698af.js.gz +0 -0
  743. package/dist/sankhyablocks/{p-4e3fc788.entry.js → p-12433b48.entry.js} +1 -1
  744. package/dist/sankhyablocks/p-12433b48.entry.js.gz +0 -0
  745. package/dist/sankhyablocks/p-162bddae.entry.js.gz +0 -0
  746. package/dist/sankhyablocks/{p-13596651.js → p-16fa4019.js} +1 -1
  747. package/dist/sankhyablocks/p-16fa4019.js.gz +0 -0
  748. package/dist/sankhyablocks/p-180716b2.entry.js.gz +0 -0
  749. package/dist/sankhyablocks/p-1a0caadb.js.gz +0 -0
  750. package/dist/sankhyablocks/p-1a68fb59.js.gz +0 -0
  751. package/dist/sankhyablocks/p-1e9c546e.entry.js.gz +0 -0
  752. package/dist/sankhyablocks/p-21107f0d.entry.js.gz +0 -0
  753. package/dist/sankhyablocks/p-27482793.entry.js.gz +0 -0
  754. package/dist/sankhyablocks/p-279f1ef9.entry.js.gz +0 -0
  755. package/dist/sankhyablocks/p-2fdac5e6.entry.js.gz +0 -0
  756. package/dist/sankhyablocks/p-3b167a03.entry.js.gz +0 -0
  757. package/dist/sankhyablocks/p-3d41f5a8.entry.js.gz +0 -0
  758. package/dist/sankhyablocks/p-471b34f4.entry.js.gz +0 -0
  759. package/dist/sankhyablocks/p-49ddc27a.entry.js.gz +0 -0
  760. package/dist/sankhyablocks/p-51833248.js.gz +0 -0
  761. package/dist/sankhyablocks/p-5340c04e.entry.js.gz +0 -0
  762. package/dist/sankhyablocks/p-55798617.js.gz +0 -0
  763. package/dist/sankhyablocks/{p-69885aaa.js → p-5cbd073e.js} +1 -1
  764. package/dist/sankhyablocks/p-5cbd073e.js.gz +0 -0
  765. package/dist/sankhyablocks/p-60dd1d27.entry.js.gz +0 -0
  766. package/dist/sankhyablocks/p-667cab42.entry.js.gz +0 -0
  767. package/dist/sankhyablocks/{p-7b3269e9.entry.js → p-66816626.entry.js} +1 -1
  768. package/dist/sankhyablocks/p-66816626.entry.js.gz +0 -0
  769. package/dist/sankhyablocks/p-688dcb4c.js.gz +0 -0
  770. package/dist/sankhyablocks/p-6a1a7a57.entry.js +1 -0
  771. package/dist/sankhyablocks/p-6a1a7a57.entry.js.gz +0 -0
  772. package/dist/sankhyablocks/p-6a4b21dd.js.gz +0 -0
  773. package/dist/sankhyablocks/{p-6471a791.entry.js → p-6edad7b3.entry.js} +1 -1
  774. package/dist/sankhyablocks/p-6edad7b3.entry.js.gz +0 -0
  775. package/dist/sankhyablocks/p-7345782c.entry.js.gz +0 -0
  776. package/dist/sankhyablocks/p-75af335e.entry.js.gz +0 -0
  777. package/dist/sankhyablocks/p-76e66fd9.js.gz +0 -0
  778. package/dist/sankhyablocks/p-7dd49d15.js.gz +0 -0
  779. package/dist/sankhyablocks/p-7e250432.entry.js.gz +0 -0
  780. package/dist/sankhyablocks/{p-94b15408.entry.js → p-7e705f8d.entry.js} +1 -1
  781. package/dist/sankhyablocks/p-7e705f8d.entry.js.gz +0 -0
  782. package/dist/sankhyablocks/p-7f7fe6c4.entry.js.gz +0 -0
  783. package/dist/sankhyablocks/p-825098c1.entry.js.gz +0 -0
  784. package/dist/sankhyablocks/p-84345e7a.js.gz +0 -0
  785. package/dist/sankhyablocks/{p-febb03ba.entry.js → p-89a87cff.entry.js} +1 -1
  786. package/dist/sankhyablocks/p-89a87cff.entry.js.gz +0 -0
  787. package/dist/sankhyablocks/{p-02a710ad.entry.js → p-8ad83616.entry.js} +1 -1
  788. package/dist/sankhyablocks/p-8ad83616.entry.js.gz +0 -0
  789. package/dist/sankhyablocks/p-8d884fab.js.gz +0 -0
  790. package/dist/sankhyablocks/{p-9fa79997.js → p-8dd0b9ce.js} +1 -1
  791. package/dist/sankhyablocks/p-8dd0b9ce.js.gz +0 -0
  792. package/dist/sankhyablocks/p-8f3f2306.js.gz +0 -0
  793. package/dist/sankhyablocks/p-9019a32f.js.gz +0 -0
  794. package/dist/sankhyablocks/p-91a9abb6.entry.js.gz +0 -0
  795. package/dist/sankhyablocks/p-96d45943.entry.js.gz +0 -0
  796. package/dist/sankhyablocks/p-988afe78.js.gz +0 -0
  797. package/dist/sankhyablocks/p-98d47361.js +1 -0
  798. package/dist/sankhyablocks/p-98d47361.js.gz +0 -0
  799. package/dist/sankhyablocks/{p-093f58fa.entry.js → p-99a11017.entry.js} +1 -1
  800. package/dist/sankhyablocks/{p-093f58fa.entry.js.gz → p-99a11017.entry.js.gz} +0 -0
  801. package/dist/sankhyablocks/p-9a63f3f7.entry.js.gz +0 -0
  802. package/dist/sankhyablocks/{p-95888078.js → p-a42c27d6.js} +1 -1
  803. package/dist/sankhyablocks/p-a42c27d6.js.gz +0 -0
  804. package/dist/sankhyablocks/{p-4c763b10.entry.js → p-a9b16874.entry.js} +1 -1
  805. package/dist/sankhyablocks/p-a9b16874.entry.js.gz +0 -0
  806. package/dist/sankhyablocks/{p-ce77774e.js → p-b1df45e4.js} +1 -1
  807. package/dist/sankhyablocks/p-b1df45e4.js.gz +0 -0
  808. package/dist/sankhyablocks/{p-42dde1ec.js → p-b2212d20.js} +1 -1
  809. package/dist/sankhyablocks/{p-42dde1ec.js.gz → p-b2212d20.js.gz} +0 -0
  810. package/dist/sankhyablocks/p-b568c1d4.js.gz +0 -0
  811. package/dist/sankhyablocks/{p-bcf5692d.entry.js → p-b597b08c.entry.js} +1 -1
  812. package/dist/sankhyablocks/p-b597b08c.entry.js.gz +0 -0
  813. package/dist/sankhyablocks/p-b7e891cc.entry.js.gz +0 -0
  814. package/dist/sankhyablocks/p-b987e15d.js.gz +0 -0
  815. package/dist/sankhyablocks/p-bad09b65.entry.js +1 -0
  816. package/dist/sankhyablocks/p-bad09b65.entry.js.gz +0 -0
  817. package/dist/sankhyablocks/p-c3dbf441.entry.js.gz +0 -0
  818. package/dist/sankhyablocks/p-cb4343c4.entry.js.gz +0 -0
  819. package/dist/sankhyablocks/{p-4db51d85.js → p-d33a3955.js} +1 -1
  820. package/dist/sankhyablocks/p-d33a3955.js.gz +0 -0
  821. package/dist/sankhyablocks/p-d68904a9.js.gz +0 -0
  822. package/dist/sankhyablocks/p-d8d8169b.js.gz +0 -0
  823. package/dist/sankhyablocks/p-dc36cfbf.js.gz +0 -0
  824. package/dist/sankhyablocks/p-e258de96.entry.js.gz +0 -0
  825. package/dist/sankhyablocks/{p-81466555.entry.js → p-e3115c1f.entry.js} +1 -1
  826. package/dist/sankhyablocks/p-e3115c1f.entry.js.gz +0 -0
  827. package/dist/sankhyablocks/{p-dafee02c.entry.js → p-e364ce81.entry.js} +1 -1
  828. package/dist/sankhyablocks/p-e364ce81.entry.js.gz +0 -0
  829. package/dist/sankhyablocks/p-e679c75a.entry.js +1 -0
  830. package/dist/sankhyablocks/p-e679c75a.entry.js.gz +0 -0
  831. package/dist/sankhyablocks/{p-31b0d523.js → p-e6fe58b7.js} +1 -1
  832. package/dist/sankhyablocks/p-e6fe58b7.js.gz +0 -0
  833. package/dist/sankhyablocks/{p-3f8c436b.entry.js → p-e8c40258.entry.js} +1 -1
  834. package/dist/sankhyablocks/p-e8c40258.entry.js.gz +0 -0
  835. package/dist/sankhyablocks/{p-09b05075.entry.js → p-e991d196.entry.js} +1 -1
  836. package/dist/sankhyablocks/p-e991d196.entry.js.gz +0 -0
  837. package/dist/sankhyablocks/p-eaad0aa8.js.gz +0 -0
  838. package/dist/sankhyablocks/{p-4b286a64.entry.js → p-ee65a267.entry.js} +1 -1
  839. package/dist/sankhyablocks/p-ee65a267.entry.js.gz +0 -0
  840. package/dist/sankhyablocks/{p-4b2523df.js → p-f1855c53.js} +1 -1
  841. package/dist/sankhyablocks/p-f1855c53.js.gz +0 -0
  842. package/dist/sankhyablocks/p-f4184ce7.js.gz +0 -0
  843. package/dist/sankhyablocks/{p-6902c5ee.entry.js → p-f53694eb.entry.js} +1 -1
  844. package/dist/sankhyablocks/p-f53694eb.entry.js.gz +0 -0
  845. package/dist/sankhyablocks/p-fa80e546.js.gz +0 -0
  846. package/dist/sankhyablocks/{p-88c12985.entry.js → p-fc70f606.entry.js} +1 -1
  847. package/dist/sankhyablocks/p-fc70f606.entry.js.gz +0 -0
  848. package/dist/sankhyablocks/p-ff1990ad.js.gz +0 -0
  849. package/dist/sankhyablocks/p-ff52b422.entry.js.gz +0 -0
  850. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  851. package/dist/sankhyablocks/sankhyablocks.esm.js.gz +0 -0
  852. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-period.d.ts +1 -0
  853. package/package.json +1 -1
  854. package/dist/cjs/ConfigStorage-2b412ac9.js.gz +0 -0
  855. package/dist/cjs/DataFetcher-a1d986da.js.gz +0 -0
  856. package/dist/cjs/ISave-4c4f7231.js.gz +0 -0
  857. package/dist/cjs/SnkFormConfigManager-cfb6323a.js.gz +0 -0
  858. package/dist/cjs/SnkMultiSelectionListDataSource-99a82236.js.gz +0 -0
  859. package/dist/cjs/auth-fetcher-3dda805e.js.gz +0 -0
  860. package/dist/cjs/dataunit-fetcher-434d8c8d.js.gz +0 -0
  861. package/dist/cjs/form-config-fetcher-0e6f36d9.js.gz +0 -0
  862. package/dist/cjs/snk-data-unit-323a507f.js.gz +0 -0
  863. package/dist/cjs/snk-guides-viewer-57624b79.js.gz +0 -0
  864. package/dist/esm/ConfigStorage-a60b12c2.js.gz +0 -0
  865. package/dist/esm/ISave-b9c9188b.js.gz +0 -0
  866. package/dist/esm/SnkFormConfigManager-1548dc73.js.gz +0 -0
  867. package/dist/esm/SnkMultiSelectionListDataSource-65764464.js.gz +0 -0
  868. package/dist/esm/auth-fetcher-566bad7c.js.gz +0 -0
  869. package/dist/esm/dataunit-fetcher-eba36247.js.gz +0 -0
  870. package/dist/esm/form-config-fetcher-cf8c52d0.js.gz +0 -0
  871. package/dist/esm/snk-data-unit-693849e3.js.gz +0 -0
  872. package/dist/esm/snk-guides-viewer-8d6067b5.js.gz +0 -0
  873. package/dist/sankhyablocks/p-02a710ad.entry.js.gz +0 -0
  874. package/dist/sankhyablocks/p-09b05075.entry.js.gz +0 -0
  875. package/dist/sankhyablocks/p-13596651.js.gz +0 -0
  876. package/dist/sankhyablocks/p-2ec52b7e.entry.js +0 -1
  877. package/dist/sankhyablocks/p-2ec52b7e.entry.js.gz +0 -0
  878. package/dist/sankhyablocks/p-31b0d523.js.gz +0 -0
  879. package/dist/sankhyablocks/p-3ed04f0d.entry.js +0 -1
  880. package/dist/sankhyablocks/p-3ed04f0d.entry.js.gz +0 -0
  881. package/dist/sankhyablocks/p-3f8c436b.entry.js.gz +0 -0
  882. package/dist/sankhyablocks/p-4b2523df.js.gz +0 -0
  883. package/dist/sankhyablocks/p-4b286a64.entry.js.gz +0 -0
  884. package/dist/sankhyablocks/p-4c763b10.entry.js.gz +0 -0
  885. package/dist/sankhyablocks/p-4db51d85.js.gz +0 -0
  886. package/dist/sankhyablocks/p-4e3fc788.entry.js.gz +0 -0
  887. package/dist/sankhyablocks/p-6471a791.entry.js.gz +0 -0
  888. package/dist/sankhyablocks/p-6902c5ee.entry.js.gz +0 -0
  889. package/dist/sankhyablocks/p-69885aaa.js.gz +0 -0
  890. package/dist/sankhyablocks/p-7b3269e9.entry.js.gz +0 -0
  891. package/dist/sankhyablocks/p-81466555.entry.js.gz +0 -0
  892. package/dist/sankhyablocks/p-867fe6f2.entry.js +0 -1
  893. package/dist/sankhyablocks/p-867fe6f2.entry.js.gz +0 -0
  894. package/dist/sankhyablocks/p-88c12985.entry.js.gz +0 -0
  895. package/dist/sankhyablocks/p-94b15408.entry.js.gz +0 -0
  896. package/dist/sankhyablocks/p-95888078.js.gz +0 -0
  897. package/dist/sankhyablocks/p-9fa79997.js.gz +0 -0
  898. package/dist/sankhyablocks/p-bcf5692d.entry.js.gz +0 -0
  899. package/dist/sankhyablocks/p-ce77774e.js.gz +0 -0
  900. package/dist/sankhyablocks/p-dafee02c.entry.js.gz +0 -0
  901. package/dist/sankhyablocks/p-f68aab71.js +0 -1
  902. package/dist/sankhyablocks/p-f68aab71.js.gz +0 -0
  903. package/dist/sankhyablocks/p-febb03ba.entry.js.gz +0 -0
@@ -1 +1 @@
1
- import{r as t,c as i,f as s,h as e,H as a,g as o}from"./p-d8d8169b.js";import{Action as h,StringUtils as n,KeyboardManager as r}from"@sankhyalabs/core";import{S as d}from"./p-13596651.js";import{FormMetadata as l,buildFormMetadata as c}from"@sankhyalabs/ezui/dist/collection/utils/form";import{S as u}from"./p-42dde1ec.js";import"./p-4db51d85.js";import{P as m}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{V as v}from"./p-9019a32f.js";import{T as p}from"./p-b987e15d.js";import{S as g}from"./p-4b2523df.js";import{buildFieldSearch as f,SHORTCUT_SEARCH_FIELD as b}from"@sankhyalabs/ezui/dist/collection/utils";import"./p-69885aaa.js";import"./p-8d884fab.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";import"./p-55798617.js";import"./p-1a0caadb.js";import"@sankhyalabs/core/dist/dataunit/DataUnit";class k{constructor(t,i,s,e){this._parentGuide=t,this._formMetadata=i,this._dataUnit=s,this._messageBuilder=e,this._messageBuilder||(this._messageBuilder=new u)}get id(){return this._parentGuide.id}getMessage(t,i){return this._messageBuilder.getMessage(t,i)}buildGuideItem(t){const i=Object.assign({},this._parentGuide);delete i.expanded,delete i.children;const s=this._dataUnit.getSelectedRecord();if(!s)return i;const e=this._dataUnit.isNewRecord(s.__record__id__),a=Array.from(this._formMetadata.getAllSheets().values()).map((i=>{const{name:s,label:a}=i,o=null!=l.getDetailName(s.split("::").pop()),h=o&&e,n=this._parentGuide.id,r=o?`${n}::${s}`:`${n}__FORM:${s}`;return o&&t.has(r)&&!h?t.get(r).buildGuideItem(t):{id:r,label:a,disabled:h,tooltip:h?this.getMessage("snkCrud.guide.tooltip.disabledDetail"):void 0}})),o=a.shift();return o.label=e?this.getMessage("snkCrud.title.newRecord"):s.__record__label__,o.children=a,i.children=[o],i}}const w=class{constructor(s){t(this,s),this.snkDetailGuidesChange=i(this,"snkDetailGuidesChange",7),this.snkSwitchGuide=i(this,"snkSwitchGuide",7),this.formItemsReady=i(this,"formItemsReady",7),this._disabledButtons=void 0,this._currentView=void 0,this.attachmentRegisterKey=void 0,this._fieldToGetFocus=void 0,this._hasToCreateFieldSearch=!0,this.formConfigManager=void 0,this.dataUnitName=void 0,this.resourceID=void 0,this.guideItemPath=void 0,this.entityName=void 0,this.label=void 0,this.dataUnit=void 0,this.selectedForm=void 0,this.dataState=void 0,this.messagesBuilder=void 0,this.branchGuide=void 0,this.canEdit=!0,this.taskbarCustomContainerId=void 0,this.customEditors=void 0,this.customRenders=void 0,this.presentationMode=m.SECONDARY}observeDataUnit(t,i){null==t||t.subscribe(this.dataUnitActionHandler.bind(this)),null==i||i.unsubscribe(this.dataUnitActionHandler)}observerDataState(t,i){const s=!(null==i?void 0:i.insertionMode)&&(null==t?void 0:t.insertionMode),e=(null==i?void 0:i.insertionMode)&&!(null==t?void 0:t.insertionMode);if((s||e)&&this.loadMetadata(),null==this._formMetadata)return;const a=null==t?void 0:t.selectedRecord,o=null==i?void 0:i.selectedRecord;(null==a?void 0:a.__record__id__)!==(null==o?void 0:o.__record__id__)&&this.snkDetailGuidesChange.emit(new k(this.branchGuide,this._formMetadata,this.dataUnit,this.messagesBuilder)),s&&setTimeout((()=>{this.changeViewMode(v.FORM)}),0),e&&this.changeViewMode(v.GRID);const h=[];this.dataState.hasPrevious||h.push(p.PREVIOUS),this.dataState.hasNext||h.push(p.NEXT),this.dataState.insertionMode&&h.push(p.INSERT),this._disabledButtons=h}async changeViewMode(t){this.emitSwitchEvent(t)}async configGrid(){this._snkGrid&&this._snkGrid.showConfig()}async showUp(){this._snkFormView&&this._snkFormView.showUp(),this._snkGrid&&this._snkGrid.scrollIntoView({behavior:"smooth",block:"start"})}async addCustomEditor(t,i){var s;const e=this.normalizeBranchGuideId(null===(s=this.branchGuide)||void 0===s?void 0:s.id);this._snkGrid.addCustomEditor(t,i,e),this._snkFormView.addCustomEditor(t,i,e)}async observerPropsCustomEditor(t){for(const i in t)await this.addCustomEditor(i,t[i])}async addGridCustomRender(t,i){var s;const e=this.normalizeBranchGuideId(null===(s=this.branchGuide)||void 0===s?void 0:s.id);await this._snkGrid.addGridCustomRender(t,i,e)}onContentCardChanged(t){g.updateContentCard(t.detail.formName,t.detail.cardConfig,t.detail.propertyChanged,this.formConfigManager).then((()=>s(this))),t.stopPropagation()}async observeCustomRenders(t){for(const i in t){const s=t[i];await this.addGridCustomRender(i,s)}}updateLabel(){const t=this.guideItemPath?this.guideItemPath.length:0;if(t>0){const i=t>0?this.guideItemPath.map((t=>t.label)):void 0;this.label=i.pop(),this._levelPath=i.length>0?i.join(" / "):void 0}else this.label="",this._levelPath=void 0}getFormGuideId(t){var i;if(!t){if(null==(null===(i=this.dataState)||void 0===i?void 0:i.selectedRecord))return;const s=Array.from(this._formMetadata.getAllSheets().keys());if(!s||0==s.length)return;t=s[0]}return`${this.stripFormPattern(this.branchGuide.id)}__FORM:${t}`}stripFormPattern(t){return t.replace(w.REGEX_FORM_ID,"")}loadMetadata(){if(!this.dataUnit)return;if(!this.formConfigManager.isLoaded)return;const t=this.formConfigManager.getConfig(this.dataUnit);this._formMetadata=c(null==t||0===t.fields.length?void 0:t,this.dataUnit,!0)}dataUnitReadyHandler(t){this.dataUnit=t.detail,this.loadMetadata()}updateViewStack(t){var i,s;this._viewStack=t,this._currentView=this.selectedForm?1:0,null===(s=null===(i=this._viewStack)||void 0===i?void 0:i.show)||void 0===s||s.call(i,this._currentView)}getFormFields(){return this.selectedForm&&this._formMetadata?this._formMetadata.getSheet(this.selectedForm).fields:[]}emitSwitchEvent(t){const i=t===v.GRID?this.stripFormPattern(this.branchGuide.id):this.getFormGuideId();i&&this.snkSwitchGuide.emit(i)}handleAttachBack(){this._viewStack.show(v.GRID)}executeActionHandler(t){t.detail===p.GRID_MODE&&(this.emitSwitchEvent(v.GRID),t.stopPropagation()),t.detail!==p.FORM_MODE&&t.detail!==p.UPDATE||(this.emitSwitchEvent(v.FORM),t.stopPropagation()),t.detail===p.ATTACH&&(this._viewStack.show(v.ATTACHMENT),t.stopPropagation())}async getAttachmentRegisterKey(){if(this._snkDataUnit)return(await this._snkDataUnit.getSelectedRecordsIDsInfo()).map((({value:t})=>t)).join("_")}async handleDataStateChange({detail:t}){this.dataState=t,void 0!==t.selectedRecord&&this._snkDataUnit&&(this.attachmentRegisterKey=await this.getAttachmentRegisterKey())}componentWillLoad(){this._configName=`dynaform.${this.entityName}`,this.formConfigManager=new d(this._configName,this.resourceID,(()=>this.loadMetadata()),this.dataUnit),this.formConfigManager.loadConfig(),null==this.messagesBuilder&&(this.messagesBuilder=new u(this.entityName))}async componentDidLoad(){await this.observerPropsCustomEditor(this.customEditors),await this.observeCustomRenders(this.customRenders),this.initKeyboardManager()}disconnectedCallback(){var t;null===(t=this._keyboardManager)||void 0===t||t.unbindAllShortcutKeys()}async dataUnitActionHandler(t){t.type===h.FIELD_INVALIDATED&&this.addErrorBadgeToBranchGuide()}addErrorBadgeToBranchGuide(){this.branchGuide=Object.assign(Object.assign({},this.branchGuide),{badge:"error"}),this.snkDetailGuidesChange.emit(new k(this.branchGuide,this._formMetadata,this.dataUnit,this.messagesBuilder))}normalizeBranchGuideId(t){return null==t?void 0:t.replace(/child\[(.*?)\]/g,"$1").replace(/::/g,">")}getSettingsListForm(){return[{value:n.generateUUID(),label:this.messagesBuilder.getMessage("snkCrud.findColumn",void 0),disableCloseOnSelect:!0,eagerInitialize:!0,itemBuilder:(t,i)=>this.getFieldsSearch(i)}]}getFieldsSearch(t){return(null==this._fieldSearch||this._hasToCreateFieldSearch)&&(this._hasToCreateFieldSearch=!1,this._fieldSearch=f(t,(({argument:t})=>this.fieldsOptionLoader(t)),(t=>this.onSelectField(t)))),this._fieldSearch}fieldsOptionLoader(t){const i=null==t?void 0:t.toLowerCase(),s=this.getFormFields().map((t=>{var i;return null===(i=this.dataUnit)||void 0===i?void 0:i.getField(t.name)})).filter((t=>{var s,e;return(null===(s=t.name)||void 0===s?void 0:s.toLowerCase().includes(i))||(null===(e=t.label)||void 0===e?void 0:e.toLowerCase().includes(i))})).map((t=>({value:t.name,label:t.label})));return Promise.resolve(s)}onSelectField(t){null!=t&&(this._fieldToGetFocus=t.value)}clearFieldToFocusHandler(){this._fieldToGetFocus=void 0}async initKeyboardManager(){this._keyboardManager=new r({propagate:!1,element:this._element}),this._keyboardManager.bind(b,(async()=>{await this._snkFormView.showSearchField()}),{description:this.messagesBuilder.getMessage("snkSimpleCrud.findFields"),element:this._element})}render(){return this.updateLabel(),e(a,null,e("snk-data-unit",{ref:t=>this._snkDataUnit=t,dataUnitName:`${this.dataUnitName}`,onDataUnitReady:t=>this.dataUnitReadyHandler(t),entityName:this.entityName,onDataStateChange:this.handleDataStateChange.bind(this),ignoreSaveMessage:this._currentView===v.GRID,messagesBuilder:this.messagesBuilder,configName:this._configName},e("ez-view-stack",{ref:t=>this.updateViewStack(t)},e("stack-item",null,e("div",{class:"ez-box ez-box--shadow grid-container"},e("div",{class:"ez-title--primary ez-size-width--full ez-padding--large detail-header"},e("div",{class:"ez-flex ez-text ez-text--bold ez-flex--justify-start ez-flex--align-items-center"},this._levelPath?e("span",{class:"level-path"},this._levelPath+" /"):void 0,this.label)),e("snk-grid",{class:"ez-size-width--full",ref:t=>this._snkGrid=t,configName:this._configName,messagesBuilder:this.messagesBuilder,onGridDoubleClick:()=>this.emitSwitchEvent(v.FORM),onActionClick:t=>this.executeActionHandler(t),presentationMode:this.presentationMode,canEdit:this.canEdit,isDetail:!0,taskbarCustomContainerId:this.taskbarCustomContainerId,gridHeaderCustomSlotId:"DETAIL_GRID_HEADER_CUSTOM_ELEMENTS",topTaskbarCustomSlotId:"DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS",outlineMode:!1}))),e("stack-item",null,e("snk-form-view",{ref:t=>this._snkFormView=t,canExpand:!1,canFix:!1,name:this.selectedForm,formMetadata:this._formMetadata,dataUnit:this.dataUnit,fields:this.getFormFields(),fieldToFocus:this._fieldToGetFocus,label:this.label,levelPath:this._levelPath,onFormItemsReady:({detail:t})=>this.formItemsReady.emit(t),onSnkRequestClearFieldToFocus:this.clearFieldToFocusHandler.bind(this),fieldSearch:this._fieldSearch},e("snk-taskbar",{key:"guideViewerTaskbar",class:"form-taskbar","data-element-id":"guideViewer",configName:this._configName,messagesBuilder:this.messagesBuilder,disabledButtons:this._disabledButtons,buttons:"INSERT,PREVIOUS,NEXT,DIVIDER,CLONE,REMOVE,MORE_OPTIONS,DIVIDER,GRID_MODE,CONFIGURATOR",primaryButton:"INSERT",presentationMode:this.presentationMode,onActionClick:t=>this.executeActionHandler(t),dataUnit:this.dataUnit,resourceID:this.resourceID,customContainerId:this.taskbarCustomContainerId,customSlotId:"DETAIL_TASKBAR_CUSTOM_ELEMENTS",actionsSettingsList:this.getSettingsListForm()},e("slot",{name:"DETAIL_TASKBAR_CUSTOM_ELEMENTS"})))),e("stack-item",null,e("snk-attach",{registerKey:this.attachmentRegisterKey,messagesBuilder:this.messagesBuilder,entityName:this.entityName,onBack:this.handleAttachBack.bind(this)})))))}get _element(){return o(this)}static get watchers(){return{dataUnit:["observeDataUnit"],dataState:["observerDataState"],customEditors:["observerPropsCustomEditor"],customRenders:["observeCustomRenders"]}}};w.REGEX_FORM_ID=/__FORM:[^:]+/g,w.style=".sc-snk-detail-view-h{display:flex;row-gap:24px;flex-direction:column;width:100%;height:100%}.level-path.sc-snk-detail-view{color:var(--color--title-primary, #2B3A54);font-weight:var(--text-weight--medium, 400);padding-right:3px}.form-taskbar.sc-snk-detail-view{padding-bottom:var(--space--medium)}.grid-container.sc-snk-detail-view{background-color:#FFF;min-height:100px;height:100%}.detail-header.sc-snk-detail-view{padding-bottom:0}snk-data-unit.sc-snk-detail-view{flex:1}snk-grid.sc-snk-detail-view{height:calc(100% - 43px)}";export{w as snk_detail_view}
1
+ import{r as t,c as i,f as s,h as e,H as a,g as o}from"./p-d8d8169b.js";import{Action as h,StringUtils as n,KeyboardManager as r}from"@sankhyalabs/core";import{S as d}from"./p-16fa4019.js";import{FormMetadata as l,buildFormMetadata as c}from"@sankhyalabs/ezui/dist/collection/utils/form";import{S as u}from"./p-b2212d20.js";import"./p-d33a3955.js";import{P as m}from"./p-0f3698af.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-8dd0b9ce.js";import"./p-ff1990ad.js";import"./p-e6fe58b7.js";import{V as v}from"./p-9019a32f.js";import{T as p}from"./p-b987e15d.js";import{S as g}from"./p-f1855c53.js";import{buildFieldSearch as f,SHORTCUT_SEARCH_FIELD as b}from"@sankhyalabs/ezui/dist/collection/utils";import"./p-5cbd073e.js";import"./p-8d884fab.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";import"./p-55798617.js";import"./p-1a0caadb.js";import"@sankhyalabs/core/dist/dataunit/DataUnit";class k{constructor(t,i,s,e){this._parentGuide=t,this._formMetadata=i,this._dataUnit=s,this._messageBuilder=e,this._messageBuilder||(this._messageBuilder=new u)}get id(){return this._parentGuide.id}getMessage(t,i){return this._messageBuilder.getMessage(t,i)}buildGuideItem(t){const i=Object.assign({},this._parentGuide);delete i.expanded,delete i.children;const s=this._dataUnit.getSelectedRecord();if(!s)return i;const e=this._dataUnit.isNewRecord(s.__record__id__),a=Array.from(this._formMetadata.getAllSheets().values()).map((i=>{const{name:s,label:a}=i,o=null!=l.getDetailName(s.split("::").pop()),h=o&&e,n=this._parentGuide.id,r=o?`${n}::${s}`:`${n}__FORM:${s}`;return o&&t.has(r)&&!h?t.get(r).buildGuideItem(t):{id:r,label:a,disabled:h,tooltip:h?this.getMessage("snkCrud.guide.tooltip.disabledDetail"):void 0}})),o=a.shift();return o.label=e?this.getMessage("snkCrud.title.newRecord"):s.__record__label__,o.children=a,i.children=[o],i}}const w=class{constructor(s){t(this,s),this.snkDetailGuidesChange=i(this,"snkDetailGuidesChange",7),this.snkSwitchGuide=i(this,"snkSwitchGuide",7),this.formItemsReady=i(this,"formItemsReady",7),this._disabledButtons=void 0,this._currentView=void 0,this.attachmentRegisterKey=void 0,this._fieldToGetFocus=void 0,this._hasToCreateFieldSearch=!0,this.formConfigManager=void 0,this.dataUnitName=void 0,this.resourceID=void 0,this.guideItemPath=void 0,this.entityName=void 0,this.label=void 0,this.dataUnit=void 0,this.selectedForm=void 0,this.dataState=void 0,this.messagesBuilder=void 0,this.branchGuide=void 0,this.canEdit=!0,this.taskbarCustomContainerId=void 0,this.customEditors=void 0,this.customRenders=void 0,this.presentationMode=m.SECONDARY}observeDataUnit(t,i){null==t||t.subscribe(this.dataUnitActionHandler.bind(this)),null==i||i.unsubscribe(this.dataUnitActionHandler)}observerDataState(t,i){const s=!(null==i?void 0:i.insertionMode)&&(null==t?void 0:t.insertionMode),e=(null==i?void 0:i.insertionMode)&&!(null==t?void 0:t.insertionMode);if((s||e)&&this.loadMetadata(),null==this._formMetadata)return;const a=null==t?void 0:t.selectedRecord,o=null==i?void 0:i.selectedRecord;(null==a?void 0:a.__record__id__)!==(null==o?void 0:o.__record__id__)&&this.snkDetailGuidesChange.emit(new k(this.branchGuide,this._formMetadata,this.dataUnit,this.messagesBuilder)),s&&setTimeout((()=>{this.changeViewMode(v.FORM)}),0),e&&this.changeViewMode(v.GRID);const h=[];this.dataState.hasPrevious||h.push(p.PREVIOUS),this.dataState.hasNext||h.push(p.NEXT),this.dataState.insertionMode&&h.push(p.INSERT),this._disabledButtons=h}async changeViewMode(t){this.emitSwitchEvent(t)}async configGrid(){this._snkGrid&&this._snkGrid.showConfig()}async showUp(){this._snkFormView&&this._snkFormView.showUp(),this._snkGrid&&this._snkGrid.scrollIntoView({behavior:"smooth",block:"start"})}async addCustomEditor(t,i){var s;const e=this.normalizeBranchGuideId(null===(s=this.branchGuide)||void 0===s?void 0:s.id);this._snkGrid.addCustomEditor(t,i,e),this._snkFormView.addCustomEditor(t,i,e)}async observerPropsCustomEditor(t){for(const i in t)await this.addCustomEditor(i,t[i])}async addGridCustomRender(t,i){var s;const e=this.normalizeBranchGuideId(null===(s=this.branchGuide)||void 0===s?void 0:s.id);await this._snkGrid.addGridCustomRender(t,i,e)}onContentCardChanged(t){g.updateContentCard(t.detail.formName,t.detail.cardConfig,t.detail.propertyChanged,this.formConfigManager).then((()=>s(this))),t.stopPropagation()}async observeCustomRenders(t){for(const i in t){const s=t[i];await this.addGridCustomRender(i,s)}}updateLabel(){const t=this.guideItemPath?this.guideItemPath.length:0;if(t>0){const i=t>0?this.guideItemPath.map((t=>t.label)):void 0;this.label=i.pop(),this._levelPath=i.length>0?i.join(" / "):void 0}else this.label="",this._levelPath=void 0}getFormGuideId(t){var i;if(!t){if(null==(null===(i=this.dataState)||void 0===i?void 0:i.selectedRecord))return;const s=Array.from(this._formMetadata.getAllSheets().keys());if(!s||0==s.length)return;t=s[0]}return`${this.stripFormPattern(this.branchGuide.id)}__FORM:${t}`}stripFormPattern(t){return t.replace(w.REGEX_FORM_ID,"")}loadMetadata(){if(!this.dataUnit)return;if(!this.formConfigManager.isLoaded)return;const t=this.formConfigManager.getConfig(this.dataUnit);this._formMetadata=c(null==t||0===t.fields.length?void 0:t,this.dataUnit,!0)}dataUnitReadyHandler(t){this.dataUnit=t.detail,this.loadMetadata()}updateViewStack(t){var i,s;this._viewStack=t,this._currentView=this.selectedForm?1:0,null===(s=null===(i=this._viewStack)||void 0===i?void 0:i.show)||void 0===s||s.call(i,this._currentView)}getFormFields(){return this.selectedForm&&this._formMetadata?this._formMetadata.getSheet(this.selectedForm).fields:[]}emitSwitchEvent(t){const i=t===v.GRID?this.stripFormPattern(this.branchGuide.id):this.getFormGuideId();i&&this.snkSwitchGuide.emit(i)}handleAttachBack(){this._viewStack.show(v.GRID)}executeActionHandler(t){t.detail===p.GRID_MODE&&(this.emitSwitchEvent(v.GRID),t.stopPropagation()),t.detail!==p.FORM_MODE&&t.detail!==p.UPDATE||(this.emitSwitchEvent(v.FORM),t.stopPropagation()),t.detail===p.ATTACH&&(this._viewStack.show(v.ATTACHMENT),t.stopPropagation())}async getAttachmentRegisterKey(){if(this._snkDataUnit)return(await this._snkDataUnit.getSelectedRecordsIDsInfo()).map((({value:t})=>t)).join("_")}async handleDataStateChange({detail:t}){this.dataState=t,void 0!==t.selectedRecord&&this._snkDataUnit&&(this.attachmentRegisterKey=await this.getAttachmentRegisterKey())}componentWillLoad(){this._configName=`dynaform.${this.entityName}`,this.formConfigManager=new d(this._configName,this.resourceID,(()=>this.loadMetadata()),this.dataUnit),this.formConfigManager.loadConfig(),null==this.messagesBuilder&&(this.messagesBuilder=new u(this.entityName))}async componentDidLoad(){await this.observerPropsCustomEditor(this.customEditors),await this.observeCustomRenders(this.customRenders),this.initKeyboardManager()}disconnectedCallback(){var t;null===(t=this._keyboardManager)||void 0===t||t.unbindAllShortcutKeys()}async dataUnitActionHandler(t){t.type===h.FIELD_INVALIDATED&&this.addErrorBadgeToBranchGuide()}addErrorBadgeToBranchGuide(){this.branchGuide=Object.assign(Object.assign({},this.branchGuide),{badge:"error"}),this.snkDetailGuidesChange.emit(new k(this.branchGuide,this._formMetadata,this.dataUnit,this.messagesBuilder))}normalizeBranchGuideId(t){return null==t?void 0:t.replace(/child\[(.*?)\]/g,"$1").replace(/::/g,">")}getSettingsListForm(){return[{value:n.generateUUID(),label:this.messagesBuilder.getMessage("snkCrud.findColumn",void 0),disableCloseOnSelect:!0,eagerInitialize:!0,itemBuilder:(t,i)=>this.getFieldsSearch(i)}]}getFieldsSearch(t){return(null==this._fieldSearch||this._hasToCreateFieldSearch)&&(this._hasToCreateFieldSearch=!1,this._fieldSearch=f(t,(({argument:t})=>this.fieldsOptionLoader(t)),(t=>this.onSelectField(t)))),this._fieldSearch}fieldsOptionLoader(t){const i=null==t?void 0:t.toLowerCase(),s=this.getFormFields().map((t=>{var i;return null===(i=this.dataUnit)||void 0===i?void 0:i.getField(t.name)})).filter((t=>{var s,e;return(null===(s=t.name)||void 0===s?void 0:s.toLowerCase().includes(i))||(null===(e=t.label)||void 0===e?void 0:e.toLowerCase().includes(i))})).map((t=>({value:t.name,label:t.label})));return Promise.resolve(s)}onSelectField(t){null!=t&&(this._fieldToGetFocus=t.value)}clearFieldToFocusHandler(){this._fieldToGetFocus=void 0}async initKeyboardManager(){this._keyboardManager=new r({propagate:!1,element:this._element}),this._keyboardManager.bind(b,(async()=>{await this._snkFormView.showSearchField()}),{description:this.messagesBuilder.getMessage("snkSimpleCrud.findFields"),element:this._element})}render(){return this.updateLabel(),e(a,null,e("snk-data-unit",{ref:t=>this._snkDataUnit=t,dataUnitName:`${this.dataUnitName}`,onDataUnitReady:t=>this.dataUnitReadyHandler(t),entityName:this.entityName,onDataStateChange:this.handleDataStateChange.bind(this),ignoreSaveMessage:this._currentView===v.GRID,messagesBuilder:this.messagesBuilder,configName:this._configName},e("ez-view-stack",{ref:t=>this.updateViewStack(t)},e("stack-item",null,e("div",{class:"ez-box ez-box--shadow grid-container"},e("div",{class:"ez-title--primary ez-size-width--full ez-padding--large detail-header"},e("div",{class:"ez-flex ez-text ez-text--bold ez-flex--justify-start ez-flex--align-items-center"},this._levelPath?e("span",{class:"level-path"},this._levelPath+" /"):void 0,this.label)),e("snk-grid",{class:"ez-size-width--full",ref:t=>this._snkGrid=t,configName:this._configName,messagesBuilder:this.messagesBuilder,onGridDoubleClick:()=>this.emitSwitchEvent(v.FORM),onActionClick:t=>this.executeActionHandler(t),presentationMode:this.presentationMode,canEdit:this.canEdit,isDetail:!0,taskbarCustomContainerId:this.taskbarCustomContainerId,gridHeaderCustomSlotId:"DETAIL_GRID_HEADER_CUSTOM_ELEMENTS",topTaskbarCustomSlotId:"DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS",outlineMode:!1}))),e("stack-item",null,e("snk-form-view",{ref:t=>this._snkFormView=t,canExpand:!1,canFix:!1,name:this.selectedForm,formMetadata:this._formMetadata,dataUnit:this.dataUnit,fields:this.getFormFields(),fieldToFocus:this._fieldToGetFocus,label:this.label,levelPath:this._levelPath,onFormItemsReady:({detail:t})=>this.formItemsReady.emit(t),onSnkRequestClearFieldToFocus:this.clearFieldToFocusHandler.bind(this),fieldSearch:this._fieldSearch},e("snk-taskbar",{key:"guideViewerTaskbar",class:"form-taskbar","data-element-id":"guideViewer",configName:this._configName,messagesBuilder:this.messagesBuilder,disabledButtons:this._disabledButtons,buttons:"INSERT,PREVIOUS,NEXT,DIVIDER,CLONE,REMOVE,MORE_OPTIONS,DIVIDER,GRID_MODE,CONFIGURATOR",primaryButton:"INSERT",presentationMode:this.presentationMode,onActionClick:t=>this.executeActionHandler(t),dataUnit:this.dataUnit,resourceID:this.resourceID,customContainerId:this.taskbarCustomContainerId,customSlotId:"DETAIL_TASKBAR_CUSTOM_ELEMENTS",actionsSettingsList:this.getSettingsListForm()},e("slot",{name:"DETAIL_TASKBAR_CUSTOM_ELEMENTS"})))),e("stack-item",null,e("snk-attach",{registerKey:this.attachmentRegisterKey,messagesBuilder:this.messagesBuilder,entityName:this.entityName,onBack:this.handleAttachBack.bind(this)})))))}get _element(){return o(this)}static get watchers(){return{dataUnit:["observeDataUnit"],dataState:["observerDataState"],customEditors:["observerPropsCustomEditor"],customRenders:["observeCustomRenders"]}}};w.REGEX_FORM_ID=/__FORM:[^:]+/g,w.style=".sc-snk-detail-view-h{display:flex;row-gap:24px;flex-direction:column;width:100%;height:100%}.level-path.sc-snk-detail-view{color:var(--color--title-primary, #2B3A54);font-weight:var(--text-weight--medium, 400);padding-right:3px}.form-taskbar.sc-snk-detail-view{padding-bottom:var(--space--medium)}.grid-container.sc-snk-detail-view{background-color:#FFF;min-height:100px;height:100%}.detail-header.sc-snk-detail-view{padding-bottom:0}snk-data-unit.sc-snk-detail-view{flex:1}snk-grid.sc-snk-detail-view{height:calc(100% - 43px)}";export{w as snk_detail_view}
Binary file
@@ -0,0 +1 @@
1
+ import{r as t,c as i,h as e,H as s,g as r,f as l}from"./p-d8d8169b.js";import{DataType as a,StringUtils as n,ObjectUtils as o,ElementIDUtils as h,ErrorException as d,ApplicationContext as c,LockManager as u,LockManagerOperation as f,DateUtils as m,MaskFormatter as p,KeyboardManager as v,FloatingManager as b,ArrayUtils as g}from"@sankhyalabs/core";import{EzScrollDirection as k}from"@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection";import{C as _}from"./p-5cbd073e.js";import{P as F}from"./p-988afe78.js";import{toString as y}from"@sankhyalabs/core/dist/dataunit/metadata/DataType";import{F as z}from"./p-ff1990ad.js";import{F as x,D as w}from"./p-84345e7a.js";import{F as C}from"./p-fa80e546.js";import{ModalAction as I}from"@sankhyalabs/ezui/dist/collection/components/ez-modal-container";import{ApplicationUtils as $}from"@sankhyalabs/ezui/dist/collection/utils";import{A as N}from"./p-6a4b21dd.js";import{F as T}from"./p-b568c1d4.js";import{g as L}from"./p-76e66fd9.js";import"./p-e6fe58b7.js";import"./p-b2212d20.js";import"./p-8d884fab.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";function A(t){let i="";return t.forEach(((t,e)=>{var s;i+=` ${e>0?null!==(s=t.operand)&&void 0!==s?s:"OR":""} ${t.expression}`})),i.trim()}const P=class{constructor(e){t(this,e),this.configUpdated=i(this,"configUpdated",7),this._updateSequence=[],this._loadingPending=!1,this._configUpdated=!1,this._firstLoad=!0,this._pendingVariables=!1,this._isDefaultFilter=!1,this._customfiltersToBeUpdated=[],this._resolveLoading=void 0,this._calculateSortIndex=t=>{if(!t.visible)return 0;if(t.hardFixed)return 1e6;let i=t.fixed?1e5:0;return i+=this.hasValidValue(t)?1e4:0,i+=this._updateSequence.lastIndexOf(t.id)+1,i},this._filtersComparator=(t,i)=>this._calculateSortIndex(i)-this._calculateSortIndex(t),this.enableLockManagerLoadingComp=!1,this.customFilterBarConfig=void 0,this.dataUnit=void 0,this.title=void 0,this.configName=void 0,this.resourceID=void 0,this.mode="regular",this.filterConfig=void 0,this.messagesBuilder=void 0,this.disablePersonalizedFilter=void 0,this.filterBarLegacyConfigName=void 0,this.autoLoad=void 0,this.afterApplyConfig=void 0,this.filterCustomConfig=void 0,this.filterCustomConfigInterceptor=void 0,this.allowDefault=void 0,this.scrollerLocked=!1,this.showPersonalizedFilter=!1,this.personalizedFilterId=void 0,this.isFilterModalOpen=!1}hasValidValue(t){var i,e;return null!=t.value&&(t.type===z.PERIOD?!!(null===(i=t.value)||void 0===i?void 0:i.start)||!!(null===(e=t.value)||void 0===e?void 0:e.end):!!t.groupedItems||!Array.isArray(t.value)||t.value.some((t=>!0===t.check)))}observeFilterConfig(t,i){o.equals(t,i)||this.handleFilterConfigsChanged(i,t)}handleFilterConfigsChanged(t,i){if(null!=t&&null==i)this._loadingPending=!0,this._configUpdated=!0;else{const e=new Map(t?t.map((t=>[t.id,t])):void 0);0===e.size&&i.length>0?(this._loadingPending=!0,this._configUpdated=!1):i.forEach((t=>{const i=e.get(t.id);if(null!=i){if(this._configUpdated=this._configUpdated||o.objectToString(i)!=o.objectToString(t),this._loadingPending=this._loadingPending||o.objectToString(i.value)!==o.objectToString(t.value),!this._loadingPending){const e=o.objectToString(i.groupedItems)!=o.objectToString(t.groupedItems);this._configUpdated=this._configUpdated||e,this._loadingPending=this._loadingPending||e}}else this._configUpdated=!0,this._loadingPending=this._loadingPending||null!=t.value}))}(this._loadingPending||this._configUpdated)&&this.configUpdated.emit(i),this.processAfterUpdateConfig()}async reload(){this.loadConfigFromStorage(!0)}async getFilterItem(t){const i=this.filterConfig.find((i=>i.id===t));return Promise.resolve(o.copy(i))}async updateFilterItem(t){return-1==this.filterConfig.findIndex((i=>i.id===t.id))?(console.warn("[SnkFilterBar.updateFilterItem] "+this.getMessage("snkFilterBar.filterItem.updateFilterItemNotFound")),Promise.resolve()):(this._loadingPending=!0,this.updateFilter(t),Promise.resolve())}async addFilterItem(t){return this.filterConfig.findIndex((i=>i.id===t.id))>-1?(console.warn("[SnkFilterBar.addFilterItem] "+this.getMessage("snkFilterBar.filterItem.addFilterItemExists")),Promise.resolve()):(this.filterConfig.push(t),this._loadingPending=!0,this.updateFilter(t),Promise.resolve())}async removeFilterItem(t){const i=this.filterConfig.findIndex((i=>i.id===t));if(-1==i)return console.warn("[SnkFilterBar.removeFilterItem] "+this.getMessage("snkFilterBar.filterItem.removeFilterItemNotFound")),Promise.resolve(void 0);const e=this.filterConfig[i];return this.filterConfig=this.filterConfig.filter((i=>i.id!==t)),Promise.resolve(e)}componentDidLoad(){this._element&&h.addIDInfo(this._element,null,{dataUnit:this.dataUnit})}processPendingFilter(){if(this._pendingVariables){const t=this._element.querySelector("#filter-PERSONALIZED_FILTER_GROUP");t&&t.showUp(!0).then((()=>{this.processAfterUpdateConfig()}))}else this.processAfterUpdateConfig()}getPersonalizedFilterItem(){return this.filterConfig.find((t=>t.type===z.PERSONALIZED))}async processAfterUpdateConfig(){var t;if(this._loadingPending){if(await this._application.isLoadedByPk()&&!this._configUpdated)return;const t=this.getPersonalizedFilterItem();if(this._pendingVariables=!F.validateVariableValues(t),this._pendingVariables)return;this._loadingPending=!1,this.doLoadData()}this._configUpdated&&(this._configUpdated=!1,_.saveFilterBarConfig(this.filterConfig,this.configName,this.resourceID),null===(t=this.afterApplyConfig)||void 0===t||t.call(this))}async doLoadData(t=!1){try{if(this._firstLoad&&!1===this.autoLoad)return;if(this._firstLoad&&!t&&void 0===this.autoLoad&&!await this._application.getBooleanParam("global.carregar.registros.iniciar.tela"))return;this.dataUnit.loadData(void 0,void 0,!0)}finally{this._firstLoad=!1}}getMessage(t,i,e){var s;return null==this.messagesBuilder&&this._application&&(this.messagesBuilder=this._application.messagesBuilder),(null===(s=this.messagesBuilder)||void 0===s?void 0:s.getMessage(t,i))||e}async getFilters(){return this.getFilter(null)}getFilter(t){var i;const e=[];return null===(i=this.filterConfig)||void 0===i||i.filter((t=>this.isActiveFilter(t))).forEach((t=>{const i=(t=>{switch(t.type){case z.DEFAULT_FILTER:return function(t){return{name:t.id,expression:t.props.expression,params:[]}}(t);case z.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 z.MULTI_SELECT:return function(t){const{id:i,value:e,props:s}=t;return{name:i,expression:s.expression,params:[{name:i,dataType:a.TEXT,value:e}]}}(t);case z.MULTI_LIST:return function(t){const{id:i,value:e,props:s}=t,r=(null!==(o=null!==(n=null==(l=e)?void 0:l.elements)&&void 0!==n?n:null==l?void 0:l.members)&&void 0!==o?o:l).filter((t=>null==t?void 0:t.check)).map((({id:t})=>Number.isNaN(+t)?String(t):Number(t)));var l,n,o;if(r.length>0)return{name:i,expression:s.expression,params:[{name:i,dataType:a.TEXT,value:JSON.stringify(r)}]}}(t);case z.PERIOD:return function(t){const{id:i,value:e,props:s}=t;let{end:r,start:l}=e;"string"==typeof r&&(r=new Date(r)),"string"==typeof l&&(l=new Date(l));const n=[];let o;return r&&l?(o=s.expression.fullfill,n.push({name:`${i}.START`,dataType:a.DATE,value:y(a.DATE,l)},{name:`${i}.END`,dataType:a.DATE,value:y(a.DATE,r)})):l?(o=s.expression.onlystart,n.push({name:i,dataType:a.DATE,value:y(a.DATE,l)})):(o=s.expression.onlyend,n.push({name:i,dataType:a.DATE,value:y(a.DATE,r)})),{name:i,expression:o,params:n}}(t);case z.SEARCH:return function(t){const{id:i,value:e,props:s}=t;return{name:i,expression:s.expression,params:[{name:i,dataType:a.TEXT,value:y(a.TEXT,null==e?void 0:e.value)}]}}(t);case z.TEXT:return function(t){let{id:i,value:e,props:s}=t;const r=s.expression;var l,o;return n.isEmpty(s.likeAs)||(l=e,e="CONTANIS"===(o=s.likeAs)?`%${l}%`:"STARTS_WITH"===o?`${l}%`:"ENDS_WITH"===o?`%${l}`:l),{name:i,expression:r,params:[{name:i,dataType:a.TEXT,value:y(a.TEXT,e)}]}}(t);case z.NUMBER:return function(t){const{id:i,value:e,props:s}=t;if(s.variation===C.INTERVAL){const{start:t,end:r}=null!=e?e:{start:0,end:0};if(!isNaN(t)&&!isNaN(r))return{name:i,expression:s.intervalExpression.fullfill,params:[{name:`${i}.START`,dataType:a.NUMBER,value:y(a.NUMBER,t)},{name:`${i}.END`,dataType:a.NUMBER,value:y(a.NUMBER,r)}]};if(!isNaN(t))return{name:i,expression:s.intervalExpression.onlystart,params:[{name:i,dataType:a.NUMBER,value:y(a.NUMBER,t)}]};if(!isNaN(r))return{name:i,expression:s.intervalExpression.onlyend,params:[{name:i,dataType:a.NUMBER,value:y(a.NUMBER,r)}]}}return{name:i,expression:s.expression,params:[{name:i,dataType:a.NUMBER,value:y(a.NUMBER,e)}]}}(t);case z.PERSONALIZED:return function(t){const{id:i,groupedItems:e=[]}=t,s=e.filter((t=>!!t.visible)).map((t=>{var i;const e=t.props.expression,s=((null===(i=t.props.personalizedFilter)||void 0===i?void 0:i.parameters)||[]).map(((i,e)=>{const s=Array.from(t.value||0),r=i.dataType;let l=e>=0&&e<s.length?s[e]:null;return null!=l&&"object"==typeof l&&"value"in l&&(l=l.value),null==l&&r===a.BOOLEAN&&(l=!1),{name:i.name,dataType:r,value:"string"==typeof l?l:y(r,l)}}));return{expression:e,name:t.id,params:s}}));return{name:i,expression:s.map((t=>`(${t.expression})`)).join(` ${x.AND} `),params:s.flatMap((t=>t.params))}}(t);case z.CHECK_BOX_LIST:return function(t){var i;const{id:e,value:s,props:r}=t,l=Object.entries(null!=s?s:{}).filter((([t,i])=>!0===i)).map((([t,i])=>t));return{name:e,expression:A(null===(i=r.options)||void 0===i?void 0:i.filter((t=>l.includes(t.name)))),params:[]}}(t);default:return}})(t);i&&e.push(i)})),e}isActiveFilter(t){return t.type===z.DEFAULT_FILTER||this.filterActiveFilter(t)&&this.hasValidValue(t)}async registryFilterProvider(){this.dataUnit.addFilterProvider(this),this.filterConfig&&await this.doLoadData()}itemFocused(t){this._element.querySelectorAll("snk-filter-item,snk-filter-list").forEach((i=>{i.id===t?"snk-filter-item"===i.tagName.toLowerCase()&&i.getClientRects()[0].x<0&&i.scrollIntoView({behavior:"auto",inline:"nearest"}):i.hideDetail()}))}filterActiveFilter(t){return t.visible||t.removalBlocked}filterPersonalizedItems(t){return t.type===z.PERSONALIZED}getPersonalizedFilterVariableItems(){return this.filterConfig.filter(this.filterPersonalizedItems).map((t=>{const i=`filter-${t.id}`;return e("snk-filter-item",{key:t.id,id:i,config:Object.assign({},t),onFocusin:()=>this.itemFocused(i),onVisibleChanged:t=>this.scrollerLocked=t.detail,onFilterChange:t=>this.updateFilter(t.detail),getMessage:(t,i)=>this.getMessage(t,i),showChips:!1})}))}getFilterItems(){const t=[],i=[];this.filterConfig.sort(((t,i)=>this._filtersComparator(t,i))).filter(this.filterActiveFilter).forEach((s=>{const r=`filter-${(s=o.copy(s)).id}`,l=e("snk-filter-item",{onVisibleChanged:t=>this.scrollerLocked=t.detail,onFilterChange:t=>this.updateFilter(t.detail),onFocusin:()=>this.itemFocused(r),id:r,config:s,class:"ez-margin-horizontal--extra-small",getMessage:(t,i)=>this.getMessage(t,i),key:s.id});return s.fixed||s.hardFixed||s.required?t.push(l):i.push(l),l}));const s=[];return s.push(...t.reverse()),t.length>0&&i.length>0&&s.push(e("hr",{class:"ez-margin-horizontal--small ez-margin-vertical--auto ez-divider-vertical ez-divider--dark snk-filter-bar__divider"})),s.push(...i),s}calculateUpdateSequence(t){t&&(this._updateSequence=this._updateSequence.filter((i=>t.id!==i)),this._updateSequence.push(t.id))}normalizeItem(t){const i=Object.assign({},t);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?(o.objectToString(i)!=o.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&&_.addFilterBarLegacyConfig(this.configName,this.filterBarLegacyConfigName)}async loadConfigFromStorage(t){try{let i;t&&await _.deleteFilterBarConfigCache(this.configName,this.resourceID),i=this.customFilterBarConfig?await this.customFilterBarConfig(this.configName,this.resourceID,{contextURI:this.dataUnit.name}):await _.loadFilterBarConfig(this.configName,this.resourceID,{contextURI:this.dataUnit.name}),this.filterCustomConfig&&(i=[...this.filterCustomConfig,...i]),this.filterCustomConfigInterceptor&&(i=this.filterCustomConfigInterceptor(i)),this.filterConfig=i.map((t=>this.normalizeItem(t))),this.filterConfig.sort(((t,i)=>this._filtersComparator(t,i)))}catch(t){throw new d(this.getMessage("snkFilterBar.failToLoadConfig"),t)}}async attachDataUnit(){if(null==this.dataUnit){let t=this._element.parentElement;for(;t;)if("SNK-DATA-UNIT"===t.tagName.toUpperCase()){const i=t;this.dataUnit=i.dataUnit,this.dataUnit?await this.registryFilterProvider():i.addEventListener("dataUnitReady",(async t=>{this.dataUnit=t.detail,await this.registryFilterProvider()}));break}t=t.parentElement}else await this.registryFilterProvider()}filterChangeListener(t){this.updateFilter(t.detail)}async showFilterModal(){this.isFilterModalOpen||(this.isFilterModalOpen=!0)}addPersonalizedFilter(t=!1){this.isFilterModalOpen=!1,this._isDefaultFilter=t,this.personalizedFilterId=void 0,this.showPersonalizedFilter=!0,window.requestAnimationFrame((()=>{this._elPersonalizedFilter.createPersonalizedFilter()}))}editPersonalizedFilter(t,i=!1){this.isFilterModalOpen=!1,this._isDefaultFilter=i,this.showPersonalizedFilter=!0,this.personalizedFilterId=t}deletePersonalizedFilter(t,i,e,s=!1){if(s)return _.removeDefaultFilter(t,this.resourceID,e),void(this._isDefaultFilter=!1);i===z.PERSONALIZED&&_.removePersonalizedFilter(t,this.resourceID,e)}closeFilterModal(){this.isFilterModalOpen=!1}applyFiltersFromModal(t){var i;this.filterConfig=t.map(this.normalizeItem).sort(((t,i)=>this._filtersComparator(t,i))),null===(i=this.afterApplyConfig)||void 0===i||i.call(this),this.isFilterModalOpen=!1}handleHidePersonalizedFilter(t){t?this.loadConfigFromStorage().then((()=>{this.hidePersonalizedFilter()})):this.hidePersonalizedFilter()}hidePersonalizedFilter(){this.personalizedFilterId=void 0,this.showPersonalizedFilter=!1,this._isDefaultFilter=!1}async componentWillLoad(){var t;try{if(this._application=c.getContextValue("__SNK__APPLICATION__"),await this.attachDataUnit(),this._application){if(this._application.enableLockManagerLoadingApp&&this.enableLockManagerLoadingComp){const t=u.addLockManagerCtxId(this._element);this._resolveLoading=u.lock(t,f.APP_LOADING)}await Promise.all([this.loadPermitions(),this.addFilterBarLegacyConfigName(),this.loadConfigFromStorage()])}}finally{null===(t=this._resolveLoading)||void 0===t||t.call(this)}}componentDidRender(){this.processPendingFilter()}render(){if(!this.dataUnit||!this.filterConfig||0===this.filterConfig.length)return;if(this.showPersonalizedFilter)return e("snk-personalized-filter",{class:"filter-bar__personalized-filter",filterId:this.personalizedFilterId,ref:t=>this._elPersonalizedFilter=t,isDefaultFilter:this._isDefaultFilter,onEzCancel:()=>this.handleHidePersonalizedFilter(!1),onEzAfterSave:()=>this.handleHidePersonalizedFilter(!0),entityUri:this.dataUnit.name,configName:this.configName,resourceID:this.resourceID});let t=o.copy(this.filterConfig);return t=t.sort(((t,i)=>t.originOrder-i.originOrder)),"regular"!==this.mode?e(s,{"data-mode":this.mode},this.getPersonalizedFilterVariableItems(),"button"===this.mode&&e("ez-button",{class:"ez-margin-left--medium",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,z.PERSONALIZED,i,e),filterCustomConfigInterceptor:this.filterCustomConfigInterceptor})):e(s,null,e("div",null,e("span",{class:"snk-filter-bar__title",title:this.title,"data-tooltip":this.title,"data-flow":"bottom"},this.title)),e("ez-scroller",{class:"snk-filter-bar__scroller",direction:k.HORIZONTAL,activeShadow:!0,locked:this.scrollerLocked},e("section",{class:"snk-filter-bar__filter-item-container"},this.getFilterItems())),e("ez-button",{class:"ez-padding-left--medium ez-margin-top--extra-small",size:"small",label:this.getMessage("snkFilterBar.filters",void 0,this.getMessage("snkFilterBar.filters")),onClick:this.showFilterModal.bind(this)},e("ez-icon",{slot:"leftIcon",iconName:"plus",class:"ez-padding-right--small"})),e("snk-filter-modal",{opened:this.isFilterModalOpen,filterConfig:this.filterConfig,configName:this.configName,disablePersonalizedFilter:this.disablePersonalizedFilter,getMessage:(t,i)=>this.getMessage(t,i),applyFilters:t=>this.applyFiltersFromModal(t),closeModal:()=>this.closeFilterModal(),addPersonalizedFilter:t=>this.addPersonalizedFilter(t),editPersonalizedFilter:(t,i)=>this.editPersonalizedFilter(t,i),deletePersonalizedFilter:(t,i,e)=>this.deletePersonalizedFilter(t,z.PERSONALIZED,i,e),filterCustomConfigInterceptor:this.filterCustomConfigInterceptor}))}get _element(){return r(this)}static get watchers(){return{filterConfig:["observeFilterConfig"]}}};P.style='.sc-snk-filter-bar-h{display:grid;grid-template-columns:1fr minmax(100px, 100%) 1fr 1fr;--snk-personalized-filter--z-index:var(--elevation--20, 20);--snk-personalized-filter--background-color:var(--background--xlight, #fff)}.snk-filter-bar__title.sc-snk-filter-bar{max-width:260px;display:inline-block;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-size:16px;font-family:var(--font-pattern, Arial);font-weight:var(--text-weight--large, 600);color:var(--color--title-primary, #2B3A54);margin-top:12px}[data-mode="hidden"].sc-snk-filter-bar-h{width:0px;height:0px}[data-mode="button"].sc-snk-filter-bar-h{grid-template-columns:1fr;width:fit-content}.snk-filter__popover-container.sc-snk-filter-bar{display:flex;cursor:auto}.filter-bar__personalized-filter.sc-snk-filter-bar{display:flex;flex-direction:column;position:fixed;top:0;left:0;width:100%;height:100%;overflow:auto;z-index:var(--snk-personalized-filter--z-index);background-color:var(--snk-personalized-filter--background-color)}.snk-filter__popover.sc-snk-filter-bar{display:flex;flex-direction:column;position:absolute;width:fit-content;height:fit-content;min-width:265px;background-color:var(--background--xlight, #fff);border-radius:var(--border--radius-medium, 12px);box-shadow:var(--shadow, 0px 0px 16px 0px #000)}.snk-filter-item__editor-header.sc-snk-filter-bar{flex-grow:1;font-weight:var(--text-weight--medium, 400);color:var(--color--title-primary, #2B3A54)}.snk-filter__popover-rule.sc-snk-filter-bar{border-style:solid;border-color:var(--color--disable-secondary, #F2F5F8);border-radius:1px;border-width:1px;width:100%}.editor__ez-check.sc-snk-filter-bar{--ez-check__label--padding-left:0}.snk-filter-item__editor-header-button.sc-snk-filter-bar{cursor:pointer;background-color:transparent;border:none;padding:3px;outline-color:var(--color--primary)}.snk-filter-bar__divider.sc-snk-filter-bar{margin-bottom:var(--space--small);height:80%}.snk-filter-bar__filter-item-container.sc-snk-filter-bar{display:flex;align-items:start;margin:var(--space--2, 2px) 0}.snk-filter-bar__scroller.sc-snk-filter-bar .sc-snk-filter-bar:first-child{margin-left:var(--space-extra-small, 3px)}.snk-filter-bar__filter-list-items-container.sc-snk-filter-bar{overflow-y:auto;max-height:360px;margin-top:var(--space--small, 6px)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar{cursor:pointer;border-radius:var(--border--radius-small, 6px);border:none;background-color:transparent}.snk-filter-bar__filter-list-item__label.sc-snk-filter-bar{color:var(--title--primary)}.snk-filter-bar__filter-list-item__label--secondary.sc-snk-filter-bar{color:var(--text--primary)}.snk-filter-bar__filter-list-item__icon.sc-snk-filter-bar{--ez-icon--color:var(--title--primary)}.snk-filter-bar__filter-list-item__icon--secondary.sc-snk-filter-bar{--ez-icon--color:var(--text--secondary)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar:focus-visible{outline:none;background-color:var(--background--medium)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar:hover{background-color:var(--background--medium)}.snk-filter-bar__filter-list-items-container--empty.sc-snk-filter-bar{width:100%;height:100px;display:flex;justify-content:center;align-self:center;align-items:center}.snk-filter-bar__filter-list-items-button--active.sc-snk-filter-bar{position:relative}.snk-filter-bar__filter-list-items-button--active.sc-snk-filter-bar::after{display:flex;position:absolute;content:"";width:8px;height:8px;top:7px;left:17px;background-color:var(--icon--alert--color, #008561);border-radius:50%}.snk-filter-bar__filter-modal-item.sc-snk-filter-bar{--modal-item-border-width:2px;display:flex;flex-direction:row;margin-left:var(--modal-item-border-width);border-radius:var(--border--radius-medium, 12px);background-color:var(--background--medium, #f0f3f7);border:none;width:100%}.snk-filter-bar__filter-modal-item.sc-snk-filter-bar:focus-visible{outline:var(--color--primary) solid var(--modal-item-border-width)}.snk-filter-bar__filter-modal-item__check.sc-snk-filter-bar{width:auto}.snk-filter-bar__filter-modal-item__label.sc-snk-filter-bar{font-weight:var(--text-weight--medium)}.snk-filter-bar__filter-modal-content.sc-snk-filter-bar{display:grid;grid-template-rows:auto auto 1fr auto;width:99%;height:100%}';const D=class{constructor(e){t(this,e),this.visibleChanged=i(this,"visibleChanged",7),this.filterChange=i(this,"filterChange",3),this._keyboardManager=void 0,this.detailIsVisible=void 0,this.config=void 0,this.getMessage=void 0,this.showChips=!0}observeDetailIsVisible(t){this.visibleChanged.emit(t)}filterChangeListener(){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===z.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===z.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===z.MULTI_SELECT)return`${l}: ${a.options.find((t=>t.value===r)).label}`;if(s===z.PERIOD){let{end:i,start:e}=r;"string"==typeof i&&(i=new Date(i),i.setMinutes(i.getMinutes()+i.getTimezoneOffset())),"string"==typeof e&&(e=new Date(e),e.setMinutes(e.getMinutes()+e.getTimezoneOffset()));const s=new Intl.DateTimeFormat("pt-BR");if(i&&e){const s=e.getFullYear()===i.getFullYear(),r=Object.assign({day:"2-digit",month:"2-digit"},(!s||t)&&{year:"2-digit"}),a=m.formatDate(e,r),n=m.formatDate(i,r);return t?this.getMessage("snkFilterBar.fullPeriodTooltip",{LABEL:l,START_LABEL:a,END_LABEL:n}):`${l}: ${a} → ${n}`}return e?`${l}: ${this.getMessage("snkFilterBar.onlyStartToltip")} ${s.format(e)}`:i?`${l}: ${this.getMessage("snkFilterBar.onlyEndToltip")} ${s.format(i)}`:l}if(s===z.SEARCH)return`${l}: ${r.value} - ${r.label}`;if(s===z.PERSONALIZED){const t=this.calculateActiveCount(n);return t<=0?l:`${l}: ${this.getMessage("snkFilterBar.personalizedCount",{activeCount:t})}`}if(s===z.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===z.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===z.NUMBER&&a.variation===C.INTERVAL){const{start:t,end:i}=r;if(!isNaN(t)&&!isNaN(i))return this.getMessage("snkFilterBar.fullIntervalTooltip",{LABEL:l,START_LABEL:t,END_LABEL:i});if(!isNaN(t))return`${l}: ${this.getMessage("snkFilterBar.onlyStartToltip")} ${Number(t)}`;if(!isNaN(i))return`${l}: ${this.getMessage("snkFilterBar.onlyEndToltip")} ${Number(i)}`}return this.config.mask?`${l}: ${new p(this.config.mask).format(r)}`:`${l}: ${r}`}return l}getLabelFromCheckedOptions(t,i,e){const s=t.length;return 0===s?`${i}`:s>1?e?`${i}: ${t.map((t=>t.label)).join(",")}`:`${i}: ${s} ${this.getMessage("snkFilterBar.multiListToltip")}`:`${i}: ${t[0].label}`}calculateActiveCount(t){return t.reduce(((t,i)=>i.visible?t+1:t),0)}componentDidLoad(){this._filterItemElement&&(h.addIDInfo(this._filterItemElement),this._idSnkFilterDetail=`filterDetail_${this.config.id}`)}canClearFilter(){const{value:t,groupedItems:i=[]}=this.config;return null!=t&&this.config.type===z.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 z.PERIOD:return"calendar";case z.PERSONALIZED:return"tune"}}hasActiveElements(t){var i;const e=Array.isArray(t)?t:null==t?void 0:t.elements;return(null===(i=null==e?void 0:e.filter((t=>null==t?void 0:t.check)))||void 0===i?void 0:i.length)>0}hasActiveValue(t){var i,e;return t.type===z.PERIOD?!!(null===(i=t.value)||void 0===i?void 0:i.start)||!!(null===(e=t.value)||void 0===e?void 0:e.end):t.type!==z.MULTI_LIST&&void 0!==t.value||this.hasActiveElements(t.value)}getEnabledChip(){if(this.detailIsVisible)return!0;if(this.config.type===z.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===z.MULTI_LIST?this.hasActiveElements(this.config.value):null!=this.config.value}getTooltipMessage(){var t,i;return this.config.required&&!this.hasValue()?{message:null!==(t=this.config.requiredMessage)&&void 0!==t?t:this.getCustomMessage("validations.requiredFilter"),type:"error"}:!1===this.config.enabled&&this.config.disabledMessage?{message:this.config.disabledMessage,type:"warning"}:{message:null!==(i=this.config.defaultMessage)&&void 0!==i?i:this.getLabel(!0),type:"default"}}getTypeChip(t){switch(t){case"default":return"secondary";case"warning":return"warning-light";case"error":return"error-light";case"success":return"success-light";default:return t}}initKeyboardManager(){this._keyboardManager=new v({element:this._filterItemElement,propagate:!0}),this._keyboardManager.bind("Escape",(()=>this.hideDetail()))}connectedCallback(){this.initKeyboardManager()}disconnectedCallback(){this._keyboardManager.unbindAllShortcutKeys()}render(){const t=this.getLeftIconName(),{type:i,message:r}=this.getTooltipMessage();return e(s,null,this.showChips&&e("ez-tooltip",{id:this.config.id,message:r,type:i,active:!this.detailIsVisible,strategy:"fixed"},e("ez-chip",{id:this.config.id,ref:t=>this._chipElement=t,label:this.getLabel(),value:this.getEnabledChip(),onClick:t=>this.togglePopover(t),disableAutoUpdateValue:!0,type:this.getTypeChip(i),enabled:this.config.enabled},t&&e("ez-icon",{ref:t=>this._leftIconElement=t,iconName:t,slot:"leftIcon"}),e("ez-icon",{ref:t=>this._rightIconElement=t,iconName:this.getRightIconName(),slot:"rightIcon",id:"removeFilter",onClick:t=>this.clearFilter(t)}))),e("ez-popover-core",{ref:t=>this._popover=t,onEzVisibilityChange:t=>this.handleVisibilityPopover(t)},e("snk-filter-detail",{ref:t=>this._filterDetail=t,key:this.config.id,config:this.config,getMessage:this.getMessage,class:"sc-snk-filter-bar snk-filter__popover ez-padding--small ez-elevation--16","data-element-id":this._idSnkFilterDetail,showHardFixed:this.showChips&&!this.config.required,removalBlocked:this.config.required})))}get _filterItemElement(){return r(this)}static get watchers(){return{detailIsVisible:["observeDetailIsVisible"]}}};D.style="ez-popover-core.sc-snk-filter-item{--ez-popover__box--z-index:var(--elevation--20, 20);--ez-popover__box--overlay-z-index:var(--elevation--16, 16)}";const S="__SHOWMORE__",B=class{constructor(e){t(this,e),this.snkItemSelected=i(this,"snkItemSelected",7),this._preselection=-1,this.innerClickCheck=(t,i)=>i.id!=b.MODAL_ELEMENT_ID||(this._detailIsVisible=!1,!1),this._filterArgument=void 0,this._showAll=void 0,this.label=void 0,this.iconName=void 0,this.items=void 0,this.getMessage=void 0,this.emptyText=void 0,this.findFilterText=void 0,this.buttonClass=void 0}showDetail(){this._preselection=-1,this._floatingID=b.float(this._popover,this._popoverContainer,{autoClose:!0,innerClickTest:this.innerClickCheck,backClickListener:()=>this.onListCloseCallback(),useOverlay:!0}),this._detailIsVisible=!0,this._showAll=!1,this._filterArgument="",this._filterInput.setFocus()}async hideDetail(){null!=this._floatingID&&b.close(this._floatingID)}onListCloseCallback(){this._floatingID=void 0,this._detailIsVisible=!1}buttonClick(){this._detailIsVisible?this.hideDetail():this.showDetail()}componentDidLoad(){this._element&&h.addIDInfo(this._element)}componentDidRender(){null==this._floatingID&&this._popover&&this._popover.remove()}buildIdElement(t,i){if(!t)return;const e={id:i};t.removeAttribute(h.DATA_ELEMENT_ID_ATTRIBUTE_NAME),h.addIDInfoIfNotExists(t,"filterItemList",e)}buildItemElement(t){const i=++this._selectableItemsCount;return e("button",{ref:i=>i&&this.buildIdElement(i,t.label),id:`filter-item${i}`,onFocusin:()=>this._preselection=i,class:"ez-col ez-col--sd-12 ez-align--middle ez-padding--small sc-snk-filter-bar snk-filter-bar__filter-list-item",onClick:()=>this.itemSelected(t.name),name:t.label,key:i},t.iconName?e("ez-icon",{iconName:t.iconName,size:"small",class:`ez-padding-right--extra-small sc-snk-filter-bar snk-filter-bar__filter-list-item__icon ${t.iconClass||""}`}):void 0,e("div",{class:`ez-text ez-text--medium ez-text--primary ez-padding--extra-small sc-snk-filter-bar snk-filter-bar__filter-list-item__label ${t.labelClass||""}`},t.label))}itemSelected(t){t===S?this._showAll=!0:(this.hideDetail(),this.snkItemSelected.emit(t))}getFilterItems(){const t=this.items?g.applyStringFilter(this._filterArgument,this.items.filter((t=>"FILTER"===t.kind))):[];return 0===t.length?e("div",{class:"ez-text ez-text--medium ez-text--primary ez-padding--extra-small sc-snk-filter-bar snk-filter-bar__filter-list-items-container--empty"},this.emptyText):(!this._filterArgument&&!this._showAll&&t.length>6&&(t.splice(5),t.push({kind:"INTERNAL",label:this.getMessage("snkFilterList.showMore"),iconName:"dots-horizontal",name:S,iconClass:"snk-filter-bar__filter-list-item__icon--secondary",labelClass:"snk-filter-bar__filter-list-item__label--secondary"})),this._selectableItemsCount=0,e("div",{class:"sc-snk-filter-bar snk-filter-bar__filter-list-items-container"},t.map((t=>this.buildItemElement(t)))))}getFooterItems(){return this.items.filter((t=>"FOOTER"===t.kind))}keyDownHandler(t){switch(t.key){case"ArrowDown":this.changePreselection(this._preselection+1),t.stopImmediatePropagation(),t.stopPropagation(),t.preventDefault();break;case"ArrowUp":this.changePreselection(this._preselection-1),t.stopImmediatePropagation(),t.stopPropagation(),t.preventDefault()}}changePreselection(t){if(t<0&&(t=this._selectableItemsCount),this._preselection=t>this._selectableItemsCount?0:t,0===this._preselection)this._filterInput.setFocus();else{const t=this._element.querySelector(`#filter-item${this._preselection}`);t&&t.focus()}}render(){return e(s,{class:"ez-flex ez-flex--column"},e("ez-button",{class:this.buttonClass,label:this.label,onClick:()=>this.buttonClick(),mode:this.iconName?"icon":void 0,iconName:this.iconName,size:"small"},e("slot",{name:"leftIcon"})),e("section",{class:"ez-margin-top--small sc-snk-filter-bar snk-filter__popover-container",ref:t=>this._popoverContainer=t},e("div",{class:"sc-snk-filter-bar snk-filter__popover ez-padding--small ez-elevation--4",ref:t=>this._popover=t},e("ez-filter-input",{ref:t=>this._filterInput=t,"data-element-id":"serachFilters",mode:"slim",label:this.findFilterText,value:this._filterArgument,onEzChange:t=>this._filterArgument=t.detail,onFocus:()=>this._preselection=0}),this.getFilterItems(),e("hr",{class:"sc-snk-filter-bar snk-filter__popover-rule"}),this.items?this.getFooterItems().map((t=>this.buildItemElement(t))):void 0)))}get _element(){return r(this)}},E=class{constructor(i){t(this,i),this._isUserSup=!1,this.filters=[],this.filtersWithError=[],this.getMessage=void 0,this.configName=void 0,this.filterConfig=void 0,this.opened=!1,this.applyFilters=void 0,this.closeModal=void 0,this.addPersonalizedFilter=void 0,this.editPersonalizedFilter=void 0,this.deletePersonalizedFilter=void 0,this.filtersToDelete=[],this.filterDefaultToDelete=void 0,this.disablePersonalizedFilter=void 0,this.filterCustomConfigInterceptor=void 0}filterConfigChangeHandler(t){this.filters=o.copy(t),this.validateFilters()}deletePersonalizedFilterListener(t){this.filtersToDelete.push(t.detail)}getCustomMessage(t,i){var e;return null===(e=this.getMessage)||void 0===e?void 0:e.call(this,`snkFilterBar.filterModal.${t}`,i)}handleClearAll(){const{customFilters:t,quickFilters:i,otherFilters:e,multiListFilters:s}=this.filters.reduce(((t,i)=>i.type===z.MULTI_LIST?(t.multiListFilters.push(i),t):i.filterType===T.QUICK_FILTER?(t.quickFilters.push(i),t):i.filterType===T.CUSTOM_FILTER?(t.customFilters.push(i),t):i.filterType===T.OTHER_FILTERS?(t.otherFilters.push(i),t):t),{quickFilters:[],customFilters:[],otherFilters:[],multiListFilters:[]});this.handleClearFilterList(i),this.handleClearCustomFilters(t),this.handleClearOthersFilters(e),s.forEach((t=>this.handleClearSigleFilter(t))),l(this)}handleClearOthersFilters(t){this.filters=this.filters.map((i=>t.includes(i)?Object.assign(Object.assign({},i),{value:void 0}):i))}handleClearCustomFilters(t){this.filters.forEach(((i,e)=>{i.filterType===T.CUSTOM_FILTER&&(this.filters[e]=this.clearAllCustomFilter(t).shift())}))}clearAllCustomFilter(t){return t.map((t=>{const i=Object.assign({},t);return delete i.value,i.visible=!1,i.groupedItems&&(i.groupedItems=this.clearAllCustomFilter(i.groupedItems)),i}))}hasChangeToSave(){return o.objectToString(this.filters)!=o.objectToString(this.filters)}handleClose(){if(this.hasChangeToSave())return $.confirm(this.getCustomMessage("validations.notSaved.title"),this.getCustomMessage("validations.notSaved.message")).then((t=>{t&&this.closeModal()}));this.closeModal()}handleApplyFilters(){if(!this.validateFilters())return;const t=this.filters.find((t=>t.filterType===T.CUSTOM_FILTER||t.filterType===T.DEFAULT_FILTER));this.isValidCustomFilter(t)&&this.applyFilters(this.filters),this.filtersToDelete.length>0&&(this.filtersToDelete.forEach((t=>{this.deletePersonalizedFilter(t,this.configName)})),this.filtersToDelete=[]),this.filterDefaultToDelete&&(this.deletePersonalizedFilter(this.filterDefaultToDelete,this.configName,!0),this._defaultFilter=void 0,this.filterDefaultToDelete=void 0)}isValidCustomFilter(t){return!!F.validateVariableValues(t)||($.alert(this.getCustomMessage("validations.notFullFilled.title"),this.getCustomMessage("validations.notFullFilled.message")),!1)}modalActionListener(t){switch(t.detail){case I.CANCEL:this.handleClearAll();break;case I.OK:this.handleApplyFilters();break;case I.CLOSE:this.handleClose()}}handleFilterChange(t){t.stopPropagation();const i=t.detail;let e=this.filters.map((t=>t.id===i.id?i:t));this.filterCustomConfigInterceptor&&(e=this.filterCustomConfigInterceptor(e)),this.filters=o.copy(e)}handleClearFilterList(t){this.filters=this.filters.map((i=>t.includes(i)?Object.assign(Object.assign({},i),{value:void 0}):i))}handleClearSigleFilter(t){if(z.MULTI_LIST===t.type){let i=o.copy(t);this.uncheckFilterValues(i.value);const e=o.copy(this.filters),s=e.findIndex((i=>i.id===t.id));return e.splice(s,1,i),void(this.filters=o.copy(e))}if(z.CHECK_BOX_LIST===t.type){const i=o.copy(this.filters);return i.find((i=>i.id===t.id)).value=void 0,void(this.filters=o.copy(i))}this.filters.find((i=>i.id===t.id)).value=void 0,this.filters=o.copy(this.filters)}uncheckFilterValues(t){return t.forEach((t=>{t&&(t.check=!1)})),t}validateFilters(){const t=L(this.filters);return this.filtersWithError=t.map((t=>t.id)),0===t.length||(t.forEach((t=>{const i=this._element.querySelector(`#filter-item-${t.id}`);i&&(i.errorMessage=t.requiredMessage||this.getCustomMessage("validations.requiredFilter"))})),!1)}renderFilterItem(t,i){return e("snk-filter-modal-item",{key:`modal-item-${t.id}`,class:i?"ez-col ez-col--sd-12":"ez-col ez-col--sd-6 ez-padding--small",filterItem:t,configName:this.configName,onFilterChange:t=>this.handleFilterChange(t),onEditPersonalizedFilter:t=>this.editPersonalizedFilter(t.detail),onAddPersonalizedFilter:()=>this.addPersonalizedFilter()})}isDefaultFilterNumberVariation(t){var i;return t.type===z.NUMBER&&(!t.props.variation||(null===(i=t.props)||void 0===i?void 0:i.variation)===C.DEFAULT)}mountFiltersLines(t){let i=0,e=!1;const s={};for(let r=0;r<t.length;r++){s[i]=s[i]||[];const l=t[r],a=r===t.length-1,n=l.type===z.TEXT||this.isDefaultFilterNumberVariation(l),o=!a&&(t[r+1].type===z.TEXT||this.isDefaultFilterNumberVariation(t[r+1]));n&&o||e?(s[i].push(l),e=s[i].length<2,2===s[i].length&&++i):(s[i]=s[i]||[],s[i].push(l),++i)}return Object.values(s)}renderFilterLine(t){const i=1===t.length;return t.map((t=>this.renderFilterItem(t,i)))}getIformedFiltersCount(t){let i=0;return t.forEach((t=>{var e,s,r,l,a,n,o,h;const d=this.filterConfig.find((i=>i.id===t.id));z.MULTI_LIST!==d.type?z.CHECK_BOX_LIST!==d.type?z.PERIOD!==d.type?null==d.groupedItems?d.value&&i++:i=d.groupedItems.filter((t=>t.visible)).length:((null===(o=d.value)||void 0===o?void 0:o.start)||(null===(h=d.value)||void 0===h?void 0:h.end))&&i++:i+=Object.entries(null!==(n=d.value)&&void 0!==n?n:{}).filter((([t,i])=>!0===i)).map((([t,i])=>t)).length:i+=null!==(a=null===(l=null===(r=null!==(s=null===(e=d.value)||void 0===e?void 0:e.elements)&&void 0!==s?s:d.value)||void 0===r?void 0:r.filter((t=>null==t?void 0:t.check)))||void 0===l?void 0:l.length)&&void 0!==a?a:0})),i}renderCollapsibleFilterBox(t,i,s,r=!0){if(!i.length)return null;const l=this.getIformedFiltersCount(i),a=this.mountFiltersLines(i),n=this.filtersWithError.filter((t=>i.some((i=>i.id===t)))).length;return e("ez-collapsible-box",{class:"snk-filter-modal__collapsible-box",headerSize:"medium",value:!0,label:t},e("div",{class:"ez-flex ez-flex--justify-end grow",slot:"rightSlot"},!!l&&e("ez-badge",{class:"ez-badge--primary-subtle",label:null==l?void 0:l.toString()}),!!n&&e("ez-badge",{class:"ez-badge--error-subtle",label:null==n?void 0:n.toString()})),e("div",{class:"ez-row snk-filter-modal__rendered-items"},a.map(this.renderFilterLine.bind(this))),r&&e("div",{class:"ez-flex ez-flex--justify-end grow"},e("ez-button",{class:"ez-button--tertiary",size:"medium",label:this.getCustomMessage("clearModal"),onClick:()=>s?this.handleClearSigleFilter(i[0]):this.handleClearFilterList(i)})))}handleDeleteFilter(){this._application.confirm(this.getMessage("snkPersonalizedFilter.deleteConfirm.title"),this.getMessage("snkPersonalizedFilter.info.deleteDefaultFilterConfirm"),"alert-circle-inverted","critical").then((t=>{t&&(this.filterDefaultToDelete=this._defaultFilter,this.filters=this.filters.filter((t=>t.id!==T.DEFAULT_FILTER)))}))}handleActionSelectedDefaultFilter({detail:t}){switch(t){case N.CREATE:this.addPersonalizedFilter(!0);break;case N.EDIT:this.editPersonalizedFilter(this._defaultFilter.id,!0);break;case N.REMOVE:this.handleDeleteFilter()}}getCustomFilter(t){return t.filter((t=>t.filterType===T.CUSTOM_FILTER))}getDefaultFilter(t){return t.find((t=>t.id===w.id))}async componentWillLoad(){this._application=c.getContextValue("__SNK__APPLICATION__"),this._isUserSup=await this._application.isUserSup(),this.filters=o.copy(this.filterConfig)}componentWillRender(){this._modalTitle=this.getCustomMessage("title"),this._okButtonLabel=this.getCustomMessage("okButtonLabel"),this._cancelButtonLabel=this.getCustomMessage("cancelButtonLabel")}componentDidLoad(){this.validateFilters()}render(){this._defaultFilter=this._isUserSup?this.getDefaultFilter(this.filters):void 0;const t=this.getCustomFilter(this.filters),i=this.filters.filter((t=>t.filterType===T.QUICK_FILTER)),s=this.filters.filter((t=>t.filterType===T.OTHER_FILTERS));return e("ez-modal",{opened:this.opened,modalSize:"col--sd-3",align:"right",heightMode:"full",closeEsc:!0},e("ez-modal-container",{class:"snk-filter-modal__container",modalTitle:this._modalTitle,cancelButtonLabel:this._cancelButtonLabel,okButtonLabel:this._okButtonLabel,onEzModalAction:this.modalActionListener.bind(this)},e("div",{class:"snk-filter-modal__content ez-col--sd-12"},this._isUserSup&&e("snk-default-filter",{getMessage:this.getCustomMessage.bind(this),hasDefaultFilter:!!this._defaultFilter,onActionSelected:this.handleActionSelectedDefaultFilter.bind(this)}),!this.disablePersonalizedFilter&&this.renderCollapsibleFilterBox(this.getCustomMessage("customFilters"),t,!1,!1),this.renderCollapsibleFilterBox(this.getCustomMessage("quickFilters"),i,!1),s.map((t=>this.renderCollapsibleFilterBox(t.label,[t],!0))))))}get _element(){return r(this)}static get watchers(){return{filterConfig:["filterConfigChangeHandler"]}}};E.style="ez-modal{--ez-modal-content-padding:24px 12px}.snk-filter-modal__container{min-width:344px;overflow:hidden}.snk-filter-modal__content{display:flex;flex-direction:column;gap:var(--space--medium, 12px);padding-right:var(--space--3xs, 4px)}.snk-filter-modal__collapsible-box{border:var(--border--small, 1px solid) var(--color--strokes, #DCE0E8);border-radius:var(--border--radius-medium);padding:var(--space--medium, 12px) var(--space--small, 6px)}.snk-filter-modal__rendered-items{max-height:760px}.snk-filter-modal__rendered-items::-webkit-scrollbar{width:var(--space--small);min-width:var(--space--small);max-width:var(--space--small)}";export{P as snk_filter_bar,D as snk_filter_item,B as snk_filter_list,E as snk_filter_modal}
Binary file
@@ -1 +1 @@
1
- import{r as t,h as e,H as i,g as s}from"./p-d8d8169b.js";import{ApplicationContext as o,ObjectUtils as r,UserInterface as n,DataType as l,ElementIDUtils as a}from"@sankhyalabs/core";import{ApplicationUtils as d,DialogType as h}from"@sankhyalabs/ezui/dist/collection/utils";import{I as c}from"./p-8f3f2306.js";import{D as u,a as p,b as m}from"./p-0f3698af.js";import{R as v}from"./p-9019a32f.js";import{D as x}from"./p-42dde1ec.js";import{S as g}from"./p-95888078.js";import"./p-4db51d85.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"./p-8d884fab.js";import"@sankhyalabs/core/dist/dataunit/metadata/DataType";import"./p-7dd49d15.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";class f{constructor(t,e){this._selectedNumber=0,this._getMessage=t,this._selectedNumber=e}setExportOption(t,e){const i=this.getExportGroupName();t===u.EXPORT_TO_PDF&&e.push(this.getExportToPDF(i)),t===u.EXPORT_TO_XLS&&e.push(this.getExportToXLS(i)),this.setExportCurrentPage(t,e),this._selectedNumber>0&&this.setExportAllRecords(t,e),this.setExportByEmail(t,e)}setExportCurrentPage(t,e){var i;const s=[u.EXPORT_PAGE_TO_PDF,u.EXPORT_PAGE_TO_XLS];if(t===u.EXPORT_CURRENT_PAGE&&e.push(this.getCurrentPage()),s.includes(t)){let s=e.find((t=>t.id===u.EXPORT_CURRENT_PAGE));null==s&&(e.push(this.getCurrentPage()),s=e.find((t=>t.id===u.EXPORT_CURRENT_PAGE))),(null===(i=null==s?void 0:s.children)||void 0===i?void 0:i.length)||(s.children=[]),t===u.EXPORT_PAGE_TO_PDF&&s.children.push(this.getExportPageToPDF()),t===u.EXPORT_PAGE_TO_XLS&&s.children.push(this.getExportPageToXLS())}}setExportAllRecords(t,e){var i;const s=[u.EXPORT_ALL_RECORDS_TO_PDF,u.EXPORT_ALL_RECORDS_TO_XLS];if(t===u.EXPORT_ALL_RECORDS&&e.push(this.getAllRecords()),s.includes(t)){let s=e.find((t=>t.id===u.EXPORT_ALL_RECORDS));null==s&&(e.push(this.getAllRecords()),s=e.find((t=>t.id===u.EXPORT_ALL_RECORDS))),(null===(i=s.children)||void 0===i?void 0:i.length)||(s.children=[]),t===u.EXPORT_ALL_RECORDS_TO_PDF&&s.children.push(this.getExportAllRecordsToPDF()),t===u.EXPORT_ALL_RECORDS_TO_XLS&&s.children.push(this.getExportAllRecordsToXLS())}}setExportByEmail(t,e){t===u.EXPORT_BY_EMAIL&&e.push(this.getExportByEmail())}getExportToPDF(t){return{id:u.EXPORT_TO_PDF,label:"PDF (.pdf)",group:t}}getExportToXLS(t){return{id:u.EXPORT_TO_XLS,label:`${this._getMessage("snkDataExporter.label.spreadsheet")} (.xls)`,group:t}}getCurrentPage(){return{id:u.EXPORT_CURRENT_PAGE,label:this._getMessage("snkDataExporter.label.currentPage"),group:this._getMessage("snkDataExporter.group.custom")}}getAllRecords(){return{id:u.EXPORT_ALL_RECORDS,label:this._getMessage("snkDataExporter.label.allRecords"),group:this._getMessage("snkDataExporter.group.custom")}}getExportPageToPDF(){return{id:u.EXPORT_PAGE_TO_PDF,label:"PDF (.pdf)"}}getExportPageToXLS(){return{id:u.EXPORT_PAGE_TO_XLS,label:`${this._getMessage("snkDataExporter.label.spreadsheet")} (.xls)`}}getExportAllRecordsToPDF(){return{id:u.EXPORT_ALL_RECORDS_TO_PDF,label:"PDF (.pdf)"}}getExportAllRecordsToXLS(){return{id:u.EXPORT_ALL_RECORDS_TO_XLS,label:`${this._getMessage("snkDataExporter.label.spreadsheet")} (.xlsx)`}}getExportByEmail(){return{id:u.EXPORT_BY_EMAIL,label:`${this._getMessage("snkDataExporter.label.sendByEmail")}...`}}getExportGroupName(){return 1===this._selectedNumber?this._getMessage("snkDataExporter.group.export.selectedLine"):this._selectedNumber>1?this._getMessage("snkDataExporter.group.export.multiSelected").replace("{0}",this._selectedNumber.toString()):this._getMessage("snkDataExporter.group.export.default")}}function b(t){const e=[];let i=0;for(const s of t){if(i+=s.width,i>=860)break;e.push(s)}return e}function E(t){return Object.keys(u).find((e=>u[e]===t))}class w{constructor(t){this._provider=t}async getParsedColumns(){return b(await this._provider.getColumnsMetadata())}async getColumns(t){var e;return(null===(e=E(null==t?void 0:t.exportOption))||void 0===e?void 0:e.includes("PDF"))?await this.getParsedColumns():await this._provider.getColumnsMetadata()}async getParams(t){var e,i,s,o,r,n;const l=null===(i=(e=this._provider).getFilters)||void 0===i?void 0:i.call(e),a=await this.getColumns(t),d=null===(o=(s=this._provider).getOrders)||void 0===o?void 0:o.call(s),h=null===(n=(r=this._provider).getResourceURI)||void 0===n?void 0:n.call(r),c=this._provider.getSelectedIDs(),p=t.exportOption,m=[u.EXPORT_PAGE_TO_PDF,u.EXPORT_PAGE_TO_XLS];delete t.exportOption;let v=Object.assign({filters:l,columns:a,sort:d,resourceURI:h,selectedIDs:c.slice(0,this._provider.getExportLimit())},t);if(m.includes(p)||"page"==t.type){const t=this._provider.getOffset(),e=this._provider.getPageSize();v=Object.assign(Object.assign({},v),{offset:t,limit:e,selectedIDs:[]})}else"all"==t.type&&(v=Object.assign(Object.assign({},v),{offset:0,limit:this._provider.getExportLimit(),selectedIDs:[]}));return Promise.resolve(v)}async executeExport(t){const e=await this.getParams(t),{methodName:i}=e,s=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(s=Object.getOwnPropertySymbols(t);o<s.length;o++)e.indexOf(s[o])<0&&Object.prototype.propertyIsEnumerable.call(t,s[o])&&(i[s[o]]=t[s[o]])}return i}(e,["methodName"]),n=`${o.getContextValue("__SNK__APPLICATION__").getModuleName()}@DataExporterSPBean.${i}`,l={serviceName:n,requestBody:s};return new Promise(((t,e)=>{x.get().callServiceBroker(n,r.objectToString(l)).then((e=>t(this.getFormatResponse(e)))).catch((t=>e(t)))}))}getFormatResponse(t){var e;const i=null===(e=null==t?void 0:t.json)||void 0===e?void 0:e.$;if(null!=i)return r.stringToObject(i)}}class D{constructor(t){this._provider=t}async getParsedColumns(){return b(await this._provider.getColumnsMetadata())}async executeExport(t){var e;const{methodName:i,gridTitle:s}=t,o=await this._provider.getRecords(t.type),r=(null===(e=E(null==t?void 0:t.exportOption))||void 0===e?void 0:e.includes("PDF"))?await this.getParsedColumns():await this._provider.getColumnsMetadata(),[n,l]=this.getExecutor(i),a={serviceName:n,requestBody:{grid:{gridTitle:s,columns:this.buildColumnsObject(r),rows:this.buildRowsObject(r,o),customOptions:{xlsxExtension:!1}}}};return new Promise(((t,e)=>{x.get().callServiceBroker(n,a).then((e=>t(l(e)))).catch((t=>e(t)))}))}getExecutor(t){return"exportToPDF"===t?["GridPDFBuilderSP.buildPDFFromJson",t=>({fileSessionKey:t.chavePDF.valor,canPrint:"S"===t.permiteImprimir.valor,canExport:"S"===t.permiteExportar.valor,canSendEmail:"S"===t.canSendEmail.valor,useAppPrint:!0})]:["GridXLSBuilderSP.buildXLSFromJson",t=>({fileSessionKey:t.chaveXLS.valor,canPrint:!0,canExport:!0,canSendEmail:!0,useAppPrint:!1})]}buildColumnsObject(t){return{column:t.map(((t,e)=>{const{label:i,id:s,width:o,userInterface:r}=t;return Object.assign({index:e+1,id:s,label:i,width:o,presentationType:"P"},k[r]||{type:"S",align:"left"})}))}}buildRowsObject(t,e){return{row:e.map((e=>{const i={};return t.forEach(((t,s)=>i["c"+(s+1)]={$:this.formatValue(e,t)})),i}))}}formatValue(t,e){return null!=this._provider.formatValue?this._provider.formatValue(t,e):t[e.id]||""}}const k={[n.DATE]:{type:"D",align:"center"},[n.DATETIME]:{type:"H",align:"center"},[n.TIME]:{type:"I",align:"right"},[n.ELAPSEDTIME]:{type:"I",align:"right"},[n.DECIMALNUMBER]:{type:"F",align:"right"},[n.INTEGERNUMBER]:{type:"I",align:"right"},[n.SEARCH]:{type:"S",align:"right"}},y=class{constructor(e){t(this,e),this._selectedNumber=0,this._customPrefix="$custom$",this._releasedToExport=[u.EXPORT_TO_PDF,u.EXPORT_TO_XLS,u.EXPORT_BY_EMAIL,u.EXPORT_PDF_TO_EMAIL,u.EXPORT_XLS_TO_EMAIL,u.EXPORT_PAGE_TO_PDF,u.EXPORT_PAGE_TO_XLS,u.EXPORT_ALL_RECORDS_TO_PDF,u.EXPORT_ALL_RECORDS_TO_XLS],this._items=[],this._showDropdown=!1,this.provider=null,this.messagesBuilder=void 0}async exportByEmail(){const t=this._selectedNumber;this._snkEmailSender.open({type:t>0?"selection":"all",selectedRows:t,email:{attachments:[{name:this._appLabel}]},resolver:({type:t,format:e,email:{to:i,subject:s,message:o}})=>{var r;const n=null!==(r=m[null==e?void 0:e.toUpperCase()])&&void 0!==r?r:m.PDF;this.resolveExporter({type:t,methodName:n,to:i,subject:s,message:o,fileName:this._appLabel,gridTitle:this._appLabel},(()=>{this._snkEmailSender.close(),d.info(this.getMessage("snkDataExporter.message.emailSuccess"),{iconName:"check"})}))}})}getMessage(t,e){if(null==this.messagesBuilder){const t=g.getNearestInstance(this._element);t&&(this.messagesBuilder=t.messagesBuilder)}return this.messagesBuilder.getMessage(t,e)}positionDropdown(){var t;const e=null===(t=this._ezButton)||void 0===t?void 0:t.getBoundingClientRect();null!=e&&null!=this._dropdownParent&&(this._dropdownParent.style.top=e.y+e.height+5+"px",this._dropdownParent.style.left=e.x+"px")}closeDropdown(t){const e=null==t?void 0:t.target;null!=e&&(e.closest(".snk-data-exporter")||(this._showDropdown=!1))}setEvents(){document.removeEventListener("click",this.closeDropdown.bind(this)),document.addEventListener("click",this.closeDropdown.bind(this)),document.removeEventListener("scroll",this.positionDropdown.bind(this)),document.addEventListener("scroll",this.positionDropdown.bind(this))}controlDropdown(){this._showDropdown=!this._showDropdown}async resolveExporter(t,e){null!=this.provider&&null!=t&&null!=e&&this.getExporterStrategy().executeExport(t).then((t=>e(t))).catch((t=>{console.error(t);let{title:e,message:i,statusMessage:s}=t||{};d.error(e||this.getMessage("snkDataExporter.message.exportError"),s||i||this.getMessage("snkDataExporter.message.unknownFailure"))}))}getExporterStrategy(){return null==this.provider.getRecords?new w(this.provider):new D(this.provider)}getOptionKey(t){return Object.keys(u).find((e=>u[e]===t))}getExportType(t){return t===u.EXPORT_ALL_RECORDS_TO_PDF||t===u.EXPORT_ALL_RECORDS_TO_XLS?c.ALL:t===u.EXPORT_PAGE_TO_PDF||t===u.EXPORT_PAGE_TO_XLS?c.PAGE:c.SELECTION}async dispatchExporter(t){var e,i,s;const r=this.getOptionKey(t),n=null!==(e=p[r])&&void 0!==e?e:p.EXPORT_TO_PDF,l={methodName:u[`EXPORT_TO_${n}`],fileName:this._appLabel,gridTitle:this._appLabel,exportOption:t,limit:null===(s=null===(i=this.provider)||void 0===i?void 0:i.getExportLimit)||void 0===s?void 0:s.call(i),type:this.getExportType(t)};await this.resolveExporter(l,(t=>{t.canExport||n===p.EXPORT_TO_PDF?function({fileSessionKey:t,isDownload:e}){const i=o.getContextValue("__SNK__APPLICATION__");window.open(`${window.location.protocol}//${window.location.hostname}:${window.location.port}/mge/visualizadorArquivos.mge?chaveArquivo=${t}${e?"&download=S":""}`),d.info(function(t){var e;return null===(e=null==t?void 0:t.messagesBuilder)||void 0===e?void 0:e.getMessage("fileViewer.message.exportSuccess",void 0)}(i),{iconName:"check"})}(Object.assign(Object.assign({},t),{fileType:n})):d.error(this.getMessage("snkDataExporter.title.permission"),this.getMessage("snkDataExporter.message.exportPermission"))}))}async processExporter(t){var e,i,s,o,r,n,l;const a=null==t?void 0:t.detail,c=[u.EXPORT_PAGE_TO_PDF,u.EXPORT_PAGE_TO_XLS],p=null===(e=null==a?void 0:a.id)||void 0===e?void 0:e.includes(this._customPrefix);if((null==a?void 0:a.id)===u.EXPORT_CURRENT_PAGE)return;const m=null===(i=this.provider)||void 0===i?void 0:i.getSelectedIDs(),v=null===(s=this.provider)||void 0===s?void 0:s.getTotalRecords(),x=null===(r=null===(o=this.provider)||void 0===o?void 0:o.getPageSize)||void 0===r?void 0:r.call(o),g=null===(l=null===(n=this.provider)||void 0===n?void 0:n.getExportLimit)||void 0===l?void 0:l.call(n);let f=!1;if(c.includes(null==a?void 0:a.id)&&x<=g||p?f=!1:(null==m?void 0:m.length)?f=m.length>g:v>g&&(f=!0),f){const t=g.toLocaleString("pt-BR",{minimumFractionDigits:0}),e={title:this.getMessage("snkDataExporter.limitExceeded.title"),description:`\n ${this.getMessage("snkDataExporter.limitExceeded.description",{limit:t})}\n <br/><br/>\n <b>\n ${this.getMessage("snkDataExporter.limitExceeded.subdescription")}\n </b>\n `,cancel:this.getMessage("snkDataExporter.limitExceeded.cancel"),confirm:this.getMessage("snkDataExporter.limitExceeded.continue")};if(!await d.confirm(e.title,e.description,null,h.WARN,{labelCancel:e.cancel,labelConfirm:e.confirm}))return}if(p)return this.openPersonalizedReports(a.id),void(this._showDropdown=!1);this.getFilteredReleasedToExport().includes(null==a?void 0:a.id)&&(a.id===u.EXPORT_BY_EMAIL?this.exportByEmail():this.dispatchExporter(a.id),this._showDropdown=!1)}getFilteredReleasedToExport(){var t,e;if(null==this.provider)return this._releasedToExport;const i=null===(e=(t=this.provider).getHiddenOptions)||void 0===e?void 0:e.call(t);return null==i?this._releasedToExport:this._releasedToExport.filter((t=>!i.includes(t)))}loadItems(){const t=[];this.getFilteredReleasedToExport().forEach((e=>{var i;null===(i=this._itemBuilder)||void 0===i||i.setExportOption(e,t)})),this.loadPersonalizedItems(t)}async loadPersonalizedItems(t){var e,i;const s=null===(i=null===(e=this.provider)||void 0===e?void 0:e.getRecordID)||void 0===i?void 0:i.call(e);if(null==s)return void(this._items=t);const n=await function(t){const e=`${o.getContextValue("__SNK__APPLICATION__").getModuleName()}@DataExporterSPBean.getPersonalizedReports`,i={serviceName:e,requestBody:t};return new Promise(((t,s)=>x.get().callServiceBroker(e,r.objectToString(i)).then((e=>t(function(t){var e;const i=null===(e=null==t?void 0:t.json)||void 0===e?void 0:e.$;if(null!=i)return r.stringToObject(i)}(e)))).catch((t=>s(t)))))}({recordID:s});null==n||n.forEach((e=>{t.push({id:`${this._customPrefix}_${e.ID}`,label:e.label,group:this.getMessage("snkDataExporter.group.custom")})})),this._items=t}openPersonalizedReports(t){var e,i;const s=[],o=(null==t?void 0:t.replace(this._customPrefix,""))||"";null===(i=null===(e=this.provider)||void 0===e?void 0:e.getSelectedIDs)||void 0===i||i.call(e).forEach((({name:t,type:e,value:i},o)=>{const r={fields:[]};0===o&&(s[`PK_${t}`]={type:this.parseDataType(e),value:i},s.pks=[]);const n={nome:`PK_${t}`,tipo:this.parseDataType(e),valor:i};r.fields.push(n),s.pks.push(r)})),this._application.openApp(`${v}${o}`,s)}parseDataType(t){switch(t){case l.NUMBER:return"I";case l.DATE:return"D";default:return"S"}}loadDropdown(){var t;this._selectedNumber=(null===(t=this.provider)||void 0===t?void 0:t.getSelectedNumber())||0,this._itemBuilder=new f(this.getMessage.bind(this),this._selectedNumber),this.loadItems()}getElementID(t){return{[a.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:a.getInternalIDInfo(t)}}canShowDropdown(){var t;return this._showDropdown&&(null===(t=this._items)||void 0===t?void 0:t.length)>0}componentWillLoad(){var t;this._application=o.getContextValue("__SNK__APPLICATION__"),null===(t=this._application)||void 0===t||t.getAppLabel().then((t=>this._appLabel=t)),this.setEvents()}componentDidLoad(){null!=this._element&&(a.addIDInfo(this._element),this.positionDropdown())}componentWillUpdate(){var t;this._showDropdown&&!(null===(t=this._items)||void 0===t?void 0:t.length)&&this.loadDropdown()}componentDidUpdate(){var t;this._showDropdown?this.positionDropdown():(null===(t=this._items)||void 0===t?void 0:t.length)>0&&(this._items=[])}render(){return e(i,null,e("div",{class:`snk-data-exporter\n ${this.canShowDropdown()?" ez-elevation--16":""}\n `},e("ez-button",Object.assign({ref:t=>this._ezButton=t,iconName:"file-download",size:"small",mode:"icon",title:this.getMessage("snkDataExporter.group.export.title"),onClick:()=>this.controlDropdown()},this.getElementID("button"))),e("div",Object.assign({ref:t=>this._dropdownParent=t,class:`snk-data-exporter__dropdown\n ${this.canShowDropdown()?"snk-data-exporter__dropdown--show":""}\n `},this.getElementID("dropdown")),this.canShowDropdown()&&e("ez-dropdown",Object.assign({items:this._items,onEzClick:t=>this.processExporter(t)},this.getElementID("dropdown"))))),this.canShowDropdown()&&e("div",Object.assign({class:"ez-scrim ez-scrim--light"},this.getElementID("ezScrim"))),e("snk-exporter-email-sender",Object.assign({ref:t=>this._snkEmailSender=t,getMessage:(t,e)=>this.getMessage(t,e)},this.getElementID("snkExporterEmailSender"))))}get _element(){return s(this)}};y.style=".sc-snk-data-exporter-h{display:flex;width:fit-content;height:fit-content}.snk-data-exporter.sc-snk-data-exporter{display:flex;width:fit-content;height:fit-content}.snk-data-exporter__dropdown.sc-snk-data-exporter{display:none}.snk-data-exporter__dropdown--show.sc-snk-data-exporter{display:flex;flex-direction:column;position:fixed}.snk-data-exporter__dropdown.sc-snk-data-exporter>ez-dropdown.sc-snk-data-exporter{position:relative}";export{y as snk_data_exporter}
1
+ import{r as t,h as e,H as i,g as s}from"./p-d8d8169b.js";import{ApplicationContext as o,ObjectUtils as r,UserInterface as n,DataType as l,ElementIDUtils as a}from"@sankhyalabs/core";import{ApplicationUtils as d,DialogType as h}from"@sankhyalabs/ezui/dist/collection/utils";import{I as c}from"./p-8f3f2306.js";import{D as u,a as p,b as m}from"./p-0f3698af.js";import{R as v}from"./p-9019a32f.js";import{D as x}from"./p-b2212d20.js";import{S as g}from"./p-a42c27d6.js";import"./p-d33a3955.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-8dd0b9ce.js";import"./p-ff1990ad.js";import"./p-e6fe58b7.js";import"./p-8d884fab.js";import"@sankhyalabs/core/dist/dataunit/metadata/DataType";import"./p-7dd49d15.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";class f{constructor(t,e){this._selectedNumber=0,this._getMessage=t,this._selectedNumber=e}setExportOption(t,e){const i=this.getExportGroupName();t===u.EXPORT_TO_PDF&&e.push(this.getExportToPDF(i)),t===u.EXPORT_TO_XLS&&e.push(this.getExportToXLS(i)),this.setExportCurrentPage(t,e),this._selectedNumber>0&&this.setExportAllRecords(t,e),this.setExportByEmail(t,e)}setExportCurrentPage(t,e){var i;const s=[u.EXPORT_PAGE_TO_PDF,u.EXPORT_PAGE_TO_XLS];if(t===u.EXPORT_CURRENT_PAGE&&e.push(this.getCurrentPage()),s.includes(t)){let s=e.find((t=>t.id===u.EXPORT_CURRENT_PAGE));null==s&&(e.push(this.getCurrentPage()),s=e.find((t=>t.id===u.EXPORT_CURRENT_PAGE))),(null===(i=null==s?void 0:s.children)||void 0===i?void 0:i.length)||(s.children=[]),t===u.EXPORT_PAGE_TO_PDF&&s.children.push(this.getExportPageToPDF()),t===u.EXPORT_PAGE_TO_XLS&&s.children.push(this.getExportPageToXLS())}}setExportAllRecords(t,e){var i;const s=[u.EXPORT_ALL_RECORDS_TO_PDF,u.EXPORT_ALL_RECORDS_TO_XLS];if(t===u.EXPORT_ALL_RECORDS&&e.push(this.getAllRecords()),s.includes(t)){let s=e.find((t=>t.id===u.EXPORT_ALL_RECORDS));null==s&&(e.push(this.getAllRecords()),s=e.find((t=>t.id===u.EXPORT_ALL_RECORDS))),(null===(i=s.children)||void 0===i?void 0:i.length)||(s.children=[]),t===u.EXPORT_ALL_RECORDS_TO_PDF&&s.children.push(this.getExportAllRecordsToPDF()),t===u.EXPORT_ALL_RECORDS_TO_XLS&&s.children.push(this.getExportAllRecordsToXLS())}}setExportByEmail(t,e){t===u.EXPORT_BY_EMAIL&&e.push(this.getExportByEmail())}getExportToPDF(t){return{id:u.EXPORT_TO_PDF,label:"PDF (.pdf)",group:t}}getExportToXLS(t){return{id:u.EXPORT_TO_XLS,label:`${this._getMessage("snkDataExporter.label.spreadsheet")} (.xls)`,group:t}}getCurrentPage(){return{id:u.EXPORT_CURRENT_PAGE,label:this._getMessage("snkDataExporter.label.currentPage"),group:this._getMessage("snkDataExporter.group.custom")}}getAllRecords(){return{id:u.EXPORT_ALL_RECORDS,label:this._getMessage("snkDataExporter.label.allRecords"),group:this._getMessage("snkDataExporter.group.custom")}}getExportPageToPDF(){return{id:u.EXPORT_PAGE_TO_PDF,label:"PDF (.pdf)"}}getExportPageToXLS(){return{id:u.EXPORT_PAGE_TO_XLS,label:`${this._getMessage("snkDataExporter.label.spreadsheet")} (.xls)`}}getExportAllRecordsToPDF(){return{id:u.EXPORT_ALL_RECORDS_TO_PDF,label:"PDF (.pdf)"}}getExportAllRecordsToXLS(){return{id:u.EXPORT_ALL_RECORDS_TO_XLS,label:`${this._getMessage("snkDataExporter.label.spreadsheet")} (.xlsx)`}}getExportByEmail(){return{id:u.EXPORT_BY_EMAIL,label:`${this._getMessage("snkDataExporter.label.sendByEmail")}...`}}getExportGroupName(){return 1===this._selectedNumber?this._getMessage("snkDataExporter.group.export.selectedLine"):this._selectedNumber>1?this._getMessage("snkDataExporter.group.export.multiSelected").replace("{0}",this._selectedNumber.toString()):this._getMessage("snkDataExporter.group.export.default")}}function b(t){const e=[];let i=0;for(const s of t){if(i+=s.width,i>=860)break;e.push(s)}return e}function E(t){return Object.keys(u).find((e=>u[e]===t))}class w{constructor(t){this._provider=t}async getParsedColumns(){return b(await this._provider.getColumnsMetadata())}async getColumns(t){var e;return(null===(e=E(null==t?void 0:t.exportOption))||void 0===e?void 0:e.includes("PDF"))?await this.getParsedColumns():await this._provider.getColumnsMetadata()}async getParams(t){var e,i,s,o,r,n;const l=null===(i=(e=this._provider).getFilters)||void 0===i?void 0:i.call(e),a=await this.getColumns(t),d=null===(o=(s=this._provider).getOrders)||void 0===o?void 0:o.call(s),h=null===(n=(r=this._provider).getResourceURI)||void 0===n?void 0:n.call(r),c=this._provider.getSelectedIDs(),p=t.exportOption,m=[u.EXPORT_PAGE_TO_PDF,u.EXPORT_PAGE_TO_XLS];delete t.exportOption;let v=Object.assign({filters:l,columns:a,sort:d,resourceURI:h,selectedIDs:c.slice(0,this._provider.getExportLimit())},t);if(m.includes(p)||"page"==t.type){const t=this._provider.getOffset(),e=this._provider.getPageSize();v=Object.assign(Object.assign({},v),{offset:t,limit:e,selectedIDs:[]})}else"all"==t.type&&(v=Object.assign(Object.assign({},v),{offset:0,limit:this._provider.getExportLimit(),selectedIDs:[]}));return Promise.resolve(v)}async executeExport(t){const e=await this.getParams(t),{methodName:i}=e,s=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(s=Object.getOwnPropertySymbols(t);o<s.length;o++)e.indexOf(s[o])<0&&Object.prototype.propertyIsEnumerable.call(t,s[o])&&(i[s[o]]=t[s[o]])}return i}(e,["methodName"]),n=`${o.getContextValue("__SNK__APPLICATION__").getModuleName()}@DataExporterSPBean.${i}`,l={serviceName:n,requestBody:s};return new Promise(((t,e)=>{x.get().callServiceBroker(n,r.objectToString(l)).then((e=>t(this.getFormatResponse(e)))).catch((t=>e(t)))}))}getFormatResponse(t){var e;const i=null===(e=null==t?void 0:t.json)||void 0===e?void 0:e.$;if(null!=i)return r.stringToObject(i)}}class D{constructor(t){this._provider=t}async getParsedColumns(){return b(await this._provider.getColumnsMetadata())}async executeExport(t){var e;const{methodName:i,gridTitle:s}=t,o=await this._provider.getRecords(t.type),r=(null===(e=E(null==t?void 0:t.exportOption))||void 0===e?void 0:e.includes("PDF"))?await this.getParsedColumns():await this._provider.getColumnsMetadata(),[n,l]=this.getExecutor(i),a={serviceName:n,requestBody:{grid:{gridTitle:s,columns:this.buildColumnsObject(r),rows:this.buildRowsObject(r,o),customOptions:{xlsxExtension:!1}}}};return new Promise(((t,e)=>{x.get().callServiceBroker(n,a).then((e=>t(l(e)))).catch((t=>e(t)))}))}getExecutor(t){return"exportToPDF"===t?["GridPDFBuilderSP.buildPDFFromJson",t=>({fileSessionKey:t.chavePDF.valor,canPrint:"S"===t.permiteImprimir.valor,canExport:"S"===t.permiteExportar.valor,canSendEmail:"S"===t.canSendEmail.valor,useAppPrint:!0})]:["GridXLSBuilderSP.buildXLSFromJson",t=>({fileSessionKey:t.chaveXLS.valor,canPrint:!0,canExport:!0,canSendEmail:!0,useAppPrint:!1})]}buildColumnsObject(t){return{column:t.map(((t,e)=>{const{label:i,id:s,width:o,userInterface:r}=t;return Object.assign({index:e+1,id:s,label:i,width:o,presentationType:"P"},k[r]||{type:"S",align:"left"})}))}}buildRowsObject(t,e){return{row:e.map((e=>{const i={};return t.forEach(((t,s)=>i["c"+(s+1)]={$:this.formatValue(e,t)})),i}))}}formatValue(t,e){return null!=this._provider.formatValue?this._provider.formatValue(t,e):t[e.id]||""}}const k={[n.DATE]:{type:"D",align:"center"},[n.DATETIME]:{type:"H",align:"center"},[n.TIME]:{type:"I",align:"right"},[n.ELAPSEDTIME]:{type:"I",align:"right"},[n.DECIMALNUMBER]:{type:"F",align:"right"},[n.INTEGERNUMBER]:{type:"I",align:"right"},[n.SEARCH]:{type:"S",align:"right"}},y=class{constructor(e){t(this,e),this._selectedNumber=0,this._customPrefix="$custom$",this._releasedToExport=[u.EXPORT_TO_PDF,u.EXPORT_TO_XLS,u.EXPORT_BY_EMAIL,u.EXPORT_PDF_TO_EMAIL,u.EXPORT_XLS_TO_EMAIL,u.EXPORT_PAGE_TO_PDF,u.EXPORT_PAGE_TO_XLS,u.EXPORT_ALL_RECORDS_TO_PDF,u.EXPORT_ALL_RECORDS_TO_XLS],this._items=[],this._showDropdown=!1,this.provider=null,this.messagesBuilder=void 0}async exportByEmail(){const t=this._selectedNumber;this._snkEmailSender.open({type:t>0?"selection":"all",selectedRows:t,email:{attachments:[{name:this._appLabel}]},resolver:({type:t,format:e,email:{to:i,subject:s,message:o}})=>{var r;const n=null!==(r=m[null==e?void 0:e.toUpperCase()])&&void 0!==r?r:m.PDF;this.resolveExporter({type:t,methodName:n,to:i,subject:s,message:o,fileName:this._appLabel,gridTitle:this._appLabel},(()=>{this._snkEmailSender.close(),d.info(this.getMessage("snkDataExporter.message.emailSuccess"),{iconName:"check"})}))}})}getMessage(t,e){if(null==this.messagesBuilder){const t=g.getNearestInstance(this._element);t&&(this.messagesBuilder=t.messagesBuilder)}return this.messagesBuilder.getMessage(t,e)}positionDropdown(){var t;const e=null===(t=this._ezButton)||void 0===t?void 0:t.getBoundingClientRect();null!=e&&null!=this._dropdownParent&&(this._dropdownParent.style.top=e.y+e.height+5+"px",this._dropdownParent.style.left=e.x+"px")}closeDropdown(t){const e=null==t?void 0:t.target;null!=e&&(e.closest(".snk-data-exporter")||(this._showDropdown=!1))}setEvents(){document.removeEventListener("click",this.closeDropdown.bind(this)),document.addEventListener("click",this.closeDropdown.bind(this)),document.removeEventListener("scroll",this.positionDropdown.bind(this)),document.addEventListener("scroll",this.positionDropdown.bind(this))}controlDropdown(){this._showDropdown=!this._showDropdown}async resolveExporter(t,e){null!=this.provider&&null!=t&&null!=e&&this.getExporterStrategy().executeExport(t).then((t=>e(t))).catch((t=>{console.error(t);let{title:e,message:i,statusMessage:s}=t||{};d.error(e||this.getMessage("snkDataExporter.message.exportError"),s||i||this.getMessage("snkDataExporter.message.unknownFailure"))}))}getExporterStrategy(){return null==this.provider.getRecords?new w(this.provider):new D(this.provider)}getOptionKey(t){return Object.keys(u).find((e=>u[e]===t))}getExportType(t){return t===u.EXPORT_ALL_RECORDS_TO_PDF||t===u.EXPORT_ALL_RECORDS_TO_XLS?c.ALL:t===u.EXPORT_PAGE_TO_PDF||t===u.EXPORT_PAGE_TO_XLS?c.PAGE:c.SELECTION}async dispatchExporter(t){var e,i,s;const r=this.getOptionKey(t),n=null!==(e=p[r])&&void 0!==e?e:p.EXPORT_TO_PDF,l={methodName:u[`EXPORT_TO_${n}`],fileName:this._appLabel,gridTitle:this._appLabel,exportOption:t,limit:null===(s=null===(i=this.provider)||void 0===i?void 0:i.getExportLimit)||void 0===s?void 0:s.call(i),type:this.getExportType(t)};await this.resolveExporter(l,(t=>{t.canExport||n===p.EXPORT_TO_PDF?function({fileSessionKey:t,isDownload:e}){const i=o.getContextValue("__SNK__APPLICATION__");window.open(`${window.location.protocol}//${window.location.hostname}:${window.location.port}/mge/visualizadorArquivos.mge?chaveArquivo=${t}${e?"&download=S":""}`),d.info(function(t){var e;return null===(e=null==t?void 0:t.messagesBuilder)||void 0===e?void 0:e.getMessage("fileViewer.message.exportSuccess",void 0)}(i),{iconName:"check"})}(Object.assign(Object.assign({},t),{fileType:n})):d.error(this.getMessage("snkDataExporter.title.permission"),this.getMessage("snkDataExporter.message.exportPermission"))}))}async processExporter(t){var e,i,s,o,r,n,l;const a=null==t?void 0:t.detail,c=[u.EXPORT_PAGE_TO_PDF,u.EXPORT_PAGE_TO_XLS],p=null===(e=null==a?void 0:a.id)||void 0===e?void 0:e.includes(this._customPrefix);if((null==a?void 0:a.id)===u.EXPORT_CURRENT_PAGE)return;const m=null===(i=this.provider)||void 0===i?void 0:i.getSelectedIDs(),v=null===(s=this.provider)||void 0===s?void 0:s.getTotalRecords(),x=null===(r=null===(o=this.provider)||void 0===o?void 0:o.getPageSize)||void 0===r?void 0:r.call(o),g=null===(l=null===(n=this.provider)||void 0===n?void 0:n.getExportLimit)||void 0===l?void 0:l.call(n);let f=!1;if(c.includes(null==a?void 0:a.id)&&x<=g||p?f=!1:(null==m?void 0:m.length)?f=m.length>g:v>g&&(f=!0),f){const t=g.toLocaleString("pt-BR",{minimumFractionDigits:0}),e={title:this.getMessage("snkDataExporter.limitExceeded.title"),description:`\n ${this.getMessage("snkDataExporter.limitExceeded.description",{limit:t})}\n <br/><br/>\n <b>\n ${this.getMessage("snkDataExporter.limitExceeded.subdescription")}\n </b>\n `,cancel:this.getMessage("snkDataExporter.limitExceeded.cancel"),confirm:this.getMessage("snkDataExporter.limitExceeded.continue")};if(!await d.confirm(e.title,e.description,null,h.WARN,{labelCancel:e.cancel,labelConfirm:e.confirm}))return}if(p)return this.openPersonalizedReports(a.id),void(this._showDropdown=!1);this.getFilteredReleasedToExport().includes(null==a?void 0:a.id)&&(a.id===u.EXPORT_BY_EMAIL?this.exportByEmail():this.dispatchExporter(a.id),this._showDropdown=!1)}getFilteredReleasedToExport(){var t,e;if(null==this.provider)return this._releasedToExport;const i=null===(e=(t=this.provider).getHiddenOptions)||void 0===e?void 0:e.call(t);return null==i?this._releasedToExport:this._releasedToExport.filter((t=>!i.includes(t)))}loadItems(){const t=[];this.getFilteredReleasedToExport().forEach((e=>{var i;null===(i=this._itemBuilder)||void 0===i||i.setExportOption(e,t)})),this.loadPersonalizedItems(t)}async loadPersonalizedItems(t){var e,i;const s=null===(i=null===(e=this.provider)||void 0===e?void 0:e.getRecordID)||void 0===i?void 0:i.call(e);if(null==s)return void(this._items=t);const n=await function(t){const e=`${o.getContextValue("__SNK__APPLICATION__").getModuleName()}@DataExporterSPBean.getPersonalizedReports`,i={serviceName:e,requestBody:t};return new Promise(((t,s)=>x.get().callServiceBroker(e,r.objectToString(i)).then((e=>t(function(t){var e;const i=null===(e=null==t?void 0:t.json)||void 0===e?void 0:e.$;if(null!=i)return r.stringToObject(i)}(e)))).catch((t=>s(t)))))}({recordID:s});null==n||n.forEach((e=>{t.push({id:`${this._customPrefix}_${e.ID}`,label:e.label,group:this.getMessage("snkDataExporter.group.custom")})})),this._items=t}openPersonalizedReports(t){var e,i;const s=[],o=(null==t?void 0:t.replace(this._customPrefix,""))||"";null===(i=null===(e=this.provider)||void 0===e?void 0:e.getSelectedIDs)||void 0===i||i.call(e).forEach((({name:t,type:e,value:i},o)=>{const r={fields:[]};0===o&&(s[`PK_${t}`]={type:this.parseDataType(e),value:i},s.pks=[]);const n={nome:`PK_${t}`,tipo:this.parseDataType(e),valor:i};r.fields.push(n),s.pks.push(r)})),this._application.openApp(`${v}${o}`,s)}parseDataType(t){switch(t){case l.NUMBER:return"I";case l.DATE:return"D";default:return"S"}}loadDropdown(){var t;this._selectedNumber=(null===(t=this.provider)||void 0===t?void 0:t.getSelectedNumber())||0,this._itemBuilder=new f(this.getMessage.bind(this),this._selectedNumber),this.loadItems()}getElementID(t){return{[a.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:a.getInternalIDInfo(t)}}canShowDropdown(){var t;return this._showDropdown&&(null===(t=this._items)||void 0===t?void 0:t.length)>0}componentWillLoad(){var t;this._application=o.getContextValue("__SNK__APPLICATION__"),null===(t=this._application)||void 0===t||t.getAppLabel().then((t=>this._appLabel=t)),this.setEvents()}componentDidLoad(){null!=this._element&&(a.addIDInfo(this._element),this.positionDropdown())}componentWillUpdate(){var t;this._showDropdown&&!(null===(t=this._items)||void 0===t?void 0:t.length)&&this.loadDropdown()}componentDidUpdate(){var t;this._showDropdown?this.positionDropdown():(null===(t=this._items)||void 0===t?void 0:t.length)>0&&(this._items=[])}render(){return e(i,null,e("div",{class:`snk-data-exporter\n ${this.canShowDropdown()?" ez-elevation--16":""}\n `},e("ez-button",Object.assign({ref:t=>this._ezButton=t,iconName:"file-download",size:"small",mode:"icon",title:this.getMessage("snkDataExporter.group.export.title"),onClick:()=>this.controlDropdown()},this.getElementID("button"))),e("div",Object.assign({ref:t=>this._dropdownParent=t,class:`snk-data-exporter__dropdown\n ${this.canShowDropdown()?"snk-data-exporter__dropdown--show":""}\n `},this.getElementID("dropdown")),this.canShowDropdown()&&e("ez-dropdown",Object.assign({items:this._items,onEzClick:t=>this.processExporter(t)},this.getElementID("dropdown"))))),this.canShowDropdown()&&e("div",Object.assign({class:"ez-scrim ez-scrim--light"},this.getElementID("ezScrim"))),e("snk-exporter-email-sender",Object.assign({ref:t=>this._snkEmailSender=t,getMessage:(t,e)=>this.getMessage(t,e)},this.getElementID("snkExporterEmailSender"))))}get _element(){return s(this)}};y.style=".sc-snk-data-exporter-h{display:flex;width:fit-content;height:fit-content}.snk-data-exporter.sc-snk-data-exporter{display:flex;width:fit-content;height:fit-content}.snk-data-exporter__dropdown.sc-snk-data-exporter{display:none}.snk-data-exporter__dropdown--show.sc-snk-data-exporter{display:flex;flex-direction:column;position:fixed}.snk-data-exporter__dropdown.sc-snk-data-exporter>ez-dropdown.sc-snk-data-exporter{position:relative}";export{y as snk_data_exporter}
Binary file
Binary file
@@ -1 +1 @@
1
- export{S as snk_data_unit}from"./p-95888078.js";import"./p-d8d8169b.js";import"@sankhyalabs/core";import"@sankhyalabs/ezui/dist/collection/utils";import"./p-42dde1ec.js";import"./p-8d884fab.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-9fa79997.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";import"@sankhyalabs/core/dist/dataunit/metadata/DataType";import"./p-7dd49d15.js";
1
+ export{S as snk_data_unit}from"./p-a42c27d6.js";import"./p-d8d8169b.js";import"@sankhyalabs/core";import"@sankhyalabs/ezui/dist/collection/utils";import"./p-b2212d20.js";import"./p-8d884fab.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-8dd0b9ce.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";import"@sankhyalabs/core/dist/dataunit/metadata/DataType";import"./p-7dd49d15.js";
Binary file
@@ -1,4 +1,4 @@
1
- import{r as t,c as e,h as i,H as s,g as n}from"./p-d8d8169b.js";import{DateUtils as r,StringUtils as a,ObjectUtils as o,WaitingChangeException as h,SilentException as l,WarningException as c,ErrorException as d,ElementIDUtils as u,SearchUtils as p,ArrayUtils as m,KeyboardManager as g,OnboardingUtils as w,DependencyType as y,DataType as v,ApplicationContext as f,ErrorTracking as P,UserAgentUtils as k,LockManager as z,LockManagerOperation as _}from"@sankhyalabs/core";import{ApplicationUtils as x}from"@sankhyalabs/ezui/dist/collection/utils";import{C as A}from"./p-69885aaa.js";import{d as S,D as b,U as I,S as T}from"./p-42dde1ec.js";import{A as N,a as L}from"./p-f68aab71.js";import{P as E,D as C}from"./p-9fa79997.js";import{P as O}from"./p-4db51d85.js";import{T as D}from"./p-9019a32f.js";import"./p-0f3698af.js";import"./p-ff1990ad.js";import{F as R}from"./p-31b0d523.js";import"./p-8d884fab.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";class M{static webConnectionCaller(t,e,i){var s;null===(s=window.AppletCaller)||void 0===s||s.webConnectionCaller(t,e,i)}}const F=U;function U(t,e){const i=$();return(U=function(t){return i[t-=378]})(t,e)}function $(){const t=["true","863GKWjmo","parse","56355fjjjAm","isSup","putAccess","4324480sjuCdS","hasOwnProperty","239748okvJLB","name","6055770tXeRaU","actions","forEach","7RPRvzn","1042CHxkUw","2988126NIwRMm","20MTNzmH","authorizationSf","item","string","hasAccess","isArray","Objeto não pode ser indefinido.","3071943fWslZp","parseFromJSON"];return($=function(){return t})()}!function(){const t=U,e=$();for(;;)try{if(281287==parseInt(t(399))/1*(-parseInt(t(387))/2)+-parseInt(t(401))/3+parseInt(t(381))/4*(-parseInt(t(389))/5)+parseInt(t(388))/6*(-parseInt(t(386))/7)+parseInt(t(379))/8+parseInt(t(396))/9+parseInt(t(383))/10)break;e.push(e.shift())}catch(t){e.push(e.shift())}}();class j{[F(397)](t){const e=F;if(typeof(t=utxt(t[e(390)]))==e(392)&&(t=JSON[e(400)](t)),null==t)throw Error(e(395));const i=new H("S"===t[e(402)]||!0===t[e(402)]);return Array[e(394)](t[e(391)])&&t[e(391)][e(385)]((t=>i.putAccess(t[e(382)],String(t.status)==e(398)))),i}}class H{constructor(t){const e=F;this.isSup=t,this[e(384)]={}}[F(378)](t,e){this[F(384)][t]=e}[F(393)](t){const e=F;if(this[e(402)])return!0;let i=!0;return this[e(384)][e(380)](t)&&(i=this.actions[t]),i}isUserSup(){return this.isSup}}class B{constructor(){this._embeddedParams=new Map,this._cachedParams=new Map,this.templateByQuery=new Map;try{if(null!=window.MGE_PARAMS){atob(window.MGE_PARAMS).split("__;__").forEach((t=>{const[e,i]=t.split("__=__");this._embeddedParams.set(e,i)}))}}catch(t){console.error("Problemas ao obter parâmetros embarcados"),console.error(t)}this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchParam",S.gql`query($name: String!) {
1
+ import{r as t,c as e,h as i,H as s,g as n}from"./p-d8d8169b.js";import{DateUtils as r,StringUtils as a,ObjectUtils as o,WaitingChangeException as h,SilentException as l,WarningException as c,ErrorException as d,ElementIDUtils as u,SearchUtils as p,ArrayUtils as m,KeyboardManager as g,OnboardingUtils as w,DependencyType as y,DataType as v,ApplicationContext as f,ErrorTracking as P,UserAgentUtils as k,LockManager as z,LockManagerOperation as _}from"@sankhyalabs/core";import{ApplicationUtils as x}from"@sankhyalabs/ezui/dist/collection/utils";import{C as A}from"./p-5cbd073e.js";import{d as S,D as b,U as I,S as T}from"./p-b2212d20.js";import{A as N,a as L}from"./p-98d47361.js";import{P as E,D as C}from"./p-8dd0b9ce.js";import{P as O}from"./p-d33a3955.js";import{T as D}from"./p-9019a32f.js";import"./p-0f3698af.js";import"./p-ff1990ad.js";import{F as R}from"./p-e6fe58b7.js";import"./p-8d884fab.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";class M{static webConnectionCaller(t,e,i){var s;null===(s=window.AppletCaller)||void 0===s||s.webConnectionCaller(t,e,i)}}const F=U;function U(t,e){const i=$();return(U=function(t){return i[t-=378]})(t,e)}function $(){const t=["true","863GKWjmo","parse","56355fjjjAm","isSup","putAccess","4324480sjuCdS","hasOwnProperty","239748okvJLB","name","6055770tXeRaU","actions","forEach","7RPRvzn","1042CHxkUw","2988126NIwRMm","20MTNzmH","authorizationSf","item","string","hasAccess","isArray","Objeto não pode ser indefinido.","3071943fWslZp","parseFromJSON"];return($=function(){return t})()}!function(){const t=U,e=$();for(;;)try{if(281287==parseInt(t(399))/1*(-parseInt(t(387))/2)+-parseInt(t(401))/3+parseInt(t(381))/4*(-parseInt(t(389))/5)+parseInt(t(388))/6*(-parseInt(t(386))/7)+parseInt(t(379))/8+parseInt(t(396))/9+parseInt(t(383))/10)break;e.push(e.shift())}catch(t){e.push(e.shift())}}();class j{[F(397)](t){const e=F;if(typeof(t=utxt(t[e(390)]))==e(392)&&(t=JSON[e(400)](t)),null==t)throw Error(e(395));const i=new H("S"===t[e(402)]||!0===t[e(402)]);return Array[e(394)](t[e(391)])&&t[e(391)][e(385)]((t=>i.putAccess(t[e(382)],String(t.status)==e(398)))),i}}class H{constructor(t){const e=F;this.isSup=t,this[e(384)]={}}[F(378)](t,e){this[F(384)][t]=e}[F(393)](t){const e=F;if(this[e(402)])return!0;let i=!0;return this[e(384)][e(380)](t)&&(i=this.actions[t]),i}isUserSup(){return this.isSup}}class B{constructor(){this._embeddedParams=new Map,this._cachedParams=new Map,this.templateByQuery=new Map;try{if(null!=window.MGE_PARAMS){atob(window.MGE_PARAMS).split("__;__").forEach((t=>{const[e,i]=t.split("__=__");this._embeddedParams.set(e,i)}))}}catch(t){console.error("Problemas ao obter parâmetros embarcados"),console.error(t)}this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchParam",S.gql`query($name: String!) {
2
2
  $queryAlias$: fetchResource(name: $name){
3
3
  name
4
4
  resource
@@ -1 +1 @@
1
- import{r as i,c as t,h as s,g as e}from"./p-d8d8169b.js";import{StringUtils as n,ApplicationContext as o,ObjectUtils as h,Action as a,DataType as r,UserInterface as d,KeyboardManager as l,ElementIDUtils as u}from"@sankhyalabs/core";import{CSSVarsUtils as c,buildFieldSearch as m}from"@sankhyalabs/ezui/dist/collection/utils";import{V as p,S as g}from"./p-9019a32f.js";import{T as v}from"./p-b987e15d.js";import"./p-42dde1ec.js";import"./p-4db51d85.js";import{S as f,R as C,b,a as S,c as k}from"./p-ce77774e.js";import{P as y}from"./p-0f3698af.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import{I as w}from"./p-9fa79997.js";import"./p-ff1990ad.js";import{F}from"./p-31b0d523.js";import{T as E}from"./p-1a0caadb.js";import{C as T}from"./p-69885aaa.js";import{S as I}from"./p-13596651.js";import{s as _}from"./p-55798617.js";import"./p-8d884fab.js";import"./p-7dd49d15.js";import"./p-8f3f2306.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";const z=["INSERT","REFRESH","PREVIOUS","NEXT","DIVIDER","MORE_OPTIONS"],R=["INSERT","REFRESH","PREVIOUS","NEXT","DIVIDER","CLONE","REMOVE","DIVIDER","MORE_OPTIONS"],M=class{constructor(s){i(this,s),this.dataStateChange=t(this,"dataStateChange",3),this.dataUnitReady=t(this,"dataUnitReady",3),this.actionClick=t(this,"actionClick",7),this.formItemsReady=t(this,"formItemsReady",7),this.configuratorSave=t(this,"configuratorSave",7),this.configuratorCancel=t(this,"configuratorCancel",7),this._multiSelectionListDataSource=new f,this._formConfigFetcher=new F,this._customEditors=new Map,this._customRenders=new Map,this._container=void 0,this._showPopUpGridConfig=!1,this._currentViewMode=p.GRID,this._config=void 0,this._fieldToGetFocus=void 0,this._customContainerId=`SNK-SIMPLE-CRUD-CUSTOM-CONTAINER-${n.generateUUID()}`,this.enableLockManagerLoadingComp=!1,this.enableLockManagerTaskbarClick=!1,this.dataState=void 0,this.dataUnit=void 0,this.entityName=void 0,this.mode=g.SERVER,this.gridConfig=void 0,this.formConfig=void 0,this._formFields=[],this._fieldsProps=new Map,this.enableContinuousInsert=!1,this.multipleSelection=void 0,this.useCancelConfirm=!0,this.pageSize=150,this.resourceID=void 0,this.enableGridInsert=!1,this.paginationCounterMode="auto",this.taskbarManager=void 0,this.messagesBuilder=void 0,this.useEnterLikeTab=!1,this.actionsList=void 0,this.configName=void 0,this.showConfiguratorButtons=!1,this.gridLegacyConfigName=void 0,this.formLegacyConfigName=void 0,this.ignoreReadOnlyFormFields=!1,this.autoFocus=!0,this.domainMessagesBuilder=void 0,this.multipleEditionEnabled=!0,this.layoutFormConfig=!0,this.autoLoad=void 0,this.outlineMode=!1}async addCustomEditor(i,t){if(this._grid&&this._form)return this._grid.addCustomEditor(i,t),void this._form.addCustomEditor(i,t);const s=new Map(this._customEditors);s.set(i,t),this._customEditors=s}async addGridCustomRender(i,t){if(this._grid)return void this._grid.addGridCustomRender(i,t);const s=new Map(this._customRenders);s.set(i,t),this._customRenders=s}async handleResourceIDChanged(i,t){n.isEmpty(i)||i!==t&&(await this.loadFormConfig(!0),await this.loadGridConfig(!0))}async addCustomValueFormatter(i,t){this._grid.addCustomValueFormatter(i,t)}async removeCustomValueFormatter(i){this._grid.removeCustomValueFormatter(i)}async setFieldProp(i,t,s){const e=new Map(this._fieldsProps),n=this._fieldsProps.get(i);e.set(i,Object.assign(Object.assign({},n),{[t]:s})),this._fieldsProps=e}loadTaskbarProcessor(){const i={};i[D.FORM_REGULAR]=this.getButtons(!1,[v.GRID_MODE],!0),i[D.GRID_REGULAR]=this.getButtons(!1,[v.DATA_EXPORTER,v.FORM_MODE]),i[D.FORM_SELECTED]=this.getButtons(!0,[v.GRID_MODE],!0),i[D.GRID_SELECTED]=this.getGridSelectedButtonsCallBack.bind(this),i[D.FINISH_EDITION]=this.getFinishEditionButtonsCallback.bind(this),i[D.MULTIPLE_EDITION]=[v.CANCEL],this._taskbarProcessor=new E(i)}getGridSelectedButtonsCallBack(){var i,t,s;return this.multipleEditionEnabled&&1!==(null===(s=null===(t=null===(i=this.dataState)||void 0===i?void 0:i.selectionInfo)||void 0===t?void 0:t.records)||void 0===s?void 0:s.length)?this.getButtons(!0,[v.UPDATE_MULTIPLE,v.DATA_EXPORTER,v.FORM_MODE]):this.getButtons(!0,[v.DATA_EXPORTER,v.FORM_MODE])}getFinishEditionButtonsCallback(){const i=[v.CANCEL,v.SAVE];return this.enableGridInsert&&this._currentViewMode!==p.ATTACHMENT&&i.push(this._currentViewMode===p.GRID?v.FORM_MODE:v.GRID_MODE),i}getButtons(i,t,s){let e=i?R:z;return(s||this.mode===g.IN_MEMORY)&&(e=e.filter((i=>i!==v.REFRESH))),this.addConfigButton(e.concat(t))}addConfigButton(i){return void 0===this.configName||this.configName&&this.gridLegacyConfigName?i:i.concat(v.CONFIGURATOR)}get application(){return o.getContextValue("__SNK__APPLICATION__")}async goToView(i){this._currentViewMode=i,this._viewStack&&(i===p.GRID&&(this.dataUnit.isMultipleEdition=!1),this._viewStack.show(i)),i===p.GRID&&requestAnimationFrame((()=>this.focusToGrid())),i===p.FORM&&requestAnimationFrame((()=>this.focusToForm()))}actionClickListener(i){this.handleTaskbarAction(i.detail),i.stopPropagation()}handleTaskbarAction(i){switch(i){case v.CONFIGURATOR:this._snkConfigurator.open();break;case v.GRID_MODE:this.goToView(p.GRID);break;case v.FORM_MODE:this.goToView(p.FORM);break;case v.UPDATE_MULTIPLE:this.dataUnit.isMultipleEdition=!0,this.goToView(p.FORM)}}async onChangeEntityName(i){if(this.dataUnit)return;const t=o.getContextValue("__SNK__APPLICATION__");this.dataUnit=await t.getDataUnit(i,null,null,this.configName)}onModeChange(){this.mode==g.IN_MEMORY&&this.initInMemoryDataUnit()}observeDataState(i,t){this.handleDataStateChange(i,t)}async observeFormLegacy(i,t){await this.handleUpdateFormLegacyConfig(i,t)}async observeGridLegacy(i,t){await this.handleUpdateGridLegacyConfig(i,t)}async handleDataStateChange(i,t){h.objectToString(t)!=h.objectToString(i)&&this.dataStateChange.emit(i),await this.processRmPrecision()}async processRmPrecision(){var i,t;const s=await this._snkDataUnit.getFieldsWithRmPrecision();for(const e of s||[]){if(!e)continue;const s=null===(t=null===(i=this.dataState)||void 0===i?void 0:i.rowMetadata)||void 0===t?void 0:t.getProp("rm_precision",e);(s||0===s)&&(await this.setFieldProp(e,"precision",s),await this.setFieldProp(e,"prettyPrecision",s))}this._rmPrecisionCustomValueFormatter.setDataState(this.dataState)}async handleUpdateGridLegacyConfig(i,t){null!=i&&i!=t&&this._gridConfigAlreadyLoaded&&await this.loadGridConfig(!0)}async handleUpdateFormLegacyConfig(i,t){null!=i&&i!=t&&this._formConfigAlreadyLoaded&&await this.loadFormConfig(!0)}openConfig(i){this._snkConfigurator.close(),i===p.GRID?this.openGridConfig():i===p.FORM&&this.openFormConfig()}openGridConfig(){this._grid.getColumnsState().then((i=>{this._snkGridConfig.columns=i.filter((i=>i.name)),this._snkGridConfig.selectedIndex=0,this._showPopUpGridConfig=!0}))}async openFormConfig(){(this.formLegacyConfigName||this.configName)&&await this._snkSimpleFormConfig.show()}addGridLegacyConfigName(){this.gridLegacyConfigName&&this.configName&&T.addGridLegacyConfig(this.configName,this.gridLegacyConfigName)}loadGridConfig(i){if(void 0!==this.configName&&(null==this.gridConfig&&!this._gridConfigAlreadyLoaded||i))return this.addGridLegacyConfigName(),this._gridConfigAlreadyLoaded=!0,new Promise(((i,t)=>{T.loadGridConfig(this.configName,this.resolveResourceID()).then((t=>{this.setGridConfig(t),i()})).catch((i=>{t(i)}))}))}formConfigIsLoaded(){return null!=this.formConfig||this._formConfigAlreadyLoaded}async loadFormConfig(i=!1,t=!1){if(void 0===this.configName)return;if(null==this._formConfigManager&&(this._formConfigManager=new I(this.configName,this.resolveResourceID(),void 0,this.dataUnit),this._formConfigManager.setConfig(this.formConfig)),this.formConfigIsLoaded()&&!i)return;this._formConfigAlreadyLoaded=!0;let s=await this._formConfigFetcher.fetchLegacyConfigurableForm(this.formLegacyConfigName);if(null!=s)return this._formConfigManager.setConfig(s),void this.setFormConfig(s,t);this.setFormConfig(await this._formConfigManager.loadConfig())}async componentWillRender(){this.loadTaskbarProcessor(),this._resourceID=await this.application.getResourceID(),this.dataExporterProviderStore(),this.dataExporterProviderStore(),this._taskbarProcessor.process(this.getTaskBarId(),this.taskbarManager,this.dataState,this.getTaskBarDisabledButtons()),void 0!==this.configName&&(null!=this.gridConfig||this._gridConfigAlreadyLoaded||(await this.addGridLegacyConfigName(),await this.loadGridConfig(),await this.loadFormConfig()))}componentDidRender(){this._rmPrecisionCustomValueFormatter.setGrid(this._grid),this.addGridCustomValueFormattters(),this.setFieldsProps(),this.setCustomRenders(),this.setCustomEditors()}componentWillLoad(){this.processMetadata(),this.onModeChange(),this.configDatasource(),this._rmPrecisionCustomValueFormatter=new C,this._continuousInsertUtils=new b(this.application,this.resolveResourceID(),this.configName),this.enableGridInsert&&this._continuousInsertUtils.getConfig().then((i=>this.enableContinuousInsert=i))}componentDidLoad(){c.applyVarsGrid(this._element,this._grid),this.initKeyboardManager(),this.dataUnit.subscribe(this.dataUnitActionHandler.bind(this))}async dataUnitActionHandler(i){i.type!==a.EDITION_CANCELED&&i.type!==a.DATA_SAVED||this.dataUnit.isMultipleEdition&&this.goToView(p.GRID)}getMessage(i,t){var s;return null===(s=this.messagesBuilder)||void 0===s?void 0:s.getMessage(i,t)}disconnectedCallback(){var i;null===(i=this._keyboardManager)||void 0===i||i.unbindAllShortcutKeys()}setCustomRenders(){if(this._grid)for(const[i,t]of this._customRenders)this._grid.addGridCustomRender(i,t),this._customRenders.delete(i)}setCustomEditors(){if(this._grid&&this._form)for(const[i,t]of this._customEditors)this._grid.addCustomEditor(i,t),this._form.addCustomEditor(i,t),this._customEditors.delete(i)}configDatasource(){this._multiSelectionListDataSource.setApplication(this.application),this._multiSelectionListDataSource.setDataUnit(this.dataUnit)}setFieldsProps(){if(this._form)for(const[i,t]of this._fieldsProps){for(const s in t)this._form.setFieldProp(i,s,t[s]);this._fieldsProps.delete(i)}}getTaskBarId(){var i,t;return(null===(i=this.dataState)||void 0===i?void 0:i.isDirty)?D.FINISH_EDITION:this.dataUnit.isMultipleEdition?D.MULTIPLE_EDITION:(null===(t=this.dataState)||void 0===t?void 0:t.selectionInfo)&&!this.dataState.selectionInfo.isAllRecords()&&this.dataState.selectionInfo.length>0?this._currentViewMode===p.GRID?D.GRID_SELECTED:D.FORM_SELECTED:this._currentViewMode===p.GRID?D.GRID_REGULAR:D.FORM_REGULAR}initInMemoryDataUnit(){this._inMemoryLoader=new w(this._metadata,void 0,{autoLoad:this.autoLoad}),this.dataUnit=this._inMemoryLoader.dataUnit,this.dataUnitReady.emit(this.dataUnit)}setMetadata(i){return this._inMemoryLoader?this._inMemoryLoader.metadata=i:this.dataUnit&&(this.dataUnit.metadata=i),Promise.resolve()}setRecords(i){return this._inMemoryLoader?this._inMemoryLoader.records=i:this.dataUnit&&(this.dataUnit.records=i),Promise.resolve()}getRecords(){return Promise.resolve(this.dataUnit.records)}async openConfigurator(){var i;null===(i=this._snkConfigurator)||void 0===i||i.open()}async closeConfigurator(){var i;null===(i=this._snkConfigurator)||void 0===i||i.close()}async updateConfig(){null==this._formConfigManager&&(this._formConfigManager=new I(this.configName,this.resolveResourceID())),this._formConfigManager.setConfig(this.formConfig)}processMetadata(){const i=this._element.querySelectorAll("snk-field-metadata"),t=[],s={fields:[],emptyConfig:!1};i.forEach((i=>{const e={name:i.getAttribute("name")||i.getAttribute("label"),label:i.getAttribute("label"),dataType:r[i.getAttribute("dataType")]||r.TEXT,userInterface:d[i.getAttribute("userInterface")]||d.SHORTTEXT,readOnly:"true"==i.getAttribute("readOnly"),required:"true"==i.getAttribute("required"),tab:i.getAttribute("tab")||void 0,visible:"false"!=i.getAttribute("visible")};s.fields.push({name:e.name,tab:e.tab,visible:e.visible}),t.push(e)})),t.length>0&&(this.formConfig||(this.formConfig=s),this._metadata={name:"SimpleCrud",label:"SimpleCrud",fields:t})}addGridCustomValueFormattters(){var i,t,s;const e=(null===(i=this._metadata)||void 0===i?void 0:i.fields)||(null===(s=null===(t=this.dataUnit)||void 0===t?void 0:t.metadata)||void 0===s?void 0:s.fields);if(!e)return;const n=[];e.forEach((i=>{var t;(null===(t=i.properties)||void 0===t?void 0:t.rm_precision)&&!n.includes(i.name)&&n.push(i.name)})),n.forEach((i=>{this.addCustomValueFormatter(i,this._rmPrecisionCustomValueFormatter)}))}onDataStateChange(i){this.dataState=Object.assign({},i.detail)}getTaskBarDisabledButtons(){var i,t,s,e,n,o;const h=[];return(null===(i=this.dataState)||void 0===i?void 0:i.hasNext)||h.push(v.NEXT),(null===(t=this.dataState)||void 0===t?void 0:t.hasPrevious)||h.push(v.PREVIOUS),(null===(e=null===(s=this.dataState)||void 0===s?void 0:s.selectionInfo)||void 0===e?void 0:e.isEmpty())&&h.push(v.FORM_MODE),(null===(o=null===(n=this.dataState)||void 0===n?void 0:n.selectionInfo)||void 0===o?void 0:o.length)>1&&h.push(v.CLONE),h}handleCancelEdit(){var i;(null===(i=this.dataState)||void 0===i?void 0:i.recordsIsEmpty)&&(this.goToView(p.GRID),this.dataUnit.clearSelection())}handleConfiguratorEvent(i,t){i.stopImmediatePropagation(),"SAVE"!==t?this.configuratorCancel.emit():this.configuratorSave.emit()}onSelectField(i){null!=i&&(this._fieldToGetFocus=i.value)}getFieldSearch(i,t){return null!=this._fieldSearch||(this._splitButtonForm=i,this._fieldSearch=m(t,(({argument:i})=>this.fieldsOptionLoader(i)),(i=>this.onSelectField(i)))),this._fieldSearch}getFormFields(){var i,t;return null!==(t=null===(i=this.formConfig)||void 0===i?void 0:i.fields)&&void 0!==t?t:this._formFields}handleFormSetFields(i){h.equals(this._formFields,i)||(this._formFields=null!=i?i:[])}fieldsOptionLoader(i){const t=null==i?void 0:i.toLowerCase(),s=this.getFormFields().map((i=>{var t;return null===(t=this.dataUnit)||void 0===t?void 0:t.getField(i.name)})).filter((i=>{var s,e;return(null===(s=i.name)||void 0===s?void 0:s.toLowerCase().includes(t))||(null===(e=i.label)||void 0===e?void 0:e.toLowerCase().includes(t))})).map((i=>({value:i.name,label:i.label})));return Promise.resolve(s)}isGridInsertActive(){return this.enableGridInsert&&this.dataUnit.hasNewRecord()}getColumnSearch(i,t){return null!=this._columnSearch||(this._splitButton=i,this._columnSearch=m(t,(({argument:i})=>new Promise((t=>{this._grid.filterColumns(i).then((i=>{t(i.filter((i=>!i.hidden)).map((i=>({label:i.label,value:i.name}))))}))}))),(i=>{null!=i&&this._grid.locateColumn(i.value)}))),this._columnSearch}getActionsList(){const i=[];if(this.enableGridInsert&&i.push(this._continuousInsertUtils.actionContinuousInsert(this.enableContinuousInsert,(()=>{this.enableContinuousInsert=!this.enableContinuousInsert,this._continuousInsertUtils.handleSaveConfig(this.enableContinuousInsert)}))),this.isGridInsertActive())return i;if(null!=this.taskbarManager&&null!=this.taskbarManager.getMoreOptions){const t=this.getTopTaskBarId();return i.concat(this.taskbarManager.getMoreOptions(t,this.configName,this.dataState,this.actionsList))}return i.concat(this.actionsList)}getSettingsListGrid(){return[{value:n.generateUUID(),label:this.getMessage("snkSimpleCrud.findColumn"),disableCloseOnSelect:!0,eagerInitialize:!0,itemBuilder:(i,t)=>this.getColumnSearch(i,t)}]}getSettingsListForm(){return[{value:n.generateUUID(),label:this.getMessage("snkSimpleCrud.findFields"),disableCloseOnSelect:!0,eagerInitialize:!0,itemBuilder:(i,t)=>this.getFieldSearch(i,t)}]}getTopTaskBarId(){var i;return(null===(i=this.dataState)||void 0===i?void 0:i.isDirty)?`snkGridTopTaskbar.finish_edition${y.PRIMARY}`:`snkGridTopTaskbar.regular${y.PRIMARY}`}clearFieldToFocusHandler(){this._fieldToGetFocus=void 0}gridConfigChangeHandler(i){i.stopPropagation(),this.configName&&T.saveGridConfig(i.detail,this.configName,this.resolveResourceID())}modalConfigChangeHandler(i){const t=i.detail;this._grid.setColumnsState(t.columns).then((()=>{this.setGridConfig(t),this.closeGridConfig(),this.dataExporterProviderStore()})),i.stopPropagation()}async dataExporterProviderStore(){if(null==this.dataUnit)return;if(null==this._grid)return;const i=new k(this.dataUnit,this._grid);_.set("exporterProviders",Object.assign(Object.assign({},_.get("exporterProviders")),{[this.getDataExporterStoreKey()]:i}))}getDataExporterStoreKey(){return`SnkSimpleCrudDataExporter:${null==this.configName?this.dataUnit.name:this.configName}`}setGridConfig(i){this.gridConfig=i,S.assertDefaultSorting(this.gridConfig,this.dataUnit)}setFormConfig(i,t){this.formConfig&&!t||(this.formConfig=i)}closeGridConfig(){this._showPopUpGridConfig=!1}getPageSize(){return this.mode===g.IN_MEMORY?0:null==this.pageSize?150:this.pageSize}resolveResourceID(){return n.isEmpty(this.resourceID)?this._resourceID:this.resourceID}getFormConfig(){var i;const t=null===(i=this._formConfigManager)||void 0===i?void 0:i.getConfig(this.dataUnit,this.ignoreReadOnlyFormFields);return this.configName||t?t:this.formConfig}updateFormConfig(){let i=this.formConfig;null==this.formLegacyConfigName&&(i=Object.assign(Object.assign({},this.formConfig),{fields:this.dataUnit.metadata.fields})),this.setFormConfig(i,!0),null==this._formConfigManager&&(this._formConfigManager=new I(this.configName,this.resolveResourceID())),this._formConfigManager.setConfig(this.formConfig)}handleDataUnitOnInsertionMode(){this.enableGridInsert||this.goToView(p.FORM)}async initKeyboardManager(){var i;this._keyboardManager=new l({propagate:!1,element:this._element});const t=this.dataUnit||await(null===(i=this._snkDataUnit)||void 0===i?void 0:i.getDataUnit());null!=t&&this._keyboardManager.bind("F7",(()=>t.saveData()),{description:this.getMessage("snkSimpleCrud.keyboardShortcuts.saveData"),element:this._element}).bind("F8",t.addRecord.bind(t),{description:this.getMessage("snkSimpleCrud.keyboardShortcuts.addRecord"),element:this._element}).bind("F9",t.removeSelectedRecords.bind(t),{description:this.getMessage("snkSimpleCrud.keyboardShortcuts.removeRecord"),element:this._element}).bind("Escape",(()=>{t.isDirty()&&t.cancelEdition()}),{debounceTime:1e3,description:this.getMessage("snkSimpleCrud.keyboardShortcuts.cancelAction"),element:this._element})}async handleFormConfigSaved(){await this.loadFormConfig(!0,!0)}focusToGrid(){this._grid.focus()}focusToForm(){this._form.focus()}renderTaskbarContent(i){var t;return s("snk-taskbar",{class:"ez-box--no-outline ez-box "+(this._currentViewMode===p.FORM?(this.outlineMode?"ez-box--outline":"ez-box--shadow-xsmall")+" ez-padding--small":""),dataUnit:this.dataUnit,primaryButton:(null===(t=this.dataState)||void 0===t?void 0:t.isDirty)?"SAVE":"INSERT","data-element-id":"grid_left",messagesBuilder:this.messagesBuilder,buttons:this._taskbarProcessor.buttons,actionsList:this.getActionsList(),actionsSettingsList:i===p.GRID?this.getSettingsListGrid():this.getSettingsListForm(),disabledButtons:this._taskbarProcessor.disabledButtons,customButtons:this._taskbarProcessor.customButtons,"data-exporter-store-key":this.getDataExporterStoreKey(),slot:"leftButtons",presentationMode:y.SECONDARY,tabindex:"0"},s("slot",{name:"TASKBAR_CUSTOM_ELEMENTS"}))}render(){var i;if(null!=this.dataUnit)return s("snk-data-unit",{ref:i=>this._snkDataUnit=i,class:"simple-crud__container",dataUnit:this.dataUnit,useCancelConfirm:this.useCancelConfirm,onDataStateChange:i=>this.onDataStateChange(i),onCancelEdition:this.handleCancelEdit.bind(this),pageSize:this.getPageSize(),onInsertionMode:this.handleDataUnitOnInsertionMode.bind(this),onDataUnitReady:i=>this.dataUnitReady.emit(i.detail),onMessagesBuilderUpdated:i=>this.messagesBuilder=i.detail,onDataUnitFieldsHidded:this.updateFormConfig.bind(this),domainMessagesBuilder:this.domainMessagesBuilder},s("header",null,s("slot",{name:"snkSimpleCrudHeader"})),s("section",{class:`ez-box ez-box--no-outline ${this.outlineMode?"ez-box--outline":"ez-box--shadow"} simple-crud__container-section`,ref:i=>this._container=i,tabindex:"0"},s("ez-view-stack",{ref:i=>this._viewStack=i,"data-element-id":"simple-crud"},s("stack-item",null,s("ez-grid",{class:"ez-margin-bottom--large ez-box--no-outline",ref:i=>this._grid=i,dataUnit:this.dataUnit,config:this.gridConfig,"no-header":!0,multipleSelection:this.multipleSelection,onEzDoubleClick:()=>this.goToView(p.FORM),onConfigChange:i=>this.gridConfigChangeHandler(i),columnfilterDataSource:this.dataUnit.name&&this.dataUnit.name.includes(w.IN_MEMORY_DATA_UNIT_NAME)?void 0:this._multiSelectionListDataSource,useEnterLikeTab:this.useEnterLikeTab,autoFocus:this.autoFocus,enableGridInsert:this.enableGridInsert,enableContinuousInsert:this.enableContinuousInsert,enableLockManagerTaskbarClick:this.enableLockManagerTaskbarClick,enableLockManagerLoadingComp:this.enableLockManagerLoadingComp,outlineMode:this.outlineMode,tabindex:"0",paginationCounterMode:this.paginationCounterMode},this.renderTaskbarContent(p.GRID),s("div",{slot:"footer"},s("slot",{name:"snkSimpleCrudFooter"})))),s("stack-item",null,this.renderTaskbarContent(p.FORM),s("ez-form",{ref:i=>this._form=i,class:"ez-margin-top--large ez-box--no-outline",dataUnit:this.dataUnit,config:this.getFormConfig(),fieldToFocus:this._fieldToGetFocus,onEzFormSetFields:i=>this.handleFormSetFields(i.detail),onEzFormRequestClearFieldToFocus:this.clearFieldToFocusHandler.bind(this),elementFocusSearchField:this._container,tabindex:"0"}),s("snk-simple-form-config",{ref:i=>this._snkSimpleFormConfig=i,dataUnit:this.dataUnit,onSnkConfigSaved:this.handleFormConfigSaved.bind(this),configName:null!==(i=this.formLegacyConfigName)&&void 0!==i?i:this.configName,messagesBuilder:this.messagesBuilder})),this.messagesBuilder&&s("snk-configurator",{ref:i=>this._snkConfigurator=i,viewMode:this._currentViewMode,messagesBuilder:this.messagesBuilder,onConfigSelected:i=>this.goToView(i.detail),onOpenConfig:i=>this.openConfig(i.detail),showActionButtons:this.showConfiguratorButtons,onSave:i=>this.handleConfiguratorEvent(i,"SAVE"),onCancel:i=>this.handleConfiguratorEvent(i,"CANCEL"),resourceID:this.resolveResourceID(),customContainerId:this._customContainerId,layoutFormConfig:this.layoutFormConfig})),s("div",{id:`${this._customContainerId}`},s("slot",{name:"SnkConfigContainerSlot"}))),s("ez-popup",{size:"medium",heightMode:"auto",useHeader:!1,opened:this._showPopUpGridConfig,onEzClosePopup:()=>this.closeGridConfig()},s("snk-grid-config",{ref:i=>this._snkGridConfig=i,config:this.gridConfig,"data-element-id":this._element.getAttribute(u.DATA_ELEMENT_ID_ATTRIBUTE_NAME),selectedIndex:0,configName:this.configName,onConfigChange:i=>this.modalConfigChangeHandler(i),onConfigCancel:()=>this.closeGridConfig(),resourceID:this.resolveResourceID()})))}get _element(){return e(this)}static get watchers(){return{resourceID:["handleResourceIDChanged"],entityName:["onChangeEntityName"],mode:["onModeChange"],dataState:["observeDataState"],formLegacyConfigName:["observeFormLegacy"],gridLegacyConfigName:["observeGridLegacy"]}}};var D;!function(i){i.FORM_REGULAR="snkSimpleCrudTaskbar.form_regular",i.GRID_REGULAR="snkSimpleCrudTaskbar.grid_regular",i.FORM_SELECTED="snkSimpleCrudTaskbar.form_selected",i.GRID_SELECTED="snkSimpleCrudTaskbar.grid_selected",i.FINISH_EDITION="snkSimpleCrudTaskbar.finish_edition",i.MULTIPLE_EDITION="snkSimpleCrudTaskbar.multiple_edition"}(D||(D={})),M.style=".sc-snk-simple-crud-h{display:flex;height:100%;width:100%;--snk-simple-crud-grid--min-height:300px}.simple-crud__container.sc-snk-simple-crud{display:grid;grid-template-rows:auto 1fr;height:100%;width:100%}.simple-crud__container-section.sc-snk-simple-crud{flex-wrap:unset;flex-direction:column}.simple-crud__form--hidden.sc-snk-simple-crud{display:none}ez-grid.sc-snk-simple-crud{--ez-grid__container--shadow:none;--ez-grid__container--shadow--outline:none;--ez-grid--min-height:var(--snk-simple-crud-grid--min-height)}ez-form.sc-snk-simple-crud{min-height:300px}";export{M as snk_simple_crud}
1
+ import{r as i,c as t,h as s,g as e}from"./p-d8d8169b.js";import{StringUtils as n,ApplicationContext as o,ObjectUtils as h,Action as a,DataType as r,UserInterface as d,KeyboardManager as l,ElementIDUtils as u}from"@sankhyalabs/core";import{CSSVarsUtils as c,buildFieldSearch as m}from"@sankhyalabs/ezui/dist/collection/utils";import{V as p,S as g}from"./p-9019a32f.js";import{T as v}from"./p-b987e15d.js";import"./p-b2212d20.js";import"./p-d33a3955.js";import{S as f,R as C,b,a as S,c as k}from"./p-b1df45e4.js";import{P as y}from"./p-0f3698af.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import{I as w}from"./p-8dd0b9ce.js";import"./p-ff1990ad.js";import{F}from"./p-e6fe58b7.js";import{T as E}from"./p-1a0caadb.js";import{C as T}from"./p-5cbd073e.js";import{S as I}from"./p-16fa4019.js";import{s as _}from"./p-55798617.js";import"./p-8d884fab.js";import"./p-7dd49d15.js";import"./p-8f3f2306.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";const z=["INSERT","REFRESH","PREVIOUS","NEXT","DIVIDER","MORE_OPTIONS"],R=["INSERT","REFRESH","PREVIOUS","NEXT","DIVIDER","CLONE","REMOVE","DIVIDER","MORE_OPTIONS"],M=class{constructor(s){i(this,s),this.dataStateChange=t(this,"dataStateChange",3),this.dataUnitReady=t(this,"dataUnitReady",3),this.actionClick=t(this,"actionClick",7),this.formItemsReady=t(this,"formItemsReady",7),this.configuratorSave=t(this,"configuratorSave",7),this.configuratorCancel=t(this,"configuratorCancel",7),this._multiSelectionListDataSource=new f,this._formConfigFetcher=new F,this._customEditors=new Map,this._customRenders=new Map,this._container=void 0,this._showPopUpGridConfig=!1,this._currentViewMode=p.GRID,this._config=void 0,this._fieldToGetFocus=void 0,this._customContainerId=`SNK-SIMPLE-CRUD-CUSTOM-CONTAINER-${n.generateUUID()}`,this.enableLockManagerLoadingComp=!1,this.enableLockManagerTaskbarClick=!1,this.dataState=void 0,this.dataUnit=void 0,this.entityName=void 0,this.mode=g.SERVER,this.gridConfig=void 0,this.formConfig=void 0,this._formFields=[],this._fieldsProps=new Map,this.enableContinuousInsert=!1,this.multipleSelection=void 0,this.useCancelConfirm=!0,this.pageSize=150,this.resourceID=void 0,this.enableGridInsert=!1,this.paginationCounterMode="auto",this.taskbarManager=void 0,this.messagesBuilder=void 0,this.useEnterLikeTab=!1,this.actionsList=void 0,this.configName=void 0,this.showConfiguratorButtons=!1,this.gridLegacyConfigName=void 0,this.formLegacyConfigName=void 0,this.ignoreReadOnlyFormFields=!1,this.autoFocus=!0,this.domainMessagesBuilder=void 0,this.multipleEditionEnabled=!0,this.layoutFormConfig=!0,this.autoLoad=void 0,this.outlineMode=!1}async addCustomEditor(i,t){if(this._grid&&this._form)return this._grid.addCustomEditor(i,t),void this._form.addCustomEditor(i,t);const s=new Map(this._customEditors);s.set(i,t),this._customEditors=s}async addGridCustomRender(i,t){if(this._grid)return void this._grid.addGridCustomRender(i,t);const s=new Map(this._customRenders);s.set(i,t),this._customRenders=s}async handleResourceIDChanged(i,t){n.isEmpty(i)||i!==t&&(await this.loadFormConfig(!0),await this.loadGridConfig(!0))}async addCustomValueFormatter(i,t){this._grid.addCustomValueFormatter(i,t)}async removeCustomValueFormatter(i){this._grid.removeCustomValueFormatter(i)}async setFieldProp(i,t,s){const e=new Map(this._fieldsProps),n=this._fieldsProps.get(i);e.set(i,Object.assign(Object.assign({},n),{[t]:s})),this._fieldsProps=e}loadTaskbarProcessor(){const i={};i[D.FORM_REGULAR]=this.getButtons(!1,[v.GRID_MODE],!0),i[D.GRID_REGULAR]=this.getButtons(!1,[v.DATA_EXPORTER,v.FORM_MODE]),i[D.FORM_SELECTED]=this.getButtons(!0,[v.GRID_MODE],!0),i[D.GRID_SELECTED]=this.getGridSelectedButtonsCallBack.bind(this),i[D.FINISH_EDITION]=this.getFinishEditionButtonsCallback.bind(this),i[D.MULTIPLE_EDITION]=[v.CANCEL],this._taskbarProcessor=new E(i)}getGridSelectedButtonsCallBack(){var i,t,s;return this.multipleEditionEnabled&&1!==(null===(s=null===(t=null===(i=this.dataState)||void 0===i?void 0:i.selectionInfo)||void 0===t?void 0:t.records)||void 0===s?void 0:s.length)?this.getButtons(!0,[v.UPDATE_MULTIPLE,v.DATA_EXPORTER,v.FORM_MODE]):this.getButtons(!0,[v.DATA_EXPORTER,v.FORM_MODE])}getFinishEditionButtonsCallback(){const i=[v.CANCEL,v.SAVE];return this.enableGridInsert&&this._currentViewMode!==p.ATTACHMENT&&i.push(this._currentViewMode===p.GRID?v.FORM_MODE:v.GRID_MODE),i}getButtons(i,t,s){let e=i?R:z;return(s||this.mode===g.IN_MEMORY)&&(e=e.filter((i=>i!==v.REFRESH))),this.addConfigButton(e.concat(t))}addConfigButton(i){return void 0===this.configName||this.configName&&this.gridLegacyConfigName?i:i.concat(v.CONFIGURATOR)}get application(){return o.getContextValue("__SNK__APPLICATION__")}async goToView(i){this._currentViewMode=i,this._viewStack&&(i===p.GRID&&(this.dataUnit.isMultipleEdition=!1),this._viewStack.show(i)),i===p.GRID&&requestAnimationFrame((()=>this.focusToGrid())),i===p.FORM&&requestAnimationFrame((()=>this.focusToForm()))}actionClickListener(i){this.handleTaskbarAction(i.detail),i.stopPropagation()}handleTaskbarAction(i){switch(i){case v.CONFIGURATOR:this._snkConfigurator.open();break;case v.GRID_MODE:this.goToView(p.GRID);break;case v.FORM_MODE:this.goToView(p.FORM);break;case v.UPDATE_MULTIPLE:this.dataUnit.isMultipleEdition=!0,this.goToView(p.FORM)}}async onChangeEntityName(i){if(this.dataUnit)return;const t=o.getContextValue("__SNK__APPLICATION__");this.dataUnit=await t.getDataUnit(i,null,null,this.configName)}onModeChange(){this.mode==g.IN_MEMORY&&this.initInMemoryDataUnit()}observeDataState(i,t){this.handleDataStateChange(i,t)}async observeFormLegacy(i,t){await this.handleUpdateFormLegacyConfig(i,t)}async observeGridLegacy(i,t){await this.handleUpdateGridLegacyConfig(i,t)}async handleDataStateChange(i,t){h.objectToString(t)!=h.objectToString(i)&&this.dataStateChange.emit(i),await this.processRmPrecision()}async processRmPrecision(){var i,t;const s=await this._snkDataUnit.getFieldsWithRmPrecision();for(const e of s||[]){if(!e)continue;const s=null===(t=null===(i=this.dataState)||void 0===i?void 0:i.rowMetadata)||void 0===t?void 0:t.getProp("rm_precision",e);(s||0===s)&&(await this.setFieldProp(e,"precision",s),await this.setFieldProp(e,"prettyPrecision",s))}this._rmPrecisionCustomValueFormatter.setDataState(this.dataState)}async handleUpdateGridLegacyConfig(i,t){null!=i&&i!=t&&this._gridConfigAlreadyLoaded&&await this.loadGridConfig(!0)}async handleUpdateFormLegacyConfig(i,t){null!=i&&i!=t&&this._formConfigAlreadyLoaded&&await this.loadFormConfig(!0)}openConfig(i){this._snkConfigurator.close(),i===p.GRID?this.openGridConfig():i===p.FORM&&this.openFormConfig()}openGridConfig(){this._grid.getColumnsState().then((i=>{this._snkGridConfig.columns=i.filter((i=>i.name)),this._snkGridConfig.selectedIndex=0,this._showPopUpGridConfig=!0}))}async openFormConfig(){(this.formLegacyConfigName||this.configName)&&await this._snkSimpleFormConfig.show()}addGridLegacyConfigName(){this.gridLegacyConfigName&&this.configName&&T.addGridLegacyConfig(this.configName,this.gridLegacyConfigName)}loadGridConfig(i){if(void 0!==this.configName&&(null==this.gridConfig&&!this._gridConfigAlreadyLoaded||i))return this.addGridLegacyConfigName(),this._gridConfigAlreadyLoaded=!0,new Promise(((i,t)=>{T.loadGridConfig(this.configName,this.resolveResourceID()).then((t=>{this.setGridConfig(t),i()})).catch((i=>{t(i)}))}))}formConfigIsLoaded(){return null!=this.formConfig||this._formConfigAlreadyLoaded}async loadFormConfig(i=!1,t=!1){if(void 0===this.configName)return;if(null==this._formConfigManager&&(this._formConfigManager=new I(this.configName,this.resolveResourceID(),void 0,this.dataUnit),this._formConfigManager.setConfig(this.formConfig)),this.formConfigIsLoaded()&&!i)return;this._formConfigAlreadyLoaded=!0;let s=await this._formConfigFetcher.fetchLegacyConfigurableForm(this.formLegacyConfigName);if(null!=s)return this._formConfigManager.setConfig(s),void this.setFormConfig(s,t);this.setFormConfig(await this._formConfigManager.loadConfig())}async componentWillRender(){this.loadTaskbarProcessor(),this._resourceID=await this.application.getResourceID(),this.dataExporterProviderStore(),this.dataExporterProviderStore(),this._taskbarProcessor.process(this.getTaskBarId(),this.taskbarManager,this.dataState,this.getTaskBarDisabledButtons()),void 0!==this.configName&&(null!=this.gridConfig||this._gridConfigAlreadyLoaded||(await this.addGridLegacyConfigName(),await this.loadGridConfig(),await this.loadFormConfig()))}componentDidRender(){this._rmPrecisionCustomValueFormatter.setGrid(this._grid),this.addGridCustomValueFormattters(),this.setFieldsProps(),this.setCustomRenders(),this.setCustomEditors()}componentWillLoad(){this.processMetadata(),this.onModeChange(),this.configDatasource(),this._rmPrecisionCustomValueFormatter=new C,this._continuousInsertUtils=new b(this.application,this.resolveResourceID(),this.configName),this.enableGridInsert&&this._continuousInsertUtils.getConfig().then((i=>this.enableContinuousInsert=i))}componentDidLoad(){c.applyVarsGrid(this._element,this._grid),this.initKeyboardManager(),this.dataUnit.subscribe(this.dataUnitActionHandler.bind(this))}async dataUnitActionHandler(i){i.type!==a.EDITION_CANCELED&&i.type!==a.DATA_SAVED||this.dataUnit.isMultipleEdition&&this.goToView(p.GRID)}getMessage(i,t){var s;return null===(s=this.messagesBuilder)||void 0===s?void 0:s.getMessage(i,t)}disconnectedCallback(){var i;null===(i=this._keyboardManager)||void 0===i||i.unbindAllShortcutKeys()}setCustomRenders(){if(this._grid)for(const[i,t]of this._customRenders)this._grid.addGridCustomRender(i,t),this._customRenders.delete(i)}setCustomEditors(){if(this._grid&&this._form)for(const[i,t]of this._customEditors)this._grid.addCustomEditor(i,t),this._form.addCustomEditor(i,t),this._customEditors.delete(i)}configDatasource(){this._multiSelectionListDataSource.setApplication(this.application),this._multiSelectionListDataSource.setDataUnit(this.dataUnit)}setFieldsProps(){if(this._form)for(const[i,t]of this._fieldsProps){for(const s in t)this._form.setFieldProp(i,s,t[s]);this._fieldsProps.delete(i)}}getTaskBarId(){var i,t;return(null===(i=this.dataState)||void 0===i?void 0:i.isDirty)?D.FINISH_EDITION:this.dataUnit.isMultipleEdition?D.MULTIPLE_EDITION:(null===(t=this.dataState)||void 0===t?void 0:t.selectionInfo)&&!this.dataState.selectionInfo.isAllRecords()&&this.dataState.selectionInfo.length>0?this._currentViewMode===p.GRID?D.GRID_SELECTED:D.FORM_SELECTED:this._currentViewMode===p.GRID?D.GRID_REGULAR:D.FORM_REGULAR}initInMemoryDataUnit(){this._inMemoryLoader=new w(this._metadata,void 0,{autoLoad:this.autoLoad}),this.dataUnit=this._inMemoryLoader.dataUnit,this.dataUnitReady.emit(this.dataUnit)}setMetadata(i){return this._inMemoryLoader?this._inMemoryLoader.metadata=i:this.dataUnit&&(this.dataUnit.metadata=i),Promise.resolve()}setRecords(i){return this._inMemoryLoader?this._inMemoryLoader.records=i:this.dataUnit&&(this.dataUnit.records=i),Promise.resolve()}getRecords(){return Promise.resolve(this.dataUnit.records)}async openConfigurator(){var i;null===(i=this._snkConfigurator)||void 0===i||i.open()}async closeConfigurator(){var i;null===(i=this._snkConfigurator)||void 0===i||i.close()}async updateConfig(){null==this._formConfigManager&&(this._formConfigManager=new I(this.configName,this.resolveResourceID())),this._formConfigManager.setConfig(this.formConfig)}processMetadata(){const i=this._element.querySelectorAll("snk-field-metadata"),t=[],s={fields:[],emptyConfig:!1};i.forEach((i=>{const e={name:i.getAttribute("name")||i.getAttribute("label"),label:i.getAttribute("label"),dataType:r[i.getAttribute("dataType")]||r.TEXT,userInterface:d[i.getAttribute("userInterface")]||d.SHORTTEXT,readOnly:"true"==i.getAttribute("readOnly"),required:"true"==i.getAttribute("required"),tab:i.getAttribute("tab")||void 0,visible:"false"!=i.getAttribute("visible")};s.fields.push({name:e.name,tab:e.tab,visible:e.visible}),t.push(e)})),t.length>0&&(this.formConfig||(this.formConfig=s),this._metadata={name:"SimpleCrud",label:"SimpleCrud",fields:t})}addGridCustomValueFormattters(){var i,t,s;const e=(null===(i=this._metadata)||void 0===i?void 0:i.fields)||(null===(s=null===(t=this.dataUnit)||void 0===t?void 0:t.metadata)||void 0===s?void 0:s.fields);if(!e)return;const n=[];e.forEach((i=>{var t;(null===(t=i.properties)||void 0===t?void 0:t.rm_precision)&&!n.includes(i.name)&&n.push(i.name)})),n.forEach((i=>{this.addCustomValueFormatter(i,this._rmPrecisionCustomValueFormatter)}))}onDataStateChange(i){this.dataState=Object.assign({},i.detail)}getTaskBarDisabledButtons(){var i,t,s,e,n,o;const h=[];return(null===(i=this.dataState)||void 0===i?void 0:i.hasNext)||h.push(v.NEXT),(null===(t=this.dataState)||void 0===t?void 0:t.hasPrevious)||h.push(v.PREVIOUS),(null===(e=null===(s=this.dataState)||void 0===s?void 0:s.selectionInfo)||void 0===e?void 0:e.isEmpty())&&h.push(v.FORM_MODE),(null===(o=null===(n=this.dataState)||void 0===n?void 0:n.selectionInfo)||void 0===o?void 0:o.length)>1&&h.push(v.CLONE),h}handleCancelEdit(){var i;(null===(i=this.dataState)||void 0===i?void 0:i.recordsIsEmpty)&&(this.goToView(p.GRID),this.dataUnit.clearSelection())}handleConfiguratorEvent(i,t){i.stopImmediatePropagation(),"SAVE"!==t?this.configuratorCancel.emit():this.configuratorSave.emit()}onSelectField(i){null!=i&&(this._fieldToGetFocus=i.value)}getFieldSearch(i,t){return null!=this._fieldSearch||(this._splitButtonForm=i,this._fieldSearch=m(t,(({argument:i})=>this.fieldsOptionLoader(i)),(i=>this.onSelectField(i)))),this._fieldSearch}getFormFields(){var i,t;return null!==(t=null===(i=this.formConfig)||void 0===i?void 0:i.fields)&&void 0!==t?t:this._formFields}handleFormSetFields(i){h.equals(this._formFields,i)||(this._formFields=null!=i?i:[])}fieldsOptionLoader(i){const t=null==i?void 0:i.toLowerCase(),s=this.getFormFields().map((i=>{var t;return null===(t=this.dataUnit)||void 0===t?void 0:t.getField(i.name)})).filter((i=>{var s,e;return(null===(s=i.name)||void 0===s?void 0:s.toLowerCase().includes(t))||(null===(e=i.label)||void 0===e?void 0:e.toLowerCase().includes(t))})).map((i=>({value:i.name,label:i.label})));return Promise.resolve(s)}isGridInsertActive(){return this.enableGridInsert&&this.dataUnit.hasNewRecord()}getColumnSearch(i,t){return null!=this._columnSearch||(this._splitButton=i,this._columnSearch=m(t,(({argument:i})=>new Promise((t=>{this._grid.filterColumns(i).then((i=>{t(i.filter((i=>!i.hidden)).map((i=>({label:i.label,value:i.name}))))}))}))),(i=>{null!=i&&this._grid.locateColumn(i.value)}))),this._columnSearch}getActionsList(){const i=[];if(this.enableGridInsert&&i.push(this._continuousInsertUtils.actionContinuousInsert(this.enableContinuousInsert,(()=>{this.enableContinuousInsert=!this.enableContinuousInsert,this._continuousInsertUtils.handleSaveConfig(this.enableContinuousInsert)}))),this.isGridInsertActive())return i;if(null!=this.taskbarManager&&null!=this.taskbarManager.getMoreOptions){const t=this.getTopTaskBarId();return i.concat(this.taskbarManager.getMoreOptions(t,this.configName,this.dataState,this.actionsList))}return i.concat(this.actionsList)}getSettingsListGrid(){return[{value:n.generateUUID(),label:this.getMessage("snkSimpleCrud.findColumn"),disableCloseOnSelect:!0,eagerInitialize:!0,itemBuilder:(i,t)=>this.getColumnSearch(i,t)}]}getSettingsListForm(){return[{value:n.generateUUID(),label:this.getMessage("snkSimpleCrud.findFields"),disableCloseOnSelect:!0,eagerInitialize:!0,itemBuilder:(i,t)=>this.getFieldSearch(i,t)}]}getTopTaskBarId(){var i;return(null===(i=this.dataState)||void 0===i?void 0:i.isDirty)?`snkGridTopTaskbar.finish_edition${y.PRIMARY}`:`snkGridTopTaskbar.regular${y.PRIMARY}`}clearFieldToFocusHandler(){this._fieldToGetFocus=void 0}gridConfigChangeHandler(i){i.stopPropagation(),this.configName&&T.saveGridConfig(i.detail,this.configName,this.resolveResourceID())}modalConfigChangeHandler(i){const t=i.detail;this._grid.setColumnsState(t.columns).then((()=>{this.setGridConfig(t),this.closeGridConfig(),this.dataExporterProviderStore()})),i.stopPropagation()}async dataExporterProviderStore(){if(null==this.dataUnit)return;if(null==this._grid)return;const i=new k(this.dataUnit,this._grid);_.set("exporterProviders",Object.assign(Object.assign({},_.get("exporterProviders")),{[this.getDataExporterStoreKey()]:i}))}getDataExporterStoreKey(){return`SnkSimpleCrudDataExporter:${null==this.configName?this.dataUnit.name:this.configName}`}setGridConfig(i){this.gridConfig=i,S.assertDefaultSorting(this.gridConfig,this.dataUnit)}setFormConfig(i,t){this.formConfig&&!t||(this.formConfig=i)}closeGridConfig(){this._showPopUpGridConfig=!1}getPageSize(){return this.mode===g.IN_MEMORY?0:null==this.pageSize?150:this.pageSize}resolveResourceID(){return n.isEmpty(this.resourceID)?this._resourceID:this.resourceID}getFormConfig(){var i;const t=null===(i=this._formConfigManager)||void 0===i?void 0:i.getConfig(this.dataUnit,this.ignoreReadOnlyFormFields);return this.configName||t?t:this.formConfig}updateFormConfig(){let i=this.formConfig;null==this.formLegacyConfigName&&(i=Object.assign(Object.assign({},this.formConfig),{fields:this.dataUnit.metadata.fields})),this.setFormConfig(i,!0),null==this._formConfigManager&&(this._formConfigManager=new I(this.configName,this.resolveResourceID())),this._formConfigManager.setConfig(this.formConfig)}handleDataUnitOnInsertionMode(){this.enableGridInsert||this.goToView(p.FORM)}async initKeyboardManager(){var i;this._keyboardManager=new l({propagate:!1,element:this._element});const t=this.dataUnit||await(null===(i=this._snkDataUnit)||void 0===i?void 0:i.getDataUnit());null!=t&&this._keyboardManager.bind("F7",(()=>t.saveData()),{description:this.getMessage("snkSimpleCrud.keyboardShortcuts.saveData"),element:this._element}).bind("F8",t.addRecord.bind(t),{description:this.getMessage("snkSimpleCrud.keyboardShortcuts.addRecord"),element:this._element}).bind("F9",t.removeSelectedRecords.bind(t),{description:this.getMessage("snkSimpleCrud.keyboardShortcuts.removeRecord"),element:this._element}).bind("Escape",(()=>{t.isDirty()&&t.cancelEdition()}),{debounceTime:1e3,description:this.getMessage("snkSimpleCrud.keyboardShortcuts.cancelAction"),element:this._element})}async handleFormConfigSaved(){await this.loadFormConfig(!0,!0)}focusToGrid(){this._grid.focus()}focusToForm(){this._form.focus()}renderTaskbarContent(i){var t;return s("snk-taskbar",{class:"ez-box--no-outline ez-box "+(this._currentViewMode===p.FORM?(this.outlineMode?"ez-box--outline":"ez-box--shadow-xsmall")+" ez-padding--small":""),dataUnit:this.dataUnit,primaryButton:(null===(t=this.dataState)||void 0===t?void 0:t.isDirty)?"SAVE":"INSERT","data-element-id":"grid_left",messagesBuilder:this.messagesBuilder,buttons:this._taskbarProcessor.buttons,actionsList:this.getActionsList(),actionsSettingsList:i===p.GRID?this.getSettingsListGrid():this.getSettingsListForm(),disabledButtons:this._taskbarProcessor.disabledButtons,customButtons:this._taskbarProcessor.customButtons,"data-exporter-store-key":this.getDataExporterStoreKey(),slot:"leftButtons",presentationMode:y.SECONDARY,tabindex:"0"},s("slot",{name:"TASKBAR_CUSTOM_ELEMENTS"}))}render(){var i;if(null!=this.dataUnit)return s("snk-data-unit",{ref:i=>this._snkDataUnit=i,class:"simple-crud__container",dataUnit:this.dataUnit,useCancelConfirm:this.useCancelConfirm,onDataStateChange:i=>this.onDataStateChange(i),onCancelEdition:this.handleCancelEdit.bind(this),pageSize:this.getPageSize(),onInsertionMode:this.handleDataUnitOnInsertionMode.bind(this),onDataUnitReady:i=>this.dataUnitReady.emit(i.detail),onMessagesBuilderUpdated:i=>this.messagesBuilder=i.detail,onDataUnitFieldsHidded:this.updateFormConfig.bind(this),domainMessagesBuilder:this.domainMessagesBuilder},s("header",null,s("slot",{name:"snkSimpleCrudHeader"})),s("section",{class:`ez-box ez-box--no-outline ${this.outlineMode?"ez-box--outline":"ez-box--shadow"} simple-crud__container-section`,ref:i=>this._container=i,tabindex:"0"},s("ez-view-stack",{ref:i=>this._viewStack=i,"data-element-id":"simple-crud"},s("stack-item",null,s("ez-grid",{class:"ez-margin-bottom--large ez-box--no-outline",ref:i=>this._grid=i,dataUnit:this.dataUnit,config:this.gridConfig,"no-header":!0,multipleSelection:this.multipleSelection,onEzDoubleClick:()=>this.goToView(p.FORM),onConfigChange:i=>this.gridConfigChangeHandler(i),columnfilterDataSource:this.dataUnit.name&&this.dataUnit.name.includes(w.IN_MEMORY_DATA_UNIT_NAME)?void 0:this._multiSelectionListDataSource,useEnterLikeTab:this.useEnterLikeTab,autoFocus:this.autoFocus,enableGridInsert:this.enableGridInsert,enableContinuousInsert:this.enableContinuousInsert,enableLockManagerTaskbarClick:this.enableLockManagerTaskbarClick,enableLockManagerLoadingComp:this.enableLockManagerLoadingComp,outlineMode:this.outlineMode,tabindex:"0",paginationCounterMode:this.paginationCounterMode},this.renderTaskbarContent(p.GRID),s("div",{slot:"footer"},s("slot",{name:"snkSimpleCrudFooter"})))),s("stack-item",null,this.renderTaskbarContent(p.FORM),s("ez-form",{ref:i=>this._form=i,class:"ez-margin-top--large ez-box--no-outline",dataUnit:this.dataUnit,config:this.getFormConfig(),fieldToFocus:this._fieldToGetFocus,onEzFormSetFields:i=>this.handleFormSetFields(i.detail),onEzFormRequestClearFieldToFocus:this.clearFieldToFocusHandler.bind(this),elementFocusSearchField:this._container,tabindex:"0"}),s("snk-simple-form-config",{ref:i=>this._snkSimpleFormConfig=i,dataUnit:this.dataUnit,onSnkConfigSaved:this.handleFormConfigSaved.bind(this),configName:null!==(i=this.formLegacyConfigName)&&void 0!==i?i:this.configName,messagesBuilder:this.messagesBuilder})),this.messagesBuilder&&s("snk-configurator",{ref:i=>this._snkConfigurator=i,viewMode:this._currentViewMode,messagesBuilder:this.messagesBuilder,onConfigSelected:i=>this.goToView(i.detail),onOpenConfig:i=>this.openConfig(i.detail),showActionButtons:this.showConfiguratorButtons,onSave:i=>this.handleConfiguratorEvent(i,"SAVE"),onCancel:i=>this.handleConfiguratorEvent(i,"CANCEL"),resourceID:this.resolveResourceID(),customContainerId:this._customContainerId,layoutFormConfig:this.layoutFormConfig})),s("div",{id:`${this._customContainerId}`},s("slot",{name:"SnkConfigContainerSlot"}))),s("ez-popup",{size:"medium",heightMode:"auto",useHeader:!1,opened:this._showPopUpGridConfig,onEzClosePopup:()=>this.closeGridConfig()},s("snk-grid-config",{ref:i=>this._snkGridConfig=i,config:this.gridConfig,"data-element-id":this._element.getAttribute(u.DATA_ELEMENT_ID_ATTRIBUTE_NAME),selectedIndex:0,configName:this.configName,onConfigChange:i=>this.modalConfigChangeHandler(i),onConfigCancel:()=>this.closeGridConfig(),resourceID:this.resolveResourceID()})))}get _element(){return e(this)}static get watchers(){return{resourceID:["handleResourceIDChanged"],entityName:["onChangeEntityName"],mode:["onModeChange"],dataState:["observeDataState"],formLegacyConfigName:["observeFormLegacy"],gridLegacyConfigName:["observeGridLegacy"]}}};var D;!function(i){i.FORM_REGULAR="snkSimpleCrudTaskbar.form_regular",i.GRID_REGULAR="snkSimpleCrudTaskbar.grid_regular",i.FORM_SELECTED="snkSimpleCrudTaskbar.form_selected",i.GRID_SELECTED="snkSimpleCrudTaskbar.grid_selected",i.FINISH_EDITION="snkSimpleCrudTaskbar.finish_edition",i.MULTIPLE_EDITION="snkSimpleCrudTaskbar.multiple_edition"}(D||(D={})),M.style=".sc-snk-simple-crud-h{display:flex;height:100%;width:100%;--snk-simple-crud-grid--min-height:300px}.simple-crud__container.sc-snk-simple-crud{display:grid;grid-template-rows:auto 1fr;height:100%;width:100%}.simple-crud__container-section.sc-snk-simple-crud{flex-wrap:unset;flex-direction:column}.simple-crud__form--hidden.sc-snk-simple-crud{display:none}ez-grid.sc-snk-simple-crud{--ez-grid__container--shadow:none;--ez-grid__container--shadow--outline:none;--ez-grid--min-height:var(--snk-simple-crud-grid--min-height)}ez-form.sc-snk-simple-crud{min-height:300px}";export{M as snk_simple_crud}
Binary file
@@ -1,4 +1,4 @@
1
- import{ObjectUtils as t,DataUnit as e,DataUnitInMemoryLoader as n,ApplicationContext as r,StringUtils as a,UserInterface as i,DataUnitStorage as o,DataType as s,ChangeOperation as c}from"@sankhyalabs/core";import{D as l,S as u,d}from"./p-42dde1ec.js";import{DISTINCT_FILTER_NAME_PREFIX as m}from"@sankhyalabs/ezui/dist/collection/utils/constants";import{DataUnitTransient as h}from"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import{ColumnFilterManager as f}from"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import p from"@sankhyalabs/core/dist/utils/SortingUtils";import{R as g}from"./p-688dcb4c.js";class _{constructor(t){this._list=[],this._listCopy=[],this._listLastUpdate=0,this._listCopyLastUpdate=0,this._equalsFunction=t}async load(t,e,n,r){let a=[].concat(this._list);null!=t&&(a=this._list.filter((e=>t(e)))),null!=e&&(a=a.sort(e));const i=a.length;if(null!=r){const t=n||0;a=a.slice(t,r?t+r:a.length)}return Promise.resolve({result:a,count:i})}async distict(t){const e=[];let n=!1;for(const r of this._list){const a=t(r);null!=a&&(null!=a.value?e.push(a):n=!0)}return n&&e.push({key:"",value:null}),Promise.resolve(new Map(e.map((t=>[t.key,t.value]))))}async push(t){this.updateList([...this._list,...t])}async clear(){this.updateList([])}async delete(t){const e=this._list.filter((e=>{for(const n of t)if(this._equalsFunction(e,n))return!1;return!0}));this.updateList(e)}async update(t){const e=this._list.map((e=>{const n=t.find((t=>this._equalsFunction(e,t)));return null==n?e:n}));this.updateList(e)}async insert(t,e){const n=this._list.indexOf(t);if(-1==n)return void this.push(e);const r=this._list.slice(0,n).concat(e).concat(this._list.slice(n));this.updateList(r)}isOperating(){return!0}async isEmpty(){return Promise.resolve(0===this._list.length)}async count(){return Promise.resolve(this._list.length)}getFromCache(){return this._listLastUpdate>this._listCopyLastUpdate&&(this._listCopyLastUpdate=this._listLastUpdate,this._listCopy=t.copy(this._list)),this._listCopy}updateList(t){this._list=t,this._listLastUpdate=Date.now()}}class v{static setLoadingStatus(t,e){this._loadingStatus.set(t.name,e)}static isCacheEnabled(t){return!0}static cacheRecords(t,e,n,r){v.setLoadingStatus(t,r),v.isCacheEnabled(t)?this.getRepository(t).push(e):n&&this._repositories.delete(t.name)}static getSortingFunction(t,e){return p.getSortingFunction(t,e)}static async getDistinct(t,e,n=!1){if(!v.isCacheEnabled(t))return Promise.resolve(f.compileDistinct(e,t));let r;const a=t.getLastLoadRequest();if(null!=a){const n=f.getColumnFilters(a.filters,e);r=f.getFilterFunction(t,Array.from(n.values()))}return new Promise(((a,i)=>{v.getRepository(t).distict((a=>{if(null!=r&&!r(a))return;const i=a[e];if(null==i)return{key:null,value:null};let o=null!=i.value?i.value:i;return(null==i?void 0:i.label)&&n?{key:null==i?void 0:i.label,value:t.getFormattedValue(e,o)}:{key:t.getFormattedValue(e,i),value:o}})).then((t=>{a(null!=t?Array.from(t.entries()).map((([t,e])=>({label:t,value:e,check:!0}))):void 0)})).catch((t=>i(t)))}))}static async loadData(t,n,r){try{if(v.isCacheEnabled(t)){if(["EZ_GRID_LOADING_SOURCE",e.CHANGING_PAGE_LOADING_SOURCE,e.ALL_RECORDS_SELECTION_SOURCE].includes(n.source)&&!await v.getRepository(t).isEmpty())return v.loadFromCache(t,n);v.getRepository(t).clear().catch((()=>{}))}return r(t,n)}catch(t){return console.error(t),Promise.reject(t)}}static insertRecords(t,e,n){v.isCacheEnabled(t)&&v.getRepository(t).insert(e,n)}static updateRecords(t,e){v.isCacheEnabled(t)&&v.getRepository(t).update(e)}static removeRecords(t,e){v.isCacheEnabled(t)&&v.getRepository(t).delete(e)}static async countRecords(t){return v.isCacheEnabled(t)?v.getRepository(t).count():Promise.resolve(0)}static getRepository(t){const e=t.name;return v._repositories.has(e)||v._repositories.set(e,new _(((t,e)=>t.__record__id__===e.__record__id__))),v._repositories.get(e)}static async loadFromCache(t,e){return new Promise(((n,r)=>{const a=f.getColumnFilters(e.filters,""),{limit:i,offset:o,sort:s}=e;v.getRepository(t).load(f.getFilterFunction(t,Array.from(a.values())),v.getSortingFunction(t,s),o,i).then((e=>{const r=v._loadingStatus.get(t.name),{count:a,result:s}=e,c=0==a?0:o+1,l=o+Math.min(s.length,i);n({records:s,paginationInfo:{count:a,currentPage:o/i,firstRecord:c,lastRecord:l,hasMore:r||l<a,total:r?void 0:a}})})).catch((t=>r(t)))}))}static getCachedRecords(t){return v.getRepository(t).getFromCache()}}v._repositories=new Map,v._loadingStatus=new Map;class b{constructor(t,e,r){this._dataUnitInMemoryLoader=new n(t,e,r)}get dataUnit(){return this._dataUnitInMemoryLoader.dataUnit}get records(){return this._dataUnitInMemoryLoader.records}set records(t){this._dataUnitInMemoryLoader.records=t}get metadata(){return this._dataUnitInMemoryLoader.metadata}set metadata(t){this._dataUnitInMemoryLoader.metadata=t}removeLoader(t,e){return this._dataUnitInMemoryLoader.removeLoader(t,e)}static getConvertedValue(t,e,r){return n.getConvertedValue(t,e,r)}}function y(t,e){var n,r;return void 0!==(null===(n=t[e])||void 0===n?void 0:n.value)?null===(r=t[e])||void 0===r?void 0:r.value:t[e]}b.IN_MEMORY_DATA_UNIT_NAME=n.IN_MEMORY_DATA_UNIT_NAME;class D{canSlice(){return!1}processSortingSide(t,e,n){var r;const a=[],o=[];if(null!=t.sort){if(0===n.length)return{localSorting:t.sort,serverSorting:[]};for(const n of t.sort){const t=e.getField(n.field);"true"===(null===(r=null==t?void 0:t.properties)||void 0===r?void 0:r.calculated)||(null==t?void 0:t.userInterface)===i.LONGTEXT?a.push(n):o.push(n)}}return{localSorting:a,serverSorting:o}}async load(t,e,n){var r,a;if(null==t.metadata)return Promise.resolve({records:[],loadingInfo:n});try{const i=null!==(a=null===(r=e.filters)||void 0===r?void 0:r.filter((t=>!t.name.startsWith("FILTRO_COLUNA_"))))&&void 0!==a?a:[],{localSorting:o,serverSorting:s}=this.processSortingSide(e,t,i),c=this.getFieldsList(t),u="DatasetSP.loadRecords",d=this.buildRequestBody(u,c,t,e,n,s,i),m=n.quiet?{urlParams:{quietMode:"true"}}:void 0,{result:h,pagerID:f,askRowsLimit:p}=await l.get().callServiceBroker(u,d,m),g=this.processRecords(t,c,h),_=null!=f,v=n.count+g.length,b=t.hasNewRecord(),y=o.length>0,D=!_&&y;return D&&b&&t.setWaitingToReload(!0),Promise.resolve({records:g,loadingInfo:Object.assign(Object.assign({},n),{pagerId:f,loadingInProgress:_,total:_?void 0:v,count:v,needReload:D&&!b,askRowsLimit:p,hasLocalSorting:y})})}catch(t){return console.error(t),Promise.reject(t)}}async loadRowMetadata(t,e,n,r={}){try{const a="DatasetSP.loadRowMetadata",i=await this.buildRequestBodyLoadRowMetadata({snkDataUnit:t,fieldName:e,metadataName:n,serviceName:a,updatedFields:r});return await l.get().callServiceBroker(a,i)}catch(t){return console.error(t),Promise.reject(t)}}async buildRequestBodyLoadRowMetadata({snkDataUnit:t,serviceName:e,fieldName:n,metadataName:r,updatedFields:a}){const i=t.dataUnit,o=O.parseDataUnitName(i.name).entityName,s=(await t.getSelectedRecordsIDsInfo()).reduce(((t,e)=>(t[e.name]=e.value,t)),{}),c=i.getSelectedRecord(),l=i.metadata.fields.filter((({standAlone:t,name:e})=>!t&&!e.includes("."))).map((({name:t})=>t)),u=l.reduce(((t,e,n)=>{const r=y(c,e),i=y(a,e);return t[n]=void 0!==i?i:r,t}),{});return JSON.stringify({serviceName:e,requestBody:{dataSetID:i.dataUnitId,entityName:o,standAlone:!1,metadataName:r,fieldName:n,fields:l,record:{pk:s,oldPk:s,values:u}}})}getFieldsList(t){let e=["__record__id__","__record__label__"];return t.metadata.fields.forEach((t=>{t.standAlone||(e=e.concat(this.getFieldNames(t)))})),e}getStandAloneFieldsList(t){let e={};return t.metadata.fields.forEach((t=>{t.standAlone&&(e=Object.assign(Object.assign({},e),{[t.name]:{fieldType:t.dataType,userType:t.userInterface}}))})),e}getFieldNames(t){const e=this.getSearchDescriptionField(t);return null==e?t.name:[t.name,e]}buildRequestBody(t,e,n,r,a,i,o){const s=n.dataUnitId,c=O.parseDataUnitName(n.name).entityName,l=!(!r.limit&&!r.offset),u={serviceName:t,requestBody:{dataSetID:s,fields:e,entityName:c,pageNumber:a.pageNumber,totalRecordsCount:a.count,pagerID:a.pagerId,standAlone:!1,standAloneFieldsMD:Object.assign({__record__id__:{fieldType:"S",userType:"P"},__record__label__:{fieldType:"S",userType:"P"}},this.getStandAloneFieldsList(n)),tryJoinedFields:!0,parallelLoader:l,crudListener:`br.com.sankhya.bff.${this.getModuleName()}.BFFDataUnitDatasetAdapter`,txProperties:this.getTxProperties(n,r,i,o),useDefaultRowsLimit:!1}};return JSON.stringify(u)}getModuleName(){return r.getContextValue("__SNK__APPLICATION__").getModuleName().replace("-bff","")}getTxProperties(t,e,n,r){const a={"__DATA_UNIT_ADAPTER__[dataUnitName]":t.name};0!==r.length&&(a["__DATA_UNIT_ADAPTER__[criteria]"]=JSON.stringify(r)),null!=n&&0!==n.length&&(a["__DATA_UNIT_ADAPTER__[sorting]"]=JSON.stringify(n)),null!=e.parentRecordId&&(a["__DATA_UNIT_ADAPTER__[parentRecordId]"]=e.parentRecordId);const i=t.getGlobalLoaderProps();return null==i||0===i.size||Array.from(i.entries()).forEach((([t,e])=>{a[t]=e})),a}processRecords(t,e,n){return n.map((n=>{const r={__record__id__:n[0],__record__label__:n[1],__record__metadata__:n[n.length-1]._rmd};return t.metadata.fields.forEach((t=>{r[t.name]=this.buildFieldValue(t,e,n)})),r}))}buildFieldValue(t,e,n){const r=e.indexOf(t.name);if(r<0)return null;const o=n[r];if(a.isEmpty(o))return null;const s=this.getSearchDescriptionField(t);if(null!=s){const t=e.indexOf(s);if(t>=0)return{value:o,label:n[t]}}return t.userInterface===i.SEARCH?isNaN(Number(o))?o:Number(o):b.getConvertedValue(t,o)}getSearchDescriptionField(t){if(![i.SEARCH,i.SEARCHPLUS].includes(t.userInterface))return;if(!t.properties)return;const{ENTITYNAME:e,mergedFrom:n,DESCRIPTIONFIELD:r}=t.properties;return a.isEmpty(r)?void 0:null!=n?`${n}.${e}.${r}`:`${e}.${r}`}}var P;!function(t){t.CANCEL="CANCEL",t.CONTINUE="CONTINUE",t.LOAD_ALL="LOAD_ALL"}(P||(P={}));class R{constructor(){}static async debounce(t,e){const n=t.name;R._debouncingTimeouts[n]&&(clearTimeout(R._debouncingTimeouts[n]),delete R._debouncingTimeouts[n]),R._debouncingTimeouts[n]=setTimeout((()=>{delete R._debouncingTimeouts[n],e()}),100)}static async loadData(t,e){return new Promise(((n,r)=>{R.debounce(t,(()=>{v.loadData(t,e,this.loadFromServer).then((t=>n(t))).catch((t=>r(t)))}))}))}static getCachedRecords(t){return v.getCachedRecords(t)}static async loadFromServer(t,e,n){try{n=R.registryLoading(t,n);const r=await R.callLoader(t,e,n);if(null==r)return;const a=r.records,i=R.buildPaginationInfo(a.length,e,r.loadingInfo),o=null==i?a:a.slice(0,i.lastRecord);return Promise.resolve({records:o,paginationInfo:i})}catch(t){return console.error(t),Promise.reject(t)}}static async callLoader(t,e,n,r){null==r&&(r=new D);const a=await r.load(t,e,n),i=a.loadingInfo;if(R.isOldRequest(t,i))return Promise.resolve(void 0);if(this.handleCache(r,i,t,a.records),t.cancelPagination)return this.handlePaginationCanceled(t,a);if(this.canFinishPagination(t,i))return Promise.resolve(a);const o=Object.assign(Object.assign({},e),{offset:i.count});let s=this.buildNewLoadingInfo(i);if(this.canProceedPagination(i))return this.recallLoader(t,o,s,r,a);const c=await async function(){return new Promise((t=>{const e=new u,{checkboxContainer:n,checkbox:r}=function(t){const e=document.createElement("div");e.style.marginBottom="14px",e.style.display="flex",e.style.alignItems="center";const{checkbox:n,checkboxLabel:r}=function(t){const e=document.createElement("input");e.type="checkbox",e.id="loadAll";const n=document.createElement("label");return n.htmlFor="loadAll",n.textContent=null==t?void 0:t.getMessage("dataUnitDataLoaderHelper.checkbox.loadAll"),n.style.marginLeft="5px",{checkbox:e,checkboxLabel:n}}(t);return e.appendChild(n),e.appendChild(r),{checkboxContainer:e,checkbox:n}}(e),a=function(t,e,n){const r=document.createElement("ez-popup");return r.opened=!0,r.size="x-small",r.ezTitle=null==n?void 0:n.getMessage("dataUnitDataLoaderHelper.pagination.title"),r.heightMode="auto",r.addEventListener("ezClosePopup",(()=>{document.body.removeChild(r),t(e.checked?P.LOAD_ALL:P.CONTINUE)}),{once:!0}),r.addEventListener("ezPopupAction",(()=>{document.body.removeChild(r),t(P.CANCEL)}),{once:!0}),r}(t,r,e),i=function(){const t=document.createElement("div");return t.style.display="flex",t.style.flexDirection="column",t.style.fontFamily="var(--font-pattern, Roboto)",t.style.fontSize="var(--text--medium)",t}(),o=function(){const t=document.createElement("div");return t.style.display="flex",t.style.flexDirection="row",t.style.justifyContent="end",t.style.gap="5px",t}();i.appendChild(n),i.appendChild(function(t){const e=document.createElement("div"),n=document.createElement("p"),r=document.createElement("p"),a=document.createElement("p");return a.style.fontWeight="var(--text-weight--large, 600)",n.textContent=null==t?void 0:t.getMessage("dataUnitDataLoaderHelper.pagination.line1"),r.textContent=null==t?void 0:t.getMessage("dataUnitDataLoaderHelper.pagination.line2"),a.textContent=null==t?void 0:t.getMessage("dataUnitDataLoaderHelper.pagination.line3"),e.appendChild(n),e.appendChild(r),e.appendChild(a),e}(e)),o.appendChild(function(t,e,n,r){const a=document.createElement("ez-button");return a.label=null==r?void 0:r.getMessage("dataUnitDataLoaderHelper.buttons.continue"),a.size="medium",a.onclick=()=>{document.body.removeChild(t),n(e.checked?P.LOAD_ALL:P.CONTINUE)},a}(a,r,t,e)),o.appendChild(function(t,e,n){const r=document.createElement("ez-button");return r.label=null==n?void 0:n.getMessage("dataUnitDataLoaderHelper.buttons.cancel"),r.size="medium",r.classList.add("ez-button--primary"),r.onclick=()=>{document.body.removeChild(t),e(P.CANCEL)},r}(a,t,e)),i.appendChild(o),a.appendChild(i),document.body.appendChild(a)}))}();return c===P.CANCEL?this.handlePaginationCanceled(t,a):(c===P.LOAD_ALL&&(s=Object.assign(Object.assign({},s),{loadAllRecords:!0})),s=Object.assign(Object.assign({},s),{lastRowLimitAsked:s.count}),this.recallLoader(t,o,s,r,a))}static buildNewLoadingInfo(t){return Object.assign(Object.assign({},t),{pageNumber:(t.pageNumber||0)+1,quiet:!0})}static handleCache(t,e,n,r){const a=!t.canSlice()||0===e.count;v.cacheRecords(n,r,a,e.loadingInProgress)}static recallLoader(t,e,n,r,a){return this.callLoader(t,e,n,r).then((e=>R.afterLoadingPage(t,e.loadingInfo))).catch((t=>console.error(t))),Promise.resolve(a)}static canFinishPagination(t,e){return!v.isCacheEnabled(t)||!e.loadingInProgress}static canProceedPagination(t){const{count:e,askRowsLimit:n,loadAllRecords:r,lastRowLimitAsked:a}=t;if(r)return!0;if(!e||!n)return!0;const i=Number(n);return e<i||e<i+(a||0)}static handlePaginationCanceled(t,e){t.cancelPagination=!1;let n=e.loadingInfo;return n=Object.assign(Object.assign({},n),{total:n.count,loadingInProgress:!1,pagerId:void 0,needReload:n.hasLocalSorting}),Promise.resolve({records:e.records,loadingInfo:n})}static afterLoadingPage(t,e){v.setLoadingStatus(t,e.loadingInProgress);const n=t.getPaginationInfo();if(null==n)return;const r=e.count;e.loadingInProgress?t.updatePagination(Object.assign(Object.assign({},n),{count:r,loadingInProgress:!0})):e.needReload?t.gotoPage(0):t.updatePagination(Object.assign(Object.assign({},n),{total:r,count:r,loadingInProgress:!1}))}static registryLoading(t,e){return null==e&&(e={requestTime:(new Date).getTime(),count:0}),R._requestTimeByDataUnit.set(t.name,e.requestTime),e}static isOldRequest(t,e){return R._requestTimeByDataUnit.get(t.name)>e.requestTime}static buildPaginationInfo(t,e,n){let{limit:r,offset:a}=e;if(!r)return;1===n.pageNumber&&(a=0);const{total:i,count:o,loadingInProgress:s,askRowsLimit:c}=n,l=0===o||0===t?0:a+1,u=a+Math.min(t,r);return{total:i,count:o,lastRecord:u,firstRecord:l,currentPage:a/r,hasMore:u<o||s,askRowsLimit:c}}}R._requestTimeByDataUnit=new Map,R._debouncingTimeouts={};const N=/dd:\/\/([^/]+)\/([^/?]+)/;class O{constructor(){this.templateByQuery=new Map,this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchDataUnit",d.gql`query($name: String!) {
1
+ import{ObjectUtils as t,DataUnit as e,DataUnitInMemoryLoader as n,ApplicationContext as r,StringUtils as a,UserInterface as i,DataUnitStorage as o,DataType as s,ChangeOperation as c}from"@sankhyalabs/core";import{D as l,S as u,d}from"./p-b2212d20.js";import{DISTINCT_FILTER_NAME_PREFIX as m}from"@sankhyalabs/ezui/dist/collection/utils/constants";import{DataUnitTransient as h}from"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import{ColumnFilterManager as f}from"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import p from"@sankhyalabs/core/dist/utils/SortingUtils";import{R as g}from"./p-688dcb4c.js";class _{constructor(t){this._list=[],this._listCopy=[],this._listLastUpdate=0,this._listCopyLastUpdate=0,this._equalsFunction=t}async load(t,e,n,r){let a=[].concat(this._list);null!=t&&(a=this._list.filter((e=>t(e)))),null!=e&&(a=a.sort(e));const i=a.length;if(null!=r){const t=n||0;a=a.slice(t,r?t+r:a.length)}return Promise.resolve({result:a,count:i})}async distict(t){const e=[];let n=!1;for(const r of this._list){const a=t(r);null!=a&&(null!=a.value?e.push(a):n=!0)}return n&&e.push({key:"",value:null}),Promise.resolve(new Map(e.map((t=>[t.key,t.value]))))}async push(t){this.updateList([...this._list,...t])}async clear(){this.updateList([])}async delete(t){const e=this._list.filter((e=>{for(const n of t)if(this._equalsFunction(e,n))return!1;return!0}));this.updateList(e)}async update(t){const e=this._list.map((e=>{const n=t.find((t=>this._equalsFunction(e,t)));return null==n?e:n}));this.updateList(e)}async insert(t,e){const n=this._list.indexOf(t);if(-1==n)return void this.push(e);const r=this._list.slice(0,n).concat(e).concat(this._list.slice(n));this.updateList(r)}isOperating(){return!0}async isEmpty(){return Promise.resolve(0===this._list.length)}async count(){return Promise.resolve(this._list.length)}getFromCache(){return this._listLastUpdate>this._listCopyLastUpdate&&(this._listCopyLastUpdate=this._listLastUpdate,this._listCopy=t.copy(this._list)),this._listCopy}updateList(t){this._list=t,this._listLastUpdate=Date.now()}}class v{static setLoadingStatus(t,e){this._loadingStatus.set(t.name,e)}static isCacheEnabled(t){return!0}static cacheRecords(t,e,n,r){v.setLoadingStatus(t,r),v.isCacheEnabled(t)?this.getRepository(t).push(e):n&&this._repositories.delete(t.name)}static getSortingFunction(t,e){return p.getSortingFunction(t,e)}static async getDistinct(t,e,n=!1){if(!v.isCacheEnabled(t))return Promise.resolve(f.compileDistinct(e,t));let r;const a=t.getLastLoadRequest();if(null!=a){const n=f.getColumnFilters(a.filters,e);r=f.getFilterFunction(t,Array.from(n.values()))}return new Promise(((a,i)=>{v.getRepository(t).distict((a=>{if(null!=r&&!r(a))return;const i=a[e];if(null==i)return{key:null,value:null};let o=null!=i.value?i.value:i;return(null==i?void 0:i.label)&&n?{key:null==i?void 0:i.label,value:t.getFormattedValue(e,o)}:{key:t.getFormattedValue(e,i),value:o}})).then((t=>{a(null!=t?Array.from(t.entries()).map((([t,e])=>({label:t,value:e,check:!0}))):void 0)})).catch((t=>i(t)))}))}static async loadData(t,n,r){try{if(v.isCacheEnabled(t)){if(["EZ_GRID_LOADING_SOURCE",e.CHANGING_PAGE_LOADING_SOURCE,e.ALL_RECORDS_SELECTION_SOURCE].includes(n.source)&&!await v.getRepository(t).isEmpty())return v.loadFromCache(t,n);v.getRepository(t).clear().catch((()=>{}))}return r(t,n)}catch(t){return console.error(t),Promise.reject(t)}}static insertRecords(t,e,n){v.isCacheEnabled(t)&&v.getRepository(t).insert(e,n)}static updateRecords(t,e){v.isCacheEnabled(t)&&v.getRepository(t).update(e)}static removeRecords(t,e){v.isCacheEnabled(t)&&v.getRepository(t).delete(e)}static async countRecords(t){return v.isCacheEnabled(t)?v.getRepository(t).count():Promise.resolve(0)}static getRepository(t){const e=t.name;return v._repositories.has(e)||v._repositories.set(e,new _(((t,e)=>t.__record__id__===e.__record__id__))),v._repositories.get(e)}static async loadFromCache(t,e){return new Promise(((n,r)=>{const a=f.getColumnFilters(e.filters,""),{limit:i,offset:o,sort:s}=e;v.getRepository(t).load(f.getFilterFunction(t,Array.from(a.values())),v.getSortingFunction(t,s),o,i).then((e=>{const r=v._loadingStatus.get(t.name),{count:a,result:s}=e,c=0==a?0:o+1,l=o+Math.min(s.length,i);n({records:s,paginationInfo:{count:a,currentPage:o/i,firstRecord:c,lastRecord:l,hasMore:r||l<a,total:r?void 0:a}})})).catch((t=>r(t)))}))}static getCachedRecords(t){return v.getRepository(t).getFromCache()}}v._repositories=new Map,v._loadingStatus=new Map;class b{constructor(t,e,r){this._dataUnitInMemoryLoader=new n(t,e,r)}get dataUnit(){return this._dataUnitInMemoryLoader.dataUnit}get records(){return this._dataUnitInMemoryLoader.records}set records(t){this._dataUnitInMemoryLoader.records=t}get metadata(){return this._dataUnitInMemoryLoader.metadata}set metadata(t){this._dataUnitInMemoryLoader.metadata=t}removeLoader(t,e){return this._dataUnitInMemoryLoader.removeLoader(t,e)}static getConvertedValue(t,e,r){return n.getConvertedValue(t,e,r)}}function y(t,e){var n,r;return void 0!==(null===(n=t[e])||void 0===n?void 0:n.value)?null===(r=t[e])||void 0===r?void 0:r.value:t[e]}b.IN_MEMORY_DATA_UNIT_NAME=n.IN_MEMORY_DATA_UNIT_NAME;class D{canSlice(){return!1}processSortingSide(t,e,n){var r;const a=[],o=[];if(null!=t.sort){if(0===n.length)return{localSorting:t.sort,serverSorting:[]};for(const n of t.sort){const t=e.getField(n.field);"true"===(null===(r=null==t?void 0:t.properties)||void 0===r?void 0:r.calculated)||(null==t?void 0:t.userInterface)===i.LONGTEXT?a.push(n):o.push(n)}}return{localSorting:a,serverSorting:o}}async load(t,e,n){var r,a;if(null==t.metadata)return Promise.resolve({records:[],loadingInfo:n});try{const i=null!==(a=null===(r=e.filters)||void 0===r?void 0:r.filter((t=>!t.name.startsWith("FILTRO_COLUNA_"))))&&void 0!==a?a:[],{localSorting:o,serverSorting:s}=this.processSortingSide(e,t,i),c=this.getFieldsList(t),u="DatasetSP.loadRecords",d=this.buildRequestBody(u,c,t,e,n,s,i),m=n.quiet?{urlParams:{quietMode:"true"}}:void 0,{result:h,pagerID:f,askRowsLimit:p}=await l.get().callServiceBroker(u,d,m),g=this.processRecords(t,c,h),_=null!=f,v=n.count+g.length,b=t.hasNewRecord(),y=o.length>0,D=!_&&y;return D&&b&&t.setWaitingToReload(!0),Promise.resolve({records:g,loadingInfo:Object.assign(Object.assign({},n),{pagerId:f,loadingInProgress:_,total:_?void 0:v,count:v,needReload:D&&!b,askRowsLimit:p,hasLocalSorting:y})})}catch(t){return console.error(t),Promise.reject(t)}}async loadRowMetadata(t,e,n,r={}){try{const a="DatasetSP.loadRowMetadata",i=await this.buildRequestBodyLoadRowMetadata({snkDataUnit:t,fieldName:e,metadataName:n,serviceName:a,updatedFields:r});return await l.get().callServiceBroker(a,i)}catch(t){return console.error(t),Promise.reject(t)}}async buildRequestBodyLoadRowMetadata({snkDataUnit:t,serviceName:e,fieldName:n,metadataName:r,updatedFields:a}){const i=t.dataUnit,o=O.parseDataUnitName(i.name).entityName,s=(await t.getSelectedRecordsIDsInfo()).reduce(((t,e)=>(t[e.name]=e.value,t)),{}),c=i.getSelectedRecord(),l=i.metadata.fields.filter((({standAlone:t,name:e})=>!t&&!e.includes("."))).map((({name:t})=>t)),u=l.reduce(((t,e,n)=>{const r=y(c,e),i=y(a,e);return t[n]=void 0!==i?i:r,t}),{});return JSON.stringify({serviceName:e,requestBody:{dataSetID:i.dataUnitId,entityName:o,standAlone:!1,metadataName:r,fieldName:n,fields:l,record:{pk:s,oldPk:s,values:u}}})}getFieldsList(t){let e=["__record__id__","__record__label__"];return t.metadata.fields.forEach((t=>{t.standAlone||(e=e.concat(this.getFieldNames(t)))})),e}getStandAloneFieldsList(t){let e={};return t.metadata.fields.forEach((t=>{t.standAlone&&(e=Object.assign(Object.assign({},e),{[t.name]:{fieldType:t.dataType,userType:t.userInterface}}))})),e}getFieldNames(t){const e=this.getSearchDescriptionField(t);return null==e?t.name:[t.name,e]}buildRequestBody(t,e,n,r,a,i,o){const s=n.dataUnitId,c=O.parseDataUnitName(n.name).entityName,l=!(!r.limit&&!r.offset),u={serviceName:t,requestBody:{dataSetID:s,fields:e,entityName:c,pageNumber:a.pageNumber,totalRecordsCount:a.count,pagerID:a.pagerId,standAlone:!1,standAloneFieldsMD:Object.assign({__record__id__:{fieldType:"S",userType:"P"},__record__label__:{fieldType:"S",userType:"P"}},this.getStandAloneFieldsList(n)),tryJoinedFields:!0,parallelLoader:l,crudListener:`br.com.sankhya.bff.${this.getModuleName()}.BFFDataUnitDatasetAdapter`,txProperties:this.getTxProperties(n,r,i,o),useDefaultRowsLimit:!1}};return JSON.stringify(u)}getModuleName(){return r.getContextValue("__SNK__APPLICATION__").getModuleName().replace("-bff","")}getTxProperties(t,e,n,r){const a={"__DATA_UNIT_ADAPTER__[dataUnitName]":t.name};0!==r.length&&(a["__DATA_UNIT_ADAPTER__[criteria]"]=JSON.stringify(r)),null!=n&&0!==n.length&&(a["__DATA_UNIT_ADAPTER__[sorting]"]=JSON.stringify(n)),null!=e.parentRecordId&&(a["__DATA_UNIT_ADAPTER__[parentRecordId]"]=e.parentRecordId);const i=t.getGlobalLoaderProps();return null==i||0===i.size||Array.from(i.entries()).forEach((([t,e])=>{a[t]=e})),a}processRecords(t,e,n){return n.map((n=>{const r={__record__id__:n[0],__record__label__:n[1],__record__metadata__:n[n.length-1]._rmd};return t.metadata.fields.forEach((t=>{r[t.name]=this.buildFieldValue(t,e,n)})),r}))}buildFieldValue(t,e,n){const r=e.indexOf(t.name);if(r<0)return null;const o=n[r];if(a.isEmpty(o))return null;const s=this.getSearchDescriptionField(t);if(null!=s){const t=e.indexOf(s);if(t>=0)return{value:o,label:n[t]}}return t.userInterface===i.SEARCH?isNaN(Number(o))?o:Number(o):b.getConvertedValue(t,o)}getSearchDescriptionField(t){if(![i.SEARCH,i.SEARCHPLUS].includes(t.userInterface))return;if(!t.properties)return;const{ENTITYNAME:e,mergedFrom:n,DESCRIPTIONFIELD:r}=t.properties;return a.isEmpty(r)?void 0:null!=n?`${n}.${e}.${r}`:`${e}.${r}`}}var P;!function(t){t.CANCEL="CANCEL",t.CONTINUE="CONTINUE",t.LOAD_ALL="LOAD_ALL"}(P||(P={}));class R{constructor(){}static async debounce(t,e){const n=t.name;R._debouncingTimeouts[n]&&(clearTimeout(R._debouncingTimeouts[n]),delete R._debouncingTimeouts[n]),R._debouncingTimeouts[n]=setTimeout((()=>{delete R._debouncingTimeouts[n],e()}),100)}static async loadData(t,e){return new Promise(((n,r)=>{R.debounce(t,(()=>{v.loadData(t,e,this.loadFromServer).then((t=>n(t))).catch((t=>r(t)))}))}))}static getCachedRecords(t){return v.getCachedRecords(t)}static async loadFromServer(t,e,n){try{n=R.registryLoading(t,n);const r=await R.callLoader(t,e,n);if(null==r)return;const a=r.records,i=R.buildPaginationInfo(a.length,e,r.loadingInfo),o=null==i?a:a.slice(0,i.lastRecord);return Promise.resolve({records:o,paginationInfo:i})}catch(t){return console.error(t),Promise.reject(t)}}static async callLoader(t,e,n,r){null==r&&(r=new D);const a=await r.load(t,e,n),i=a.loadingInfo;if(R.isOldRequest(t,i))return Promise.resolve(void 0);if(this.handleCache(r,i,t,a.records),t.cancelPagination)return this.handlePaginationCanceled(t,a);if(this.canFinishPagination(t,i))return Promise.resolve(a);const o=Object.assign(Object.assign({},e),{offset:i.count});let s=this.buildNewLoadingInfo(i);if(this.canProceedPagination(i))return this.recallLoader(t,o,s,r,a);const c=await async function(){return new Promise((t=>{const e=new u,{checkboxContainer:n,checkbox:r}=function(t){const e=document.createElement("div");e.style.marginBottom="14px",e.style.display="flex",e.style.alignItems="center";const{checkbox:n,checkboxLabel:r}=function(t){const e=document.createElement("input");e.type="checkbox",e.id="loadAll";const n=document.createElement("label");return n.htmlFor="loadAll",n.textContent=null==t?void 0:t.getMessage("dataUnitDataLoaderHelper.checkbox.loadAll"),n.style.marginLeft="5px",{checkbox:e,checkboxLabel:n}}(t);return e.appendChild(n),e.appendChild(r),{checkboxContainer:e,checkbox:n}}(e),a=function(t,e,n){const r=document.createElement("ez-popup");return r.opened=!0,r.size="x-small",r.ezTitle=null==n?void 0:n.getMessage("dataUnitDataLoaderHelper.pagination.title"),r.heightMode="auto",r.addEventListener("ezClosePopup",(()=>{document.body.removeChild(r),t(e.checked?P.LOAD_ALL:P.CONTINUE)}),{once:!0}),r.addEventListener("ezPopupAction",(()=>{document.body.removeChild(r),t(P.CANCEL)}),{once:!0}),r}(t,r,e),i=function(){const t=document.createElement("div");return t.style.display="flex",t.style.flexDirection="column",t.style.fontFamily="var(--font-pattern, Roboto)",t.style.fontSize="var(--text--medium)",t}(),o=function(){const t=document.createElement("div");return t.style.display="flex",t.style.flexDirection="row",t.style.justifyContent="end",t.style.gap="5px",t}();i.appendChild(n),i.appendChild(function(t){const e=document.createElement("div"),n=document.createElement("p"),r=document.createElement("p"),a=document.createElement("p");return a.style.fontWeight="var(--text-weight--large, 600)",n.textContent=null==t?void 0:t.getMessage("dataUnitDataLoaderHelper.pagination.line1"),r.textContent=null==t?void 0:t.getMessage("dataUnitDataLoaderHelper.pagination.line2"),a.textContent=null==t?void 0:t.getMessage("dataUnitDataLoaderHelper.pagination.line3"),e.appendChild(n),e.appendChild(r),e.appendChild(a),e}(e)),o.appendChild(function(t,e,n,r){const a=document.createElement("ez-button");return a.label=null==r?void 0:r.getMessage("dataUnitDataLoaderHelper.buttons.continue"),a.size="medium",a.onclick=()=>{document.body.removeChild(t),n(e.checked?P.LOAD_ALL:P.CONTINUE)},a}(a,r,t,e)),o.appendChild(function(t,e,n){const r=document.createElement("ez-button");return r.label=null==n?void 0:n.getMessage("dataUnitDataLoaderHelper.buttons.cancel"),r.size="medium",r.classList.add("ez-button--primary"),r.onclick=()=>{document.body.removeChild(t),e(P.CANCEL)},r}(a,t,e)),i.appendChild(o),a.appendChild(i),document.body.appendChild(a)}))}();return c===P.CANCEL?this.handlePaginationCanceled(t,a):(c===P.LOAD_ALL&&(s=Object.assign(Object.assign({},s),{loadAllRecords:!0})),s=Object.assign(Object.assign({},s),{lastRowLimitAsked:s.count}),this.recallLoader(t,o,s,r,a))}static buildNewLoadingInfo(t){return Object.assign(Object.assign({},t),{pageNumber:(t.pageNumber||0)+1,quiet:!0})}static handleCache(t,e,n,r){const a=!t.canSlice()||0===e.count;v.cacheRecords(n,r,a,e.loadingInProgress)}static recallLoader(t,e,n,r,a){return this.callLoader(t,e,n,r).then((e=>R.afterLoadingPage(t,e.loadingInfo))).catch((t=>console.error(t))),Promise.resolve(a)}static canFinishPagination(t,e){return!v.isCacheEnabled(t)||!e.loadingInProgress}static canProceedPagination(t){const{count:e,askRowsLimit:n,loadAllRecords:r,lastRowLimitAsked:a}=t;if(r)return!0;if(!e||!n)return!0;const i=Number(n);return e<i||e<i+(a||0)}static handlePaginationCanceled(t,e){t.cancelPagination=!1;let n=e.loadingInfo;return n=Object.assign(Object.assign({},n),{total:n.count,loadingInProgress:!1,pagerId:void 0,needReload:n.hasLocalSorting}),Promise.resolve({records:e.records,loadingInfo:n})}static afterLoadingPage(t,e){v.setLoadingStatus(t,e.loadingInProgress);const n=t.getPaginationInfo();if(null==n)return;const r=e.count;e.loadingInProgress?t.updatePagination(Object.assign(Object.assign({},n),{count:r,loadingInProgress:!0})):e.needReload?t.gotoPage(0):t.updatePagination(Object.assign(Object.assign({},n),{total:r,count:r,loadingInProgress:!1}))}static registryLoading(t,e){return null==e&&(e={requestTime:(new Date).getTime(),count:0}),R._requestTimeByDataUnit.set(t.name,e.requestTime),e}static isOldRequest(t,e){return R._requestTimeByDataUnit.get(t.name)>e.requestTime}static buildPaginationInfo(t,e,n){let{limit:r,offset:a}=e;if(!r)return;1===n.pageNumber&&(a=0);const{total:i,count:o,loadingInProgress:s,askRowsLimit:c}=n,l=0===o||0===t?0:a+1,u=a+Math.min(t,r);return{total:i,count:o,lastRecord:u,firstRecord:l,currentPage:a/r,hasMore:u<o||s,askRowsLimit:c}}}R._requestTimeByDataUnit=new Map,R._debouncingTimeouts={};const N=/dd:\/\/([^/]+)\/([^/?]+)/;class O{constructor(){this.templateByQuery=new Map,this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchDataUnit",d.gql`query($name: String!) {
2
2
  $queryAlias$: fetchDataUnit(name: $name){
3
3
  name
4
4
  fields{
Binary file
Binary file
Binary file
@@ -0,0 +1 @@
1
+ import{ObjectUtils as t}from"@sankhyalabs/core";import{R as e}from"./p-e6fe58b7.js";class a extends e{getData(e){const a=`cfg://auth/${e}`;return new Promise(((e,s)=>{this.loadResource(a).then((a=>{let s=t.stringToObject(a);s&&"object"==typeof s&&e(s)})).catch((t=>{s(t)}))}))}}var s;!function(t){t.INSERT="I",t.UPDATE="A",t.REMOVE="E",t.SHOW="C",t.CONFIG="F",t.CONFIG_NUMBER="N",t.CLONE="D",t.CONFIG_GRID="G"}(s||(s={}));export{s as A,a}