@sankhyalabs/sankhyablocks 8.16.0-rc.38 → 8.16.0-rc.39

Sign up to get free protection for your applications and to get access to all the features.
Files changed (696) hide show
  1. package/dist/cjs/AuthorizationConfig-79ffae4b.js.gz +0 -0
  2. package/dist/cjs/ConfigStorage-d024aec8.js.gz +0 -0
  3. package/dist/cjs/{ContinuousInsertUtils-54d44192.js → ContinuousInsertUtils-cab06826.js} +1 -1
  4. package/dist/cjs/ContinuousInsertUtils-cab06826.js.gz +0 -0
  5. package/dist/cjs/DataFetcher-65879b2c.js.gz +0 -0
  6. package/dist/cjs/GetSelectedRecordsIDsInfo-bd50caf1.js.gz +0 -0
  7. package/dist/cjs/ISave-e91b70a7.js.gz +0 -0
  8. package/dist/cjs/ParamType-90b440a0.js.gz +0 -0
  9. package/dist/cjs/PersonalizedFilterUtils-0184ffbb.js.gz +0 -0
  10. package/dist/cjs/PrintUtils-bcaeb82f.js.gz +0 -0
  11. package/dist/cjs/ResourceIDUtils-5ff86aa7.js.gz +0 -0
  12. package/dist/cjs/SnkFormConfigManager-ae3185b2.js.gz +0 -0
  13. package/dist/cjs/SnkMessageBuilder-bae64d0d.js.gz +0 -0
  14. package/dist/cjs/Sortable-fb1c4cbb.js.gz +0 -0
  15. package/dist/cjs/auth-fetcher-8480751c.js.gz +0 -0
  16. package/dist/cjs/constants-35ddd366.js.gz +0 -0
  17. package/dist/cjs/{dataunit-fetcher-8ea97d88.js → dataunit-fetcher-e4e787d6.js} +21 -7
  18. package/dist/cjs/dataunit-fetcher-e4e787d6.js.gz +0 -0
  19. package/dist/cjs/field-search-68e34bf4.js.gz +0 -0
  20. package/dist/cjs/filter-item-type.enum-a7ffdaa6.js.gz +0 -0
  21. package/dist/cjs/filter-type.enum-b14ce507.js.gz +0 -0
  22. package/dist/cjs/filterNumberVariation-d65332da.js.gz +0 -0
  23. package/dist/cjs/form-config-fetcher-90126e4c.js.gz +0 -0
  24. package/dist/cjs/index-102ba62d.js.gz +0 -0
  25. package/dist/cjs/index-1dfc7a6e.js.gz +0 -0
  26. package/dist/cjs/index-8d94b7e0.js.gz +0 -0
  27. package/dist/cjs/index-c5771aba.js.gz +0 -0
  28. package/dist/cjs/index-f9e81701.js.gz +0 -0
  29. package/dist/cjs/index.cjs.js.gz +0 -0
  30. package/dist/cjs/loader.cjs.js.gz +0 -0
  31. package/dist/cjs/pesquisa-fetcher-f3454c23.js.gz +0 -0
  32. package/dist/cjs/pesquisa-grid_2.cjs.entry.js +1 -1
  33. package/dist/cjs/pesquisa-grid_2.cjs.entry.js.gz +0 -0
  34. package/dist/cjs/presentationMode-52ec3bdd.js.gz +0 -0
  35. package/dist/cjs/sankhyablocks.cjs.js.gz +0 -0
  36. package/dist/cjs/snk-actions-button_5.cjs.entry.js +1 -1
  37. package/dist/cjs/snk-actions-button_5.cjs.entry.js.gz +0 -0
  38. package/dist/cjs/snk-actions-form.cjs.entry.js.gz +0 -0
  39. package/dist/cjs/snk-application.cjs.entry.js +1 -1
  40. package/dist/cjs/snk-application.cjs.entry.js.gz +0 -0
  41. package/dist/cjs/snk-attach.cjs.entry.js +1 -1
  42. package/dist/cjs/snk-attach.cjs.entry.js.gz +0 -0
  43. package/dist/cjs/snk-client-confirm.cjs.entry.js.gz +0 -0
  44. package/dist/cjs/snk-config-options_3.cjs.entry.js.gz +0 -0
  45. package/dist/cjs/snk-configurator.cjs.entry.js.gz +0 -0
  46. package/dist/cjs/snk-crud.cjs.entry.js +1 -1
  47. package/dist/cjs/snk-crud.cjs.entry.js.gz +0 -0
  48. package/dist/cjs/snk-custom-slot-elements.cjs.entry.js.gz +0 -0
  49. package/dist/cjs/snk-data-exporter.cjs.entry.js +2 -2
  50. package/dist/cjs/snk-data-exporter.cjs.entry.js.gz +0 -0
  51. package/dist/cjs/{snk-data-unit-72ef8777.js → snk-data-unit-c5995c46.js} +1 -1
  52. package/dist/cjs/snk-data-unit-c5995c46.js.gz +0 -0
  53. package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
  54. package/dist/cjs/snk-data-unit.cjs.entry.js.gz +0 -0
  55. package/dist/cjs/snk-detail-view.cjs.entry.js +2 -2
  56. package/dist/cjs/snk-detail-view.cjs.entry.js.gz +0 -0
  57. package/dist/cjs/snk-entity-list.cjs.entry.js.gz +0 -0
  58. package/dist/cjs/snk-exporter-email-sender.cjs.entry.js.gz +0 -0
  59. package/dist/cjs/snk-expression-group_2.cjs.entry.js.gz +0 -0
  60. package/dist/cjs/snk-field-config.cjs.entry.js.gz +0 -0
  61. package/dist/cjs/snk-filter-advanced-mode_2.cjs.entry.js.gz +0 -0
  62. package/dist/cjs/snk-filter-bar_4.cjs.entry.js.gz +0 -0
  63. package/dist/cjs/snk-filter-binary-select.cjs.entry.js.gz +0 -0
  64. package/dist/cjs/snk-filter-checkbox-list.cjs.entry.js.gz +0 -0
  65. package/dist/cjs/snk-filter-detail.cjs.entry.js.gz +0 -0
  66. package/dist/cjs/snk-filter-field-search_2.cjs.entry.js.gz +0 -0
  67. package/dist/cjs/snk-filter-modal-item.cjs.entry.js.gz +0 -0
  68. package/dist/cjs/snk-filter-multi-select.cjs.entry.js.gz +0 -0
  69. package/dist/cjs/snk-filter-number.cjs.entry.js.gz +0 -0
  70. package/dist/cjs/snk-filter-period.cjs.entry.js.gz +0 -0
  71. package/dist/cjs/snk-filter-search.cjs.entry.js.gz +0 -0
  72. package/dist/cjs/snk-filter-text.cjs.entry.js.gz +0 -0
  73. package/dist/cjs/snk-form-summary.cjs.entry.js.gz +0 -0
  74. package/dist/cjs/snk-form-view.cjs.entry.js.gz +0 -0
  75. package/dist/cjs/snk-grid.cjs.entry.js +2 -2
  76. package/dist/cjs/snk-grid.cjs.entry.js.gz +0 -0
  77. package/dist/cjs/{snk-guides-viewer-ea5d0907.js → snk-guides-viewer-cb53c237.js} +1 -1
  78. package/dist/cjs/snk-guides-viewer-cb53c237.js.gz +0 -0
  79. package/dist/cjs/snk-guides-viewer.cjs.entry.js +2 -2
  80. package/dist/cjs/snk-guides-viewer.cjs.entry.js.gz +0 -0
  81. package/dist/cjs/snk-personalized-filter-editor.cjs.entry.js.gz +0 -0
  82. package/dist/cjs/snk-personalized-filter.cjs.entry.js.gz +0 -0
  83. package/dist/cjs/snk-pesquisa.cjs.entry.js +1 -1
  84. package/dist/cjs/snk-pesquisa.cjs.entry.js.gz +0 -0
  85. package/dist/cjs/snk-print-selector.cjs.entry.js.gz +0 -0
  86. package/dist/cjs/snk-simple-bar.cjs.entry.js.gz +0 -0
  87. package/dist/cjs/snk-simple-crud.cjs.entry.js +2 -2
  88. package/dist/cjs/snk-simple-crud.cjs.entry.js.gz +0 -0
  89. package/dist/cjs/snk-tab-config.cjs.entry.js.gz +0 -0
  90. package/dist/cjs/snk-taskbar.cjs.entry.js.gz +0 -0
  91. package/dist/cjs/taskbar-elements-9ad1f9c0.js.gz +0 -0
  92. package/dist/cjs/teste-pesquisa.cjs.entry.js.gz +0 -0
  93. package/dist/collection/components/snk-actions-button/actions/enum/ActionsType.js.gz +0 -0
  94. package/dist/collection/components/snk-actions-button/actions/enum/ParamType.js.gz +0 -0
  95. package/dist/collection/components/snk-actions-button/actions/enum/RefreshType.js.gz +0 -0
  96. package/dist/collection/components/snk-actions-button/actions/executor/java.executor.js.gz +0 -0
  97. package/dist/collection/components/snk-actions-button/actions/executor/javascript.executor.js.gz +0 -0
  98. package/dist/collection/components/snk-actions-button/actions/executor/launch-screen.executor.js.gz +0 -0
  99. package/dist/collection/components/snk-actions-button/actions/executor/procedure.executor.js.gz +0 -0
  100. package/dist/collection/components/snk-actions-button/actions/factory/executor.factory.js.gz +0 -0
  101. package/dist/collection/components/snk-actions-button/actions/index.js.gz +0 -0
  102. package/dist/collection/components/snk-actions-button/actions/interfaces/IAction.js.gz +0 -0
  103. package/dist/collection/components/snk-actions-button/actions/interfaces/IExecSource.js.gz +0 -0
  104. package/dist/collection/components/snk-actions-button/actions/interfaces/IExecuteActions.js.gz +0 -0
  105. package/dist/collection/components/snk-actions-button/actions/interfaces/IExecuteActionsProps.js.gz +0 -0
  106. package/dist/collection/components/snk-actions-button/actions/interfaces/IResultParam.js.gz +0 -0
  107. package/dist/collection/components/snk-actions-button/clientEvent/index.js.gz +0 -0
  108. package/dist/collection/components/snk-actions-button/clientEvent/interfaces/IClientEventConfirm.js.gz +0 -0
  109. package/dist/collection/components/snk-actions-button/interfaces/index.js.gz +0 -0
  110. package/dist/collection/components/snk-actions-button/snk-actions-button.css.gz +0 -0
  111. package/dist/collection/components/snk-actions-button/snk-actions-button.js.gz +0 -0
  112. package/dist/collection/components/snk-actions-button/subcomponents/snk-actions-form.js.gz +0 -0
  113. package/dist/collection/components/snk-actions-button/subcomponents/snk-client-confirm.js.gz +0 -0
  114. package/dist/collection/components/snk-application/__mocks__/snk-application.js.gz +0 -0
  115. package/dist/collection/components/snk-application/errorhandler/snk-error-handler.js.gz +0 -0
  116. package/dist/collection/components/snk-application/request-listener/DebouncedRequestListener.js.gz +0 -0
  117. package/dist/collection/components/snk-application/request-listener/RequestListenerFactory.js.gz +0 -0
  118. package/dist/collection/components/snk-application/request-listener/RequestListenerLoadingBar.js.gz +0 -0
  119. package/dist/collection/components/snk-application/snk-application.css.gz +0 -0
  120. package/dist/collection/components/snk-application/snk-application.js.gz +0 -0
  121. package/dist/collection/components/snk-attach/interfaces/ICrudConfig.js.gz +0 -0
  122. package/dist/collection/components/snk-attach/interfaces/TFetcherType.js.gz +0 -0
  123. package/dist/collection/components/snk-attach/interfaces/index.js.gz +0 -0
  124. package/dist/collection/components/snk-attach/snk-attach.css.gz +0 -0
  125. package/dist/collection/components/snk-attach/snk-attach.js.gz +0 -0
  126. package/dist/collection/components/snk-attach/structure/builder/anexo-sistema-crud-config.builder.js.gz +0 -0
  127. package/dist/collection/components/snk-attach/structure/builder/attach-crud-config.builder.js.gz +0 -0
  128. package/dist/collection/components/snk-attach/structure/builder/taskbar-builder.js.gz +0 -0
  129. package/dist/collection/components/snk-attach/structure/fetcher/facade/fetcher.facade.js.gz +0 -0
  130. package/dist/collection/components/snk-attach/structure/fetcher/factory/anexo-sistema-data-unit.factory.js.gz +0 -0
  131. package/dist/collection/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.js.gz +0 -0
  132. package/dist/collection/components/snk-attach/structure/index.js.gz +0 -0
  133. package/dist/collection/components/snk-configurator/AuthorizationConfig.js.gz +0 -0
  134. package/dist/collection/components/snk-configurator/snk-configurator.css.gz +0 -0
  135. package/dist/collection/components/snk-configurator/snk-configurator.js.gz +0 -0
  136. package/dist/collection/components/snk-crud/interfaces/PropsCustomEditor.js.gz +0 -0
  137. package/dist/collection/components/snk-crud/interfaces/PropsCustomRender.js.gz +0 -0
  138. package/dist/collection/components/snk-crud/snk-crud.css.gz +0 -0
  139. package/dist/collection/components/snk-crud/snk-crud.js.gz +0 -0
  140. package/dist/collection/components/snk-crud/subcomponents/CardFormResizeObserver.js.gz +0 -0
  141. package/dist/collection/components/snk-crud/subcomponents/GuideBuilder.js.gz +0 -0
  142. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.css.gz +0 -0
  143. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js.gz +0 -0
  144. package/dist/collection/components/snk-crud/subcomponents/snk-form-summary.css.gz +0 -0
  145. package/dist/collection/components/snk-crud/subcomponents/snk-form-summary.js.gz +0 -0
  146. package/dist/collection/components/snk-crud/subcomponents/snk-form-view.css.gz +0 -0
  147. package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js.gz +0 -0
  148. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.css.gz +0 -0
  149. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js.gz +0 -0
  150. package/dist/collection/components/snk-custom-slot-elements/snk-custom-slot-elements.css.gz +0 -0
  151. package/dist/collection/components/snk-custom-slot-elements/snk-custom-slot-elements.js.gz +0 -0
  152. package/dist/collection/components/snk-data-exporter/data/attachment.js.gz +0 -0
  153. package/dist/collection/components/snk-data-exporter/data/email.js.gz +0 -0
  154. package/dist/collection/components/snk-data-exporter/data/export-config.js.gz +0 -0
  155. package/dist/collection/components/snk-data-exporter/data/export-result.js.gz +0 -0
  156. package/dist/collection/components/snk-data-exporter/data/report.js.gz +0 -0
  157. package/dist/collection/components/snk-data-exporter/exporter-email-sender/email-info-step.js.gz +0 -0
  158. package/dist/collection/components/snk-data-exporter/exporter-email-sender/options-step.js.gz +0 -0
  159. package/dist/collection/components/snk-data-exporter/exporter-email-sender/snk-exporter-email-sender.js.gz +0 -0
  160. package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js.gz +0 -0
  161. package/dist/collection/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.js.gz +0 -0
  162. package/dist/collection/components/snk-data-exporter/interfaces/IExporterProvider.js.gz +0 -0
  163. package/dist/collection/components/snk-data-exporter/interfaces/IExporterStrategy.js.gz +0 -0
  164. package/dist/collection/components/snk-data-exporter/interfaces/IRecordID.js.gz +0 -0
  165. package/dist/collection/components/snk-data-exporter/interfaces/ISelectedID.js.gz +0 -0
  166. package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js.gz +0 -0
  167. package/dist/collection/components/snk-data-exporter/providers/ServerSideExporterProvider.js.gz +0 -0
  168. package/dist/collection/components/snk-data-exporter/snk-data-exporter.css.gz +0 -0
  169. package/dist/collection/components/snk-data-exporter/snk-data-exporter.js.gz +0 -0
  170. package/dist/collection/components/snk-data-exporter/structure/ItemBuilder.js.gz +0 -0
  171. package/dist/collection/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.js.gz +0 -0
  172. package/dist/collection/components/snk-data-exporter/utils/ParserExport.js.gz +0 -0
  173. package/dist/collection/components/snk-data-unit/snk-data-unit.js.gz +0 -0
  174. package/dist/collection/components/snk-data-unit/test/resources/metadataMock.js.gz +0 -0
  175. package/dist/collection/components/snk-data-unit/test/resources/parentMetadataMock.js.gz +0 -0
  176. package/dist/collection/components/snk-entity-list/snk-entity-list.css.gz +0 -0
  177. package/dist/collection/components/snk-entity-list/snk-entity-list.js.gz +0 -0
  178. package/dist/collection/components/snk-filter-bar/filter-item/dataunitfilter/data-unit-filter-builder.js.gz +0 -0
  179. package/dist/collection/components/snk-filter-bar/filter-item/editors/enum/filterNumberVariation.js.gz +0 -0
  180. package/dist/collection/components/snk-filter-bar/filter-item/editors/enum/presentationMode.js.gz +0 -0
  181. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.js.gz +0 -0
  182. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-checkbox-list.js.gz +0 -0
  183. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.js.gz +0 -0
  184. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js.gz +0 -0
  185. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js.gz +0 -0
  186. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-search.js.gz +0 -0
  187. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js.gz +0 -0
  188. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-personalized-filter-editor/snk-personalized-filter-editor.css.gz +0 -0
  189. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-personalized-filter-editor/snk-personalized-filter-editor.js.gz +0 -0
  190. package/dist/collection/components/snk-filter-bar/filter-item/filter-item-type-mask.enum.js.gz +0 -0
  191. package/dist/collection/components/snk-filter-bar/filter-item/filter-item-type.enum.js.gz +0 -0
  192. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js.gz +0 -0
  193. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js.gz +0 -0
  194. package/dist/collection/components/snk-filter-bar/filter-list/snk-filter-list.js.gz +0 -0
  195. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.css.gz +0 -0
  196. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js.gz +0 -0
  197. package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.css.gz +0 -0
  198. package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js.gz +0 -0
  199. package/dist/collection/components/snk-filter-bar/snk-filter-bar.css.gz +0 -0
  200. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js.gz +0 -0
  201. package/dist/collection/components/snk-filter-bar/types/custom-element-filter.js.gz +0 -0
  202. package/dist/collection/components/snk-filter-bar/types/filter-type.enum.js.gz +0 -0
  203. package/dist/collection/components/snk-filter-bar/utils/SnkFilterModalFactory.js.gz +0 -0
  204. package/dist/collection/components/snk-filter-bar/utils/filters-mock.js.gz +0 -0
  205. package/dist/collection/components/snk-filter-field-search/interfaces/index.js.gz +0 -0
  206. package/dist/collection/components/snk-filter-field-search/snk-filter-field-search.css.gz +0 -0
  207. package/dist/collection/components/snk-filter-field-search/snk-filter-field-search.js.gz +0 -0
  208. package/dist/collection/components/snk-filter-field-search/subcomponents/index.js.gz +0 -0
  209. package/dist/collection/components/snk-filter-field-search/subcomponents/list-item.js.gz +0 -0
  210. package/dist/collection/components/snk-form/snk-form.css.gz +0 -0
  211. package/dist/collection/components/snk-form/snk-form.js.gz +0 -0
  212. package/dist/collection/components/snk-form-config/SnkFormConfigManager.js.gz +0 -0
  213. package/dist/collection/components/snk-form-config/snk-form-config.css.gz +0 -0
  214. package/dist/collection/components/snk-form-config/snk-form-config.js.gz +0 -0
  215. package/dist/collection/components/snk-form-config/subcomponents/snk-config-options/snk-config-options.css.gz +0 -0
  216. package/dist/collection/components/snk-form-config/subcomponents/snk-config-options/snk-config-options.js.gz +0 -0
  217. package/dist/collection/components/snk-form-config/subcomponents/snk-field-config/snk-field-config.css.gz +0 -0
  218. package/dist/collection/components/snk-form-config/subcomponents/snk-field-config/snk-field-config.js.gz +0 -0
  219. package/dist/collection/components/snk-form-config/subcomponents/snk-tab-config/snk-tab-config.css.gz +0 -0
  220. package/dist/collection/components/snk-form-config/subcomponents/snk-tab-config/snk-tab-config.js.gz +0 -0
  221. package/dist/collection/components/snk-grid/filtercolumn/SnkMultiSelectionListDataSource.js.gz +0 -0
  222. package/dist/collection/components/snk-grid/snk-grid.css.gz +0 -0
  223. package/dist/collection/components/snk-grid/snk-grid.js.gz +0 -0
  224. package/dist/collection/components/snk-grid-config/snk-grid-config.css.gz +0 -0
  225. package/dist/collection/components/snk-grid-config/snk-grid-config.js.gz +0 -0
  226. package/dist/collection/components/snk-grid-config/snk-select-box/snk-select-box.css.gz +0 -0
  227. package/dist/collection/components/snk-grid-config/snk-select-box/snk-select-box.js.gz +0 -0
  228. package/dist/collection/components/snk-personalized-filter/interfaces/IExpressionGroup.js.gz +0 -0
  229. package/dist/collection/components/snk-personalized-filter/interfaces/IExpressionItem.js.gz +0 -0
  230. package/dist/collection/components/snk-personalized-filter/interfaces/IParameter.js.gz +0 -0
  231. package/dist/collection/components/snk-personalized-filter/interfaces/IPersonalizedFilter.js.gz +0 -0
  232. package/dist/collection/components/snk-personalized-filter/interfaces/ISystemFilterConfig.js.gz +0 -0
  233. package/dist/collection/components/snk-personalized-filter/interfaces/IUserFilterConfig.js.gz +0 -0
  234. package/dist/collection/components/snk-personalized-filter/interfaces/index.js.gz +0 -0
  235. package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.css.gz +0 -0
  236. package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js.gz +0 -0
  237. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-group/snk-expression-group.css.gz +0 -0
  238. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-group/snk-expression-group.js.gz +0 -0
  239. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/filter-operands/filter-operands.js.gz +0 -0
  240. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.css.gz +0 -0
  241. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.js.gz +0 -0
  242. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-advanced-mode/snk-filter-advanced-mode.css.gz +0 -0
  243. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-advanced-mode/snk-filter-advanced-mode.js.gz +0 -0
  244. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-assistent-mode/snk-filter-assistent-mode.css.gz +0 -0
  245. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-assistent-mode/snk-filter-assistent-mode.js.gz +0 -0
  246. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/snk-filter-param-config.css.gz +0 -0
  247. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/snk-filter-param-config.js.gz +0 -0
  248. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/utils/PersonalizedFilterUtils.js.gz +0 -0
  249. package/dist/collection/components/snk-pesquisa/pesquisa-grid/pesquisa-grid.css.gz +0 -0
  250. package/dist/collection/components/snk-pesquisa/pesquisa-grid/pesquisa-grid.js.gz +0 -0
  251. package/dist/collection/components/snk-pesquisa/pesquisa-tree/pesquisa-tree.css.gz +0 -0
  252. package/dist/collection/components/snk-pesquisa/pesquisa-tree/pesquisa-tree.js.gz +0 -0
  253. package/dist/collection/components/snk-pesquisa/pesquisaHelper.js.gz +0 -0
  254. package/dist/collection/components/snk-pesquisa/snk-pesquisa.css.gz +0 -0
  255. package/dist/collection/components/snk-pesquisa/snk-pesquisa.js.gz +0 -0
  256. package/dist/collection/components/snk-print-selector/snk-print-selector.css.gz +0 -0
  257. package/dist/collection/components/snk-print-selector/snk-print-selector.js.gz +0 -0
  258. package/dist/collection/components/snk-simple-bar/snk-simple-bar.css.gz +0 -0
  259. package/dist/collection/components/snk-simple-bar/snk-simple-bar.js.gz +0 -0
  260. package/dist/collection/components/snk-simple-crud/regular-buttons.js.gz +0 -0
  261. package/dist/collection/components/snk-simple-crud/snk-simple-crud.css.gz +0 -0
  262. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js.gz +0 -0
  263. package/dist/collection/components/snk-simple-form-config/snk-simple-form-config.css.gz +0 -0
  264. package/dist/collection/components/snk-simple-form-config/snk-simple-form-config.js.gz +0 -0
  265. package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.css.gz +0 -0
  266. package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.js.gz +0 -0
  267. package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js.gz +0 -0
  268. package/dist/collection/components/snk-taskbar/processor/taskbar-processor.js.gz +0 -0
  269. package/dist/collection/components/snk-taskbar/snk-taskbar.css.gz +0 -0
  270. package/dist/collection/components/snk-taskbar/snk-taskbar.js.gz +0 -0
  271. package/dist/collection/components/snk-taskbar/subcomponents/field-search.js.gz +0 -0
  272. package/dist/collection/components/teste-pesquisa/teste-pesquisa.css.gz +0 -0
  273. package/dist/collection/components/teste-pesquisa/teste-pesquisa.js.gz +0 -0
  274. package/dist/collection/index.js.gz +0 -0
  275. package/dist/collection/lib/@types/index.js.gz +0 -0
  276. package/dist/collection/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.js.gz +0 -0
  277. package/dist/collection/lib/applet-caller/applet-caller.js.gz +0 -0
  278. package/dist/collection/lib/auth/mgeauthorization.module.js.gz +0 -0
  279. package/dist/collection/lib/configs/ConfigStorage.js.gz +0 -0
  280. package/dist/collection/lib/dataUnit/InMemoryLoader.js.gz +0 -0
  281. package/dist/collection/lib/dataUnit/ValueFormatter.js.gz +0 -0
  282. package/dist/collection/lib/dataUnit/dataUnitInMemoryUtils.js.gz +0 -0
  283. package/dist/collection/lib/dataUnit/interfaces/InMemoryLoaderConfig.js.gz +0 -0
  284. package/dist/collection/lib/http/data-fetcher/DataFetcher.js.gz +0 -0
  285. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/anexo-sistema-fetcher.js.gz +0 -0
  286. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/attach-fetcher.js.gz +0 -0
  287. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/facade/attach-fetcher.facade.js.gz +0 -0
  288. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/index.js.gz +0 -0
  289. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/IDelete.js.gz +0 -0
  290. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/IDownloadKey.js.gz +0 -0
  291. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/ISave.js.gz +0 -0
  292. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/index.js.gz +0 -0
  293. package/dist/collection/lib/http/data-fetcher/fetchers/application-config-fetcher.js.gz +0 -0
  294. package/dist/collection/lib/http/data-fetcher/fetchers/auth-fetcher.js.gz +0 -0
  295. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.js.gz +0 -0
  296. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.js +21 -7
  297. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.js.gz +0 -0
  298. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.js.gz +0 -0
  299. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.js.gz +0 -0
  300. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IBuildRequestBodyLoadRowMetadata.js.gz +0 -0
  301. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadDataResult.js.gz +0 -0
  302. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadDataStrategy.js.gz +0 -0
  303. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadingInfo.js.gz +0 -0
  304. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRecordField.js.gz +0 -0
  305. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IResponseRecord.js.gz +0 -0
  306. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRowMetadata.js.gz +0 -0
  307. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DataUnitStrategy.js.gz +0 -0
  308. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js.gz +0 -0
  309. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/test/resources/metadataMock.js.gz +0 -0
  310. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IExporterColumnMetadata.js.gz +0 -0
  311. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams.js.gz +0 -0
  312. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterResponse.js.gz +0 -0
  313. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IPersonalizedReport.js.gz +0 -0
  314. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/permission-export-pdf.js.gz +0 -0
  315. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/personalized-reports-fetcher.js.gz +0 -0
  316. package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js.gz +0 -0
  317. package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js.gz +0 -0
  318. package/dist/collection/lib/http/data-fetcher/fetchers/grid-config-fetcher.js.gz +0 -0
  319. package/dist/collection/lib/http/data-fetcher/fetchers/parameters-fecher.js.gz +0 -0
  320. package/dist/collection/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.js.gz +0 -0
  321. package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js.gz +0 -0
  322. package/dist/collection/lib/http/data-fetcher/fetchers/resource-fetcher.js.gz +0 -0
  323. package/dist/collection/lib/http/data-fetcher/fetchers/totals-fetcher.js.gz +0 -0
  324. package/dist/collection/lib/http/data-fetcher/interfaces/IClientEventResponse.js.gz +0 -0
  325. package/dist/collection/lib/http/data-fetcher/recaller/GraphQLRecaller.js.gz +0 -0
  326. package/dist/collection/lib/http/data-fetcher/recaller/IDataFetcherRecaller.js.gz +0 -0
  327. package/dist/collection/lib/http/data-fetcher/recaller/ServiceBrokerRecaller.js.gz +0 -0
  328. package/dist/collection/lib/http/data-fetcher/state/LoadStateManager.js.gz +0 -0
  329. package/dist/collection/lib/index.js.gz +0 -0
  330. package/dist/collection/lib/licenses/sankhyalicense.module.js.gz +0 -0
  331. package/dist/collection/lib/message/SnkMessageBuilder.js.gz +0 -0
  332. package/dist/collection/lib/message/resources/crud-utils.msg.js.gz +0 -0
  333. package/dist/collection/lib/message/resources/file-viewer.msg.js.gz +0 -0
  334. package/dist/collection/lib/message/resources/snk-actions-button.msg.js.gz +0 -0
  335. package/dist/collection/lib/message/resources/snk-application.msg.js.gz +0 -0
  336. package/dist/collection/lib/message/resources/snk-attach.msg.js.gz +0 -0
  337. package/dist/collection/lib/message/resources/snk-configurator.msg.js.gz +0 -0
  338. package/dist/collection/lib/message/resources/snk-crud.msg.js.gz +0 -0
  339. package/dist/collection/lib/message/resources/snk-data-exporter.msg.js.gz +0 -0
  340. package/dist/collection/lib/message/resources/snk-data-unit.msg.js.gz +0 -0
  341. package/dist/collection/lib/message/resources/snk-entity-list.msg.js.gz +0 -0
  342. package/dist/collection/lib/message/resources/snk-exporter.msg.js.gz +0 -0
  343. package/dist/collection/lib/message/resources/snk-filter-bar.msg.js.gz +0 -0
  344. package/dist/collection/lib/message/resources/snk-filter-field-search.msg.js.gz +0 -0
  345. package/dist/collection/lib/message/resources/snk-filter-param-config.msg.js.gz +0 -0
  346. package/dist/collection/lib/message/resources/snk-form.msg.js.gz +0 -0
  347. package/dist/collection/lib/message/resources/snk-grid.msg.js.gz +0 -0
  348. package/dist/collection/lib/message/resources/snk-personalized-filter.msg.js.gz +0 -0
  349. package/dist/collection/lib/message/resources/snk-print-selector.msg.js.gz +0 -0
  350. package/dist/collection/lib/message/resources/snk-simple-bar.msg.js.gz +0 -0
  351. package/dist/collection/lib/message/resources/snk-simple-crud.msg.js.gz +0 -0
  352. package/dist/collection/lib/message/resources/snk-taskbar.msg.js.gz +0 -0
  353. package/dist/collection/lib/resourceid/ResourceIDUtils.js.gz +0 -0
  354. package/dist/collection/lib/store/index.js.gz +0 -0
  355. package/dist/collection/lib/utils/ContinuousInsertUtils.js.gz +0 -0
  356. package/dist/collection/lib/utils/CrudUtils.js.gz +0 -0
  357. package/dist/collection/lib/utils/GetSelectedRecordsIDsInfo.js.gz +0 -0
  358. package/dist/collection/lib/utils/PrintUtils.js.gz +0 -0
  359. package/dist/collection/lib/utils/constants.js.gz +0 -0
  360. package/dist/collection/lib/utils/fileViewer/index.js.gz +0 -0
  361. package/dist/collection/lib/utils/fileViewer/interfaces/IFileViewerParams.js.gz +0 -0
  362. package/dist/collection/lib/utils/pesquisa.js.gz +0 -0
  363. package/dist/collection/lib/utils/urlutils.js.gz +0 -0
  364. package/dist/collection/lib/workspace/workspace.js.gz +0 -0
  365. package/dist/collection/sw.js.gz +0 -0
  366. package/dist/components/AuthorizationConfig.js.gz +0 -0
  367. package/dist/components/ConfigStorage.js.gz +0 -0
  368. package/dist/components/ContinuousInsertUtils.js.gz +0 -0
  369. package/dist/components/DataFetcher.js.gz +0 -0
  370. package/dist/components/GetSelectedRecordsIDsInfo.js.gz +0 -0
  371. package/dist/components/ISave.js.gz +0 -0
  372. package/dist/components/ParamType.js.gz +0 -0
  373. package/dist/components/PersonalizedFilterUtils.js.gz +0 -0
  374. package/dist/components/PrintUtils.js.gz +0 -0
  375. package/dist/components/ResourceIDUtils.js.gz +0 -0
  376. package/dist/components/SnkFormConfigManager.js.gz +0 -0
  377. package/dist/components/SnkMessageBuilder.js.gz +0 -0
  378. package/dist/components/auth-fetcher.js.gz +0 -0
  379. package/dist/components/constants.js.gz +0 -0
  380. package/dist/components/dataunit-fetcher.js +21 -7
  381. package/dist/components/dataunit-fetcher.js.gz +0 -0
  382. package/dist/components/filter-item-type.enum.js.gz +0 -0
  383. package/dist/components/filterNumberVariation.js.gz +0 -0
  384. package/dist/components/form-config-fetcher.js.gz +0 -0
  385. package/dist/components/index.js.gz +0 -0
  386. package/dist/components/index2.js.gz +0 -0
  387. package/dist/components/pesquisa-grid.js.gz +0 -0
  388. package/dist/components/pesquisa-grid2.js.gz +0 -0
  389. package/dist/components/pesquisa-tree.js.gz +0 -0
  390. package/dist/components/pesquisa-tree2.js.gz +0 -0
  391. package/dist/components/presentationMode.js.gz +0 -0
  392. package/dist/components/snk-actions-button.js.gz +0 -0
  393. package/dist/components/snk-actions-button2.js.gz +0 -0
  394. package/dist/components/snk-actions-form.js.gz +0 -0
  395. package/dist/components/snk-application.js.gz +0 -0
  396. package/dist/components/snk-application2.js.gz +0 -0
  397. package/dist/components/snk-attach.js.gz +0 -0
  398. package/dist/components/snk-attach2.js.gz +0 -0
  399. package/dist/components/snk-client-confirm.js.gz +0 -0
  400. package/dist/components/snk-config-options.js.gz +0 -0
  401. package/dist/components/snk-config-options2.js.gz +0 -0
  402. package/dist/components/snk-configurator.js.gz +0 -0
  403. package/dist/components/snk-configurator2.js.gz +0 -0
  404. package/dist/components/snk-crud.js.gz +0 -0
  405. package/dist/components/snk-custom-slot-elements.js.gz +0 -0
  406. package/dist/components/snk-data-exporter.js.gz +0 -0
  407. package/dist/components/snk-data-exporter2.js.gz +0 -0
  408. package/dist/components/snk-data-unit.js.gz +0 -0
  409. package/dist/components/snk-data-unit2.js.gz +0 -0
  410. package/dist/components/snk-detail-view.js.gz +0 -0
  411. package/dist/components/snk-detail-view2.js.gz +0 -0
  412. package/dist/components/snk-entity-list.js.gz +0 -0
  413. package/dist/components/snk-exporter-email-sender.js.gz +0 -0
  414. package/dist/components/snk-exporter-email-sender2.js.gz +0 -0
  415. package/dist/components/snk-expression-group.js.gz +0 -0
  416. package/dist/components/snk-expression-group2.js.gz +0 -0
  417. package/dist/components/snk-expression-item.js.gz +0 -0
  418. package/dist/components/snk-expression-item2.js.gz +0 -0
  419. package/dist/components/snk-field-config.js.gz +0 -0
  420. package/dist/components/snk-field-config2.js.gz +0 -0
  421. package/dist/components/snk-filter-advanced-mode.js.gz +0 -0
  422. package/dist/components/snk-filter-advanced-mode2.js.gz +0 -0
  423. package/dist/components/snk-filter-assistent-mode.js.gz +0 -0
  424. package/dist/components/snk-filter-assistent-mode2.js.gz +0 -0
  425. package/dist/components/snk-filter-bar.js.gz +0 -0
  426. package/dist/components/snk-filter-bar2.js.gz +0 -0
  427. package/dist/components/snk-filter-binary-select.js.gz +0 -0
  428. package/dist/components/snk-filter-checkbox-list.js.gz +0 -0
  429. package/dist/components/snk-filter-detail.js.gz +0 -0
  430. package/dist/components/snk-filter-detail2.js.gz +0 -0
  431. package/dist/components/snk-filter-field-search.js.gz +0 -0
  432. package/dist/components/snk-filter-field-search2.js.gz +0 -0
  433. package/dist/components/snk-filter-item.js.gz +0 -0
  434. package/dist/components/snk-filter-item2.js.gz +0 -0
  435. package/dist/components/snk-filter-list.js.gz +0 -0
  436. package/dist/components/snk-filter-modal-item.js.gz +0 -0
  437. package/dist/components/snk-filter-modal-item2.js.gz +0 -0
  438. package/dist/components/snk-filter-modal.js.gz +0 -0
  439. package/dist/components/snk-filter-multi-select.js.gz +0 -0
  440. package/dist/components/snk-filter-number.js.gz +0 -0
  441. package/dist/components/snk-filter-param-config.js.gz +0 -0
  442. package/dist/components/snk-filter-param-config2.js.gz +0 -0
  443. package/dist/components/snk-filter-period.js.gz +0 -0
  444. package/dist/components/snk-filter-search.js.gz +0 -0
  445. package/dist/components/snk-filter-text.js.gz +0 -0
  446. package/dist/components/snk-form-config.js.gz +0 -0
  447. package/dist/components/snk-form-config2.js.gz +0 -0
  448. package/dist/components/snk-form-summary.js.gz +0 -0
  449. package/dist/components/snk-form-summary2.js.gz +0 -0
  450. package/dist/components/snk-form-view.js.gz +0 -0
  451. package/dist/components/snk-form-view2.js.gz +0 -0
  452. package/dist/components/snk-form.js.gz +0 -0
  453. package/dist/components/snk-grid-config.js.gz +0 -0
  454. package/dist/components/snk-grid-config2.js.gz +0 -0
  455. package/dist/components/snk-grid.js.gz +0 -0
  456. package/dist/components/snk-grid2.js.gz +0 -0
  457. package/dist/components/snk-guides-viewer.js.gz +0 -0
  458. package/dist/components/snk-personalized-filter-editor.js.gz +0 -0
  459. package/dist/components/snk-personalized-filter.js.gz +0 -0
  460. package/dist/components/snk-personalized-filter2.js.gz +0 -0
  461. package/dist/components/snk-pesquisa.js.gz +0 -0
  462. package/dist/components/snk-pesquisa2.js.gz +0 -0
  463. package/dist/components/snk-print-selector.js.gz +0 -0
  464. package/dist/components/snk-select-box.js.gz +0 -0
  465. package/dist/components/snk-select-box2.js.gz +0 -0
  466. package/dist/components/snk-simple-bar.js.gz +0 -0
  467. package/dist/components/snk-simple-bar2.js.gz +0 -0
  468. package/dist/components/snk-simple-crud.js.gz +0 -0
  469. package/dist/components/snk-simple-crud2.js.gz +0 -0
  470. package/dist/components/snk-simple-form-config.js.gz +0 -0
  471. package/dist/components/snk-simple-form-config2.js.gz +0 -0
  472. package/dist/components/snk-tab-config.js.gz +0 -0
  473. package/dist/components/snk-tab-config2.js.gz +0 -0
  474. package/dist/components/snk-taskbar.js.gz +0 -0
  475. package/dist/components/snk-taskbar2.js.gz +0 -0
  476. package/dist/components/taskbar-actions-button.js.gz +0 -0
  477. package/dist/components/taskbar-actions-button2.js.gz +0 -0
  478. package/dist/components/teste-pesquisa.js.gz +0 -0
  479. package/dist/esm/AuthorizationConfig-dcbd207a.js.gz +0 -0
  480. package/dist/esm/ConfigStorage-373bb440.js.gz +0 -0
  481. package/dist/esm/{ContinuousInsertUtils-25e7bd9a.js → ContinuousInsertUtils-e35a827f.js} +1 -1
  482. package/dist/esm/ContinuousInsertUtils-e35a827f.js.gz +0 -0
  483. package/dist/esm/DataFetcher-5221b992.js.gz +0 -0
  484. package/dist/esm/GetSelectedRecordsIDsInfo-9fa41508.js.gz +0 -0
  485. package/dist/esm/ISave-d8c8bc59.js.gz +0 -0
  486. package/dist/esm/ParamType-d5152b06.js.gz +0 -0
  487. package/dist/esm/PersonalizedFilterUtils-e2b38ef7.js.gz +0 -0
  488. package/dist/esm/PrintUtils-3e4ff0f5.js.gz +0 -0
  489. package/dist/esm/ResourceIDUtils-a114189a.js.gz +0 -0
  490. package/dist/esm/SnkFormConfigManager-b65e6db0.js.gz +0 -0
  491. package/dist/esm/SnkMessageBuilder-6fff4a4c.js.gz +0 -0
  492. package/dist/esm/Sortable-83960219.js.gz +0 -0
  493. package/dist/esm/auth-fetcher-e32fe8a4.js.gz +0 -0
  494. package/dist/esm/constants-7302ee87.js.gz +0 -0
  495. package/dist/esm/{dataunit-fetcher-8dd93d8b.js → dataunit-fetcher-55effba3.js} +21 -7
  496. package/dist/esm/dataunit-fetcher-55effba3.js.gz +0 -0
  497. package/dist/esm/field-search-f8b1d91e.js.gz +0 -0
  498. package/dist/esm/filter-item-type.enum-d45e026f.js.gz +0 -0
  499. package/dist/esm/filter-type.enum-a80c1b6b.js.gz +0 -0
  500. package/dist/esm/filterNumberVariation-8cee02ea.js.gz +0 -0
  501. package/dist/esm/form-config-fetcher-126e2471.js.gz +0 -0
  502. package/dist/esm/index-3aa4977a.js.gz +0 -0
  503. package/dist/esm/index-620ac460.js.gz +0 -0
  504. package/dist/esm/index-a7d3d3f1.js.gz +0 -0
  505. package/dist/esm/index-ae591a44.js.gz +0 -0
  506. package/dist/esm/index-bdf75557.js.gz +0 -0
  507. package/dist/esm/index.js.gz +0 -0
  508. package/dist/esm/loader.js.gz +0 -0
  509. package/dist/esm/pesquisa-fetcher-0af41f09.js.gz +0 -0
  510. package/dist/esm/pesquisa-grid_2.entry.js +1 -1
  511. package/dist/esm/pesquisa-grid_2.entry.js.gz +0 -0
  512. package/dist/esm/polyfills/core-js.js.gz +0 -0
  513. package/dist/esm/polyfills/css-shim.js.gz +0 -0
  514. package/dist/esm/polyfills/dom.js.gz +0 -0
  515. package/dist/esm/polyfills/es5-html-element.js.gz +0 -0
  516. package/dist/esm/polyfills/index.js.gz +0 -0
  517. package/dist/esm/polyfills/system.js.gz +0 -0
  518. package/dist/esm/presentationMode-783bbf9d.js.gz +0 -0
  519. package/dist/esm/sankhyablocks.js.gz +0 -0
  520. package/dist/esm/snk-actions-button_5.entry.js +1 -1
  521. package/dist/esm/snk-actions-button_5.entry.js.gz +0 -0
  522. package/dist/esm/snk-actions-form.entry.js.gz +0 -0
  523. package/dist/esm/snk-application.entry.js +1 -1
  524. package/dist/esm/snk-application.entry.js.gz +0 -0
  525. package/dist/esm/snk-attach.entry.js +1 -1
  526. package/dist/esm/snk-attach.entry.js.gz +0 -0
  527. package/dist/esm/snk-client-confirm.entry.js.gz +0 -0
  528. package/dist/esm/snk-config-options_3.entry.js.gz +0 -0
  529. package/dist/esm/snk-configurator.entry.js.gz +0 -0
  530. package/dist/esm/snk-crud.entry.js +1 -1
  531. package/dist/esm/snk-crud.entry.js.gz +0 -0
  532. package/dist/esm/snk-custom-slot-elements.entry.js.gz +0 -0
  533. package/dist/esm/snk-data-exporter.entry.js +2 -2
  534. package/dist/esm/snk-data-exporter.entry.js.gz +0 -0
  535. package/dist/esm/{snk-data-unit-11a49fc3.js → snk-data-unit-d3c5b577.js} +1 -1
  536. package/dist/esm/snk-data-unit-d3c5b577.js.gz +0 -0
  537. package/dist/esm/snk-data-unit.entry.js +2 -2
  538. package/dist/esm/snk-data-unit.entry.js.gz +0 -0
  539. package/dist/esm/snk-detail-view.entry.js +2 -2
  540. package/dist/esm/snk-detail-view.entry.js.gz +0 -0
  541. package/dist/esm/snk-entity-list.entry.js.gz +0 -0
  542. package/dist/esm/snk-exporter-email-sender.entry.js.gz +0 -0
  543. package/dist/esm/snk-expression-group_2.entry.js.gz +0 -0
  544. package/dist/esm/snk-field-config.entry.js.gz +0 -0
  545. package/dist/esm/snk-filter-advanced-mode_2.entry.js.gz +0 -0
  546. package/dist/esm/snk-filter-bar_4.entry.js.gz +0 -0
  547. package/dist/esm/snk-filter-binary-select.entry.js.gz +0 -0
  548. package/dist/esm/snk-filter-checkbox-list.entry.js.gz +0 -0
  549. package/dist/esm/snk-filter-detail.entry.js.gz +0 -0
  550. package/dist/esm/snk-filter-field-search_2.entry.js.gz +0 -0
  551. package/dist/esm/snk-filter-modal-item.entry.js.gz +0 -0
  552. package/dist/esm/snk-filter-multi-select.entry.js.gz +0 -0
  553. package/dist/esm/snk-filter-number.entry.js.gz +0 -0
  554. package/dist/esm/snk-filter-period.entry.js.gz +0 -0
  555. package/dist/esm/snk-filter-search.entry.js.gz +0 -0
  556. package/dist/esm/snk-filter-text.entry.js.gz +0 -0
  557. package/dist/esm/snk-form-summary.entry.js.gz +0 -0
  558. package/dist/esm/snk-form-view.entry.js.gz +0 -0
  559. package/dist/esm/snk-grid.entry.js +2 -2
  560. package/dist/esm/snk-grid.entry.js.gz +0 -0
  561. package/dist/esm/{snk-guides-viewer-830f5fb9.js → snk-guides-viewer-136e94a0.js} +1 -1
  562. package/dist/esm/snk-guides-viewer-136e94a0.js.gz +0 -0
  563. package/dist/esm/snk-guides-viewer.entry.js +2 -2
  564. package/dist/esm/snk-guides-viewer.entry.js.gz +0 -0
  565. package/dist/esm/snk-personalized-filter-editor.entry.js.gz +0 -0
  566. package/dist/esm/snk-personalized-filter.entry.js.gz +0 -0
  567. package/dist/esm/snk-pesquisa.entry.js +1 -1
  568. package/dist/esm/snk-pesquisa.entry.js.gz +0 -0
  569. package/dist/esm/snk-print-selector.entry.js.gz +0 -0
  570. package/dist/esm/snk-simple-bar.entry.js.gz +0 -0
  571. package/dist/esm/snk-simple-crud.entry.js +2 -2
  572. package/dist/esm/snk-simple-crud.entry.js.gz +0 -0
  573. package/dist/esm/snk-tab-config.entry.js.gz +0 -0
  574. package/dist/esm/snk-taskbar.entry.js.gz +0 -0
  575. package/dist/esm/taskbar-elements-d59867f1.js.gz +0 -0
  576. package/dist/esm/teste-pesquisa.entry.js.gz +0 -0
  577. package/dist/index.cjs.js.gz +0 -0
  578. package/dist/index.js.gz +0 -0
  579. package/dist/sankhyablocks/index.esm.js.gz +0 -0
  580. package/dist/sankhyablocks/p-01ba23cd.entry.js.gz +0 -0
  581. package/dist/sankhyablocks/{p-28ae6c20.entry.js → p-02a88355.entry.js} +1 -1
  582. package/dist/sankhyablocks/p-02a88355.entry.js.gz +0 -0
  583. package/dist/sankhyablocks/p-057fad05.js.gz +0 -0
  584. package/dist/sankhyablocks/p-05b6ff91.js.gz +0 -0
  585. package/dist/sankhyablocks/{p-d92d4f91.entry.js → p-0fd3799b.entry.js} +1 -1
  586. package/dist/sankhyablocks/p-0fd3799b.entry.js.gz +0 -0
  587. package/dist/sankhyablocks/p-118e769b.entry.js.gz +0 -0
  588. package/dist/sankhyablocks/p-1435701f.js.gz +0 -0
  589. package/dist/sankhyablocks/p-16a1dd18.entry.js.gz +0 -0
  590. package/dist/sankhyablocks/p-17425c72.js.gz +0 -0
  591. package/dist/sankhyablocks/p-19dc71e9.js.gz +0 -0
  592. package/dist/sankhyablocks/p-1a68fb59.js.gz +0 -0
  593. package/dist/sankhyablocks/p-1cf39cfd.entry.js.gz +0 -0
  594. package/dist/sankhyablocks/p-1db45d26.entry.js.gz +0 -0
  595. package/dist/sankhyablocks/p-1e4f16f3.js +60 -0
  596. package/dist/sankhyablocks/p-1e4f16f3.js.gz +0 -0
  597. package/dist/sankhyablocks/p-21749402.js.gz +0 -0
  598. package/dist/sankhyablocks/p-21a81901.entry.js.gz +0 -0
  599. package/dist/sankhyablocks/p-23736d75.js.gz +0 -0
  600. package/dist/sankhyablocks/{p-4c395589.entry.js → p-2426b166.entry.js} +1 -1
  601. package/dist/sankhyablocks/p-2426b166.entry.js.gz +0 -0
  602. package/dist/sankhyablocks/p-26b0ce3e.entry.js.gz +0 -0
  603. package/dist/sankhyablocks/p-28ca3908.entry.js.gz +0 -0
  604. package/dist/sankhyablocks/p-2d3f9482.entry.js.gz +0 -0
  605. package/dist/sankhyablocks/{p-40ca4721.entry.js → p-30a62c1f.entry.js} +2 -2
  606. package/dist/sankhyablocks/{p-40ca4721.entry.js.gz → p-30a62c1f.entry.js.gz} +0 -0
  607. package/dist/sankhyablocks/p-30cf616e.js.gz +0 -0
  608. package/dist/sankhyablocks/p-33718dfc.entry.js.gz +0 -0
  609. package/dist/sankhyablocks/p-36ee903d.entry.js.gz +0 -0
  610. package/dist/sankhyablocks/{p-60e4db34.js → p-3a7e91cd.js} +1 -1
  611. package/dist/sankhyablocks/p-3a7e91cd.js.gz +0 -0
  612. package/dist/sankhyablocks/p-3ab6df3d.entry.js.gz +0 -0
  613. package/dist/sankhyablocks/p-41793e17.entry.js.gz +0 -0
  614. package/dist/sankhyablocks/p-434817f0.entry.js.gz +0 -0
  615. package/dist/sankhyablocks/p-47178038.entry.js.gz +0 -0
  616. package/dist/sankhyablocks/p-54a5d52a.entry.js.gz +0 -0
  617. package/dist/sankhyablocks/p-5f157b09.entry.js.gz +0 -0
  618. package/dist/sankhyablocks/p-688dcb4c.js.gz +0 -0
  619. package/dist/sankhyablocks/p-6dc031de.js.gz +0 -0
  620. package/dist/sankhyablocks/p-798386c7.js.gz +0 -0
  621. package/dist/sankhyablocks/{p-1a91d1f3.entry.js → p-7cf8c72c.entry.js} +1 -1
  622. package/dist/sankhyablocks/p-7cf8c72c.entry.js.gz +0 -0
  623. package/dist/sankhyablocks/p-7dd49d15.js.gz +0 -0
  624. package/dist/sankhyablocks/p-7e2ded86.entry.js.gz +0 -0
  625. package/dist/sankhyablocks/p-7e7a7473.js.gz +0 -0
  626. package/dist/sankhyablocks/p-8002dcd0.entry.js.gz +0 -0
  627. package/dist/sankhyablocks/p-82ee6dc3.entry.js.gz +0 -0
  628. package/dist/sankhyablocks/p-89c92727.entry.js.gz +0 -0
  629. package/dist/sankhyablocks/p-8b4fc28f.entry.js.gz +0 -0
  630. package/dist/sankhyablocks/p-8c235d4c.entry.js.gz +0 -0
  631. package/dist/sankhyablocks/p-8d884fab.js.gz +0 -0
  632. package/dist/sankhyablocks/p-933c0c0b.js.gz +0 -0
  633. package/dist/sankhyablocks/p-9531fd46.entry.js.gz +0 -0
  634. package/dist/sankhyablocks/p-95ce311a.js.gz +0 -0
  635. package/dist/sankhyablocks/{p-8a1ee5b5.js → p-9bcb5505.js} +1 -1
  636. package/dist/sankhyablocks/p-9bcb5505.js.gz +0 -0
  637. package/dist/sankhyablocks/p-9d3a025a.entry.js.gz +0 -0
  638. package/dist/sankhyablocks/{p-469384a2.entry.js → p-ac51aa8a.entry.js} +1 -1
  639. package/dist/sankhyablocks/p-ac51aa8a.entry.js.gz +0 -0
  640. package/dist/sankhyablocks/p-ac8d1cd6.entry.js.gz +0 -0
  641. package/dist/sankhyablocks/p-bf2acf72.entry.js.gz +0 -0
  642. package/dist/sankhyablocks/p-c2e468c9.entry.js.gz +0 -0
  643. package/dist/sankhyablocks/p-c8622597.entry.js.gz +0 -0
  644. package/dist/sankhyablocks/{p-171b7623.js → p-d0f23f4e.js} +1 -1
  645. package/dist/sankhyablocks/p-d0f23f4e.js.gz +0 -0
  646. package/dist/sankhyablocks/p-d2d301a6.js.gz +0 -0
  647. package/dist/sankhyablocks/{p-4e52f28e.entry.js → p-d5288cda.entry.js} +1 -1
  648. package/dist/sankhyablocks/p-d5288cda.entry.js.gz +0 -0
  649. package/dist/sankhyablocks/p-d62228fb.js.gz +0 -0
  650. package/dist/sankhyablocks/p-d9804798.js.gz +0 -0
  651. package/dist/sankhyablocks/{p-c475ac24.entry.js → p-dba5b22c.entry.js} +1 -1
  652. package/dist/sankhyablocks/p-dba5b22c.entry.js.gz +0 -0
  653. package/dist/sankhyablocks/p-dc36cfbf.js.gz +0 -0
  654. package/dist/sankhyablocks/p-eaad0aa8.js.gz +0 -0
  655. package/dist/sankhyablocks/{p-09067bee.entry.js → p-ebc9d9ac.entry.js} +1 -1
  656. package/dist/sankhyablocks/p-ebc9d9ac.entry.js.gz +0 -0
  657. package/dist/sankhyablocks/{p-254c59d2.entry.js → p-ef6ba53c.entry.js} +1 -1
  658. package/dist/sankhyablocks/p-ef6ba53c.entry.js.gz +0 -0
  659. package/dist/sankhyablocks/p-f0b9303b.js.gz +0 -0
  660. package/dist/sankhyablocks/p-f4184ce7.js.gz +0 -0
  661. package/dist/sankhyablocks/{p-54f5354a.entry.js → p-f6fd8040.entry.js} +1 -1
  662. package/dist/sankhyablocks/p-f6fd8040.entry.js.gz +0 -0
  663. package/dist/sankhyablocks/p-f975370f.entry.js.gz +0 -0
  664. package/dist/sankhyablocks/p-fa80e546.js.gz +0 -0
  665. package/dist/sankhyablocks/p-fa816fb2.js.gz +0 -0
  666. package/dist/sankhyablocks/{p-b50a0753.entry.js → p-fd3ea476.entry.js} +1 -1
  667. package/dist/sankhyablocks/p-fd3ea476.entry.js.gz +0 -0
  668. package/dist/sankhyablocks/p-ff1990ad.js.gz +0 -0
  669. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  670. package/dist/sankhyablocks/sankhyablocks.esm.js.gz +0 -0
  671. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.d.ts +4 -0
  672. package/package.json +1 -1
  673. package/dist/cjs/ContinuousInsertUtils-54d44192.js.gz +0 -0
  674. package/dist/cjs/dataunit-fetcher-8ea97d88.js.gz +0 -0
  675. package/dist/cjs/snk-data-unit-72ef8777.js.gz +0 -0
  676. package/dist/cjs/snk-guides-viewer-ea5d0907.js.gz +0 -0
  677. package/dist/esm/ContinuousInsertUtils-25e7bd9a.js.gz +0 -0
  678. package/dist/esm/dataunit-fetcher-8dd93d8b.js.gz +0 -0
  679. package/dist/esm/snk-data-unit-11a49fc3.js.gz +0 -0
  680. package/dist/esm/snk-guides-viewer-830f5fb9.js.gz +0 -0
  681. package/dist/sankhyablocks/p-09067bee.entry.js.gz +0 -0
  682. package/dist/sankhyablocks/p-171b7623.js.gz +0 -0
  683. package/dist/sankhyablocks/p-1a91d1f3.entry.js.gz +0 -0
  684. package/dist/sankhyablocks/p-254c59d2.entry.js.gz +0 -0
  685. package/dist/sankhyablocks/p-28ae6c20.entry.js.gz +0 -0
  686. package/dist/sankhyablocks/p-469384a2.entry.js.gz +0 -0
  687. package/dist/sankhyablocks/p-4c395589.entry.js.gz +0 -0
  688. package/dist/sankhyablocks/p-4e52f28e.entry.js.gz +0 -0
  689. package/dist/sankhyablocks/p-54f5354a.entry.js.gz +0 -0
  690. package/dist/sankhyablocks/p-60e4db34.js.gz +0 -0
  691. package/dist/sankhyablocks/p-8a1ee5b5.js.gz +0 -0
  692. package/dist/sankhyablocks/p-b50a0753.entry.js.gz +0 -0
  693. package/dist/sankhyablocks/p-c475ac24.entry.js.gz +0 -0
  694. package/dist/sankhyablocks/p-d92d4f91.entry.js.gz +0 -0
  695. package/dist/sankhyablocks/p-ddefbbc7.js +0 -60
  696. package/dist/sankhyablocks/p-ddefbbc7.js.gz +0 -0
@@ -1 +1 @@
1
- import{r as i,h as t,H as s,g as e,c as n}from"./p-d2d301a6.js";import{ApplicationContext as o,StringUtils as r,ErrorException as a,WarningException as l,ObjectUtils as c,DateUtils as d,ServiceUtils as h,StorageType as u,ArrayUtils as g,ElementIDUtils as f}from"@sankhyalabs/core";import{D as m}from"./p-d62228fb.js";import{P as p}from"./p-eaad0aa8.js";import"./p-798386c7.js";import"./p-30cf616e.js";import"./p-21749402.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-ddefbbc7.js";import"./p-ff1990ad.js";import{F as v}from"./p-1435701f.js";import{g as b}from"./p-7dd49d15.js";import{R as k}from"./p-688dcb4c.js";import{ApplicationUtils as _,DialogType as w}from"@sankhyalabs/ezui/dist/collection/utils";import{CheckMode as y}from"@sankhyalabs/ezui/dist/collection/components/ez-check/CheckMode";import{C}from"./p-19dc71e9.js";import{O as x}from"./p-95ce311a.js";import"./p-8d884fab.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";class S{execute(i){var t;const s={actionID:i.actionID,refreshType:null===(t=i.actionConfig.javaCall)||void 0===t?void 0:t.refreshType};return new Promise((i=>{i({execSource:s,callback:this.callExecJava})}))}async callExecJava(i){const t={requestBody:{javaCall:i}};await m.get().callServiceBroker("ActionButtonsSP.executeJava",JSON.stringify(t))}}class z{execute(i){var t;const s={actionID:i.actionID,refreshType:null===(t=i.actionConfig.runScript)||void 0===t?void 0:t.refreshType};return new Promise((i=>{i({execSource:s,callback:this.callExecScript})}))}async callExecScript(i){const t={runScript:i};await m.get().callServiceBroker("ActionButtonsSP.executeScript",t)}}class A{constructor(){this._application=o.getContextValue("__SNK__APPLICATION__")}async execute(i,t){const s=i.resourceID;if(!s)return;let e=await this.buildLaunchObject(i,t);return this._application.openApp(s,e),null}buildLaunchObject(i,t){return new Promise((s=>{let e=i.actionConfig.params.param;if(e&&e.length>0){let n={},o=[];e.forEach((s=>{const e=s.localField;let l=t.getFieldValue(e);if(!l){let s=t.getField(e).label;throw s=r.isEmpty(t.getField(e).label)?e:s,new a(this._application.messagesBuilder.getMessage("snkActionsButton.title.error",void 0),this._application.messagesBuilder.getMessage("snkActionsButton.launchScreen.emptyField",{description:i.description,localFieldLabel:s}))}l=r.isEmpty(l.toString())?void 0:l.toString(),n[s.targetField]=l,o.push({fieldName:s.targetField,value:l})})),n.ACTION_PARAMETERS=o,n.call_time=Date.now(),s(n)}s(null)}))}}class O{execute(i){var t,s,e;const n=null===(t=i.actionConfig.dbCall)||void 0===t?void 0:t.name,o=null===(s=i.actionConfig.dbCall)||void 0===s?void 0:s.rootEntity,r={actionID:i.actionID,refreshType:null===(e=i.actionConfig.dbCall)||void 0===e?void 0:e.refreshType,procName:n,rootEntity:o};return new Promise((i=>{i({execSource:r,callback:this.callExecProcedure})}))}async callExecProcedure(i){const t={requestBody:{stpCall:i}};await m.get().callServiceBroker("ActionButtonsSP.executeSTP",JSON.stringify(t))}}var P,D;!function(i){i.LAUNCH_SCREEN="LC",i.JAVASCRIPT="SC",i.JAVA="RJ",i.PROCEDURE="SP",i.EMBEDDED="EB"}(P||(P={}));class N{constructor(i){this.actionType=i,this._application=o.getContextValue("__SNK__APPLICATION__")}get executor(){switch(this.actionType){case P.LAUNCH_SCREEN:return new A;case P.JAVASCRIPT:return new z;case P.JAVA:return new S;case P.PROCEDURE:return new O;default:throw new a(this._application.messagesBuilder.getMessage("snkActionsButton.title.error",void 0),this._application.messagesBuilder.getMessage("snkActionsButton.action.nonExistentType",{actionType:this.actionType}))}}}!function(i){i.NONE="NONE",i.PARENT="PARENT",i.MASTER="MASTER",i.ALL="ALL"}(D||(D={}));const E="__MASTER_ROW__";class I{constructor(i,t,s){var e;this._lastValuesCache={},this._actionsExecuteInterface=i,this._dataUnit=t,this._selectedRows=(null===(e=null==t?void 0:t.getSelectionInfo())||void 0===e?void 0:e.isAllRecords())?[]:null==t?void 0:t.getSelectionInfo().records,this._application=o.getContextValue("__SNK__APPLICATION__"),this._appResourceId=s}getPrimaryKeys(){return b(this._dataUnit).map((({name:i})=>i))}apply(i,t){this._application.closePopUp(),this._actionsExecuteInterface.execute(i,this._dataUnit).then((({execSource:s,callback:e})=>{this.resolvePromptParams(i,s,t).then((()=>{this.actionExecute(s,e)}))}))}async execute(i){var t;if(!i.actionConfig)throw new l(this._application.messagesBuilder.getMessage("snkActionsButton.title.warning",void 0),this._application.messagesBuilder.getMessage("snkActionsButton.action.incorrectAction",{description:i.description}));if(null===(t=i.actionConfig.params)||void 0===t?void 0:t.promptParam){const t=i.actionConfig.params.promptParam;let s=!1;for(let i=0;i<t.length;i++)if(!s&&"true"===t[i].saveLast){s=!0;break}s&&(i.actionConfig.params.promptParam=await this.loadSavedValuesIntoParams(i));const e=document.createElement("snk-actions-form");window.document.body.appendChild(e),e.action=c.copy(i),e.applyParameters=i=>{this.apply(i,s)},e.openPopup()}else i.type!=P.LAUNCH_SCREEN?this._actionsExecuteInterface.execute(i,this._dataUnit).then((({execSource:i,callback:t})=>{this.actionExecute(i,t)})):this._actionsExecuteInterface.execute(i,this._dataUnit)}loadSavedValuesIntoParams(i){return this.loadLastValues(i).then((t=>{let s=i.actionConfig.params.promptParam;return t&&t.param.forEach((i=>{s=s.map((t=>t.name!==i.paramName?t:Object.assign(Object.assign({},t),"B"===t.paramType?{value:"S"===i.$}:{value:i.$})))})),s}))}async actionExecute(i,t){i.virtualPage=this.buildVirtualPage(),await this.prepareAndExecute(i,t),this.recordsReloader(i.refreshType)}resolvePromptParams(i,t,s){return new Promise((e=>{let n=[];i.actionConfig.params.promptParam.forEach((i=>{n.push(this.buildPromptParam(i))})),this.putParamsOnExecSource(n,t),s&&this.saveLastValues(i,n),e()}))}buildPromptParam(i){let t,s,e=i.paramType,n=!1,o=i.value;switch(e){case p.DATE:e="D";break;case p.DATETIME:e="H";break;case p.DECIMAL:e="F",t={"sk-precision":Number(i.precision)};break;case p.BOOLEAN:e="S",n=!0,o=i.value?"S":"N";break;case p.ENTITY:t={"sk-entity-name":i.entityName,"sk-allow-show-hierarchical-mode":i.hierarchyEntity,"sk-data-type":"S"},i.hierarchyEntity&&i.entityPK&&(s=i.entityPK),o=i.value?Number(i.value):null;break;case p.OPTIONS:e="O";let r=i.options.split(";").map((function(i,t){let s,e;if(i.indexOf("=")>-1){let t=i.split("=");s=t[0],e=t[1]}else s=t+1,e=i;return{data:s,value:e}}));t={"sk-options":r}}return{description:i.label,required:"true"==i.required,fieldName:i.name,fieldNameOri:i.name,entityPK:s,paramType:i.paramType,type:e,isCheckbox:n,saveLast:i.saveLast,fieldProp:t,value:o,isGeneratedName:i.isGeneratedName}}putParamsOnExecSource(i,t){t.params={param:[]},i.forEach((i=>{if(i.isGeneratedName&&i.value)throw new a(this._application.messagesBuilder.getMessage("snkActionsButton.title.error",void 0),this._application.messagesBuilder.getMessage("snkActionsButton.action.emptyParamName",void 0));r.isEmpty(i.value)||t.params.param.push({type:this.getParamDataType(i.paramType),paramName:i.fieldName,$:this.getParamValue(i)})}))}getParamDataType(i){let t;switch(i){case"D":t="F";break;case"DT":case"DH":t="D";break;case"B":case"ENTITY":case"SO":t="S";break;default:t=i}return t}getParamValue(i){let t=i.value;return t?("DT"==i.paramType?t=d.formatDate(t):"DH"==i.paramType&&(t=d.formatDateTime(t)),t):t}async loadLastValues(i){const t=await this.buildResourceId(i.actionID);return new Promise(((i,s)=>{if(this._lastValuesCache[t])i(this._lastValuesCache[t]);else{const e={config:{chave:t,tipo:"T"}};m.get().callServiceBroker("SystemUtilsSP.getConf",e).then((s=>{var e,n;let o;(null===(n=null===(e=s.config)||void 0===e?void 0:e.data)||void 0===n?void 0:n.params)&&(o=s.config.data.params,Array.isArray(o.param)||(o.param=[o.param])),this._lastValuesCache[t]=o,i(o)})).catch((i=>{s(i)}))}}))}async saveLastValues(i,t){if(this._application){let s={params:{param:[]}};t.forEach((i=>{"true"==i.saveLast&&s.params.param.push({paramName:i.fieldName,$:i.value})}));const e=await this.buildResourceId(i.actionID);this._lastValuesCache[e]=s.params,this._application.saveConfig(e,s)}}async buildResourceId(i){return this._appResourceId+".actionconfig."+i}async prepareAndExecute(i,t){this.addRows(i),await t(i)}addRows(i){const t=this.getPrimaryKeys(),s={row:[]},e=this._selectedRows;for(const i in e){const n=e[i],o={};n.hasOwnProperty(E)&&(o.master="S",o.entityName=n.__ENTITY_NAME__,delete n[E],delete n.__ENTITY_NAME__),o.field||(o.field=[]);for(const i of t)o.field.push({fieldName:i,$:n[i]});s.row.push(o)}s.row.length>0&&(i.rows=s)}recordsReloader(i){switch(i){case D.NONE:break;case D.PARENT:case D.MASTER:case D.ALL:this._dataUnit.loadData();break;default:this._dataUnit.reloadCurrentRecord()}}buildVirtualPage(){var i,t,s,e;if(null===(t=null===(i=this._dataUnit)||void 0===i?void 0:i.getSelectionInfo())||void 0===t?void 0:t.isAllRecords())return{filters:{filters:null===(s=this._dataUnit)||void 0===s?void 0:s.getAppliedFilters()},orders:{orders:null===(e=this._dataUnit)||void 0===e?void 0:e.getSort()}}}}class L{async clientConfirm(i,t){return new Promise((s=>{const e=o.getContextValue("__SNK__APPLICATION__");let n="";i.content.event.hasOwnProperty("stpCall")?(t.requestBody=i.content.event.stpCall,n=P.PROCEDURE):i.content.event.hasOwnProperty("runScript")?(t.requestBody=i.content.event.runScript,n=P.JAVASCRIPT):i.content.event.hasOwnProperty("javaCall")&&(t.requestBody=i.content.event.javaCall,n=P.JAVA);let r={type:"S",sequence:i.content.event.sequence};t.requestBody.params?Array.isArray(t.requestBody.params.param)||(t.requestBody.params.param=[t.requestBody.params.param]):t.requestBody.params={param:[]},t.requestBody.params.param.push(r);const a=i.content.event.title.$,l=i.content.event.message.$;let c;switch(n){case P.JAVASCRIPT:c={runScript:t.requestBody};break;case P.PROCEDURE:c={requestBody:{stpCall:t.requestBody}};break;case P.JAVA:c={requestBody:{javaCall:t.requestBody}}}if("S"==i.content.event.showNoOption){r.paramName="__ESCOLHA_SIMNAO__";const i=document.createElement("snk-client-confirm");window.document.body.appendChild(i),i.titleMessage=a,i.message=l,i.accept=async()=>{r.$="S",await t.reCall(c),s()},i.cancel=async()=>{r.$="N",await t.reCall(c),s()},i.openPopup()}else e.confirm(a,l,null,"warn",{labelCancel:"Cancelar",labelConfirm:"Sim"}).then((async i=>{i&&(r.paramName="__CONFIRMACAO__",r.$="S",await t.reCall(c),s())}))}))}}const j=class{constructor(t){i(this,t),this.CLIENT_EVENT_CONFIRM_NAME="br.com.sankhya.actionbutton.clientconfirm",this._actions=[],this.handleClick=i=>{const t=this._actions.find((t=>t.actionID==i.detail.id)),s=new N(t.type).executor;new I(s,this._dataUnit,this._resourceID).execute(Object.assign({},t)),this._showDropdown=!1},this._items=[],this._showDropdown=!1}async getActions(){const i=await h.useCacheWithService(`SnkActionsButton_${this._entityName}-${this._resourceID}`,(async()=>{var i;const t={param:{entityName:this._entityName,resourceID:this._resourceID}};return(null===(i=(await m.get().callServiceBroker("ActionButtonsSP.getActions",t)).actions)||void 0===i?void 0:i.action)||[]}),u.IN_MEMORY_CACHE);this._actions=j.parameters.isOrderActions?g.sortAlphabetically(i,"description"):i}controlDropdown(){this._showDropdown=!this._showDropdown}canShowDropdown(){var i;return this._showDropdown&&(null===(i=this._items)||void 0===i?void 0:i.length)>0}positionDropdown(){var i;const t=null===(i=this._ezButton)||void 0===i?void 0:i.getBoundingClientRect();t&&this._dropdownParent&&(this._dropdownParent.style.top=t.y+t.height+5+"px",this._dropdownParent.style.left=t.x+"px")}closeDropdown(i){const t=null==i?void 0:i.target;t&&(t.closest(".snk-actions-button")||(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))}async componentWillLoad(){this._application=o.getContextValue("__SNK__APPLICATION__"),await this.loadParameters();const i=this._element.parentElement;this._dataUnit=null==i?void 0:i.dataUnit,this._resourceID=null==i?void 0:i.resourceID,this._entityName=this._dataUnit.name.split("/")[2],null==this._resourceID&&(this._resourceID=await k.getResourceID()),this.setEvents(),await this.getActions(),this.loadItems()}async componentDidLoad(){if(this._element&&(f.addIDInfo(this._element),this.positionDropdown(),!await this._application.hasClientEvent(this.CLIENT_EVENT_CONFIRM_NAME))){const i=new L;this._application.addClientEvent(this.CLIENT_EVENT_CONFIRM_NAME,i.clientConfirm)}}componentDidUpdate(){this.positionDropdown()}loadItems(){this._actions&&0!=this._actions.length&&this._actions.forEach((i=>{this._items.push({id:i.actionID,label:i.description})}))}getElementID(i){return{[f.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:f.getInternalIDInfo(i)}}async loadParameters(){null==j.parameters.isOrderActions&&(j.parameters.isOrderActions=await this._application.getBooleanParam("global.ordenar.acoes.personalizadas"))}render(){return t(s,null,this._actions&&this._actions.length>0&&t("div",{class:`ez-padding-left--medium snk-actions-button\n ${this.canShowDropdown()?" ez-elevation--16":""}\n `},t("ez-button",Object.assign({ref:i=>this._ezButton=i,iconName:"acao",size:"small",mode:"icon",title:this._application.messagesBuilder.getMessage("snkActionsButton.title.actions",void 0),onClick:()=>this.controlDropdown()},this.getElementID("button"))),t("div",Object.assign({ref:i=>this._dropdownParent=i,class:(this.canShowDropdown()?"snk-actions-button__dropdown--show":"snk-actions-button__dropdown")+"\n "},this.getElementID("dropdown")),this.canShowDropdown()&&t("ez-dropdown",Object.assign({items:this._items,onEzClick:i=>this.handleClick(i)},this.getElementID("dropdown"))))),this.canShowDropdown()&&t("div",Object.assign({class:"ez-scrim ez-scrim--light"},this.getElementID("ezScrim"))))}get _element(){return e(this)}};j.parameters={isOrderActions:null},j.style=".sc-snk-actions-button-h{display:flex;width:fit-content;height:fit-content}.snk-actions-button.sc-snk-actions-button{display:flex;width:fit-content;height:fit-content}.snk-actions-button__dropdown--show.sc-snk-actions-button{display:flex;flex-direction:column;position:fixed}.snk-actions-button__dropdown.sc-snk-actions-button>ez-dropdown.sc-snk-actions-button{position:relative}.snk-actions-button__dropdown.sc-snk-actions-button{display:none}";const B=class{constructor(t){i(this,t),this.configChange=n(this,"configChange",7),this.configCancel=n(this,"configCancel",7),this._orderListItems=[],this._orderPriorityList=[],this._columListItems=[],this._selectedIndex=-1,this._dataChanged=!1,this._componenteInternalKey=Date.now(),this.selectedIndex=0,this.columns=void 0,this.config=void 0,this.configName=void 0,this.resourceID=void 0}getMessage(i,t){return o.getContextValue("__SNK__APPLICATION__").messagesBuilder.getMessage(i,t)}getSortableColumns(){let i=[];return this.columns.filter((i=>{var t;return r.getBooleanValue(null===(t=null==i?void 0:i.props)||void 0===t?void 0:t.get("sortable"),!0)})).forEach((t=>{var s;let e=null===(s=this.config)||void 0===s?void 0:s.columns.find((i=>i.name===t.name)),n={name:t.name,label:t.label};e&&(n.orderIndex=e.orderIndex,n.ascending=e.ascending),t.hidden||i.push(n)})),i}createOrderList(){let i=this.getSortableColumns();i.sort(((i,t)=>0!=i.orderIndex||0!=t.orderIndex||null==i.ascending&&null==t.ascending?null!=i.ascending&&null!=t.ascending?i.orderIndex-t.orderIndex:null!=i.ascending||null!=t.ascending?null!=i.ascending?-1:null!=t.ascending?1:0:i.orderIndex-t.orderIndex:null!=i.ascending?-1:null!=t.ascending?1:0)),this._orderListItems=i}createColumnList(){let i={group:this.getMessage("snkGridConfig.group.visible"),items:[]},t={group:this.getMessage("snkGridConfig.group.hidden"),items:[],sort:x.asc.value};this.columns.forEach((s=>{let e={label:s.label};s.hidden?t.items.push(e):i.items.push(e)})),this._columListItems=[i,t]}createColumnListSlotDataElementId(i){return`configItem_${r.replaceAccentuatedChars(r.toCamelCase(i.label))}`}buildColumnListSlot(i,s){const e=this.createColumnListSlotDataElementId(i);return t("div",null,t("ez-check",{mode:y.SWITCH,id:y.SWITCH+((null==i?void 0:i.label)||"")+((null==s?void 0:s.group)||""),value:s.group===this.getMessage("snkGridConfig.group.visible"),"data-element-id":e,onEzChange:t=>{this.switchColumnGroup(t,i)}}))}createOrderListSlotDataElementId(i){return`${this._element.getAttribute(f.DATA_ELEMENT_ID_ATTRIBUTE_NAME)}_configItem_${r.toCamelCase(i.label)}`}buildOrderListSlot(i){const s=this.createOrderListSlotDataElementId(i);let e=x.none.value;return null!=(null==i?void 0:i.ascending)&&(e=1==i.ascending?x.asc.value:x.desc.value),t("div",null,t("snk-select-box",{selectedOption:e,key:"snk-select-box-"+this._componenteInternalKey+"-"+i,"data-element-id":s,onEzChange:t=>{t.stopPropagation(),this.updateOrder(t.detail,i.label)}}))}updateOrder(i,t){var s;this._dataChanged=!0;let e,n=[...this.columns],o=n.find((i=>i.label===t));o&&(o.sort=i.value===x.none.value?void 0:i.value),(null===(s=this._orderPriorityList)||void 0===s?void 0:s.length)>0?(this._orderPriorityList.find((i=>i.label===o.label)).sort=i,this._orderPriorityList.filter((i=>i.sort)).forEach(((i,t)=>{i.label===o.label&&(o.sortIndex=t)}))):(e=n.filter((i=>i.sort&&!0!==i.hidden)).map(((i,t)=>({label:i.label,orderIndex:t}))),e.forEach((i=>{n.find((t=>t.label===i.label)).sortIndex=i.orderIndex}))),this.columns=n}switchColumnGroup(i,t){i.stopPropagation();let s=[...this._columListItems];if(this._dataChanged=!0,!0===i.detail){let i=s.find((i=>i.group===this.getMessage("snkGridConfig.group.hidden"))),e=i.items.findIndex((i=>i.label===t.label));e>=0&&i.items.splice(e,1),s.find((i=>i.group===this.getMessage("snkGridConfig.group.visible"))).items.push(t),this._columListItems=s,this.createOrderList()}else if(!1===i.detail){let i=s.find((i=>i.group===this.getMessage("snkGridConfig.group.visible"))),e=i.items.findIndex((i=>i.label===t.label));e>=0&&i.items.splice(e,1),s.find((i=>i.group===this.getMessage("snkGridConfig.group.hidden"))).items.push(t),this._columListItems=s,this.createOrderList()}}finish(){if(!this._dataChanged)return void this.closeConfig();let i=[];this._columListItems.forEach((t=>{t.items.forEach((s=>{const e=this.columns.find((i=>i.label===s.label));let n=Object.assign({},e);n.hidden=t.group===this.getMessage("snkGridConfig.group.hidden"),i.push(n)}))})),this.columns=i,this._dataChanged=!1,this.closeConfig(),this.save()}saveGridConfigOnStorage(i){C.saveGridConfig(i,this.configName,this.resourceID).then((i=>{this.configChange.emit(i),this._orderList.clearHistory(),_.info(this.getMessage("snkGridConfig.info.successfullyConfigSaved"),{iconName:"check"})}))}reOrderPriorityColumns(i,t){let s=[];s=i.filter((i=>i.sort&&!0!==i.hidden)).map((i=>({label:i.label,orderIndex:0})));let e=0,n=[];return t.forEach((i=>{let t=s.find((t=>t.label===i.label));t&&(t.orderIndex=e,n.push(t),e++)})),n.length>0&&(s=n),s}save(){var i;let t;t=this.config?this.config:this.createConfigFromState(this.columns);let s,e=[];(null===(i=this._orderPriorityList)||void 0===i?void 0:i.length)>0&&(s=this.reOrderPriorityColumns(this.columns,this._orderPriorityList)),this.columns.forEach((i=>{let n=t.columns.find((t=>i.name===t.name));!0===i.hidden&&n||(n?n.width=i.width:!1===i.hidden&&(n={name:i.name,width:i.width,orderIndex:0}),n&&(i.sort?(n.ascending=i.sort.toUpperCase()===x.asc.value,s?function(i,t){if(s){let e=s.find((t=>t.label===i.label));e&&(t.orderIndex=e.orderIndex)}}(i,n):n.orderIndex=i.sortIndex):(delete n.ascending,n.orderIndex=0),e.push(n)))})),t.columns=e,this.saveGridConfigOnStorage(t)}createConfigFromState(i){let t={columns:[]};return i.forEach((i=>{if(!i.hidden){let s={name:i.name};i.width&&(s.width=i.width),i.sort?(s.ascending=i.sort.toUpperCase()===x.asc.value,s.orderIndex=i.sortIndex):s.orderIndex=0,s&&t.columns.push(s)}})),t}async locateColumn(i,t){var s;const e="Enter"===i.key;if(!(t=t||(null===(s=i.currentTarget)||void 0===s?void 0:s.value)))return void this.removeSelection();const n=await this.getMatchedIndexes(t),o=this.getNewSelectedIndex(n,e);this._selectedIndex=o,1===this.selectedIndex?this.updateOrderListSelection(o):this.updateColumnListSelection(o)}async getMatchedIndexes(i){const t=[];return 1===this.selectedIndex?(await this._orderList.getList()).forEach(((s,e)=>{this.compareWords(s,i)&&t.push(e)})):this.columns.forEach(((s,e)=>{this.compareWords(s,i)&&t.push(e)})),t}getNewSelectedIndex(i,t){if(0===i.length)return-1;if(t)for(const t of i)if(t>this._selectedIndex)return t;return i[0]}updateOrderListSelection(i){-1!==i?this._orderList.getList().then((t=>{const s=t[i];s?this._orderList.setSelection(s,!0):this._orderList.removeSelection()})):this._orderList.removeSelection()}updateColumnListSelection(i){if(-1===i)return void this._columnList.removeSelection();const t=this.columns[i];if(t){const i=this._columListItems.map((i=>i.items)).flat().find((i=>i.label===t.label));i?this._columnList.setSelection(i,!0):this._columnList.removeSelection()}else this._columnList.removeSelection()}removeSelection(){1===this.selectedIndex?this._orderList.removeSelection():this._columnList.removeSelection()}compareWords(i,t){var s,e;const n=null===(s=r.replaceAccentuatedChars(null==i?void 0:i.label))||void 0===s?void 0:s.toUpperCase(),o=null===(e=r.replaceAccentuatedChars(t))||void 0===e?void 0:e.toUpperCase();return!r.isEmpty(n)&&!r.isEmpty(o)&&n.includes(o)}getColumnNames(){const i=[];return i.push(this.getMessage("snkGridConfig.tab.columns")),i.push(this.getMessage("snkGridConfig.tab.lineOrdering")),i.join(",")}closeConfig(){if(this._orderList.scrollToTop(),this._columnList.scrollToTop(),this._searchElement.value="",this._dataChanged){let i={canClose:!1,labelCancel:this.getMessage("snkGridConfig.confirm.cancel"),labelConfirm:this.getMessage("snkGridConfig.confirm.save"),btnConfirmDanger:!1};_.confirm(this.getMessage("snkGridConfig.confirm.alert"),this.getMessage("snkGridConfig.confirm.msgCancel"),null,w.WARN,i).then((i=>{i?this.finish():(this._dataChanged=!1,this.configCancel.emit(),this._orderList.clearHistory(),this._componenteInternalKey=Date.now())}))}else this.configCancel.emit(),this._orderList.clearHistory()}handleTabChange(i){null!=(null==i?void 0:i.index)&&(this.selectedIndex!==i.index&&(0===i.index?this._orderList.scrollToTop():1===i.index&&this._columnList.scrollToTop(),this._searchElement.value=""),1===i.index&&this.createOrderList(),this.selectedIndex=i.index)}handleColumnListChange(i){var t;if(i.detail){let s=null===(t=i.detail.find((i=>i.group===this.getMessage("snkGridConfig.group.visible"))))||void 0===t?void 0:t.items;s&&(this._dataChanged=!0,this._orderListItems=s)}}handleOrderListChange(i){if(i.detail){let t=i.detail;t&&(this._dataChanged=!0,this._orderPriorityList=t)}}componentWillRender(){var i;(null===(i=this.columns)||void 0===i?void 0:i.length)>0&&this.createColumnList()}componentDidRender(){var i;(null===(i=this.columns)||void 0===i?void 0:i.length)>0&&this.locateColumn(new KeyboardEvent("arrow-right",{key:"ArrowRight"}),this._searchElement.value)}componentDidLoad(){f.addIDInfo(this._element)}render(){return t(s,null,t("div",{class:"grid-config__header"},t("div",{class:"title-container"},t("div",{class:""},t("label",{class:"title"},this.getMessage("snkGridConfig.gridConfiguration")),t("label",{class:"subtitle"},this.getMessage("snkGridConfig.columnVisibilityOrder"))),t("div",{class:"button-close"},t("ez-button",{mode:"icon",iconName:"close",size:"medium",onClick:()=>this.closeConfig()}))),t("div",{class:"tabselector-container"},t("ez-tabselector",{selectedIndex:this.selectedIndex,onEzChange:i=>{this.handleTabChange(i.detail)},tabs:this.getColumnNames()})),t("div",null,t("ez-text-input",{"data-element-id":"searchColums",ref:i=>this._searchElement=i,label:this.getMessage("snkGridConfig.findColumn"),onKeyUp:i=>this.locateColumn(i)},t("ez-icon",{slot:"leftIcon",size:"medium",iconName:"search"})))),t("div",{class:"grid-config__main"},t("ez-list",{ref:i=>this._columnList=i,class:0===this.selectedIndex?"":"hidden",dataSource:this._columListItems,onEzChange:i=>this.handleColumnListChange(i),ezDraggable:!0,ezSelectable:!0,itemSlotBuilder:(i,t)=>this.buildColumnListSlot(i,t),useGroups:!0,"data-element-id":"configCols"}),t("div",{class:1===this.selectedIndex?"group-name":"hidden"},this.getMessage("snkGridConfig.info.sortingSequence")),t("ez-list",{ref:i=>this._orderList=i,class:1===this.selectedIndex?"height-calc":"hidden",dataSource:this._orderListItems,ezSelectable:!0,onEzChange:i=>this.handleOrderListChange(i),ezDraggable:!0,itemSlotBuilder:i=>this.buildOrderListSlot(i),"data-element-id":"configDataOrder"})),t("div",{class:"grid-config__footer"},t("ez-button",{class:"padding-right--medium",label:this.getMessage("snkGridConfig.cancel"),onClick:()=>this.closeConfig()}),t("ez-button",{label:this.getMessage("snkGridConfig.complete"),class:"ez-button--primary",onClick:()=>this.finish()})))}static get assetsDirs(){return["../assets"]}get _element(){return e(this)}};B.style='.sc-snk-grid-config-h{--snk-grid-config__footer--padding-top:var(--space--medium, 12px);--snk-grid-config__main--padding-right:var(--space--medium, 12px);--snk-grid-config__tabselector-container--padding:var(--space--medium, 12px);--snk-grid-config__button-close--padding-left:var(--space--medium, 12px);--snk-grid-config__title--color:var(--title--primary, #2B3A54);--snk-grid-config__title--font-family:var(--font-pattern, "Roboto");--snk-grid-config__title--font-size:var(--title--large, 20px);--snk-grid-config__title--font-weight:var(--text-weight--extra-large, 700);--snk-grid-config__subtitle--font-family:var(--font-pattern, "Roboto");--snk-grid-config__subtitle--font-size:var(--text--medium, 14px);--snk-grid-config__group--font-family:var(--font-pattern, "Roboto");--snk-grid-config__group--font-size:var(--text--medium, 14px);--snk-grid-config__group--font-weight:var(--text-weight--large, 600);--snk-grid-config__group--padding-bottom:var(--space-small, 6px);--snk-grid-config__scrollbar--color-default:var(--scrollbar--default, #626e82);--snk-grid-config__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--snk-grid-config__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--snk-grid-config__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--snk-grid-config__scrollbar--border-radius:var(--border--radius-small, 6px);--snk-grid-config__scrollbar--width:var(--space--medium, 12px);display:grid;grid-template-rows:auto 1fr auto;max-height:100%;width:100%}@media screen and (min-width: 480px){.sc-snk-grid-config-h{width:359px;max-width:359px}}.padding-right--medium.sc-snk-grid-config{padding-right:var(--space--medium)}ez-list.sc-snk-grid-config{height:100%}.height-calc.sc-snk-grid-config{max-height:calc(100% - 24px)}.grid-config__footer.sc-snk-grid-config{display:flex;justify-content:flex-end;width:100%;padding-top:var(--snk-grid-config__footer--padding-top)}.hidden.sc-snk-grid-config{display:none}.tabselector-container.sc-snk-grid-config{padding:var(--snk-grid-config__tabselector-container--padding) 0}.button-close.sc-snk-grid-config{padding-left:var(--snk-grid-config__button-close--padding-left)}.title-container.sc-snk-grid-config{display:flex;justify-content:space-between;align-items:center;width:100%}.title.sc-snk-grid-config{display:flex;margin:0;line-height:normal;letter-spacing:0em;text-align:left;color:var(--snk-grid-config__title--color);font-size:var(--snk-grid-config__title--font-size);font-family:var(--snk-grid-config__title--font-family);font-weight:var(--snk-grid-config__title--font-weight)}.subtitle.sc-snk-grid-config{color:var(--text--primary);font-size:var(--snk-grid-config__subtitle--font-size);font-family:var(--snk-grid-config__subtitle--font-family)}.grid-config__main.sc-snk-grid-config{overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--snk-grid-config__scrollbar--color-clicked) var(--snk-grid-config__scrollbar--color-background);padding-right:var(--snk-grid-config__main--padding-right)}.grid-config__main.sc-snk-grid-config::-webkit-scrollbar{width:var(--snk-grid-config__scrollbar--width);max-width:var(--snk-grid-config__scrollbar--width);min-width:var(--snk-grid-config__scrollbar--width);background-color:var(--snk-grid-config__scrollbar--color-background)}.grid-config__main.sc-snk-grid-config::-webkit-scrollbar-track{background-color:var(--snk-grid-config__scrollbar--color-background);border-radius:var(--snk-grid-config__scrollbar--border-radius)}.grid-config__main.sc-snk-grid-config::-webkit-scrollbar-thumb{background-color:var(--snk-grid-config__scrollbar--color-default);border-radius:var(--snk-grid-config__scrollbar--border-radius)}.grid-config__main.sc-snk-grid-config::-webkit-scrollbar-thumb:vertical:hover,.grid-config__main.sc-snk-grid-config::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--snk-grid-config__scrollbar--color-hover)}.grid-config__main.sc-snk-grid-config::-webkit-scrollbar-thumb:vertical:active,.grid-config__main.sc-snk-grid-config::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--snk-grid-config__scrollbar--color-clicked)}.group-name.sc-snk-grid-config{font-family:var(--snk-grid-config__group--font-family);font-size:var(--snk-grid-config__group--font-size);font-weight:var(--snk-grid-config__group--font-weight);padding-bottom:var(--snk-grid-config__group--padding-bottom)}';const T=class{constructor(t){i(this,t),this.ezChange=n(this,"ezChange",7),this.selectedOption=x.none}render(){return t("ez-combo-box",{class:"grid-config-combo ez-input--inverted",label:"",suppressSearch:!0,value:this.selectedOption,enabled:!0,canShowError:!1,suppressEmptyOption:!0},Object.keys(x).map((i=>t("option",{value:x[i].value},x[i].label))))}static get assetsDirs(){return["../assets"]}};T.style="ez-combo-box{width:100px}.grid-config-combo{--ez-text-input--height:28px;--ez-text-input__input--background-color:#fff;--ez-text-input__input--border-color:#dce0e8}";const G=class{constructor(t){i(this,t),this.snkConfigSaved=n(this,"snkConfigSaved",7),this._formConfigFetcher=new v,this.fieldsToSave=[],this.dataUnit=void 0,this.configName=void 0,this.avaliableFields=[],this.selectedFields=[]}async show(){var i;await(null===(i=this.ezDoubleListRef)||void 0===i?void 0:i.resetSelectedLists()),await this.initializeFormConfig(),this.ezPopupRef.opened=!0}async initializeFormConfig(){if(!this.configName)return;const i=this.getAllVisibleFieldsFromDataUnit(),t=await this.getConfig();if(0===t.length)return this.avaliableFields=[],this.selectedFields=[...i],void(this.fieldsToSave=[...this.selectedFields]);const s=this.sortDisplayedFields(t,i),e=i.filter((i=>!t.includes(i.id)));this.avaliableFields=[...e],this.selectedFields=[...s],this.fieldsToSave=[...this.selectedFields]}async getConfig(){const i=await this._formConfigFetcher.fetchSimpleFormConfig(this.configName);return[...this.removeDuplicates(i)]}removeDuplicates(i){return i.filter(((t,s)=>i.indexOf(t)===s))}sortDisplayedFields(i,t){const s=[];return i.forEach((i=>{const e=t.find((t=>t.id===i));e&&s.push(e)})),s}getAllVisibleFieldsFromDataUnit(){var i,t,s;return(null!==(s=null===(t=null===(i=this.dataUnit)||void 0===i?void 0:i.metadata)||void 0===t?void 0:t.fields)&&void 0!==s?s:[]).filter((i=>i.visible)).map((i=>({id:i.name,label:i.label})))}close(){this.ezPopupRef.opened=!1}async handleResetConfigs(){await this._formConfigFetcher.restoreFormConfig(this.configName),await this.initializeFormConfig(),await this.handleSave()}handleCancel(){this.close()}async handleSave(){const i=this.fieldsToSave.map((i=>i.id));await this._formConfigFetcher.saveSimpleFormConfig(this.configName,i),this.close(),this.snkConfigSaved.emit()}render(){return t("ez-popup",{ref:i=>this.ezPopupRef=i,heightMode:"auto",size:"auto",ezTitle:"Configurar formulário"},t("div",{class:"config-container"},t("div",{class:"config-lists"},t("ez-double-list",{ref:i=>this.ezDoubleListRef=i,leftList:this.avaliableFields,leftTitle:"Campos disponíveis",rightList:this.selectedFields,rightTitle:"Campos selecionados",onEzRightListChanged:({detail:i})=>this.fieldsToSave=[...i],entityLabel:"campo",entityLabelPlural:"campos"})),t("div",{class:"config-actions"},t("ez-button",{label:"Restaurar",onClick:this.handleResetConfigs.bind(this),size:"small"}),t("ez-button",{label:"Cancelar",onClick:this.handleCancel.bind(this),size:"small"}),t("ez-button",{label:"Salvar",class:"ez-button--primary",onClick:this.handleSave.bind(this),size:"small"}))))}};G.style=":host{display:block}.config-container{display:flex;flex-direction:column;align-items:center;justify-content:space-between}.config-lists{margin-bottom:12px}.config-actions{display:flex;flex-direction:row;justify-content:flex-end;width:100%;gap:12px}";const R=class{constructor(t){i(this,t),this.taskbarActionSelected=n(this,"taskbarActionSelected",7),this.taskbarActionsOpened=n(this,"taskbarActionsOpened",7),this.taskbarActionsButtonDisconnected=n(this,"taskbarActionsButtonDisconnected",7),this._showDropdown=!1,this.title=void 0,this.enabled=void 0,this.actions=void 0}async handleKeyDown(i){"Escape"!==i.key&&"Esc"!==i.key||await this.hideActions()}async handleClose(){await this.hideActions()}async showActions(){this._showDropdown=!0,requestAnimationFrame((()=>{this._element.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}))}async hideActions(){this._showDropdown=!1}async isOpened(){return this._showDropdown}controlDropdown(){this._showDropdown=!this._showDropdown}loadItems(){return this.actions.filter((i=>void 0!==i)).map((i=>{var t;return{id:i.value,label:i.label,value:i.value,type:null!==(t=i.type)&&void 0!==t?t:"item",children:i.children,iconName:i.iconName,subAction:i.subAction,group:i.group,disableCloseOnSelect:i.disableCloseOnSelect}}))}canShowDropdown(){var i;return this._showDropdown&&(null===(i=this.actions)||void 0===i?void 0:i.length)>0}onSelectAction(i){const t=this.actions.map((i=>Object.assign(Object.assign({},i),{id:i.value}))),s=this.getSelectedAction(i.id,t);this.taskbarActionSelected.emit(s),s.disableCloseOnSelect||(this._showDropdown=!1)}getSelectedAction(i,t){let s=null;for(const e of t){if(e.id===i){s=e;break}if((null==e?void 0:e.children)&&(s=this.getSelectedAction(i,e.children),s))break}return s}dropdownItemBuilder(i,s){const e=this.actions.find((t=>t.value===i.id));if(!e||!e.itemBuilder)return;const n=e.itemBuilder(this._element,e);return"string"==typeof n?t("div",{innerHTML:n}):n}initializeEagerItems(){var i;null===(i=this.actions)||void 0===i||i.forEach((i=>{var t;i&&i.eagerInitialize&&i.itemBuilder&&(null===(t=i.itemBuilder)||void 0===t||t.call(i,this._element,i))}))}componentDidLoad(){this.initializeEagerItems()}componentDidRender(){this._showDropdown&&this.taskbarActionsOpened.emit(this._element)}disconnectedCallback(){this.taskbarActionsButtonDisconnected.emit()}render(){return t(s,null,t("div",{class:this.canShowDropdown()?" ez-elevation--16":""},t("ez-button",{title:this.title,mode:"icon",iconName:"dots-vertical",size:"small",enabled:this.enabled,onClick:()=>this.controlDropdown()}),this.canShowDropdown()&&t("ez-dropdown",{items:this.loadItems(),onEzClick:i=>this.onSelectAction(i.detail),onEzOutsideClick:()=>this._showDropdown=!1,itemBuilder:(i,t)=>this.dropdownItemBuilder(i,t)})))}get _element(){return e(this)}};R.style=".sc-taskbar-actions-button-h{display:flex;width:fit-content;height:fit-content}";export{j as snk_actions_button,B as snk_grid_config,T as snk_select_box,G as snk_simple_form_config,R as taskbar_actions_button}
1
+ import{r as i,h as t,H as s,g as e,c as n}from"./p-d2d301a6.js";import{ApplicationContext as o,StringUtils as r,ErrorException as a,WarningException as l,ObjectUtils as c,DateUtils as d,ServiceUtils as h,StorageType as u,ArrayUtils as g,ElementIDUtils as f}from"@sankhyalabs/core";import{D as m}from"./p-d62228fb.js";import{P as p}from"./p-eaad0aa8.js";import"./p-798386c7.js";import"./p-30cf616e.js";import"./p-21749402.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-1e4f16f3.js";import"./p-ff1990ad.js";import{F as v}from"./p-1435701f.js";import{g as b}from"./p-7dd49d15.js";import{R as k}from"./p-688dcb4c.js";import{ApplicationUtils as _,DialogType as w}from"@sankhyalabs/ezui/dist/collection/utils";import{CheckMode as y}from"@sankhyalabs/ezui/dist/collection/components/ez-check/CheckMode";import{C}from"./p-19dc71e9.js";import{O as x}from"./p-95ce311a.js";import"./p-8d884fab.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";class S{execute(i){var t;const s={actionID:i.actionID,refreshType:null===(t=i.actionConfig.javaCall)||void 0===t?void 0:t.refreshType};return new Promise((i=>{i({execSource:s,callback:this.callExecJava})}))}async callExecJava(i){const t={requestBody:{javaCall:i}};await m.get().callServiceBroker("ActionButtonsSP.executeJava",JSON.stringify(t))}}class z{execute(i){var t;const s={actionID:i.actionID,refreshType:null===(t=i.actionConfig.runScript)||void 0===t?void 0:t.refreshType};return new Promise((i=>{i({execSource:s,callback:this.callExecScript})}))}async callExecScript(i){const t={runScript:i};await m.get().callServiceBroker("ActionButtonsSP.executeScript",t)}}class A{constructor(){this._application=o.getContextValue("__SNK__APPLICATION__")}async execute(i,t){const s=i.resourceID;if(!s)return;let e=await this.buildLaunchObject(i,t);return this._application.openApp(s,e),null}buildLaunchObject(i,t){return new Promise((s=>{let e=i.actionConfig.params.param;if(e&&e.length>0){let n={},o=[];e.forEach((s=>{const e=s.localField;let l=t.getFieldValue(e);if(!l){let s=t.getField(e).label;throw s=r.isEmpty(t.getField(e).label)?e:s,new a(this._application.messagesBuilder.getMessage("snkActionsButton.title.error",void 0),this._application.messagesBuilder.getMessage("snkActionsButton.launchScreen.emptyField",{description:i.description,localFieldLabel:s}))}l=r.isEmpty(l.toString())?void 0:l.toString(),n[s.targetField]=l,o.push({fieldName:s.targetField,value:l})})),n.ACTION_PARAMETERS=o,n.call_time=Date.now(),s(n)}s(null)}))}}class O{execute(i){var t,s,e;const n=null===(t=i.actionConfig.dbCall)||void 0===t?void 0:t.name,o=null===(s=i.actionConfig.dbCall)||void 0===s?void 0:s.rootEntity,r={actionID:i.actionID,refreshType:null===(e=i.actionConfig.dbCall)||void 0===e?void 0:e.refreshType,procName:n,rootEntity:o};return new Promise((i=>{i({execSource:r,callback:this.callExecProcedure})}))}async callExecProcedure(i){const t={requestBody:{stpCall:i}};await m.get().callServiceBroker("ActionButtonsSP.executeSTP",JSON.stringify(t))}}var P,D;!function(i){i.LAUNCH_SCREEN="LC",i.JAVASCRIPT="SC",i.JAVA="RJ",i.PROCEDURE="SP",i.EMBEDDED="EB"}(P||(P={}));class N{constructor(i){this.actionType=i,this._application=o.getContextValue("__SNK__APPLICATION__")}get executor(){switch(this.actionType){case P.LAUNCH_SCREEN:return new A;case P.JAVASCRIPT:return new z;case P.JAVA:return new S;case P.PROCEDURE:return new O;default:throw new a(this._application.messagesBuilder.getMessage("snkActionsButton.title.error",void 0),this._application.messagesBuilder.getMessage("snkActionsButton.action.nonExistentType",{actionType:this.actionType}))}}}!function(i){i.NONE="NONE",i.PARENT="PARENT",i.MASTER="MASTER",i.ALL="ALL"}(D||(D={}));const E="__MASTER_ROW__";class I{constructor(i,t,s){var e;this._lastValuesCache={},this._actionsExecuteInterface=i,this._dataUnit=t,this._selectedRows=(null===(e=null==t?void 0:t.getSelectionInfo())||void 0===e?void 0:e.isAllRecords())?[]:null==t?void 0:t.getSelectionInfo().records,this._application=o.getContextValue("__SNK__APPLICATION__"),this._appResourceId=s}getPrimaryKeys(){return b(this._dataUnit).map((({name:i})=>i))}apply(i,t){this._application.closePopUp(),this._actionsExecuteInterface.execute(i,this._dataUnit).then((({execSource:s,callback:e})=>{this.resolvePromptParams(i,s,t).then((()=>{this.actionExecute(s,e)}))}))}async execute(i){var t;if(!i.actionConfig)throw new l(this._application.messagesBuilder.getMessage("snkActionsButton.title.warning",void 0),this._application.messagesBuilder.getMessage("snkActionsButton.action.incorrectAction",{description:i.description}));if(null===(t=i.actionConfig.params)||void 0===t?void 0:t.promptParam){const t=i.actionConfig.params.promptParam;let s=!1;for(let i=0;i<t.length;i++)if(!s&&"true"===t[i].saveLast){s=!0;break}s&&(i.actionConfig.params.promptParam=await this.loadSavedValuesIntoParams(i));const e=document.createElement("snk-actions-form");window.document.body.appendChild(e),e.action=c.copy(i),e.applyParameters=i=>{this.apply(i,s)},e.openPopup()}else i.type!=P.LAUNCH_SCREEN?this._actionsExecuteInterface.execute(i,this._dataUnit).then((({execSource:i,callback:t})=>{this.actionExecute(i,t)})):this._actionsExecuteInterface.execute(i,this._dataUnit)}loadSavedValuesIntoParams(i){return this.loadLastValues(i).then((t=>{let s=i.actionConfig.params.promptParam;return t&&t.param.forEach((i=>{s=s.map((t=>t.name!==i.paramName?t:Object.assign(Object.assign({},t),"B"===t.paramType?{value:"S"===i.$}:{value:i.$})))})),s}))}async actionExecute(i,t){i.virtualPage=this.buildVirtualPage(),await this.prepareAndExecute(i,t),this.recordsReloader(i.refreshType)}resolvePromptParams(i,t,s){return new Promise((e=>{let n=[];i.actionConfig.params.promptParam.forEach((i=>{n.push(this.buildPromptParam(i))})),this.putParamsOnExecSource(n,t),s&&this.saveLastValues(i,n),e()}))}buildPromptParam(i){let t,s,e=i.paramType,n=!1,o=i.value;switch(e){case p.DATE:e="D";break;case p.DATETIME:e="H";break;case p.DECIMAL:e="F",t={"sk-precision":Number(i.precision)};break;case p.BOOLEAN:e="S",n=!0,o=i.value?"S":"N";break;case p.ENTITY:t={"sk-entity-name":i.entityName,"sk-allow-show-hierarchical-mode":i.hierarchyEntity,"sk-data-type":"S"},i.hierarchyEntity&&i.entityPK&&(s=i.entityPK),o=i.value?Number(i.value):null;break;case p.OPTIONS:e="O";let r=i.options.split(";").map((function(i,t){let s,e;if(i.indexOf("=")>-1){let t=i.split("=");s=t[0],e=t[1]}else s=t+1,e=i;return{data:s,value:e}}));t={"sk-options":r}}return{description:i.label,required:"true"==i.required,fieldName:i.name,fieldNameOri:i.name,entityPK:s,paramType:i.paramType,type:e,isCheckbox:n,saveLast:i.saveLast,fieldProp:t,value:o,isGeneratedName:i.isGeneratedName}}putParamsOnExecSource(i,t){t.params={param:[]},i.forEach((i=>{if(i.isGeneratedName&&i.value)throw new a(this._application.messagesBuilder.getMessage("snkActionsButton.title.error",void 0),this._application.messagesBuilder.getMessage("snkActionsButton.action.emptyParamName",void 0));r.isEmpty(i.value)||t.params.param.push({type:this.getParamDataType(i.paramType),paramName:i.fieldName,$:this.getParamValue(i)})}))}getParamDataType(i){let t;switch(i){case"D":t="F";break;case"DT":case"DH":t="D";break;case"B":case"ENTITY":case"SO":t="S";break;default:t=i}return t}getParamValue(i){let t=i.value;return t?("DT"==i.paramType?t=d.formatDate(t):"DH"==i.paramType&&(t=d.formatDateTime(t)),t):t}async loadLastValues(i){const t=await this.buildResourceId(i.actionID);return new Promise(((i,s)=>{if(this._lastValuesCache[t])i(this._lastValuesCache[t]);else{const e={config:{chave:t,tipo:"T"}};m.get().callServiceBroker("SystemUtilsSP.getConf",e).then((s=>{var e,n;let o;(null===(n=null===(e=s.config)||void 0===e?void 0:e.data)||void 0===n?void 0:n.params)&&(o=s.config.data.params,Array.isArray(o.param)||(o.param=[o.param])),this._lastValuesCache[t]=o,i(o)})).catch((i=>{s(i)}))}}))}async saveLastValues(i,t){if(this._application){let s={params:{param:[]}};t.forEach((i=>{"true"==i.saveLast&&s.params.param.push({paramName:i.fieldName,$:i.value})}));const e=await this.buildResourceId(i.actionID);this._lastValuesCache[e]=s.params,this._application.saveConfig(e,s)}}async buildResourceId(i){return this._appResourceId+".actionconfig."+i}async prepareAndExecute(i,t){this.addRows(i),await t(i)}addRows(i){const t=this.getPrimaryKeys(),s={row:[]},e=this._selectedRows;for(const i in e){const n=e[i],o={};n.hasOwnProperty(E)&&(o.master="S",o.entityName=n.__ENTITY_NAME__,delete n[E],delete n.__ENTITY_NAME__),o.field||(o.field=[]);for(const i of t)o.field.push({fieldName:i,$:n[i]});s.row.push(o)}s.row.length>0&&(i.rows=s)}recordsReloader(i){switch(i){case D.NONE:break;case D.PARENT:case D.MASTER:case D.ALL:this._dataUnit.loadData();break;default:this._dataUnit.reloadCurrentRecord()}}buildVirtualPage(){var i,t,s,e;if(null===(t=null===(i=this._dataUnit)||void 0===i?void 0:i.getSelectionInfo())||void 0===t?void 0:t.isAllRecords())return{filters:{filters:null===(s=this._dataUnit)||void 0===s?void 0:s.getAppliedFilters()},orders:{orders:null===(e=this._dataUnit)||void 0===e?void 0:e.getSort()}}}}class L{async clientConfirm(i,t){return new Promise((s=>{const e=o.getContextValue("__SNK__APPLICATION__");let n="";i.content.event.hasOwnProperty("stpCall")?(t.requestBody=i.content.event.stpCall,n=P.PROCEDURE):i.content.event.hasOwnProperty("runScript")?(t.requestBody=i.content.event.runScript,n=P.JAVASCRIPT):i.content.event.hasOwnProperty("javaCall")&&(t.requestBody=i.content.event.javaCall,n=P.JAVA);let r={type:"S",sequence:i.content.event.sequence};t.requestBody.params?Array.isArray(t.requestBody.params.param)||(t.requestBody.params.param=[t.requestBody.params.param]):t.requestBody.params={param:[]},t.requestBody.params.param.push(r);const a=i.content.event.title.$,l=i.content.event.message.$;let c;switch(n){case P.JAVASCRIPT:c={runScript:t.requestBody};break;case P.PROCEDURE:c={requestBody:{stpCall:t.requestBody}};break;case P.JAVA:c={requestBody:{javaCall:t.requestBody}}}if("S"==i.content.event.showNoOption){r.paramName="__ESCOLHA_SIMNAO__";const i=document.createElement("snk-client-confirm");window.document.body.appendChild(i),i.titleMessage=a,i.message=l,i.accept=async()=>{r.$="S",await t.reCall(c),s()},i.cancel=async()=>{r.$="N",await t.reCall(c),s()},i.openPopup()}else e.confirm(a,l,null,"warn",{labelCancel:"Cancelar",labelConfirm:"Sim"}).then((async i=>{i&&(r.paramName="__CONFIRMACAO__",r.$="S",await t.reCall(c),s())}))}))}}const j=class{constructor(t){i(this,t),this.CLIENT_EVENT_CONFIRM_NAME="br.com.sankhya.actionbutton.clientconfirm",this._actions=[],this.handleClick=i=>{const t=this._actions.find((t=>t.actionID==i.detail.id)),s=new N(t.type).executor;new I(s,this._dataUnit,this._resourceID).execute(Object.assign({},t)),this._showDropdown=!1},this._items=[],this._showDropdown=!1}async getActions(){const i=await h.useCacheWithService(`SnkActionsButton_${this._entityName}-${this._resourceID}`,(async()=>{var i;const t={param:{entityName:this._entityName,resourceID:this._resourceID}};return(null===(i=(await m.get().callServiceBroker("ActionButtonsSP.getActions",t)).actions)||void 0===i?void 0:i.action)||[]}),u.IN_MEMORY_CACHE);this._actions=j.parameters.isOrderActions?g.sortAlphabetically(i,"description"):i}controlDropdown(){this._showDropdown=!this._showDropdown}canShowDropdown(){var i;return this._showDropdown&&(null===(i=this._items)||void 0===i?void 0:i.length)>0}positionDropdown(){var i;const t=null===(i=this._ezButton)||void 0===i?void 0:i.getBoundingClientRect();t&&this._dropdownParent&&(this._dropdownParent.style.top=t.y+t.height+5+"px",this._dropdownParent.style.left=t.x+"px")}closeDropdown(i){const t=null==i?void 0:i.target;t&&(t.closest(".snk-actions-button")||(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))}async componentWillLoad(){this._application=o.getContextValue("__SNK__APPLICATION__"),await this.loadParameters();const i=this._element.parentElement;this._dataUnit=null==i?void 0:i.dataUnit,this._resourceID=null==i?void 0:i.resourceID,this._entityName=this._dataUnit.name.split("/")[2],null==this._resourceID&&(this._resourceID=await k.getResourceID()),this.setEvents(),await this.getActions(),this.loadItems()}async componentDidLoad(){if(this._element&&(f.addIDInfo(this._element),this.positionDropdown(),!await this._application.hasClientEvent(this.CLIENT_EVENT_CONFIRM_NAME))){const i=new L;this._application.addClientEvent(this.CLIENT_EVENT_CONFIRM_NAME,i.clientConfirm)}}componentDidUpdate(){this.positionDropdown()}loadItems(){this._actions&&0!=this._actions.length&&this._actions.forEach((i=>{this._items.push({id:i.actionID,label:i.description})}))}getElementID(i){return{[f.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:f.getInternalIDInfo(i)}}async loadParameters(){null==j.parameters.isOrderActions&&(j.parameters.isOrderActions=await this._application.getBooleanParam("global.ordenar.acoes.personalizadas"))}render(){return t(s,null,this._actions&&this._actions.length>0&&t("div",{class:`ez-padding-left--medium snk-actions-button\n ${this.canShowDropdown()?" ez-elevation--16":""}\n `},t("ez-button",Object.assign({ref:i=>this._ezButton=i,iconName:"acao",size:"small",mode:"icon",title:this._application.messagesBuilder.getMessage("snkActionsButton.title.actions",void 0),onClick:()=>this.controlDropdown()},this.getElementID("button"))),t("div",Object.assign({ref:i=>this._dropdownParent=i,class:(this.canShowDropdown()?"snk-actions-button__dropdown--show":"snk-actions-button__dropdown")+"\n "},this.getElementID("dropdown")),this.canShowDropdown()&&t("ez-dropdown",Object.assign({items:this._items,onEzClick:i=>this.handleClick(i)},this.getElementID("dropdown"))))),this.canShowDropdown()&&t("div",Object.assign({class:"ez-scrim ez-scrim--light"},this.getElementID("ezScrim"))))}get _element(){return e(this)}};j.parameters={isOrderActions:null},j.style=".sc-snk-actions-button-h{display:flex;width:fit-content;height:fit-content}.snk-actions-button.sc-snk-actions-button{display:flex;width:fit-content;height:fit-content}.snk-actions-button__dropdown--show.sc-snk-actions-button{display:flex;flex-direction:column;position:fixed}.snk-actions-button__dropdown.sc-snk-actions-button>ez-dropdown.sc-snk-actions-button{position:relative}.snk-actions-button__dropdown.sc-snk-actions-button{display:none}";const B=class{constructor(t){i(this,t),this.configChange=n(this,"configChange",7),this.configCancel=n(this,"configCancel",7),this._orderListItems=[],this._orderPriorityList=[],this._columListItems=[],this._selectedIndex=-1,this._dataChanged=!1,this._componenteInternalKey=Date.now(),this.selectedIndex=0,this.columns=void 0,this.config=void 0,this.configName=void 0,this.resourceID=void 0}getMessage(i,t){return o.getContextValue("__SNK__APPLICATION__").messagesBuilder.getMessage(i,t)}getSortableColumns(){let i=[];return this.columns.filter((i=>{var t;return r.getBooleanValue(null===(t=null==i?void 0:i.props)||void 0===t?void 0:t.get("sortable"),!0)})).forEach((t=>{var s;let e=null===(s=this.config)||void 0===s?void 0:s.columns.find((i=>i.name===t.name)),n={name:t.name,label:t.label};e&&(n.orderIndex=e.orderIndex,n.ascending=e.ascending),t.hidden||i.push(n)})),i}createOrderList(){let i=this.getSortableColumns();i.sort(((i,t)=>0!=i.orderIndex||0!=t.orderIndex||null==i.ascending&&null==t.ascending?null!=i.ascending&&null!=t.ascending?i.orderIndex-t.orderIndex:null!=i.ascending||null!=t.ascending?null!=i.ascending?-1:null!=t.ascending?1:0:i.orderIndex-t.orderIndex:null!=i.ascending?-1:null!=t.ascending?1:0)),this._orderListItems=i}createColumnList(){let i={group:this.getMessage("snkGridConfig.group.visible"),items:[]},t={group:this.getMessage("snkGridConfig.group.hidden"),items:[],sort:x.asc.value};this.columns.forEach((s=>{let e={label:s.label};s.hidden?t.items.push(e):i.items.push(e)})),this._columListItems=[i,t]}createColumnListSlotDataElementId(i){return`configItem_${r.replaceAccentuatedChars(r.toCamelCase(i.label))}`}buildColumnListSlot(i,s){const e=this.createColumnListSlotDataElementId(i);return t("div",null,t("ez-check",{mode:y.SWITCH,id:y.SWITCH+((null==i?void 0:i.label)||"")+((null==s?void 0:s.group)||""),value:s.group===this.getMessage("snkGridConfig.group.visible"),"data-element-id":e,onEzChange:t=>{this.switchColumnGroup(t,i)}}))}createOrderListSlotDataElementId(i){return`${this._element.getAttribute(f.DATA_ELEMENT_ID_ATTRIBUTE_NAME)}_configItem_${r.toCamelCase(i.label)}`}buildOrderListSlot(i){const s=this.createOrderListSlotDataElementId(i);let e=x.none.value;return null!=(null==i?void 0:i.ascending)&&(e=1==i.ascending?x.asc.value:x.desc.value),t("div",null,t("snk-select-box",{selectedOption:e,key:"snk-select-box-"+this._componenteInternalKey+"-"+i,"data-element-id":s,onEzChange:t=>{t.stopPropagation(),this.updateOrder(t.detail,i.label)}}))}updateOrder(i,t){var s;this._dataChanged=!0;let e,n=[...this.columns],o=n.find((i=>i.label===t));o&&(o.sort=i.value===x.none.value?void 0:i.value),(null===(s=this._orderPriorityList)||void 0===s?void 0:s.length)>0?(this._orderPriorityList.find((i=>i.label===o.label)).sort=i,this._orderPriorityList.filter((i=>i.sort)).forEach(((i,t)=>{i.label===o.label&&(o.sortIndex=t)}))):(e=n.filter((i=>i.sort&&!0!==i.hidden)).map(((i,t)=>({label:i.label,orderIndex:t}))),e.forEach((i=>{n.find((t=>t.label===i.label)).sortIndex=i.orderIndex}))),this.columns=n}switchColumnGroup(i,t){i.stopPropagation();let s=[...this._columListItems];if(this._dataChanged=!0,!0===i.detail){let i=s.find((i=>i.group===this.getMessage("snkGridConfig.group.hidden"))),e=i.items.findIndex((i=>i.label===t.label));e>=0&&i.items.splice(e,1),s.find((i=>i.group===this.getMessage("snkGridConfig.group.visible"))).items.push(t),this._columListItems=s,this.createOrderList()}else if(!1===i.detail){let i=s.find((i=>i.group===this.getMessage("snkGridConfig.group.visible"))),e=i.items.findIndex((i=>i.label===t.label));e>=0&&i.items.splice(e,1),s.find((i=>i.group===this.getMessage("snkGridConfig.group.hidden"))).items.push(t),this._columListItems=s,this.createOrderList()}}finish(){if(!this._dataChanged)return void this.closeConfig();let i=[];this._columListItems.forEach((t=>{t.items.forEach((s=>{const e=this.columns.find((i=>i.label===s.label));let n=Object.assign({},e);n.hidden=t.group===this.getMessage("snkGridConfig.group.hidden"),i.push(n)}))})),this.columns=i,this._dataChanged=!1,this.closeConfig(),this.save()}saveGridConfigOnStorage(i){C.saveGridConfig(i,this.configName,this.resourceID).then((i=>{this.configChange.emit(i),this._orderList.clearHistory(),_.info(this.getMessage("snkGridConfig.info.successfullyConfigSaved"),{iconName:"check"})}))}reOrderPriorityColumns(i,t){let s=[];s=i.filter((i=>i.sort&&!0!==i.hidden)).map((i=>({label:i.label,orderIndex:0})));let e=0,n=[];return t.forEach((i=>{let t=s.find((t=>t.label===i.label));t&&(t.orderIndex=e,n.push(t),e++)})),n.length>0&&(s=n),s}save(){var i;let t;t=this.config?this.config:this.createConfigFromState(this.columns);let s,e=[];(null===(i=this._orderPriorityList)||void 0===i?void 0:i.length)>0&&(s=this.reOrderPriorityColumns(this.columns,this._orderPriorityList)),this.columns.forEach((i=>{let n=t.columns.find((t=>i.name===t.name));!0===i.hidden&&n||(n?n.width=i.width:!1===i.hidden&&(n={name:i.name,width:i.width,orderIndex:0}),n&&(i.sort?(n.ascending=i.sort.toUpperCase()===x.asc.value,s?function(i,t){if(s){let e=s.find((t=>t.label===i.label));e&&(t.orderIndex=e.orderIndex)}}(i,n):n.orderIndex=i.sortIndex):(delete n.ascending,n.orderIndex=0),e.push(n)))})),t.columns=e,this.saveGridConfigOnStorage(t)}createConfigFromState(i){let t={columns:[]};return i.forEach((i=>{if(!i.hidden){let s={name:i.name};i.width&&(s.width=i.width),i.sort?(s.ascending=i.sort.toUpperCase()===x.asc.value,s.orderIndex=i.sortIndex):s.orderIndex=0,s&&t.columns.push(s)}})),t}async locateColumn(i,t){var s;const e="Enter"===i.key;if(!(t=t||(null===(s=i.currentTarget)||void 0===s?void 0:s.value)))return void this.removeSelection();const n=await this.getMatchedIndexes(t),o=this.getNewSelectedIndex(n,e);this._selectedIndex=o,1===this.selectedIndex?this.updateOrderListSelection(o):this.updateColumnListSelection(o)}async getMatchedIndexes(i){const t=[];return 1===this.selectedIndex?(await this._orderList.getList()).forEach(((s,e)=>{this.compareWords(s,i)&&t.push(e)})):this.columns.forEach(((s,e)=>{this.compareWords(s,i)&&t.push(e)})),t}getNewSelectedIndex(i,t){if(0===i.length)return-1;if(t)for(const t of i)if(t>this._selectedIndex)return t;return i[0]}updateOrderListSelection(i){-1!==i?this._orderList.getList().then((t=>{const s=t[i];s?this._orderList.setSelection(s,!0):this._orderList.removeSelection()})):this._orderList.removeSelection()}updateColumnListSelection(i){if(-1===i)return void this._columnList.removeSelection();const t=this.columns[i];if(t){const i=this._columListItems.map((i=>i.items)).flat().find((i=>i.label===t.label));i?this._columnList.setSelection(i,!0):this._columnList.removeSelection()}else this._columnList.removeSelection()}removeSelection(){1===this.selectedIndex?this._orderList.removeSelection():this._columnList.removeSelection()}compareWords(i,t){var s,e;const n=null===(s=r.replaceAccentuatedChars(null==i?void 0:i.label))||void 0===s?void 0:s.toUpperCase(),o=null===(e=r.replaceAccentuatedChars(t))||void 0===e?void 0:e.toUpperCase();return!r.isEmpty(n)&&!r.isEmpty(o)&&n.includes(o)}getColumnNames(){const i=[];return i.push(this.getMessage("snkGridConfig.tab.columns")),i.push(this.getMessage("snkGridConfig.tab.lineOrdering")),i.join(",")}closeConfig(){if(this._orderList.scrollToTop(),this._columnList.scrollToTop(),this._searchElement.value="",this._dataChanged){let i={canClose:!1,labelCancel:this.getMessage("snkGridConfig.confirm.cancel"),labelConfirm:this.getMessage("snkGridConfig.confirm.save"),btnConfirmDanger:!1};_.confirm(this.getMessage("snkGridConfig.confirm.alert"),this.getMessage("snkGridConfig.confirm.msgCancel"),null,w.WARN,i).then((i=>{i?this.finish():(this._dataChanged=!1,this.configCancel.emit(),this._orderList.clearHistory(),this._componenteInternalKey=Date.now())}))}else this.configCancel.emit(),this._orderList.clearHistory()}handleTabChange(i){null!=(null==i?void 0:i.index)&&(this.selectedIndex!==i.index&&(0===i.index?this._orderList.scrollToTop():1===i.index&&this._columnList.scrollToTop(),this._searchElement.value=""),1===i.index&&this.createOrderList(),this.selectedIndex=i.index)}handleColumnListChange(i){var t;if(i.detail){let s=null===(t=i.detail.find((i=>i.group===this.getMessage("snkGridConfig.group.visible"))))||void 0===t?void 0:t.items;s&&(this._dataChanged=!0,this._orderListItems=s)}}handleOrderListChange(i){if(i.detail){let t=i.detail;t&&(this._dataChanged=!0,this._orderPriorityList=t)}}componentWillRender(){var i;(null===(i=this.columns)||void 0===i?void 0:i.length)>0&&this.createColumnList()}componentDidRender(){var i;(null===(i=this.columns)||void 0===i?void 0:i.length)>0&&this.locateColumn(new KeyboardEvent("arrow-right",{key:"ArrowRight"}),this._searchElement.value)}componentDidLoad(){f.addIDInfo(this._element)}render(){return t(s,null,t("div",{class:"grid-config__header"},t("div",{class:"title-container"},t("div",{class:""},t("label",{class:"title"},this.getMessage("snkGridConfig.gridConfiguration")),t("label",{class:"subtitle"},this.getMessage("snkGridConfig.columnVisibilityOrder"))),t("div",{class:"button-close"},t("ez-button",{mode:"icon",iconName:"close",size:"medium",onClick:()=>this.closeConfig()}))),t("div",{class:"tabselector-container"},t("ez-tabselector",{selectedIndex:this.selectedIndex,onEzChange:i=>{this.handleTabChange(i.detail)},tabs:this.getColumnNames()})),t("div",null,t("ez-text-input",{"data-element-id":"searchColums",ref:i=>this._searchElement=i,label:this.getMessage("snkGridConfig.findColumn"),onKeyUp:i=>this.locateColumn(i)},t("ez-icon",{slot:"leftIcon",size:"medium",iconName:"search"})))),t("div",{class:"grid-config__main"},t("ez-list",{ref:i=>this._columnList=i,class:0===this.selectedIndex?"":"hidden",dataSource:this._columListItems,onEzChange:i=>this.handleColumnListChange(i),ezDraggable:!0,ezSelectable:!0,itemSlotBuilder:(i,t)=>this.buildColumnListSlot(i,t),useGroups:!0,"data-element-id":"configCols"}),t("div",{class:1===this.selectedIndex?"group-name":"hidden"},this.getMessage("snkGridConfig.info.sortingSequence")),t("ez-list",{ref:i=>this._orderList=i,class:1===this.selectedIndex?"height-calc":"hidden",dataSource:this._orderListItems,ezSelectable:!0,onEzChange:i=>this.handleOrderListChange(i),ezDraggable:!0,itemSlotBuilder:i=>this.buildOrderListSlot(i),"data-element-id":"configDataOrder"})),t("div",{class:"grid-config__footer"},t("ez-button",{class:"padding-right--medium",label:this.getMessage("snkGridConfig.cancel"),onClick:()=>this.closeConfig()}),t("ez-button",{label:this.getMessage("snkGridConfig.complete"),class:"ez-button--primary",onClick:()=>this.finish()})))}static get assetsDirs(){return["../assets"]}get _element(){return e(this)}};B.style='.sc-snk-grid-config-h{--snk-grid-config__footer--padding-top:var(--space--medium, 12px);--snk-grid-config__main--padding-right:var(--space--medium, 12px);--snk-grid-config__tabselector-container--padding:var(--space--medium, 12px);--snk-grid-config__button-close--padding-left:var(--space--medium, 12px);--snk-grid-config__title--color:var(--title--primary, #2B3A54);--snk-grid-config__title--font-family:var(--font-pattern, "Roboto");--snk-grid-config__title--font-size:var(--title--large, 20px);--snk-grid-config__title--font-weight:var(--text-weight--extra-large, 700);--snk-grid-config__subtitle--font-family:var(--font-pattern, "Roboto");--snk-grid-config__subtitle--font-size:var(--text--medium, 14px);--snk-grid-config__group--font-family:var(--font-pattern, "Roboto");--snk-grid-config__group--font-size:var(--text--medium, 14px);--snk-grid-config__group--font-weight:var(--text-weight--large, 600);--snk-grid-config__group--padding-bottom:var(--space-small, 6px);--snk-grid-config__scrollbar--color-default:var(--scrollbar--default, #626e82);--snk-grid-config__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--snk-grid-config__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--snk-grid-config__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--snk-grid-config__scrollbar--border-radius:var(--border--radius-small, 6px);--snk-grid-config__scrollbar--width:var(--space--medium, 12px);display:grid;grid-template-rows:auto 1fr auto;max-height:100%;width:100%}@media screen and (min-width: 480px){.sc-snk-grid-config-h{width:359px;max-width:359px}}.padding-right--medium.sc-snk-grid-config{padding-right:var(--space--medium)}ez-list.sc-snk-grid-config{height:100%}.height-calc.sc-snk-grid-config{max-height:calc(100% - 24px)}.grid-config__footer.sc-snk-grid-config{display:flex;justify-content:flex-end;width:100%;padding-top:var(--snk-grid-config__footer--padding-top)}.hidden.sc-snk-grid-config{display:none}.tabselector-container.sc-snk-grid-config{padding:var(--snk-grid-config__tabselector-container--padding) 0}.button-close.sc-snk-grid-config{padding-left:var(--snk-grid-config__button-close--padding-left)}.title-container.sc-snk-grid-config{display:flex;justify-content:space-between;align-items:center;width:100%}.title.sc-snk-grid-config{display:flex;margin:0;line-height:normal;letter-spacing:0em;text-align:left;color:var(--snk-grid-config__title--color);font-size:var(--snk-grid-config__title--font-size);font-family:var(--snk-grid-config__title--font-family);font-weight:var(--snk-grid-config__title--font-weight)}.subtitle.sc-snk-grid-config{color:var(--text--primary);font-size:var(--snk-grid-config__subtitle--font-size);font-family:var(--snk-grid-config__subtitle--font-family)}.grid-config__main.sc-snk-grid-config{overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--snk-grid-config__scrollbar--color-clicked) var(--snk-grid-config__scrollbar--color-background);padding-right:var(--snk-grid-config__main--padding-right)}.grid-config__main.sc-snk-grid-config::-webkit-scrollbar{width:var(--snk-grid-config__scrollbar--width);max-width:var(--snk-grid-config__scrollbar--width);min-width:var(--snk-grid-config__scrollbar--width);background-color:var(--snk-grid-config__scrollbar--color-background)}.grid-config__main.sc-snk-grid-config::-webkit-scrollbar-track{background-color:var(--snk-grid-config__scrollbar--color-background);border-radius:var(--snk-grid-config__scrollbar--border-radius)}.grid-config__main.sc-snk-grid-config::-webkit-scrollbar-thumb{background-color:var(--snk-grid-config__scrollbar--color-default);border-radius:var(--snk-grid-config__scrollbar--border-radius)}.grid-config__main.sc-snk-grid-config::-webkit-scrollbar-thumb:vertical:hover,.grid-config__main.sc-snk-grid-config::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--snk-grid-config__scrollbar--color-hover)}.grid-config__main.sc-snk-grid-config::-webkit-scrollbar-thumb:vertical:active,.grid-config__main.sc-snk-grid-config::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--snk-grid-config__scrollbar--color-clicked)}.group-name.sc-snk-grid-config{font-family:var(--snk-grid-config__group--font-family);font-size:var(--snk-grid-config__group--font-size);font-weight:var(--snk-grid-config__group--font-weight);padding-bottom:var(--snk-grid-config__group--padding-bottom)}';const T=class{constructor(t){i(this,t),this.ezChange=n(this,"ezChange",7),this.selectedOption=x.none}render(){return t("ez-combo-box",{class:"grid-config-combo ez-input--inverted",label:"",suppressSearch:!0,value:this.selectedOption,enabled:!0,canShowError:!1,suppressEmptyOption:!0},Object.keys(x).map((i=>t("option",{value:x[i].value},x[i].label))))}static get assetsDirs(){return["../assets"]}};T.style="ez-combo-box{width:100px}.grid-config-combo{--ez-text-input--height:28px;--ez-text-input__input--background-color:#fff;--ez-text-input__input--border-color:#dce0e8}";const G=class{constructor(t){i(this,t),this.snkConfigSaved=n(this,"snkConfigSaved",7),this._formConfigFetcher=new v,this.fieldsToSave=[],this.dataUnit=void 0,this.configName=void 0,this.avaliableFields=[],this.selectedFields=[]}async show(){var i;await(null===(i=this.ezDoubleListRef)||void 0===i?void 0:i.resetSelectedLists()),await this.initializeFormConfig(),this.ezPopupRef.opened=!0}async initializeFormConfig(){if(!this.configName)return;const i=this.getAllVisibleFieldsFromDataUnit(),t=await this.getConfig();if(0===t.length)return this.avaliableFields=[],this.selectedFields=[...i],void(this.fieldsToSave=[...this.selectedFields]);const s=this.sortDisplayedFields(t,i),e=i.filter((i=>!t.includes(i.id)));this.avaliableFields=[...e],this.selectedFields=[...s],this.fieldsToSave=[...this.selectedFields]}async getConfig(){const i=await this._formConfigFetcher.fetchSimpleFormConfig(this.configName);return[...this.removeDuplicates(i)]}removeDuplicates(i){return i.filter(((t,s)=>i.indexOf(t)===s))}sortDisplayedFields(i,t){const s=[];return i.forEach((i=>{const e=t.find((t=>t.id===i));e&&s.push(e)})),s}getAllVisibleFieldsFromDataUnit(){var i,t,s;return(null!==(s=null===(t=null===(i=this.dataUnit)||void 0===i?void 0:i.metadata)||void 0===t?void 0:t.fields)&&void 0!==s?s:[]).filter((i=>i.visible)).map((i=>({id:i.name,label:i.label})))}close(){this.ezPopupRef.opened=!1}async handleResetConfigs(){await this._formConfigFetcher.restoreFormConfig(this.configName),await this.initializeFormConfig(),await this.handleSave()}handleCancel(){this.close()}async handleSave(){const i=this.fieldsToSave.map((i=>i.id));await this._formConfigFetcher.saveSimpleFormConfig(this.configName,i),this.close(),this.snkConfigSaved.emit()}render(){return t("ez-popup",{ref:i=>this.ezPopupRef=i,heightMode:"auto",size:"auto",ezTitle:"Configurar formulário"},t("div",{class:"config-container"},t("div",{class:"config-lists"},t("ez-double-list",{ref:i=>this.ezDoubleListRef=i,leftList:this.avaliableFields,leftTitle:"Campos disponíveis",rightList:this.selectedFields,rightTitle:"Campos selecionados",onEzRightListChanged:({detail:i})=>this.fieldsToSave=[...i],entityLabel:"campo",entityLabelPlural:"campos"})),t("div",{class:"config-actions"},t("ez-button",{label:"Restaurar",onClick:this.handleResetConfigs.bind(this),size:"small"}),t("ez-button",{label:"Cancelar",onClick:this.handleCancel.bind(this),size:"small"}),t("ez-button",{label:"Salvar",class:"ez-button--primary",onClick:this.handleSave.bind(this),size:"small"}))))}};G.style=":host{display:block}.config-container{display:flex;flex-direction:column;align-items:center;justify-content:space-between}.config-lists{margin-bottom:12px}.config-actions{display:flex;flex-direction:row;justify-content:flex-end;width:100%;gap:12px}";const R=class{constructor(t){i(this,t),this.taskbarActionSelected=n(this,"taskbarActionSelected",7),this.taskbarActionsOpened=n(this,"taskbarActionsOpened",7),this.taskbarActionsButtonDisconnected=n(this,"taskbarActionsButtonDisconnected",7),this._showDropdown=!1,this.title=void 0,this.enabled=void 0,this.actions=void 0}async handleKeyDown(i){"Escape"!==i.key&&"Esc"!==i.key||await this.hideActions()}async handleClose(){await this.hideActions()}async showActions(){this._showDropdown=!0,requestAnimationFrame((()=>{this._element.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}))}async hideActions(){this._showDropdown=!1}async isOpened(){return this._showDropdown}controlDropdown(){this._showDropdown=!this._showDropdown}loadItems(){return this.actions.filter((i=>void 0!==i)).map((i=>{var t;return{id:i.value,label:i.label,value:i.value,type:null!==(t=i.type)&&void 0!==t?t:"item",children:i.children,iconName:i.iconName,subAction:i.subAction,group:i.group,disableCloseOnSelect:i.disableCloseOnSelect}}))}canShowDropdown(){var i;return this._showDropdown&&(null===(i=this.actions)||void 0===i?void 0:i.length)>0}onSelectAction(i){const t=this.actions.map((i=>Object.assign(Object.assign({},i),{id:i.value}))),s=this.getSelectedAction(i.id,t);this.taskbarActionSelected.emit(s),s.disableCloseOnSelect||(this._showDropdown=!1)}getSelectedAction(i,t){let s=null;for(const e of t){if(e.id===i){s=e;break}if((null==e?void 0:e.children)&&(s=this.getSelectedAction(i,e.children),s))break}return s}dropdownItemBuilder(i,s){const e=this.actions.find((t=>t.value===i.id));if(!e||!e.itemBuilder)return;const n=e.itemBuilder(this._element,e);return"string"==typeof n?t("div",{innerHTML:n}):n}initializeEagerItems(){var i;null===(i=this.actions)||void 0===i||i.forEach((i=>{var t;i&&i.eagerInitialize&&i.itemBuilder&&(null===(t=i.itemBuilder)||void 0===t||t.call(i,this._element,i))}))}componentDidLoad(){this.initializeEagerItems()}componentDidRender(){this._showDropdown&&this.taskbarActionsOpened.emit(this._element)}disconnectedCallback(){this.taskbarActionsButtonDisconnected.emit()}render(){return t(s,null,t("div",{class:this.canShowDropdown()?" ez-elevation--16":""},t("ez-button",{title:this.title,mode:"icon",iconName:"dots-vertical",size:"small",enabled:this.enabled,onClick:()=>this.controlDropdown()}),this.canShowDropdown()&&t("ez-dropdown",{items:this.loadItems(),onEzClick:i=>this.onSelectAction(i.detail),onEzOutsideClick:()=>this._showDropdown=!1,itemBuilder:(i,t)=>this.dropdownItemBuilder(i,t)})))}get _element(){return e(this)}};R.style=".sc-taskbar-actions-button-h{display:flex;width:fit-content;height:fit-content}";export{j as snk_actions_button,B as snk_grid_config,T as snk_select_box,G as snk_simple_form_config,R as taskbar_actions_button}
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,60 @@
1
+ import{ObjectUtils as t,DataUnit as e,DataType as r,DateUtils as n,StringUtils as s,ChangeOperation as a,ApplicationContext as i,UserInterface as o,DataUnitStorage as c}from"@sankhyalabs/core";import{D as l,d as u}from"./p-d62228fb.js";import{DISTINCT_FILTER_NAME_PREFIX as d}from"@sankhyalabs/ezui/dist/collection/utils/constants";import{DataUnitTransient as h}from"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import{ColumnFilterManager as m}from"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import f from"@sankhyalabs/core/dist/utils/SortingUtils";import{R as _}from"./p-688dcb4c.js";class g{constructor(t){this._list=[],this._listCopy=[],this._listLastUpdate=0,this._listCopyLastUpdate=0,this._equalsFunction=t}async load(t,e,r,n){let s=[].concat(this._list);null!=t&&(s=this._list.filter((e=>t(e)))),null!=e&&(s=s.sort(e));const a=s.length;if(null!=n){const t=r||0;s=s.slice(t,n?t+n:s.length)}return Promise.resolve({result:s,count:a})}async distict(t){const e=[];let r=!1;for(const n of this._list){const s=t(n);null!=s&&(null!=s.value?e.push(s):r=!0)}return r&&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 r of t)if(this._equalsFunction(e,r))return!1;return!0}));this.updateList(e)}async update(t){const e=this._list.map((e=>{const r=t.find((t=>this._equalsFunction(e,t)));return null==r?e:r}));this.updateList(e)}async insert(t,e){const r=this._list.indexOf(t);if(-1==r)return void this.push(e);const n=this._list.slice(0,r).concat(e).concat(this._list.slice(r));this.updateList(n)}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 p{static setLoadingStatus(t,e){this._loadingStatus.set(t.name,e)}static isCacheEnabled(t){return!0}static cacheRecords(t,e,r,n){p.setLoadingStatus(t,n),p.isCacheEnabled(t)?this.getRepository(t).push(e):r&&this._repositories.delete(t.name)}static getSortingFunction(t,e){return f.getSortingFunction(t,e)}static async getDistinct(t,e){if(!p.isCacheEnabled(t))return Promise.resolve(m.compileDistinct(e,t));let r;const n=t.getLastLoadRequest();if(null!=n){const s=m.getColumnFilters(n.filters,e);r=m.getFilterFunction(t,Array.from(s.values()))}return new Promise(((n,s)=>{p.getRepository(t).distict((n=>{if(null!=r&&!r(n))return;const s=n[e];if(null==s)return{key:null,value:null};const a=null!=s.value?s.value:s;return{key:t.getFormattedValue(e,s),value:a}})).then((t=>{n(null!=t?Array.from(t.entries()).map((([t,e])=>({label:t,value:e,check:!0}))):void 0)})).catch((t=>s(t)))}))}static async loadData(t,r,n){try{if(p.isCacheEnabled(t)){if(["EZ_GRID_LOADING_SOURCE",e.CHANGING_PAGE_LOADING_SOURCE,e.ALL_RECORDS_SELECTION_SOURCE].includes(r.source)&&!await p.getRepository(t).isEmpty())return p.loadFromCache(t,r);p.getRepository(t).clear().catch((()=>{}))}return n(t,r)}catch(t){return console.error(t),Promise.reject(t)}}static insertRecords(t,e,r){p.isCacheEnabled(t)&&p.getRepository(t).insert(e,r)}static updateRecords(t,e){p.isCacheEnabled(t)&&p.getRepository(t).update(e)}static removeRecords(t,e){p.isCacheEnabled(t)&&p.getRepository(t).delete(e)}static async countRecords(t){return p.isCacheEnabled(t)?p.getRepository(t).count():Promise.resolve(0)}static getRepository(t){const e=t.name;return p._repositories.has(e)||p._repositories.set(e,new g(((t,e)=>t.__record__id__===e.__record__id__))),p._repositories.get(e)}static async loadFromCache(t,e){return new Promise(((r,n)=>{const s=m.getColumnFilters(e.filters,""),{limit:a,offset:i,sort:o}=e;p.getRepository(t).load(m.getFilterFunction(t,Array.from(s.values())),p.getSortingFunction(t,o),i,a).then((e=>{const n=p._loadingStatus.get(t.name),{count:s,result:o}=e,c=0==s?0:i+1,l=i+Math.min(o.length,a);r({records:o,paginationInfo:{count:s,currentPage:i/a,firstRecord:c,lastRecord:l,hasMore:n||l<s,total:n?void 0:s}})})).catch((t=>n(t)))}))}static getCachedRecords(t){return p.getRepository(t).getFromCache()}}function y(t,e,r){let n=t?[...t]:[];n=function(t,e,r){const n=m.getColumnFilters(r,"");if(!(null==n?void 0:n.size))return t;const s=m.getFilterFunction(e,Array.from(n.values()));return null==s?t:t.filter(s)}(n,e,r.filters),n=function(t,e,r){if(null==r||0==r.length)return t;const n=p.getSortingFunction(e,r);return null==n?t:t.sort(n)}(n,e,r.sort);const{offset:s,limit:a}=r,i={recordsLength:n.length,offset:s,recordsPerPage:a};return Promise.resolve({records:v(n,s,a),paginationInfo:e.pageSize?b(i):void 0})}function v(t,e=0,r=0){return t&&t.length&&function(t,e){return t>=0&&e>=0}(e,r)?0===r&&0===e?t:t.slice(e,e+r):[]}function b({recordsLength:t=0,offset:e=0,recordsPerPage:r=0}){if(!t)return{currentPage:0,firstRecord:0,lastRecord:0,total:0,hasMore:!1};const n=e+r,s=n?Math.min(n,t):t;return{currentPage:0===r?0:Math.ceil(e/r),firstRecord:e+1,lastRecord:s,total:t,hasMore:s<t}}p._repositories=new Map,p._loadingStatus=new Map;class P{constructor(t,r,n){this.metadata=t,this.records=r,this._dataUnit=new e(P.IN_MEMORY_DATA_UNIT_NAME),this._dataUnit.pageSize=150,this._dataUnit.metadataLoader=()=>this.metadaLoader(),this._dataUnit.dataLoader=(t,e)=>this.inMemoryLoader(t,e,this.getRecordsToLoad()),this._dataUnit.saveLoader=(t,e)=>this.saveLoader(t,e),this._dataUnit.removeLoader=(t,e)=>this.removeLoader(t,e),this.dataUnit.loadMetadata().then((()=>{!1!==(null==n?void 0:n.autoLoad)&&this.dataUnit.loadData()}))}getRecordsToLoad(){null==this._initialRecords&&this.dataUnit.records.length>0&&(this._initialRecords=this.dataUnit.records);const t=this.dataUnit.getAddedRecords();return t?[...this._initialRecords,...t]:this._initialRecords}get dataUnit(){return this._dataUnit}get records(){return this.dataUnit.records}static getConvertedValue(t,e){return t.dataType===r.BOOLEAN?"S"===e:t.dataType===r.NUMBER?Number(e):t.dataType===r.DATE?n.strToDate(e,!0):t.dataType===r.OBJECT?JSON.parse(e):e}set records(t){const e=this._metadata?new Map(this._metadata.fields.map((t=>[t.name,t]))):void 0,r=null==t?void 0:t.map((t=>{if(t.__record__id__||(t.__record__id__=this.generateUniqueId()),null!=e)for(const r in t){const n=t[r];"string"==typeof n&&e.has(r)&&(t[r]=P.getConvertedValue(e.get(r),n))}return t}));this._initialRecords=r,this._dataUnit&&this._dataUnit.loadData()}get metadata(){return this._metadata}set metadata(t){this._metadata=t,this._dataUnit&&(this._dataUnit.metadata=this._metadata)}generateUniqueId(){return s.generateUUID()}inMemoryLoader(t,e,r){return y(r,t,e)}metadaLoader(){return Promise.resolve(this._metadata)}saveLoader(t,e){return new Promise((t=>{let r=[];e.forEach((t=>{let{record:e,updatingFields:n,operation:s}=t;const i=Object.assign(Object.assign({},e),n);if(s===a.INSERT||s===a.COPY)i.__old__id__=e.__record__id__,i.__record__id__=this.generateUniqueId(),this.records.push(i);else{const t=this.records.findIndex((t=>t.__record__id__==i.__record__id__));this.records[t]=i}r.push(i)})),t(r)}))}removeLoader(t,e){return new Promise((t=>{t(e)}))}}function D(t,e){var r,n;return void 0!==(null===(r=t[e])||void 0===r?void 0:r.value)?null===(n=t[e])||void 0===n?void 0:n.value:t[e]}P.IN_MEMORY_DATA_UNIT_NAME="InMemoryDataUnit";class I{canSlice(){return!1}processSortingSide(t,e,r){var n;const s=[],a=[];if(null!=t.sort){if(0===r.length)return{localSorting:t.sort,serverSorting:[]};for(const r of t.sort){const t=e.getField(r.field);"true"===(null===(n=null==t?void 0:t.properties)||void 0===n?void 0:n.calculated)||(null==t?void 0:t.userInterface)===o.LONGTEXT?s.push(r):a.push(r)}}return{localSorting:s,serverSorting:a}}async load(t,e,r){var n,s;if(null==t.metadata)return Promise.resolve({records:[],loadingInfo:r});try{const a=null!==(s=null===(n=e.filters)||void 0===n?void 0:n.filter((t=>!t.name.startsWith("FILTRO_COLUNA_"))))&&void 0!==s?s:[],{localSorting:i,serverSorting:o}=this.processSortingSide(e,t,a),c=this.getFieldsList(t),u="DatasetSP.loadRecords",d=this.buildRequestBody(u,c,t,e,r,o,a),h=r.quiet?{urlParams:{quietMode:"true"}}:void 0,{result:m,pagerID:f}=await l.get().callServiceBroker(u,d,h),_=this.processRecords(t,c,m),g=null!=f,p=r.count+_.length,y=t.hasNewRecord(),v=!g&&i.length>0;return v&&y&&t.setWaitingToReload(!0),Promise.resolve({records:_,loadingInfo:Object.assign(Object.assign({},r),{pagerId:f,loadingInProgress:g,total:g?void 0:p,count:p,needReload:v&&!y})})}catch(t){return console.error(t),Promise.reject(t)}}async loadRowMetadata(t,e,r,n={}){try{const s="DatasetSP.loadRowMetadata",a=await this.buildRequestBodyLoadRowMetadata({snkDataUnit:t,fieldName:e,metadataName:r,serviceName:s,updatedFields:n});return await l.get().callServiceBroker(s,a)}catch(t){return console.error(t),Promise.reject(t)}}async buildRequestBodyLoadRowMetadata({snkDataUnit:t,serviceName:e,fieldName:r,metadataName:n,updatedFields:s}){const a=t.dataUnit,i=O.parseDataUnitName(a.name).entityName,o=(await t.getSelectedRecordsIDsInfo()).reduce(((t,e)=>(t[e.name]=e.value,t)),{}),c=a.getSelectedRecord(),l=a.metadata.fields.filter((({standAlone:t,name:e})=>!t&&!e.includes("."))).map((({name:t})=>t)),u=l.reduce(((t,e,r)=>{const n=D(c,e),a=D(s,e);return t[r]=void 0!==a?a:n,t}),{});return JSON.stringify({serviceName:e,requestBody:{dataSetID:a.dataUnitId,entityName:i,standAlone:!1,metadataName:n,fieldName:r,fields:l,record:{pk:o,oldPk:o,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,r,n,s,a,i){const o=r.dataUnitId,c=O.parseDataUnitName(r.name).entityName,l=!(!n.limit&&!n.offset),u={serviceName:t,requestBody:{dataSetID:o,fields:e,entityName:c,pageNumber:s.pageNumber,totalRecordsCount:s.count,pagerID:s.pagerId,standAlone:!1,standAloneFieldsMD:Object.assign({__record__id__:{fieldType:"S",userType:"P"},__record__label__:{fieldType:"S",userType:"P"}},this.getStandAloneFieldsList(r)),tryJoinedFields:!0,parallelLoader:l,crudListener:`br.com.sankhya.bff.${this.getModuleName()}.BFFDataUnitDatasetAdapter`,txProperties:this.getTxProperties(r,n,a,i),useDefaultRowsLimit:!1}};return JSON.stringify(u)}getModuleName(){return i.getContextValue("__SNK__APPLICATION__").getModuleName().replace("-bff","")}getTxProperties(t,e,r,n){const s={"__DATA_UNIT_ADAPTER__[dataUnitName]":t.name};0!==n.length&&(s["__DATA_UNIT_ADAPTER__[criteria]"]=JSON.stringify(n)),null!=r&&0!==r.length&&(s["__DATA_UNIT_ADAPTER__[sorting]"]=JSON.stringify(r)),null!=e.parentRecordId&&(s["__DATA_UNIT_ADAPTER__[parentRecordId]"]=e.parentRecordId);const a=t.getGlobalLoaderProps();return null==a||0===a.size||Array.from(a.entries()).forEach((([t,e])=>{s[t]=e})),s}processRecords(t,e,r){return r.map((r=>{const n={__record__id__:r[0],__record__label__:r[1],__record__metadata__:r[r.length-1]._rmd};return t.metadata.fields.forEach((t=>{n[t.name]=this.buildFieldValue(t,e,r)})),n}))}buildFieldValue(t,e,r){const n=e.indexOf(t.name);if(n<0)return null;const a=r[n];if(s.isEmpty(a))return null;const i=this.getSearchDescriptionField(t);if(null!=i){const t=e.indexOf(i);if(t>=0)return{value:a,label:r[t]}}return t.userInterface===o.SEARCH?isNaN(Number(a))?a:Number(a):P.getConvertedValue(t,a)}getSearchDescriptionField(t){if(t.userInterface===o.SEARCH){const{ENTITYNAME:e,mergedFrom:r,DESCRIPTIONFIELD:n}=t.properties;if(!s.isEmpty(n))return null!=r?`${r}.${e}.${n}`:`${e}.${n}`}}}class N{static async debounce(t,e){const r=t.name;N._debouncingTimeouts[r]&&(clearTimeout(N._debouncingTimeouts[r]),delete N._debouncingTimeouts[r]),N._debouncingTimeouts[r]=setTimeout((()=>{delete N._debouncingTimeouts[r],e()}),100)}static async loadData(t,e){return new Promise(((r,n)=>{N.debounce(t,(()=>{p.loadData(t,e,this.loadFromServer).then((t=>r(t))).catch((t=>n(t)))}))}))}static getCachedRecords(t){return p.getCachedRecords(t)}static async loadFromServer(t,e,r){try{r=N.registryLoading(t,r);const n=await N.callLoader(t,e,r);if(null==n)return;const s=n.records,a=N.buildPaginationInfo(s.length,e,n.loadingInfo),i=null==a?s:s.slice(0,a.lastRecord);return Promise.resolve({records:i,paginationInfo:a})}catch(t){return console.error(t),Promise.reject(t)}}static async callLoader(t,e,r,n){null==n&&(n=new I);const s=await n.load(t,e,r),{records:a,loadingInfo:i}=s;if(N.isOldRequest(t,i))return Promise.resolve(void 0);const o=!n.canSlice()||0===i.count;if(p.cacheRecords(t,a,o,i.loadingInProgress),p.isCacheEnabled(t)&&i.loadingInProgress){const r=Object.assign(Object.assign({},e),{offset:i.count}),s=Object.assign(Object.assign({},i),{pageNumber:(i.pageNumber||0)+1,quiet:!0});this.callLoader(t,r,s,n).then((e=>N.afterLoadingPage(t,e.loadingInfo))).catch((t=>console.error(t)))}return Promise.resolve(s)}static afterLoadingPage(t,e){p.setLoadingStatus(t,e.loadingInProgress);const r=t.getPaginationInfo();if(null==r)return;const n=e.count;e.loadingInProgress?t.updatePagination(Object.assign(Object.assign({},r),{count:n,loadingInProgress:!0})):e.needReload?t.gotoPage(0):t.updatePagination(Object.assign(Object.assign({},r),{total:n,count:n,loadingInProgress:!1}))}static registryLoading(t,e){return null==e&&(e={requestTime:(new Date).getTime(),count:0}),N._requestTimeByDataUnit.set(t.name,e.requestTime),e}static isOldRequest(t,e){return N._requestTimeByDataUnit.get(t.name)>e.requestTime}static buildPaginationInfo(t,e,r){let{limit:n,offset:s}=e;if(!n)return;1===r.pageNumber&&(s=0);const{total:a,count:i,loadingInProgress:o}=r,c=0===i||0===t?0:s+1,l=s+Math.min(t,n);return{total:a,count:i,lastRecord:l,firstRecord:c,currentPage:s/n,hasMore:l<i||o}}}N._requestTimeByDataUnit=new Map,N._debouncingTimeouts={};const R=/dd:\/\/([^/]+)\/([^/?]+)/;class O{constructor(){this.templateByQuery=new Map,this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchDataUnit",u.gql`query($name: String!) {
2
+ $queryAlias$: fetchDataUnit(name: $name){
3
+ name
4
+ fields{
5
+ name
6
+ defaultValue
7
+ label
8
+ visible
9
+ standAlone
10
+ readOnly
11
+ required
12
+ dataType
13
+ userInterface
14
+ calculated
15
+ group
16
+ order
17
+ properties{
18
+ name
19
+ value
20
+ }
21
+ dependencies{
22
+ masterFields
23
+ type
24
+ expression
25
+ }
26
+ }
27
+ children{
28
+ name
29
+ label
30
+ links{
31
+ source
32
+ target
33
+ }
34
+ }
35
+ }
36
+ }`),this.templateByQuery.set("saveData",u.gql`mutation($changes: [InputBatchChange!]!) {
37
+ $queryAlias$: batchOperationDataUnit(changes: $changes){
38
+ oldId
39
+ id
40
+ label
41
+ ownerDataUnitName
42
+ fields {
43
+ name
44
+ value
45
+ }
46
+ }
47
+ }`),this.templateByQuery.set("fetchDataRecord",u.gql`query($dataunit: String! $recordID: [String!]) {
48
+ $queryAlias$: fetchDataUnit(name: $dataunit){
49
+ record(id: $recordID){
50
+ id
51
+ label
52
+ fields {
53
+ name
54
+ value
55
+ }
56
+ }
57
+ }
58
+ }`),this.templateByQuery.set("fetchDistinctColumn",u.gql`query($dataUnit: String!, $fieldName: String!, $argument: String, $filters: [InputFilter], $parentRecordId: String) {
59
+ $queryAlias$: selectDistinct(dataUnit: $dataUnit, fieldName: $fieldName, argument: $argument, filters: $filters, parentRecordId: $parentRecordId)
60
+ }`)}static parseDataUnitName(t){if(null==t)return;const e=R.exec(t);return e?{entityName:e[1],resourceID:e[2]}:void 0}getDataUnit(t,r,n,s){null==p.applicationResourceID&&_.getResourceID().then((t=>p.applicationResourceID=t));const a=`dd://${t}/${r}${s?"/"+s:""}`,i=null!=n?n.getChildDataunit(a):new e(a);return i.metadataLoader=t=>this.loadMetadata(t),i.dataLoader=(t,e)=>N.loadData(t,e),i.saveLoader=(t,e)=>this.saveData(i,e),i.removeLoader=(t,e)=>this.removeRecords(t,e),i.recordLoader=(t,e)=>this.loadRecord(t,e),i.allRecordsLoader=t=>N.getCachedRecords(t),i}loadMetadata(t){return new Promise(((e,r)=>{l.get().callGraphQL({values:{name:t.name},query:this.templateByQuery.get("fetchDataUnit")}).then((t=>{var r;const n={name:t.name,label:t.name,children:[...t.children],fields:[]};null===(r=t.fields)||void 0===r||r.forEach((t=>{let e;Array.isArray(t.properties)&&(e={},t.calculated&&(e.gridHeaderTooltip="Campos calculados não podem ser ordenados"),t.properties.forEach((t=>e[t.name]=t.value))),n.fields.push(Object.assign(Object.assign({},t),{properties:e}))})),n.fields.sort(((t,e)=>t.order-e.order)),e(n)})).catch((t=>{r(t)}))}))}loadSelectDistinct(t,e,r){const{parentRecordId:n,filters:s}=t.getLastLoadRequest()||{},a=s.filter((t=>t.name!==`${d}${e}`)),i={dataUnit:t.name,argument:r,fieldName:e,parentRecordId:n,filters:a};return new Promise(((t,e)=>{l.get().callGraphQL({values:i,query:this.templateByQuery.get("fetchDistinctColumn")}).then((e=>{t(e)})).catch((t=>{e(t)}))}))}addTransientProperties(t,e){const r=t.getGlobalLoaderProps();return null==r||0===r.size||(null==e&&(e={}),Array.from(r.entries()).forEach((([t,r])=>{e[`transient.${t}`]=r}))),e}getUpdatingFields(t,e){if(null==e)return;const r=Object.assign({},e);return Object.keys(r).forEach((e=>{const n=t.getField(e);null!=n&&n.standAlone&&delete r[e]})),this.addTransientProperties(t,r)}saveData(t,e){const n=[],s=[],i=e.map((e=>{const{dataUnit:i,record:o,operation:l}=e,u=c.get(i),d=this.getUpdatingFields(u,e.updatingFields);let h;null!=d&&(h=Object.entries(d).map((([t,e])=>{const n=u.getField(t);return{fieldName:t,dataType:n?n.dataType:r.TEXT,value:u.valueToString(t,e)}}))),i===t.name&&(l===a.INSERT||l===a.COPY?s.push(o.__record__id__):n.push(o.__record__id__));const m={dataUnit:i,fields:h,operation:l,recordId:o.__record__id__};return e.sourceId&&(m.sourceId=e.sourceId),o.__parent__record__id__&&(m.parentRecordId=o.__parent__record__id__),m}));return new Promise(((e,r)=>{const a=i.map((t=>function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(r[n[s]]=t[n[s]])}return r}(t,[])));l.get().callGraphQL({values:{changes:a},query:this.templateByQuery.get("saveData")}).then((r=>{const a=[];null==r||r.forEach((e=>{const r={__record__id__:e.id,__record__label__:e.label,__owner__dataunit__name__:e.ownerDataUnitName},n=c.get(r.__owner__dataunit__name__)||t;e.oldId&&(r.__old__id__=e.oldId),e.fields.forEach((({name:t,value:e})=>{var s;const a=null===(s=null==n?void 0:n.valueFromString)||void 0===s?void 0:s.call(n,t,e);r[t]=void 0!==a?a:e})),a.push(r)})),this.updateCache(t,a,n,s),e(a)})).catch((t=>{r(t)}))}))}updateCache(t,e,r,n){const s=new Map(e.map((t=>[t.__old__id__||t.__record__id__,t]))),a=n.map((t=>{const e=Object.assign({},s.get(t));return delete e.__old__id__,e}));a.length>0&&p.insertRecords(t,t.records[0],a);const i=r.map((t=>Object.assign({},s.get(t))));p.updateRecords(t,i)}getTransientInfo(t,e){const{records:n}=t.getSelectionInfo();return Object.entries(n.filter((t=>t.__record__id__==e))[0]).filter((([t])=>t.startsWith(h.DATA_UNIT_TRANSIENT_PREFIX_NAME))).map((([t,e])=>({fieldName:t,value:e,dataType:r.TEXT})))}removeRecords(t,e){const r=e.map((e=>({dataUnit:t.name,operation:a.DELETE,recordId:e,fields:this.getTransientInfo(t,e)})));return new Promise(((n,s)=>{l.get().callGraphQL({values:{changes:r},query:this.templateByQuery.get("saveData")}).then((()=>{p.removeRecords(t,t.records.filter((t=>e.includes(t.__record__id__)))),n(e)})).catch((t=>{s(t)}))}))}loadRecord(t,e){return new Promise(((r,n)=>{l.get().callGraphQL({values:{recordID:e,dataunit:t.name},query:this.templateByQuery.get("fetchDataRecord")}).then((e=>{const n=[];e.record.forEach((e=>{const r={__record__id__:e.id,__record__label__:e.label};e.fields.forEach((({name:e,value:n})=>{r[e]=t.valueFromString(e,n)})),n.push(r)})),r(n)})).catch((t=>{n(t)}))}))}}export{O as D,P as I,p as P,I as a,y as b,D as g}
Binary file
Binary file
@@ -1 +1 @@
1
- import{r as i,c as t,h as s,F as e,g as r}from"./p-d2d301a6.js";import{Action as a,ElementIDUtils as n,ApplicationContext as d,StringUtils as o}from"@sankhyalabs/core";import{T as h}from"./p-7e7a7473.js";import{C as l}from"./p-19dc71e9.js";import{P as c}from"./p-30cf616e.js";import{T as u,o as g,b as m}from"./p-23736d75.js";import{s as T}from"./p-6dc031de.js";import{C as k,S as v,a as f,R as E,b as p}from"./p-8a1ee5b5.js";import{SelectionMode as b}from"@sankhyalabs/core/dist/dataunit/DataUnit";import"./p-d62228fb.js";import"./p-798386c7.js";import"./p-21749402.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-ddefbbc7.js";import"./p-ff1990ad.js";import"./p-1435701f.js";import{g as O}from"./p-7dd49d15.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource";import"./p-8d884fab.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";class R extends k{getFilters(){var i;return null===(i=this.dataUnit)||void 0===i?void 0:i.getAppliedFilters()}getOrders(){var i;return null===(i=this.dataUnit)||void 0===i?void 0:i.getSort()}getResourceURI(){var i;return null===(i=this.dataUnit)||void 0===i?void 0:i.name}getSelectedNumber(){return this.dataUnit.getSelectionInfo().length}getTotalRecords(){var i,t,s;const{total:e}=(null===(i=this.dataUnit)||void 0===i?void 0:i.getPaginationInfo())||{};return null!=e?e:null===(s=null===(t=this.dataUnit)||void 0===t?void 0:t.records)||void 0===s?void 0:s.length}getSelectedIDs(){return O(this.dataUnit)}getOffset(){return this.getExporterOffset(this.getPaginationInfo())}getPageSize(){var i;return null===(i=this.dataUnit)||void 0===i?void 0:i.pageSize}getExportLimit(){return 5e3}getRecordID(){var i,t,s;return null===(s=null===(t=null===(i=this.dataUnit)||void 0===i?void 0:i.records)||void 0===t?void 0:t[0])||void 0===s?void 0:s.__record__id__}getPaginationInfo(){var i;return null===(i=this.dataUnit)||void 0===i?void 0:i.getPaginationInfo()}getExporterOffset(i){if(null==i)return;const t=i.firstRecord;return t>0?t-1:t}}const C=class{constructor(s){i(this,s),this.actionClick=t(this,"actionClick",7),this.gridDoubleClick=t(this,"gridDoubleClick",7),this._customEditors=new Map,this._customRenders=new Map,this._topTaskbarProcessor=new u({"snkGridTopTaskbar.regular":["FORM_MODE","CONFIGURATOR","INSERT"],"snkGridTopTaskbar.regular.secondary":["FORM_MODE","CONFIGURATOR","INSERT"],"snkGridTopTaskbar.regular.singleTaskbar":[],"snkGridTopTaskbar.finish_edition":["CANCEL","SAVE",this.handleAddFormMode()],"snkGridTopTaskbar.finish_edition.secondary":[],"snkGridTopTaskbar.finish_edition.singleTaskbar":[]}),this._headerTaskbarProcessor=new u({"snkGridHeaderTaskbar.unselected":["REFRESH","DATA_EXPORTER","ACTIONS_BUTTON","MORE_OPTIONS"],"snkGridHeaderTaskbar.selected":["UPDATE","CLONE","REMOVE","MORE_OPTIONS","DIVIDER","ATTACH","REFRESH","DATA_EXPORTER","ACTIONS_BUTTON"],"snkGridHeaderTaskbar.detail.unselected":["REFRESH","MORE_OPTIONS"],"snkGridHeaderTaskbar.detail.selected":["UPDATE","ATTACH","CLONE","REMOVE","MORE_OPTIONS","DIVIDER","REFRESH"],"snkGridHeaderTaskbar.singleTaskbar.unselected":["INSERT","FORM_MODE","CONFIGURATOR","REFRESH","DATA_EXPORTER","ACTIONS_BUTTON","MORE_OPTIONS"],"snkGridHeaderTaskbar.singleTaskbar.selected":["UPDATE","CLONE","REMOVE","MORE_OPTIONS","DIVIDER","ATTACH","FORM_MODE","CONFIGURATOR","REFRESH","DATA_EXPORTER","ACTIONS_BUTTON"],"snkGridHeaderTaskbar.singleTaskbar.detail.unselected":["INSERT","FORM_MODE","CONFIGURATOR","REFRESH","MORE_OPTIONS"],"snkGridHeaderTaskbar.singleTaskbar.detail.selected":["UPDATE","ATTACH","CLONE","REMOVE","MORE_OPTIONS","DIVIDER","FORM_MODE","CONFIGURATOR","REFRESH"],"snkGridHeaderTaskbar.singleTaskbar.finish_edition":["CANCEL","SAVE",this.handleAddFormMode()]}),this.dataUnitInterceptor={interceptAction:async i=>i.type===a.METADATA_LOADED?await this.interceptMetadataLoaded(i):i},this._dataUnit=void 0,this._dataState=void 0,this._gridConfig=void 0,this._popUpGridConfig=!1,this._showSnkFilterBar=!0,this._enableContinuousInsert=!1,this.columnFilterDataSource=new v,this.configName=void 0,this.filterBarTitle=void 0,this.resourceID=void 0,this.selectionToastConfig=void 0,this.actionsList=void 0,this.isDetail=void 0,this.taskbarManager=void 0,this.statusResolver=void 0,this.multipleSelection=void 0,this.presentationMode=c.PRIMARY,this.messagesBuilder=void 0,this.useEnterLikeTab=!1,this.recordsValidator=void 0,this.canEdit=!0,this.taskbarCustomContainerId=void 0,this.gridHeaderCustomSlotId="GRID_HEADER_CUSTOM_ELEMENTS",this.topTaskbarCustomSlotId="GRID_TASKBAR_CUSTOM_ELEMENTS",this.disablePersonalizedFilter=void 0,this.gridLegacyConfigName=void 0,this.filterBarLegacyConfigName=void 0,this.autoLoad=void 0,this.autoFocus=!0,this.enableGridInsert=!1,this.enableLockManger=!1,this.outlineMode=!1}reloadConfig(){this.loadConfig()}async showConfig(){null!=this._grid&&this.openGridConfig()}async hideConfig(){null!=this._grid&&this.closeGridConfig()}async setConfig(i){this.setGridConfig(i)}async reloadFilterBar(){var i;null===(i=this._snkFilterBar)||void 0===i||i.reload()}async getFilterBar(){return this._snkFilterBar}async findColumn(){await g(this._moreOptions,this._columnSearch)}async addCustomEditor(i,t,s){if(this._grid)return void this._grid.addCustomEditor(i,t,s);const e=new Map(this._customEditors);e.set(i,{customEditor:t,detailContext:s}),this._customEditors=e}async addGridCustomRender(i,t,s){if(this._grid)return void this._grid.addGridCustomRender(i,t,s);const e=new Map(this._customRenders);e.set(i,{customRender:t,detailContext:s}),this._customRenders=e}async addCustomValueFormatter(i,t){this._grid.addCustomValueFormatter(i,t)}async removeCustomValueFormatter(i){this._grid.removeCustomValueFormatter(i)}async setFocus(){this._grid.setFocus()}async handleClick(i){var t;if(this.hasToBlockEvent(i)){if(i.preventDefault(),i.stopPropagation(),!await this._dataUnit.cancelEdition())return;const s=new i.constructor(i.type,i);null===(t=i.target)||void 0===t||t.dispatchEvent(s)}this._grid&&!this._grid.contains(i.target)&&this._grid.stopEdit()}hasToBlockEvent(i){var t;return(null===(t=this._snkFilterBar)||void 0===t?void 0:t.contains(i.target))&&this.enableGridInsert&&this._dataUnit.hasNewRecord()}async handleGridLegacyConfigName(i,t){i&&i!==t&&(this.addGridLegacyConfigName(),this.loadConfig())}handleAddFormMode(){return this.enableGridInsert?h.FORM_MODE:""}openGridConfig(){this._grid.getColumnsState().then((i=>{this._snkGridConfig.columns=i.filter((i=>i.name)),this._snkGridConfig.selectedIndex=0,this._popUpGridConfig=!0}))}closeGridConfig(){this._popUpGridConfig=!1}setGridConfig(i){this._gridConfig=i,f.assertDefaultSorting(this._gridConfig,this._dataUnit)}fixColumNameCharset(i){try{return decodeURIComponent(escape(i))}catch(t){return i}}normalizeGridConfig(i){if(!i)return i;const t=i.columns.map((i=>Object.assign(Object.assign({},i),{name:this.fixColumNameCharset(i.name)})));return Object.assign(Object.assign({},i),{columns:t})}loadConfig(){l.loadGridConfig(this.configName,this.resourceID).then((i=>{this.setGridConfig(this.normalizeGridConfig(i))})).catch((i=>{console.warn(i)}))}addGridLegacyConfigName(){this.gridLegacyConfigName&&this.configName&&l.addGridLegacyConfig(this.configName,this.gridLegacyConfigName)}gridConfigChangeHandler(i){const t=this.normalizeGridConfig(i.detail);l.saveGridConfig(t,this.configName,this.resourceID),i.stopPropagation()}modalConfigChangeHandler(i){const t=this.normalizeGridConfig(i.detail);this._grid.setColumnsState(t.columns).then((()=>{this.setGridConfig(t),this.closeGridConfig(),this.dataExporterProviderStore()})),i.stopPropagation()}async dataExporterProviderStore(){const i=new R(this._dataUnit,this._grid);T.set("exporterProviders",Object.assign(Object.assign({},T.get("exporterProviders")),{[this.configName]:i}))}addElementID(){n.addIDInfo(this._element,null,{dataUnit:this._dataUnit})}loadGridCustomFormatters(i){i&&this._grid&&i.forEach((i=>{var t;(null===(t=i.properties)||void 0===t?void 0:t.rm_precision)&&this.addCustomValueFormatter(i.name,this._rmPrecisionCustomValueFormatter)}))}async interceptMetadataLoaded(i){return this.loadGridCustomFormatters(i.payload.fields),i}finishLoading(){this._dataUnit.addInterceptor(this.dataUnitInterceptor),f.assertDefaultSorting(this._gridConfig,this._dataUnit),this.addElementID(),null!=this.columnFilterDataSource&&(this.columnFilterDataSource.setApplication(this._application),this.columnFilterDataSource.setDataUnit(this._dataUnit))}setCustomRenders(){if(this._grid)for(const[i,t]of this._customRenders)this._grid.addGridCustomRender(i,t.customRender,t.detailContext),this._customRenders.delete(i)}setCustomEditors(){if(this._grid)for(const[i,t]of this._customEditors)this._grid.addCustomEditor(i,t.customEditor,t.detailContext),this._customEditors.delete(i)}componentWillLoad(){this._application=d.getContextValue("__SNK__APPLICATION__");let i=this._element.parentElement;for(;i;){if("SNK-DATA-UNIT"===i.tagName.toUpperCase()){this._snkDataUnit=i,this._dataUnit=this._snkDataUnit.dataUnit,this._dataUnit?this.finishLoading():this._snkDataUnit.addEventListener("dataUnitReady",(i=>{this._dataUnit=i.detail,this.finishLoading()})),this.messagesBuilder||(this.messagesBuilder=this._snkDataUnit.messagesBuilder),this._snkDataUnit.addEventListener("dataStateChange",this.handleDataStateChange.bind(this)),this._snkDataUnit.addEventListener("cancelEdition",(()=>{var i;(null===(i=this._dataState)||void 0===i?void 0:i.recordsIsEmpty)&&this._dataUnit.clearSelection()}));break}i=i.parentElement}this._rmPrecisionCustomValueFormatter=new E,this.addGridLegacyConfigName(),this.loadConfig(),this._continuousInsertUtils=new p(this._application,this.resourceID,this.configName),this.enableGridInsert&&this._continuousInsertUtils.getConfig().then((i=>this._enableContinuousInsert=i))}componentDidRender(){var i,t;this._rmPrecisionCustomValueFormatter.setGrid(this._grid),this.loadGridCustomFormatters(null===(t=null===(i=this._dataUnit)||void 0===i?void 0:i.metadata)||void 0===t?void 0:t.fields),this.setCustomRenders(),this.setCustomEditors()}async handleDataStateChange(i){this._dataState=i.detail,this._rmPrecisionCustomValueFormatter.setDataState(this._dataState)}getHeaderDisabledButtons(){var i;const t=[];return(null===(i=this._dataState)||void 0===i?void 0:i.selectionInfo)&&(this._dataState.selectionInfo.length>1&&t.push(h.CLONE,"ATTACH",h.UPDATE),this._dataState.selectionInfo.isAllRecords()&&t.push("REMOVE")),t}getInvisibleButtons(){let i=[];return this._dataUnit&&0!==this._dataUnit.records.length||i.push("DATA_EXPORTER"),this._dataState&&this._dataState.selectionInfo.mode===b.ALL_RECORDS&&i.push("ACTIONS_BUTTON"),i}componentWillRender(){const i=this.getInvisibleButtons();this._headerTaskbarProcessor.process(this.getHeaderTaskbarId(),this.taskbarManager,this._dataState,this.getHeaderDisabledButtons(),i),this._topTaskbarProcessor.process(this.getTopTaskBarId(),this.taskbarManager,this._dataState,void 0,i),this.dataExporterProviderStore()}getHeaderTaskbarId(){var i,t;const s=this._dataState&&!!(null===(i=this._dataState.selectionInfo)||void 0===i?void 0:i.length),e={primary:this.isDetail?"snkGridHeaderTaskbar.detail":"snkGridHeaderTaskbar",secondary:this.isDetail?"snkGridHeaderTaskbar.detail":"snkGridHeaderTaskbar",singleTaskbar:this.isDetail?"snkGridHeaderTaskbar.singleTaskbar.detail":"snkGridHeaderTaskbar.singleTaskbar"}[this.presentationMode];let r=s?`${e}.selected`:`${e}.unselected`;return(null===(t=this._dataState)||void 0===t?void 0:t.isDirty)&&this.presentationMode===c.SINGLE_TASKBAR&&(r="snkGridHeaderTaskbar.singleTaskbar.finish_edition"),r}getTopTaskBarId(){var i;const t={primary:"",secondary:".secondary",singleTaskbar:".singleTaskbar"}[this.presentationMode];return(null===(i=this._dataState)||void 0===i?void 0:i.isDirty)?`snkGridTopTaskbar.finish_edition${t}`:`snkGridTopTaskbar.regular${t}`}getPrimaryButton(){return{primary:"INSERT",secondary:"",singleTaskbar:"INSERT"}[this.presentationMode]}getColumnSearch(i,t){return null!=this._columnSearch||(this._moreOptions=i,this._columnSearch=m(t,(({argument:i})=>new Promise((t=>{this._grid.filterColumns(i).then((i=>{t(i.filter((i=>!i.hidden)).map((i=>({label:i.label,value:i.name}))))}))}))),(t=>{null!=t&&(this._grid.locateColumn(t.value),i.hideActions())}))),this._columnSearch}getActionsList(){const i=[{value:o.generateUUID(),label:this.messagesBuilder.getMessage("snkGrid.findColumn",{}),disableCloseOnSelect:!0,eagerInitialize:!0,itemBuilder:(i,t)=>this.getColumnSearch(i,t)}];if(this.enableGridInsert&&i.push(this._continuousInsertUtils.actionContinuousInsert(this._enableContinuousInsert,(()=>{this._enableContinuousInsert=!this._enableContinuousInsert,this._continuousInsertUtils.handleSaveConfig(this._enableContinuousInsert)}))),this.isGridInsertActive())return i;if(null!=this.taskbarManager&&null!=this.taskbarManager.getMoreOptions){const t=this.getTopTaskBarId();return i.concat(this.taskbarManager.getMoreOptions(t,this.configName,this._dataState,this.actionsList))}return i.concat(this.actionsList)}handleFilterConfigUpdated(i){this._showSnkFilterBar=!!i.length&&(1!==i.length||"PERSONALIZED_FILTER_GROUP"!==i[0].id||i[0].groupedItems.length>0)}getGridHeaderButtons(){return this.isGridInsertActive()?h.MORE_OPTIONS:this._headerTaskbarProcessor.buttons}isGridInsertActive(){return this.enableGridInsert&&this._dataUnit.hasNewRecord()}render(){if(this._dataUnit)return s("div",{class:"snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large"},s("div",{class:"snk-grid__header ez-margin-bottom--extra-small"},this._showSnkFilterBar&&s(e,null,s("snk-filter-bar",{ref:i=>this._snkFilterBar=i,title:this.filterBarTitle,dataUnit:this._dataUnit,"data-element-id":"gridFilter",class:"snk-grid__filter-bar ez-align--top",configName:this.configName,messagesBuilder:this.messagesBuilder,resourceID:this.resourceID,onConfigUpdated:i=>this.handleFilterConfigUpdated(i.detail),disablePersonalizedFilter:this.disablePersonalizedFilter,filterBarLegacyConfigName:this.filterBarLegacyConfigName,autoLoad:this.autoLoad}),s("hr",{class:"ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider"})),s("snk-taskbar",{class:"ez-padding-left--medium","data-element-id":"grid_top",key:"topTaskbar",configName:this.configName,dataUnit:this._dataUnit,messagesBuilder:this.messagesBuilder,buttons:this._topTaskbarProcessor.buttons,disabledButtons:this._topTaskbarProcessor.disabledButtons,customButtons:this._topTaskbarProcessor.customButtons,primaryButton:this.getPrimaryButton(),resourceID:this.resourceID,customContainerId:this.taskbarCustomContainerId,customSlotId:this.topTaskbarCustomSlotId,overflowStrategy:"none"},s("slot",{name:this.topTaskbarCustomSlotId}))),s("ez-grid",{ref:i=>this._grid=i,class:(this.presentationMode===c.SECONDARY?"snk-grid-container__without-shadow ":"")+"snk-grid__table","data-element-id":"embedded",dataUnit:this._dataUnit,key:"grid-"+this._snkDataUnit.entityName,config:this._gridConfig,onConfigChange:i=>{this.gridConfigChangeHandler(i)},onEzDoubleClick:i=>this.gridDoubleClick.emit(i.detail),statusResolver:this.statusResolver,multipleSelection:this.multipleSelection,columnfilterDataSource:this.columnFilterDataSource,selectionToastConfig:this.selectionToastConfig,useEnterLikeTab:this.useEnterLikeTab,recordsValidator:this.recordsValidator,canEdit:this.canEdit,autoFocus:this.autoFocus,enableGridInsert:this.enableGridInsert,enableContinuousInsert:this._enableContinuousInsert,enableLockManger:this.enableLockManger,outlineMode:this.outlineMode},s("snk-taskbar",{id:"teste",dataUnit:this._dataUnit,configName:this.configName,messagesBuilder:this.messagesBuilder,"data-element-id":"grid_left",buttons:this.getGridHeaderButtons(),presentationMode:this.presentationMode,disabledButtons:this._headerTaskbarProcessor.disabledButtons,customButtons:this._headerTaskbarProcessor.customButtons,slot:"leftButtons",actionsList:this.getActionsList(),primaryButton:this.getPrimaryButton(),resourceID:this.resourceID,customContainerId:this.taskbarCustomContainerId,customSlotId:this.gridHeaderCustomSlotId},s("slot",{name:this.gridHeaderCustomSlotId}))),s("div",{class:"ez-col ez-col--sd-12"},s("slot",{name:"SnkGridFooter"})),s("ez-modal",{modalSize:"small",closeEsc:!1,closeOutsideClick:!1,opened:this._popUpGridConfig,onEzCloseModal:()=>this.closeGridConfig()},s("snk-grid-config",{ref:i=>this._snkGridConfig=i,config:this._gridConfig,"data-element-id":this._element.getAttribute(n.DATA_ELEMENT_ID_ATTRIBUTE_NAME),selectedIndex:0,configName:this.configName,onConfigChange:i=>this.modalConfigChangeHandler(i),onConfigCancel:()=>this.closeGridConfig(),resourceID:this.resourceID})))}get _element(){return r(this)}static get watchers(){return{gridLegacyConfigName:["handleGridLegacyConfigName"]}}};C.style=".sc-snk-grid-h{--snk-grid-min-height:300px;--snk-grid-padding:var(--space--small)}.snk-grid__container.sc-snk-grid{display:flex;height:100%;width:100%;padding:var(--snk-grid-padding)}.snk-grid__header.sc-snk-grid{width:100%;display:flex;flex-wrap:nowrap;justify-content:flex-end}.snk-grid__filter-bar.sc-snk-grid{width:100%}.snk-grid__header-divider.sc-snk-grid{margin-bottom:var(--space--medium)}.snk-grid__table.sc-snk-grid{min-height:var(--snk-grid-min-height)}.snk-grid-container__without-shadow.sc-snk-grid{--ezgrid__container--shadow:unset}";export{C as snk_grid}
1
+ import{r as i,c as t,h as s,F as e,g as r}from"./p-d2d301a6.js";import{Action as a,ElementIDUtils as n,ApplicationContext as d,StringUtils as o}from"@sankhyalabs/core";import{T as h}from"./p-7e7a7473.js";import{C as l}from"./p-19dc71e9.js";import{P as c}from"./p-30cf616e.js";import{T as u,o as g,b as m}from"./p-23736d75.js";import{s as T}from"./p-6dc031de.js";import{C as k,S as v,a as f,R as E,b as p}from"./p-9bcb5505.js";import{SelectionMode as b}from"@sankhyalabs/core/dist/dataunit/DataUnit";import"./p-d62228fb.js";import"./p-798386c7.js";import"./p-21749402.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-1e4f16f3.js";import"./p-ff1990ad.js";import"./p-1435701f.js";import{g as O}from"./p-7dd49d15.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource";import"./p-8d884fab.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";class R extends k{getFilters(){var i;return null===(i=this.dataUnit)||void 0===i?void 0:i.getAppliedFilters()}getOrders(){var i;return null===(i=this.dataUnit)||void 0===i?void 0:i.getSort()}getResourceURI(){var i;return null===(i=this.dataUnit)||void 0===i?void 0:i.name}getSelectedNumber(){return this.dataUnit.getSelectionInfo().length}getTotalRecords(){var i,t,s;const{total:e}=(null===(i=this.dataUnit)||void 0===i?void 0:i.getPaginationInfo())||{};return null!=e?e:null===(s=null===(t=this.dataUnit)||void 0===t?void 0:t.records)||void 0===s?void 0:s.length}getSelectedIDs(){return O(this.dataUnit)}getOffset(){return this.getExporterOffset(this.getPaginationInfo())}getPageSize(){var i;return null===(i=this.dataUnit)||void 0===i?void 0:i.pageSize}getExportLimit(){return 5e3}getRecordID(){var i,t,s;return null===(s=null===(t=null===(i=this.dataUnit)||void 0===i?void 0:i.records)||void 0===t?void 0:t[0])||void 0===s?void 0:s.__record__id__}getPaginationInfo(){var i;return null===(i=this.dataUnit)||void 0===i?void 0:i.getPaginationInfo()}getExporterOffset(i){if(null==i)return;const t=i.firstRecord;return t>0?t-1:t}}const C=class{constructor(s){i(this,s),this.actionClick=t(this,"actionClick",7),this.gridDoubleClick=t(this,"gridDoubleClick",7),this._customEditors=new Map,this._customRenders=new Map,this._topTaskbarProcessor=new u({"snkGridTopTaskbar.regular":["FORM_MODE","CONFIGURATOR","INSERT"],"snkGridTopTaskbar.regular.secondary":["FORM_MODE","CONFIGURATOR","INSERT"],"snkGridTopTaskbar.regular.singleTaskbar":[],"snkGridTopTaskbar.finish_edition":["CANCEL","SAVE",this.handleAddFormMode()],"snkGridTopTaskbar.finish_edition.secondary":[],"snkGridTopTaskbar.finish_edition.singleTaskbar":[]}),this._headerTaskbarProcessor=new u({"snkGridHeaderTaskbar.unselected":["REFRESH","DATA_EXPORTER","ACTIONS_BUTTON","MORE_OPTIONS"],"snkGridHeaderTaskbar.selected":["UPDATE","CLONE","REMOVE","MORE_OPTIONS","DIVIDER","ATTACH","REFRESH","DATA_EXPORTER","ACTIONS_BUTTON"],"snkGridHeaderTaskbar.detail.unselected":["REFRESH","MORE_OPTIONS"],"snkGridHeaderTaskbar.detail.selected":["UPDATE","ATTACH","CLONE","REMOVE","MORE_OPTIONS","DIVIDER","REFRESH"],"snkGridHeaderTaskbar.singleTaskbar.unselected":["INSERT","FORM_MODE","CONFIGURATOR","REFRESH","DATA_EXPORTER","ACTIONS_BUTTON","MORE_OPTIONS"],"snkGridHeaderTaskbar.singleTaskbar.selected":["UPDATE","CLONE","REMOVE","MORE_OPTIONS","DIVIDER","ATTACH","FORM_MODE","CONFIGURATOR","REFRESH","DATA_EXPORTER","ACTIONS_BUTTON"],"snkGridHeaderTaskbar.singleTaskbar.detail.unselected":["INSERT","FORM_MODE","CONFIGURATOR","REFRESH","MORE_OPTIONS"],"snkGridHeaderTaskbar.singleTaskbar.detail.selected":["UPDATE","ATTACH","CLONE","REMOVE","MORE_OPTIONS","DIVIDER","FORM_MODE","CONFIGURATOR","REFRESH"],"snkGridHeaderTaskbar.singleTaskbar.finish_edition":["CANCEL","SAVE",this.handleAddFormMode()]}),this.dataUnitInterceptor={interceptAction:async i=>i.type===a.METADATA_LOADED?await this.interceptMetadataLoaded(i):i},this._dataUnit=void 0,this._dataState=void 0,this._gridConfig=void 0,this._popUpGridConfig=!1,this._showSnkFilterBar=!0,this._enableContinuousInsert=!1,this.columnFilterDataSource=new v,this.configName=void 0,this.filterBarTitle=void 0,this.resourceID=void 0,this.selectionToastConfig=void 0,this.actionsList=void 0,this.isDetail=void 0,this.taskbarManager=void 0,this.statusResolver=void 0,this.multipleSelection=void 0,this.presentationMode=c.PRIMARY,this.messagesBuilder=void 0,this.useEnterLikeTab=!1,this.recordsValidator=void 0,this.canEdit=!0,this.taskbarCustomContainerId=void 0,this.gridHeaderCustomSlotId="GRID_HEADER_CUSTOM_ELEMENTS",this.topTaskbarCustomSlotId="GRID_TASKBAR_CUSTOM_ELEMENTS",this.disablePersonalizedFilter=void 0,this.gridLegacyConfigName=void 0,this.filterBarLegacyConfigName=void 0,this.autoLoad=void 0,this.autoFocus=!0,this.enableGridInsert=!1,this.enableLockManger=!1,this.outlineMode=!1}reloadConfig(){this.loadConfig()}async showConfig(){null!=this._grid&&this.openGridConfig()}async hideConfig(){null!=this._grid&&this.closeGridConfig()}async setConfig(i){this.setGridConfig(i)}async reloadFilterBar(){var i;null===(i=this._snkFilterBar)||void 0===i||i.reload()}async getFilterBar(){return this._snkFilterBar}async findColumn(){await g(this._moreOptions,this._columnSearch)}async addCustomEditor(i,t,s){if(this._grid)return void this._grid.addCustomEditor(i,t,s);const e=new Map(this._customEditors);e.set(i,{customEditor:t,detailContext:s}),this._customEditors=e}async addGridCustomRender(i,t,s){if(this._grid)return void this._grid.addGridCustomRender(i,t,s);const e=new Map(this._customRenders);e.set(i,{customRender:t,detailContext:s}),this._customRenders=e}async addCustomValueFormatter(i,t){this._grid.addCustomValueFormatter(i,t)}async removeCustomValueFormatter(i){this._grid.removeCustomValueFormatter(i)}async setFocus(){this._grid.setFocus()}async handleClick(i){var t;if(this.hasToBlockEvent(i)){if(i.preventDefault(),i.stopPropagation(),!await this._dataUnit.cancelEdition())return;const s=new i.constructor(i.type,i);null===(t=i.target)||void 0===t||t.dispatchEvent(s)}this._grid&&!this._grid.contains(i.target)&&this._grid.stopEdit()}hasToBlockEvent(i){var t;return(null===(t=this._snkFilterBar)||void 0===t?void 0:t.contains(i.target))&&this.enableGridInsert&&this._dataUnit.hasNewRecord()}async handleGridLegacyConfigName(i,t){i&&i!==t&&(this.addGridLegacyConfigName(),this.loadConfig())}handleAddFormMode(){return this.enableGridInsert?h.FORM_MODE:""}openGridConfig(){this._grid.getColumnsState().then((i=>{this._snkGridConfig.columns=i.filter((i=>i.name)),this._snkGridConfig.selectedIndex=0,this._popUpGridConfig=!0}))}closeGridConfig(){this._popUpGridConfig=!1}setGridConfig(i){this._gridConfig=i,f.assertDefaultSorting(this._gridConfig,this._dataUnit)}fixColumNameCharset(i){try{return decodeURIComponent(escape(i))}catch(t){return i}}normalizeGridConfig(i){if(!i)return i;const t=i.columns.map((i=>Object.assign(Object.assign({},i),{name:this.fixColumNameCharset(i.name)})));return Object.assign(Object.assign({},i),{columns:t})}loadConfig(){l.loadGridConfig(this.configName,this.resourceID).then((i=>{this.setGridConfig(this.normalizeGridConfig(i))})).catch((i=>{console.warn(i)}))}addGridLegacyConfigName(){this.gridLegacyConfigName&&this.configName&&l.addGridLegacyConfig(this.configName,this.gridLegacyConfigName)}gridConfigChangeHandler(i){const t=this.normalizeGridConfig(i.detail);l.saveGridConfig(t,this.configName,this.resourceID),i.stopPropagation()}modalConfigChangeHandler(i){const t=this.normalizeGridConfig(i.detail);this._grid.setColumnsState(t.columns).then((()=>{this.setGridConfig(t),this.closeGridConfig(),this.dataExporterProviderStore()})),i.stopPropagation()}async dataExporterProviderStore(){const i=new R(this._dataUnit,this._grid);T.set("exporterProviders",Object.assign(Object.assign({},T.get("exporterProviders")),{[this.configName]:i}))}addElementID(){n.addIDInfo(this._element,null,{dataUnit:this._dataUnit})}loadGridCustomFormatters(i){i&&this._grid&&i.forEach((i=>{var t;(null===(t=i.properties)||void 0===t?void 0:t.rm_precision)&&this.addCustomValueFormatter(i.name,this._rmPrecisionCustomValueFormatter)}))}async interceptMetadataLoaded(i){return this.loadGridCustomFormatters(i.payload.fields),i}finishLoading(){this._dataUnit.addInterceptor(this.dataUnitInterceptor),f.assertDefaultSorting(this._gridConfig,this._dataUnit),this.addElementID(),null!=this.columnFilterDataSource&&(this.columnFilterDataSource.setApplication(this._application),this.columnFilterDataSource.setDataUnit(this._dataUnit))}setCustomRenders(){if(this._grid)for(const[i,t]of this._customRenders)this._grid.addGridCustomRender(i,t.customRender,t.detailContext),this._customRenders.delete(i)}setCustomEditors(){if(this._grid)for(const[i,t]of this._customEditors)this._grid.addCustomEditor(i,t.customEditor,t.detailContext),this._customEditors.delete(i)}componentWillLoad(){this._application=d.getContextValue("__SNK__APPLICATION__");let i=this._element.parentElement;for(;i;){if("SNK-DATA-UNIT"===i.tagName.toUpperCase()){this._snkDataUnit=i,this._dataUnit=this._snkDataUnit.dataUnit,this._dataUnit?this.finishLoading():this._snkDataUnit.addEventListener("dataUnitReady",(i=>{this._dataUnit=i.detail,this.finishLoading()})),this.messagesBuilder||(this.messagesBuilder=this._snkDataUnit.messagesBuilder),this._snkDataUnit.addEventListener("dataStateChange",this.handleDataStateChange.bind(this)),this._snkDataUnit.addEventListener("cancelEdition",(()=>{var i;(null===(i=this._dataState)||void 0===i?void 0:i.recordsIsEmpty)&&this._dataUnit.clearSelection()}));break}i=i.parentElement}this._rmPrecisionCustomValueFormatter=new E,this.addGridLegacyConfigName(),this.loadConfig(),this._continuousInsertUtils=new p(this._application,this.resourceID,this.configName),this.enableGridInsert&&this._continuousInsertUtils.getConfig().then((i=>this._enableContinuousInsert=i))}componentDidRender(){var i,t;this._rmPrecisionCustomValueFormatter.setGrid(this._grid),this.loadGridCustomFormatters(null===(t=null===(i=this._dataUnit)||void 0===i?void 0:i.metadata)||void 0===t?void 0:t.fields),this.setCustomRenders(),this.setCustomEditors()}async handleDataStateChange(i){this._dataState=i.detail,this._rmPrecisionCustomValueFormatter.setDataState(this._dataState)}getHeaderDisabledButtons(){var i;const t=[];return(null===(i=this._dataState)||void 0===i?void 0:i.selectionInfo)&&(this._dataState.selectionInfo.length>1&&t.push(h.CLONE,"ATTACH",h.UPDATE),this._dataState.selectionInfo.isAllRecords()&&t.push("REMOVE")),t}getInvisibleButtons(){let i=[];return this._dataUnit&&0!==this._dataUnit.records.length||i.push("DATA_EXPORTER"),this._dataState&&this._dataState.selectionInfo.mode===b.ALL_RECORDS&&i.push("ACTIONS_BUTTON"),i}componentWillRender(){const i=this.getInvisibleButtons();this._headerTaskbarProcessor.process(this.getHeaderTaskbarId(),this.taskbarManager,this._dataState,this.getHeaderDisabledButtons(),i),this._topTaskbarProcessor.process(this.getTopTaskBarId(),this.taskbarManager,this._dataState,void 0,i),this.dataExporterProviderStore()}getHeaderTaskbarId(){var i,t;const s=this._dataState&&!!(null===(i=this._dataState.selectionInfo)||void 0===i?void 0:i.length),e={primary:this.isDetail?"snkGridHeaderTaskbar.detail":"snkGridHeaderTaskbar",secondary:this.isDetail?"snkGridHeaderTaskbar.detail":"snkGridHeaderTaskbar",singleTaskbar:this.isDetail?"snkGridHeaderTaskbar.singleTaskbar.detail":"snkGridHeaderTaskbar.singleTaskbar"}[this.presentationMode];let r=s?`${e}.selected`:`${e}.unselected`;return(null===(t=this._dataState)||void 0===t?void 0:t.isDirty)&&this.presentationMode===c.SINGLE_TASKBAR&&(r="snkGridHeaderTaskbar.singleTaskbar.finish_edition"),r}getTopTaskBarId(){var i;const t={primary:"",secondary:".secondary",singleTaskbar:".singleTaskbar"}[this.presentationMode];return(null===(i=this._dataState)||void 0===i?void 0:i.isDirty)?`snkGridTopTaskbar.finish_edition${t}`:`snkGridTopTaskbar.regular${t}`}getPrimaryButton(){return{primary:"INSERT",secondary:"",singleTaskbar:"INSERT"}[this.presentationMode]}getColumnSearch(i,t){return null!=this._columnSearch||(this._moreOptions=i,this._columnSearch=m(t,(({argument:i})=>new Promise((t=>{this._grid.filterColumns(i).then((i=>{t(i.filter((i=>!i.hidden)).map((i=>({label:i.label,value:i.name}))))}))}))),(t=>{null!=t&&(this._grid.locateColumn(t.value),i.hideActions())}))),this._columnSearch}getActionsList(){const i=[{value:o.generateUUID(),label:this.messagesBuilder.getMessage("snkGrid.findColumn",{}),disableCloseOnSelect:!0,eagerInitialize:!0,itemBuilder:(i,t)=>this.getColumnSearch(i,t)}];if(this.enableGridInsert&&i.push(this._continuousInsertUtils.actionContinuousInsert(this._enableContinuousInsert,(()=>{this._enableContinuousInsert=!this._enableContinuousInsert,this._continuousInsertUtils.handleSaveConfig(this._enableContinuousInsert)}))),this.isGridInsertActive())return i;if(null!=this.taskbarManager&&null!=this.taskbarManager.getMoreOptions){const t=this.getTopTaskBarId();return i.concat(this.taskbarManager.getMoreOptions(t,this.configName,this._dataState,this.actionsList))}return i.concat(this.actionsList)}handleFilterConfigUpdated(i){this._showSnkFilterBar=!!i.length&&(1!==i.length||"PERSONALIZED_FILTER_GROUP"!==i[0].id||i[0].groupedItems.length>0)}getGridHeaderButtons(){return this.isGridInsertActive()?h.MORE_OPTIONS:this._headerTaskbarProcessor.buttons}isGridInsertActive(){return this.enableGridInsert&&this._dataUnit.hasNewRecord()}render(){if(this._dataUnit)return s("div",{class:"snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large"},s("div",{class:"snk-grid__header ez-margin-bottom--extra-small"},this._showSnkFilterBar&&s(e,null,s("snk-filter-bar",{ref:i=>this._snkFilterBar=i,title:this.filterBarTitle,dataUnit:this._dataUnit,"data-element-id":"gridFilter",class:"snk-grid__filter-bar ez-align--top",configName:this.configName,messagesBuilder:this.messagesBuilder,resourceID:this.resourceID,onConfigUpdated:i=>this.handleFilterConfigUpdated(i.detail),disablePersonalizedFilter:this.disablePersonalizedFilter,filterBarLegacyConfigName:this.filterBarLegacyConfigName,autoLoad:this.autoLoad}),s("hr",{class:"ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider"})),s("snk-taskbar",{class:"ez-padding-left--medium","data-element-id":"grid_top",key:"topTaskbar",configName:this.configName,dataUnit:this._dataUnit,messagesBuilder:this.messagesBuilder,buttons:this._topTaskbarProcessor.buttons,disabledButtons:this._topTaskbarProcessor.disabledButtons,customButtons:this._topTaskbarProcessor.customButtons,primaryButton:this.getPrimaryButton(),resourceID:this.resourceID,customContainerId:this.taskbarCustomContainerId,customSlotId:this.topTaskbarCustomSlotId,overflowStrategy:"none"},s("slot",{name:this.topTaskbarCustomSlotId}))),s("ez-grid",{ref:i=>this._grid=i,class:(this.presentationMode===c.SECONDARY?"snk-grid-container__without-shadow ":"")+"snk-grid__table","data-element-id":"embedded",dataUnit:this._dataUnit,key:"grid-"+this._snkDataUnit.entityName,config:this._gridConfig,onConfigChange:i=>{this.gridConfigChangeHandler(i)},onEzDoubleClick:i=>this.gridDoubleClick.emit(i.detail),statusResolver:this.statusResolver,multipleSelection:this.multipleSelection,columnfilterDataSource:this.columnFilterDataSource,selectionToastConfig:this.selectionToastConfig,useEnterLikeTab:this.useEnterLikeTab,recordsValidator:this.recordsValidator,canEdit:this.canEdit,autoFocus:this.autoFocus,enableGridInsert:this.enableGridInsert,enableContinuousInsert:this._enableContinuousInsert,enableLockManger:this.enableLockManger,outlineMode:this.outlineMode},s("snk-taskbar",{id:"teste",dataUnit:this._dataUnit,configName:this.configName,messagesBuilder:this.messagesBuilder,"data-element-id":"grid_left",buttons:this.getGridHeaderButtons(),presentationMode:this.presentationMode,disabledButtons:this._headerTaskbarProcessor.disabledButtons,customButtons:this._headerTaskbarProcessor.customButtons,slot:"leftButtons",actionsList:this.getActionsList(),primaryButton:this.getPrimaryButton(),resourceID:this.resourceID,customContainerId:this.taskbarCustomContainerId,customSlotId:this.gridHeaderCustomSlotId},s("slot",{name:this.gridHeaderCustomSlotId}))),s("div",{class:"ez-col ez-col--sd-12"},s("slot",{name:"SnkGridFooter"})),s("ez-modal",{modalSize:"small",closeEsc:!1,closeOutsideClick:!1,opened:this._popUpGridConfig,onEzCloseModal:()=>this.closeGridConfig()},s("snk-grid-config",{ref:i=>this._snkGridConfig=i,config:this._gridConfig,"data-element-id":this._element.getAttribute(n.DATA_ELEMENT_ID_ATTRIBUTE_NAME),selectedIndex:0,configName:this.configName,onConfigChange:i=>this.modalConfigChangeHandler(i),onConfigCancel:()=>this.closeGridConfig(),resourceID:this.resourceID})))}get _element(){return r(this)}static get watchers(){return{gridLegacyConfigName:["handleGridLegacyConfigName"]}}};C.style=".sc-snk-grid-h{--snk-grid-min-height:300px;--snk-grid-padding:var(--space--small)}.snk-grid__container.sc-snk-grid{display:flex;height:100%;width:100%;padding:var(--snk-grid-padding)}.snk-grid__header.sc-snk-grid{width:100%;display:flex;flex-wrap:nowrap;justify-content:flex-end}.snk-grid__filter-bar.sc-snk-grid{width:100%}.snk-grid__header-divider.sc-snk-grid{margin-bottom:var(--space--medium)}.snk-grid__table.sc-snk-grid{min-height:var(--snk-grid-min-height)}.snk-grid-container__without-shadow.sc-snk-grid{--ezgrid__container--shadow:unset}";export{C as snk_grid}
@@ -1,4 +1,4 @@
1
- import{r as t,c as s,h as e,g as i}from"./p-d2d301a6.js";import{DateUtils as n,StringUtils as r,ObjectUtils as o,WaitingChangeException as a,WarningException as c,ErrorException as h,KeyboardManager as u,OnboardingUtils as l,DependencyType as d,ArrayUtils as p,SearchUtils as w,ElementIDUtils as m,ApplicationContext as y,DataType as f,ErrorTracking as P}from"@sankhyalabs/core";import{ApplicationUtils as v}from"@sankhyalabs/ezui/dist/collection/utils";import{C as _}from"./p-19dc71e9.js";import{d as g,D as A,U as I}from"./p-d62228fb.js";import{A as S,a as b}from"./p-f0b9303b.js";import{P as N,D as C}from"./p-ddefbbc7.js";import{P as E}from"./p-798386c7.js";import{S as T}from"./p-17425c72.js";import"./p-1435701f.js";import"./p-ff1990ad.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 L{static webConnectionCaller(t,s,e){var i;null===(i=window.AppletCaller)||void 0===i||i.webConnectionCaller(t,s,e)}}const D=k;function k(t,s){const e=O();return(k=function(t){return e[t-=378]})(t,s)}function O(){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(O=function(){return t})()}!function(){const t=k,s=O();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;s.push(s.shift())}catch(t){s.push(s.shift())}}();class R{[D(397)](t){const s=D;if(typeof(t=utxt(t[s(390)]))==s(392)&&(t=JSON[s(400)](t)),null==t)throw Error(s(395));const e=new M("S"===t[s(402)]||!0===t[s(402)]);return Array[s(394)](t[s(391)])&&t[s(391)][s(385)]((t=>e.putAccess(t[s(382)],String(t.status)==s(398)))),e}}class M{constructor(t){const s=D;this.isSup=t,this[s(384)]={}}[D(378)](t,s){this[D(384)][t]=s}[D(393)](t){const s=D;if(this[s(402)])return!0;let e=!0;return this[s(384)][s(380)](t)&&(e=this.actions[t]),e}isUserSup(){return this.isSup}}class U{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[s,e]=t.split("__=__");this._embeddedParams.set(s,e)}))}}catch(t){console.error("Problemas ao obter parâmetros embarcados"),console.error(t)}this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchParam",g.gql`query($name: String!) {
1
+ import{r as t,c as s,h as e,g as i}from"./p-d2d301a6.js";import{DateUtils as n,StringUtils as r,ObjectUtils as o,WaitingChangeException as a,WarningException as c,ErrorException as h,KeyboardManager as u,OnboardingUtils as l,DependencyType as p,ArrayUtils as d,SearchUtils as w,ElementIDUtils as m,ApplicationContext as y,DataType as f,ErrorTracking as P}from"@sankhyalabs/core";import{ApplicationUtils as v}from"@sankhyalabs/ezui/dist/collection/utils";import{C as _}from"./p-19dc71e9.js";import{d as g,D as A,U as I}from"./p-d62228fb.js";import{A as S,a as N}from"./p-f0b9303b.js";import{P as b,D as C}from"./p-1e4f16f3.js";import{P as E}from"./p-798386c7.js";import{S as T}from"./p-17425c72.js";import"./p-1435701f.js";import"./p-ff1990ad.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 L{static webConnectionCaller(t,s,e){var i;null===(i=window.AppletCaller)||void 0===i||i.webConnectionCaller(t,s,e)}}const D=k;function k(t,s){const e=O();return(k=function(t){return e[t-=378]})(t,s)}function O(){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(O=function(){return t})()}!function(){const t=k,s=O();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;s.push(s.shift())}catch(t){s.push(s.shift())}}();class R{[D(397)](t){const s=D;if(typeof(t=utxt(t[s(390)]))==s(392)&&(t=JSON[s(400)](t)),null==t)throw Error(s(395));const e=new M("S"===t[s(402)]||!0===t[s(402)]);return Array[s(394)](t[s(391)])&&t[s(391)][s(385)]((t=>e.putAccess(t[s(382)],String(t.status)==s(398)))),e}}class M{constructor(t){const s=D;this.isSup=t,this[s(384)]={}}[D(378)](t,s){this[D(384)][t]=s}[D(393)](t){const s=D;if(this[s(402)])return!0;let e=!0;return this[s(384)][s(380)](t)&&(e=this.actions[t]),e}isUserSup(){return this.isSup}}class U{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[s,e]=t.split("__=__");this._embeddedParams.set(s,e)}))}}catch(t){console.error("Problemas ao obter parâmetros embarcados"),console.error(t)}this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchParam",g.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 s,h as e,g as i}from"./p-d2d301a6.js";import{DateUtils as n,S
8
8
  name
9
9
  value
10
10
  }
11
- }`)}fetchTotals(t,s,e=[]){const i=`${t}_${s}`,n=this.cancel.findIndex((t=>t[i]));return n>=0&&(this.cancel[n][i](),this.cancel.splice(n,1)),Promise.race([new Promise((t=>this.cancel.push({[i]:t}))),this.getTotals(t,s,e)]).then((t=>{let s=new Map;if(t){s=t;const e=this.cancel.findIndex((t=>t[i]));e>=0&&this.cancel.splice(e,1)}return s}))}getTotals(t,s,e=[]){return new Promise(((i,n)=>{A.get().callGraphQL({query:this.templateByQuery.get("fetchTotals"),values:{name:`totals://${t}/${s}`,filters:e}}).then((t=>{if(t.length>0){const s=new Map;return t.forEach((t=>s.set(t.name,parseFloat(t.value)))),i(s)}return n("Não foi possível recuperar os totalizadores")})).catch(n)}))}}function F(){const t=["2909523kXwted","CompanyName=Sankhya Jiva Tecnologia e Inovao Ltda,LicensedApplication=Sankhya Gestao,LicenseType=SingleApplication,LicensedConcurrentDeveloperCount=2,LicensedProductionInstancesCount=0,AssetReference=AG-019460,ExpiryDate=9_November_2022_[v2]_MTY2Nzk1MjAwMDAwMA==10487151e296ee4360f80961ca960869","1131048CARoeW","502909mLEPmu","447255iQEXuN","428UHbJwW","270AFTxAV","194369jhGqTI","1540nWuTrj","2044062GicUQI","30CkXPWg"];return(F=function(){return t})()}const $=q;function q(t,s){const e=F();return(q=function(t){return e[t-=392]})(t,s)}!function(){const t=q,s=F();for(;;)try{if(951926==-parseInt(t(398))/1+-parseInt(t(393))/2+parseInt(t(395))/3+-parseInt(t(400))/4*(parseInt(t(392))/5)+-parseInt(t(401))/6*(-parseInt(t(402))/7)+parseInt(t(397))/8+-parseInt(t(399))/9*(-parseInt(t(394))/10))break;s.push(s.shift())}catch(t){s.push(s.shift())}}();const z=$(396);var x;class B{static openAppActivity(t,s){var e;null===(e=window.workspace)||void 0===e||e.openAppActivity(t,s)}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,s;null===(s=null===(t=window.workspace)||void 0===t?void 0:t.showDesktop)||void 0===s||s.call(t)}static searchApp(){var t,s;null===(s=null===(t=window.workspace)||void 0===t?void 0:t.searchApp)||void 0===s||s.call(t)}static openHelp(){var t,s;null===(s=null===(t=window.workspace)||void 0===t?void 0:t.openHelp)||void 0===s||s.call(t)}static applicationClick(){var t,s;(null===(t=window.workspace)||void 0===t?void 0:t.applicationClick)&&(null===(s=window.workspace)||void 0===s||s.applicationClick())}}B.resourceID=null===(x=window.workspace)||void 0===x?void 0:x.resourceID;class H{constructor(t){this._app=t,window.addEventListener("error",(t=>this.errorHandler(t))),window.addEventListener("unhandledrejection",(t=>this.rejectionHandler(t)))}rejectionHandler(t){const s=t.reason;s instanceof a||(s?this.processException(s):this._app.isDebugMode().then((t=>{t&&this._app.error("Promise rejeitada","Erro interno: Uma promise foi rejeitada sem razão determinada.")})))}errorHandler(t){this.processException(t.error)}buildErrorCodeHTML(t){return'<br><a href="#" onclick="try{window.workspace.openHelp(\'_tbcode:'+t+"')} catch(e){alert('Não é possível abrir a ajuda fora do workspace Sankhya');}\">Código: "+t+"</a>"}processException(t){t.errorCode&&(t.message+=this.buildErrorCodeHTML(t.errorCode)),t instanceof a||t instanceof c?this._app.alert(t.title,t.message):t instanceof h?this._app.error(t.title,t.message):this._app.isDebugMode().then((s=>{if(s)if(t instanceof Error)this._app.error(t.name,t.message);else{const s=(null==t?void 0:t.title)||"Erro detectado",e="string"==typeof t?t:t.message||`Erro interno "${o.objectToString(t)}"`;this._app.error(s,e)}}))}}class K{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 s=setTimeout((()=>{this.ezLoadingBar.show()}),this._debounceTime);this.requests.set(t.requestId,s)}onRequestEnd(t){const s=this.requests.get(t.requestId);clearTimeout(s),this.requestsLoadingBar.includes(t.requestId)&&(this.requestsLoadingBar=this.requestsLoadingBar.filter((s=>s!==t.requestId)),!this.requestsLoadingBar.length&&this.ezLoadingBar.hide())}}class V{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:s}=t.requestBody[0].variables;if(s){const t=s.split(":");return this._ignoredNameTypes.indexOf(t[0])>=0}}return!1}}class W{static create({strategy:t}){switch(t){case"request_name":return new V;case"request_time":return new K;default:throw new Error("Strategy not found")}}}const G=class{constructor(e){t(this,e),this.applicationLoaded=s(this,"applicationLoaded",7),this.applicationLoading=s(this,"applicationLoading",7),this.NEW_VERSION_POPUP_LOCKER="NEW_VERSION_POPUP_LOCKER",this._authPromises=[],this._keyboardManager=new u,this._waitingAppReady=new Array,this._duCache=new Map,this._duPromises=new Map,this._requestListener=W.create({strategy:"request_time"}),this._pendingActions=new Map,this._loadPkParameter=null,this._isLoadedByPk=!1,this.messagesBuilder=void 0,this.configName=void 0,this.gridLegacyConfigName=void 0,this.formLegacyConfigName=void 0,this.loadByPK=void 0}async processPendingActions(t){const s=this._pendingActions.get(t);s&&s.length&&(s.forEach((t=>t())),this._pendingActions.set(t,[]))}get parameters(){return this._parameters||(this._parameters=new U),this._parameters}async getAuth(t){return null==t?this.getApplicationAuth():new Promise(((s,e)=>{this.authFetcher.getData(t).then((t=>{s(t)})).catch((t=>{e(t)}))}))}async getApplicationAuth(){return this._auth?Promise.resolve(this._auth):new Promise(((t,s)=>{const e=this._authPromises.length>0;this._authPromises.push(new J(t,s)),e||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,s){t&&this._loadPkParameter&&(this.loadByPK(this._loadPkParameter.pk,this._loadPkParameter.redirect),this._loadPkParameter=null)}async getKeyboardManager(){return Promise.resolve(this._keyboardManager)}async isUserSup(){return new Promise(((t,s)=>{this.getAuth().then((e=>{this.getAuthList(e).then((s=>{t(s.isSup)})).catch((t=>s(t)))}))}))}async addPendingAction(t,s){var e;const i=null!==(e=this._pendingActions.get(t))&&void 0!==e?e:[];this._pendingActions.set(t,[...i,s])}async callServiceBroker(t,s,e){return A.get().callServiceBroker(t,s,e)}async initOnboarding(t){this.hasToShowNewVersionPopup()?await this.addPendingAction(this.NEW_VERSION_POPUP_LOCKER,(()=>this.doInitOnboarding(t))):this.doInitOnboarding(t)}doInitOnboarding(t){l.getInstance().init(t,window.envContext)}async hasAccess(t,s){return new Promise(((e,i)=>{this.getAuth(s).then((s=>{this.getAuthList(s).then((s=>{e(s.isSup||s.actions[t])})).catch((t=>i(t)))}))}))}async getAllAccess(t){return new Promise(((s,e)=>{this.getAuth(t).then((t=>{this.getAuthList(t).then((t=>{const e={};e.isSup=t.isSup,Object.entries(S).forEach((s=>{e[s[0]]=t.actions[s[1]]||!1})),s(e)})).catch((t=>e(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,s="full",e=!0,i){this.clearContent(this._popUp),this._popUp.addEventListener("ezClosePopup",(()=>{i()}),{once:!0}),this._popUp.appendChild(t),this._popUp.opened=!0,this._popUp.heightMode=s,this._popUp.useHeader=e,"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 v.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 s=t.split(",");return new Promise(((t,e)=>{this.getAttributeFromHTMLWrapper("opc0009").then((i=>{"1"===i?t(!0):Promise.all(s.map((t=>this.getAttributeFromHTMLWrapper("opc"+t)))).then((s=>{t(s.includes("1"))})).catch((t=>{e(t)}))})).catch((t=>{e(t)}))}))}async getConfig(t){let s={serviceName:"SystemUtilsSP.getConf",requestBody:{config:{chave:t,tipo:"T"}}};return new Promise(((t,e)=>{A.get().callServiceBroker("SystemUtilsSP.getConf",JSON.stringify(s)).then((s=>{var e;return t(null===(e=s.config)||void 0===e?void 0:e.data)})).catch((t=>e(t)))}))}async saveConfig(t,s){let e={serviceName:"SystemUtilsSP.saveConf",requestBody:{config:{chave:t,tipo:"T",data:s}}};return new Promise(((t,s)=>{A.get().callServiceBroker("SystemUtilsSP.saveConf",JSON.stringify(e)).then((s=>t(s))).catch((t=>s(t)))}))}async getAttributeFromHTMLWrapper(t){return Promise.resolve(window[t])}async openApp(t,s){B.openAppActivity(t,s)}async webConnection(t,s,e){this.getStringParam(t).then((t=>{L.webConnectionCaller(t,s,e)}))}getDuPromissesStack(t){let s;return t&&(s=this._duPromises.get(t),s||(s=[],this._duPromises.set(t,s))),s||[]}async createDataunit(t,s,e,i,n){return null==n&&(n=this.applicationResourceID),new Promise(((r,o)=>{const a=this.getDuPromissesStack(s),c=a.length>0;if(a.push(new J(r,o)),!c){const r=this.dataUnitFetcher.getDataUnit(t,n,e,i);r.loadMetadata().then((()=>{this.processResolveDataUnit(r,s,a)})).catch((t=>{for(;a.length>0;)a.pop().reject(t)}))}}))}processResolveDataUnit(t,s,e){for(s&&this.updateDataunitCache(void 0,s,t);e.length>0;)e.pop().resolve(t)}async updateDataunitCache(t,s,e){t&&this._duCache.delete(t),this._duCache.set(s,e)}async getDataUnit(t,s,e,i,n){return new Promise(((r,o)=>{const a=this._duCache.get(s);a?r(a):this.createDataunit(t,s,e,i,n).then((t=>{r(t)})).catch((t=>o(t)))}))}async addClientEvent(t,s){return new Promise((e=>{A.addClientEvent(t,s),e()}))}async removeClientEvent(t){return new Promise((s=>{A.removeClientEvent(t),s()}))}async hasClientEvent(t){return new Promise((s=>{s(A.hasClientEvent(t))}))}get applicationResourceID(){return this._applicationResourceID||(this._applicationResourceID=this.urlParams.get("workspaceResourceID")||this.urlParams.get("resourceID")||B.resourceID||"unknown.resource.id"),this._applicationResourceID}async getResourceID(){return Promise.resolve(this.applicationResourceID)}async getUserID(){return Promise.resolve(window.UID)}async alert(t,s,e,i){return v.alert(t,s,e,i)}async error(t,s,e,i){return v.error(t,s,e,i)}async success(t,s,e,i){return v.success(t,s,e,i)}async message(t,s,e,i){return v.message(t,s,e,i)}async confirm(t,s,e,i,n){return v.confirm(t,s,e,i,n)}async info(t,s){return v.info(t,s)}async loadTotals(t,s,e){return this.totalsFetcher.fetchTotals(t,s,e)}async isLoadedByPk(){return Promise.resolve(this._isLoadedByPk)}async preloadMangerRemoveRecord(t,s){const e=s.map((t=>({__record__id__:t})));N.removeRecords(t,e)}async getAuthList(t){return await(new R).parseFromJSON(t)}get urlParams(){return this._urlParams||(this._urlParams=I.getQueryParams(location.search)),this._urlParams}getMessage(t,s){var e;return null===(e=this.messagesBuilder)||void 0===e?void 0:e.getMessage(t,s)}get dataUnitFetcher(){return this._dataUnitFetcher||(this._dataUnitFetcher=new C),this._dataUnitFetcher}get totalsFetcher(){return this._totalsFetcher||(this._totalsFetcher=new j),this._totalsFetcher}get pesquisaFetcher(){return this._pesquisaFetcher||(this._pesquisaFetcher=new E),this._pesquisaFetcher}get authFetcher(){return this._authFetcher||(this._authFetcher=new b),this._authFetcher}async executeSearch(t,s,e,i){const n=null==e?void 0:e.getField(s);if(n){const{mode:s,argument:r}=t,{ENTITYNAME:o,CODEFIELD:a,DESCRIPTIONFIELD:c,ROOTENTITY:h,DESCRIPTIONENTITY:u,ISHIERARCHYENTITY:l}=n.properties,p=n.dependencies;let w;const m={rootEntity:h,descriptionFieldName:c,codeFieldName:a,showInactives:!1,dataUnitId:e.dataUnitId};return null==p||p.filter((t=>t.masterFields)).forEach((t=>{var s;t.type===d.SEARCHING&&(null===(s=t.masterFields)||void 0===s?void 0:s.length)>0&&(w={expression:t.expression,params:t.masterFields.map((t=>{const s=e.getField(t),i=(null==s?void 0:s.dataType)||f.TEXT,n=e.getFieldValue(t);if(null==n)throw this.alert("Erro ao pesquisar",`É necessario informar o campo ${s.label} para executar a pesquisa.`),new Error(`É necessario informar o campo ${s.label} para executar a pesquisa.`);return{name:t,value:n,dataType:i}}))})})),this.executePreparedSearch(s,r,{entity:o,entityDescription:u,isHierarchyEntity:l,criteria:w,searchOptions:m,allowsNonAnalytic:null==i?void 0:i.allowsNonAnalytic})}}filterInvalidFields(t,s,e){return t.fieldsMetadata.filter((i=>{let n=!r.isEmpty(s[i.fieldName])&&!1!==i.visible&&"B"!==i.type&&t.pkField!==i.fieldName&&t.descriptionField!==i.fieldName&&(i.isPrimaryKey||!i.isLinkField)&&!("S"===i.type&&"H"===i.presentationType);return n&&(e[i.fieldName]=i),("string"!=typeof s[i.fieldName]||!(s[i.fieldName].indexOf("<img")>-1||s[i.fieldName].indexOf("<svg")>-1))&&n}))}filterMathFields(t,s,e,i){return t&&Array.isArray(t)&&t.forEach((t=>{let e=p.removeReference(s,i[t]);e&&s.unshift(e)})),s=s.slice(0,e)}builOptionItem(t,s,e,i,n){var o;return{value:r.highlightValue(t,s.__matchFields,null===(o=s[n])||void 0===o?void 0:o.toString(),e,!0),label:i?r.highlightValue(t,s.__matchFields,s[i],e,!0):"",details:w.buildDetails(t,e,s)}}async executePreparedSearch(t,s,e){const i={},{entity:n,entityDescription:r,criteria:a,searchOptions:c,isHierarchyEntity:h,allowsNonAnalytic:u}=e;return new Promise("ADVANCED"===t?(t,e)=>{const i=document.createElement("snk-pesquisa");i[m.DATA_ELEMENT_ID_ATTRIBUTE_NAME]=`entity_${n}`,i.entityName=n,i.argument=s,i.searchLoader=t=>this.pesquisaFetcher.loadAdvancedSearch(n,t,a,c),i.isHierarchyEntity=h,h&&(i.treeLoader=t=>this.pesquisaFetcher.loadTree(n,t,a,c),i.allowsNonAnalytic=u),i.selectItem=s=>{t(s),this.clearPopUpTitle(),this.closePopUp()},this.setPopUpTitle(r),this.showPopUp(i,void 0,void 0,e)}:(t,e)=>{this.pesquisaFetcher.loadAdvancedSearch(n,s,a,c).then((e=>{let n=(e=o.stringToObject(e.json.$)).descriptionField,r=e.pkField;const a=[];e.data.forEach((t=>{let o=this.filterInvalidFields(e,t,i),c=this.filterMathFields(t.__matchFields,o,6,i);a.push(this.builOptionItem(s,t,c,n,r))})),t(a)})).catch((t=>{e(t)}))})}async isDebugMode(){return new Promise((t=>{t(window.isDebugMode)}))}async getAppLabel(){return B.getAppLabel(this.applicationResourceID)}addSearchListener(t,s,e){return new Promise((i=>{i(this.pesquisaFetcher.addSearchListener(t,s.dataUnitId,e))}))}importScript(t){return new Promise((s=>{this.getApplicationPath().then((e=>{let i=[];Array.isArray(t)||(i=[t]),i.forEach((t=>{const s=document.createElement("script");s.src=`${e}/${t}`,s.async=!0,document.body.appendChild(s)})),s()}))}))}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,s,e){return this.dataUnitFetcher.loadSelectDistinct(t,s,e)}getDataFetcher(){return Promise.resolve(A.get())}async whenApplicationReady(){return y.getContextValue("__SNK__APPLICATION__LOADING__")?Promise.resolve(this):new Promise((t=>{this._waitingAppReady.push((()=>t(this)))}))}async setSearchFilterContext(t,s){y.setContextValue(`__SNK__APPLICATION__FILTER__CONTEXT(${t})__`,s)}clearContent(t){t&&Array.from(t.children).forEach((s=>{t.removeChild(s)}))}clearPopUpTitle(){this._popUp.ezTitle=""}setPopUpTitle(t){this._popUp.ezTitle=t}async pkChangeListener(){const t=top.window.location.hash.split("/")[2];if(this._currentPkParameter===t)return;const s=this.getResourceIdFromToken(),e=I.getPkObjectFromUrlToken(top.window.location.hash),i=window.redirectFrom;if(void 0===e)return;if((!i||-1===i.split("_")[0].indexOf(s.split("_")[0]))&&s!==this.applicationResourceID)return;const n={pk:e};if(this._isLoadedByPk=!0,this.loadByPK)return this.loadByPK(n,i),void(this._currentPkParameter=t);this._loadPkParameter={pk:n,redirect:i},this.defaultLoadByPK(n,t)}getResourceIdFromToken(){return top.window.location.pathname.indexOf("tabContent.jsp")>-1?I.getResourceIdFromUrlToken(window.location.generateHash(window.location.hash)):I.getResourceIdFromUrlToken(top.window.location.hash)}defaultLoadByPK(t,s){if(!(null==t?void 0:t.pk))return;const e=this.getFirstDataUnitFromDOM(),i=e.dataUnit;if(!i)return console.warn("Dataunit não inicializado"),void e.addEventListener("dataUnitReady",(e=>{this.loadDataWithPKFilter(t,e.detail),this._currentPkParameter=s}));this.loadDataWithPKFilter(t,i),this._currentPkParameter=s}loadDataWithPKFilter(t,s){const e={term:"",filter:{name:"LOAD_BY_PK_FILTER",expression:this.buildFilterExpressionByPkObject(t),params:this.getFilterParamsFromPkObject(t,s)}};s.loadData(e)}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,s){var e;const i=[];for(const n in t.pk)t.pk.hasOwnProperty(n)&&!Array.isArray(t.pk[n])&&i.push({name:n,dataType:(null===(e=s.getField(n))||void 0===e?void 0:e.dataType)||this.getDefaultDataTypeLoadByPK(t.pk[n]),value:t.pk[n]});return i}getDefaultDataTypeLoadByPK(t){return"number"==typeof t||t instanceof Number?f.NUMBER:"boolean"==typeof t||t instanceof Boolean?f.BOOLEAN:t instanceof Date?f.DATE:f.TEXT}buildFilterExpressionByPkObject(t){let s="";for(const e in t.pk)r.isEmpty(s)||(s+=" AND "),Array.isArray(t.pk[e])?s+=`${e} IN (${t.pk[e].toString()})`:s+=`${e} = :${e}`;return s}async showNewVersionPopup(){const t=document.createElement("ez-modal-container"),s=await this.getAppLabel();t.modalTitle=this.getMessage("snkApplication.newVersionPopup.title",{screenName:s}),t.okButtonLabel=this.getMessage("snkApplication.newVersionPopup.okButton"),t.cancelButtonLabel=this.getMessage("snkApplication.newVersionPopup.cancelButton");const e=document.createElement("p");e.innerText=this.getMessage("snkApplication.newVersionPopup.info"),e.className="ez-text",t.appendChild(e),t.addEventListener("ezModalAction",this.newVersionPopupEventListener.bind(this));const i=await v.showPopup({content:t});this._removeVersionLayoutPopup=async()=>{await i(),await this.processPendingActions(this.NEW_VERSION_POPUP_LOCKER)}}async newVersionPopupEventListener(t){"LOAD"!==t.detail&&("OK"===t.detail&&B.setScreenToUseV3Layout(),"CANCEL"===t.detail&&B.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(){y.setContextValue("__SNK__APPLICATION__LOADING__",!0),this._errorHandler=new H(this),this.messagesBuilder=new T,y.setContextValue("__EZUI__UPLOAD__ADD__URL__",`${I.getUrlBase()}/mge/upload/file`),y.setContextValue("__EZUI__SEARCH__OPTION__LOADER__",((t,s,e,i)=>this.executeSearch(t,s,e,i))),y.setContextValue("__EZUI__GRID_LICENSE__",z),this.registerPkChangeListener(),P.init(),_.preload(this.applicationResourceID,this.configName,{gridLegacyConfig:this.gridLegacyConfigName,formLegacyConfig:this.formLegacyConfigName}),document.addEventListener("click",(()=>B.applicationClick())),this._waitingAppReady.forEach((t=>t()))}connectedCallback(){y.setContextValue("__SNK__APPLICATION__",this),A.addRequestListener(this._requestListener)}disconnectedCallback(){A.removeRequestListener(this._requestListener),this.removeShortcuts()}async componentDidLoad(){this.applicationLoading.emit(!0),window.requestAnimationFrame((()=>{y.setContextValue("__SNK__APPLICATION__LOADING__",!1),this.applicationLoaded.emit(!0),this.pkChangeListener()})),m.addIDInfo(this._element,`resource_${this.applicationResourceID}`),await this.handleShowNewVersionPopup(),this.initKeyboardManager()}initKeyboardManager(){this._keyboardManager.bind("ctrl + g",B.searchApp.bind(this),{description:"Pesquisar por telas"}).bind("ctrl + d",B.showDesktop.bind(this),{description:"Mostrar o desktop"}).bind("F1",B.openHelp.bind(this),{description:"Abrir ajuda"})}removeShortcuts(){this._keyboardManager.unbind("ctrl + g").unbind("ctrl + d").unbind("F1")}render(){return e("div",null,e("ez-loading-bar",{ref:t=>this._requestListener.ezLoadingBar=t}),e("ez-popup",{opened:!1,ref:t=>this._popUp=t,onEzClosePopup:()=>this.closePopUp()}),e("ez-modal",{opened:!1,ref:t=>this._rightModal=t,"modal-size":"small",closeOutsideClick:!0,closeEsc:!0}))}get _element(){return i(this)}static get watchers(){return{loadByPK:["watchPropHandler"]}}};class J{constructor(t,s){this.resolve=t,this.reject=s}}G.style=".sc-snk-application-h{display:flex;flex-direction:column;height:100%}";export{G as snk_application}
11
+ }`)}fetchTotals(t,s,e=[]){const i=`${t}_${s}`,n=this.cancel.findIndex((t=>t[i]));return n>=0&&(this.cancel[n][i](),this.cancel.splice(n,1)),Promise.race([new Promise((t=>this.cancel.push({[i]:t}))),this.getTotals(t,s,e)]).then((t=>{let s=new Map;if(t){s=t;const e=this.cancel.findIndex((t=>t[i]));e>=0&&this.cancel.splice(e,1)}return s}))}getTotals(t,s,e=[]){return new Promise(((i,n)=>{A.get().callGraphQL({query:this.templateByQuery.get("fetchTotals"),values:{name:`totals://${t}/${s}`,filters:e}}).then((t=>{if(t.length>0){const s=new Map;return t.forEach((t=>s.set(t.name,parseFloat(t.value)))),i(s)}return n("Não foi possível recuperar os totalizadores")})).catch(n)}))}}function F(){const t=["2909523kXwted","CompanyName=Sankhya Jiva Tecnologia e Inovao Ltda,LicensedApplication=Sankhya Gestao,LicenseType=SingleApplication,LicensedConcurrentDeveloperCount=2,LicensedProductionInstancesCount=0,AssetReference=AG-019460,ExpiryDate=9_November_2022_[v2]_MTY2Nzk1MjAwMDAwMA==10487151e296ee4360f80961ca960869","1131048CARoeW","502909mLEPmu","447255iQEXuN","428UHbJwW","270AFTxAV","194369jhGqTI","1540nWuTrj","2044062GicUQI","30CkXPWg"];return(F=function(){return t})()}const $=q;function q(t,s){const e=F();return(q=function(t){return e[t-=392]})(t,s)}!function(){const t=q,s=F();for(;;)try{if(951926==-parseInt(t(398))/1+-parseInt(t(393))/2+parseInt(t(395))/3+-parseInt(t(400))/4*(parseInt(t(392))/5)+-parseInt(t(401))/6*(-parseInt(t(402))/7)+parseInt(t(397))/8+-parseInt(t(399))/9*(-parseInt(t(394))/10))break;s.push(s.shift())}catch(t){s.push(s.shift())}}();const z=$(396);var x;class B{static openAppActivity(t,s){var e;null===(e=window.workspace)||void 0===e||e.openAppActivity(t,s)}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,s;null===(s=null===(t=window.workspace)||void 0===t?void 0:t.showDesktop)||void 0===s||s.call(t)}static searchApp(){var t,s;null===(s=null===(t=window.workspace)||void 0===t?void 0:t.searchApp)||void 0===s||s.call(t)}static openHelp(){var t,s;null===(s=null===(t=window.workspace)||void 0===t?void 0:t.openHelp)||void 0===s||s.call(t)}static applicationClick(){var t,s;(null===(t=window.workspace)||void 0===t?void 0:t.applicationClick)&&(null===(s=window.workspace)||void 0===s||s.applicationClick())}}B.resourceID=null===(x=window.workspace)||void 0===x?void 0:x.resourceID;class H{constructor(t){this._app=t,window.addEventListener("error",(t=>this.errorHandler(t))),window.addEventListener("unhandledrejection",(t=>this.rejectionHandler(t)))}rejectionHandler(t){const s=t.reason;s instanceof a||(s?this.processException(s):this._app.isDebugMode().then((t=>{t&&this._app.error("Promise rejeitada","Erro interno: Uma promise foi rejeitada sem razão determinada.")})))}errorHandler(t){this.processException(t.error)}buildErrorCodeHTML(t){return'<br><a href="#" onclick="try{window.workspace.openHelp(\'_tbcode:'+t+"')} catch(e){alert('Não é possível abrir a ajuda fora do workspace Sankhya');}\">Código: "+t+"</a>"}processException(t){t.errorCode&&(t.message+=this.buildErrorCodeHTML(t.errorCode)),t instanceof a||t instanceof c?this._app.alert(t.title,t.message):t instanceof h?this._app.error(t.title,t.message):this._app.isDebugMode().then((s=>{if(s)if(t instanceof Error)this._app.error(t.name,t.message);else{const s=(null==t?void 0:t.title)||"Erro detectado",e="string"==typeof t?t:t.message||`Erro interno "${o.objectToString(t)}"`;this._app.error(s,e)}}))}}class K{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 s=setTimeout((()=>{this.ezLoadingBar.show()}),this._debounceTime);this.requests.set(t.requestId,s)}onRequestEnd(t){const s=this.requests.get(t.requestId);clearTimeout(s),this.requestsLoadingBar.includes(t.requestId)&&(this.requestsLoadingBar=this.requestsLoadingBar.filter((s=>s!==t.requestId)),!this.requestsLoadingBar.length&&this.ezLoadingBar.hide())}}class V{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:s}=t.requestBody[0].variables;if(s){const t=s.split(":");return this._ignoredNameTypes.indexOf(t[0])>=0}}return!1}}class W{static create({strategy:t}){switch(t){case"request_name":return new V;case"request_time":return new K;default:throw new Error("Strategy not found")}}}const G=class{constructor(e){t(this,e),this.applicationLoaded=s(this,"applicationLoaded",7),this.applicationLoading=s(this,"applicationLoading",7),this.NEW_VERSION_POPUP_LOCKER="NEW_VERSION_POPUP_LOCKER",this._authPromises=[],this._keyboardManager=new u,this._waitingAppReady=new Array,this._duCache=new Map,this._duPromises=new Map,this._requestListener=W.create({strategy:"request_time"}),this._pendingActions=new Map,this._loadPkParameter=null,this._isLoadedByPk=!1,this.messagesBuilder=void 0,this.configName=void 0,this.gridLegacyConfigName=void 0,this.formLegacyConfigName=void 0,this.loadByPK=void 0}async processPendingActions(t){const s=this._pendingActions.get(t);s&&s.length&&(s.forEach((t=>t())),this._pendingActions.set(t,[]))}get parameters(){return this._parameters||(this._parameters=new U),this._parameters}async getAuth(t){return null==t?this.getApplicationAuth():new Promise(((s,e)=>{this.authFetcher.getData(t).then((t=>{s(t)})).catch((t=>{e(t)}))}))}async getApplicationAuth(){return this._auth?Promise.resolve(this._auth):new Promise(((t,s)=>{const e=this._authPromises.length>0;this._authPromises.push(new J(t,s)),e||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,s){t&&this._loadPkParameter&&(this.loadByPK(this._loadPkParameter.pk,this._loadPkParameter.redirect),this._loadPkParameter=null)}async getKeyboardManager(){return Promise.resolve(this._keyboardManager)}async isUserSup(){return new Promise(((t,s)=>{this.getAuth().then((e=>{this.getAuthList(e).then((s=>{t(s.isSup)})).catch((t=>s(t)))}))}))}async addPendingAction(t,s){var e;const i=null!==(e=this._pendingActions.get(t))&&void 0!==e?e:[];this._pendingActions.set(t,[...i,s])}async callServiceBroker(t,s,e){return A.get().callServiceBroker(t,s,e)}async initOnboarding(t){this.hasToShowNewVersionPopup()?await this.addPendingAction(this.NEW_VERSION_POPUP_LOCKER,(()=>this.doInitOnboarding(t))):this.doInitOnboarding(t)}doInitOnboarding(t){l.getInstance().init(t,window.envContext)}async hasAccess(t,s){return new Promise(((e,i)=>{this.getAuth(s).then((s=>{this.getAuthList(s).then((s=>{e(s.isSup||s.actions[t])})).catch((t=>i(t)))}))}))}async getAllAccess(t){return new Promise(((s,e)=>{this.getAuth(t).then((t=>{this.getAuthList(t).then((t=>{const e={};e.isSup=t.isSup,Object.entries(S).forEach((s=>{e[s[0]]=t.actions[s[1]]||!1})),s(e)})).catch((t=>e(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,s="full",e=!0,i){this.clearContent(this._popUp),this._popUp.addEventListener("ezClosePopup",(()=>{i()}),{once:!0}),this._popUp.appendChild(t),this._popUp.opened=!0,this._popUp.heightMode=s,this._popUp.useHeader=e,"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 v.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 s=t.split(",");return new Promise(((t,e)=>{this.getAttributeFromHTMLWrapper("opc0009").then((i=>{"1"===i?t(!0):Promise.all(s.map((t=>this.getAttributeFromHTMLWrapper("opc"+t)))).then((s=>{t(s.includes("1"))})).catch((t=>{e(t)}))})).catch((t=>{e(t)}))}))}async getConfig(t){let s={serviceName:"SystemUtilsSP.getConf",requestBody:{config:{chave:t,tipo:"T"}}};return new Promise(((t,e)=>{A.get().callServiceBroker("SystemUtilsSP.getConf",JSON.stringify(s)).then((s=>{var e;return t(null===(e=s.config)||void 0===e?void 0:e.data)})).catch((t=>e(t)))}))}async saveConfig(t,s){let e={serviceName:"SystemUtilsSP.saveConf",requestBody:{config:{chave:t,tipo:"T",data:s}}};return new Promise(((t,s)=>{A.get().callServiceBroker("SystemUtilsSP.saveConf",JSON.stringify(e)).then((s=>t(s))).catch((t=>s(t)))}))}async getAttributeFromHTMLWrapper(t){return Promise.resolve(window[t])}async openApp(t,s){B.openAppActivity(t,s)}async webConnection(t,s,e){this.getStringParam(t).then((t=>{L.webConnectionCaller(t,s,e)}))}getDuPromissesStack(t){let s;return t&&(s=this._duPromises.get(t),s||(s=[],this._duPromises.set(t,s))),s||[]}async createDataunit(t,s,e,i,n){return null==n&&(n=this.applicationResourceID),new Promise(((r,o)=>{const a=this.getDuPromissesStack(s),c=a.length>0;if(a.push(new J(r,o)),!c){const r=this.dataUnitFetcher.getDataUnit(t,n,e,i);r.loadMetadata().then((()=>{this.processResolveDataUnit(r,s,a)})).catch((t=>{for(;a.length>0;)a.pop().reject(t)}))}}))}processResolveDataUnit(t,s,e){for(s&&this.updateDataunitCache(void 0,s,t);e.length>0;)e.pop().resolve(t)}async updateDataunitCache(t,s,e){t&&this._duCache.delete(t),this._duCache.set(s,e)}async getDataUnit(t,s,e,i,n){return new Promise(((r,o)=>{const a=this._duCache.get(s);a?r(a):this.createDataunit(t,s,e,i,n).then((t=>{r(t)})).catch((t=>o(t)))}))}async addClientEvent(t,s){return new Promise((e=>{A.addClientEvent(t,s),e()}))}async removeClientEvent(t){return new Promise((s=>{A.removeClientEvent(t),s()}))}async hasClientEvent(t){return new Promise((s=>{s(A.hasClientEvent(t))}))}get applicationResourceID(){return this._applicationResourceID||(this._applicationResourceID=this.urlParams.get("workspaceResourceID")||this.urlParams.get("resourceID")||B.resourceID||"unknown.resource.id"),this._applicationResourceID}async getResourceID(){return Promise.resolve(this.applicationResourceID)}async getUserID(){return Promise.resolve(window.UID)}async alert(t,s,e,i){return v.alert(t,s,e,i)}async error(t,s,e,i){return v.error(t,s,e,i)}async success(t,s,e,i){return v.success(t,s,e,i)}async message(t,s,e,i){return v.message(t,s,e,i)}async confirm(t,s,e,i,n){return v.confirm(t,s,e,i,n)}async info(t,s){return v.info(t,s)}async loadTotals(t,s,e){return this.totalsFetcher.fetchTotals(t,s,e)}async isLoadedByPk(){return Promise.resolve(this._isLoadedByPk)}async preloadMangerRemoveRecord(t,s){const e=s.map((t=>({__record__id__:t})));b.removeRecords(t,e)}async getAuthList(t){return await(new R).parseFromJSON(t)}get urlParams(){return this._urlParams||(this._urlParams=I.getQueryParams(location.search)),this._urlParams}getMessage(t,s){var e;return null===(e=this.messagesBuilder)||void 0===e?void 0:e.getMessage(t,s)}get dataUnitFetcher(){return this._dataUnitFetcher||(this._dataUnitFetcher=new C),this._dataUnitFetcher}get totalsFetcher(){return this._totalsFetcher||(this._totalsFetcher=new j),this._totalsFetcher}get pesquisaFetcher(){return this._pesquisaFetcher||(this._pesquisaFetcher=new E),this._pesquisaFetcher}get authFetcher(){return this._authFetcher||(this._authFetcher=new N),this._authFetcher}async executeSearch(t,s,e,i){const n=null==e?void 0:e.getField(s);if(n){const{mode:s,argument:r}=t,{ENTITYNAME:o,CODEFIELD:a,DESCRIPTIONFIELD:c,ROOTENTITY:h,DESCRIPTIONENTITY:u,ISHIERARCHYENTITY:l}=n.properties,d=n.dependencies;let w;const m={rootEntity:h,descriptionFieldName:c,codeFieldName:a,showInactives:!1,dataUnitId:e.dataUnitId};return null==d||d.filter((t=>t.masterFields)).forEach((t=>{var s;t.type===p.SEARCHING&&(null===(s=t.masterFields)||void 0===s?void 0:s.length)>0&&(w={expression:t.expression,params:t.masterFields.map((t=>{const s=e.getField(t),i=(null==s?void 0:s.dataType)||f.TEXT,n=e.getFieldValue(t);if(null==n)throw this.alert("Erro ao pesquisar",`É necessario informar o campo ${s.label} para executar a pesquisa.`),new Error(`É necessario informar o campo ${s.label} para executar a pesquisa.`);return{name:t,value:n,dataType:i}}))})})),this.executePreparedSearch(s,r,{entity:o,entityDescription:u,isHierarchyEntity:l,criteria:w,searchOptions:m,allowsNonAnalytic:null==i?void 0:i.allowsNonAnalytic})}}filterInvalidFields(t,s,e){return t.fieldsMetadata.filter((i=>{let n=!r.isEmpty(s[i.fieldName])&&!1!==i.visible&&"B"!==i.type&&t.pkField!==i.fieldName&&t.descriptionField!==i.fieldName&&(i.isPrimaryKey||!i.isLinkField)&&!("S"===i.type&&"H"===i.presentationType);return n&&(e[i.fieldName]=i),("string"!=typeof s[i.fieldName]||!(s[i.fieldName].indexOf("<img")>-1||s[i.fieldName].indexOf("<svg")>-1))&&n}))}filterMathFields(t,s,e,i){return t&&Array.isArray(t)&&t.forEach((t=>{let e=d.removeReference(s,i[t]);e&&s.unshift(e)})),s=s.slice(0,e)}builOptionItem(t,s,e,i,n){var o;return{value:r.highlightValue(t,s.__matchFields,null===(o=s[n])||void 0===o?void 0:o.toString(),e,!0),label:i?r.highlightValue(t,s.__matchFields,s[i],e,!0):"",details:w.buildDetails(t,e,s)}}async executePreparedSearch(t,s,e){const i={},{entity:n,entityDescription:r,criteria:a,searchOptions:c,isHierarchyEntity:h,allowsNonAnalytic:u}=e;return new Promise("ADVANCED"===t?(t,e)=>{const i=document.createElement("snk-pesquisa");i[m.DATA_ELEMENT_ID_ATTRIBUTE_NAME]=`entity_${n}`,i.entityName=n,i.argument=s,i.searchLoader=t=>this.pesquisaFetcher.loadAdvancedSearch(n,t,a,c),i.isHierarchyEntity=h,h&&(i.treeLoader=t=>this.pesquisaFetcher.loadTree(n,t,a,c),i.allowsNonAnalytic=u),i.selectItem=s=>{t(s),this.clearPopUpTitle(),this.closePopUp()},this.setPopUpTitle(r),this.showPopUp(i,void 0,void 0,e)}:(t,e)=>{this.pesquisaFetcher.loadAdvancedSearch(n,s,a,c).then((e=>{let n=(e=o.stringToObject(e.json.$)).descriptionField,r=e.pkField;const a=[];e.data.forEach((t=>{let o=this.filterInvalidFields(e,t,i),c=this.filterMathFields(t.__matchFields,o,6,i);a.push(this.builOptionItem(s,t,c,n,r))})),t(a)})).catch((t=>{e(t)}))})}async isDebugMode(){return new Promise((t=>{t(window.isDebugMode)}))}async getAppLabel(){return B.getAppLabel(this.applicationResourceID)}addSearchListener(t,s,e){return new Promise((i=>{i(this.pesquisaFetcher.addSearchListener(t,s.dataUnitId,e))}))}importScript(t){return new Promise((s=>{this.getApplicationPath().then((e=>{let i=[];Array.isArray(t)||(i=[t]),i.forEach((t=>{const s=document.createElement("script");s.src=`${e}/${t}`,s.async=!0,document.body.appendChild(s)})),s()}))}))}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,s,e){return this.dataUnitFetcher.loadSelectDistinct(t,s,e)}getDataFetcher(){return Promise.resolve(A.get())}async whenApplicationReady(){return y.getContextValue("__SNK__APPLICATION__LOADING__")?Promise.resolve(this):new Promise((t=>{this._waitingAppReady.push((()=>t(this)))}))}async setSearchFilterContext(t,s){y.setContextValue(`__SNK__APPLICATION__FILTER__CONTEXT(${t})__`,s)}clearContent(t){t&&Array.from(t.children).forEach((s=>{t.removeChild(s)}))}clearPopUpTitle(){this._popUp.ezTitle=""}setPopUpTitle(t){this._popUp.ezTitle=t}async pkChangeListener(){const t=top.window.location.hash.split("/")[2];if(this._currentPkParameter===t)return;const s=this.getResourceIdFromToken(),e=I.getPkObjectFromUrlToken(top.window.location.hash),i=window.redirectFrom;if(void 0===e)return;if((!i||-1===i.split("_")[0].indexOf(s.split("_")[0]))&&s!==this.applicationResourceID)return;const n={pk:e};if(this._isLoadedByPk=!0,this.loadByPK)return this.loadByPK(n,i),void(this._currentPkParameter=t);this._loadPkParameter={pk:n,redirect:i},this.defaultLoadByPK(n,t)}getResourceIdFromToken(){return top.window.location.pathname.indexOf("tabContent.jsp")>-1?I.getResourceIdFromUrlToken(window.location.generateHash(window.location.hash)):I.getResourceIdFromUrlToken(top.window.location.hash)}defaultLoadByPK(t,s){if(!(null==t?void 0:t.pk))return;const e=this.getFirstDataUnitFromDOM(),i=e.dataUnit;if(!i)return console.warn("Dataunit não inicializado"),void e.addEventListener("dataUnitReady",(e=>{this.loadDataWithPKFilter(t,e.detail),this._currentPkParameter=s}));this.loadDataWithPKFilter(t,i),this._currentPkParameter=s}loadDataWithPKFilter(t,s){const e={term:"",filter:{name:"LOAD_BY_PK_FILTER",expression:this.buildFilterExpressionByPkObject(t),params:this.getFilterParamsFromPkObject(t,s)}};s.loadData(e)}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,s){var e;const i=[];for(const n in t.pk)t.pk.hasOwnProperty(n)&&!Array.isArray(t.pk[n])&&i.push({name:n,dataType:(null===(e=s.getField(n))||void 0===e?void 0:e.dataType)||this.getDefaultDataTypeLoadByPK(t.pk[n]),value:t.pk[n]});return i}getDefaultDataTypeLoadByPK(t){return"number"==typeof t||t instanceof Number?f.NUMBER:"boolean"==typeof t||t instanceof Boolean?f.BOOLEAN:t instanceof Date?f.DATE:f.TEXT}buildFilterExpressionByPkObject(t){let s="";for(const e in t.pk)r.isEmpty(s)||(s+=" AND "),Array.isArray(t.pk[e])?s+=`${e} IN (${t.pk[e].toString()})`:s+=`${e} = :${e}`;return s}async showNewVersionPopup(){const t=document.createElement("ez-modal-container"),s=await this.getAppLabel();t.modalTitle=this.getMessage("snkApplication.newVersionPopup.title",{screenName:s}),t.okButtonLabel=this.getMessage("snkApplication.newVersionPopup.okButton"),t.cancelButtonLabel=this.getMessage("snkApplication.newVersionPopup.cancelButton");const e=document.createElement("p");e.innerText=this.getMessage("snkApplication.newVersionPopup.info"),e.className="ez-text",t.appendChild(e),t.addEventListener("ezModalAction",this.newVersionPopupEventListener.bind(this));const i=await v.showPopup({content:t});this._removeVersionLayoutPopup=async()=>{await i(),await this.processPendingActions(this.NEW_VERSION_POPUP_LOCKER)}}async newVersionPopupEventListener(t){"LOAD"!==t.detail&&("OK"===t.detail&&B.setScreenToUseV3Layout(),"CANCEL"===t.detail&&B.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(){y.setContextValue("__SNK__APPLICATION__LOADING__",!0),this._errorHandler=new H(this),this.messagesBuilder=new T,y.setContextValue("__EZUI__UPLOAD__ADD__URL__",`${I.getUrlBase()}/mge/upload/file`),y.setContextValue("__EZUI__SEARCH__OPTION__LOADER__",((t,s,e,i)=>this.executeSearch(t,s,e,i))),y.setContextValue("__EZUI__GRID_LICENSE__",z),this.registerPkChangeListener(),P.init(),_.preload(this.applicationResourceID,this.configName,{gridLegacyConfig:this.gridLegacyConfigName,formLegacyConfig:this.formLegacyConfigName}),document.addEventListener("click",(()=>B.applicationClick())),this._waitingAppReady.forEach((t=>t()))}connectedCallback(){y.setContextValue("__SNK__APPLICATION__",this),A.addRequestListener(this._requestListener)}disconnectedCallback(){A.removeRequestListener(this._requestListener),this.removeShortcuts()}async componentDidLoad(){this.applicationLoading.emit(!0),window.requestAnimationFrame((()=>{y.setContextValue("__SNK__APPLICATION__LOADING__",!1),this.applicationLoaded.emit(!0),this.pkChangeListener()})),m.addIDInfo(this._element,`resource_${this.applicationResourceID}`),await this.handleShowNewVersionPopup(),this.initKeyboardManager()}initKeyboardManager(){this._keyboardManager.bind("ctrl + g",B.searchApp.bind(this),{description:"Pesquisar por telas"}).bind("ctrl + d",B.showDesktop.bind(this),{description:"Mostrar o desktop"}).bind("F1",B.openHelp.bind(this),{description:"Abrir ajuda"})}removeShortcuts(){this._keyboardManager.unbind("ctrl + g").unbind("ctrl + d").unbind("F1")}render(){return e("div",null,e("ez-loading-bar",{ref:t=>this._requestListener.ezLoadingBar=t}),e("ez-popup",{opened:!1,ref:t=>this._popUp=t,onEzClosePopup:()=>this.closePopUp()}),e("ez-modal",{opened:!1,ref:t=>this._rightModal=t,"modal-size":"small",closeOutsideClick:!0,closeEsc:!0}))}get _element(){return i(this)}static get watchers(){return{loadByPK:["watchPropHandler"]}}};class J{constructor(t,s){this.resolve=t,this.reject=s}}G.style=".sc-snk-application-h{display:flex;flex-direction:column;height:100%}";export{G as snk_application}
Binary file