@sankhyalabs/sankhyablocks 10.1.0-rc.1 → 10.1.0-rc.10

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 (983) hide show
  1. package/dist/cjs/AuthorizationConfig-79ffae4b.js.gz +0 -0
  2. package/dist/cjs/{ConfigStorage-5a73e979.js → ConfigStorage-b96ff235.js} +2 -2
  3. package/dist/cjs/ConfigStorage-b96ff235.js.gz +0 -0
  4. package/dist/cjs/{DataFetcher-eeb3b0b7.js → DataFetcher-c24cdc3d.js} +32 -22
  5. package/dist/cjs/DataFetcher-c24cdc3d.js.gz +0 -0
  6. package/dist/cjs/{FormConfigHelper-ebb77625.js → FormConfigHelper-1e8bb464.js} +24 -0
  7. package/dist/cjs/FormConfigHelper-1e8bb464.js.gz +0 -0
  8. package/dist/cjs/GetSelectedRecordsIDsInfo-bd50caf1.js.gz +0 -0
  9. package/dist/cjs/IFetchDataExporterParams-e78ec415.js.gz +0 -0
  10. package/dist/cjs/{ISave-861e9d6d.js → ISave-f1aecaa6.js} +1 -1
  11. package/dist/cjs/ISave-f1aecaa6.js.gz +0 -0
  12. package/dist/cjs/ParamType-90b440a0.js.gz +0 -0
  13. package/dist/cjs/PersonalizedFilterUtils-7259cf65.js.gz +0 -0
  14. package/dist/cjs/PrintUtils-bcaeb82f.js.gz +0 -0
  15. package/dist/cjs/ResourceIDUtils-5ff86aa7.js.gz +0 -0
  16. package/dist/cjs/ServicesNumberingConfig-69038a0f.js.gz +0 -0
  17. package/dist/cjs/{SnkFormConfigManager-8d4fded8.js → SnkFormConfigManager-b4f72038.js} +7 -7
  18. package/dist/cjs/SnkFormConfigManager-b4f72038.js.gz +0 -0
  19. package/dist/cjs/{SnkMultiSelectionListDataSource-3b93f6a6.js → SnkMultiSelectionListDataSource-b7529c7e.js} +4 -4
  20. package/dist/cjs/SnkMultiSelectionListDataSource-b7529c7e.js.gz +0 -0
  21. package/dist/cjs/{auth-fetcher-8d8acd69.js → auth-fetcher-33a7361c.js} +1 -1
  22. package/dist/cjs/auth-fetcher-33a7361c.js.gz +0 -0
  23. package/dist/cjs/config-header.cjs.entry.js.gz +0 -0
  24. package/dist/cjs/configs-button.cjs.entry.js.gz +0 -0
  25. package/dist/cjs/constants-6d82e405.js.gz +0 -0
  26. package/dist/cjs/{dataunit-fetcher-1cea0695.js → dataunit-fetcher-75ba0c0a.js} +1 -1
  27. package/dist/cjs/dataunit-fetcher-75ba0c0a.js.gz +0 -0
  28. package/dist/cjs/default-filters-a09bf82b.js.gz +0 -0
  29. package/dist/cjs/field-config_2.cjs.entry.js +2 -2
  30. package/dist/cjs/field-config_2.cjs.entry.js.gz +0 -0
  31. package/dist/cjs/fields-layout.cjs.entry.js +6 -3
  32. package/dist/cjs/fields-layout.cjs.entry.js.gz +0 -0
  33. package/dist/cjs/fields-selector.cjs.entry.js +1 -1
  34. package/dist/cjs/fields-selector.cjs.entry.js.gz +0 -0
  35. package/dist/cjs/filter-item-type.enum-a7ffdaa6.js.gz +0 -0
  36. package/dist/cjs/filter-type.enum-2bb46d2a.js.gz +0 -0
  37. package/dist/cjs/filter-validate-cb4ed41a.js.gz +0 -0
  38. package/dist/cjs/filterNumberVariation-d65332da.js.gz +0 -0
  39. package/dist/cjs/{form-config-fetcher-f347f884.js → form-config-fetcher-6b2f0c28.js} +1 -1
  40. package/dist/cjs/form-config-fetcher-6b2f0c28.js.gz +0 -0
  41. package/dist/cjs/guides-configurator.cjs.entry.js +5 -3
  42. package/dist/cjs/guides-configurator.cjs.entry.js.gz +0 -0
  43. package/dist/cjs/index-13d05f03.js.gz +0 -0
  44. package/dist/cjs/index-1cf293c1.js.gz +0 -0
  45. package/dist/cjs/index-62760a9c.js.gz +0 -0
  46. package/dist/cjs/index-8d94b7e0.js.gz +0 -0
  47. package/dist/cjs/index-e3e39724.js.gz +0 -0
  48. package/dist/cjs/index.cjs.js.gz +0 -0
  49. package/dist/cjs/loader.cjs.js.gz +0 -0
  50. package/dist/cjs/pesquisa-grid_2.cjs.entry.js +4 -4
  51. package/dist/cjs/pesquisa-grid_2.cjs.entry.js.gz +0 -0
  52. package/dist/cjs/presentationMode-52ec3bdd.js.gz +0 -0
  53. package/dist/cjs/sankhyablocks.cjs.js.gz +0 -0
  54. package/dist/cjs/snk-actions-button_9.cjs.entry.js +5 -5
  55. package/dist/cjs/snk-actions-button_9.cjs.entry.js.gz +0 -0
  56. package/dist/cjs/snk-actions-form.cjs.entry.js.gz +0 -0
  57. package/dist/cjs/snk-application.cjs.entry.js +24 -7
  58. package/dist/cjs/snk-application.cjs.entry.js.gz +0 -0
  59. package/dist/cjs/snk-attach.cjs.entry.js +5 -5
  60. package/dist/cjs/snk-attach.cjs.entry.js.gz +0 -0
  61. package/dist/cjs/snk-client-confirm.cjs.entry.js.gz +0 -0
  62. package/dist/cjs/snk-configurator.cjs.entry.js.gz +0 -0
  63. package/dist/cjs/snk-crud.cjs.entry.js +5 -5
  64. package/dist/cjs/snk-crud.cjs.entry.js.gz +0 -0
  65. package/dist/cjs/snk-custom-slot-elements.cjs.entry.js.gz +0 -0
  66. package/dist/cjs/snk-data-exporter.cjs.entry.js +5 -5
  67. package/dist/cjs/snk-data-exporter.cjs.entry.js.gz +0 -0
  68. package/dist/cjs/{snk-data-unit-de248308.js → snk-data-unit-9369de25.js} +9 -2
  69. package/dist/cjs/snk-data-unit-9369de25.js.gz +0 -0
  70. package/dist/cjs/snk-data-unit.cjs.entry.js +3 -3
  71. package/dist/cjs/snk-data-unit.cjs.entry.js.gz +0 -0
  72. package/dist/cjs/snk-default-filter.cjs.entry.js.gz +0 -0
  73. package/dist/cjs/snk-detail-view.cjs.entry.js +7 -7
  74. package/dist/cjs/snk-detail-view.cjs.entry.js.gz +0 -0
  75. package/dist/cjs/snk-entity-list.cjs.entry.js.gz +0 -0
  76. package/dist/cjs/snk-exporter-email-sender.cjs.entry.js.gz +0 -0
  77. package/dist/cjs/snk-expression-group_2.cjs.entry.js.gz +0 -0
  78. package/dist/cjs/snk-filter-advanced-mode_2.cjs.entry.js.gz +0 -0
  79. package/dist/cjs/snk-filter-bar_4.cjs.entry.js +34 -11
  80. package/dist/cjs/snk-filter-bar_4.cjs.entry.js.gz +0 -0
  81. package/dist/cjs/snk-filter-binary-select.cjs.entry.js.gz +0 -0
  82. package/dist/cjs/snk-filter-checkbox-list.cjs.entry.js.gz +0 -0
  83. package/dist/cjs/snk-filter-detail.cjs.entry.js.gz +0 -0
  84. package/dist/cjs/snk-filter-field-search_2.cjs.entry.js.gz +0 -0
  85. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
  86. package/dist/cjs/snk-filter-modal-item.cjs.entry.js.gz +0 -0
  87. package/dist/cjs/snk-filter-multi-select.cjs.entry.js.gz +0 -0
  88. package/dist/cjs/snk-filter-number.cjs.entry.js +1 -1
  89. package/dist/cjs/snk-filter-number.cjs.entry.js.gz +0 -0
  90. package/dist/cjs/snk-filter-period.cjs.entry.js +10 -5
  91. package/dist/cjs/snk-filter-period.cjs.entry.js.gz +0 -0
  92. package/dist/cjs/snk-filter-search.cjs.entry.js.gz +0 -0
  93. package/dist/cjs/snk-filter-text.cjs.entry.js +1 -1
  94. package/dist/cjs/snk-filter-text.cjs.entry.js.gz +0 -0
  95. package/dist/cjs/snk-form-summary.cjs.entry.js.gz +0 -0
  96. package/dist/cjs/snk-form-view.cjs.entry.js.gz +0 -0
  97. package/dist/cjs/snk-form_2.cjs.entry.js +28 -7
  98. package/dist/cjs/snk-form_2.cjs.entry.js.gz +0 -0
  99. package/dist/cjs/snk-grid.cjs.entry.js +7 -7
  100. package/dist/cjs/snk-grid.cjs.entry.js.gz +0 -0
  101. package/dist/cjs/{snk-guides-viewer-4ec3e7e1.js → snk-guides-viewer-0d694e37.js} +5 -5
  102. package/dist/cjs/snk-guides-viewer-0d694e37.js.gz +0 -0
  103. package/dist/cjs/snk-guides-viewer.cjs.entry.js +7 -7
  104. package/dist/cjs/snk-guides-viewer.cjs.entry.js.gz +0 -0
  105. package/dist/cjs/snk-personalized-filter-editor.cjs.entry.js.gz +0 -0
  106. package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
  107. package/dist/cjs/snk-personalized-filter.cjs.entry.js.gz +0 -0
  108. package/dist/cjs/snk-pesquisa.cjs.entry.js +4 -4
  109. package/dist/cjs/snk-pesquisa.cjs.entry.js.gz +0 -0
  110. package/dist/cjs/snk-print-selector.cjs.entry.js.gz +0 -0
  111. package/dist/cjs/snk-simple-bar.cjs.entry.js.gz +0 -0
  112. package/dist/cjs/snk-simple-crud.cjs.entry.js +9 -17
  113. package/dist/cjs/snk-simple-crud.cjs.entry.js.gz +0 -0
  114. package/dist/cjs/snk-taskbar.cjs.entry.js +56 -44
  115. package/dist/cjs/snk-taskbar.cjs.entry.js.gz +0 -0
  116. package/dist/cjs/sortable.esm-9a110bb7.js.gz +0 -0
  117. package/dist/cjs/taskbar-elements-fb5d1e08.js.gz +0 -0
  118. package/dist/cjs/taskbar-processor-2fba34a8.js.gz +0 -0
  119. package/dist/cjs/teste-pesquisa.cjs.entry.js.gz +0 -0
  120. package/dist/collection/components/snk-actions-button/actions/enum/ActionsType.js.gz +0 -0
  121. package/dist/collection/components/snk-actions-button/actions/enum/ParamType.js.gz +0 -0
  122. package/dist/collection/components/snk-actions-button/actions/enum/RefreshType.js.gz +0 -0
  123. package/dist/collection/components/snk-actions-button/actions/executor/java.executor.js.gz +0 -0
  124. package/dist/collection/components/snk-actions-button/actions/executor/javascript.executor.js.gz +0 -0
  125. package/dist/collection/components/snk-actions-button/actions/executor/launch-screen.executor.js.gz +0 -0
  126. package/dist/collection/components/snk-actions-button/actions/executor/procedure.executor.js.gz +0 -0
  127. package/dist/collection/components/snk-actions-button/actions/factory/executor.factory.js.gz +0 -0
  128. package/dist/collection/components/snk-actions-button/actions/index.js.gz +0 -0
  129. package/dist/collection/components/snk-actions-button/actions/interfaces/IAction.js.gz +0 -0
  130. package/dist/collection/components/snk-actions-button/actions/interfaces/IExecSource.js.gz +0 -0
  131. package/dist/collection/components/snk-actions-button/actions/interfaces/IExecuteActions.js.gz +0 -0
  132. package/dist/collection/components/snk-actions-button/actions/interfaces/IExecuteActionsProps.js.gz +0 -0
  133. package/dist/collection/components/snk-actions-button/actions/interfaces/IResultParam.js.gz +0 -0
  134. package/dist/collection/components/snk-actions-button/clientEvent/index.js.gz +0 -0
  135. package/dist/collection/components/snk-actions-button/clientEvent/interfaces/IClientEventConfirm.js.gz +0 -0
  136. package/dist/collection/components/snk-actions-button/interfaces/index.js.gz +0 -0
  137. package/dist/collection/components/snk-actions-button/snk-actions-button.css.gz +0 -0
  138. package/dist/collection/components/snk-actions-button/snk-actions-button.js.gz +0 -0
  139. package/dist/collection/components/snk-actions-button/subcomponents/snk-actions-form.js.gz +0 -0
  140. package/dist/collection/components/snk-actions-button/subcomponents/snk-client-confirm.js.gz +0 -0
  141. package/dist/collection/components/snk-application/__mocks__/snk-application.js.gz +0 -0
  142. package/dist/collection/components/snk-application/errorhandler/snk-error-handler.js.gz +0 -0
  143. package/dist/collection/components/snk-application/request-listener/DebouncedRequestListener.js.gz +0 -0
  144. package/dist/collection/components/snk-application/request-listener/RequestListenerFactory.js.gz +0 -0
  145. package/dist/collection/components/snk-application/request-listener/RequestListenerLoadingBar.js.gz +0 -0
  146. package/dist/collection/components/snk-application/search-strategy/exec-prepared-search-plus.js.gz +0 -0
  147. package/dist/collection/components/snk-application/snk-application.css.gz +0 -0
  148. package/dist/collection/components/snk-application/snk-application.js +18 -1
  149. package/dist/collection/components/snk-application/snk-application.js.gz +0 -0
  150. package/dist/collection/components/snk-attach/interfaces/ICrudConfig.js.gz +0 -0
  151. package/dist/collection/components/snk-attach/interfaces/TFetcherType.js.gz +0 -0
  152. package/dist/collection/components/snk-attach/interfaces/index.js.gz +0 -0
  153. package/dist/collection/components/snk-attach/snk-attach.css.gz +0 -0
  154. package/dist/collection/components/snk-attach/snk-attach.js.gz +0 -0
  155. package/dist/collection/components/snk-attach/structure/builder/anexo-sistema-crud-config.builder.js.gz +0 -0
  156. package/dist/collection/components/snk-attach/structure/builder/attach-crud-config.builder.js.gz +0 -0
  157. package/dist/collection/components/snk-attach/structure/builder/taskbar-builder.js.gz +0 -0
  158. package/dist/collection/components/snk-attach/structure/fetcher/facade/fetcher.facade.js.gz +0 -0
  159. package/dist/collection/components/snk-attach/structure/fetcher/factory/anexo-sistema-data-unit.factory.js.gz +0 -0
  160. package/dist/collection/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.js.gz +0 -0
  161. package/dist/collection/components/snk-attach/structure/index.js.gz +0 -0
  162. package/dist/collection/components/snk-configurator/AuthorizationConfig.js.gz +0 -0
  163. package/dist/collection/components/snk-configurator/snk-configurator.css.gz +0 -0
  164. package/dist/collection/components/snk-configurator/snk-configurator.js.gz +0 -0
  165. package/dist/collection/components/snk-crud/interfaces/PropsCustomEditor.js.gz +0 -0
  166. package/dist/collection/components/snk-crud/interfaces/PropsCustomRender.js.gz +0 -0
  167. package/dist/collection/components/snk-crud/snk-crud.css.gz +0 -0
  168. package/dist/collection/components/snk-crud/snk-crud.js.gz +0 -0
  169. package/dist/collection/components/snk-crud/subcomponents/CardFormResizeObserver.js.gz +0 -0
  170. package/dist/collection/components/snk-crud/subcomponents/GuideBuilder.js.gz +0 -0
  171. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.css.gz +0 -0
  172. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js.gz +0 -0
  173. package/dist/collection/components/snk-crud/subcomponents/snk-form-summary.css.gz +0 -0
  174. package/dist/collection/components/snk-crud/subcomponents/snk-form-summary.js.gz +0 -0
  175. package/dist/collection/components/snk-crud/subcomponents/snk-form-view.css.gz +0 -0
  176. package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js.gz +0 -0
  177. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.css.gz +0 -0
  178. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js.gz +0 -0
  179. package/dist/collection/components/snk-custom-slot-elements/snk-custom-slot-elements.css.gz +0 -0
  180. package/dist/collection/components/snk-custom-slot-elements/snk-custom-slot-elements.js.gz +0 -0
  181. package/dist/collection/components/snk-data-exporter/data/attachment.js.gz +0 -0
  182. package/dist/collection/components/snk-data-exporter/data/email.js.gz +0 -0
  183. package/dist/collection/components/snk-data-exporter/data/export-config.js.gz +0 -0
  184. package/dist/collection/components/snk-data-exporter/data/export-result.js.gz +0 -0
  185. package/dist/collection/components/snk-data-exporter/data/report.js.gz +0 -0
  186. package/dist/collection/components/snk-data-exporter/exporter-email-sender/email-info-step.js.gz +0 -0
  187. package/dist/collection/components/snk-data-exporter/exporter-email-sender/options-step.js.gz +0 -0
  188. package/dist/collection/components/snk-data-exporter/exporter-email-sender/snk-exporter-email-sender.js.gz +0 -0
  189. package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js.gz +0 -0
  190. package/dist/collection/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.js.gz +0 -0
  191. package/dist/collection/components/snk-data-exporter/interfaces/IExporterProvider.js.gz +0 -0
  192. package/dist/collection/components/snk-data-exporter/interfaces/IExporterStrategy.js.gz +0 -0
  193. package/dist/collection/components/snk-data-exporter/interfaces/IRecordID.js.gz +0 -0
  194. package/dist/collection/components/snk-data-exporter/interfaces/ISelectedID.js.gz +0 -0
  195. package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js.gz +0 -0
  196. package/dist/collection/components/snk-data-exporter/providers/ServerSideExporterProvider.js.gz +0 -0
  197. package/dist/collection/components/snk-data-exporter/snk-data-exporter.css.gz +0 -0
  198. package/dist/collection/components/snk-data-exporter/snk-data-exporter.js.gz +0 -0
  199. package/dist/collection/components/snk-data-exporter/structure/ItemBuilder.js.gz +0 -0
  200. package/dist/collection/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.js.gz +0 -0
  201. package/dist/collection/components/snk-data-exporter/utils/ParserExport.js.gz +0 -0
  202. package/dist/collection/components/snk-data-unit/MultipleUpdateHelper.js.gz +0 -0
  203. package/dist/collection/components/snk-data-unit/snk-data-unit.js +7 -0
  204. package/dist/collection/components/snk-data-unit/snk-data-unit.js.gz +0 -0
  205. package/dist/collection/components/snk-data-unit/test/resources/metadataMock.js.gz +0 -0
  206. package/dist/collection/components/snk-data-unit/test/resources/parentMetadataMock.js.gz +0 -0
  207. package/dist/collection/components/snk-entity-list/snk-entity-list.css.gz +0 -0
  208. package/dist/collection/components/snk-entity-list/snk-entity-list.js.gz +0 -0
  209. package/dist/collection/components/snk-filter-bar/filter-item/dataunitfilter/data-unit-filter-builder.js.gz +0 -0
  210. package/dist/collection/components/snk-filter-bar/filter-item/editors/enum/filterNumberVariation.js.gz +0 -0
  211. package/dist/collection/components/snk-filter-bar/filter-item/editors/enum/presentationMode.js.gz +0 -0
  212. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.js.gz +0 -0
  213. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-checkbox-list.js.gz +0 -0
  214. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.js.gz +0 -0
  215. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js +1 -1
  216. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js.gz +0 -0
  217. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js +11 -6
  218. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js.gz +0 -0
  219. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-search.js.gz +0 -0
  220. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js +1 -1
  221. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js.gz +0 -0
  222. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-personalized-filter-editor/snk-personalized-filter-editor.css.gz +0 -0
  223. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-personalized-filter-editor/snk-personalized-filter-editor.js.gz +0 -0
  224. package/dist/collection/components/snk-filter-bar/filter-item/filter-item-type-mask.enum.js.gz +0 -0
  225. package/dist/collection/components/snk-filter-bar/filter-item/filter-item-type.enum.js.gz +0 -0
  226. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js.gz +0 -0
  227. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.css +4 -0
  228. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.css.gz +0 -0
  229. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +4 -0
  230. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js.gz +0 -0
  231. package/dist/collection/components/snk-filter-bar/filter-list/snk-filter-list.js.gz +0 -0
  232. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.css.gz +0 -0
  233. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +15 -4
  234. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js.gz +0 -0
  235. package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-default-filter/snk-default-filter.css.gz +0 -0
  236. package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-default-filter/snk-default-filter.js.gz +0 -0
  237. package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.css.gz +0 -0
  238. package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js.gz +0 -0
  239. package/dist/collection/components/snk-filter-bar/snk-filter-bar.css.gz +0 -0
  240. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +12 -3
  241. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js.gz +0 -0
  242. package/dist/collection/components/snk-filter-bar/types/custom-element-filter.js.gz +0 -0
  243. package/dist/collection/components/snk-filter-bar/types/default-filters.js.gz +0 -0
  244. package/dist/collection/components/snk-filter-bar/types/filter-type.enum.js.gz +0 -0
  245. package/dist/collection/components/snk-filter-bar/utils/SnkFilterModalFactory.js.gz +0 -0
  246. package/dist/collection/components/snk-filter-bar/utils/filter-validate.js.gz +0 -0
  247. package/dist/collection/components/snk-filter-bar/utils/filters-mock.js.gz +0 -0
  248. package/dist/collection/components/snk-filter-field-search/interfaces/index.js.gz +0 -0
  249. package/dist/collection/components/snk-filter-field-search/snk-filter-field-search.css.gz +0 -0
  250. package/dist/collection/components/snk-filter-field-search/snk-filter-field-search.js.gz +0 -0
  251. package/dist/collection/components/snk-filter-field-search/subcomponents/index.js.gz +0 -0
  252. package/dist/collection/components/snk-filter-field-search/subcomponents/list-item.js.gz +0 -0
  253. package/dist/collection/components/snk-form/snk-form.css.gz +0 -0
  254. package/dist/collection/components/snk-form/snk-form.js.gz +0 -0
  255. package/dist/collection/components/snk-form-config/FormConfigHelper.js +23 -0
  256. package/dist/collection/components/snk-form-config/FormConfigHelper.js.gz +0 -0
  257. package/dist/collection/components/snk-form-config/SnkFormConfigManager.js +6 -6
  258. package/dist/collection/components/snk-form-config/SnkFormConfigManager.js.gz +0 -0
  259. package/dist/collection/components/snk-form-config/config-header/config-header.css.gz +0 -0
  260. package/dist/collection/components/snk-form-config/config-header/config-header.js.gz +0 -0
  261. package/dist/collection/components/snk-form-config/config-header/configs-button/configs-button.css.gz +0 -0
  262. package/dist/collection/components/snk-form-config/config-header/configs-button/configs-button.js.gz +0 -0
  263. package/dist/collection/components/snk-form-config/field-item/field-config/field-config.css +1 -0
  264. package/dist/collection/components/snk-form-config/field-item/field-config/field-config.css.gz +0 -0
  265. package/dist/collection/components/snk-form-config/field-item/field-config/field-config.js.gz +0 -0
  266. package/dist/collection/components/snk-form-config/field-item/field-item.css.gz +0 -0
  267. package/dist/collection/components/snk-form-config/field-item/field-item.js.gz +0 -0
  268. package/dist/collection/components/snk-form-config/fields-layout/fields-layout.css +16 -0
  269. package/dist/collection/components/snk-form-config/fields-layout/fields-layout.css.gz +0 -0
  270. package/dist/collection/components/snk-form-config/fields-layout/fields-layout.js +6 -3
  271. package/dist/collection/components/snk-form-config/fields-layout/fields-layout.js.gz +0 -0
  272. package/dist/collection/components/snk-form-config/fields-selector/fields-selector.css.gz +0 -0
  273. package/dist/collection/components/snk-form-config/fields-selector/fields-selector.js.gz +0 -0
  274. package/dist/collection/components/snk-form-config/guides-configurator/guides-configurator.css +3 -3
  275. package/dist/collection/components/snk-form-config/guides-configurator/guides-configurator.css.gz +0 -0
  276. package/dist/collection/components/snk-form-config/guides-configurator/guides-configurator.js +5 -3
  277. package/dist/collection/components/snk-form-config/guides-configurator/guides-configurator.js.gz +0 -0
  278. package/dist/collection/components/snk-form-config/snk-form-config.css.gz +0 -0
  279. package/dist/collection/components/snk-form-config/snk-form-config.js +25 -4
  280. package/dist/collection/components/snk-form-config/snk-form-config.js.gz +0 -0
  281. package/dist/collection/components/snk-grid/filtercolumn/SnkMultiSelectionListDataSource.js.gz +0 -0
  282. package/dist/collection/components/snk-grid/snk-grid.css.gz +0 -0
  283. package/dist/collection/components/snk-grid/snk-grid.js +1 -1
  284. package/dist/collection/components/snk-grid/snk-grid.js.gz +0 -0
  285. package/dist/collection/components/snk-grid-config/snk-grid-config.css.gz +0 -0
  286. package/dist/collection/components/snk-grid-config/snk-grid-config.js.gz +0 -0
  287. package/dist/collection/components/snk-grid-config/snk-select-box/snk-select-box.css.gz +0 -0
  288. package/dist/collection/components/snk-grid-config/snk-select-box/snk-select-box.js.gz +0 -0
  289. package/dist/collection/components/snk-layout-form-config/snk-layout-form-config.css.gz +0 -0
  290. package/dist/collection/components/snk-layout-form-config/snk-layout-form-config.js.gz +0 -0
  291. package/dist/collection/components/snk-layout-form-config/snk-view-representation/snk-view-representation.css.gz +0 -0
  292. package/dist/collection/components/snk-layout-form-config/snk-view-representation/snk-view-representation.js.gz +0 -0
  293. package/dist/collection/components/snk-numbering-config/services/ServicesNumberingConfig.js.gz +0 -0
  294. package/dist/collection/components/snk-numbering-config/snk-numbering-config.css.gz +0 -0
  295. package/dist/collection/components/snk-numbering-config/snk-numbering-config.js.gz +0 -0
  296. package/dist/collection/components/snk-personalized-filter/interfaces/IExpressionGroup.js.gz +0 -0
  297. package/dist/collection/components/snk-personalized-filter/interfaces/IExpressionItem.js.gz +0 -0
  298. package/dist/collection/components/snk-personalized-filter/interfaces/IParameter.js.gz +0 -0
  299. package/dist/collection/components/snk-personalized-filter/interfaces/IPersonalizedFilter.js.gz +0 -0
  300. package/dist/collection/components/snk-personalized-filter/interfaces/ISystemFilterConfig.js.gz +0 -0
  301. package/dist/collection/components/snk-personalized-filter/interfaces/IUserFilterConfig.js.gz +0 -0
  302. package/dist/collection/components/snk-personalized-filter/interfaces/index.js.gz +0 -0
  303. package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.css.gz +0 -0
  304. package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js.gz +0 -0
  305. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-group/snk-expression-group.css.gz +0 -0
  306. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-group/snk-expression-group.js.gz +0 -0
  307. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/filter-operands/filter-operands.js.gz +0 -0
  308. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.css.gz +0 -0
  309. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.js.gz +0 -0
  310. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-advanced-mode/snk-filter-advanced-mode.css.gz +0 -0
  311. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-advanced-mode/snk-filter-advanced-mode.js.gz +0 -0
  312. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-assistent-mode/snk-filter-assistent-mode.css.gz +0 -0
  313. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-assistent-mode/snk-filter-assistent-mode.js.gz +0 -0
  314. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/snk-filter-param-config.css.gz +0 -0
  315. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/snk-filter-param-config.js.gz +0 -0
  316. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/utils/PersonalizedFilterUtils.js.gz +0 -0
  317. package/dist/collection/components/snk-pesquisa/pesquisa-grid/pesquisa-grid.css.gz +0 -0
  318. package/dist/collection/components/snk-pesquisa/pesquisa-grid/pesquisa-grid.js.gz +0 -0
  319. package/dist/collection/components/snk-pesquisa/pesquisa-tree/pesquisa-tree.css.gz +0 -0
  320. package/dist/collection/components/snk-pesquisa/pesquisa-tree/pesquisa-tree.js.gz +0 -0
  321. package/dist/collection/components/snk-pesquisa/pesquisaHelper.js.gz +0 -0
  322. package/dist/collection/components/snk-pesquisa/snk-pesquisa.css.gz +0 -0
  323. package/dist/collection/components/snk-pesquisa/snk-pesquisa.js.gz +0 -0
  324. package/dist/collection/components/snk-print-selector/snk-print-selector.css.gz +0 -0
  325. package/dist/collection/components/snk-print-selector/snk-print-selector.js.gz +0 -0
  326. package/dist/collection/components/snk-simple-bar/snk-simple-bar.css.gz +0 -0
  327. package/dist/collection/components/snk-simple-bar/snk-simple-bar.js.gz +0 -0
  328. package/dist/collection/components/snk-simple-crud/snk-simple-crud.constants.js.gz +0 -0
  329. package/dist/collection/components/snk-simple-crud/snk-simple-crud.css.gz +0 -0
  330. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +2 -10
  331. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js.gz +0 -0
  332. package/dist/collection/components/snk-simple-form-config/snk-simple-form-config.css.gz +0 -0
  333. package/dist/collection/components/snk-simple-form-config/snk-simple-form-config.js.gz +0 -0
  334. package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.css.gz +0 -0
  335. package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.js.gz +0 -0
  336. package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js.gz +0 -0
  337. package/dist/collection/components/snk-taskbar/elements/taskbar-split-button/taskbar-split-button.css.gz +0 -0
  338. package/dist/collection/components/snk-taskbar/elements/taskbar-split-button/taskbar-split-button.js.gz +0 -0
  339. package/dist/collection/components/snk-taskbar/processor/taskbar-processor.js.gz +0 -0
  340. package/dist/collection/components/snk-taskbar/snk-taskbar.css.gz +0 -0
  341. package/dist/collection/components/snk-taskbar/snk-taskbar.js +58 -44
  342. package/dist/collection/components/snk-taskbar/snk-taskbar.js.gz +0 -0
  343. package/dist/collection/components/teste-pesquisa/teste-pesquisa.css.gz +0 -0
  344. package/dist/collection/components/teste-pesquisa/teste-pesquisa.js.gz +0 -0
  345. package/dist/collection/index.js.gz +0 -0
  346. package/dist/collection/lib/@types/index.js.gz +0 -0
  347. package/dist/collection/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.js.gz +0 -0
  348. package/dist/collection/lib/applet-caller/applet-caller.js.gz +0 -0
  349. package/dist/collection/lib/auth/mgeauthorization.module.js.gz +0 -0
  350. package/dist/collection/lib/configs/ConfigStorage.js.gz +0 -0
  351. package/dist/collection/lib/configs/LayoutFormConfig.js.gz +0 -0
  352. package/dist/collection/lib/dataUnit/InMemoryLoader.js.gz +0 -0
  353. package/dist/collection/lib/dataUnit/ValueFormatter.js.gz +0 -0
  354. package/dist/collection/lib/dataUnit/dataUnitInMemoryUtils.js.gz +0 -0
  355. package/dist/collection/lib/dataUnit/interfaces/InMemoryLoaderConfig.js.gz +0 -0
  356. package/dist/collection/lib/http/data-fetcher/DataFetcher.js.gz +0 -0
  357. package/dist/collection/lib/http/data-fetcher/custom-xhr-override.js.gz +0 -0
  358. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/anexo-sistema-fetcher.js.gz +0 -0
  359. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/attach-fetcher.js.gz +0 -0
  360. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/facade/attach-fetcher.facade.js.gz +0 -0
  361. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/index.js.gz +0 -0
  362. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/IDelete.js.gz +0 -0
  363. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/IDownloadKey.js.gz +0 -0
  364. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/ISave.js.gz +0 -0
  365. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/index.js.gz +0 -0
  366. package/dist/collection/lib/http/data-fetcher/fetchers/application-config-fetcher.js.gz +0 -0
  367. package/dist/collection/lib/http/data-fetcher/fetchers/auth-fetcher.js.gz +0 -0
  368. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.js.gz +0 -0
  369. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.js.gz +0 -0
  370. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.js.gz +0 -0
  371. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.js.gz +0 -0
  372. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/helpers/DataUnitDataLoaderHelper.js.gz +0 -0
  373. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IBuildRequestBodyLoadRowMetadata.js.gz +0 -0
  374. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadDataResult.js.gz +0 -0
  375. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadDataStrategy.js.gz +0 -0
  376. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadingInfo.js.gz +0 -0
  377. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRecordField.js.gz +0 -0
  378. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IResponseRecord.js.gz +0 -0
  379. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRowMetadata.js.gz +0 -0
  380. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DataUnitStrategy.js.gz +0 -0
  381. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js.gz +0 -0
  382. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/test/resources/metadataMock.js.gz +0 -0
  383. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IExporterColumnMetadata.js.gz +0 -0
  384. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams.js.gz +0 -0
  385. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterResponse.js.gz +0 -0
  386. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IPersonalizedReport.js.gz +0 -0
  387. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/permission-export-pdf.js.gz +0 -0
  388. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/personalized-reports-fetcher.js.gz +0 -0
  389. package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js.gz +0 -0
  390. package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js.gz +0 -0
  391. package/dist/collection/lib/http/data-fetcher/fetchers/grid-config-fetcher.js.gz +0 -0
  392. package/dist/collection/lib/http/data-fetcher/fetchers/parameters-fecher.js.gz +0 -0
  393. package/dist/collection/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.js.gz +0 -0
  394. package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js.gz +0 -0
  395. package/dist/collection/lib/http/data-fetcher/fetchers/resource-fetcher.js.gz +0 -0
  396. package/dist/collection/lib/http/data-fetcher/fetchers/totals-fetcher.js.gz +0 -0
  397. package/dist/collection/lib/http/data-fetcher/interfaces/IClientEventResponse.js.gz +0 -0
  398. package/dist/collection/lib/http/data-fetcher/recaller/GraphQLRecaller.js.gz +0 -0
  399. package/dist/collection/lib/http/data-fetcher/recaller/IDataFetcherRecaller.js.gz +0 -0
  400. package/dist/collection/lib/http/data-fetcher/recaller/ServiceBrokerRecaller.js.gz +0 -0
  401. package/dist/collection/lib/http/data-fetcher/state/LoadStateManager.js.gz +0 -0
  402. package/dist/collection/lib/index.js.gz +0 -0
  403. package/dist/collection/lib/message/SnkMessageBuilder.js +11 -2
  404. package/dist/collection/lib/message/SnkMessageBuilder.js.gz +0 -0
  405. package/dist/collection/lib/message/messageResourceEnUSUtils.js.gz +0 -0
  406. package/dist/collection/lib/message/messageResourceEsESUtils.js.gz +0 -0
  407. package/dist/collection/lib/message/messageResourcePtBRUtils.js.gz +0 -0
  408. package/dist/collection/lib/message/resources/en-us/continuousInsertUtils.msg.js.gz +0 -0
  409. package/dist/collection/lib/message/resources/en-us/crud-utils.msg.js.gz +0 -0
  410. package/dist/collection/lib/message/resources/en-us/dataFetcher.msg.js.gz +0 -0
  411. package/dist/collection/lib/message/resources/en-us/dataUnitDataLoaderHelper.msg.js.gz +0 -0
  412. package/dist/collection/lib/message/resources/en-us/file-viewer.msg.js.gz +0 -0
  413. package/dist/collection/lib/message/resources/en-us/snk-actions-button.msg.js.gz +0 -0
  414. package/dist/collection/lib/message/resources/en-us/snk-application.msg.js.gz +0 -0
  415. package/dist/collection/lib/message/resources/en-us/snk-attach.msg.js.gz +0 -0
  416. package/dist/collection/lib/message/resources/en-us/snk-configurator.msg.js.gz +0 -0
  417. package/dist/collection/lib/message/resources/en-us/snk-crud.msg.js.gz +0 -0
  418. package/dist/collection/lib/message/resources/en-us/snk-data-exporter.msg.js.gz +0 -0
  419. package/dist/collection/lib/message/resources/en-us/snk-data-unit.msg.js.gz +0 -0
  420. package/dist/collection/lib/message/resources/en-us/snk-entity-list.msg.js.gz +0 -0
  421. package/dist/collection/lib/message/resources/en-us/snk-error-handler.msg.js.gz +0 -0
  422. package/dist/collection/lib/message/resources/en-us/snk-exporter.msg.js.gz +0 -0
  423. package/dist/collection/lib/message/resources/en-us/snk-filter-bar.msg.js.gz +0 -0
  424. package/dist/collection/lib/message/resources/en-us/snk-filter-field-search.msg.js.gz +0 -0
  425. package/dist/collection/lib/message/resources/en-us/snk-filter-list.msg.js.gz +0 -0
  426. package/dist/collection/lib/message/resources/en-us/snk-filter-param-config.msg.js.gz +0 -0
  427. package/dist/collection/lib/message/resources/en-us/snk-form.msg.js +7 -0
  428. package/dist/collection/lib/message/resources/en-us/snk-form.msg.js.gz +0 -0
  429. package/dist/collection/lib/message/resources/en-us/snk-grid.msg.js.gz +0 -0
  430. package/dist/collection/lib/message/resources/en-us/snk-layout-form-config.msg.js.gz +0 -0
  431. package/dist/collection/lib/message/resources/en-us/snk-numbering-config.msg.js.gz +0 -0
  432. package/dist/collection/lib/message/resources/en-us/snk-personalized-filter.msg.js.gz +0 -0
  433. package/dist/collection/lib/message/resources/en-us/snk-pesquisa.msg.js.gz +0 -0
  434. package/dist/collection/lib/message/resources/en-us/snk-print-selector.msg.js.gz +0 -0
  435. package/dist/collection/lib/message/resources/en-us/snk-simple-bar.msg.js.gz +0 -0
  436. package/dist/collection/lib/message/resources/en-us/snk-simple-crud.msg.js.gz +0 -0
  437. package/dist/collection/lib/message/resources/en-us/snk-simple-form-config.msg.js.gz +0 -0
  438. package/dist/collection/lib/message/resources/en-us/snk-taskbar.msg.js.gz +0 -0
  439. package/dist/collection/lib/message/resources/es-es/continuousInsertUtils.msg.js.gz +0 -0
  440. package/dist/collection/lib/message/resources/es-es/crud-utils.msg.js.gz +0 -0
  441. package/dist/collection/lib/message/resources/es-es/dataFetcher.msg.js.gz +0 -0
  442. package/dist/collection/lib/message/resources/es-es/dataUnitDataLoaderHelper.msg.js.gz +0 -0
  443. package/dist/collection/lib/message/resources/es-es/file-viewer.msg.js.gz +0 -0
  444. package/dist/collection/lib/message/resources/es-es/snk-actions-button.msg.js.gz +0 -0
  445. package/dist/collection/lib/message/resources/es-es/snk-application.msg.js.gz +0 -0
  446. package/dist/collection/lib/message/resources/es-es/snk-attach.msg.js.gz +0 -0
  447. package/dist/collection/lib/message/resources/es-es/snk-configurator.msg.js.gz +0 -0
  448. package/dist/collection/lib/message/resources/es-es/snk-crud.msg.js.gz +0 -0
  449. package/dist/collection/lib/message/resources/es-es/snk-data-exporter.msg.js.gz +0 -0
  450. package/dist/collection/lib/message/resources/es-es/snk-data-unit.msg.js.gz +0 -0
  451. package/dist/collection/lib/message/resources/es-es/snk-entity-list.msg.js.gz +0 -0
  452. package/dist/collection/lib/message/resources/es-es/snk-error-handler.msg.js.gz +0 -0
  453. package/dist/collection/lib/message/resources/es-es/snk-exporter.msg.js.gz +0 -0
  454. package/dist/collection/lib/message/resources/es-es/snk-filter-bar.msg.js.gz +0 -0
  455. package/dist/collection/lib/message/resources/es-es/snk-filter-field-search.msg.js.gz +0 -0
  456. package/dist/collection/lib/message/resources/es-es/snk-filter-list.msg.js.gz +0 -0
  457. package/dist/collection/lib/message/resources/es-es/snk-filter-param-config.msg.js.gz +0 -0
  458. package/dist/collection/lib/message/resources/es-es/snk-form.msg.js +7 -0
  459. package/dist/collection/lib/message/resources/es-es/snk-form.msg.js.gz +0 -0
  460. package/dist/collection/lib/message/resources/es-es/snk-grid.msg.js.gz +0 -0
  461. package/dist/collection/lib/message/resources/es-es/snk-layout-form-config.msg.js.gz +0 -0
  462. package/dist/collection/lib/message/resources/es-es/snk-numbering-config.msg.js.gz +0 -0
  463. package/dist/collection/lib/message/resources/es-es/snk-personalized-filter.msg.js.gz +0 -0
  464. package/dist/collection/lib/message/resources/es-es/snk-pesquisa.msg.js.gz +0 -0
  465. package/dist/collection/lib/message/resources/es-es/snk-print-selector.msg.js.gz +0 -0
  466. package/dist/collection/lib/message/resources/es-es/snk-simple-bar.msg.js.gz +0 -0
  467. package/dist/collection/lib/message/resources/es-es/snk-simple-crud.msg.js.gz +0 -0
  468. package/dist/collection/lib/message/resources/es-es/snk-simple-form-config.msg.js.gz +0 -0
  469. package/dist/collection/lib/message/resources/es-es/snk-taskbar.msg.js.gz +0 -0
  470. package/dist/collection/lib/message/resources/pt-br/continuousInsertUtils.msg.js.gz +0 -0
  471. package/dist/collection/lib/message/resources/pt-br/crud-utils.msg.js.gz +0 -0
  472. package/dist/collection/lib/message/resources/pt-br/dataFetcher.msg.js.gz +0 -0
  473. package/dist/collection/lib/message/resources/pt-br/dataUnitDataLoaderHelper.msg.js.gz +0 -0
  474. package/dist/collection/lib/message/resources/pt-br/file-viewer.msg.js.gz +0 -0
  475. package/dist/collection/lib/message/resources/pt-br/snk-actions-button.msg.js.gz +0 -0
  476. package/dist/collection/lib/message/resources/pt-br/snk-application.msg.js.gz +0 -0
  477. package/dist/collection/lib/message/resources/pt-br/snk-attach.msg.js.gz +0 -0
  478. package/dist/collection/lib/message/resources/pt-br/snk-configurator.msg.js.gz +0 -0
  479. package/dist/collection/lib/message/resources/pt-br/snk-crud.msg.js.gz +0 -0
  480. package/dist/collection/lib/message/resources/pt-br/snk-data-exporter.msg.js.gz +0 -0
  481. package/dist/collection/lib/message/resources/pt-br/snk-data-unit.msg.js.gz +0 -0
  482. package/dist/collection/lib/message/resources/pt-br/snk-entity-list.msg.js.gz +0 -0
  483. package/dist/collection/lib/message/resources/pt-br/snk-error-handler.msg.js.gz +0 -0
  484. package/dist/collection/lib/message/resources/pt-br/snk-exporter.msg.js.gz +0 -0
  485. package/dist/collection/lib/message/resources/pt-br/snk-filter-bar.msg.js.gz +0 -0
  486. package/dist/collection/lib/message/resources/pt-br/snk-filter-field-search.msg.js.gz +0 -0
  487. package/dist/collection/lib/message/resources/pt-br/snk-filter-list.msg.js.gz +0 -0
  488. package/dist/collection/lib/message/resources/pt-br/snk-filter-param-config.msg.js.gz +0 -0
  489. package/dist/collection/lib/message/resources/pt-br/snk-form.msg.js +7 -0
  490. package/dist/collection/lib/message/resources/pt-br/snk-form.msg.js.gz +0 -0
  491. package/dist/collection/lib/message/resources/pt-br/snk-grid.msg.js.gz +0 -0
  492. package/dist/collection/lib/message/resources/pt-br/snk-layout-form-config.msg.js.gz +0 -0
  493. package/dist/collection/lib/message/resources/pt-br/snk-numbering-config.msg.js.gz +0 -0
  494. package/dist/collection/lib/message/resources/pt-br/snk-personalized-filter.msg.js.gz +0 -0
  495. package/dist/collection/lib/message/resources/pt-br/snk-pesquisa.msg.js.gz +0 -0
  496. package/dist/collection/lib/message/resources/pt-br/snk-print-selector.msg.js.gz +0 -0
  497. package/dist/collection/lib/message/resources/pt-br/snk-simple-bar.msg.js.gz +0 -0
  498. package/dist/collection/lib/message/resources/pt-br/snk-simple-crud.msg.js.gz +0 -0
  499. package/dist/collection/lib/message/resources/pt-br/snk-simple-form-config.msg.js.gz +0 -0
  500. package/dist/collection/lib/message/resources/pt-br/snk-taskbar.msg.js.gz +0 -0
  501. package/dist/collection/lib/resourceid/ResourceIDUtils.js.gz +0 -0
  502. package/dist/collection/lib/store/index.js.gz +0 -0
  503. package/dist/collection/lib/utils/ContinuousInsertUtils.js.gz +0 -0
  504. package/dist/collection/lib/utils/CrudUtils.js.gz +0 -0
  505. package/dist/collection/lib/utils/GetSelectedRecordsIDsInfo.js.gz +0 -0
  506. package/dist/collection/lib/utils/PrintUtils.js.gz +0 -0
  507. package/dist/collection/lib/utils/constants.js.gz +0 -0
  508. package/dist/collection/lib/utils/fileViewer/index.js.gz +0 -0
  509. package/dist/collection/lib/utils/fileViewer/interfaces/IFileViewerParams.js.gz +0 -0
  510. package/dist/collection/lib/utils/pesquisa.js.gz +0 -0
  511. package/dist/collection/lib/utils/urlutils.js.gz +0 -0
  512. package/dist/collection/lib/workspace/workspace.js.gz +0 -0
  513. package/dist/collection/sw.js.gz +0 -0
  514. package/dist/components/AuthorizationConfig.js.gz +0 -0
  515. package/dist/components/ConfigStorage.js.gz +0 -0
  516. package/dist/components/ContinuousInsertUtils.js.gz +0 -0
  517. package/dist/components/DataFetcher.js +32 -2
  518. package/dist/components/DataFetcher.js.gz +0 -0
  519. package/dist/components/GetSelectedRecordsIDsInfo.js.gz +0 -0
  520. package/dist/components/ISave.js.gz +0 -0
  521. package/dist/components/ParamType.js.gz +0 -0
  522. package/dist/components/PersonalizedFilterUtils.js.gz +0 -0
  523. package/dist/components/PrintUtils.js.gz +0 -0
  524. package/dist/components/ResourceIDUtils.js.gz +0 -0
  525. package/dist/components/SnkFormConfigManager.js +6 -6
  526. package/dist/components/SnkFormConfigManager.js.gz +0 -0
  527. package/dist/components/auth-fetcher.js.gz +0 -0
  528. package/dist/components/config-header.js.gz +0 -0
  529. package/dist/components/config-header2.js.gz +0 -0
  530. package/dist/components/configs-button.js.gz +0 -0
  531. package/dist/components/configs-button2.js.gz +0 -0
  532. package/dist/components/constants.js.gz +0 -0
  533. package/dist/components/dataunit-fetcher.js.gz +0 -0
  534. package/dist/components/field-config.js.gz +0 -0
  535. package/dist/components/field-config2.js +25 -2
  536. package/dist/components/field-config2.js.gz +0 -0
  537. package/dist/components/field-item.js.gz +0 -0
  538. package/dist/components/field-item2.js.gz +0 -0
  539. package/dist/components/fields-layout.js.gz +0 -0
  540. package/dist/components/fields-layout2.js +6 -3
  541. package/dist/components/fields-layout2.js.gz +0 -0
  542. package/dist/components/fields-selector.js.gz +0 -0
  543. package/dist/components/fields-selector2.js.gz +0 -0
  544. package/dist/components/filter-item-type.enum.js.gz +0 -0
  545. package/dist/components/filterNumberVariation.js.gz +0 -0
  546. package/dist/components/form-config-fetcher.js.gz +0 -0
  547. package/dist/components/guides-configurator.js.gz +0 -0
  548. package/dist/components/guides-configurator2.js +5 -3
  549. package/dist/components/guides-configurator2.js.gz +0 -0
  550. package/dist/components/index.js.gz +0 -0
  551. package/dist/components/index2.js.gz +0 -0
  552. package/dist/components/pesquisa-grid.js.gz +0 -0
  553. package/dist/components/pesquisa-grid2.js.gz +0 -0
  554. package/dist/components/pesquisa-tree.js.gz +0 -0
  555. package/dist/components/pesquisa-tree2.js.gz +0 -0
  556. package/dist/components/presentationMode.js.gz +0 -0
  557. package/dist/components/snk-actions-button.js.gz +0 -0
  558. package/dist/components/snk-actions-button2.js.gz +0 -0
  559. package/dist/components/snk-actions-form.js.gz +0 -0
  560. package/dist/components/snk-application.js.gz +0 -0
  561. package/dist/components/snk-application2.js +18 -1
  562. package/dist/components/snk-application2.js.gz +0 -0
  563. package/dist/components/snk-attach.js.gz +0 -0
  564. package/dist/components/snk-attach2.js.gz +0 -0
  565. package/dist/components/snk-client-confirm.js.gz +0 -0
  566. package/dist/components/snk-configurator.js.gz +0 -0
  567. package/dist/components/snk-configurator2.js.gz +0 -0
  568. package/dist/components/snk-crud.js.gz +0 -0
  569. package/dist/components/snk-custom-slot-elements.js.gz +0 -0
  570. package/dist/components/snk-data-exporter.js.gz +0 -0
  571. package/dist/components/snk-data-exporter2.js.gz +0 -0
  572. package/dist/components/snk-data-unit.js.gz +0 -0
  573. package/dist/components/snk-data-unit2.js +7 -0
  574. package/dist/components/snk-data-unit2.js.gz +0 -0
  575. package/dist/components/snk-default-filter.js.gz +0 -0
  576. package/dist/components/snk-default-filter2.js.gz +0 -0
  577. package/dist/components/snk-detail-view.js.gz +0 -0
  578. package/dist/components/snk-detail-view2.js.gz +0 -0
  579. package/dist/components/snk-entity-list.js.gz +0 -0
  580. package/dist/components/snk-exporter-email-sender.js.gz +0 -0
  581. package/dist/components/snk-exporter-email-sender2.js.gz +0 -0
  582. package/dist/components/snk-expression-group.js.gz +0 -0
  583. package/dist/components/snk-expression-group2.js.gz +0 -0
  584. package/dist/components/snk-expression-item.js.gz +0 -0
  585. package/dist/components/snk-expression-item2.js.gz +0 -0
  586. package/dist/components/snk-filter-advanced-mode.js.gz +0 -0
  587. package/dist/components/snk-filter-advanced-mode2.js.gz +0 -0
  588. package/dist/components/snk-filter-assistent-mode.js.gz +0 -0
  589. package/dist/components/snk-filter-assistent-mode2.js.gz +0 -0
  590. package/dist/components/snk-filter-bar.js.gz +0 -0
  591. package/dist/components/snk-filter-bar2.js +12 -3
  592. package/dist/components/snk-filter-bar2.js.gz +0 -0
  593. package/dist/components/snk-filter-binary-select.js.gz +0 -0
  594. package/dist/components/snk-filter-checkbox-list.js.gz +0 -0
  595. package/dist/components/snk-filter-detail.js.gz +0 -0
  596. package/dist/components/snk-filter-detail2.js.gz +0 -0
  597. package/dist/components/snk-filter-field-search.js.gz +0 -0
  598. package/dist/components/snk-filter-field-search2.js.gz +0 -0
  599. package/dist/components/snk-filter-item.js.gz +0 -0
  600. package/dist/components/snk-filter-item2.js +5 -1
  601. package/dist/components/snk-filter-item2.js.gz +0 -0
  602. package/dist/components/snk-filter-list.js.gz +0 -0
  603. package/dist/components/snk-filter-modal-item.js.gz +0 -0
  604. package/dist/components/snk-filter-modal-item2.js.gz +0 -0
  605. package/dist/components/snk-filter-modal.js.gz +0 -0
  606. package/dist/components/snk-filter-modal2.js +15 -5
  607. package/dist/components/snk-filter-modal2.js.gz +0 -0
  608. package/dist/components/snk-filter-multi-select.js.gz +0 -0
  609. package/dist/components/snk-filter-number.js +1 -1
  610. package/dist/components/snk-filter-number.js.gz +0 -0
  611. package/dist/components/snk-filter-param-config.js.gz +0 -0
  612. package/dist/components/snk-filter-param-config2.js.gz +0 -0
  613. package/dist/components/snk-filter-period.js +10 -5
  614. package/dist/components/snk-filter-period.js.gz +0 -0
  615. package/dist/components/snk-filter-search.js.gz +0 -0
  616. package/dist/components/snk-filter-text.js +1 -1
  617. package/dist/components/snk-filter-text.js.gz +0 -0
  618. package/dist/components/snk-form-config.js.gz +0 -0
  619. package/dist/components/snk-form-config2.js +24 -3
  620. package/dist/components/snk-form-config2.js.gz +0 -0
  621. package/dist/components/snk-form-summary.js.gz +0 -0
  622. package/dist/components/snk-form-summary2.js.gz +0 -0
  623. package/dist/components/snk-form-view.js.gz +0 -0
  624. package/dist/components/snk-form-view2.js.gz +0 -0
  625. package/dist/components/snk-form.js.gz +0 -0
  626. package/dist/components/snk-grid-config.js.gz +0 -0
  627. package/dist/components/snk-grid-config2.js.gz +0 -0
  628. package/dist/components/snk-grid.js.gz +0 -0
  629. package/dist/components/snk-grid2.js +1 -1
  630. package/dist/components/snk-grid2.js.gz +0 -0
  631. package/dist/components/snk-guides-viewer.js.gz +0 -0
  632. package/dist/components/snk-layout-form-config.js.gz +0 -0
  633. package/dist/components/snk-layout-form-config2.js.gz +0 -0
  634. package/dist/components/snk-numbering-config.js.gz +0 -0
  635. package/dist/components/snk-numbering-config2.js.gz +0 -0
  636. package/dist/components/snk-personalized-filter-editor.js.gz +0 -0
  637. package/dist/components/snk-personalized-filter.js.gz +0 -0
  638. package/dist/components/snk-personalized-filter2.js.gz +0 -0
  639. package/dist/components/snk-pesquisa.js.gz +0 -0
  640. package/dist/components/snk-pesquisa2.js.gz +0 -0
  641. package/dist/components/snk-print-selector.js.gz +0 -0
  642. package/dist/components/snk-select-box.js.gz +0 -0
  643. package/dist/components/snk-select-box2.js.gz +0 -0
  644. package/dist/components/snk-simple-bar.js.gz +0 -0
  645. package/dist/components/snk-simple-bar2.js.gz +0 -0
  646. package/dist/components/snk-simple-crud.js.gz +0 -0
  647. package/dist/components/snk-simple-crud2.js +2 -10
  648. package/dist/components/snk-simple-crud2.js.gz +0 -0
  649. package/dist/components/snk-simple-form-config.js.gz +0 -0
  650. package/dist/components/snk-simple-form-config2.js.gz +0 -0
  651. package/dist/components/snk-taskbar.js.gz +0 -0
  652. package/dist/components/snk-taskbar2.js +57 -45
  653. package/dist/components/snk-taskbar2.js.gz +0 -0
  654. package/dist/components/snk-view-representation.js.gz +0 -0
  655. package/dist/components/snk-view-representation2.js.gz +0 -0
  656. package/dist/components/sortable.esm.js.gz +0 -0
  657. package/dist/components/taskbar-actions-button.js.gz +0 -0
  658. package/dist/components/taskbar-actions-button2.js.gz +0 -0
  659. package/dist/components/taskbar-split-button.js.gz +0 -0
  660. package/dist/components/taskbar-split-button2.js.gz +0 -0
  661. package/dist/components/teste-pesquisa.js.gz +0 -0
  662. package/dist/esm/AuthorizationConfig-dcbd207a.js.gz +0 -0
  663. package/dist/esm/{ConfigStorage-568dc227.js → ConfigStorage-9eb9cd0a.js} +2 -2
  664. package/dist/esm/ConfigStorage-9eb9cd0a.js.gz +0 -0
  665. package/dist/esm/{DataFetcher-743feb3b.js → DataFetcher-8c9be33f.js} +32 -2
  666. package/dist/esm/{DataFetcher-743feb3b.js.gz → DataFetcher-8c9be33f.js.gz} +0 -0
  667. package/dist/esm/{FormConfigHelper-4e42f0b6.js → FormConfigHelper-b9cf7758.js} +24 -1
  668. package/dist/esm/FormConfigHelper-b9cf7758.js.gz +0 -0
  669. package/dist/esm/GetSelectedRecordsIDsInfo-9fa41508.js.gz +0 -0
  670. package/dist/esm/IFetchDataExporterParams-d73bed3d.js.gz +0 -0
  671. package/dist/esm/{ISave-345481c1.js → ISave-30cc0eee.js} +1 -1
  672. package/dist/esm/ISave-30cc0eee.js.gz +0 -0
  673. package/dist/esm/ParamType-d5152b06.js.gz +0 -0
  674. package/dist/esm/PersonalizedFilterUtils-2db38ff2.js.gz +0 -0
  675. package/dist/esm/PrintUtils-3e4ff0f5.js.gz +0 -0
  676. package/dist/esm/ResourceIDUtils-a114189a.js.gz +0 -0
  677. package/dist/esm/ServicesNumberingConfig-2f7b050e.js.gz +0 -0
  678. package/dist/esm/{SnkFormConfigManager-d61df0c8.js → SnkFormConfigManager-93ff3178.js} +7 -7
  679. package/dist/esm/SnkFormConfigManager-93ff3178.js.gz +0 -0
  680. package/dist/esm/{SnkMultiSelectionListDataSource-ca8d7a09.js → SnkMultiSelectionListDataSource-3916b4df.js} +4 -4
  681. package/dist/esm/SnkMultiSelectionListDataSource-3916b4df.js.gz +0 -0
  682. package/dist/esm/{auth-fetcher-c353127d.js → auth-fetcher-fbe8792a.js} +1 -1
  683. package/dist/esm/auth-fetcher-fbe8792a.js.gz +0 -0
  684. package/dist/esm/config-header.entry.js.gz +0 -0
  685. package/dist/esm/configs-button.entry.js.gz +0 -0
  686. package/dist/esm/constants-7b422de0.js.gz +0 -0
  687. package/dist/esm/{dataunit-fetcher-7f2c61ca.js → dataunit-fetcher-07e525dc.js} +1 -1
  688. package/dist/esm/dataunit-fetcher-07e525dc.js.gz +0 -0
  689. package/dist/esm/default-filters-50105e43.js.gz +0 -0
  690. package/dist/esm/field-config_2.entry.js +2 -2
  691. package/dist/esm/field-config_2.entry.js.gz +0 -0
  692. package/dist/esm/fields-layout.entry.js +6 -3
  693. package/dist/esm/fields-layout.entry.js.gz +0 -0
  694. package/dist/esm/fields-selector.entry.js +1 -1
  695. package/dist/esm/fields-selector.entry.js.gz +0 -0
  696. package/dist/esm/filter-item-type.enum-d45e026f.js.gz +0 -0
  697. package/dist/esm/filter-type.enum-f6a8fe23.js.gz +0 -0
  698. package/dist/esm/filter-validate-faf51fa9.js.gz +0 -0
  699. package/dist/esm/filterNumberVariation-8cee02ea.js.gz +0 -0
  700. package/dist/esm/{form-config-fetcher-898d2dd1.js → form-config-fetcher-2da29748.js} +1 -1
  701. package/dist/esm/form-config-fetcher-2da29748.js.gz +0 -0
  702. package/dist/esm/guides-configurator.entry.js +5 -3
  703. package/dist/esm/guides-configurator.entry.js.gz +0 -0
  704. package/dist/esm/index-446f9341.js.gz +0 -0
  705. package/dist/esm/index-479e1293.js.gz +0 -0
  706. package/dist/esm/index-620ac460.js.gz +0 -0
  707. package/dist/esm/index-8acbae97.js.gz +0 -0
  708. package/dist/esm/index-b40568ff.js.gz +0 -0
  709. package/dist/esm/index.js.gz +0 -0
  710. package/dist/esm/loader.js.gz +0 -0
  711. package/dist/esm/pesquisa-grid_2.entry.js +4 -4
  712. package/dist/esm/pesquisa-grid_2.entry.js.gz +0 -0
  713. package/dist/esm/polyfills/core-js.js.gz +0 -0
  714. package/dist/esm/polyfills/css-shim.js.gz +0 -0
  715. package/dist/esm/polyfills/dom.js.gz +0 -0
  716. package/dist/esm/polyfills/es5-html-element.js.gz +0 -0
  717. package/dist/esm/polyfills/index.js.gz +0 -0
  718. package/dist/esm/polyfills/system.js.gz +0 -0
  719. package/dist/esm/presentationMode-783bbf9d.js.gz +0 -0
  720. package/dist/esm/sankhyablocks.js.gz +0 -0
  721. package/dist/esm/snk-actions-button_9.entry.js +5 -5
  722. package/dist/esm/snk-actions-button_9.entry.js.gz +0 -0
  723. package/dist/esm/snk-actions-form.entry.js.gz +0 -0
  724. package/dist/esm/snk-application.entry.js +24 -7
  725. package/dist/esm/snk-application.entry.js.gz +0 -0
  726. package/dist/esm/snk-attach.entry.js +5 -5
  727. package/dist/esm/snk-attach.entry.js.gz +0 -0
  728. package/dist/esm/snk-client-confirm.entry.js.gz +0 -0
  729. package/dist/esm/snk-configurator.entry.js.gz +0 -0
  730. package/dist/esm/snk-crud.entry.js +5 -5
  731. package/dist/esm/snk-crud.entry.js.gz +0 -0
  732. package/dist/esm/snk-custom-slot-elements.entry.js.gz +0 -0
  733. package/dist/esm/snk-data-exporter.entry.js +5 -5
  734. package/dist/esm/snk-data-exporter.entry.js.gz +0 -0
  735. package/dist/esm/{snk-data-unit-60b338c5.js → snk-data-unit-9534563e.js} +9 -2
  736. package/dist/esm/snk-data-unit-9534563e.js.gz +0 -0
  737. package/dist/esm/snk-data-unit.entry.js +3 -3
  738. package/dist/esm/snk-data-unit.entry.js.gz +0 -0
  739. package/dist/esm/snk-default-filter.entry.js.gz +0 -0
  740. package/dist/esm/snk-detail-view.entry.js +7 -7
  741. package/dist/esm/snk-detail-view.entry.js.gz +0 -0
  742. package/dist/esm/snk-entity-list.entry.js.gz +0 -0
  743. package/dist/esm/snk-exporter-email-sender.entry.js.gz +0 -0
  744. package/dist/esm/snk-expression-group_2.entry.js.gz +0 -0
  745. package/dist/esm/snk-filter-advanced-mode_2.entry.js.gz +0 -0
  746. package/dist/esm/snk-filter-bar_4.entry.js +35 -12
  747. package/dist/esm/snk-filter-bar_4.entry.js.gz +0 -0
  748. package/dist/esm/snk-filter-binary-select.entry.js.gz +0 -0
  749. package/dist/esm/snk-filter-checkbox-list.entry.js.gz +0 -0
  750. package/dist/esm/snk-filter-detail.entry.js.gz +0 -0
  751. package/dist/esm/snk-filter-field-search_2.entry.js.gz +0 -0
  752. package/dist/esm/snk-filter-modal-item.entry.js +3 -3
  753. package/dist/esm/snk-filter-modal-item.entry.js.gz +0 -0
  754. package/dist/esm/snk-filter-multi-select.entry.js.gz +0 -0
  755. package/dist/esm/snk-filter-number.entry.js +1 -1
  756. package/dist/esm/snk-filter-number.entry.js.gz +0 -0
  757. package/dist/esm/snk-filter-period.entry.js +10 -5
  758. package/dist/esm/snk-filter-period.entry.js.gz +0 -0
  759. package/dist/esm/snk-filter-search.entry.js.gz +0 -0
  760. package/dist/esm/snk-filter-text.entry.js +1 -1
  761. package/dist/esm/snk-filter-text.entry.js.gz +0 -0
  762. package/dist/esm/snk-form-summary.entry.js.gz +0 -0
  763. package/dist/esm/snk-form-view.entry.js.gz +0 -0
  764. package/dist/esm/snk-form_2.entry.js +28 -7
  765. package/dist/esm/snk-form_2.entry.js.gz +0 -0
  766. package/dist/esm/snk-grid.entry.js +7 -7
  767. package/dist/esm/snk-grid.entry.js.gz +0 -0
  768. package/dist/esm/{snk-guides-viewer-339e10b3.js → snk-guides-viewer-19b420c7.js} +5 -5
  769. package/dist/esm/snk-guides-viewer-19b420c7.js.gz +0 -0
  770. package/dist/esm/snk-guides-viewer.entry.js +7 -7
  771. package/dist/esm/snk-guides-viewer.entry.js.gz +0 -0
  772. package/dist/esm/snk-personalized-filter-editor.entry.js.gz +0 -0
  773. package/dist/esm/snk-personalized-filter.entry.js +3 -3
  774. package/dist/esm/snk-personalized-filter.entry.js.gz +0 -0
  775. package/dist/esm/snk-pesquisa.entry.js +4 -4
  776. package/dist/esm/snk-pesquisa.entry.js.gz +0 -0
  777. package/dist/esm/snk-print-selector.entry.js.gz +0 -0
  778. package/dist/esm/snk-simple-bar.entry.js.gz +0 -0
  779. package/dist/esm/snk-simple-crud.entry.js +9 -17
  780. package/dist/esm/snk-simple-crud.entry.js.gz +0 -0
  781. package/dist/esm/snk-taskbar.entry.js +57 -45
  782. package/dist/esm/snk-taskbar.entry.js.gz +0 -0
  783. package/dist/esm/sortable.esm-842f85a3.js.gz +0 -0
  784. package/dist/esm/taskbar-elements-faaf5d8f.js.gz +0 -0
  785. package/dist/esm/taskbar-processor-3436124c.js.gz +0 -0
  786. package/dist/esm/teste-pesquisa.entry.js.gz +0 -0
  787. package/dist/index.cjs.js.gz +0 -0
  788. package/dist/index.js.gz +0 -0
  789. package/dist/sankhyablocks/index.esm.js.gz +0 -0
  790. package/dist/sankhyablocks/{p-11346b8d.entry.js → p-07c5289b.entry.js} +1 -1
  791. package/dist/sankhyablocks/p-07c5289b.entry.js.gz +0 -0
  792. package/dist/sankhyablocks/{p-bd203e8d.entry.js → p-0d85b1fc.entry.js} +1 -1
  793. package/dist/sankhyablocks/p-0d85b1fc.entry.js.gz +0 -0
  794. package/dist/sankhyablocks/p-0f3698af.js.gz +0 -0
  795. package/dist/sankhyablocks/{p-7fc46290.js → p-1273039f.js} +1 -1
  796. package/dist/sankhyablocks/p-1273039f.js.gz +0 -0
  797. package/dist/sankhyablocks/p-162bddae.entry.js.gz +0 -0
  798. package/dist/sankhyablocks/p-180716b2.entry.js.gz +0 -0
  799. package/dist/sankhyablocks/p-1a0caadb.js.gz +0 -0
  800. package/dist/sankhyablocks/p-1a68fb59.js.gz +0 -0
  801. package/dist/sankhyablocks/p-1c2258d7.entry.js +1 -0
  802. package/dist/sankhyablocks/p-1c2258d7.entry.js.gz +0 -0
  803. package/dist/sankhyablocks/p-21107f0d.entry.js.gz +0 -0
  804. package/dist/sankhyablocks/{p-56948f00.entry.js → p-21d08648.entry.js} +2 -2
  805. package/dist/sankhyablocks/p-21d08648.entry.js.gz +0 -0
  806. package/dist/sankhyablocks/p-27482793.entry.js.gz +0 -0
  807. package/dist/sankhyablocks/p-279f1ef9.entry.js +1 -0
  808. package/dist/sankhyablocks/p-279f1ef9.entry.js.gz +0 -0
  809. package/dist/sankhyablocks/p-2fdac5e6.entry.js.gz +0 -0
  810. package/dist/sankhyablocks/{p-e64958ba.entry.js → p-30efd095.entry.js} +1 -1
  811. package/dist/sankhyablocks/p-30efd095.entry.js.gz +0 -0
  812. package/dist/sankhyablocks/{p-1d585081.js → p-3810bd66.js} +1 -1
  813. package/dist/sankhyablocks/p-3810bd66.js.gz +0 -0
  814. package/dist/sankhyablocks/p-3b167a03.entry.js +1 -0
  815. package/dist/sankhyablocks/p-3b167a03.entry.js.gz +0 -0
  816. package/dist/sankhyablocks/p-3d41f5a8.entry.js.gz +0 -0
  817. package/dist/sankhyablocks/{p-e8c49c12.js → p-403c0168.js} +1 -1
  818. package/dist/sankhyablocks/p-403c0168.js.gz +0 -0
  819. package/dist/sankhyablocks/{p-88ed2793.js → p-42e248cd.js} +1 -1
  820. package/dist/sankhyablocks/p-42e248cd.js.gz +0 -0
  821. package/dist/sankhyablocks/p-471b34f4.entry.js.gz +0 -0
  822. package/dist/sankhyablocks/p-49ddc27a.entry.js.gz +0 -0
  823. package/dist/sankhyablocks/{p-c90f337a.entry.js → p-4c782d79.entry.js} +1 -1
  824. package/dist/sankhyablocks/p-4c782d79.entry.js.gz +0 -0
  825. package/dist/sankhyablocks/p-50735892.js +1 -0
  826. package/dist/sankhyablocks/p-50735892.js.gz +0 -0
  827. package/dist/sankhyablocks/p-51833248.js.gz +0 -0
  828. package/dist/sankhyablocks/{p-7b3ca294.entry.js → p-5340c04e.entry.js} +1 -1
  829. package/dist/sankhyablocks/p-5340c04e.entry.js.gz +0 -0
  830. package/dist/sankhyablocks/p-547dbd09.entry.js +1 -0
  831. package/dist/sankhyablocks/p-547dbd09.entry.js.gz +0 -0
  832. package/dist/sankhyablocks/p-55798617.js.gz +0 -0
  833. package/dist/sankhyablocks/{p-f25c50f7.entry.js → p-56f2e975.entry.js} +1 -1
  834. package/dist/sankhyablocks/p-56f2e975.entry.js.gz +0 -0
  835. package/dist/sankhyablocks/{p-1f8cb438.entry.js → p-57c5b8b8.entry.js} +1 -1
  836. package/dist/sankhyablocks/p-57c5b8b8.entry.js.gz +0 -0
  837. package/dist/sankhyablocks/{p-164c822d.entry.js → p-5a65b696.entry.js} +1 -1
  838. package/dist/sankhyablocks/p-5a65b696.entry.js.gz +0 -0
  839. package/dist/sankhyablocks/{p-9fe91526.js → p-5d9d7196.js} +1 -1
  840. package/dist/sankhyablocks/p-5d9d7196.js.gz +0 -0
  841. package/dist/sankhyablocks/p-60dd1d27.entry.js.gz +0 -0
  842. package/dist/sankhyablocks/p-661114a2.entry.js +1 -0
  843. package/dist/sankhyablocks/p-661114a2.entry.js.gz +0 -0
  844. package/dist/sankhyablocks/p-667cab42.entry.js.gz +0 -0
  845. package/dist/sankhyablocks/p-688dcb4c.js.gz +0 -0
  846. package/dist/sankhyablocks/p-6a11f754.js +1 -0
  847. package/dist/sankhyablocks/p-6a11f754.js.gz +0 -0
  848. package/dist/sankhyablocks/p-6a4b21dd.js.gz +0 -0
  849. package/dist/sankhyablocks/p-7345782c.entry.js.gz +0 -0
  850. package/dist/sankhyablocks/p-75af335e.entry.js.gz +0 -0
  851. package/dist/sankhyablocks/p-76e66fd9.js.gz +0 -0
  852. package/dist/sankhyablocks/p-7dd49d15.js.gz +0 -0
  853. package/dist/sankhyablocks/p-7e250432.entry.js.gz +0 -0
  854. package/dist/sankhyablocks/p-7f7fe6c4.entry.js.gz +0 -0
  855. package/dist/sankhyablocks/p-81329e1c.entry.js +1 -0
  856. package/dist/sankhyablocks/p-81329e1c.entry.js.gz +0 -0
  857. package/dist/sankhyablocks/p-825098c1.entry.js.gz +0 -0
  858. package/dist/sankhyablocks/p-84345e7a.js.gz +0 -0
  859. package/dist/sankhyablocks/{p-144da1d1.entry.js → p-8a9090b0.entry.js} +1 -1
  860. package/dist/sankhyablocks/p-8a9090b0.entry.js.gz +0 -0
  861. package/dist/sankhyablocks/p-8d884fab.js.gz +0 -0
  862. package/dist/sankhyablocks/p-8f3f2306.js.gz +0 -0
  863. package/dist/sankhyablocks/{p-4759912d.entry.js → p-8f67fb18.entry.js} +1 -1
  864. package/dist/sankhyablocks/p-8f67fb18.entry.js.gz +0 -0
  865. package/dist/sankhyablocks/p-9019a32f.js.gz +0 -0
  866. package/dist/sankhyablocks/p-91a9abb6.entry.js.gz +0 -0
  867. package/dist/sankhyablocks/{p-f8f29e1a.entry.js → p-965fc67f.entry.js} +1 -1
  868. package/dist/sankhyablocks/p-965fc67f.entry.js.gz +0 -0
  869. package/dist/sankhyablocks/p-96d45943.entry.js.gz +0 -0
  870. package/dist/sankhyablocks/{p-e6b1c769.entry.js → p-986a8960.entry.js} +1 -1
  871. package/dist/sankhyablocks/p-986a8960.entry.js.gz +0 -0
  872. package/dist/sankhyablocks/p-988afe78.js.gz +0 -0
  873. package/dist/sankhyablocks/{p-093f58fa.entry.js → p-99a11017.entry.js} +1 -1
  874. package/dist/sankhyablocks/{p-093f58fa.entry.js.gz → p-99a11017.entry.js.gz} +0 -0
  875. package/dist/sankhyablocks/p-9a63f3f7.entry.js.gz +0 -0
  876. package/dist/sankhyablocks/{p-27005fac.entry.js → p-9dec2162.entry.js} +1 -1
  877. package/dist/sankhyablocks/p-9dec2162.entry.js.gz +0 -0
  878. package/dist/sankhyablocks/{p-1788d191.js → p-a17e9ecd.js} +1 -1
  879. package/dist/sankhyablocks/p-a17e9ecd.js.gz +0 -0
  880. package/dist/sankhyablocks/{p-af9d79e0.entry.js → p-a911166f.entry.js} +1 -1
  881. package/dist/sankhyablocks/p-a911166f.entry.js.gz +0 -0
  882. package/dist/sankhyablocks/{p-4c763b10.entry.js → p-a9b16874.entry.js} +1 -1
  883. package/dist/sankhyablocks/p-a9b16874.entry.js.gz +0 -0
  884. package/dist/sankhyablocks/p-b568c1d4.js.gz +0 -0
  885. package/dist/sankhyablocks/p-b7e891cc.entry.js.gz +0 -0
  886. package/dist/sankhyablocks/p-b987e15d.js.gz +0 -0
  887. package/dist/sankhyablocks/p-c3dbf441.entry.js.gz +0 -0
  888. package/dist/sankhyablocks/p-c4fcf1fb.entry.js.gz +0 -0
  889. package/dist/sankhyablocks/p-cad964b5.js.gz +0 -0
  890. package/dist/sankhyablocks/p-cb4343c4.entry.js.gz +0 -0
  891. package/dist/sankhyablocks/{p-6d241415.js → p-cdda05e3.js} +1 -1
  892. package/dist/sankhyablocks/p-cdda05e3.js.gz +0 -0
  893. package/dist/sankhyablocks/p-d68904a9.js +1 -0
  894. package/dist/sankhyablocks/p-d68904a9.js.gz +0 -0
  895. package/dist/sankhyablocks/p-d8d8169b.js.gz +0 -0
  896. package/dist/sankhyablocks/p-dc36cfbf.js.gz +0 -0
  897. package/dist/sankhyablocks/p-e258de96.entry.js.gz +0 -0
  898. package/dist/sankhyablocks/{p-59b8f277.js → p-e400dc69.js} +1 -1
  899. package/dist/sankhyablocks/p-e400dc69.js.gz +0 -0
  900. package/dist/sankhyablocks/p-e679c75a.entry.js +1 -0
  901. package/dist/sankhyablocks/p-e679c75a.entry.js.gz +0 -0
  902. package/dist/sankhyablocks/p-eaad0aa8.js.gz +0 -0
  903. package/dist/sankhyablocks/p-f4184ce7.js.gz +0 -0
  904. package/dist/sankhyablocks/p-fa80e546.js.gz +0 -0
  905. package/dist/sankhyablocks/p-ff1990ad.js.gz +0 -0
  906. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  907. package/dist/sankhyablocks/sankhyablocks.esm.js.gz +0 -0
  908. package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +1 -0
  909. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-period.d.ts +1 -0
  910. package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +2 -1
  911. package/dist/types/components/snk-form-config/FormConfigHelper.d.ts +4 -1
  912. package/dist/types/components/snk-form-config/SnkFormConfigManager.d.ts +1 -1
  913. package/dist/types/components/snk-form-config/fields-layout/fields-layout.d.ts +2 -2
  914. package/dist/types/components/snk-form-config/guides-configurator/guides-configurator.d.ts +1 -1
  915. package/dist/types/components/snk-form-config/snk-form-config.d.ts +4 -2
  916. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +0 -1
  917. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +6 -3
  918. package/package.json +1 -1
  919. package/dist/cjs/ConfigStorage-5a73e979.js.gz +0 -0
  920. package/dist/cjs/DataFetcher-eeb3b0b7.js.gz +0 -0
  921. package/dist/cjs/FormConfigHelper-ebb77625.js.gz +0 -0
  922. package/dist/cjs/ISave-861e9d6d.js.gz +0 -0
  923. package/dist/cjs/SnkFormConfigManager-8d4fded8.js.gz +0 -0
  924. package/dist/cjs/SnkMultiSelectionListDataSource-3b93f6a6.js.gz +0 -0
  925. package/dist/cjs/auth-fetcher-8d8acd69.js.gz +0 -0
  926. package/dist/cjs/dataunit-fetcher-1cea0695.js.gz +0 -0
  927. package/dist/cjs/form-config-fetcher-f347f884.js.gz +0 -0
  928. package/dist/cjs/snk-data-unit-de248308.js.gz +0 -0
  929. package/dist/cjs/snk-guides-viewer-4ec3e7e1.js.gz +0 -0
  930. package/dist/esm/ConfigStorage-568dc227.js.gz +0 -0
  931. package/dist/esm/FormConfigHelper-4e42f0b6.js.gz +0 -0
  932. package/dist/esm/ISave-345481c1.js.gz +0 -0
  933. package/dist/esm/SnkFormConfigManager-d61df0c8.js.gz +0 -0
  934. package/dist/esm/SnkMultiSelectionListDataSource-ca8d7a09.js.gz +0 -0
  935. package/dist/esm/auth-fetcher-c353127d.js.gz +0 -0
  936. package/dist/esm/dataunit-fetcher-7f2c61ca.js.gz +0 -0
  937. package/dist/esm/form-config-fetcher-898d2dd1.js.gz +0 -0
  938. package/dist/esm/snk-data-unit-60b338c5.js.gz +0 -0
  939. package/dist/esm/snk-guides-viewer-339e10b3.js.gz +0 -0
  940. package/dist/sankhyablocks/p-0cf9aa38.js +0 -1
  941. package/dist/sankhyablocks/p-0cf9aa38.js.gz +0 -0
  942. package/dist/sankhyablocks/p-11346b8d.entry.js.gz +0 -0
  943. package/dist/sankhyablocks/p-144da1d1.entry.js.gz +0 -0
  944. package/dist/sankhyablocks/p-1649f51e.entry.js +0 -1
  945. package/dist/sankhyablocks/p-1649f51e.entry.js.gz +0 -0
  946. package/dist/sankhyablocks/p-164c822d.entry.js.gz +0 -0
  947. package/dist/sankhyablocks/p-1788d191.js.gz +0 -0
  948. package/dist/sankhyablocks/p-1d585081.js.gz +0 -0
  949. package/dist/sankhyablocks/p-1f8cb438.entry.js.gz +0 -0
  950. package/dist/sankhyablocks/p-27005fac.entry.js.gz +0 -0
  951. package/dist/sankhyablocks/p-3ed04f0d.entry.js +0 -1
  952. package/dist/sankhyablocks/p-3ed04f0d.entry.js.gz +0 -0
  953. package/dist/sankhyablocks/p-4759912d.entry.js.gz +0 -0
  954. package/dist/sankhyablocks/p-4c763b10.entry.js.gz +0 -0
  955. package/dist/sankhyablocks/p-56948f00.entry.js.gz +0 -0
  956. package/dist/sankhyablocks/p-59b8f277.js.gz +0 -0
  957. package/dist/sankhyablocks/p-626b7a17.js +0 -1
  958. package/dist/sankhyablocks/p-626b7a17.js.gz +0 -0
  959. package/dist/sankhyablocks/p-6d241415.js.gz +0 -0
  960. package/dist/sankhyablocks/p-7b3ca294.entry.js.gz +0 -0
  961. package/dist/sankhyablocks/p-7fc46290.js.gz +0 -0
  962. package/dist/sankhyablocks/p-88ed2793.js.gz +0 -0
  963. package/dist/sankhyablocks/p-8f73da95.js +0 -1
  964. package/dist/sankhyablocks/p-8f73da95.js.gz +0 -0
  965. package/dist/sankhyablocks/p-95c71f5e.entry.js +0 -1
  966. package/dist/sankhyablocks/p-95c71f5e.entry.js.gz +0 -0
  967. package/dist/sankhyablocks/p-9f2cdaab.entry.js +0 -1
  968. package/dist/sankhyablocks/p-9f2cdaab.entry.js.gz +0 -0
  969. package/dist/sankhyablocks/p-9fe91526.js.gz +0 -0
  970. package/dist/sankhyablocks/p-a5108625.entry.js +0 -1
  971. package/dist/sankhyablocks/p-a5108625.entry.js.gz +0 -0
  972. package/dist/sankhyablocks/p-aae4258d.entry.js +0 -1
  973. package/dist/sankhyablocks/p-aae4258d.entry.js.gz +0 -0
  974. package/dist/sankhyablocks/p-af9d79e0.entry.js.gz +0 -0
  975. package/dist/sankhyablocks/p-bb0de89c.entry.js +0 -1
  976. package/dist/sankhyablocks/p-bb0de89c.entry.js.gz +0 -0
  977. package/dist/sankhyablocks/p-bd203e8d.entry.js.gz +0 -0
  978. package/dist/sankhyablocks/p-c90f337a.entry.js.gz +0 -0
  979. package/dist/sankhyablocks/p-e64958ba.entry.js.gz +0 -0
  980. package/dist/sankhyablocks/p-e6b1c769.entry.js.gz +0 -0
  981. package/dist/sankhyablocks/p-e8c49c12.js.gz +0 -0
  982. package/dist/sankhyablocks/p-f25c50f7.entry.js.gz +0 -0
  983. package/dist/sankhyablocks/p-f8f29e1a.entry.js.gz +0 -0
@@ -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-1788d191.js";import{d as S,D as b,U as I,S as T}from"./p-6d241415.js";import{A as N,a as L}from"./p-1d585081.js";import{P as E,D as C}from"./p-88ed2793.js";import{P as O}from"./p-e8c49c12.js";import{T as D}from"./p-9019a32f.js";import"./p-0f3698af.js";import"./p-ff1990ad.js";import{F as R}from"./p-7fc46290.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-a17e9ecd.js";import{d as S,D as b,U as I,S as T}from"./p-cdda05e3.js";import{A as N,a as L}from"./p-3810bd66.js";import{P as E,D as O}from"./p-42e248cd.js";import{P as C}from"./p-403c0168.js";import{T as D}from"./p-9019a32f.js";import"./p-0f3698af.js";import"./p-ff1990ad.js";import{F as R}from"./p-1273039f.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
@@ -8,4 +8,4 @@ import{r as t,c as e,h as i,H as s,g as n}from"./p-d8d8169b.js";import{DateUtils
8
8
  name
9
9
  value
10
10
  }
11
- }`)}fetchTotals(t,e,i=[]){const s=`${t}_${e}`,n=this.cancel.findIndex((t=>t[s]));return n>=0&&(this.cancel[n][s](),this.cancel.splice(n,1)),Promise.race([new Promise((t=>this.cancel.push({[s]:t}))),this.getTotals(t,e,i)]).then((t=>{let e=new Map;if(t){e=t;const i=this.cancel.findIndex((t=>t[s]));i>=0&&this.cancel.splice(i,1)}return e}))}getTotals(t,e,i=[]){return new Promise(((s,n)=>{b.get().callGraphQL({query:this.templateByQuery.get("fetchTotals"),values:{name:`totals://${t}/${e}`,filters:i}}).then((t=>{if(t.length>0){const e=new Map;return t.forEach((t=>e.set(t.name,parseFloat(t.value)))),s(e)}return n("Não foi possível recuperar os totalizadores")})).catch(n)}))}}var K;class V{static openAppActivity(t,e){var i;null===(i=window.workspace)||void 0===i||i.openAppActivity(t,e)}static getAppLabel(t){if(null!=(null===window||void 0===window?void 0:window.workspace))return null==window.workspace.getAppLabel&&(window.workspace.getAppLabel=t=>(t||"").split(".").pop()),window.workspace.getAppLabel(t)}static setScreenToUseV3Layout(){var t;null===(t=window.workspace)||void 0===t||t.setScreenToUseV3Layout()}static setScreenToUseOldLayout(){var t;null===(t=window.workspace)||void 0===t||t.setScreenToUseOldLayout()}static showDesktop(){var t,e;null===(e=null===(t=window.workspace)||void 0===t?void 0:t.showDesktop)||void 0===e||e.call(t)}static searchApp(){var t,e;null===(e=null===(t=window.workspace)||void 0===t?void 0:t.searchApp)||void 0===e||e.call(t)}static openHelp(){var t,e;null===(e=null===(t=window.workspace)||void 0===t?void 0:t.openHelp)||void 0===e||e.call(t)}static applicationClick(){var t,e;(null===(t=window.workspace)||void 0===t?void 0:t.applicationClick)&&(null===(e=window.workspace)||void 0===e||e.applicationClick())}}V.resourceID=null===(K=window.workspace)||void 0===K?void 0:K.resourceID;class W{constructor(t){this._app=t,window.addEventListener("error",(t=>this.errorHandler(t))),window.addEventListener("unhandledrejection",(t=>this.rejectionHandler(t)))}getMessage(t,e){return this._app.messagesBuilder.getMessage(t,e)}rejectionHandler(t){const e=t.reason;e instanceof h||(e?this.processException(e):this._app.isDebugMode().then((t=>{t&&this._app.error(this.getMessage("snkErrorHandler.title.promiseRejected"),this.getMessage("snkErrorHandler.message.undeterminedPromiseRejection"))})))}errorHandler(t){this.processException(t.error)}buildErrorCodeHTML(t){return`<br><a href="#" onclick="try{window.workspace.openHelp('_tbcode:${t}')} catch(e){alert('${this.getMessage("snkErrorHandler.message.cannotOpenHelp")}');}">${this.getMessage("snkErrorHandler.errorCode.label")}${t}</a>`}processException(t){t.errorCode&&(t.message+=this.buildErrorCodeHTML(t.errorCode)),t instanceof l?console.warn(this.getMessage("snkErrorHandler.message.silentExceptionIgnored"),t):t instanceof h||t instanceof c?this._app.alert(t.title,t.message):t instanceof d?this._app.error(t.title,t.message):this._app.isDebugMode().then((e=>{if(e)if(t instanceof Error)this._app.error(t.name,t.message);else{const e=(null==t?void 0:t.title)||this.getMessage("snkErrorHandler.title.errorDetected",void 0),i="string"==typeof t?t:t.message||`${this.getMessage("snkErrorHandler.error.internal")} "${o.objectToString(t)}"`;this._app.error(e,i)}}))}}class G{constructor(){this._debounceTime=1500,this.requests=new Map,this.requestsLoadingBar=[]}onRequestStart(t){if(t.url.includes("quietMode=true"))return;this.requestsLoadingBar.push(t.requestId);const e=setTimeout((()=>{this.ezLoadingBar.show()}),this._debounceTime);this.requests.set(t.requestId,e)}onRequestEnd(t){var e,i,s;const n=this.requests.get(t.requestId);clearTimeout(n),(null===(e=this.requestsLoadingBar)||void 0===e?void 0:e.includes(t.requestId))&&(this.requestsLoadingBar=null===(i=this.requestsLoadingBar)||void 0===i?void 0:i.filter((e=>e!==t.requestId)),!this.requestsLoadingBar.length&&(null===(s=this.ezLoadingBar)||void 0===s||s.hide()))}}class J{constructor(){this._debounceTime=1e3,this._ignoredNameTypes=["totals"],this._countRequest=0}onRequestStart(t){this.isIgnoreLoadingOnRequest(t)||(this._countRequest++,this.ezLoadingBar.show(),this._timerLoading&&clearTimeout(this._timerLoading))}onRequestEnd(t){this.isIgnoreLoadingOnRequest(t)||(this._countRequest--,this._timerLoading=setTimeout((()=>{this._countRequest<=0&&this.ezLoadingBar.hide()}),this._debounceTime))}isIgnoreLoadingOnRequest(t){if(null==t)return!1;if(t.url.includes("quietMode=true"))return!0;if(null==t.requestBody)return!1;if(1==t.requestBody.length){const{name:e}=t.requestBody[0].variables;if(e){const t=e.split(":");return this._ignoredNameTypes.indexOf(t[0])>=0}}return!1}}class Y{static create({strategy:t}){switch(t){case"request_name":return new J;case"request_time":return new G;default:throw new Error("Strategy not found")}}}const Z=["<img","<svg"];class X{constructor(){this._config=null,this.listeners=[]}static getInstance(){return X.instance||(X.instance=new X),X.instance}get config(){return this._config}setConfig(t){this._config=t,this.notifyListeners()}onConfigChange(t){this.listeners.push(t)}notifyListeners(){this.listeners.forEach((t=>t(this._config)))}}const Q=class{constructor(i){t(this,i),this.applicationLoaded=e(this,"applicationLoaded",7),this.applicationLoading=e(this,"applicationLoading",7),this.NEW_VERSION_POPUP_LOCKER="NEW_VERSION_POPUP_LOCKER",this.FEATURE_FLAG_CACHE_DURATION=36e5,this._authPromises=[],this._keyboardManager=new g,this._waitingAppReady=new Array,this._duCache=new Map,this._duPromises=new Map,this._requestListener=Y.create({strategy:"request_time"}),this._maxTimerAppLoading=1e4,this._featureFlagsCache=new Map,this._isBrowserTypeElectron=!1,this._pendingActions=new Map,this._loadPkParameter=null,this._isLoadedByPk=!1,this._formConfigFetcher=new R,this._LayoutFormConfigSingleton=X.getInstance(),this._applicationReady=!1,this._templateSkeleton=D.GRID,this._activeScrimWindow=!1,this.enableLockManagerLoadingApp=void 0,this.messagesBuilder=void 0,this.configName=void 0,this.gridLegacyConfigName=void 0,this.formLegacyConfigName=void 0,this.loadByPK=void 0}async processPendingActions(t){const e=this._pendingActions.get(t);e&&e.length&&(e.forEach((t=>t())),this._pendingActions.set(t,[]))}get parameters(){return this._parameters||(this._parameters=new B),this._parameters}async getAuth(t){return null==t?this.getApplicationAuth():new Promise(((e,i)=>{this.authFetcher.getData(t).then((t=>{e(t)})).catch((t=>{i(t)}))}))}async getApplicationAuth(){return this._auth?Promise.resolve(this._auth):new Promise(((t,e)=>{const i=this._authPromises.length>0;this._authPromises.push(new tt(t,e)),i||this.authFetcher.getData(this.applicationResourceID).then((t=>{for(this._auth=t;this._authPromises.length>0;)this._authPromises.pop().resolve(this._auth)})).catch((t=>{for(;this._authPromises.length>0;)this._authPromises.pop().reject(t)}))}))}watchPropHandler(t,e){t&&this._loadPkParameter&&(this.loadByPK(this._loadPkParameter.pk,this._loadPkParameter.redirect),this._loadPkParameter=null)}async getKeyboardManager(){return Promise.resolve(this._keyboardManager)}async getLayoutFormConfig(){return Promise.resolve(this._LayoutFormConfigSingleton)}async isUserSup(){return new Promise(((t,e)=>{this.getAuth().then((i=>{this.getAuthList(i).then((e=>{t(e.isSup)})).catch((t=>e(t)))}))}))}async addPendingAction(t,e){var i;const s=null!==(i=this._pendingActions.get(t))&&void 0!==i?i:[];this._pendingActions.set(t,[...s,e])}async callServiceBroker(t,e,i){return b.get().callServiceBroker(t,e,i)}async initOnboarding(t){this.hasToShowNewVersionPopup()?await this.addPendingAction(this.NEW_VERSION_POPUP_LOCKER,(()=>this.doInitOnboarding(t))):this.doInitOnboarding(t)}doInitOnboarding(t){w.getInstance().init(t,window.envContext)}async hasAccess(t,e){return new Promise(((i,s)=>{this.getAuth(e).then((e=>{this.getAuthList(e).then((e=>{i(e.isSup||e.actions[t])})).catch((t=>s(t)))}))}))}async getAllAccess(t){return new Promise(((e,i)=>{this.getAuth(t).then((t=>{this.getAuthList(t).then((t=>{const i={};i.isSup=t.isSup,Object.entries(N).forEach((e=>{i[e[0]]=e[1]===N.CLONE?t.actions[N.INSERT]&&t.actions[N.CLONE]||!1:t.actions[e[1]]||!1})),e(i)})).catch((t=>i(t)))}))}))}async getStringParam(t){return this.parameters.asString(t)}async getIntParam(t){return this.parameters.asInteger(t)}async getFloatParam(t){return this.parameters.asFloat(t)}async getBooleanParam(t){return this.parameters.asBoolean(t)}async getDateParam(t){return this.parameters.asDate(t)}async showPopUp(t,e="full",i=!0,s){this.clearContent(this._popUp),this._popUp.addEventListener("ezClosePopup",(()=>{s()}),{once:!0}),this._popUp.appendChild(t),this._popUp.opened=!0,this._popUp.heightMode=e,this._popUp.useHeader=i,"EZ-MODAL-CONTAINER"===t.tagName&&(this._popUp.useHeader=!1)}async showModal(t){this.clearContent(this._rightModal),this._rightModal.appendChild(t),this._rightModal.opened=!0}showAlerts(t){return x.showAlerts({alerts:t})}async closeModal(){this.clearContent(this._rightModal),this._rightModal.opened=!1}async closePopUp(){this.clearContent(this._popUp),this._popUp.opened=!1,this._popUp.useHeader=!0,this._popUp.heightMode="full"}async temOpcional(t){const e=t.split(",");return new Promise(((t,i)=>{this.getAttributeFromHTMLWrapper("opc0009").then((s=>{"1"===s?t(!0):Promise.all(e.map((t=>this.getAttributeFromHTMLWrapper("opc"+t)))).then((e=>{t(e.includes("1"))})).catch((t=>{i(t)}))})).catch((t=>{i(t)}))}))}async getConfig(t){let e={serviceName:"SystemUtilsSP.getConf",requestBody:{config:{chave:t,tipo:"T"}}};return new Promise(((t,i)=>{b.get().callServiceBroker("SystemUtilsSP.getConf",JSON.stringify(e)).then((e=>{var i;return t(null===(i=e.config)||void 0===i?void 0:i.data)})).catch((t=>i(t)))}))}async isFeatureActive(t){const e=Date.now();let i={serviceName:"SystemUtilsSP.featureIsActive",requestBody:{featureName:t}};if(this._featureFlagsCache.get(t)&&e<this._featureFlagsCache.get(t).expires)return Promise.resolve(this._featureFlagsCache.get(t).isActive);const s=(await b.get().callServiceBroker("SystemUtilsSP.featureIsActive",JSON.stringify(i))).isActive;return this._featureFlagsCache.set(t,{isActive:s,expires:e+this.FEATURE_FLAG_CACHE_DURATION}),s}async saveConfig(t,e){let i={serviceName:"SystemUtilsSP.saveConf",requestBody:{config:{chave:t,tipo:"T",data:e}}};return new Promise(((t,e)=>{b.get().callServiceBroker("SystemUtilsSP.saveConf",JSON.stringify(i)).then((e=>t(e))).catch((t=>e(t)))}))}async getAttributeFromHTMLWrapper(t){return Promise.resolve(window[t])}async openApp(t,e){V.openAppActivity(t,e)}async webConnection(t,e,i){this.getStringParam(t).then((t=>{M.webConnectionCaller(t,e,i)}))}getDuPromissesStack(t){let e;return t&&(e=this._duPromises.get(t),e||(e=[],this._duPromises.set(t,e))),e||[]}async createDataunit(t,e,i,s,n){return null==n&&(n=this.applicationResourceID),new Promise(((r,a)=>{const o=this.getDuPromissesStack(e),h=o.length>0;if(o.push(new tt(r,a)),!h){const r=this.dataUnitFetcher.getDataUnit(t,n,i,s);r.loadMetadata().then((()=>{this.processResolveDataUnit(r,e,o)})).catch((t=>{for(;o.length>0;)o.pop().reject(t)}))}}))}processResolveDataUnit(t,e,i){for(e&&this.updateDataunitCache(void 0,e,t);i.length>0;)i.pop().resolve(t)}async updateDataunitCache(t,e,i){t&&this._duCache.delete(t),this._duCache.set(e,i)}async getDataUnit(t,e,i,s,n){return new Promise(((r,a)=>{const o=this._duCache.get(e);o?r(o):this.createDataunit(t,e,i,s,n).then((t=>{r(t)})).catch((t=>a(t)))}))}async addClientEvent(t,e){return new Promise((i=>{b.addClientEvent(t,e),i()}))}async removeClientEvent(t){return new Promise((e=>{b.removeClientEvent(t),e()}))}async hasClientEvent(t){return new Promise((e=>{e(b.hasClientEvent(t))}))}get applicationResourceID(){return this._applicationResourceID||(this._applicationResourceID=this.urlParams.get("workspaceResourceID")||this.urlParams.get("resourceID")||V.resourceID||"unknown.resource.id"),this._applicationResourceID}async getResourceID(){return Promise.resolve(this.applicationResourceID)}async getUserID(){return Promise.resolve(window.UID)}async alert(t,e,i,s){return x.alert(t,e,i,s)}async error(t,e,i,s){return x.error(t,e,i,s)}async success(t,e,i,s){return x.success(t,e,i,s)}async message(t,e,i,s){return x.message(t,e,i,s)}async confirm(t,e,i,s,n){return x.confirm(t,e,i,s,n)}async info(t,e){return x.info(t,e)}async loadTotals(t,e,i){return this.totalsFetcher.fetchTotals(t,e,i)}async isLoadedByPk(){return Promise.resolve(this._isLoadedByPk)}async preloadMangerRemoveRecord(t,e){const i=e.map((t=>({__record__id__:t})));E.removeRecords(t,i)}getCountSkeleton(t,e,i){i=i||160;const s=window.innerHeight-i;return Math.floor(s/(t+(e||10)))-1||1}getSkeletonRandomWidth(){return`${Math.floor(71*Math.random())+30}%`}async getAuthList(t){return await(new j).parseFromJSON(t)}get urlParams(){return this._urlParams||(this._urlParams=I.getQueryParams(location.search)),this._urlParams}getMessage(t,e){var i;return null===(i=this.messagesBuilder)||void 0===i?void 0:i.getMessage(t,e)}get dataUnitFetcher(){return this._dataUnitFetcher||(this._dataUnitFetcher=new C),this._dataUnitFetcher}get totalsFetcher(){return this._totalsFetcher||(this._totalsFetcher=new q),this._totalsFetcher}get pesquisaFetcher(){return this._pesquisaFetcher||(this._pesquisaFetcher=new O),this._pesquisaFetcher}get authFetcher(){return this._authFetcher||(this._authFetcher=new L),this._authFetcher}async executeSearch(t,e,i,s){const n=null==i?void 0:i.getField(e);if(n){const{mode:e,argument:a}=t,{ENTITYNAME:o,CODEFIELD:h,DESCRIPTIONFIELD:l,ROOTENTITY:c,DESCRIPTIONENTITY:d,ISHIERARCHYENTITY:u}=n.properties,p=n.dependencies;let m;const g={rootEntity:c,descriptionFieldName:l,codeFieldName:h,showInactives:!1,dataUnitId:i.dataUnitId};null==p||p.filter((t=>t.masterFields)).forEach((t=>{var e;t.type===y.SEARCHING&&(null===(e=t.masterFields)||void 0===e?void 0:e.length)>0&&(m={expression:t.expression,params:t.masterFields.map((t=>{const e=i.getField(t),s=(null==e?void 0:e.dataType)||v.TEXT,n=s===v.DATE?r.formatDate(new Date(null==e?void 0:e.defaultValue)):null==e?void 0:e.defaultValue,a=i.getFieldValue(t)||n;if(null==a)throw this.alert(this.getMessage("snkApplication.search.error.title"),this.getMessage("snkApplication.search.error.requiredField",{fieldLabel:e.label})),new Error(this.getMessage("snkApplication.search.error.requiredField",{fieldLabel:e.label}));return{name:t,value:a,dataType:s}}))})}));const w={entity:o,entityDescription:d,isHierarchyEntity:u,criteria:m,searchOptions:g,allowsNonAnalytic:null==s?void 0:s.allowsNonAnalytic};return(null==s?void 0:s.useSearchPlus)?this.executePreparedSearchPlus(e,a,w):this.executePreparedSearch(e,a,w)}}filterInvalidFields(t,e,i){return t.fieldsMetadata.filter((s=>{let n=!a.isEmpty(e[s.fieldName])&&!1!==s.visible&&"B"!==s.type&&t.pkField!==s.fieldName&&t.descriptionField!==s.fieldName&&(s.isPrimaryKey||!s.isLinkField)&&!("S"===s.type&&"H"===s.presentationType);return n&&(i[s.fieldName]=s),("string"!=typeof e[s.fieldName]||!(e[s.fieldName].indexOf("<img")>-1||e[s.fieldName].indexOf("<svg")>-1))&&n}))}filterMathFields(t,e,i,s){return t&&Array.isArray(t)&&t.forEach((t=>{let i=m.removeReference(e,s[t]);i&&e.unshift(i)})),e=e.slice(0,i)}builOptionItem(t,e,i,s,n){var r;return{value:a.highlightValue(t,e.__matchFields,null===(r=e[n])||void 0===r?void 0:r.toString(),i,!0),label:s?a.highlightValue(t,e.__matchFields,e[s],i,!0):"",details:p.buildDetails(t,i,e)}}async executePreparedSearchPlus(t,e,i){return await this.executePreparedSearch(t,e,Object.assign(Object.assign({},i),{useSearchPlus:!0}))}async executePreparedSearch(t,e,i){const s={},{entity:n,entityDescription:r,criteria:h,searchOptions:l,isHierarchyEntity:c,allowsNonAnalytic:d,useSearchPlus:g}=i;return g?(async(t,e,i,s,n)=>{var r;const h={},{entity:l,entityDescription:c,criteria:d,searchOptions:g,isHierarchyEntity:w,allowsNonAnalytic:y}=i;if("ADVANCED"===t)return new Promise(((t,i)=>{const r=document.createElement("snk-pesquisa");r[u.DATA_ELEMENT_ID_ATTRIBUTE_NAME]=`entity_${l}`,r.entityName=l,r.argument=e,r.searchLoader=t=>n.loadAdvancedSearch(l,t,d,g),r.isHierarchyEntity=w,w&&(r.treeLoader=t=>n.loadTree(l,t,d,g),r.allowsNonAnalytic=y),r.selectItem=e=>{t(e),s.clearPopUpTitle(),s.closePopUp()},s.setPopUpTitle(c),s.showPopUp(r,void 0,void 0,i)}));if("LOAD_DESCRIPTION"===t){let t=await n.loadByCode(l,e,d,g);t=o.stringToObject(t.json.$);const i=null===(r=t.data)||void 0===r?void 0:r[0];return i?{value:e,label:i[t.descriptionField]}:{value:e,label:""}}{let t,i=await n.loadAdvancedSearch(l,e,d,g,t);i=o.stringToObject(i.json.$);let s=i.descriptionField,r=i.pkField;return i.data.map((t=>{let n=((t,e,i)=>t.fieldsMetadata.filter((s=>{let n=!a.isEmpty(e[s.fieldName])&&!1!==s.visible&&"B"!==s.type&&t.pkField!==s.fieldName&&t.descriptionField!==s.fieldName&&(s.isPrimaryKey||!s.isLinkField)&&!("S"===s.type&&"H"===s.presentationType);return n&&(i[s.fieldName]=s),("string"!=typeof e[s.fieldName]||!Z.some((t=>e[s.fieldName].includes(t))))&&n})))(i,t,h),o=((t,e,i,s)=>(t&&Array.isArray(t)&&t.forEach((t=>{let i=m.removeReference(e,s[t]);i&&e.unshift(i)})),e=e.slice(0,i)))(t.__matchFields,n,6,h);return((t,e,i,s,n)=>{var r;const o=e.__matchFields,h=null!==(r=e[s])&&void 0!==r?r:"",l=e[n];return{value:l,label:h,presentationValue:a.highlightValue(t,o,l,i,!0),presentationLabel:s?a.highlightValue(t,o,h,i,!0):"",details:p.buildDetails(t,i,e)}})(e,t,o,s,r)}))}})(t,e,i,this,this.pesquisaFetcher):new Promise("ADVANCED"===t?(t,i)=>{const s=document.createElement("snk-pesquisa");s[u.DATA_ELEMENT_ID_ATTRIBUTE_NAME]=`entity_${n}`,s.entityName=n,s.argument=e,s.searchLoader=t=>this.pesquisaFetcher.loadAdvancedSearch(n,t,h,l),s.isHierarchyEntity=c,c&&(s.treeLoader=t=>this.pesquisaFetcher.loadTree(n,t,h,l),s.allowsNonAnalytic=d),s.selectItem=e=>{t(e),this.clearPopUpTitle(),this.closePopUp()},this.setPopUpTitle(r),this.showPopUp(s,void 0,void 0,i)}:(t,i)=>{this.pesquisaFetcher.loadAdvancedSearch(n,e,h,l).then((i=>{let n=(i=o.stringToObject(i.json.$)).descriptionField,r=i.pkField;const a=[];i.data.forEach((t=>{let o=this.filterInvalidFields(i,t,s),h=this.filterMathFields(t.__matchFields,o,6,s);a.push(this.builOptionItem(e,t,h,n,r))})),t(a)})).catch((t=>{i(t)}))})}async isDebugMode(){return new Promise((t=>{t(window.isDebugMode)}))}async getAppLabel(){return V.getAppLabel(this.applicationResourceID)}addSearchListener(t,e,i){return new Promise((s=>{s(this.pesquisaFetcher.addSearchListener(t,e.dataUnitId,i))}))}importScript(t){return new Promise((e=>{this.getApplicationPath().then((i=>{let s=[];Array.isArray(t)||(s=[t]),s.forEach((t=>{const e=document.createElement("script");e.src=`${i}/${t}`,e.async=!0,document.body.appendChild(e)})),e()}))}))}async getApplicationPath(){return new Promise((t=>{"dev"===window.applicationenv?t(""):t(`/${this.getModuleName()}/labsApps/${window.APPLICATION_NAME}/build`)}))}getModuleName(){return window.MGE_MODULE_NAME||"mgefin-bff"}executeSelectDistinct(t,e,i){return this.dataUnitFetcher.loadSelectDistinct(t,e,i)}getDataFetcher(){return Promise.resolve(b.get())}async whenApplicationReady(){return f.getContextValue("__SNK__APPLICATION__LOADING__")?Promise.resolve(this):new Promise((t=>{this._waitingAppReady.push((()=>t(this)))}))}async setSearchFilterContext(t,e){f.setContextValue(`__SNK__APPLICATION__FILTER__CONTEXT(${t})__`,e)}clearContent(t){t&&Array.from(t.children).forEach((e=>{t.removeChild(e)}))}async clearPopUpTitle(){this._popUp.ezTitle=""}async setPopUpTitle(t){this._popUp.ezTitle=t}async pkChangeListener(){const t=top.window.location.hash.split("/")[2];if(this._currentPkParameter===t)return;const e=this.getResourceIdFromToken(),i=I.getPkObjectFromUrlToken(top.window.location.hash),s=window.redirectFrom;if(void 0===i)return;if((!s||-1===s.split("_")[0].indexOf(e.split("_")[0]))&&e!==this.applicationResourceID)return;const n={pk:i};if(this._isLoadedByPk=!0,this.loadByPK)return this.loadByPK(n,s),void(this._currentPkParameter=t);this._loadPkParameter={pk:n,redirect:s},this.defaultLoadByPK(n,t)}getResourceIdFromToken(){var t;return(null===(t=top.window.location.pathname)||void 0===t?void 0:t.indexOf("tabContent.jsp"))>-1&&window.location.generateHash?I.getResourceIdFromUrlToken(window.location.generateHash(window.location.hash)):I.getResourceIdFromUrlToken(top.window.location.hash)}defaultLoadByPK(t,e){if(!(null==t?void 0:t.pk))return;const i=this.getFirstDataUnitFromDOM(),s=i.dataUnit;if(!s)return console.warn(this.getMessage("snkApplication.dataUnit.initDataUnitError")),void i.addEventListener("dataUnitReady",(i=>{this.loadDataWithPKFilter(t,i.detail),this._currentPkParameter=e}));this.loadDataWithPKFilter(t,s),this._currentPkParameter=e}loadDataWithPKFilter(t,e){const i={term:"",filter:{name:"LOAD_BY_PK_FILTER",expression:this.buildFilterExpressionByPkObject(t),params:this.getFilterParamsFromPkObject(t,e)}};e.loadData(i)}getFirstDataUnitFromDOM(){let t=this._element.querySelector("snk-data-unit[data-load-by-pk]");if(t||(t=this._element.querySelector("snk-data-unit")),t)return t}getFilterParamsFromPkObject(t,e){var i;const s=[];for(const n in t.pk)t.pk.hasOwnProperty(n)&&!Array.isArray(t.pk[n])&&s.push({name:n,dataType:(null===(i=e.getField(n))||void 0===i?void 0:i.dataType)||this.getDefaultDataTypeLoadByPK(t.pk[n]),value:t.pk[n]});return s}getDefaultDataTypeLoadByPK(t){return"number"==typeof t||t instanceof Number?v.NUMBER:"boolean"==typeof t||t instanceof Boolean?v.BOOLEAN:t instanceof Date?v.DATE:v.TEXT}buildFilterExpressionByPkObject(t){let e="";for(const i in t.pk)a.isEmpty(e)||(e+=" AND "),Array.isArray(t.pk[i])?e+=`${i} IN (${t.pk[i].toString()})`:e+=`${i} = :${i}`;return e}async showNewVersionPopup(){const t=document.createElement("ez-modal-container"),e=await this.getAppLabel();t.modalTitle=this.getMessage("snkApplication.newVersionPopup.title",{screenName:e}),t.okButtonLabel=this.getMessage("snkApplication.newVersionPopup.okButton"),t.cancelButtonLabel=this.getMessage("snkApplication.newVersionPopup.cancelButton");const i=document.createElement("p");i.innerText=this.getMessage("snkApplication.newVersionPopup.info"),i.className="ez-text",t.appendChild(i),t.addEventListener("ezModalAction",this.newVersionPopupEventListener.bind(this));const s=await x.showPopup({content:t});this._removeVersionLayoutPopup=async()=>{await s(),await this.processPendingActions(this.NEW_VERSION_POPUP_LOCKER)}}async newVersionPopupEventListener(t){"LOAD"!==t.detail&&("OK"===t.detail&&V.setScreenToUseV3Layout(),"CANCEL"===t.detail&&V.setScreenToUseOldLayout(),this._popUp.opened=!1,this._removeVersionLayoutPopup&&await this._removeVersionLayoutPopup())}async handleShowNewVersionPopup(){this.hasToShowNewVersionPopup()&&await this.showNewVersionPopup()}hasToShowNewVersionPopup(){const t=new URLSearchParams(window.location.search).get("firstLoadConv");return t&&"S"===t}registerPkChangeListener(){window.hasOwnProperty("onhashchange")?window.onhashchange=this.pkChangeListener.bind(this):setInterval(this.pkChangeListener.bind(this),100)}componentWillLoad(){f.setContextValue("__SNK__APPLICATION__LOADING__",!0),this._errorHandler=new W(this),this.messagesBuilder=new T,f.setContextValue("__EZUI__UPLOAD__ADD__URL__",`${I.getUrlBase()}/mge/upload/file`),f.setContextValue("__EZUI__SEARCH__OPTION__LOADER__",((t,e,i,s)=>this.executeSearch(t,e,i,s))),f.setContextValue("__EZUI__SEARCH__PLUS__OPTION__LOADER__",((t,e,i,s)=>this.executeSearch(t,e,i,Object.assign(Object.assign({},s),{useSearchPlus:!0})))),this.registerPkChangeListener(),P.init(),A.preload(this.applicationResourceID,this.configName,{gridLegacyConfig:this.gridLegacyConfigName,formLegacyConfig:this.formLegacyConfigName}),document.addEventListener("click",(()=>V.applicationClick())),this._waitingAppReady.forEach((t=>t())),this.setLayoutFormConfig()}async setLayoutFormConfig(){const t=await this._formConfigFetcher.fetchLayoutFormConfig("formColCfg."+this.applicationResourceID),e=isNaN(Number(null==t?void 0:t.config))?null:Number(null==t?void 0:t.config);this._LayoutFormConfigSingleton.setConfig(e)}connectedCallback(){this._isBrowserTypeElectron=k.isElectron(),f.setContextValue("__SNK__APPLICATION__",this),b.addRequestListener(this._requestListener)}disconnectedCallback(){null==b||b.removeRequestListener(this._requestListener),this.removeShortcuts(),this._lockManagerTimer&&clearTimeout(this._lockManagerTimer),this._scrimWindowTimer&&clearTimeout(this._scrimWindowTimer)}async componentDidLoad(){this.applicationLoading.emit(!0),window.requestAnimationFrame((()=>{f.setContextValue("__SNK__APPLICATION__LOADING__",!1),this.applicationLoaded.emit(!0),this.pkChangeListener()})),u.addIDInfo(this._element,`resource_${this.applicationResourceID}`),await this.handleShowNewVersionPopup(),this.initKeyboardManager(),this.enableLockManagerLoadingApp?(z.addLockManagerCtxId(this._element),this.resolveApplicationReady()):this._applicationReady=!0}async showScrimApp(t){if(!this.enableLockManagerLoadingApp||!this._applicationReady||!t)return this._activeScrimWindow=!1,void(this._scrimWindowTimer&&clearTimeout(this._scrimWindowTimer));this._activeScrimWindow=!0,this._scrimWindowTimer=setTimeout((async()=>{this._activeScrimWindow&&(this._activeScrimWindow=!1,clearTimeout(this._scrimWindowTimer))}),this._maxTimerAppLoading)}async changeTemplateSkeleton(t){this._templateSkeleton=t||this._templateSkeleton}async markToReload(t){this.enableLockManagerLoadingApp&&(await this.changeTemplateSkeleton(t),this._applicationReady=!1,await z.resetLocks(this._element,_.APP_LOADING),this.resolveApplicationReady())}async addLoadingLock(t=!1,e){if(this.enableLockManagerLoadingApp)return await this.changeTemplateSkeleton(e),t&&(this._applicationReady=!1,this._activeScrimWindow=!!this._applicationReady,await z.resetLocks(this._element,_.APP_LOADING)),this.resolveApplicationReady(),await z.lock(this._element,_.APP_LOADING)}async resolveApplicationReady(){if(!this._applicationReady)try{await this.checkTimeoutLimitLockManager(),await z.whenHasLock(this._element,_.APP_LOADING),await z.whenResolve(this._element,_.APP_LOADING,200),await z.resetLocks(this._element,_.APP_LOADING),this._applicationReady=!0}catch(t){console.warn(t),this._applicationReady=!0}}stopTimeoutLockManager(){this._lockManagerTimer&&clearTimeout(this._lockManagerTimer)}async checkTimeoutLimitLockManager(){this.stopTimeoutLockManager(),this._applicationReady||(this._lockManagerTimer=setTimeout((async()=>{this._applicationReady||(await z.resetLocks(this._element,_.APP_LOADING),this.stopTimeoutLockManager(),this._applicationReady=!0)}),this._maxTimerAppLoading))}initKeyboardManager(){this._keyboardManager.bind("ctrl + g",V.searchApp.bind(this),{description:this.getMessage("snkApplication.keyboard.shortcuts.searchApp")}).bind("ctrl + d",V.showDesktop.bind(this),{description:this.getMessage("snkApplication.keyboard.shortcuts.showDesktop")}).bind("F1",V.openHelp.bind(this),{description:this.getMessage("snkApplication.keyboard.shortcuts.openHelp")})}removeShortcuts(){this._keyboardManager.unbindAllShortcutKeys()}renderLoadingSkeleton(){if(this.enableLockManagerLoadingApp){if(this._isBrowserTypeElectron)return this.getSpinnerLoadingDefault();switch(this._templateSkeleton){case D.CUSTOM_TEMPLATE:case D.GRID:return this.getSkeletonTemplateGrid();case D.GRID_WITH_SIDEBAR:return this.getSkeletonTemplateGridWithSidebar();case D.GRID_WITH_PANEL:return this.getSkeletonTemplateGridWithPanel();case D.FORM_WITH_SIDEBAR:return this.getSkeletonTemplateFormWithSidebar();default:return this.getSkeletonTemplateGrid()}}}getLoadingVisibilityStyle(){return{visibility:this._applicationReady?"hidden":"initial",display:this._applicationReady?"none":"unset"}}getSkeletonTemplateGrid(){return i("div",{class:"loading-hidden",style:this.getLoadingVisibilityStyle()},i("div",{class:"ez-flex ez-flex--column ez-margin--large ez-margin-top--medium"},i("div",{class:"ez-margin-bottom--medium"},i("ez-skeleton",{count:1,variant:"text",width:"20%",height:"35px",animation:"progress"})),i("div",{class:""},i("ez-skeleton",{count:1,variant:"text",width:"70%",height:"25px",animation:"progress"}))),i("div",{class:"ez-flex ez-flex--justify-start skeleton-content-column ez-margin-horizontal--large",style:{height:"calc(-105px + 100vh)"}},[1,2,3,4].map(((t,e)=>i("div",{class:"ez-margin-right--large",key:e,style:{width:"25%"}},i("ez-skeleton",{count:this.getCountSkeleton(50,10),variant:"text",width:"100%",height:"50px",animation:"progress",marginBottom:"10px"}))))))}getSkeletonTemplateGridWithSidebar(){return i("div",{class:"loading-hidden",style:this.getLoadingVisibilityStyle()},i("div",{class:"ez-flex ez-flex--column ez-margin--large ez-margin-top--medium"},i("div",{class:"ez-margin-bottom--medium"},i("ez-skeleton",{count:1,variant:"text",width:"20%",height:"35px",animation:"progress"})),i("div",{class:""},i("ez-skeleton",{count:1,variant:"text",width:"70%",height:"25px",animation:"progress"}))),i("div",{class:"ez-flex ez-flex--justify-start skeleton-content-column ez-margin-horizontal--large",style:{height:"calc(100vh - 160px)"}},i("div",{class:"ez-flex ez-flex--column ez-margin-right--large",style:{width:"25%",overflow:"hidden"}},Array(this.getCountSkeleton(30,6)).fill(null).map(((t,e)=>i("ez-skeleton",{key:e,count:1,variant:"text",width:this.getSkeletonRandomWidth(),height:"30px",animation:"progress",marginBottom:"10px"})))),i("div",{class:"ez-margin-right--large",style:{width:"75%"}},i("ez-skeleton",{count:this.getCountSkeleton(50,10),variant:"text",width:"100%",height:"50px",animation:"progress",marginBottom:"10px"}))))}getSkeletonTemplateGridWithPanel(){return i("div",{class:"loading-hidden",style:this.getLoadingVisibilityStyle()},i("div",{class:"ez-margin--medium ez-margin-top--medium ez-padding--medium"},i("ez-skeleton",{count:1,variant:"text",width:"70%",height:"25px",animation:"progress"})),i("div",{class:"ez-flex ez-margin--medium ez-margin-top--medium",style:{maxHeight:"calc(-105px + 100vh)",overflow:"hidden"}},i("div",{class:"",style:{width:"70%",overflow:"hidden"}},i("div",{class:"ez-padding--medium",style:{height:"50%"}},i("ez-skeleton",{count:1,variant:"text",width:"100%",height:"100%",animation:"progress"})),i("div",{class:"ez-padding--medium",style:{}},i("ez-skeleton",{count:1,variant:"text",width:"250px",height:"25px",animation:"progress"})),i("div",{class:"ez-flex ez-padding--medium",style:{height:"45%"}},[1,2].map((()=>i("div",{style:{width:"50%"}},i("ez-skeleton",{count:1,variant:"text",width:"100%",height:"100%",animation:"progress"})))))),i("div",{class:"ez-flex ez-flex--column ez-padding--medium",style:{width:"30%",overflow:"hidden"}},Array(this.getCountSkeleton(30,10)).fill(null).map(((t,e)=>i("ez-skeleton",{key:e,count:1,variant:"text",width:"100%",height:"50px",animation:"progress",marginBottom:"10px"}))))))}getSkeletonTemplateFormWithSidebar(){return i("div",{class:"loading-hidden",style:this.getLoadingVisibilityStyle()},i("div",{class:"ez-margin--medium ez-margin-top--medium ez-padding--medium"},i("ez-skeleton",{count:1,variant:"text",width:"70%",height:"25px",animation:"progress"})),i("div",{class:"ez-flex ez-margin--medium ez-margin-top--medium",style:{maxHeight:"calc(-105px + 100vh)",overflow:"hidden"}},i("div",{class:"ez-flex ez-flex--column ez-margin-right--large",style:{width:"25%",overflow:"hidden"}},Array(this.getCountSkeleton(30,6)).fill(null).map(((t,e)=>i("ez-skeleton",{key:e,count:1,variant:"text",width:this.getSkeletonRandomWidth(),height:"30px",animation:"progress",marginBottom:"10px"})))),i("div",{class:"ez-flex ez-flex--column",style:{width:"75%"}},i("div",{class:"ez-padding--medium",style:{width:"100%"}},i("ez-skeleton",{count:1,variant:"text",width:"30%",height:"25px",animation:"progress"})),i("div",{class:"ez-padding--medium",style:{height:"45%"}},i("div",{class:"ez-flex",style:{width:"100%",height:"100%"}},[1,2,3,4].map(((t,e)=>i("div",{key:e,class:"ez-padding-right--large",style:{width:"25%",overflow:"hidden"}},Array(this.getCountSkeleton(50,20)).fill(null).map(((t,e)=>i("ez-skeleton",{key:e,count:1,variant:"text",width:"100%",height:"50px",animation:"progress",marginBottom:"10px"})))))))),i("div",{class:"ez-padding--medium",style:{width:"100%"}},i("ez-skeleton",{count:1,variant:"text",width:"30%",height:"25px",animation:"progress"})),i("div",{class:"ez-padding--medium",style:{height:"45%"}},i("div",{class:"ez-flex",style:{width:"100%",height:"100%"}},[1,2,3,4].map(((t,e)=>i("div",{key:e,class:"ez-padding-right--large",style:{width:"25%",overflow:"hidden"}},Array(this.getCountSkeleton(50,20)).fill(null).map(((t,e)=>i("ez-skeleton",{key:e,count:1,variant:"text",width:"100%",height:"50px",animation:"progress",marginBottom:"10px"})))))))))))}getSpinnerLoadingDefault(){return i("div",{class:"loading-hidden",style:this.getLoadingVisibilityStyle()},i("div",{class:"ez-flex ez-size-height--full ez-size-width--full ez-flex--justify-center ez-flex--align-items-center spinner"},i("ez-icon",{iconName:"sync",size:"x-large",class:"spin"}),i("span",{class:"ez-title ez-title--secondary ez-title--extra-large"},this.getMessage("snkApplication.loading.text"))))}render(){return i(s,{style:{visibility:!this.enableLockManagerLoadingApp||this._applicationReady?"unset":"hidden",overflow:!this.enableLockManagerLoadingApp||this._applicationReady?"unset":"hidden"}},i("div",null,i("ez-loading-bar",{ref:t=>this._requestListener.ezLoadingBar=t}),i("ez-popup",{opened:!1,ref:t=>this._popUp=t,onEzClosePopup:()=>this.closePopUp()}),i("ez-modal",{opened:!1,ref:t=>this._rightModal=t,"modal-size":"small",closeOutsideClick:!0,closeEsc:!0}),this.renderLoadingSkeleton(),this._activeScrimWindow&&i("div",{class:"ez-scrim ez-scrim--light",style:{cursor:"progress",zIndex:"var(--scrim-z-index)"}})))}get _element(){return n(this)}static get watchers(){return{loadByPK:["watchPropHandler"]}}};class tt{constructor(t,e){this.resolve=t,this.reject=e}}Q.style=".sc-snk-application-h{--scrim-z-index:var(--elevation--100, 100);display:flex;flex-direction:column;height:100%}.sc-snk-application-h>.loading-hidden.sc-snk-application{display:none;pointer-events:none}.skeleton-content-left.sc-snk-application{width:300px;padding-right:5px}.skeleton-content.sc-snk-application{height:calc(100vh - 310px)}.spinner.sc-snk-application{height:100vh;gap:10px}.spinner.sc-snk-application>.spin.sc-snk-application{animation-name:spin;animation-duration:5000ms;animation-iteration-count:infinite;animation-timing-function:linear}@keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}";export{Q as snk_application}
11
+ }`)}fetchTotals(t,e,i=[]){const s=`${t}_${e}`,n=this.cancel.findIndex((t=>t[s]));return n>=0&&(this.cancel[n][s](),this.cancel.splice(n,1)),Promise.race([new Promise((t=>this.cancel.push({[s]:t}))),this.getTotals(t,e,i)]).then((t=>{let e=new Map;if(t){e=t;const i=this.cancel.findIndex((t=>t[s]));i>=0&&this.cancel.splice(i,1)}return e}))}getTotals(t,e,i=[]){return new Promise(((s,n)=>{b.get().callGraphQL({query:this.templateByQuery.get("fetchTotals"),values:{name:`totals://${t}/${e}`,filters:i}}).then((t=>{if(t.length>0){const e=new Map;return t.forEach((t=>e.set(t.name,parseFloat(t.value)))),s(e)}return n("Não foi possível recuperar os totalizadores")})).catch(n)}))}}var K;class V{static openAppActivity(t,e){var i;null===(i=window.workspace)||void 0===i||i.openAppActivity(t,e)}static getAppLabel(t){if(null!=(null===window||void 0===window?void 0:window.workspace))return null==window.workspace.getAppLabel&&(window.workspace.getAppLabel=t=>(t||"").split(".").pop()),window.workspace.getAppLabel(t)}static setScreenToUseV3Layout(){var t;null===(t=window.workspace)||void 0===t||t.setScreenToUseV3Layout()}static setScreenToUseOldLayout(){var t;null===(t=window.workspace)||void 0===t||t.setScreenToUseOldLayout()}static showDesktop(){var t,e;null===(e=null===(t=window.workspace)||void 0===t?void 0:t.showDesktop)||void 0===e||e.call(t)}static searchApp(){var t,e;null===(e=null===(t=window.workspace)||void 0===t?void 0:t.searchApp)||void 0===e||e.call(t)}static openHelp(){var t,e;null===(e=null===(t=window.workspace)||void 0===t?void 0:t.openHelp)||void 0===e||e.call(t)}static applicationClick(){var t,e;(null===(t=window.workspace)||void 0===t?void 0:t.applicationClick)&&(null===(e=window.workspace)||void 0===e||e.applicationClick())}}V.resourceID=null===(K=window.workspace)||void 0===K?void 0:K.resourceID;class W{constructor(t){this._app=t,window.addEventListener("error",(t=>this.errorHandler(t))),window.addEventListener("unhandledrejection",(t=>this.rejectionHandler(t)))}getMessage(t,e){return this._app.messagesBuilder.getMessage(t,e)}rejectionHandler(t){const e=t.reason;e instanceof h||(e?this.processException(e):this._app.isDebugMode().then((t=>{t&&this._app.error(this.getMessage("snkErrorHandler.title.promiseRejected"),this.getMessage("snkErrorHandler.message.undeterminedPromiseRejection"))})))}errorHandler(t){this.processException(t.error)}buildErrorCodeHTML(t){return`<br><a href="#" onclick="try{window.workspace.openHelp('_tbcode:${t}')} catch(e){alert('${this.getMessage("snkErrorHandler.message.cannotOpenHelp")}');}">${this.getMessage("snkErrorHandler.errorCode.label")}${t}</a>`}processException(t){t.errorCode&&(t.message+=this.buildErrorCodeHTML(t.errorCode)),t instanceof l?console.warn(this.getMessage("snkErrorHandler.message.silentExceptionIgnored"),t):t instanceof h||t instanceof c?this._app.alert(t.title,t.message):t instanceof d?this._app.error(t.title,t.message):this._app.isDebugMode().then((e=>{if(e)if(t instanceof Error)this._app.error(t.name,t.message);else{const e=(null==t?void 0:t.title)||this.getMessage("snkErrorHandler.title.errorDetected",void 0),i="string"==typeof t?t:t.message||`${this.getMessage("snkErrorHandler.error.internal")} "${o.objectToString(t)}"`;this._app.error(e,i)}}))}}class G{constructor(){this._debounceTime=1500,this.requests=new Map,this.requestsLoadingBar=[]}onRequestStart(t){if(t.url.includes("quietMode=true"))return;this.requestsLoadingBar.push(t.requestId);const e=setTimeout((()=>{this.ezLoadingBar.show()}),this._debounceTime);this.requests.set(t.requestId,e)}onRequestEnd(t){var e,i,s;const n=this.requests.get(t.requestId);clearTimeout(n),(null===(e=this.requestsLoadingBar)||void 0===e?void 0:e.includes(t.requestId))&&(this.requestsLoadingBar=null===(i=this.requestsLoadingBar)||void 0===i?void 0:i.filter((e=>e!==t.requestId)),!this.requestsLoadingBar.length&&(null===(s=this.ezLoadingBar)||void 0===s||s.hide()))}}class J{constructor(){this._debounceTime=1e3,this._ignoredNameTypes=["totals"],this._countRequest=0}onRequestStart(t){this.isIgnoreLoadingOnRequest(t)||(this._countRequest++,this.ezLoadingBar.show(),this._timerLoading&&clearTimeout(this._timerLoading))}onRequestEnd(t){this.isIgnoreLoadingOnRequest(t)||(this._countRequest--,this._timerLoading=setTimeout((()=>{this._countRequest<=0&&this.ezLoadingBar.hide()}),this._debounceTime))}isIgnoreLoadingOnRequest(t){if(null==t)return!1;if(t.url.includes("quietMode=true"))return!0;if(null==t.requestBody)return!1;if(1==t.requestBody.length){const{name:e}=t.requestBody[0].variables;if(e){const t=e.split(":");return this._ignoredNameTypes.indexOf(t[0])>=0}}return!1}}class Y{static create({strategy:t}){switch(t){case"request_name":return new J;case"request_time":return new G;default:throw new Error("Strategy not found")}}}const Z=["<img","<svg"];class X{constructor(){this._config=null,this.listeners=[]}static getInstance(){return X.instance||(X.instance=new X),X.instance}get config(){return this._config}setConfig(t){this._config=t,this.notifyListeners()}onConfigChange(t){this.listeners.push(t)}notifyListeners(){this.listeners.forEach((t=>t(this._config)))}}const Q=class{constructor(i){t(this,i),this.applicationLoaded=e(this,"applicationLoaded",7),this.applicationLoading=e(this,"applicationLoading",7),this.NEW_VERSION_POPUP_LOCKER="NEW_VERSION_POPUP_LOCKER",this.FEATURE_FLAG_CACHE_DURATION=36e5,this._authPromises=[],this._keyboardManager=new g,this._waitingAppReady=new Array,this._duCache=new Map,this._duPromises=new Map,this._requestListener=Y.create({strategy:"request_time"}),this._maxTimerAppLoading=1e4,this._featureFlagsCache=new Map,this._isBrowserTypeElectron=!1,this._pendingActions=new Map,this._loadPkParameter=null,this._isLoadedByPk=!1,this._formConfigFetcher=new R,this._LayoutFormConfigSingleton=X.getInstance(),this._applicationReady=!1,this._templateSkeleton=D.GRID,this._activeScrimWindow=!1,this.enableLockManagerLoadingApp=void 0,this.messagesBuilder=void 0,this.configName=void 0,this.gridLegacyConfigName=void 0,this.formLegacyConfigName=void 0,this.loadByPK=void 0}async processPendingActions(t){const e=this._pendingActions.get(t);e&&e.length&&(e.forEach((t=>t())),this._pendingActions.set(t,[]))}get parameters(){return this._parameters||(this._parameters=new B),this._parameters}async getAuth(t){return null==t?this.getApplicationAuth():new Promise(((e,i)=>{this.authFetcher.getData(t).then((t=>{e(t)})).catch((t=>{i(t)}))}))}async getApplicationAuth(){return this._auth?Promise.resolve(this._auth):new Promise(((t,e)=>{const i=this._authPromises.length>0;this._authPromises.push(new tt(t,e)),i||this.authFetcher.getData(this.applicationResourceID).then((t=>{for(this._auth=t;this._authPromises.length>0;)this._authPromises.pop().resolve(this._auth)})).catch((t=>{for(;this._authPromises.length>0;)this._authPromises.pop().reject(t)}))}))}watchPropHandler(t,e){t&&this._loadPkParameter&&(this.loadByPK(this._loadPkParameter.pk,this._loadPkParameter.redirect),this._loadPkParameter=null)}async getKeyboardManager(){return Promise.resolve(this._keyboardManager)}async getLayoutFormConfig(){return Promise.resolve(this._LayoutFormConfigSingleton)}async isUserSup(){return new Promise(((t,e)=>{this.getAuth().then((i=>{this.getAuthList(i).then((e=>{t(e.isSup)})).catch((t=>e(t)))}))}))}async addPendingAction(t,e){var i;const s=null!==(i=this._pendingActions.get(t))&&void 0!==i?i:[];this._pendingActions.set(t,[...s,e])}async callServiceBroker(t,e,i){return b.get().callServiceBroker(t,e,i)}async initOnboarding(t){this.hasToShowNewVersionPopup()?await this.addPendingAction(this.NEW_VERSION_POPUP_LOCKER,(()=>this.doInitOnboarding(t))):this.doInitOnboarding(t)}doInitOnboarding(t){w.getInstance().init(t,window.envContext)}async hasAccess(t,e){return new Promise(((i,s)=>{this.getAuth(e).then((e=>{this.getAuthList(e).then((e=>{i(e.isSup||e.actions[t])})).catch((t=>s(t)))}))}))}async getAllAccess(t){return new Promise(((e,i)=>{this.getAuth(t).then((t=>{this.getAuthList(t).then((t=>{const i={};i.isSup=t.isSup,Object.entries(N).forEach((e=>{i[e[0]]=e[1]===N.CLONE?t.actions[N.INSERT]&&t.actions[N.CLONE]||!1:t.actions[e[1]]||!1})),e(i)})).catch((t=>i(t)))}))}))}async getStringParam(t){return this.parameters.asString(t)}async getIntParam(t){return this.parameters.asInteger(t)}async getFloatParam(t){return this.parameters.asFloat(t)}async getBooleanParam(t){return this.parameters.asBoolean(t)}async getDateParam(t){return this.parameters.asDate(t)}async showPopUp(t,e="full",i=!0,s){this.clearContent(this._popUp),this._popUp.addEventListener("ezClosePopup",(()=>{s()}),{once:!0}),this._popUp.appendChild(t),this._popUp.opened=!0,this._popUp.heightMode=e,this._popUp.useHeader=i,"EZ-MODAL-CONTAINER"===t.tagName&&(this._popUp.useHeader=!1)}async showModal(t){this.clearContent(this._rightModal),this._rightModal.appendChild(t),this._rightModal.opened=!0}showAlerts(t){return x.showAlerts({alerts:t})}async closeModal(){this.clearContent(this._rightModal),this._rightModal.opened=!1}async closePopUp(){this.clearContent(this._popUp),this._popUp.opened=!1,this._popUp.useHeader=!0,this._popUp.heightMode="full"}async temOpcional(t){const e=t.split(",");return new Promise(((t,i)=>{this.getAttributeFromHTMLWrapper("opc0009").then((s=>{"1"===s?t(!0):Promise.all(e.map((t=>this.getAttributeFromHTMLWrapper("opc"+t)))).then((e=>{t(e.includes("1"))})).catch((t=>{i(t)}))})).catch((t=>{i(t)}))}))}async getConfig(t){let e={serviceName:"SystemUtilsSP.getConf",requestBody:{config:{chave:t,tipo:"T"}}};return new Promise(((t,i)=>{b.get().callServiceBroker("SystemUtilsSP.getConf",JSON.stringify(e)).then((e=>{var i;return t(null===(i=e.config)||void 0===i?void 0:i.data)})).catch((t=>i(t)))}))}async isFeatureActive(t){const e=Date.now();let i={serviceName:"SystemUtilsSP.featureIsActive",requestBody:{featureName:t}};if(this._featureFlagsCache.get(t)&&e<this._featureFlagsCache.get(t).expires)return Promise.resolve(this._featureFlagsCache.get(t).isActive);const s=(await b.get().callServiceBroker("SystemUtilsSP.featureIsActive",JSON.stringify(i))).isActive;return this._featureFlagsCache.set(t,{isActive:s,expires:e+this.FEATURE_FLAG_CACHE_DURATION}),s}async saveConfig(t,e){let i={serviceName:"SystemUtilsSP.saveConf",requestBody:{config:{chave:t,tipo:"T",data:e}}};return new Promise(((t,e)=>{b.get().callServiceBroker("SystemUtilsSP.saveConf",JSON.stringify(i)).then((e=>t(e))).catch((t=>e(t)))}))}async getAttributeFromHTMLWrapper(t){return Promise.resolve(window[t])}async openApp(t,e){V.openAppActivity(t,e)}async webConnection(t,e,i){this.getStringParam(t).then((t=>{M.webConnectionCaller(t,e,i)}))}getDuPromissesStack(t){let e;return t&&(e=this._duPromises.get(t),e||(e=[],this._duPromises.set(t,e))),e||[]}async createDataunit(t,e,i,s,n){return null==n&&(n=this.applicationResourceID),new Promise(((r,a)=>{const o=this.getDuPromissesStack(e),h=o.length>0;if(o.push(new tt(r,a)),!h){const r=this.dataUnitFetcher.getDataUnit(t,n,i,s);r.loadMetadata().then((()=>{this.processResolveDataUnit(r,e,o)})).catch((t=>{for(;o.length>0;)o.pop().reject(t)}))}}))}processResolveDataUnit(t,e,i){for(e&&this.updateDataunitCache(void 0,e,t);i.length>0;)i.pop().resolve(t)}async updateDataunitCache(t,e,i){t&&this._duCache.delete(t),this._duCache.set(e,i)}async getDataUnit(t,e,i,s,n){return new Promise(((r,a)=>{const o=this._duCache.get(e);o?r(o):this.createDataunit(t,e,i,s,n).then((t=>{r(t)})).catch((t=>a(t)))}))}async addClientEvent(t,e){return new Promise((i=>{b.addClientEvent(t,e),i()}))}async removeClientEvent(t){return new Promise((e=>{b.removeClientEvent(t),e()}))}async hasClientEvent(t){return new Promise((e=>{e(b.hasClientEvent(t))}))}get applicationResourceID(){return this._applicationResourceID||(this._applicationResourceID=this.urlParams.get("workspaceResourceID")||this.urlParams.get("resourceID")||V.resourceID||"unknown.resource.id"),this._applicationResourceID}async getResourceID(){return Promise.resolve(this.applicationResourceID)}async getUserID(){return Promise.resolve(window.UID)}async alert(t,e,i,s){return x.alert(t,e,i,s)}async error(t,e,i,s){return x.error(t,e,i,s)}async success(t,e,i,s){return x.success(t,e,i,s)}async message(t,e,i,s){return x.message(t,e,i,s)}async confirm(t,e,i,s,n){return x.confirm(t,e,i,s,n)}async info(t,e){return x.info(t,e)}async loadTotals(t,e,i){return this.totalsFetcher.fetchTotals(t,e,i)}async isLoadedByPk(){return Promise.resolve(this._isLoadedByPk)}async preloadMangerRemoveRecord(t,e){const i=e.map((t=>({__record__id__:t})));E.removeRecords(t,i)}getCountSkeleton(t,e,i){i=i||160;const s=window.innerHeight-i;return Math.floor(s/(t+(e||10)))-1||1}getSkeletonRandomWidth(){return`${Math.floor(71*Math.random())+30}%`}async getAuthList(t){return await(new j).parseFromJSON(t)}get urlParams(){return this._urlParams||(this._urlParams=I.getQueryParams(location.search)),this._urlParams}getMessage(t,e){var i;return null===(i=this.messagesBuilder)||void 0===i?void 0:i.getMessage(t,e)}get dataUnitFetcher(){return this._dataUnitFetcher||(this._dataUnitFetcher=new O),this._dataUnitFetcher}get totalsFetcher(){return this._totalsFetcher||(this._totalsFetcher=new q),this._totalsFetcher}get pesquisaFetcher(){return this._pesquisaFetcher||(this._pesquisaFetcher=new C),this._pesquisaFetcher}get authFetcher(){return this._authFetcher||(this._authFetcher=new L),this._authFetcher}async executeSearch(t,e,i,s){const n=null==i?void 0:i.getField(e);if(n){const{mode:e,argument:a}=t,{ENTITYNAME:o,CODEFIELD:h,DESCRIPTIONFIELD:l,ROOTENTITY:c,DESCRIPTIONENTITY:d,ISHIERARCHYENTITY:u}=n.properties,p=n.dependencies;let m;const g={rootEntity:c,descriptionFieldName:l,codeFieldName:h,showInactives:!1,dataUnitId:i.dataUnitId};null==p||p.filter((t=>t.masterFields)).forEach((t=>{var e;t.type===y.SEARCHING&&(null===(e=t.masterFields)||void 0===e?void 0:e.length)>0&&(m={expression:t.expression,params:t.masterFields.map((t=>{const e=i.getField(t),s=(null==e?void 0:e.dataType)||v.TEXT,n=s===v.DATE?r.formatDate(new Date(null==e?void 0:e.defaultValue)):null==e?void 0:e.defaultValue,a=i.getFieldValue(t)||n;if(null==a)throw this.alert(this.getMessage("snkApplication.search.error.title"),this.getMessage("snkApplication.search.error.requiredField",{fieldLabel:e.label})),new Error(this.getMessage("snkApplication.search.error.requiredField",{fieldLabel:e.label}));return{name:t,value:a,dataType:s}}))})}));const w={entity:o,entityDescription:d,isHierarchyEntity:u,criteria:m,searchOptions:g,allowsNonAnalytic:null==s?void 0:s.allowsNonAnalytic};return(null==s?void 0:s.useSearchPlus)?this.executePreparedSearchPlus(e,a,w):this.executePreparedSearch(e,a,w)}}filterInvalidFields(t,e,i){return t.fieldsMetadata.filter((s=>{let n=!a.isEmpty(e[s.fieldName])&&!1!==s.visible&&"B"!==s.type&&t.pkField!==s.fieldName&&t.descriptionField!==s.fieldName&&(s.isPrimaryKey||!s.isLinkField)&&!("S"===s.type&&"H"===s.presentationType);return n&&(i[s.fieldName]=s),("string"!=typeof e[s.fieldName]||!(e[s.fieldName].indexOf("<img")>-1||e[s.fieldName].indexOf("<svg")>-1))&&n}))}filterMathFields(t,e,i,s){return t&&Array.isArray(t)&&t.forEach((t=>{let i=m.removeReference(e,s[t]);i&&e.unshift(i)})),e=e.slice(0,i)}builOptionItem(t,e,i,s,n){var r;return{value:a.highlightValue(t,e.__matchFields,null===(r=e[n])||void 0===r?void 0:r.toString(),i,!0),label:s?a.highlightValue(t,e.__matchFields,e[s],i,!0):"",details:p.buildDetails(t,i,e)}}async executePreparedSearchPlus(t,e,i){return await this.executePreparedSearch(t,e,Object.assign(Object.assign({},i),{useSearchPlus:!0}))}async executePreparedSearch(t,e,i){var s;const n={},{entity:r,entityDescription:h,criteria:l,searchOptions:c,isHierarchyEntity:d,allowsNonAnalytic:g,useSearchPlus:w}=i;if(w)return(async(t,e,i,s,n)=>{var r;const h={},{entity:l,entityDescription:c,criteria:d,searchOptions:g,isHierarchyEntity:w,allowsNonAnalytic:y}=i;if("ADVANCED"===t)return new Promise(((t,i)=>{const r=document.createElement("snk-pesquisa");r[u.DATA_ELEMENT_ID_ATTRIBUTE_NAME]=`entity_${l}`,r.entityName=l,r.argument=e,r.searchLoader=t=>n.loadAdvancedSearch(l,t,d,g),r.isHierarchyEntity=w,w&&(r.treeLoader=t=>n.loadTree(l,t,d,g),r.allowsNonAnalytic=y),r.selectItem=e=>{t(e),s.clearPopUpTitle(),s.closePopUp()},s.setPopUpTitle(c),s.showPopUp(r,void 0,void 0,i)}));if("LOAD_DESCRIPTION"===t){let t=await n.loadByCode(l,e,d,g);t=o.stringToObject(t.json.$);const i=null===(r=t.data)||void 0===r?void 0:r[0];return i?{value:e,label:i[t.descriptionField]}:{value:e,label:""}}{let t,i=await n.loadAdvancedSearch(l,e,d,g,t);i=o.stringToObject(i.json.$);let s=i.descriptionField,r=i.pkField;return i.data.map((t=>{let n=((t,e,i)=>t.fieldsMetadata.filter((s=>{let n=!a.isEmpty(e[s.fieldName])&&!1!==s.visible&&"B"!==s.type&&t.pkField!==s.fieldName&&t.descriptionField!==s.fieldName&&(s.isPrimaryKey||!s.isLinkField)&&!("S"===s.type&&"H"===s.presentationType);return n&&(i[s.fieldName]=s),("string"!=typeof e[s.fieldName]||!Z.some((t=>e[s.fieldName].includes(t))))&&n})))(i,t,h),o=((t,e,i,s)=>(t&&Array.isArray(t)&&t.forEach((t=>{let i=m.removeReference(e,s[t]);i&&e.unshift(i)})),e=e.slice(0,i)))(t.__matchFields,n,6,h);return((t,e,i,s,n)=>{var r;const o=e.__matchFields,h=null!==(r=e[s])&&void 0!==r?r:"",l=e[n];return{value:l,label:h,presentationValue:a.highlightValue(t,o,l,i,!0),presentationLabel:s?a.highlightValue(t,o,h,i,!0):"",details:p.buildDetails(t,i,e)}})(e,t,o,s,r)}))}})(t,e,i,this,this.pesquisaFetcher);if("LOAD_DESCRIPTION"===t){let t=await this.pesquisaFetcher.loadByCode(r,e,l,c);t=o.stringToObject(t.json.$);const i=null===(s=t.data)||void 0===s?void 0:s[0];return i?{value:e,label:i[t.descriptionField]}:{value:e,label:""}}return new Promise("ADVANCED"===t?(t,i)=>{const s=document.createElement("snk-pesquisa");s[u.DATA_ELEMENT_ID_ATTRIBUTE_NAME]=`entity_${r}`,s.entityName=r,s.argument=e,s.searchLoader=t=>this.pesquisaFetcher.loadAdvancedSearch(r,t,l,c),s.isHierarchyEntity=d,d&&(s.treeLoader=t=>this.pesquisaFetcher.loadTree(r,t,l,c),s.allowsNonAnalytic=g),s.selectItem=e=>{t(e),this.clearPopUpTitle(),this.closePopUp()},this.setPopUpTitle(h),this.showPopUp(s,void 0,void 0,i)}:(t,i)=>{this.pesquisaFetcher.loadAdvancedSearch(r,e,l,c).then((i=>{let s=(i=o.stringToObject(i.json.$)).descriptionField,r=i.pkField;const a=[];i.data.forEach((t=>{let o=this.filterInvalidFields(i,t,n),h=this.filterMathFields(t.__matchFields,o,6,n);a.push(this.builOptionItem(e,t,h,s,r))})),t(a)})).catch((t=>{i(t)}))})}async isDebugMode(){return new Promise((t=>{t(window.isDebugMode)}))}async getAppLabel(){return V.getAppLabel(this.applicationResourceID)}addSearchListener(t,e,i){return new Promise((s=>{s(this.pesquisaFetcher.addSearchListener(t,e.dataUnitId,i))}))}importScript(t){return new Promise((e=>{this.getApplicationPath().then((i=>{let s=[];Array.isArray(t)||(s=[t]),s.forEach((t=>{const e=document.createElement("script");e.src=`${i}/${t}`,e.async=!0,document.body.appendChild(e)})),e()}))}))}async getApplicationPath(){return new Promise((t=>{"dev"===window.applicationenv?t(""):t(`/${this.getModuleName()}/labsApps/${window.APPLICATION_NAME}/build`)}))}getModuleName(){return window.MGE_MODULE_NAME||"mgefin-bff"}executeSelectDistinct(t,e,i){return this.dataUnitFetcher.loadSelectDistinct(t,e,i)}getDataFetcher(){return Promise.resolve(b.get())}async whenApplicationReady(){return f.getContextValue("__SNK__APPLICATION__LOADING__")?Promise.resolve(this):new Promise((t=>{this._waitingAppReady.push((()=>t(this)))}))}async setSearchFilterContext(t,e){f.setContextValue(`__SNK__APPLICATION__FILTER__CONTEXT(${t})__`,e)}clearContent(t){t&&Array.from(t.children).forEach((e=>{t.removeChild(e)}))}async clearPopUpTitle(){this._popUp.ezTitle=""}async setPopUpTitle(t){this._popUp.ezTitle=t}async pkChangeListener(){const t=top.window.location.hash.split("/")[2];if(this._currentPkParameter===t)return;const e=this.getResourceIdFromToken(),i=I.getPkObjectFromUrlToken(top.window.location.hash),s=window.redirectFrom;if(void 0===i)return;if((!s||-1===s.split("_")[0].indexOf(e.split("_")[0]))&&e!==this.applicationResourceID)return;const n={pk:i};if(this._isLoadedByPk=!0,this.loadByPK)return this.loadByPK(n,s),void(this._currentPkParameter=t);this._loadPkParameter={pk:n,redirect:s},this.defaultLoadByPK(n,t)}getResourceIdFromToken(){var t;return(null===(t=top.window.location.pathname)||void 0===t?void 0:t.indexOf("tabContent.jsp"))>-1&&window.location.generateHash?I.getResourceIdFromUrlToken(window.location.generateHash(window.location.hash)):I.getResourceIdFromUrlToken(top.window.location.hash)}defaultLoadByPK(t,e){if(!(null==t?void 0:t.pk))return;const i=this.getFirstDataUnitFromDOM(),s=i.dataUnit;if(!s)return console.warn(this.getMessage("snkApplication.dataUnit.initDataUnitError")),void i.addEventListener("dataUnitReady",(i=>{this.loadDataWithPKFilter(t,i.detail),this._currentPkParameter=e}));this.loadDataWithPKFilter(t,s),this._currentPkParameter=e}loadDataWithPKFilter(t,e){const i={term:"",filter:{name:"LOAD_BY_PK_FILTER",expression:this.buildFilterExpressionByPkObject(t),params:this.getFilterParamsFromPkObject(t,e)}};e.loadData(i)}getFirstDataUnitFromDOM(){let t=this._element.querySelector("snk-data-unit[data-load-by-pk]");if(t||(t=this._element.querySelector("snk-data-unit")),t)return t}getFilterParamsFromPkObject(t,e){var i;const s=[];for(const n in t.pk)t.pk.hasOwnProperty(n)&&!Array.isArray(t.pk[n])&&s.push({name:n,dataType:(null===(i=e.getField(n))||void 0===i?void 0:i.dataType)||this.getDefaultDataTypeLoadByPK(t.pk[n]),value:t.pk[n]});return s}getDefaultDataTypeLoadByPK(t){return"number"==typeof t||t instanceof Number?v.NUMBER:"boolean"==typeof t||t instanceof Boolean?v.BOOLEAN:t instanceof Date?v.DATE:v.TEXT}buildFilterExpressionByPkObject(t){let e="";for(const i in t.pk)a.isEmpty(e)||(e+=" AND "),Array.isArray(t.pk[i])?e+=`${i} IN (${t.pk[i].toString()})`:e+=`${i} = :${i}`;return e}async showNewVersionPopup(){const t=document.createElement("ez-modal-container"),e=await this.getAppLabel();t.modalTitle=this.getMessage("snkApplication.newVersionPopup.title",{screenName:e}),t.okButtonLabel=this.getMessage("snkApplication.newVersionPopup.okButton"),t.cancelButtonLabel=this.getMessage("snkApplication.newVersionPopup.cancelButton");const i=document.createElement("p");i.innerText=this.getMessage("snkApplication.newVersionPopup.info"),i.className="ez-text",t.appendChild(i),t.addEventListener("ezModalAction",this.newVersionPopupEventListener.bind(this));const s=await x.showPopup({content:t});this._removeVersionLayoutPopup=async()=>{await s(),await this.processPendingActions(this.NEW_VERSION_POPUP_LOCKER)}}async newVersionPopupEventListener(t){"LOAD"!==t.detail&&("OK"===t.detail&&V.setScreenToUseV3Layout(),"CANCEL"===t.detail&&V.setScreenToUseOldLayout(),this._popUp.opened=!1,this._removeVersionLayoutPopup&&await this._removeVersionLayoutPopup())}async handleShowNewVersionPopup(){this.hasToShowNewVersionPopup()&&await this.showNewVersionPopup()}hasToShowNewVersionPopup(){const t=new URLSearchParams(window.location.search).get("firstLoadConv");return t&&"S"===t}registerPkChangeListener(){window.hasOwnProperty("onhashchange")?window.onhashchange=this.pkChangeListener.bind(this):setInterval(this.pkChangeListener.bind(this),100)}componentWillLoad(){f.setContextValue("__SNK__APPLICATION__LOADING__",!0),this._errorHandler=new W(this),this.messagesBuilder=new T,f.setContextValue("__EZUI__UPLOAD__ADD__URL__",`${I.getUrlBase()}/mge/upload/file`),f.setContextValue("__EZUI__SEARCH__OPTION__LOADER__",((t,e,i,s)=>this.executeSearch(t,e,i,s))),f.setContextValue("__EZUI__SEARCH__PLUS__OPTION__LOADER__",((t,e,i,s)=>this.executeSearch(t,e,i,Object.assign(Object.assign({},s),{useSearchPlus:!0})))),this.registerPkChangeListener(),P.init(),A.preload(this.applicationResourceID,this.configName,{gridLegacyConfig:this.gridLegacyConfigName,formLegacyConfig:this.formLegacyConfigName}),document.addEventListener("click",(()=>V.applicationClick())),this._waitingAppReady.forEach((t=>t())),this.setLayoutFormConfig()}async setLayoutFormConfig(){const t=await this._formConfigFetcher.fetchLayoutFormConfig("formColCfg."+this.applicationResourceID),e=isNaN(Number(null==t?void 0:t.config))?null:Number(null==t?void 0:t.config);this._LayoutFormConfigSingleton.setConfig(e)}connectedCallback(){this._isBrowserTypeElectron=k.isElectron(),f.setContextValue("__SNK__APPLICATION__",this),b.addRequestListener(this._requestListener)}disconnectedCallback(){null==b||b.removeRequestListener(this._requestListener),this.removeShortcuts(),this._lockManagerTimer&&clearTimeout(this._lockManagerTimer),this._scrimWindowTimer&&clearTimeout(this._scrimWindowTimer)}async componentDidLoad(){this.applicationLoading.emit(!0),window.requestAnimationFrame((()=>{f.setContextValue("__SNK__APPLICATION__LOADING__",!1),this.applicationLoaded.emit(!0),this.pkChangeListener()})),u.addIDInfo(this._element,`resource_${this.applicationResourceID}`),await this.handleShowNewVersionPopup(),this.initKeyboardManager(),this.enableLockManagerLoadingApp?(z.addLockManagerCtxId(this._element),this.resolveApplicationReady()):this._applicationReady=!0}async showScrimApp(t){if(!this.enableLockManagerLoadingApp||!this._applicationReady||!t)return this._activeScrimWindow=!1,void(this._scrimWindowTimer&&clearTimeout(this._scrimWindowTimer));this._activeScrimWindow=!0,this._scrimWindowTimer=setTimeout((async()=>{this._activeScrimWindow&&(this._activeScrimWindow=!1,clearTimeout(this._scrimWindowTimer))}),this._maxTimerAppLoading)}async changeTemplateSkeleton(t){this._templateSkeleton=t||this._templateSkeleton}async markToReload(t){this.enableLockManagerLoadingApp&&(await this.changeTemplateSkeleton(t),this._applicationReady=!1,await z.resetLocks(this._element,_.APP_LOADING),this.resolveApplicationReady())}async addLoadingLock(t=!1,e){if(this.enableLockManagerLoadingApp)return await this.changeTemplateSkeleton(e),t&&(this._applicationReady=!1,this._activeScrimWindow=!!this._applicationReady,await z.resetLocks(this._element,_.APP_LOADING)),this.resolveApplicationReady(),await z.lock(this._element,_.APP_LOADING)}async resolveApplicationReady(){if(!this._applicationReady)try{await this.checkTimeoutLimitLockManager(),await z.whenHasLock(this._element,_.APP_LOADING),await z.whenResolve(this._element,_.APP_LOADING,200),await z.resetLocks(this._element,_.APP_LOADING),this._applicationReady=!0}catch(t){console.warn(t),this._applicationReady=!0}}stopTimeoutLockManager(){this._lockManagerTimer&&clearTimeout(this._lockManagerTimer)}async checkTimeoutLimitLockManager(){this.stopTimeoutLockManager(),this._applicationReady||(this._lockManagerTimer=setTimeout((async()=>{this._applicationReady||(await z.resetLocks(this._element,_.APP_LOADING),this.stopTimeoutLockManager(),this._applicationReady=!0)}),this._maxTimerAppLoading))}initKeyboardManager(){this._keyboardManager.bind("ctrl + g",V.searchApp.bind(this),{description:this.getMessage("snkApplication.keyboard.shortcuts.searchApp")}).bind("ctrl + d",V.showDesktop.bind(this),{description:this.getMessage("snkApplication.keyboard.shortcuts.showDesktop")}).bind("F1",V.openHelp.bind(this),{description:this.getMessage("snkApplication.keyboard.shortcuts.openHelp")})}removeShortcuts(){this._keyboardManager.unbindAllShortcutKeys()}renderLoadingSkeleton(){if(this.enableLockManagerLoadingApp){if(this._isBrowserTypeElectron)return this.getSpinnerLoadingDefault();switch(this._templateSkeleton){case D.CUSTOM_TEMPLATE:case D.GRID:return this.getSkeletonTemplateGrid();case D.GRID_WITH_SIDEBAR:return this.getSkeletonTemplateGridWithSidebar();case D.GRID_WITH_PANEL:return this.getSkeletonTemplateGridWithPanel();case D.FORM_WITH_SIDEBAR:return this.getSkeletonTemplateFormWithSidebar();default:return this.getSkeletonTemplateGrid()}}}getLoadingVisibilityStyle(){return{visibility:this._applicationReady?"hidden":"initial",display:this._applicationReady?"none":"unset"}}getSkeletonTemplateGrid(){return i("div",{class:"loading-hidden",style:this.getLoadingVisibilityStyle()},i("div",{class:"ez-flex ez-flex--column ez-margin--large ez-margin-top--medium"},i("div",{class:"ez-margin-bottom--medium"},i("ez-skeleton",{count:1,variant:"text",width:"20%",height:"35px",animation:"progress"})),i("div",{class:""},i("ez-skeleton",{count:1,variant:"text",width:"70%",height:"25px",animation:"progress"}))),i("div",{class:"ez-flex ez-flex--justify-start skeleton-content-column ez-margin-horizontal--large",style:{height:"calc(-105px + 100vh)"}},[1,2,3,4].map(((t,e)=>i("div",{class:"ez-margin-right--large",key:e,style:{width:"25%"}},i("ez-skeleton",{count:this.getCountSkeleton(50,10),variant:"text",width:"100%",height:"50px",animation:"progress",marginBottom:"10px"}))))))}getSkeletonTemplateGridWithSidebar(){return i("div",{class:"loading-hidden",style:this.getLoadingVisibilityStyle()},i("div",{class:"ez-flex ez-flex--column ez-margin--large ez-margin-top--medium"},i("div",{class:"ez-margin-bottom--medium"},i("ez-skeleton",{count:1,variant:"text",width:"20%",height:"35px",animation:"progress"})),i("div",{class:""},i("ez-skeleton",{count:1,variant:"text",width:"70%",height:"25px",animation:"progress"}))),i("div",{class:"ez-flex ez-flex--justify-start skeleton-content-column ez-margin-horizontal--large",style:{height:"calc(100vh - 160px)"}},i("div",{class:"ez-flex ez-flex--column ez-margin-right--large",style:{width:"25%",overflow:"hidden"}},Array(this.getCountSkeleton(30,6)).fill(null).map(((t,e)=>i("ez-skeleton",{key:e,count:1,variant:"text",width:this.getSkeletonRandomWidth(),height:"30px",animation:"progress",marginBottom:"10px"})))),i("div",{class:"ez-margin-right--large",style:{width:"75%"}},i("ez-skeleton",{count:this.getCountSkeleton(50,10),variant:"text",width:"100%",height:"50px",animation:"progress",marginBottom:"10px"}))))}getSkeletonTemplateGridWithPanel(){return i("div",{class:"loading-hidden",style:this.getLoadingVisibilityStyle()},i("div",{class:"ez-margin--medium ez-margin-top--medium ez-padding--medium"},i("ez-skeleton",{count:1,variant:"text",width:"70%",height:"25px",animation:"progress"})),i("div",{class:"ez-flex ez-margin--medium ez-margin-top--medium",style:{maxHeight:"calc(-105px + 100vh)",overflow:"hidden"}},i("div",{class:"",style:{width:"70%",overflow:"hidden"}},i("div",{class:"ez-padding--medium",style:{height:"50%"}},i("ez-skeleton",{count:1,variant:"text",width:"100%",height:"100%",animation:"progress"})),i("div",{class:"ez-padding--medium",style:{}},i("ez-skeleton",{count:1,variant:"text",width:"250px",height:"25px",animation:"progress"})),i("div",{class:"ez-flex ez-padding--medium",style:{height:"45%"}},[1,2].map((()=>i("div",{style:{width:"50%"}},i("ez-skeleton",{count:1,variant:"text",width:"100%",height:"100%",animation:"progress"})))))),i("div",{class:"ez-flex ez-flex--column ez-padding--medium",style:{width:"30%",overflow:"hidden"}},Array(this.getCountSkeleton(30,10)).fill(null).map(((t,e)=>i("ez-skeleton",{key:e,count:1,variant:"text",width:"100%",height:"50px",animation:"progress",marginBottom:"10px"}))))))}getSkeletonTemplateFormWithSidebar(){return i("div",{class:"loading-hidden",style:this.getLoadingVisibilityStyle()},i("div",{class:"ez-margin--medium ez-margin-top--medium ez-padding--medium"},i("ez-skeleton",{count:1,variant:"text",width:"70%",height:"25px",animation:"progress"})),i("div",{class:"ez-flex ez-margin--medium ez-margin-top--medium",style:{maxHeight:"calc(-105px + 100vh)",overflow:"hidden"}},i("div",{class:"ez-flex ez-flex--column ez-margin-right--large",style:{width:"25%",overflow:"hidden"}},Array(this.getCountSkeleton(30,6)).fill(null).map(((t,e)=>i("ez-skeleton",{key:e,count:1,variant:"text",width:this.getSkeletonRandomWidth(),height:"30px",animation:"progress",marginBottom:"10px"})))),i("div",{class:"ez-flex ez-flex--column",style:{width:"75%"}},i("div",{class:"ez-padding--medium",style:{width:"100%"}},i("ez-skeleton",{count:1,variant:"text",width:"30%",height:"25px",animation:"progress"})),i("div",{class:"ez-padding--medium",style:{height:"45%"}},i("div",{class:"ez-flex",style:{width:"100%",height:"100%"}},[1,2,3,4].map(((t,e)=>i("div",{key:e,class:"ez-padding-right--large",style:{width:"25%",overflow:"hidden"}},Array(this.getCountSkeleton(50,20)).fill(null).map(((t,e)=>i("ez-skeleton",{key:e,count:1,variant:"text",width:"100%",height:"50px",animation:"progress",marginBottom:"10px"})))))))),i("div",{class:"ez-padding--medium",style:{width:"100%"}},i("ez-skeleton",{count:1,variant:"text",width:"30%",height:"25px",animation:"progress"})),i("div",{class:"ez-padding--medium",style:{height:"45%"}},i("div",{class:"ez-flex",style:{width:"100%",height:"100%"}},[1,2,3,4].map(((t,e)=>i("div",{key:e,class:"ez-padding-right--large",style:{width:"25%",overflow:"hidden"}},Array(this.getCountSkeleton(50,20)).fill(null).map(((t,e)=>i("ez-skeleton",{key:e,count:1,variant:"text",width:"100%",height:"50px",animation:"progress",marginBottom:"10px"})))))))))))}getSpinnerLoadingDefault(){return i("div",{class:"loading-hidden",style:this.getLoadingVisibilityStyle()},i("div",{class:"ez-flex ez-size-height--full ez-size-width--full ez-flex--justify-center ez-flex--align-items-center spinner"},i("ez-icon",{iconName:"sync",size:"x-large",class:"spin"}),i("span",{class:"ez-title ez-title--secondary ez-title--extra-large"},this.getMessage("snkApplication.loading.text"))))}render(){return i(s,{style:{visibility:!this.enableLockManagerLoadingApp||this._applicationReady?"unset":"hidden",overflow:!this.enableLockManagerLoadingApp||this._applicationReady?"unset":"hidden"}},i("div",null,i("ez-loading-bar",{ref:t=>this._requestListener.ezLoadingBar=t}),i("ez-popup",{opened:!1,ref:t=>this._popUp=t,onEzClosePopup:()=>this.closePopUp()}),i("ez-modal",{opened:!1,ref:t=>this._rightModal=t,"modal-size":"small",closeOutsideClick:!0,closeEsc:!0}),this.renderLoadingSkeleton(),this._activeScrimWindow&&i("div",{class:"ez-scrim ez-scrim--light",style:{cursor:"progress",zIndex:"var(--scrim-z-index)"}})))}get _element(){return n(this)}static get watchers(){return{loadByPK:["watchPropHandler"]}}};class tt{constructor(t,e){this.resolve=t,this.reject=e}}Q.style=".sc-snk-application-h{--scrim-z-index:var(--elevation--100, 100);display:flex;flex-direction:column;height:100%}.sc-snk-application-h>.loading-hidden.sc-snk-application{display:none;pointer-events:none}.skeleton-content-left.sc-snk-application{width:300px;padding-right:5px}.skeleton-content.sc-snk-application{height:calc(100vh - 310px)}.spinner.sc-snk-application{height:100vh;gap:10px}.spinner.sc-snk-application>.spin.sc-snk-application{animation-name:spin;animation-duration:5000ms;animation-iteration-count:infinite;animation-timing-function:linear}@keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}";export{Q as snk_application}
@@ -0,0 +1 @@
1
+ import{r as t,c as s,h as i,H as e,g as a}from"./p-d8d8169b.js";import{Action as h,ElementIDUtils as n,LockManager as r,LockManagerOperation as o,SilentException as l,StringUtils as d,ApplicationContext as v,OVERFLOWED_CLASS_NAME as u,OverflowWatcher as c,OverflowDirection as k}from"@sankhyalabs/core";import{P as m}from"./p-0f3698af.js";import{A as b}from"./p-dc36cfbf.js";import{T as p,V as T,A as f,b as g,a as w}from"./p-b987e15d.js";import"./p-55798617.js";const E=class{constructor(i){t(this,i),this.actionClick=s(this,"actionClick",7),this.taskbarSaveLocker=s(this,"taskbarSaveLocker",7),this.taskbarSaveUnlocker=s(this,"taskbarSaveUnlocker",7),this.TASKBAR_ITEM_ID_PREFIX="TASKBAR_ITEM_",this.TASKBAR_CUSTOM_ELEMENTS_CONTAINER_CLASS_NAME="taskbar-custom-elements-container",this.ACTIONS_BUTTON_TAG="TASKBAR-ACTIONS-BUTTON",this.NOT_OVERFLOW_ELEMENTS=["moreOptions","dataExporter_snkDataExporter","actionsButton_snkActionsButton"],this.TASKBAR_CUSTOM_ELEMENTS="taskbar-custom-elements-container",this._dataUnitInitialized=!1,this._titleKeyByElement={[p.UPDATE_MULTIPLE]:"snkTaskbar.titleUpdateMultiple",[p.UPDATE]:"snkTaskbar.titleUpdate",[p.PREVIOUS]:"snkTaskbar.titlePrevious",[p.NEXT]:"snkTaskbar.titleNext",[p.REFRESH]:"snkTaskbar.titleRefresh",[p.CLONE]:"snkTaskbar.titleClone",[p.REMOVE]:"snkTaskbar.titleRemove",[p.MORE_OPTIONS]:"snkTaskbar.titleMoreOptions",[p.INSERT]:"snkTaskbar.titleInsert",[p.CANCEL]:"snkTaskbar.titleCancel",[p.SAVE]:"snkTaskbar.titleSave",[p.GRID_MODE]:"snkTaskbar.titleGridMode",[p.FORM_MODE]:"snkTaskbar.titleFormMode",[p.CONFIGURATOR]:"snkTaskbar.titleConfigurator",[p.ATTACH]:"snkTaskbar.titleAttach"},this.onSaveEvent=t=>{switch(t.type){case h.FIELD_INVALIDATED:case h.INVALIDATE_CLEAN:case h.DATA_SAVED:case h.SAVING_ERROR:case h.SAVING_CANCELED:this._isWaitingForSave=!1;break;case h.SAVING_DATA:this._isWaitingForSave=!0}},this._permissions=void 0,this._overFlowedElements=[],this._customElements=void 0,this._customElementsId=void 0,this._slotContainer=void 0,this._hiddenActionsList=[],this._lastWidth=void 0,this._hasToUpdateOverFlow=!1,this._isWaitingForSave=!1,this.alignRigth=!1,this.customSlotId="TASKBAR_CUSTOM_ELEMENTS",this.customContainerId=void 0,this.overflowStrategy="hiddenItems",this.configName=void 0,this.resourceID=void 0,this.buttons=void 0,this.customButtons=void 0,this.actionsList=void 0,this.actionsSettingsList=void 0,this.primaryButton=void 0,this.disabledButtons=void 0,this.dataUnit=void 0,this.presentationMode=m.PRIMARY,this.messagesBuilder=void 0}handleCustomSlotElementsLoaded(t){this.hasToSearchCustomElements(t)&&this.getCustomElements(!0)}handleTaskbarSaveLocker(){!0!==this._isWaitingForSave&&(this._isWaitingForSave=!0)}handleTaskbarSaveUnlocker(){!0===this._isWaitingForSave&&(this._isWaitingForSave=!1)}hasToSearchCustomElements(t){return this.customSlotId===t.detail&&!this._slotContainer}observeButtons(){this._definitions=void 0,requestAnimationFrame((()=>{requestAnimationFrame((()=>{var t;return null===(t=this._overFlowWatcher)||void 0===t?void 0:t.forceUpdate()}))}))}observeDisabledButtons(){var t;null===(t=this._overFlowWatcher)||void 0===t||t.forceUpdate()}observeLastWidth(t,s){0===s&&0!==t&&(this._hasToUpdateOverFlow=!0)}observeIsWaitingForSave(t,s){1==t&&0==s&&this.taskbarSaveLocker.emit(),0==t&&1==s&&this.taskbarSaveUnlocker.emit()}observeDataUnit(t){this.initializeDataUnit(t)}initializeDataUnit(t){t&&!this._dataUnitInitialized&&(this._dataUnitInitialized=!0,n.addIDInfo(this._element,null,{dataUnit:this.dataUnit}),this.dataUnit.subscribe(this.onSaveEvent))}elementsFromString(t){const s=[];return null==t||t.split(",").forEach((t=>{t=t.trim(),(T[t]||this.isAllowed(t))&&s.push(t.trim())})),s}isAllowed(t){return t===f.CONFIGURATOR?!!this._permissions&&(this._permissions.isSup||this._permissions[b.CONFIG_GRID]||this._permissions[b.CONFIG]):!f[t]||!!this._permissions&&(this._permissions.isSup||this._permissions[t])}getTitle(t){var s;let i;return i=this.isAllowed(t)?this._titleKeyByElement[t]:"snkTaskbar.forbidden",i?null===(s=this.messagesBuilder)||void 0===s?void 0:s.getMessage(i,{}):""}elementClick(t){r.whenResolve(this._element,o.TASKBAR_CLICK).then((()=>{if(this.dataUnit){switch(t){case p.PREVIOUS:this.dataUnit.previousRecord();break;case p.NEXT:this.dataUnit.nextRecord();break;case p.REFRESH:this.dataUnit.loadData();break;case p.CLONE:this.dataUnit.copySelected();break;case p.REMOVE:this.dataUnit.removeSelectedRecords();break;case p.INSERT:this.dataUnit.addRecord();break;case p.CANCEL:this.dataUnit.cancelEdition();break;case p.SAVE:this._isWaitingForSave||(this._isWaitingForSave=!0,this.dataUnit.saveData().catch((t=>{if(!(t instanceof l))throw t})).finally((()=>{this._isWaitingForSave=!1})))}this.isEnabled(t)&&this.actionClick.emit(t)}}))}isEnabled(t){return!(!this.isAllowed(t)||this.disabledButtons&&this.disabledButtons.includes(t))}validatePresentationMode(){Object.values(m).includes(this.presentationMode)||(this.presentationMode=m.PRIMARY)}getElement(t,s){let i=s===this.primaryButton?"ez-button--primary ":"";t>1&&(i+="ez-padding-left--medium");const e=p[s.toString()],a=this._element.dataset.exporterStoreKey||this.configName;return e?g(s,i,this.getIdElemBtnNative(s),(t=>this.getTitle(t)),(t=>this.elementClick(t)),(t=>this.isEnabled(t)),s!==p.CONFIGURATOR?this.buildDynamicActionsList():this.buildActionsSettingsList(),a,this.presentationMode):w(s,i,this.getIdElemBtnCustom(s),(t=>this.elementClick(t)),(t=>this.isEnabled(t)))}buildDynamicActionsList(){var t;return this._hiddenActionsList.length?[...null!==(t=this.actionsList)&&void 0!==t?t:[],...this._hiddenActionsList]:this.actionsList}buildActionsSettingsList(){return this.actionsSettingsList}getIdElemBtnNative(t){return d.toCamelCase(t)}getIdElemBtnCustom(t){return d.toCamelCase(t.name)}isDivider(t){var s;return void 0!==t&&(null===(s=t.t)||void 0===s?void 0:s["data-taskbar-divider"])}removeEmpty(t){let s;return t.filter((t=>!(null==t||this.isDivider(s)&&this.isDivider(t)||(s=t,0))))}appendCustomElementsInTaskbar(){this._customElementsId.forEach((t=>{const s=t.replace(this.TASKBAR_ITEM_ID_PREFIX,""),i=this._customElements.get(s),e=this._element.querySelector(`#${t}`);e?null==e||e.appendChild(i):this.unlinkCustomElementFromTaskbar(i)}))}addCustomElementContainer(t){var s;const e=`${this.TASKBAR_ITEM_ID_PREFIX}${t}`;return this._customElementsId.includes(e)||(this._customElementsId.push(e),null===(s=this._overFlowWatcher)||void 0===s||s.addNotOverFlowElement(e)),i("span",{class:"ez-padding-left--medium",key:e,id:e})}getCustomElements(t){var s,i;this._customElementsId=[],this._customElements=new Map,this._slotContainer=this.buildSlotContainer(t),Array.from(null!==(i=null===(s=this._slotContainer)||void 0===s?void 0:s.children)&&void 0!==i?i:[]).forEach((t=>this._customElements.set(t.id,t)))}buildSlotContainer(t){let s;if(this.customContainerId){const t=document.querySelector(`#${this.customContainerId}`);s=null==t?void 0:t.querySelector(`#${this.customSlotId}`)}else s=this._element.querySelector(`#${this.customSlotId}`);return t&&!s&&(s=document.querySelector(`#${this.customSlotId}`)),s}componentWillLoad(){this._application=v.getContextValue("__SNK__APPLICATION__"),this._application?this._application.getAllAccess(this.resourceID).then((t=>this._permissions=t)):this._permissions={},this.getCustomElements()}componentWillRender(){this.handleDefinitions(),this.validatePresentationMode(),this.updateOverFlowIfNeeded()}handleDefinitions(){null==this._definitions&&this._permissions&&(this._definitions=this.elementsFromString(this.buttons))}updateOverFlowIfNeeded(){this._hasToUpdateOverFlow&&(requestAnimationFrame((()=>{var t;return null===(t=this._overFlowWatcher)||void 0===t?void 0:t.forceUpdate()})),this._hasToUpdateOverFlow=!1)}handleOverFlow(t){const s=t.filter((t=>!this.hasToIgnoreOverFlow(t)));this.resetOverFlowedElements(),this.doOverFlowElements(s)}resetOverFlowedElements(){this._overFlowedElements.forEach((t=>{t.classList.remove(u)})),this._hiddenActionsList=[],this._overFlowedElements=[]}doOverFlowElements(t){t.forEach((t=>{t.classList.add(u),this._overFlowedElements.push(t),this.addItemToActionList(t)}))}addItemToActionList(t){const s=this.getTaskbarElementName(t);if(s&&this.isEnabled(s)&&this.isAllowed(s)){const i={value:s,label:this.getTaskbarElementLabel(t),iconName:this.getTaskbarElementIcon(t)};this._hiddenActionsList.push(i)}}getTaskbarElementName(t){var s;return null!==(s=t.getAttribute("data-taskbar-element"))&&void 0!==s?s:""}getTaskbarElementIcon(t){var s;return null!==(s=t.getAttribute("data-taskbar-icon"))&&void 0!==s?s:""}getTaskbarElementLabel(t){var s;return null!==(s=t.getAttribute("data-taskbar-label"))&&void 0!==s?s:""}hasToIgnoreOverFlow(t){return t.classList.contains(this.TASKBAR_CUSTOM_ELEMENTS_CONTAINER_CLASS_NAME)}handleOverFlowStrategy(){"hiddenItems"===this.overflowStrategy&&(this._overFlowWatcher=new c(this.buildOverFlowWatcherParams()))}buildOverFlowWatcherParams(){return{element:this._element,callback:this.handleOverFlow.bind(this),overFlowDirection:k.HORIZONTAL,notOverFlow:this.NOT_OVERFLOW_ELEMENTS}}componentDidLoad(){this.initializeDataUnit(this.dataUnit),this.handleOverFlowStrategy()}componentDidRender(){this.appendCustomElementsInTaskbar(),this.updateLastWidth()}updateLastWidth(){this._lastWidth=this._element.getBoundingClientRect().width}disconnectedCallback(){var t,s;null===(t=this.dataUnit)||void 0===t||t.unsubscribe(this.onSaveEvent),this.unlinkAllCustomElements(),null===(s=this._overFlowWatcher)||void 0===s||s.destroy()}unlinkAllCustomElements(){var t;null===(t=this._customElementsId)||void 0===t||t.forEach((t=>{const s=t.replace(this.TASKBAR_ITEM_ID_PREFIX,""),i=this._customElements.get(s);this.unlinkCustomElementFromTaskbar(i)}))}unlinkCustomElementFromTaskbar(t){this._slotContainer.appendChild(t)}render(){var t;if(void 0===this._definitions)return;let s=0;return i(e,{class:this.getHostClasses()},this.removeEmpty(this._definitions.map((t=>{var e,a;return s++,p[t]?this.getElement(s,p[t]):(null===(e=this.customButtons)||void 0===e?void 0:e.has(t))?this.getElement(s,this.customButtons.get(t)):this._customElements.has(t)?this.addCustomElementContainer(t):(null===(a=this._overFlowWatcher)||void 0===a||a.addNotOverFlowElement(t),i("slot",{name:t}))}))),i("div",{id:this.TASKBAR_CUSTOM_ELEMENTS,class:this.TASKBAR_CUSTOM_ELEMENTS_CONTAINER_CLASS_NAME},i("slot",{name:this.customSlotId}),null===(t=this._overFlowWatcher)||void 0===t?void 0:t.addNotOverFlowElement(this.TASKBAR_CUSTOM_ELEMENTS)))}getHostClasses(){return"hiddenItems"!==this.overflowStrategy?"no-wrap":"full-width "+(this.alignRigth?"align-right":"")}get _element(){return a(this)}static get watchers(){return{buttons:["observeButtons"],disabledButtons:["observeDisabledButtons"],_lastWidth:["observeLastWidth"],_isWaitingForSave:["observeIsWaitingForSave"],dataUnit:["observeDataUnit"]}}};E.style=".sc-snk-taskbar-h{display:flex;flex-wrap:wrap}.no-wrap.sc-snk-taskbar-h{flex-wrap:nowrap}.full-width.sc-snk-taskbar-h{width:100%}.align-right.sc-snk-taskbar-h{justify-content:flex-end}.overflowed.sc-snk-taskbar{display:none}";export{E as snk_taskbar}
@@ -1 +1 @@
1
- export{S as snk_data_unit}from"./p-626b7a17.js";import"./p-d8d8169b.js";import"@sankhyalabs/core";import"@sankhyalabs/ezui/dist/collection/utils";import"./p-6d241415.js";import"./p-8d884fab.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-88ed2793.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-6a11f754.js";import"./p-d8d8169b.js";import"@sankhyalabs/core";import"@sankhyalabs/ezui/dist/collection/utils";import"./p-cdda05e3.js";import"./p-8d884fab.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-42e248cd.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 +1 @@
1
- import{ObjectUtils as t}from"@sankhyalabs/core";import{R as a}from"./p-7fc46290.js";class s extends a{getData(a){const s=`cfg://auth/${a}`;return new Promise(((a,e)=>{this.loadResource(s).then((s=>{let e=t.stringToObject(s);e&&"object"==typeof e&&a(e)})).catch((t=>{e(t)}))}))}}var e;!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"}(e||(e={}));export{e as A,s as a}
1
+ import{ObjectUtils as t}from"@sankhyalabs/core";import{R as a}from"./p-1273039f.js";class s extends a{getData(a){const s=`cfg://auth/${a}`;return new Promise(((a,e)=>{this.loadResource(s).then((s=>{let e=t.stringToObject(s);e&&"object"==typeof e&&a(e)})).catch((t=>{e(t)}))}))}}var e;!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"}(e||(e={}));export{e as A,s as a}
@@ -0,0 +1 @@
1
+ import{r as i,c as e,h as t,g as s}from"./p-d8d8169b.js";import{ObjectUtils as o,ArrayUtils as n}from"@sankhyalabs/core";import{ApplicationUtils as a}from"@sankhyalabs/ezui/dist/collection/utils";import{S as r}from"./p-51833248.js";import{a as d}from"./p-9019a32f.js";const l=class{constructor(t){i(this,t),this.guideSelected=e(this,"guideSelected",7),this.guideListChanged=e(this,"guideListChanged",7),this.guideDeleted=e(this,"guideDeleted",7),this.createNewGuide=e(this,"createNewGuide",7),this.ID_VISIBLE_GUIDES="container-visible-guides",this.ID_HIDDEN_GUIDES="container-hidden-guides",this.sortLogic=(i,e)=>{var t,s;return(null!==(t=i.order)&&void 0!==t?t:Number.MAX_VALUE)-(null!==(s=e.order)&&void 0!==s?s:Number.MAX_VALUE)},this.mainGuide=void 0,this.filterTerm="",this.visibleGuides=[],this.hiddenGuides=[],this.guidesList=[],this.selectedGuide=void 0,this.messagesBuilder=void 0}onMessagesBuilderChange(){this.setCustomCSSProperties()}observeVisibleGuides(i){this.initGuidesConfig(i)}observeSelectedGuide(i){this.guideSelected.emit(i)}getMessage(i,e){return this.messagesBuilder.getMessage(i,e)}initGuidesConfig(i){const e=[...i.filter((i=>i.visible&&i.name!==d.main))],t=[...i.filter((i=>!i.visible&&i.name!==d.main))];this.visibleGuides=[...e.sort(this.sortLogic)],this.hiddenGuides=[...t.sort(this.sortLogic)],this.mainGuide=i.find((i=>i.name===d.main))}handleAddGuide(){this.createNewGuide.emit()}handleSelectGuide(i,e){e.stopPropagation(),this.selectedGuide=i}toggleGuideVisibility(i,e){e.stopPropagation();const t=Object.assign(Object.assign({},i),{visible:!i.visible});let s,o;i.visible?(s=[...this.visibleGuides.filter((e=>e.name!==i.name))],o=[...this.hiddenGuides,t]):(s=[...this.visibleGuides,t],o=[...this.hiddenGuides.filter((e=>e.name!==i.name))]);const n=[...s,...o];this.applyGuidesUpdate(n)}adjustListOrder(i){return i.map(((i,e)=>Object.assign(Object.assign({},i),{order:e})))}applyGuidesUpdate(i){let e=this.adjustListOrder(i);e=[this.mainGuide,...e],o.equals(e,this.guidesList)||this.guideListChanged.emit(e)}async handleDeleteGuide(i,e){e.stopPropagation();const t=this.getMessage("snkFormConfig.confirm.title"),s=this.getMessage("snkFormConfig.confirm.deleteGuide").replace("{0}",i.label);if(!await a.confirm(t,s))return;this.guideDeleted.emit(i);const o=this.getMessage("snkFormConfig.info.successfullyGuideDeleted").replace("{0}",i.label);a.info(o)}renderItems(i){return n.applyStringFilter(this.filterTerm,i).map((i=>{var e;return t("div",{key:i.name,"data-guide-name":i.name,title:i.label,class:`guide-item ${(null===(e=this.selectedGuide)||void 0===e?void 0:e.label)===i.label?"selected":""} ${this.filterTerm.length?"disable-sort":""}`,onClick:e=>this.handleSelectGuide(i,e)},t("span",null,t("ez-icon",{iconName:"drag-indicator",class:"ez-margin-right--small"})),t("span",{class:"item-label"},i.label),t("div",{class:"actions"},t("ez-button",{mode:"icon",class:"ez-button--tertiary",onClick:e=>this.toggleGuideVisibility(i,e),size:"medium",iconName:i.visible?"eye-off":"eye",title:this.getMessage(i.visible?"snkFormConfig.guidesConfigurator.actions.hide":"snkFormConfig.guidesConfigurator.actions.show")}),t("ez-button",{mode:"icon",class:"ez-button--tertiary",onClick:e=>this.handleDeleteGuide(i,e),size:"medium",isDisabled:i.isCustom||i.isDetail,iconName:"delete",title:this.getMessage(i.isCustom||i.isDetail?"snkFormConfig.guidesConfigurator.canNotDeleteCustomGuide":"snkFormConfig.guidesConfigurator.actions.delete")})))}))}getContainerElement(i){return this.el.querySelector(`[id="${i}"]`)}handleSortGuide(){const i=[...this.getGuidesFromStatus(!0),...this.getGuidesFromStatus(!1)];this.applyGuidesUpdate(i)}getGuidesFromStatus(i){let e=[];return this.getOrderedGuideNames(i?this.ID_VISIBLE_GUIDES:this.ID_HIDDEN_GUIDES).forEach((t=>{const s=this.guidesList.find((i=>i.name===t));s&&e.push(Object.assign(Object.assign({},s),{visible:i}))})),e}getOrderedGuideNames(i){var e;const t=null===(e=this.getContainerElement(i))||void 0===e?void 0:e.children;return Array.from(t).map((i=>i.getAttribute("data-guide-name")))}initializeDraggableContainers(){this._sortableVisibleGuides=new r(this.getContainerElement(this.ID_VISIBLE_GUIDES),{group:"guides",ghostClass:"ghost",direction:"vertical",filter:".disable-sort",animation:15,onSort:()=>this.handleSortGuide()}),this._sortableInvisibleGuides=new r(this.getContainerElement(this.ID_HIDDEN_GUIDES),{group:"guides",ghostClass:"ghost",animation:15,filter:".disable-sort",onSort:()=>this.handleSortGuide()})}handleSelectMainGuide(){this.guideSelected.emit(this.mainGuide)}setCustomCSSProperties(){document.documentElement.style.setProperty("--no-hidden-guides-message",`"${this.getMessage("snkFormConfig.guidesConfigurator.noHiddenGuides")}"`),document.documentElement.style.setProperty("--no-visible-guides-message",`"${this.getMessage("snkFormConfig.guidesConfigurator.noVisibleGuides")}"`)}componentDidLoad(){this.initializeDraggableContainers(),this.initGuidesConfig(this.guidesList),this.setCustomCSSProperties()}render(){var i,e,s;return t("ez-sidebar-navigator",{class:"ezSidebarNavigator",type:"fixed",size:"md",titleMenu:this.getMessage("snkFormConfig.guidesConfigurator.title")},t("div",{class:"navigator-container"},t("ez-filter-input",{slot:"content",mode:"slim",label:this.getMessage("snkFormConfig.guidesConfigurator.searchGuide"),onEzChange:i=>this.filterTerm=i.detail}),t("div",{onClick:this.handleSelectMainGuide.bind(this),class:"main-guide "+((null===(i=this.selectedGuide)||void 0===i?void 0:i.name)===(null===(e=this.mainGuide)||void 0===e?void 0:e.name)?"selected":"")},t("span",null,null===(s=this.mainGuide)||void 0===s?void 0:s.label)),t("div",{class:"collapsible-container"},t("div",{class:"collapsible-item"},t("ez-collapsible-box",{label:this.getMessage("snkFormConfig.guidesConfigurator.visibleGuides"),headerSize:"large"},t("div",{id:this.ID_VISIBLE_GUIDES,class:"guide-list "+(this.visibleGuides.length?"":"visible-empty-content")},this.renderItems(this.visibleGuides)))),t("div",{class:"collapsible-item"},t("ez-collapsible-box",{label:this.getMessage("snkFormConfig.guidesConfigurator.hiddenGuides"),headerSize:"large"},t("div",{id:this.ID_HIDDEN_GUIDES,class:"guide-list "+(this.hiddenGuides.length?"":"hidden-empty-content")},this.renderItems(this.hiddenGuides))))),t("div",{class:"add-button-container",onClick:this.handleAddGuide.bind(this)},t("ez-icon",{slot:"leftIcon",iconName:"plus"}),t("span",null,this.getMessage("snkFormConfig.guidesConfigurator.createNewGuide")))))}get el(){return s(this)}static get watchers(){return{messagesBuilder:["onMessagesBuilderChange"],guidesList:["observeVisibleGuides"],selectedGuide:["observeSelectedGuide"]}}};l.style='.ezSidebarNavigator.sc-guides-configurator{--ez-sidebar-navigator--height:calc(100vh - 118px)}.navigator-container.sc-guides-configurator{height:calc(100vh - 175px);display:flex;flex-direction:column;justify-content:space-between}.collapsible-container.sc-guides-configurator{display:flex;flex-direction:column;gap:12px;flex-grow:1;max-height:calc(100vh - 240px);overflow:auto}.collapsible-item.sc-guides-configurator{padding:6px;border-radius:6px;border:1px solid #dce0e8}.add-button-container.sc-guides-configurator{display:flex;align-items:center;border-top:1px solid #dce0e8;padding-top:22px;gap:6px;cursor:pointer;justify-content:center}.add-button-container.sc-guides-configurator span.sc-guides-configurator{display:block}.guide-list.sc-guides-configurator{display:flex;flex-direction:column;width:100%;min-height:10px}.guide-list.hidden-empty-content.sc-guides-configurator::before{content:var(--no-hidden-guides-message, "Nenhuma guia oculta");display:block;font-size:16px;font-weight:400;color:#AFB6C0;margin:auto;padding:8px}.guide-list.visible-empty-content.sc-guides-configurator::before{content:var(--no-visible-guides-message, "Nenhuma guia visível");display:block;font-size:16px;font-weight:400;color:#AFB6C0;margin:auto;padding:8px}.item-label.sc-guides-configurator{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex-grow:1}.guide-item.sc-guides-configurator{margin:0 3px;display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:5px 10px;border-radius:6px;transition:all 0.2s ease-in-out;height:32px}.guide-item.sc-guides-configurator .actions.sc-guides-configurator{display:flex;gap:8px;transition:opacity 0.2s ease-in-out;display:none;opacity:0}.guide-item.sc-guides-configurator:hover .actions.sc-guides-configurator{display:flex;opacity:1}ez-button.sc-guides-configurator{width:24px;align-items:center;justify-content:center;display:flex}.ghost.sc-guides-configurator{opacity:.5;background:#e2eaf4}.main-guide.sc-guides-configurator{padding:12px;margin:12px 0;border:1px solid #dce0e8;border-radius:6px;transition:all 0.2s ease-in-out}.guide-item.selected.sc-guides-configurator,.main-guide.selected.sc-guides-configurator{background:#E2F4EF}.guide-item.sc-guides-configurator:hover,.main-guide.sc-guides-configurator:hover{background:#f5fcfa}';export{l as guides_configurator}
@@ -1,4 +1,4 @@
1
- import{UserInterface as e,DataType as t,ApplicationContext as n,ErrorException as i}from"@sankhyalabs/core";import{d as o,D as r}from"./p-6d241415.js";function a(e){const t=(n=e.fieldsMetadata)&&n.length?n.map((e=>({name:e.fieldName,label:e.description,dataType:u(e.type),userInterface:l(e),properties:s(e)}))):[];var n;return{label:e.entityDescription,name:e.descriptionField,fields:t}}function s(e){const t={};return t.options=function(e){const t=e.options;if(!t)return;const n=[];return Object.keys(t).forEach((e=>{n.push({label:e,value:t[e]})})),n}(e),t.mask=function(e){const t=e.uiType;return t?String(t).toLowerCase():void 0}(e),t}function l(t){const n=t.options;return n&&Object.keys(n).length>0?e.OPTIONSELECTOR:"D"===t.type?e.DATE:"H"===t.type?e.DATETIME:"T"===t.type?e.TIME:"I"===t.type?e.INTEGERNUMBER:void 0}function u(e){switch(e){case"F":case"I":return t.NUMBER;case"D":case"H":return t.DATE;case"B":return t.OBJECT;default:return t.TEXT}}function c(e){return Object.assign({id:e.codigo,label:`${e.caminho} - ${e.descricao}`,bold:"N"===e.analitico,props:{analitico:"S"===e.analitico}},e.no&&{children:e.no.map(c)})}var d,v,f;!function(e){e[e.GRID=0]="GRID",e[e.CARDS=1]="CARDS",e[e.TREE=2]="TREE"}(d||(d={}));class m{constructor(){this._defaultPageSize=100,this._templateByQuery=new Map,this._searchListenersByDataUnit=new Map,this.buldTemplates()}buldTemplates(){this._templateByQuery.set("search",o.gql`query($entityName: String! $argument: String $criteria: InputSearchCriteria $options: InputSearchOptions) {
1
+ import{UserInterface as e,DataType as t,ApplicationContext as n,ErrorException as i}from"@sankhyalabs/core";import{d as o,D as r}from"./p-cdda05e3.js";function a(e){const t=(n=e.fieldsMetadata)&&n.length?n.map((e=>({name:e.fieldName,label:e.description,dataType:u(e.type),userInterface:l(e),properties:s(e)}))):[];var n;return{label:e.entityDescription,name:e.descriptionField,fields:t}}function s(e){const t={};return t.options=function(e){const t=e.options;if(!t)return;const n=[];return Object.keys(t).forEach((e=>{n.push({label:e,value:t[e]})})),n}(e),t.mask=function(e){const t=e.uiType;return t?String(t).toLowerCase():void 0}(e),t}function l(t){const n=t.options;return n&&Object.keys(n).length>0?e.OPTIONSELECTOR:"D"===t.type?e.DATE:"H"===t.type?e.DATETIME:"T"===t.type?e.TIME:"I"===t.type?e.INTEGERNUMBER:void 0}function u(e){switch(e){case"F":case"I":return t.NUMBER;case"D":case"H":return t.DATE;case"B":return t.OBJECT;default:return t.TEXT}}function c(e){return Object.assign({id:e.codigo,label:`${e.caminho} - ${e.descricao}`,bold:"N"===e.analitico,props:{analitico:"S"===e.analitico}},e.no&&{children:e.no.map(c)})}var d,v,f;!function(e){e[e.GRID=0]="GRID",e[e.CARDS=1]="CARDS",e[e.TREE=2]="TREE"}(d||(d={}));class m{constructor(){this._defaultPageSize=100,this._templateByQuery=new Map,this._searchListenersByDataUnit=new Map,this.buldTemplates()}buldTemplates(){this._templateByQuery.set("search",o.gql`query($entityName: String! $argument: String $criteria: InputSearchCriteria $options: InputSearchOptions) {
2
2
  $queryAlias$: search(entityName: $entityName argument: $argument criteria: $criteria options: $options){
3
3
  value
4
4
  label
@@ -1,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-6d241415.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-cdda05e3.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{
@@ -1 +1 @@
1
- import{r as t,h as e,H as i,g as s}from"./p-d8d8169b.js";import{ApplicationContext as o,ObjectUtils as r,UserInterface as n,DataType as l,ElementIDUtils as a}from"@sankhyalabs/core";import{ApplicationUtils as d,DialogType as h}from"@sankhyalabs/ezui/dist/collection/utils";import{I as c}from"./p-8f3f2306.js";import{D as u,a as p,b as m}from"./p-0f3698af.js";import{R as v}from"./p-9019a32f.js";import{D as x}from"./p-6d241415.js";import{S as g}from"./p-626b7a17.js";import"./p-e8c49c12.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-88ed2793.js";import"./p-ff1990ad.js";import"./p-7fc46290.js";import"./p-8d884fab.js";import"@sankhyalabs/core/dist/dataunit/metadata/DataType";import"./p-7dd49d15.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";class f{constructor(t,e){this._selectedNumber=0,this._getMessage=t,this._selectedNumber=e}setExportOption(t,e){const i=this.getExportGroupName();t===u.EXPORT_TO_PDF&&e.push(this.getExportToPDF(i)),t===u.EXPORT_TO_XLS&&e.push(this.getExportToXLS(i)),this.setExportCurrentPage(t,e),this._selectedNumber>0&&this.setExportAllRecords(t,e),this.setExportByEmail(t,e)}setExportCurrentPage(t,e){var i;const s=[u.EXPORT_PAGE_TO_PDF,u.EXPORT_PAGE_TO_XLS];if(t===u.EXPORT_CURRENT_PAGE&&e.push(this.getCurrentPage()),s.includes(t)){let s=e.find((t=>t.id===u.EXPORT_CURRENT_PAGE));null==s&&(e.push(this.getCurrentPage()),s=e.find((t=>t.id===u.EXPORT_CURRENT_PAGE))),(null===(i=null==s?void 0:s.children)||void 0===i?void 0:i.length)||(s.children=[]),t===u.EXPORT_PAGE_TO_PDF&&s.children.push(this.getExportPageToPDF()),t===u.EXPORT_PAGE_TO_XLS&&s.children.push(this.getExportPageToXLS())}}setExportAllRecords(t,e){var i;const s=[u.EXPORT_ALL_RECORDS_TO_PDF,u.EXPORT_ALL_RECORDS_TO_XLS];if(t===u.EXPORT_ALL_RECORDS&&e.push(this.getAllRecords()),s.includes(t)){let s=e.find((t=>t.id===u.EXPORT_ALL_RECORDS));null==s&&(e.push(this.getAllRecords()),s=e.find((t=>t.id===u.EXPORT_ALL_RECORDS))),(null===(i=s.children)||void 0===i?void 0:i.length)||(s.children=[]),t===u.EXPORT_ALL_RECORDS_TO_PDF&&s.children.push(this.getExportAllRecordsToPDF()),t===u.EXPORT_ALL_RECORDS_TO_XLS&&s.children.push(this.getExportAllRecordsToXLS())}}setExportByEmail(t,e){t===u.EXPORT_BY_EMAIL&&e.push(this.getExportByEmail())}getExportToPDF(t){return{id:u.EXPORT_TO_PDF,label:"PDF (.pdf)",group:t}}getExportToXLS(t){return{id:u.EXPORT_TO_XLS,label:`${this._getMessage("snkDataExporter.label.spreadsheet")} (.xls)`,group:t}}getCurrentPage(){return{id:u.EXPORT_CURRENT_PAGE,label:this._getMessage("snkDataExporter.label.currentPage"),group:this._getMessage("snkDataExporter.group.custom")}}getAllRecords(){return{id:u.EXPORT_ALL_RECORDS,label:this._getMessage("snkDataExporter.label.allRecords"),group:this._getMessage("snkDataExporter.group.custom")}}getExportPageToPDF(){return{id:u.EXPORT_PAGE_TO_PDF,label:"PDF (.pdf)"}}getExportPageToXLS(){return{id:u.EXPORT_PAGE_TO_XLS,label:`${this._getMessage("snkDataExporter.label.spreadsheet")} (.xls)`}}getExportAllRecordsToPDF(){return{id:u.EXPORT_ALL_RECORDS_TO_PDF,label:"PDF (.pdf)"}}getExportAllRecordsToXLS(){return{id:u.EXPORT_ALL_RECORDS_TO_XLS,label:`${this._getMessage("snkDataExporter.label.spreadsheet")} (.xlsx)`}}getExportByEmail(){return{id:u.EXPORT_BY_EMAIL,label:`${this._getMessage("snkDataExporter.label.sendByEmail")}...`}}getExportGroupName(){return 1===this._selectedNumber?this._getMessage("snkDataExporter.group.export.selectedLine"):this._selectedNumber>1?this._getMessage("snkDataExporter.group.export.multiSelected").replace("{0}",this._selectedNumber.toString()):this._getMessage("snkDataExporter.group.export.default")}}function b(t){const e=[];let i=0;for(const s of t){if(i+=s.width,i>=860)break;e.push(s)}return e}function E(t){return Object.keys(u).find((e=>u[e]===t))}class w{constructor(t){this._provider=t}async getParsedColumns(){return b(await this._provider.getColumnsMetadata())}async getColumns(t){var e;return(null===(e=E(null==t?void 0:t.exportOption))||void 0===e?void 0:e.includes("PDF"))?await this.getParsedColumns():await this._provider.getColumnsMetadata()}async getParams(t){var e,i,s,o,r,n;const l=null===(i=(e=this._provider).getFilters)||void 0===i?void 0:i.call(e),a=await this.getColumns(t),d=null===(o=(s=this._provider).getOrders)||void 0===o?void 0:o.call(s),h=null===(n=(r=this._provider).getResourceURI)||void 0===n?void 0:n.call(r),c=this._provider.getSelectedIDs(),p=t.exportOption,m=[u.EXPORT_PAGE_TO_PDF,u.EXPORT_PAGE_TO_XLS];delete t.exportOption;let v=Object.assign({filters:l,columns:a,sort:d,resourceURI:h,selectedIDs:c.slice(0,this._provider.getExportLimit())},t);if(m.includes(p)||"page"==t.type){const t=this._provider.getOffset(),e=this._provider.getPageSize();v=Object.assign(Object.assign({},v),{offset:t,limit:e,selectedIDs:[]})}else"all"==t.type&&(v=Object.assign(Object.assign({},v),{offset:0,limit:this._provider.getExportLimit(),selectedIDs:[]}));return Promise.resolve(v)}async executeExport(t){const e=await this.getParams(t),{methodName:i}=e,s=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(s=Object.getOwnPropertySymbols(t);o<s.length;o++)e.indexOf(s[o])<0&&Object.prototype.propertyIsEnumerable.call(t,s[o])&&(i[s[o]]=t[s[o]])}return i}(e,["methodName"]),n=`${o.getContextValue("__SNK__APPLICATION__").getModuleName()}@DataExporterSPBean.${i}`,l={serviceName:n,requestBody:s};return new Promise(((t,e)=>{x.get().callServiceBroker(n,r.objectToString(l)).then((e=>t(this.getFormatResponse(e)))).catch((t=>e(t)))}))}getFormatResponse(t){var e;const i=null===(e=null==t?void 0:t.json)||void 0===e?void 0:e.$;if(null!=i)return r.stringToObject(i)}}class D{constructor(t){this._provider=t}async getParsedColumns(){return b(await this._provider.getColumnsMetadata())}async executeExport(t){var e;const{methodName:i,gridTitle:s}=t,o=await this._provider.getRecords(t.type),r=(null===(e=E(null==t?void 0:t.exportOption))||void 0===e?void 0:e.includes("PDF"))?await this.getParsedColumns():await this._provider.getColumnsMetadata(),[n,l]=this.getExecutor(i),a={serviceName:n,requestBody:{grid:{gridTitle:s,columns:this.buildColumnsObject(r),rows:this.buildRowsObject(r,o),customOptions:{xlsxExtension:!1}}}};return new Promise(((t,e)=>{x.get().callServiceBroker(n,a).then((e=>t(l(e)))).catch((t=>e(t)))}))}getExecutor(t){return"exportToPDF"===t?["GridPDFBuilderSP.buildPDFFromJson",t=>({fileSessionKey:t.chavePDF.valor,canPrint:"S"===t.permiteImprimir.valor,canExport:"S"===t.permiteExportar.valor,canSendEmail:"S"===t.canSendEmail.valor,useAppPrint:!0})]:["GridXLSBuilderSP.buildXLSFromJson",t=>({fileSessionKey:t.chaveXLS.valor,canPrint:!0,canExport:!0,canSendEmail:!0,useAppPrint:!1})]}buildColumnsObject(t){return{column:t.map(((t,e)=>{const{label:i,id:s,width:o,userInterface:r}=t;return Object.assign({index:e+1,id:s,label:i,width:o,presentationType:"P"},k[r]||{type:"S",align:"left"})}))}}buildRowsObject(t,e){return{row:e.map((e=>{const i={};return t.forEach(((t,s)=>i["c"+(s+1)]={$:this.formatValue(e,t)})),i}))}}formatValue(t,e){return null!=this._provider.formatValue?this._provider.formatValue(t,e):t[e.id]||""}}const k={[n.DATE]:{type:"D",align:"center"},[n.DATETIME]:{type:"H",align:"center"},[n.TIME]:{type:"I",align:"right"},[n.ELAPSEDTIME]:{type:"I",align:"right"},[n.DECIMALNUMBER]:{type:"F",align:"right"},[n.INTEGERNUMBER]:{type:"I",align:"right"},[n.SEARCH]:{type:"S",align:"right"}},y=class{constructor(e){t(this,e),this._selectedNumber=0,this._customPrefix="$custom$",this._releasedToExport=[u.EXPORT_TO_PDF,u.EXPORT_TO_XLS,u.EXPORT_BY_EMAIL,u.EXPORT_PDF_TO_EMAIL,u.EXPORT_XLS_TO_EMAIL,u.EXPORT_PAGE_TO_PDF,u.EXPORT_PAGE_TO_XLS,u.EXPORT_ALL_RECORDS_TO_PDF,u.EXPORT_ALL_RECORDS_TO_XLS],this._items=[],this._showDropdown=!1,this.provider=null,this.messagesBuilder=void 0}async exportByEmail(){const t=this._selectedNumber;this._snkEmailSender.open({type:t>0?"selection":"all",selectedRows:t,email:{attachments:[{name:this._appLabel}]},resolver:({type:t,format:e,email:{to:i,subject:s,message:o}})=>{var r;const n=null!==(r=m[null==e?void 0:e.toUpperCase()])&&void 0!==r?r:m.PDF;this.resolveExporter({type:t,methodName:n,to:i,subject:s,message:o,fileName:this._appLabel,gridTitle:this._appLabel},(()=>{this._snkEmailSender.close(),d.info(this.getMessage("snkDataExporter.message.emailSuccess"),{iconName:"check"})}))}})}getMessage(t,e){if(null==this.messagesBuilder){const t=g.getNearestInstance(this._element);t&&(this.messagesBuilder=t.messagesBuilder)}return this.messagesBuilder.getMessage(t,e)}positionDropdown(){var t;const e=null===(t=this._ezButton)||void 0===t?void 0:t.getBoundingClientRect();null!=e&&null!=this._dropdownParent&&(this._dropdownParent.style.top=e.y+e.height+5+"px",this._dropdownParent.style.left=e.x+"px")}closeDropdown(t){const e=null==t?void 0:t.target;null!=e&&(e.closest(".snk-data-exporter")||(this._showDropdown=!1))}setEvents(){document.removeEventListener("click",this.closeDropdown.bind(this)),document.addEventListener("click",this.closeDropdown.bind(this)),document.removeEventListener("scroll",this.positionDropdown.bind(this)),document.addEventListener("scroll",this.positionDropdown.bind(this))}controlDropdown(){this._showDropdown=!this._showDropdown}async resolveExporter(t,e){null!=this.provider&&null!=t&&null!=e&&this.getExporterStrategy().executeExport(t).then((t=>e(t))).catch((t=>{console.error(t);let{title:e,message:i,statusMessage:s}=t||{};d.error(e||this.getMessage("snkDataExporter.message.exportError"),s||i||this.getMessage("snkDataExporter.message.unknownFailure"))}))}getExporterStrategy(){return null==this.provider.getRecords?new w(this.provider):new D(this.provider)}getOptionKey(t){return Object.keys(u).find((e=>u[e]===t))}getExportType(t){return t===u.EXPORT_ALL_RECORDS_TO_PDF||t===u.EXPORT_ALL_RECORDS_TO_XLS?c.ALL:t===u.EXPORT_PAGE_TO_PDF||t===u.EXPORT_PAGE_TO_XLS?c.PAGE:c.SELECTION}async dispatchExporter(t){var e,i,s;const r=this.getOptionKey(t),n=null!==(e=p[r])&&void 0!==e?e:p.EXPORT_TO_PDF,l={methodName:u[`EXPORT_TO_${n}`],fileName:this._appLabel,gridTitle:this._appLabel,exportOption:t,limit:null===(s=null===(i=this.provider)||void 0===i?void 0:i.getExportLimit)||void 0===s?void 0:s.call(i),type:this.getExportType(t)};await this.resolveExporter(l,(t=>{t.canExport||n===p.EXPORT_TO_PDF?function({fileSessionKey:t,isDownload:e}){const i=o.getContextValue("__SNK__APPLICATION__");window.open(`${window.location.protocol}//${window.location.hostname}:${window.location.port}/mge/visualizadorArquivos.mge?chaveArquivo=${t}${e?"&download=S":""}`),d.info(function(t){var e;return null===(e=null==t?void 0:t.messagesBuilder)||void 0===e?void 0:e.getMessage("fileViewer.message.exportSuccess",void 0)}(i),{iconName:"check"})}(Object.assign(Object.assign({},t),{fileType:n})):d.error(this.getMessage("snkDataExporter.title.permission"),this.getMessage("snkDataExporter.message.exportPermission"))}))}async processExporter(t){var e,i,s,o,r,n,l;const a=null==t?void 0:t.detail,c=[u.EXPORT_PAGE_TO_PDF,u.EXPORT_PAGE_TO_XLS],p=null===(e=null==a?void 0:a.id)||void 0===e?void 0:e.includes(this._customPrefix);if((null==a?void 0:a.id)===u.EXPORT_CURRENT_PAGE)return;const m=null===(i=this.provider)||void 0===i?void 0:i.getSelectedIDs(),v=null===(s=this.provider)||void 0===s?void 0:s.getTotalRecords(),x=null===(r=null===(o=this.provider)||void 0===o?void 0:o.getPageSize)||void 0===r?void 0:r.call(o),g=null===(l=null===(n=this.provider)||void 0===n?void 0:n.getExportLimit)||void 0===l?void 0:l.call(n);let f=!1;if(c.includes(null==a?void 0:a.id)&&x<=g||p?f=!1:(null==m?void 0:m.length)?f=m.length>g:v>g&&(f=!0),f){const t=g.toLocaleString("pt-BR",{minimumFractionDigits:0}),e={title:this.getMessage("snkDataExporter.limitExceeded.title"),description:`\n ${this.getMessage("snkDataExporter.limitExceeded.description",{limit:t})}\n <br/><br/>\n <b>\n ${this.getMessage("snkDataExporter.limitExceeded.subdescription")}\n </b>\n `,cancel:this.getMessage("snkDataExporter.limitExceeded.cancel"),confirm:this.getMessage("snkDataExporter.limitExceeded.continue")};if(!await d.confirm(e.title,e.description,null,h.WARN,{labelCancel:e.cancel,labelConfirm:e.confirm}))return}if(p)return this.openPersonalizedReports(a.id),void(this._showDropdown=!1);this.getFilteredReleasedToExport().includes(null==a?void 0:a.id)&&(a.id===u.EXPORT_BY_EMAIL?this.exportByEmail():this.dispatchExporter(a.id),this._showDropdown=!1)}getFilteredReleasedToExport(){var t,e;if(null==this.provider)return this._releasedToExport;const i=null===(e=(t=this.provider).getHiddenOptions)||void 0===e?void 0:e.call(t);return null==i?this._releasedToExport:this._releasedToExport.filter((t=>!i.includes(t)))}loadItems(){const t=[];this.getFilteredReleasedToExport().forEach((e=>{var i;null===(i=this._itemBuilder)||void 0===i||i.setExportOption(e,t)})),this.loadPersonalizedItems(t)}async loadPersonalizedItems(t){var e,i;const s=null===(i=null===(e=this.provider)||void 0===e?void 0:e.getRecordID)||void 0===i?void 0:i.call(e);if(null==s)return void(this._items=t);const n=await function(t){const e=`${o.getContextValue("__SNK__APPLICATION__").getModuleName()}@DataExporterSPBean.getPersonalizedReports`,i={serviceName:e,requestBody:t};return new Promise(((t,s)=>x.get().callServiceBroker(e,r.objectToString(i)).then((e=>t(function(t){var e;const i=null===(e=null==t?void 0:t.json)||void 0===e?void 0:e.$;if(null!=i)return r.stringToObject(i)}(e)))).catch((t=>s(t)))))}({recordID:s});null==n||n.forEach((e=>{t.push({id:`${this._customPrefix}_${e.ID}`,label:e.label,group:this.getMessage("snkDataExporter.group.custom")})})),this._items=t}openPersonalizedReports(t){var e,i;const s=[],o=(null==t?void 0:t.replace(this._customPrefix,""))||"";null===(i=null===(e=this.provider)||void 0===e?void 0:e.getSelectedIDs)||void 0===i||i.call(e).forEach((({name:t,type:e,value:i},o)=>{const r={fields:[]};0===o&&(s[`PK_${t}`]={type:this.parseDataType(e),value:i},s.pks=[]);const n={nome:`PK_${t}`,tipo:this.parseDataType(e),valor:i};r.fields.push(n),s.pks.push(r)})),this._application.openApp(`${v}${o}`,s)}parseDataType(t){switch(t){case l.NUMBER:return"I";case l.DATE:return"D";default:return"S"}}loadDropdown(){var t;this._selectedNumber=(null===(t=this.provider)||void 0===t?void 0:t.getSelectedNumber())||0,this._itemBuilder=new f(this.getMessage.bind(this),this._selectedNumber),this.loadItems()}getElementID(t){return{[a.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:a.getInternalIDInfo(t)}}canShowDropdown(){var t;return this._showDropdown&&(null===(t=this._items)||void 0===t?void 0:t.length)>0}componentWillLoad(){var t;this._application=o.getContextValue("__SNK__APPLICATION__"),null===(t=this._application)||void 0===t||t.getAppLabel().then((t=>this._appLabel=t)),this.setEvents()}componentDidLoad(){null!=this._element&&(a.addIDInfo(this._element),this.positionDropdown())}componentWillUpdate(){var t;this._showDropdown&&!(null===(t=this._items)||void 0===t?void 0:t.length)&&this.loadDropdown()}componentDidUpdate(){var t;this._showDropdown?this.positionDropdown():(null===(t=this._items)||void 0===t?void 0:t.length)>0&&(this._items=[])}render(){return e(i,null,e("div",{class:`snk-data-exporter\n ${this.canShowDropdown()?" ez-elevation--16":""}\n `},e("ez-button",Object.assign({ref:t=>this._ezButton=t,iconName:"file-download",size:"small",mode:"icon",title:this.getMessage("snkDataExporter.group.export.title"),onClick:()=>this.controlDropdown()},this.getElementID("button"))),e("div",Object.assign({ref:t=>this._dropdownParent=t,class:`snk-data-exporter__dropdown\n ${this.canShowDropdown()?"snk-data-exporter__dropdown--show":""}\n `},this.getElementID("dropdown")),this.canShowDropdown()&&e("ez-dropdown",Object.assign({items:this._items,onEzClick:t=>this.processExporter(t)},this.getElementID("dropdown"))))),this.canShowDropdown()&&e("div",Object.assign({class:"ez-scrim ez-scrim--light"},this.getElementID("ezScrim"))),e("snk-exporter-email-sender",Object.assign({ref:t=>this._snkEmailSender=t,getMessage:(t,e)=>this.getMessage(t,e)},this.getElementID("snkExporterEmailSender"))))}get _element(){return s(this)}};y.style=".sc-snk-data-exporter-h{display:flex;width:fit-content;height:fit-content}.snk-data-exporter.sc-snk-data-exporter{display:flex;width:fit-content;height:fit-content}.snk-data-exporter__dropdown.sc-snk-data-exporter{display:none}.snk-data-exporter__dropdown--show.sc-snk-data-exporter{display:flex;flex-direction:column;position:fixed}.snk-data-exporter__dropdown.sc-snk-data-exporter>ez-dropdown.sc-snk-data-exporter{position:relative}";export{y as snk_data_exporter}
1
+ import{r as t,h as e,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-cdda05e3.js";import{S as f}from"./p-6a11f754.js";import"./p-403c0168.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-42e248cd.js";import"./p-ff1990ad.js";import"./p-1273039f.js";import"./p-8d884fab.js";import"@sankhyalabs/core/dist/dataunit/metadata/DataType";import"./p-7dd49d15.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";class g{constructor(t,e){this._selectedNumber=0,this._getMessage=t,this._selectedNumber=e}setExportOption(t,e){const i=this.getExportGroupName();t===u.EXPORT_TO_PDF&&e.push(this.getExportToPDF(i)),t===u.EXPORT_TO_XLS&&e.push(this.getExportToXLS(i)),this.setExportCurrentPage(t,e),this._selectedNumber>0&&this.setExportAllRecords(t,e),this.setExportByEmail(t,e)}setExportCurrentPage(t,e){var i;const s=[u.EXPORT_PAGE_TO_PDF,u.EXPORT_PAGE_TO_XLS];if(t===u.EXPORT_CURRENT_PAGE&&e.push(this.getCurrentPage()),s.includes(t)){let s=e.find((t=>t.id===u.EXPORT_CURRENT_PAGE));null==s&&(e.push(this.getCurrentPage()),s=e.find((t=>t.id===u.EXPORT_CURRENT_PAGE))),(null===(i=null==s?void 0:s.children)||void 0===i?void 0:i.length)||(s.children=[]),t===u.EXPORT_PAGE_TO_PDF&&s.children.push(this.getExportPageToPDF()),t===u.EXPORT_PAGE_TO_XLS&&s.children.push(this.getExportPageToXLS())}}setExportAllRecords(t,e){var i;const s=[u.EXPORT_ALL_RECORDS_TO_PDF,u.EXPORT_ALL_RECORDS_TO_XLS];if(t===u.EXPORT_ALL_RECORDS&&e.push(this.getAllRecords()),s.includes(t)){let s=e.find((t=>t.id===u.EXPORT_ALL_RECORDS));null==s&&(e.push(this.getAllRecords()),s=e.find((t=>t.id===u.EXPORT_ALL_RECORDS))),(null===(i=s.children)||void 0===i?void 0:i.length)||(s.children=[]),t===u.EXPORT_ALL_RECORDS_TO_PDF&&s.children.push(this.getExportAllRecordsToPDF()),t===u.EXPORT_ALL_RECORDS_TO_XLS&&s.children.push(this.getExportAllRecordsToXLS())}}setExportByEmail(t,e){t===u.EXPORT_BY_EMAIL&&e.push(this.getExportByEmail())}getExportToPDF(t){return{id:u.EXPORT_TO_PDF,label:"PDF (.pdf)",group:t}}getExportToXLS(t){return{id:u.EXPORT_TO_XLS,label:`${this._getMessage("snkDataExporter.label.spreadsheet")} (.xls)`,group:t}}getCurrentPage(){return{id:u.EXPORT_CURRENT_PAGE,label:this._getMessage("snkDataExporter.label.currentPage"),group:this._getMessage("snkDataExporter.group.custom")}}getAllRecords(){return{id:u.EXPORT_ALL_RECORDS,label:this._getMessage("snkDataExporter.label.allRecords"),group:this._getMessage("snkDataExporter.group.custom")}}getExportPageToPDF(){return{id:u.EXPORT_PAGE_TO_PDF,label:"PDF (.pdf)"}}getExportPageToXLS(){return{id:u.EXPORT_PAGE_TO_XLS,label:`${this._getMessage("snkDataExporter.label.spreadsheet")} (.xls)`}}getExportAllRecordsToPDF(){return{id:u.EXPORT_ALL_RECORDS_TO_PDF,label:"PDF (.pdf)"}}getExportAllRecordsToXLS(){return{id:u.EXPORT_ALL_RECORDS_TO_XLS,label:`${this._getMessage("snkDataExporter.label.spreadsheet")} (.xlsx)`}}getExportByEmail(){return{id:u.EXPORT_BY_EMAIL,label:`${this._getMessage("snkDataExporter.label.sendByEmail")}...`}}getExportGroupName(){return 1===this._selectedNumber?this._getMessage("snkDataExporter.group.export.selectedLine"):this._selectedNumber>1?this._getMessage("snkDataExporter.group.export.multiSelected").replace("{0}",this._selectedNumber.toString()):this._getMessage("snkDataExporter.group.export.default")}}function E(t){const e=[];let i=0;for(const s of t){if(i+=s.width,i>=860)break;e.push(s)}return e}function b(t){return Object.keys(u).find((e=>u[e]===t))}class w{constructor(t){this._provider=t}async getParsedColumns(){return E(await this._provider.getColumnsMetadata())}async getColumns(t){var e;return(null===(e=b(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 E(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=b(null==t?void 0:t.exportOption))||void 0===e?void 0:e.includes("PDF"))?await this.getParsedColumns():await this._provider.getColumnsMetadata(),[n,l]=this.getExecutor(i),a={serviceName:n,requestBody:{grid:{gridTitle:s,columns:this.buildColumnsObject(r),rows:this.buildRowsObject(r,o),customOptions:{xlsxExtension:!1}}}};return new Promise(((t,e)=>{x.get().callServiceBroker(n,a).then((e=>t(l(e)))).catch((t=>e(t)))}))}getExecutor(t){return"exportToPDF"===t?["GridPDFBuilderSP.buildPDFFromJson",t=>({fileSessionKey:t.chavePDF.valor,canPrint:"S"===t.permiteImprimir.valor,canExport:"S"===t.permiteExportar.valor,canSendEmail:"S"===t.canSendEmail.valor,useAppPrint:!0})]:["GridXLSBuilderSP.buildXLSFromJson",t=>({fileSessionKey:t.chaveXLS.valor,canPrint:!0,canExport:!0,canSendEmail:!0,useAppPrint:!1})]}buildColumnsObject(t){return{column:t.map(((t,e)=>{const{label:i,id:s,width:o,userInterface:r}=t;return Object.assign({index:e+1,id:s,label:i,width:o,presentationType:"P"},k[r]||{type:"S",align:"left"})}))}}buildRowsObject(t,e){return{row:e.map((e=>{const i={};return t.forEach(((t,s)=>i["c"+(s+1)]={$:this.formatValue(e,t)})),i}))}}formatValue(t,e){return null!=this._provider.formatValue?this._provider.formatValue(t,e):t[e.id]||""}}const k={[n.DATE]:{type:"D",align:"center"},[n.DATETIME]:{type:"H",align:"center"},[n.TIME]:{type:"I",align:"right"},[n.ELAPSEDTIME]:{type:"I",align:"right"},[n.DECIMALNUMBER]:{type:"F",align:"right"},[n.INTEGERNUMBER]:{type:"I",align:"right"},[n.SEARCH]:{type:"S",align:"right"}},y=class{constructor(e){t(this,e),this._selectedNumber=0,this._customPrefix="$custom$",this._releasedToExport=[u.EXPORT_TO_PDF,u.EXPORT_TO_XLS,u.EXPORT_BY_EMAIL,u.EXPORT_PDF_TO_EMAIL,u.EXPORT_XLS_TO_EMAIL,u.EXPORT_PAGE_TO_PDF,u.EXPORT_PAGE_TO_XLS,u.EXPORT_ALL_RECORDS_TO_PDF,u.EXPORT_ALL_RECORDS_TO_XLS],this._items=[],this._showDropdown=!1,this.provider=null,this.messagesBuilder=void 0}async exportByEmail(){const t=this._selectedNumber;this._snkEmailSender.open({type:t>0?"selection":"all",selectedRows:t,email:{attachments:[{name:this._appLabel}]},resolver:({type:t,format:e,email:{to:i,subject:s,message:o}})=>{var r;const n=null!==(r=m[null==e?void 0:e.toUpperCase()])&&void 0!==r?r:m.PDF;this.resolveExporter({type:t,methodName:n,to:i,subject:s,message:o,fileName:this._appLabel,gridTitle:this._appLabel},(()=>{this._snkEmailSender.close(),d.info(this.getMessage("snkDataExporter.message.emailSuccess"),{iconName:"check"})}))}})}getMessage(t,e){if(null==this.messagesBuilder){const t=f.getNearestInstance(this._element);t&&(this.messagesBuilder=t.messagesBuilder)}return this.messagesBuilder.getMessage(t,e)}positionDropdown(){var t;const e=null===(t=this._ezButton)||void 0===t?void 0:t.getBoundingClientRect();null!=e&&null!=this._dropdownParent&&(this._dropdownParent.style.top=e.y+e.height+5+"px",this._dropdownParent.style.left=e.x+"px")}closeDropdown(t){const e=null==t?void 0:t.target;null!=e&&(e.closest(".snk-data-exporter")||(this._showDropdown=!1))}setEvents(){document.removeEventListener("click",this.closeDropdown.bind(this)),document.addEventListener("click",this.closeDropdown.bind(this)),document.removeEventListener("scroll",this.positionDropdown.bind(this)),document.addEventListener("scroll",this.positionDropdown.bind(this))}controlDropdown(){this._showDropdown=!this._showDropdown}async resolveExporter(t,e){null!=this.provider&&null!=t&&null!=e&&this.getExporterStrategy().executeExport(t).then((t=>e(t))).catch((t=>{console.error(t);let{title:e,message:i,statusMessage:s}=t||{};d.error(e||this.getMessage("snkDataExporter.message.exportError"),s||i||this.getMessage("snkDataExporter.message.unknownFailure"))}))}getExporterStrategy(){return null==this.provider.getRecords?new w(this.provider):new D(this.provider)}getOptionKey(t){return Object.keys(u).find((e=>u[e]===t))}getExportType(t){return t===u.EXPORT_ALL_RECORDS_TO_PDF||t===u.EXPORT_ALL_RECORDS_TO_XLS?c.ALL:t===u.EXPORT_PAGE_TO_PDF||t===u.EXPORT_PAGE_TO_XLS?c.PAGE:c.SELECTION}async dispatchExporter(t){var e,i,s;const r=this.getOptionKey(t),n=null!==(e=p[r])&&void 0!==e?e:p.EXPORT_TO_PDF,l={methodName:u[`EXPORT_TO_${n}`],fileName:this._appLabel,gridTitle:this._appLabel,exportOption:t,limit:null===(s=null===(i=this.provider)||void 0===i?void 0:i.getExportLimit)||void 0===s?void 0:s.call(i),type:this.getExportType(t)};await this.resolveExporter(l,(t=>{t.canExport||n===p.EXPORT_TO_PDF?function({fileSessionKey:t,isDownload:e}){const i=o.getContextValue("__SNK__APPLICATION__");window.open(`${window.location.protocol}//${window.location.hostname}:${window.location.port}/mge/visualizadorArquivos.mge?chaveArquivo=${t}${e?"&download=S":""}`),d.info(function(t){var e;return null===(e=null==t?void 0:t.messagesBuilder)||void 0===e?void 0:e.getMessage("fileViewer.message.exportSuccess",void 0)}(i),{iconName:"check"})}(Object.assign(Object.assign({},t),{fileType:n})):d.error(this.getMessage("snkDataExporter.title.permission"),this.getMessage("snkDataExporter.message.exportPermission"))}))}async processExporter(t){var e,i,s,o,r,n,l;const a=null==t?void 0:t.detail,c=[u.EXPORT_PAGE_TO_PDF,u.EXPORT_PAGE_TO_XLS],p=null===(e=null==a?void 0:a.id)||void 0===e?void 0:e.includes(this._customPrefix);if((null==a?void 0:a.id)===u.EXPORT_CURRENT_PAGE)return;const m=null===(i=this.provider)||void 0===i?void 0:i.getSelectedIDs(),v=null===(s=this.provider)||void 0===s?void 0:s.getTotalRecords(),x=null===(r=null===(o=this.provider)||void 0===o?void 0:o.getPageSize)||void 0===r?void 0:r.call(o),f=null===(l=null===(n=this.provider)||void 0===n?void 0:n.getExportLimit)||void 0===l?void 0:l.call(n);let g=!1;if(c.includes(null==a?void 0:a.id)&&x<=f||p?g=!1:(null==m?void 0:m.length)?g=m.length>f:v>f&&(g=!0),g){const t=f.toLocaleString("pt-BR",{minimumFractionDigits:0}),e={title:this.getMessage("snkDataExporter.limitExceeded.title"),description:`\n ${this.getMessage("snkDataExporter.limitExceeded.description",{limit:t})}\n <br/><br/>\n <b>\n ${this.getMessage("snkDataExporter.limitExceeded.subdescription")}\n </b>\n `,cancel:this.getMessage("snkDataExporter.limitExceeded.cancel"),confirm:this.getMessage("snkDataExporter.limitExceeded.continue")};if(!await d.confirm(e.title,e.description,null,h.WARN,{labelCancel:e.cancel,labelConfirm:e.confirm}))return}if(p)return this.openPersonalizedReports(a.id),void(this._showDropdown=!1);this.getFilteredReleasedToExport().includes(null==a?void 0:a.id)&&(a.id===u.EXPORT_BY_EMAIL?this.exportByEmail():this.dispatchExporter(a.id),this._showDropdown=!1)}getFilteredReleasedToExport(){var t,e;if(null==this.provider)return this._releasedToExport;const i=null===(e=(t=this.provider).getHiddenOptions)||void 0===e?void 0:e.call(t);return null==i?this._releasedToExport:this._releasedToExport.filter((t=>!i.includes(t)))}loadItems(){const t=[];this.getFilteredReleasedToExport().forEach((e=>{var i;null===(i=this._itemBuilder)||void 0===i||i.setExportOption(e,t)})),this.loadPersonalizedItems(t)}async loadPersonalizedItems(t){var e,i;const s=null===(i=null===(e=this.provider)||void 0===e?void 0:e.getRecordID)||void 0===i?void 0:i.call(e);if(null==s)return void(this._items=t);const n=await function(t){const e=`${o.getContextValue("__SNK__APPLICATION__").getModuleName()}@DataExporterSPBean.getPersonalizedReports`,i={serviceName:e,requestBody:t};return new Promise(((t,s)=>x.get().callServiceBroker(e,r.objectToString(i)).then((e=>t(function(t){var e;const i=null===(e=null==t?void 0:t.json)||void 0===e?void 0:e.$;if(null!=i)return r.stringToObject(i)}(e)))).catch((t=>s(t)))))}({recordID:s});null==n||n.forEach((e=>{t.push({id:`${this._customPrefix}_${e.ID}`,label:e.label,group:this.getMessage("snkDataExporter.group.custom")})})),this._items=t}openPersonalizedReports(t){var e,i;const s=[],o=(null==t?void 0:t.replace(this._customPrefix,""))||"";null===(i=null===(e=this.provider)||void 0===e?void 0:e.getSelectedIDs)||void 0===i||i.call(e).forEach((({name:t,type:e,value:i},o)=>{const r={fields:[]};0===o&&(s[`PK_${t}`]={type:this.parseDataType(e),value:i},s.pks=[]);const n={nome:`PK_${t}`,tipo:this.parseDataType(e),valor:i};r.fields.push(n),s.pks.push(r)})),this._application.openApp(`${v}${o}`,s)}parseDataType(t){switch(t){case l.NUMBER:return"I";case l.DATE:return"D";default:return"S"}}loadDropdown(){var t;this._selectedNumber=(null===(t=this.provider)||void 0===t?void 0:t.getSelectedNumber())||0,this._itemBuilder=new g(this.getMessage.bind(this),this._selectedNumber),this.loadItems()}getElementID(t){return{[a.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:a.getInternalIDInfo(t)}}canShowDropdown(){var t;return this._showDropdown&&(null===(t=this._items)||void 0===t?void 0:t.length)>0}componentWillLoad(){var t;this._application=o.getContextValue("__SNK__APPLICATION__"),null===(t=this._application)||void 0===t||t.getAppLabel().then((t=>this._appLabel=t)),this.setEvents()}componentDidLoad(){null!=this._element&&(a.addIDInfo(this._element),this.positionDropdown())}componentWillUpdate(){var t;this._showDropdown&&!(null===(t=this._items)||void 0===t?void 0:t.length)&&this.loadDropdown()}componentDidUpdate(){var t;this._showDropdown?this.positionDropdown():(null===(t=this._items)||void 0===t?void 0:t.length)>0&&(this._items=[])}render(){return e(i,null,e("div",{class:`snk-data-exporter\n ${this.canShowDropdown()?" ez-elevation--16":""}\n `},e("ez-button",Object.assign({ref:t=>this._ezButton=t,iconName:"file-download",size:"small",mode:"icon",title:this.getMessage("snkDataExporter.group.export.title"),onClick:()=>this.controlDropdown()},this.getElementID("button"))),e("div",Object.assign({ref:t=>this._dropdownParent=t,class:`snk-data-exporter__dropdown\n ${this.canShowDropdown()?"snk-data-exporter__dropdown--show":""}\n `},this.getElementID("dropdown")),this.canShowDropdown()&&e("ez-dropdown",Object.assign({items:this._items,onEzClick:t=>this.processExporter(t)},this.getElementID("dropdown"))))),this.canShowDropdown()&&e("div",Object.assign({class:"ez-scrim ez-scrim--light"},this.getElementID("ezScrim"))),e("snk-exporter-email-sender",Object.assign({ref:t=>this._snkEmailSender=t,getMessage:(t,e)=>this.getMessage(t,e)},this.getElementID("snkExporterEmailSender"))))}get _element(){return s(this)}};y.style=".sc-snk-data-exporter-h{display:flex;width:fit-content;height:fit-content}.snk-data-exporter.sc-snk-data-exporter{display:flex;width:fit-content;height:fit-content}.snk-data-exporter__dropdown.sc-snk-data-exporter{display:none}.snk-data-exporter__dropdown--show.sc-snk-data-exporter{display:flex;flex-direction:column;position:fixed}.snk-data-exporter__dropdown.sc-snk-data-exporter>ez-dropdown.sc-snk-data-exporter{position:relative}";export{y as snk_data_exporter}
@@ -0,0 +1 @@
1
+ import{ObjectUtils as t,StringUtils as i}from"@sankhyalabs/core";import{C as e}from"./p-a17e9ecd.js";import{F as s}from"./p-1273039f.js";import{a as r}from"./p-9019a32f.js";class n{constructor(t,i,e,s){this._resourceID=i,this._configName=t,this._onConfigChange=e,this._dataUnit=s}addFormLegacyConfig(t){this._configName&&e.addFormLegacyConfig(this._configName,t)}async loadConfig(){return new Promise((t=>{e.loadFormConfig(this._configName,this._resourceID).then((i=>{i=this.buildFormMetadataUITabs(i),this.setConfig(i),t(i)})).catch((t=>{console.warn(t)}))}))}getEmptyConfig(){return this.buildFormMetadataUITabs({fields:[],emptyConfig:!0},!0)}saveConfig(i){const s=t.copy(i);return new Promise((t=>{e.saveFormConfig(i,this._configName,this._resourceID).then((i=>{this.setConfig(Object.assign(Object.assign({},s),i)),t(Object.assign(Object.assign({},s),i))}))}))}saveCardState(t,i,s){return new Promise((r=>{var n;const l=(null===(n=this._config)||void 0===n?void 0:n.cardsState)||new Map,o=l.get(t);l.set(t,"fixed"===s?this.updateFixSequence(Object.assign(Object.assign({},o),{fixed:i.fixed}),l):Object.assign(Object.assign({},o),{[s]:i[s]})),e.saveCardState(l,this._configName,this._resourceID).then((t=>{this._config=Object.assign(Object.assign({},this._config),{cardsState:l}),r(t)}))}))}updateFixSequence(t,i){let e=-1;return Array.from(i.values()).forEach((i=>{i.fixed||delete t.fixSequence,null!=i.fixSequence&&(e=Math.max(e,i.fixSequence))})),t.fixed?t.fixSequence=e+1:delete t.fixSequence,t}hasConfig(t){var i;const e=null!=t?t:this._config;return!(!e||!(null===(i=e.fields)||void 0===i?void 0:i.length))}getFieldsList(t,i=!1){var e,s;const r=null===(e=this._config)||void 0===e?void 0:e.fields;return this.hasConfig()&&!i?r.map((({label:t,name:i,readOnly:e,visible:s,required:r,tab:n,group:l})=>{var o;if(null==t){const t=null===(o=this._dataUnit)||void 0===o?void 0:o.getField(i);if(!t)return;return Object.assign(Object.assign({},t),{name:null!=i?i:t.name,readOnly:null!=e?e:t.readOnly,visible:null!=s?s:t.visible,required:null!=r?r:t.required,tab:n,group:l})}return{name:i,label:t,readOnly:e,visible:s,required:r,tab:n,group:l}})).filter((i=>this.isFieldVisible(i,t))):this._dataUnit&&(null===(s=this._dataUnit.metadata)||void 0===s?void 0:s.fields)?this._dataUnit.metadata.fields.filter((i=>this.isFieldVisible(i,t))).map((({label:t,name:i,readOnly:e,visible:s,required:r,properties:n})=>({label:t,name:i,readOnly:e,visible:s,required:r,tab:null==n?void 0:n.UITabName}))):[]}isFieldVisible(t,e){if(void 0===t||!1===t.visible)return!1;if(null==e)return!0;const s=i.replaceAccentuatedCharsLower((t.label||t.name).toLocaleLowerCase()),r=i.replaceAccentuatedCharsLower(e.toLocaleLowerCase());return s.includes(r)}getFormConfig(t,i,e=!1){let s=this.getFieldsList(void 0,e);return i&&(s=s.filter((i=>{if(t){const e=t.getField(i.name);if(e&&e.readOnly)return!1}return!i.readOnly}))),Object.assign(Object.assign({},this._config),{fields:s})}setConfig(t){this.isLoaded=!0;const{cardsState:i,summary:e,defaultVars:s}=this._config||{};this._config=Object.assign({},t),i&&(this._config.cardsState=i),e&&(this._config.summary=e),s&&(this._config.defaultVars=s),this._onConfigChange&&this._onConfigChange(Object.assign({},this._config))}getConfig(t,i){return this.getFormConfig(t,i)}getFormConfigFetcher(){return null==this._formConfigFetcher&&(this._formConfigFetcher=new s),this._formConfigFetcher}async fetchUserAvailableConfigs(){return null!=this._configName?Promise.resolve(void 0):this.getFormConfigFetcher().fetchUserAvailableConfigs(this._configName,this._resourceID)}async fetchLegacyConfig(){return this.getFormConfigFetcher().fetchLegacyConfig(this._configName,this._resourceID)}async fetchDefaultConfig(){return this.getFormConfigFetcher().fetchDefaultConfig(this._configName,this._resourceID)}parseObjectList(t){return t?Array.isArray(t)?t:[t]:[]}buildFormMetadataUITabs(t,i=!1){var e,s,n;const l=this.hasConfig(t);if(!i&&(!this._dataUnit||l))return t;(t=this.getFormConfig(this._dataUnit,!1,!0)).tabs=this.parseObjectList(t.tabs),t.emptyConfig=!1,t.defaultConfiguration=!0;const o=null!==(s=null===(e=this._dataUnit.metadata)||void 0===e?void 0:e.fields)&&void 0!==s?s:[];for(const i of o){const e=t.fields.find((t=>t.name===i.name)),s=null===(n=i.properties)||void 0===n?void 0:n.UITabName;s&&s!==r.main&&(t.tabs.some((t=>t.label===s))||t.tabs.push({label:s,name:s,order:0,visible:!0}),e&&(e.tab=s))}return t}}export{n as S}
Binary file
@@ -1 +1 @@
1
- import{r as e,c as i,f as t,h as s,H as o,g as n}from"./p-d8d8169b.js";import{StringUtils as r,ObjectUtils as a}from"@sankhyalabs/core";import{S as l}from"./p-51833248.js";import{S as d,d as h,I as u}from"./p-8f73da95.js";import{a as c,G as p}from"./p-9019a32f.js";import{ApplicationUtils as g}from"@sankhyalabs/ezui/dist/collection/utils";const m=class{constructor(t){e(this,t),this.isEditingGuideName=i(this,"isEditingGuideName",7),this.isEditingGroupName=i(this,"isEditingGroupName",7),this.layoutChanged=i(this,"layoutChanged",7),this.setFieldListAsAvailable=i(this,"setFieldListAsAvailable",7),this.guideRenamed=i(this,"guideRenamed",7),this.ID_GROUPS="container-groups",this.ID_FIELDS="container-fields",this.reservedGuideNames=[c.main.toLowerCase(),c.general.toLocaleLowerCase()],this.groupsListMemory=[],this.groupsRefList=[],this.isEditGuideNameActive=!1,this.selectedGuide=void 0,this.groupsList=[],this.guideNames=[],this.dataUnit=void 0,this.messagesBuilder=void 0}onMessagesBuilderChange(){this.setCustomCSSProperties()}handleFieldConfigChanged({detail:e}){const i=this.groupsListMemory.find((i=>i.name===e.group));if(!i)return;const t=i.fields.map((i=>i.name===e.name?e:i)),s=this.groupsListMemory.map((e=>e.name===i.name?{name:e.name,fields:t}:e));this.applyGroupUpdate(s)}observeSelectedGuide(){this.isEditGuideNameActive=!1,t(this),this.isEditingGroupName.emit(!1)}observeGroupList(e){this.groupsListMemory=[...e]}observeIsEditGuideNameActive(e){this.isEditingGuideName.emit(e)}async addFieldToLayout(e){e.group=p.noGroup,e.tab=this.selectedGuide.name;const i=this.getFixedFieldsGroup(),t={name:p.noGroup,fields:i?[...i.fields,e]:[e]},s=i?[t,...this.groupsListMemory.slice(1)]:[t,...this.groupsListMemory];this.applyGroupUpdate(s)}getFixedFieldsGroup(){return this.groupsListMemory.find((e=>e.name===p.noGroup))}getMessage(e,i){return this.messagesBuilder.getMessage(e,i)}handleAddGroup(){const e={name:this.buildNewGroupName(),fields:[]},i=[...this.groupsListMemory,e];this.applyGroupUpdate(i)}buildNewGroupName(){var e,i;const t=this.getMessage("snkFormConfig.form.newGroup"),s=null!==(i=null===(e=this.groupsListMemory.filter((e=>e.name.includes(t))))||void 0===e?void 0:e.length)&&void 0!==i?i:0;return 0===s?t:`${t} (${s})`}makeDynamicFieldsContainersDraggable(){this.groupsList.filter((e=>e.name!==p.noGroup)).forEach((e=>{this.makeFieldContainerDraggable(this.getFieldsContainerId(e.name))}))}getFieldsContainerId(e){return`${this.ID_FIELDS}-${r.replaceBlankCharacters(e)}`}handleSortGroups(e){var i;const t=null===(i=e.to)||void 0===i?void 0:i.children;if(!t)return;const s=Array.from(t).map((e=>e.getAttribute("data-group-name"))),o=[],n=this.getFixedFieldsGroup();n&&o.push(n),s.forEach((e=>{const i=this.groupsListMemory.find((i=>i.name===e));i&&o.push(i)})),this.applyGroupUpdate(o)}handleFieldsChanged(e){let i=[...this.groupsListMemory];i=[...this.handleFieldsOnGroupUpdate(i,e,d.FROM)],i=[...this.handleFieldsOnGroupUpdate(i,e,d.TO)],this.applyGroupUpdate(i)}applyGroupUpdate(e){var i;return null===(i=this.groupsRefList)||void 0===i||i.forEach((e=>null==e?void 0:e.cancelEdition())),!a.equals(e,this.groupsListMemory)&&(this.groupsListMemory=[...e],this.layoutChanged.emit(this.groupsListMemory),!0)}handleFieldsOnGroupUpdate(e,i,t){const s=i[t];return s.id===u?e:this.updateGroupList(e,s,t,i)}updateGroupList(e,i,t,s){const o=i.getAttribute("data-group-name"),n={name:o,fields:h(s,t,o,this.selectedGuide.name)};return this.replaceGroup(e,n)}replaceGroup(e,i){return e.map((e=>e.name===i.name?i:e))}makeGroupsDraggable(){try{const e=this.getContainerElement(this.ID_GROUPS);if(!e)return;new l(e,{group:"groups",ghostClass:"ghost",direction:"horizontal",animation:15,onSort:e=>this.handleSortGroups(e)})}catch(e){console.error(this.getMessage("snkFormConfig.errors.failMakeGroupsDraggable"),this.ID_GROUPS)}}makeFieldContainerDraggable(e){try{const i=this.getContainerElement(e);if(!i)return;new l(i,{group:"fields",ghostClass:"ghost",direction:"vertical",animation:15,onAdd:e=>this.handleFieldsChanged(e),onRemove:e=>this.handleFieldsChanged(e),onSort:e=>this.handleFieldsChanged(e)})}catch(i){console.error(this.getMessage("snkFormConfig.errors.failMakeFieldContainerDraggable"),e)}}getContainerElement(e){return this.el.querySelector(`[id="${e}"]`)}handleSetFieldAsAvailable(e){var i;const t=null!==(i=e.group)&&void 0!==i?i:p.noGroup,s=this.groupsListMemory.find((e=>e.name===t)).fields.filter((i=>i.name!==e.name)),o=[...this.replaceGroup(this.groupsListMemory,{name:t,fields:s})];this.applyGroupUpdate(o)}removeGroup(e){var i,t;const s=null!==(t=null===(i=this.groupsListMemory.find((i=>i.name===e.name)))||void 0===i?void 0:i.fields)&&void 0!==t?t:[],o=[...this.groupsListMemory.filter((i=>i.name!==e.name))];this.applyGroupUpdate(o)&&this.setFieldListAsAvailable.emit(s)}handleRenameGroup(e){const{value:i,newValue:t}=e.detail,s=this.groupsListMemory.map((e=>{if(e.name!==i)return Object.assign({},e);const s=e.fields.map((e=>Object.assign(Object.assign({},e),{group:t})));return{name:t,fields:s}}));this.applyGroupUpdate(s)}canSaveGroup(e,i){if(!this.groupsList.some((i=>{var t;return(null!==(t=i.name)&&void 0!==t?t:"").toLocaleLowerCase()===(null!=e?e:"").toLocaleLowerCase()})))return!0;const t=this.getMessage("snkFormConfig.confirm.title"),s=this.buildDuplicatedGroupNameContent(e);return g.alert(t,s).then((()=>{var e;return null===(e=this.groupsRefList[i])||void 0===e?void 0:e.applyFocusTextEdit()})),!1}buildDuplicatedGroupNameContent(e){const i=this.selectedGuide.name;return`\n ${this.getMessage("snkFormConfig.alert.titleGroupExists")}\n <b>${e}</b>\n ${this.getMessage("snkFormConfig.alert.inTab")}\n <b>${i===c.main?this.getMessage("snkFormConfig.form.mainArea"):i}</b>.\n <br/><br/>\n ${this.getMessage("snkFormConfig.alert.infoValidTitle")}\n `}buildDuplicatedTabNameContent(e){return`\n ${this.getMessage("snkFormConfig.alert.titleGuideExists")}\n <b>${e}</b>.\n <br/><br/>\n ${this.getMessage("snkFormConfig.alert.infoValidTitle")}\n `}buildReservedTabNameContent(e){return`\n ${this.getMessage("snkFormConfig.alert.titleGuideReservedName")}\n <br/><br/>\n <b>${e}</b>.\n <br/><br/>\n ${this.getMessage("snkFormConfig.alert.infoValidTitle")}\n `}renderFields(e){if(0!==e.length)return e.map((e=>s("field-item",{key:e.name,fieldConfig:e,onLayoutConfig:!0,dataUnit:this.dataUnit,messagesBuilder:this.messagesBuilder,onSetFieldAsAvailable:e=>this.handleSetFieldAsAvailable(e.detail)})))}renderDraggableGroups(){return this.groupsList.filter((e=>e.name!==p.noGroup)).map(((e,i)=>{var t;return s("div",{key:e.name,class:"group-config","data-group-name":e.name},s("ez-collapsible-box",{ref:e=>this.groupsRefList[i]=e,label:e.name,headerSize:"large",editable:!0,removable:!0,"icon-placement":"left",onEzRemove:()=>this.removeGroup(e),onEzSaveEditLabel:e=>this.handleRenameGroup(e),onEzEditLabelMode:({detail:e})=>this.isEditingGroupName.emit(e),conditionalSave:e=>this.canSaveGroup(e,i)},s("div",{id:this.getFieldsContainerId(e.name),class:"group-content "+((null===(t=e.fields)||void 0===t?void 0:t.length)?"":"empty-content"),"data-group-name":e.name},this.renderFields(e.fields))))}))}renderFixedFields(){var e,i;const t=null!==(i=null===(e=this.groupsList.find((e=>e.name===p.noGroup)))||void 0===e?void 0:e.fields)&&void 0!==i?i:[];return this.renderFields(t)}handleRenameGuide(e){const{value:i,newValue:t}=e.detail;if(this.isEditGuideNameActive=!1,t===i)return;const s=this.guideNames.includes(t.toLowerCase()),o=this.reservedGuideNames.includes(t.toLowerCase());if(o||s){const e=this.getMessage("snkFormConfig.confirm.title"),i=o?this.buildReservedTabNameContent(t):this.buildDuplicatedTabNameContent(t);g.alert(e,i).then((()=>this._refTextEdit.applyFocusSelect()))}else this.guideRenamed.emit(t)}cancelEditGuideName(){this.isEditGuideNameActive=!1}async startGuideNameEdition(){this.isEditGuideNameActive=!0,setTimeout((async()=>{await this._refTextEdit.applyFocusSelect()}),200)}getTextEditStyle(){return{fontSize:"20px",fontWeight:"500",fontFamily:"Roboto"}}renderGuideName(){var e,i;return this.isEditGuideNameActive?s("div",{class:"guide-header"},s("ez-text-edit",{class:"collapsible-box__text-edit",ref:e=>this._refTextEdit=e,value:null===(e=this.selectedGuide)||void 0===e?void 0:e.label,styled:this.getTextEditStyle(),onSaveEdition:e=>this.handleRenameGuide(e),onCancelEdition:()=>this.cancelEditGuideName()})):s("div",{class:"guide-header"},s("span",{class:"guide-header-label"},null===(i=this.selectedGuide)||void 0===i?void 0:i.label),this.renderEditGuideNameButton())}renderEditGuideNameButton(){var e;if((null===(e=this.selectedGuide)||void 0===e?void 0:e.name)!==c.main)return s("ez-button",{mode:"icon",class:"ez-button--tertiary",onClick:()=>this.startGuideNameEdition(),size:"medium",iconName:"edit",title:this.getMessage("snkFormConfig.buttons.rename")})}setCustomCSSProperties(){document.documentElement.style.setProperty("--empty-content-message",`"${this.getMessage("snkFormConfig.form.labelDropField")}"`),document.documentElement.style.setProperty("--no-group-message",`"${this.getMessage("snkFormConfig.form.subTitleInfo")}"`)}componentDidRender(){this.makeGroupsDraggable(),this.makeDynamicFieldsContainersDraggable(),this.makeFieldContainerDraggable(p.noGroup),this.setCustomCSSProperties()}render(){return this.selectedGuide?s(o,{class:"ez-flex-item--auto ez-size-height--full ez-box ez-padding--medium content-container"},this.renderGuideName(),s("div",{class:"layout-container"},s("ez-scroller",{direction:"vertical",activeShadow:!0},s("div",{class:"no-group-container"},s("div",{id:p.noGroup,class:"group-content","data-group-name":p.noGroup},this.renderFixedFields())),s("hr",null),s("div",{id:this.ID_GROUPS,class:"groups-container"},this.renderDraggableGroups()))),s("div",{class:"add-group-container",onClick:this.handleAddGroup.bind(this)},s("ez-icon",{slot:"leftIcon",iconName:"plus"}),s("span",null,this.getMessage("snkFormConfig.form.createNewGroup")))):s(o,{class:"ez-flex-item--auto ez-size-height--full ez-box ez-padding--medium content-container"},s("span",{class:"no-guide-selected"},this.getMessage("snkFormConfig.form.noGuideSelected")))}get el(){return n(this)}static get watchers(){return{messagesBuilder:["onMessagesBuilderChange"],selectedGuide:["observeSelectedGuide"],groupsList:["observeGroupList"],isEditGuideNameActive:["observeIsEditGuideNameActive"]}}};m.style='.sc-fields-layout-h{display:flex;padding:12px;box-shadow:var(--shadow--small, 0 0 16px rgba(0, 38, 111, 0.07));border-radius:var(--border--radius-medium, 6px);height:var(--snk-form-config-container-height);flex-direction:column}.layout-container.sc-fields-layout{container-type:inline-size;display:flex;flex-direction:column;overflow:auto;height:calc(100vh - 225px)}.guide-header.sc-fields-layout{display:flex;width:100%;font-size:20px;border-bottom:1px solid #dce0e8;margin-bottom:6px;align-items:center;height:45px}.guide-header.sc-fields-layout ez-button.sc-fields-layout{transition:all 0.2s ease-in-out;visibility:hidden;opacity:0}.guide-header.sc-fields-layout:hover ez-button.sc-fields-layout{visibility:visible;opacity:1}.guide-header-label.sc-fields-layout{display:block;padding:10px 0}.group-config.sc-fields-layout{padding:12px 0;display:flex;flex-direction:column;width:100%}.group-content.sc-fields-layout{display:grid;gap:12px;min-height:65px;width:100%;padding:6px 0;grid-template-columns:repeat(auto-fill, minmax(250px, 1fr))}.group-content.empty-content.sc-fields-layout{position:relative}.group-content.empty-content.sc-fields-layout::before{content:var(--empty-content-message, "Arraste e solte um campo aqui");color:#cbcfd7;font-size:16px;font-weight:500;text-align:center;position:absolute;inset:0;display:flex;align-items:center;justify-content:center;pointer-events:none;transition:opacity 0.3s;height:100%;box-sizing:border-box;padding:10px;background:#f9f9f9;border:1px dashed #dce0e8;border-radius:6px}.no-group-container.sc-fields-layout{padding:12px 0;width:100%;border-bottom:1px solid #dce0e8}.no-group-container.sc-fields-layout::before{content:var(--no-group-message, "Inclua estes campos nos grupos ou deixe-os separados no topo do formulário");width:100%;display:block;font-size:16px;font-weight:400;color:#AFB6C0;padding-bottom:12px}.add-group-container.sc-fields-layout{display:flex;align-items:center;border-top:1px solid #dce0e8;padding-top:22px;padding-bottom:12px;gap:6px;cursor:pointer;justify-content:center;width:100%;height:55px}.no-guide-selected.sc-fields-layout{display:block;margin:auto;font-size:24px;color:#AFB6C0;font-weight:500}.ghost.sc-fields-layout{opacity:.5;background:#c8fbe2}';export{m as fields_layout}
1
+ import{r as e,c as i,f as t,h as s,H as o,g as n}from"./p-d8d8169b.js";import{StringUtils as a,ObjectUtils as r}from"@sankhyalabs/core";import{ApplicationUtils as l}from"@sankhyalabs/ezui/dist/collection/utils";import{S as d}from"./p-51833248.js";import{a as h,G as u}from"./p-9019a32f.js";import{S as c,e as g,I as p}from"./p-d68904a9.js";const m=class{constructor(t){e(this,t),this.isEditingGuideName=i(this,"isEditingGuideName",7),this.isEditingGroupName=i(this,"isEditingGroupName",7),this.layoutChanged=i(this,"layoutChanged",7),this.setFieldListAsAvailable=i(this,"setFieldListAsAvailable",7),this.guideRenamed=i(this,"guideRenamed",7),this.ID_GROUPS="container-groups",this.ID_FIELDS="container-fields",this.reservedGuideNames=[h.main.toLowerCase(),h.general.toLocaleLowerCase()],this.groupsListMemory=[],this.groupsRefList=[],this.isEditGuideNameActive=!1,this.selectedGuide=void 0,this.groupsList=[],this.guideNames=[],this.dataUnit=void 0,this.messagesBuilder=void 0}onMessagesBuilderChange(){this.setCustomCSSProperties()}handleFieldConfigChanged({detail:e}){const i=this.groupsListMemory.find((i=>i.name===e.group));if(!i)return;const t=i.fields.map((i=>i.name===e.name?e:i)),s=this.groupsListMemory.map((e=>e.name===i.name?{name:e.name,fields:t}:e));this.applyGroupUpdate(s)}observeSelectedGuide(){this.isEditGuideNameActive=!1,t(this),this.isEditingGroupName.emit(!1)}observeGroupList(e){this.groupsListMemory=[...e]}observeIsEditGuideNameActive(e){this.isEditingGuideName.emit(e)}async addFieldToLayout(e){e.group=u.noGroup,e.tab=this.selectedGuide.name;const i=this.getFixedFieldsGroup(),t={name:u.noGroup,fields:i?[...i.fields,e]:[e]},s=i?[t,...this.groupsListMemory.slice(1)]:[t,...this.groupsListMemory];this.applyGroupUpdate(s)}getFixedFieldsGroup(){return this.groupsListMemory.find((e=>e.name===u.noGroup))}getMessage(e,i){return this.messagesBuilder.getMessage(e,i)}handleAddGroup(){const e={name:this.buildNewGroupName(),fields:[]},i=[...this.groupsListMemory,e];this.applyGroupUpdate(i)}buildNewGroupName(){var e,i;const t=this.getMessage("snkFormConfig.form.newGroup"),s=null!==(i=null===(e=this.groupsListMemory.filter((e=>e.name.includes(t))))||void 0===e?void 0:e.length)&&void 0!==i?i:0;return 0===s?t:`${t} (${s})`}makeDynamicFieldsContainersDraggable(){this.groupsList.filter((e=>e.name!==u.noGroup)).forEach((e=>{this.makeFieldContainerDraggable(this.getFieldsContainerId(e.name))}))}getFieldsContainerId(e){return`${this.ID_FIELDS}-${a.replaceBlankCharacters(e)}`}handleSortGroups(e){var i;const t=null===(i=e.to)||void 0===i?void 0:i.children;if(!t)return;const s=Array.from(t).map((e=>e.getAttribute("data-group-name"))),o=[],n=this.getFixedFieldsGroup();n&&o.push(n),s.forEach((e=>{const i=this.groupsListMemory.find((i=>i.name===e));i&&o.push(i)})),this.applyGroupUpdate(o)}handleFieldsChanged(e){let i=[...this.groupsListMemory];i=[...this.handleFieldsOnGroupUpdate(i,e,c.FROM)],i=[...this.handleFieldsOnGroupUpdate(i,e,c.TO)],this.applyGroupUpdate(i)}applyGroupUpdate(e){var i;return null===(i=this.groupsRefList)||void 0===i||i.forEach((e=>null==e?void 0:e.cancelEdition())),!r.equals(e,this.groupsListMemory)&&(this.groupsListMemory=[...e],this.layoutChanged.emit(this.groupsListMemory),!0)}handleFieldsOnGroupUpdate(e,i,t){const s=i[t];return s.id===p?e:this.updateGroupList(e,s,t,i)}updateGroupList(e,i,t,s){const o=i.getAttribute("data-group-name"),n={name:o,fields:g(s,t,o,this.selectedGuide.name)};return this.replaceGroup(e,n)}replaceGroup(e,i){return e.map((e=>e.name===i.name?i:e))}makeGroupsDraggable(){try{const e=this.getContainerElement(this.ID_GROUPS);if(!e)return;new d(e,{group:"groups",ghostClass:"ghost",direction:"horizontal",animation:15,onSort:e=>this.handleSortGroups(e)})}catch(e){console.error(this.getMessage("snkFormConfig.errors.failMakeGroupsDraggable"),this.ID_GROUPS)}}makeFieldContainerDraggable(e){try{const i=this.getContainerElement(e);if(!i)return;new d(i,{group:"fields",ghostClass:"ghost",direction:"vertical",animation:15,onAdd:e=>this.handleFieldsChanged(e),onRemove:e=>this.handleFieldsChanged(e),onSort:e=>this.handleFieldsChanged(e)})}catch(i){console.error(this.getMessage("snkFormConfig.errors.failMakeFieldContainerDraggable"),e)}}getContainerElement(e){return this.el.querySelector(`[id="${e}"]`)}handleSetFieldAsAvailable(e){var i;const t=null!==(i=e.group)&&void 0!==i?i:u.noGroup,s=this.groupsListMemory.find((e=>e.name===t)).fields.filter((i=>i.name!==e.name)),o=[...this.replaceGroup(this.groupsListMemory,{name:t,fields:s})];this.applyGroupUpdate(o)}removeGroup(e){var i,t;const s=null!==(t=null===(i=this.groupsListMemory.find((i=>i.name===e.name)))||void 0===i?void 0:i.fields)&&void 0!==t?t:[],o=[...this.groupsListMemory.filter((i=>i.name!==e.name))];this.applyGroupUpdate(o)&&this.setFieldListAsAvailable.emit(s)}handleRenameGroup(e){const{value:i,newValue:t}=e.detail,s=this.groupsListMemory.map((e=>{if(e.name!==i)return Object.assign({},e);const s=e.fields.map((e=>Object.assign(Object.assign({},e),{group:t})));return{name:t,fields:s}}));this.applyGroupUpdate(s)}canSaveGroup(e,i){if(!this.groupsList.some((i=>{var t;return(null!==(t=i.name)&&void 0!==t?t:"").toLocaleLowerCase()===(null!=e?e:"").toLocaleLowerCase()})))return!0;const t=this.getMessage("snkFormConfig.confirm.title"),s=this.buildDuplicatedGroupNameContent(e);return l.alert(t,s).then((()=>{var e;return null===(e=this.groupsRefList[i])||void 0===e?void 0:e.applyFocusTextEdit()})),!1}buildDuplicatedGroupNameContent(e){const i=this.selectedGuide.name;return`\n ${this.getMessage("snkFormConfig.alert.titleGroupExists")}\n <b>${e}</b>\n ${this.getMessage("snkFormConfig.alert.inTab")}\n <b>${i===h.main?this.getMessage("snkFormConfig.form.mainArea"):i}</b>.\n <br/><br/>\n ${this.getMessage("snkFormConfig.alert.infoValidTitle")}\n `}buildDuplicatedTabNameContent(e){return`\n ${this.getMessage("snkFormConfig.alert.titleGuideExists")}\n <b>${e}</b>.\n <br/><br/>\n ${this.getMessage("snkFormConfig.alert.infoValidTitle")}\n `}buildReservedTabNameContent(e){return`\n ${this.getMessage("snkFormConfig.alert.titleGuideReservedName")}\n <br/><br/>\n <b>${e}</b>.\n <br/><br/>\n ${this.getMessage("snkFormConfig.alert.infoValidTitle")}\n `}renderFields(e){if(0!==e.length)return e.map((e=>s("field-item",{key:e.name,fieldConfig:e,onLayoutConfig:!0,dataUnit:this.dataUnit,messagesBuilder:this.messagesBuilder,onSetFieldAsAvailable:e=>this.handleSetFieldAsAvailable(e.detail)})))}renderDraggableGroups(){return this.groupsList.filter((e=>e.name!==u.noGroup)).map(((e,i)=>{var t;return s("div",{key:e.name,class:"group-config","data-group-name":e.name},s("ez-collapsible-box",{ref:e=>this.groupsRefList[i]=e,label:e.name,headerSize:"large",editable:!0,removable:!0,"icon-placement":"left",onEzRemove:()=>this.removeGroup(e),onEzSaveEditLabel:e=>this.handleRenameGroup(e),onEzEditLabelMode:({detail:e})=>this.isEditingGroupName.emit(e),conditionalSave:e=>this.canSaveGroup(e,i)},s("div",{id:this.getFieldsContainerId(e.name),class:"group-content "+((null===(t=e.fields)||void 0===t?void 0:t.length)?"":"empty-content"),"data-group-name":e.name},this.renderFields(e.fields))))}))}renderFixedFields(){var e,i;const t=null!==(i=null===(e=this.groupsList.find((e=>e.name===u.noGroup)))||void 0===e?void 0:e.fields)&&void 0!==i?i:[];return this.renderFields(t)}handleRenameGuide(e){const{value:i,newValue:t}=e.detail;if(this.isEditGuideNameActive=!1,t===i)return;const s=this.guideNames.includes(t.toLowerCase()),o=this.reservedGuideNames.includes(t.toLowerCase());if(o||s){const e=this.getMessage("snkFormConfig.confirm.title"),i=o?this.buildReservedTabNameContent(t):this.buildDuplicatedTabNameContent(t);l.alert(e,i).then((()=>this._refTextEdit.applyFocusSelect()))}else this.guideRenamed.emit(t)}cancelEditGuideName(){this.isEditGuideNameActive=!1}async startGuideNameEdition(){this.isEditGuideNameActive=!0,setTimeout((async()=>{await this._refTextEdit.applyFocusSelect()}),200)}getTextEditStyle(){return{fontSize:"20px",fontWeight:"500",fontFamily:"Roboto"}}renderGuideName(){var e,i;return this.isEditGuideNameActive?s("div",{class:"guide-header"},s("ez-text-edit",{class:"collapsible-box__text-edit",ref:e=>this._refTextEdit=e,value:null===(e=this.selectedGuide)||void 0===e?void 0:e.label,styled:this.getTextEditStyle(),onSaveEdition:e=>this.handleRenameGuide(e),onCancelEdition:()=>this.cancelEditGuideName()})):s("div",{class:"guide-header"},s("span",{class:"guide-header-label"},null===(i=this.selectedGuide)||void 0===i?void 0:i.label),this.renderEditGuideNameButton())}renderEditGuideNameButton(){var e;if((null===(e=this.selectedGuide)||void 0===e?void 0:e.name)!==h.main)return s("ez-button",{mode:"icon",class:"ez-button--tertiary",onClick:()=>this.startGuideNameEdition(),size:"medium",iconName:"edit",title:this.getMessage("snkFormConfig.buttons.rename")})}setCustomCSSProperties(){document.documentElement.style.setProperty("--empty-content-message",`"${this.getMessage("snkFormConfig.form.labelDropField")}"`),document.documentElement.style.setProperty("--no-group-message",`"${this.getMessage("snkFormConfig.form.subTitleInfo")}"`)}componentDidRender(){this.makeGroupsDraggable(),this.makeDynamicFieldsContainersDraggable(),this.makeFieldContainerDraggable(u.noGroup),this.setCustomCSSProperties()}render(){return this.selectedGuide?this.selectedGuide.isCustom||this.selectedGuide.isDetail?s(o,{class:"ez-flex-item--auto ez-size-height--full ez-box ez-padding--medium content-container"},s("div",{class:"message-container"},s("h1",{class:"no-guide-selected"},this.getMessage("snkFormConfig.form.canNotEditCustomGuide")),s("span",{class:"message-config-detail"},this.getMessage("snkFormConfig.form.canNotEditDetailGuide")))):s(o,{class:"ez-flex-item--auto ez-size-height--full ez-box ez-padding--medium content-container"},this.renderGuideName(),s("div",{class:"layout-container"},s("ez-scroller",{direction:"vertical",activeShadow:!0},s("div",{class:"no-group-container"},s("div",{id:u.noGroup,class:"group-content","data-group-name":u.noGroup},this.renderFixedFields())),s("hr",null),s("div",{id:this.ID_GROUPS,class:"groups-container"},this.renderDraggableGroups()))),s("div",{class:"add-group-container",onClick:this.handleAddGroup.bind(this)},s("ez-icon",{slot:"leftIcon",iconName:"plus"}),s("span",null,this.getMessage("snkFormConfig.form.createNewGroup")))):s(o,{class:"ez-flex-item--auto ez-size-height--full ez-box ez-padding--medium content-container"},s("span",{class:"no-guide-selected"},this.getMessage("snkFormConfig.form.noGuideSelected")))}get el(){return n(this)}static get watchers(){return{messagesBuilder:["onMessagesBuilderChange"],selectedGuide:["observeSelectedGuide"],groupsList:["observeGroupList"],isEditGuideNameActive:["observeIsEditGuideNameActive"]}}};m.style='.sc-fields-layout-h{display:flex;padding:12px;box-shadow:var(--shadow--small, 0 0 16px rgba(0, 38, 111, 0.07));border-radius:var(--border--radius-medium, 6px);height:var(--snk-form-config-container-height);flex-direction:column}.layout-container.sc-fields-layout{container-type:inline-size;display:flex;flex-direction:column;overflow:auto;height:calc(100vh - 225px)}.guide-header.sc-fields-layout{display:flex;width:100%;font-size:20px;border-bottom:1px solid #dce0e8;margin-bottom:6px;align-items:center;height:45px}.guide-header.sc-fields-layout ez-button.sc-fields-layout{transition:all 0.2s ease-in-out;visibility:hidden;opacity:0}.guide-header.sc-fields-layout:hover ez-button.sc-fields-layout{visibility:visible;opacity:1}.guide-header-label.sc-fields-layout{display:block;padding:10px 0}.group-config.sc-fields-layout{padding:12px 0;display:flex;flex-direction:column;width:100%}.group-content.sc-fields-layout{display:grid;gap:12px;min-height:65px;width:100%;padding:6px 0;grid-template-columns:repeat(auto-fill, minmax(250px, 1fr))}.group-content.empty-content.sc-fields-layout{position:relative}.group-content.empty-content.sc-fields-layout::before{content:var(--empty-content-message, "Arraste e solte um campo aqui");color:#cbcfd7;font-size:16px;font-weight:500;text-align:center;position:absolute;inset:0;display:flex;align-items:center;justify-content:center;pointer-events:none;transition:opacity 0.3s;height:100%;box-sizing:border-box;padding:10px;background:#f9f9f9;border:1px dashed #dce0e8;border-radius:6px}.no-group-container.sc-fields-layout{padding:12px 0;width:100%;border-bottom:1px solid #dce0e8}.no-group-container.sc-fields-layout::before{content:var(--no-group-message, "Inclua estes campos nos grupos ou deixe-os separados no topo do formulário");width:100%;display:block;font-size:16px;font-weight:400;color:#AFB6C0;padding-bottom:12px}.add-group-container.sc-fields-layout{display:flex;align-items:center;border-top:1px solid #dce0e8;padding-top:22px;padding-bottom:12px;gap:6px;cursor:pointer;justify-content:center;width:100%;height:55px}.no-guide-selected.sc-fields-layout{display:block;margin:auto;font-size:24px;color:#AFB6C0;font-weight:500}.message-container.sc-fields-layout{margin:auto;display:flex;flex-direction:column;justify-content:center;align-items:center}.message-config-detail.sc-fields-layout{display:block;margin:auto;font-size:var(--font-size--medium, 16px);color:#AFB6C0;font-weight:var(--font-weight--medium, 500)}.ghost.sc-fields-layout{opacity:.5;background:#c8fbe2}';export{m as fields_layout}