@sankhyalabs/sankhyablocks 8.16.0-rc.33 → 8.16.0-rc.35

Sign up to get free protection for your applications and to get access to all the features.
Files changed (753) hide show
  1. package/dist/cjs/AuthorizationConfig-79ffae4b.js.gz +0 -0
  2. package/dist/cjs/ConfigStorage-9b965af9.js.gz +0 -0
  3. package/dist/cjs/{ContinuousInsertUtils-414b772c.js → ContinuousInsertUtils-a6139f3d.js} +2 -2
  4. package/dist/cjs/ContinuousInsertUtils-a6139f3d.js.gz +0 -0
  5. package/dist/cjs/DataFetcher-e059eb72.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-51caf3d0.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-a78242d1.js.gz +0 -0
  16. package/dist/cjs/constants-35ddd366.js.gz +0 -0
  17. package/dist/cjs/{dataunit-fetcher-228016f4.js → dataunit-fetcher-0121621c.js} +1 -1
  18. package/dist/cjs/dataunit-fetcher-0121621c.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-91fba2b1.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 +4 -0
  29. package/dist/cjs/index-f9e81701.js.gz +0 -0
  30. package/dist/cjs/index.cjs.js.gz +0 -0
  31. package/dist/cjs/loader.cjs.js +1 -1
  32. package/dist/cjs/loader.cjs.js.gz +0 -0
  33. package/dist/cjs/{pesquisa-fetcher-2ec4811b.js → pesquisa-fetcher-a85d6935.js} +175 -0
  34. package/dist/cjs/pesquisa-fetcher-a85d6935.js.gz +0 -0
  35. package/dist/cjs/pesquisa-grid_2.cjs.entry.js +127 -0
  36. package/dist/cjs/pesquisa-grid_2.cjs.entry.js.gz +0 -0
  37. package/dist/cjs/presentationMode-52ec3bdd.js.gz +0 -0
  38. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  39. package/dist/cjs/sankhyablocks.cjs.js.gz +0 -0
  40. package/dist/cjs/snk-actions-button_5.cjs.entry.js +6 -6
  41. package/dist/cjs/snk-actions-button_5.cjs.entry.js.gz +0 -0
  42. package/dist/cjs/snk-actions-form.cjs.entry.js.gz +0 -0
  43. package/dist/cjs/snk-application.cjs.entry.js +23 -8
  44. package/dist/cjs/snk-application.cjs.entry.js.gz +0 -0
  45. package/dist/cjs/snk-attach.cjs.entry.js +2 -2
  46. package/dist/cjs/snk-attach.cjs.entry.js.gz +0 -0
  47. package/dist/cjs/snk-client-confirm.cjs.entry.js.gz +0 -0
  48. package/dist/cjs/snk-config-options_3.cjs.entry.js.gz +0 -0
  49. package/dist/cjs/snk-configurator.cjs.entry.js.gz +0 -0
  50. package/dist/cjs/snk-crud.cjs.entry.js +2 -2
  51. package/dist/cjs/snk-crud.cjs.entry.js.gz +0 -0
  52. package/dist/cjs/snk-custom-slot-elements.cjs.entry.js.gz +0 -0
  53. package/dist/cjs/snk-data-exporter.cjs.entry.js +3 -3
  54. package/dist/cjs/snk-data-exporter.cjs.entry.js.gz +0 -0
  55. package/dist/cjs/{snk-data-unit-3d9b6ed4.js → snk-data-unit-c699179d.js} +1 -1
  56. package/dist/cjs/snk-data-unit-c699179d.js.gz +0 -0
  57. package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
  58. package/dist/cjs/snk-data-unit.cjs.entry.js.gz +0 -0
  59. package/dist/cjs/snk-detail-view.cjs.entry.js +3 -3
  60. package/dist/cjs/snk-detail-view.cjs.entry.js.gz +0 -0
  61. package/dist/cjs/snk-entity-list.cjs.entry.js.gz +0 -0
  62. package/dist/cjs/snk-exporter-email-sender.cjs.entry.js.gz +0 -0
  63. package/dist/cjs/snk-expression-group_2.cjs.entry.js.gz +0 -0
  64. package/dist/cjs/snk-field-config.cjs.entry.js.gz +0 -0
  65. package/dist/cjs/snk-filter-advanced-mode_2.cjs.entry.js.gz +0 -0
  66. package/dist/cjs/snk-filter-bar_4.cjs.entry.js.gz +0 -0
  67. package/dist/cjs/snk-filter-binary-select.cjs.entry.js.gz +0 -0
  68. package/dist/cjs/snk-filter-checkbox-list.cjs.entry.js.gz +0 -0
  69. package/dist/cjs/snk-filter-detail.cjs.entry.js.gz +0 -0
  70. package/dist/cjs/snk-filter-field-search_2.cjs.entry.js.gz +0 -0
  71. package/dist/cjs/snk-filter-modal-item.cjs.entry.js.gz +0 -0
  72. package/dist/cjs/snk-filter-multi-select.cjs.entry.js.gz +0 -0
  73. package/dist/cjs/snk-filter-number.cjs.entry.js.gz +0 -0
  74. package/dist/cjs/snk-filter-period.cjs.entry.js.gz +0 -0
  75. package/dist/cjs/snk-filter-search.cjs.entry.js.gz +0 -0
  76. package/dist/cjs/snk-filter-text.cjs.entry.js.gz +0 -0
  77. package/dist/cjs/snk-form-summary.cjs.entry.js.gz +0 -0
  78. package/dist/cjs/snk-form-view.cjs.entry.js.gz +0 -0
  79. package/dist/cjs/snk-grid.cjs.entry.js +3 -3
  80. package/dist/cjs/snk-grid.cjs.entry.js.gz +0 -0
  81. package/dist/cjs/{snk-guides-viewer-421555af.js → snk-guides-viewer-575596a2.js} +2 -2
  82. package/dist/cjs/snk-guides-viewer-575596a2.js.gz +0 -0
  83. package/dist/cjs/snk-guides-viewer.cjs.entry.js +3 -3
  84. package/dist/cjs/snk-guides-viewer.cjs.entry.js.gz +0 -0
  85. package/dist/cjs/snk-personalized-filter-editor.cjs.entry.js.gz +0 -0
  86. package/dist/cjs/snk-personalized-filter.cjs.entry.js.gz +0 -0
  87. package/dist/cjs/snk-pesquisa.cjs.entry.js +105 -31
  88. package/dist/cjs/snk-pesquisa.cjs.entry.js.gz +0 -0
  89. package/dist/cjs/snk-print-selector.cjs.entry.js.gz +0 -0
  90. package/dist/cjs/snk-simple-bar.cjs.entry.js.gz +0 -0
  91. package/dist/cjs/snk-simple-crud.cjs.entry.js +3 -3
  92. package/dist/cjs/snk-simple-crud.cjs.entry.js.gz +0 -0
  93. package/dist/cjs/snk-tab-config.cjs.entry.js.gz +0 -0
  94. package/dist/cjs/snk-taskbar.cjs.entry.js.gz +0 -0
  95. package/dist/cjs/taskbar-elements-9ad1f9c0.js.gz +0 -0
  96. package/dist/cjs/teste-pesquisa.cjs.entry.js.gz +0 -0
  97. package/dist/collection/collection-manifest.json +2 -0
  98. package/dist/collection/components/snk-actions-button/actions/enum/ActionsType.js.gz +0 -0
  99. package/dist/collection/components/snk-actions-button/actions/enum/ParamType.js.gz +0 -0
  100. package/dist/collection/components/snk-actions-button/actions/enum/RefreshType.js.gz +0 -0
  101. package/dist/collection/components/snk-actions-button/actions/executor/java.executor.js.gz +0 -0
  102. package/dist/collection/components/snk-actions-button/actions/executor/javascript.executor.js.gz +0 -0
  103. package/dist/collection/components/snk-actions-button/actions/executor/launch-screen.executor.js.gz +0 -0
  104. package/dist/collection/components/snk-actions-button/actions/executor/procedure.executor.js.gz +0 -0
  105. package/dist/collection/components/snk-actions-button/actions/factory/executor.factory.js.gz +0 -0
  106. package/dist/collection/components/snk-actions-button/actions/index.js +4 -4
  107. package/dist/collection/components/snk-actions-button/actions/index.js.gz +0 -0
  108. package/dist/collection/components/snk-actions-button/actions/interfaces/IAction.js.gz +0 -0
  109. package/dist/collection/components/snk-actions-button/actions/interfaces/IExecSource.js.gz +0 -0
  110. package/dist/collection/components/snk-actions-button/actions/interfaces/IExecuteActions.js.gz +0 -0
  111. package/dist/collection/components/snk-actions-button/actions/interfaces/IExecuteActionsProps.js.gz +0 -0
  112. package/dist/collection/components/snk-actions-button/actions/interfaces/IResultParam.js.gz +0 -0
  113. package/dist/collection/components/snk-actions-button/clientEvent/index.js.gz +0 -0
  114. package/dist/collection/components/snk-actions-button/clientEvent/interfaces/IClientEventConfirm.js.gz +0 -0
  115. package/dist/collection/components/snk-actions-button/interfaces/index.js.gz +0 -0
  116. package/dist/collection/components/snk-actions-button/snk-actions-button.css.gz +0 -0
  117. package/dist/collection/components/snk-actions-button/snk-actions-button.js.gz +0 -0
  118. package/dist/collection/components/snk-actions-button/subcomponents/snk-actions-form.js.gz +0 -0
  119. package/dist/collection/components/snk-actions-button/subcomponents/snk-client-confirm.js.gz +0 -0
  120. package/dist/collection/components/snk-application/__mocks__/snk-application.js.gz +0 -0
  121. package/dist/collection/components/snk-application/errorhandler/snk-error-handler.js.gz +0 -0
  122. package/dist/collection/components/snk-application/request-listener/DebouncedRequestListener.js.gz +0 -0
  123. package/dist/collection/components/snk-application/request-listener/RequestListenerFactory.js.gz +0 -0
  124. package/dist/collection/components/snk-application/request-listener/RequestListenerLoadingBar.js.gz +0 -0
  125. package/dist/collection/components/snk-application/snk-application.css.gz +0 -0
  126. package/dist/collection/components/snk-application/snk-application.js +25 -7
  127. package/dist/collection/components/snk-application/snk-application.js.gz +0 -0
  128. package/dist/collection/components/snk-attach/interfaces/ICrudConfig.js.gz +0 -0
  129. package/dist/collection/components/snk-attach/interfaces/TFetcherType.js.gz +0 -0
  130. package/dist/collection/components/snk-attach/interfaces/index.js.gz +0 -0
  131. package/dist/collection/components/snk-attach/snk-attach.css.gz +0 -0
  132. package/dist/collection/components/snk-attach/snk-attach.js.gz +0 -0
  133. package/dist/collection/components/snk-attach/structure/builder/anexo-sistema-crud-config.builder.js.gz +0 -0
  134. package/dist/collection/components/snk-attach/structure/builder/attach-crud-config.builder.js.gz +0 -0
  135. package/dist/collection/components/snk-attach/structure/builder/taskbar-builder.js.gz +0 -0
  136. package/dist/collection/components/snk-attach/structure/fetcher/facade/fetcher.facade.js.gz +0 -0
  137. package/dist/collection/components/snk-attach/structure/fetcher/factory/anexo-sistema-data-unit.factory.js.gz +0 -0
  138. package/dist/collection/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.js.gz +0 -0
  139. package/dist/collection/components/snk-attach/structure/index.js.gz +0 -0
  140. package/dist/collection/components/snk-configurator/AuthorizationConfig.js.gz +0 -0
  141. package/dist/collection/components/snk-configurator/snk-configurator.css.gz +0 -0
  142. package/dist/collection/components/snk-configurator/snk-configurator.js.gz +0 -0
  143. package/dist/collection/components/snk-crud/interfaces/PropsCustomEditor.js.gz +0 -0
  144. package/dist/collection/components/snk-crud/interfaces/PropsCustomRender.js.gz +0 -0
  145. package/dist/collection/components/snk-crud/snk-crud.css.gz +0 -0
  146. package/dist/collection/components/snk-crud/snk-crud.js.gz +0 -0
  147. package/dist/collection/components/snk-crud/subcomponents/CardFormResizeObserver.js.gz +0 -0
  148. package/dist/collection/components/snk-crud/subcomponents/GuideBuilder.js.gz +0 -0
  149. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.css.gz +0 -0
  150. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js.gz +0 -0
  151. package/dist/collection/components/snk-crud/subcomponents/snk-form-summary.css.gz +0 -0
  152. package/dist/collection/components/snk-crud/subcomponents/snk-form-summary.js.gz +0 -0
  153. package/dist/collection/components/snk-crud/subcomponents/snk-form-view.css.gz +0 -0
  154. package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js.gz +0 -0
  155. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.css.gz +0 -0
  156. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js.gz +0 -0
  157. package/dist/collection/components/snk-custom-slot-elements/snk-custom-slot-elements.css.gz +0 -0
  158. package/dist/collection/components/snk-custom-slot-elements/snk-custom-slot-elements.js.gz +0 -0
  159. package/dist/collection/components/snk-data-exporter/data/attachment.js.gz +0 -0
  160. package/dist/collection/components/snk-data-exporter/data/email.js.gz +0 -0
  161. package/dist/collection/components/snk-data-exporter/data/export-config.js.gz +0 -0
  162. package/dist/collection/components/snk-data-exporter/data/export-result.js.gz +0 -0
  163. package/dist/collection/components/snk-data-exporter/data/report.js.gz +0 -0
  164. package/dist/collection/components/snk-data-exporter/exporter-email-sender/email-info-step.js.gz +0 -0
  165. package/dist/collection/components/snk-data-exporter/exporter-email-sender/options-step.js.gz +0 -0
  166. package/dist/collection/components/snk-data-exporter/exporter-email-sender/snk-exporter-email-sender.js.gz +0 -0
  167. package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js.gz +0 -0
  168. package/dist/collection/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.js.gz +0 -0
  169. package/dist/collection/components/snk-data-exporter/interfaces/IExporterProvider.js.gz +0 -0
  170. package/dist/collection/components/snk-data-exporter/interfaces/IExporterStrategy.js.gz +0 -0
  171. package/dist/collection/components/snk-data-exporter/interfaces/IRecordID.js.gz +0 -0
  172. package/dist/collection/components/snk-data-exporter/interfaces/ISelectedID.js.gz +0 -0
  173. package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js.gz +0 -0
  174. package/dist/collection/components/snk-data-exporter/providers/ServerSideExporterProvider.js.gz +0 -0
  175. package/dist/collection/components/snk-data-exporter/snk-data-exporter.css.gz +0 -0
  176. package/dist/collection/components/snk-data-exporter/snk-data-exporter.js.gz +0 -0
  177. package/dist/collection/components/snk-data-exporter/structure/ItemBuilder.js.gz +0 -0
  178. package/dist/collection/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.js.gz +0 -0
  179. package/dist/collection/components/snk-data-exporter/utils/ParserExport.js.gz +0 -0
  180. package/dist/collection/components/snk-data-unit/snk-data-unit.js.gz +0 -0
  181. package/dist/collection/components/snk-data-unit/test/resources/metadataMock.js.gz +0 -0
  182. package/dist/collection/components/snk-data-unit/test/resources/parentMetadataMock.js.gz +0 -0
  183. package/dist/collection/components/snk-entity-list/snk-entity-list.css.gz +0 -0
  184. package/dist/collection/components/snk-entity-list/snk-entity-list.js.gz +0 -0
  185. package/dist/collection/components/snk-filter-bar/filter-item/dataunitfilter/data-unit-filter-builder.js.gz +0 -0
  186. package/dist/collection/components/snk-filter-bar/filter-item/editors/enum/filterNumberVariation.js.gz +0 -0
  187. package/dist/collection/components/snk-filter-bar/filter-item/editors/enum/presentationMode.js.gz +0 -0
  188. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.js.gz +0 -0
  189. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-checkbox-list.js.gz +0 -0
  190. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.js.gz +0 -0
  191. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js.gz +0 -0
  192. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js.gz +0 -0
  193. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-search.js.gz +0 -0
  194. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js.gz +0 -0
  195. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-personalized-filter-editor/snk-personalized-filter-editor.css.gz +0 -0
  196. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-personalized-filter-editor/snk-personalized-filter-editor.js.gz +0 -0
  197. package/dist/collection/components/snk-filter-bar/filter-item/filter-item-type-mask.enum.js.gz +0 -0
  198. package/dist/collection/components/snk-filter-bar/filter-item/filter-item-type.enum.js.gz +0 -0
  199. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js.gz +0 -0
  200. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js.gz +0 -0
  201. package/dist/collection/components/snk-filter-bar/filter-list/snk-filter-list.js.gz +0 -0
  202. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.css.gz +0 -0
  203. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js.gz +0 -0
  204. package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.css.gz +0 -0
  205. package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js.gz +0 -0
  206. package/dist/collection/components/snk-filter-bar/snk-filter-bar.css.gz +0 -0
  207. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js.gz +0 -0
  208. package/dist/collection/components/snk-filter-bar/types/custom-element-filter.js.gz +0 -0
  209. package/dist/collection/components/snk-filter-bar/types/filter-type.enum.js.gz +0 -0
  210. package/dist/collection/components/snk-filter-bar/utils/SnkFilterModalFactory.js.gz +0 -0
  211. package/dist/collection/components/snk-filter-bar/utils/filters-mock.js.gz +0 -0
  212. package/dist/collection/components/snk-filter-field-search/interfaces/index.js.gz +0 -0
  213. package/dist/collection/components/snk-filter-field-search/snk-filter-field-search.css.gz +0 -0
  214. package/dist/collection/components/snk-filter-field-search/snk-filter-field-search.js.gz +0 -0
  215. package/dist/collection/components/snk-filter-field-search/subcomponents/index.js.gz +0 -0
  216. package/dist/collection/components/snk-filter-field-search/subcomponents/list-item.js.gz +0 -0
  217. package/dist/collection/components/snk-form/snk-form.css.gz +0 -0
  218. package/dist/collection/components/snk-form/snk-form.js.gz +0 -0
  219. package/dist/collection/components/snk-form-config/SnkFormConfigManager.js.gz +0 -0
  220. package/dist/collection/components/snk-form-config/snk-form-config.css.gz +0 -0
  221. package/dist/collection/components/snk-form-config/snk-form-config.js.gz +0 -0
  222. package/dist/collection/components/snk-form-config/subcomponents/snk-config-options/snk-config-options.css.gz +0 -0
  223. package/dist/collection/components/snk-form-config/subcomponents/snk-config-options/snk-config-options.js.gz +0 -0
  224. package/dist/collection/components/snk-form-config/subcomponents/snk-field-config/snk-field-config.css.gz +0 -0
  225. package/dist/collection/components/snk-form-config/subcomponents/snk-field-config/snk-field-config.js.gz +0 -0
  226. package/dist/collection/components/snk-form-config/subcomponents/snk-tab-config/snk-tab-config.css.gz +0 -0
  227. package/dist/collection/components/snk-form-config/subcomponents/snk-tab-config/snk-tab-config.js.gz +0 -0
  228. package/dist/collection/components/snk-grid/filtercolumn/SnkMultiSelectionListDataSource.js.gz +0 -0
  229. package/dist/collection/components/snk-grid/snk-grid.css.gz +0 -0
  230. package/dist/collection/components/snk-grid/snk-grid.js.gz +0 -0
  231. package/dist/collection/components/snk-grid-config/snk-grid-config.css.gz +0 -0
  232. package/dist/collection/components/snk-grid-config/snk-grid-config.js.gz +0 -0
  233. package/dist/collection/components/snk-grid-config/snk-select-box/snk-select-box.css.gz +0 -0
  234. package/dist/collection/components/snk-grid-config/snk-select-box/snk-select-box.js.gz +0 -0
  235. package/dist/collection/components/snk-personalized-filter/interfaces/IExpressionGroup.js.gz +0 -0
  236. package/dist/collection/components/snk-personalized-filter/interfaces/IExpressionItem.js.gz +0 -0
  237. package/dist/collection/components/snk-personalized-filter/interfaces/IParameter.js.gz +0 -0
  238. package/dist/collection/components/snk-personalized-filter/interfaces/IPersonalizedFilter.js.gz +0 -0
  239. package/dist/collection/components/snk-personalized-filter/interfaces/ISystemFilterConfig.js.gz +0 -0
  240. package/dist/collection/components/snk-personalized-filter/interfaces/IUserFilterConfig.js.gz +0 -0
  241. package/dist/collection/components/snk-personalized-filter/interfaces/index.js.gz +0 -0
  242. package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.css.gz +0 -0
  243. package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js.gz +0 -0
  244. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-group/snk-expression-group.css.gz +0 -0
  245. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-group/snk-expression-group.js.gz +0 -0
  246. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/filter-operands/filter-operands.js.gz +0 -0
  247. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.css.gz +0 -0
  248. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.js.gz +0 -0
  249. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-advanced-mode/snk-filter-advanced-mode.css.gz +0 -0
  250. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-advanced-mode/snk-filter-advanced-mode.js.gz +0 -0
  251. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-assistent-mode/snk-filter-assistent-mode.css.gz +0 -0
  252. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-assistent-mode/snk-filter-assistent-mode.js.gz +0 -0
  253. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/snk-filter-param-config.css.gz +0 -0
  254. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/snk-filter-param-config.js.gz +0 -0
  255. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/utils/PersonalizedFilterUtils.js.gz +0 -0
  256. package/dist/collection/components/snk-pesquisa/pesquisa-grid/pesquisa-grid.css +10 -0
  257. package/dist/collection/components/snk-pesquisa/pesquisa-grid/pesquisa-grid.css.gz +0 -0
  258. package/dist/collection/components/snk-pesquisa/pesquisa-grid/pesquisa-grid.js +190 -0
  259. package/dist/collection/components/snk-pesquisa/pesquisa-grid/pesquisa-grid.js.gz +0 -0
  260. package/dist/collection/components/snk-pesquisa/pesquisa-tree/pesquisa-tree.css +25 -0
  261. package/dist/collection/components/snk-pesquisa/pesquisa-tree/pesquisa-tree.css.gz +0 -0
  262. package/dist/collection/components/snk-pesquisa/pesquisa-tree/pesquisa-tree.js +173 -0
  263. package/dist/collection/components/snk-pesquisa/pesquisa-tree/pesquisa-tree.js.gz +0 -0
  264. package/dist/collection/components/snk-pesquisa/pesquisaHelper.js +89 -0
  265. package/dist/collection/components/snk-pesquisa/pesquisaHelper.js.gz +0 -0
  266. package/dist/collection/components/snk-pesquisa/snk-pesquisa.css +24 -5
  267. package/dist/collection/components/snk-pesquisa/snk-pesquisa.css.gz +0 -0
  268. package/dist/collection/components/snk-pesquisa/snk-pesquisa.js +168 -32
  269. package/dist/collection/components/snk-pesquisa/snk-pesquisa.js.gz +0 -0
  270. package/dist/collection/components/snk-print-selector/snk-print-selector.css.gz +0 -0
  271. package/dist/collection/components/snk-print-selector/snk-print-selector.js.gz +0 -0
  272. package/dist/collection/components/snk-simple-bar/snk-simple-bar.css.gz +0 -0
  273. package/dist/collection/components/snk-simple-bar/snk-simple-bar.js.gz +0 -0
  274. package/dist/collection/components/snk-simple-crud/regular-buttons.js.gz +0 -0
  275. package/dist/collection/components/snk-simple-crud/snk-simple-crud.css.gz +0 -0
  276. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js.gz +0 -0
  277. package/dist/collection/components/snk-simple-form-config/snk-simple-form-config.css.gz +0 -0
  278. package/dist/collection/components/snk-simple-form-config/snk-simple-form-config.js.gz +0 -0
  279. package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.css.gz +0 -0
  280. package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.js.gz +0 -0
  281. package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js.gz +0 -0
  282. package/dist/collection/components/snk-taskbar/processor/taskbar-processor.js.gz +0 -0
  283. package/dist/collection/components/snk-taskbar/snk-taskbar.css.gz +0 -0
  284. package/dist/collection/components/snk-taskbar/snk-taskbar.js.gz +0 -0
  285. package/dist/collection/components/snk-taskbar/subcomponents/field-search.js.gz +0 -0
  286. package/dist/collection/components/teste-pesquisa/teste-pesquisa.css.gz +0 -0
  287. package/dist/collection/components/teste-pesquisa/teste-pesquisa.js.gz +0 -0
  288. package/dist/collection/index.js.gz +0 -0
  289. package/dist/collection/lib/@types/index.js.gz +0 -0
  290. package/dist/collection/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.js.gz +0 -0
  291. package/dist/collection/lib/applet-caller/applet-caller.js.gz +0 -0
  292. package/dist/collection/lib/auth/mgeauthorization.module.js.gz +0 -0
  293. package/dist/collection/lib/configs/ConfigStorage.js.gz +0 -0
  294. package/dist/collection/lib/dataUnit/InMemoryLoader.js.gz +0 -0
  295. package/dist/collection/lib/dataUnit/ValueFormatter.js.gz +0 -0
  296. package/dist/collection/lib/dataUnit/dataUnitInMemoryUtils.js +1 -1
  297. package/dist/collection/lib/dataUnit/dataUnitInMemoryUtils.js.gz +0 -0
  298. package/dist/collection/lib/dataUnit/interfaces/InMemoryLoaderConfig.js.gz +0 -0
  299. package/dist/collection/lib/http/data-fetcher/DataFetcher.js.gz +0 -0
  300. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/anexo-sistema-fetcher.js.gz +0 -0
  301. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/attach-fetcher.js.gz +0 -0
  302. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/facade/attach-fetcher.facade.js.gz +0 -0
  303. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/index.js.gz +0 -0
  304. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/IDelete.js.gz +0 -0
  305. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/IDownloadKey.js.gz +0 -0
  306. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/ISave.js.gz +0 -0
  307. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/index.js.gz +0 -0
  308. package/dist/collection/lib/http/data-fetcher/fetchers/application-config-fetcher.js.gz +0 -0
  309. package/dist/collection/lib/http/data-fetcher/fetchers/auth-fetcher.js.gz +0 -0
  310. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.js.gz +0 -0
  311. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.js.gz +0 -0
  312. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.js.gz +0 -0
  313. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.js.gz +0 -0
  314. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IBuildRequestBodyLoadRowMetadata.js.gz +0 -0
  315. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadDataResult.js.gz +0 -0
  316. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadDataStrategy.js.gz +0 -0
  317. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadingInfo.js.gz +0 -0
  318. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRecordField.js.gz +0 -0
  319. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IResponseRecord.js.gz +0 -0
  320. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRowMetadata.js.gz +0 -0
  321. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DataUnitStrategy.js.gz +0 -0
  322. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js.gz +0 -0
  323. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/test/resources/metadataMock.js.gz +0 -0
  324. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IExporterColumnMetadata.js.gz +0 -0
  325. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams.js.gz +0 -0
  326. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterResponse.js.gz +0 -0
  327. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IPersonalizedReport.js.gz +0 -0
  328. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/permission-export-pdf.js.gz +0 -0
  329. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/personalized-reports-fetcher.js.gz +0 -0
  330. package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js.gz +0 -0
  331. package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js.gz +0 -0
  332. package/dist/collection/lib/http/data-fetcher/fetchers/grid-config-fetcher.js.gz +0 -0
  333. package/dist/collection/lib/http/data-fetcher/fetchers/parameters-fecher.js.gz +0 -0
  334. package/dist/collection/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.js.gz +0 -0
  335. package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +89 -3
  336. package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js.gz +0 -0
  337. package/dist/collection/lib/http/data-fetcher/fetchers/resource-fetcher.js.gz +0 -0
  338. package/dist/collection/lib/http/data-fetcher/fetchers/totals-fetcher.js.gz +0 -0
  339. package/dist/collection/lib/http/data-fetcher/interfaces/IClientEventResponse.js.gz +0 -0
  340. package/dist/collection/lib/http/data-fetcher/recaller/GraphQLRecaller.js.gz +0 -0
  341. package/dist/collection/lib/http/data-fetcher/recaller/IDataFetcherRecaller.js.gz +0 -0
  342. package/dist/collection/lib/http/data-fetcher/recaller/ServiceBrokerRecaller.js.gz +0 -0
  343. package/dist/collection/lib/http/data-fetcher/state/LoadStateManager.js.gz +0 -0
  344. package/dist/collection/lib/index.js.gz +0 -0
  345. package/dist/collection/lib/licenses/sankhyalicense.module.js.gz +0 -0
  346. package/dist/collection/lib/message/SnkMessageBuilder.js.gz +0 -0
  347. package/dist/collection/lib/message/resources/crud-utils.msg.js.gz +0 -0
  348. package/dist/collection/lib/message/resources/file-viewer.msg.js.gz +0 -0
  349. package/dist/collection/lib/message/resources/snk-actions-button.msg.js.gz +0 -0
  350. package/dist/collection/lib/message/resources/snk-application.msg.js.gz +0 -0
  351. package/dist/collection/lib/message/resources/snk-attach.msg.js.gz +0 -0
  352. package/dist/collection/lib/message/resources/snk-configurator.msg.js.gz +0 -0
  353. package/dist/collection/lib/message/resources/snk-crud.msg.js.gz +0 -0
  354. package/dist/collection/lib/message/resources/snk-data-exporter.msg.js.gz +0 -0
  355. package/dist/collection/lib/message/resources/snk-data-unit.msg.js.gz +0 -0
  356. package/dist/collection/lib/message/resources/snk-entity-list.msg.js.gz +0 -0
  357. package/dist/collection/lib/message/resources/snk-exporter.msg.js.gz +0 -0
  358. package/dist/collection/lib/message/resources/snk-filter-bar.msg.js.gz +0 -0
  359. package/dist/collection/lib/message/resources/snk-filter-field-search.msg.js.gz +0 -0
  360. package/dist/collection/lib/message/resources/snk-filter-param-config.msg.js.gz +0 -0
  361. package/dist/collection/lib/message/resources/snk-form.msg.js.gz +0 -0
  362. package/dist/collection/lib/message/resources/snk-grid.msg.js.gz +0 -0
  363. package/dist/collection/lib/message/resources/snk-personalized-filter.msg.js.gz +0 -0
  364. package/dist/collection/lib/message/resources/snk-print-selector.msg.js.gz +0 -0
  365. package/dist/collection/lib/message/resources/snk-simple-bar.msg.js.gz +0 -0
  366. package/dist/collection/lib/message/resources/snk-simple-crud.msg.js.gz +0 -0
  367. package/dist/collection/lib/message/resources/snk-taskbar.msg.js.gz +0 -0
  368. package/dist/collection/lib/resourceid/ResourceIDUtils.js.gz +0 -0
  369. package/dist/collection/lib/store/index.js.gz +0 -0
  370. package/dist/collection/lib/utils/ContinuousInsertUtils.js.gz +0 -0
  371. package/dist/collection/lib/utils/CrudUtils.js.gz +0 -0
  372. package/dist/collection/lib/utils/GetSelectedRecordsIDsInfo.js.gz +0 -0
  373. package/dist/collection/lib/utils/PrintUtils.js.gz +0 -0
  374. package/dist/collection/lib/utils/constants.js.gz +0 -0
  375. package/dist/collection/lib/utils/fileViewer/index.js.gz +0 -0
  376. package/dist/collection/lib/utils/fileViewer/interfaces/IFileViewerParams.js.gz +0 -0
  377. package/dist/collection/lib/utils/pesquisa.js.gz +0 -0
  378. package/dist/collection/lib/utils/urlutils.js.gz +0 -0
  379. package/dist/collection/lib/workspace/workspace.js.gz +0 -0
  380. package/dist/collection/sw.js.gz +0 -0
  381. package/dist/components/AuthorizationConfig.js.gz +0 -0
  382. package/dist/components/ConfigStorage.js.gz +0 -0
  383. package/dist/components/ContinuousInsertUtils.js +1 -2
  384. package/dist/components/ContinuousInsertUtils.js.gz +0 -0
  385. package/dist/components/DataFetcher.js.gz +0 -0
  386. package/dist/components/GetSelectedRecordsIDsInfo.js.gz +0 -0
  387. package/dist/components/ISave.js +346 -1
  388. package/dist/components/ISave.js.gz +0 -0
  389. package/dist/components/ParamType.js.gz +0 -0
  390. package/dist/components/PersonalizedFilterUtils.js.gz +0 -0
  391. package/dist/components/PrintUtils.js.gz +0 -0
  392. package/dist/components/ResourceIDUtils.js.gz +0 -0
  393. package/dist/components/SnkFormConfigManager.js.gz +0 -0
  394. package/dist/components/SnkMessageBuilder.js.gz +0 -0
  395. package/dist/components/auth-fetcher.js.gz +0 -0
  396. package/dist/components/constants.js.gz +0 -0
  397. package/dist/components/dataunit-fetcher.js +1 -1
  398. package/dist/components/dataunit-fetcher.js.gz +0 -0
  399. package/dist/components/filter-item-type.enum.js.gz +0 -0
  400. package/dist/components/filterNumberVariation.js.gz +0 -0
  401. package/dist/components/form-config-fetcher.js.gz +0 -0
  402. package/dist/components/index.d.ts +2 -0
  403. package/dist/components/index.js +2 -0
  404. package/dist/components/index.js.gz +0 -0
  405. package/dist/components/index2.js.gz +0 -0
  406. package/dist/components/pesquisa-grid.d.ts +11 -0
  407. package/dist/components/pesquisa-grid.js +6 -0
  408. package/dist/components/pesquisa-grid.js.gz +0 -0
  409. package/dist/components/pesquisa-grid2.js +86 -0
  410. package/dist/components/pesquisa-grid2.js.gz +0 -0
  411. package/dist/components/pesquisa-tree.d.ts +11 -0
  412. package/dist/components/pesquisa-tree.js +6 -0
  413. package/dist/components/pesquisa-tree.js.gz +0 -0
  414. package/dist/components/pesquisa-tree2.js +76 -0
  415. package/dist/components/pesquisa-tree2.js.gz +0 -0
  416. package/dist/components/presentationMode.js.gz +0 -0
  417. package/dist/components/snk-actions-button.js.gz +0 -0
  418. package/dist/components/snk-actions-button2.js +4 -5
  419. package/dist/components/snk-actions-button2.js.gz +0 -0
  420. package/dist/components/snk-actions-form.js.gz +0 -0
  421. package/dist/components/snk-application.js.gz +0 -0
  422. package/dist/components/snk-application2.js +35 -8
  423. package/dist/components/snk-application2.js.gz +0 -0
  424. package/dist/components/snk-attach.js.gz +0 -0
  425. package/dist/components/snk-attach2.js +0 -1
  426. package/dist/components/snk-attach2.js.gz +0 -0
  427. package/dist/components/snk-client-confirm.js.gz +0 -0
  428. package/dist/components/snk-config-options.js.gz +0 -0
  429. package/dist/components/snk-config-options2.js.gz +0 -0
  430. package/dist/components/snk-configurator.js.gz +0 -0
  431. package/dist/components/snk-configurator2.js.gz +0 -0
  432. package/dist/components/snk-crud.js +0 -1
  433. package/dist/components/snk-crud.js.gz +0 -0
  434. package/dist/components/snk-custom-slot-elements.js.gz +0 -0
  435. package/dist/components/snk-data-exporter.js.gz +0 -0
  436. package/dist/components/snk-data-exporter2.js +1 -2
  437. package/dist/components/snk-data-exporter2.js.gz +0 -0
  438. package/dist/components/snk-data-unit.js.gz +0 -0
  439. package/dist/components/snk-data-unit2.js.gz +0 -0
  440. package/dist/components/snk-detail-view.js.gz +0 -0
  441. package/dist/components/snk-detail-view2.js +0 -1
  442. package/dist/components/snk-detail-view2.js.gz +0 -0
  443. package/dist/components/snk-entity-list.js.gz +0 -0
  444. package/dist/components/snk-exporter-email-sender.js.gz +0 -0
  445. package/dist/components/snk-exporter-email-sender2.js.gz +0 -0
  446. package/dist/components/snk-expression-group.js.gz +0 -0
  447. package/dist/components/snk-expression-group2.js.gz +0 -0
  448. package/dist/components/snk-expression-item.js.gz +0 -0
  449. package/dist/components/snk-expression-item2.js.gz +0 -0
  450. package/dist/components/snk-field-config.js.gz +0 -0
  451. package/dist/components/snk-field-config2.js.gz +0 -0
  452. package/dist/components/snk-filter-advanced-mode.js.gz +0 -0
  453. package/dist/components/snk-filter-advanced-mode2.js.gz +0 -0
  454. package/dist/components/snk-filter-assistent-mode.js.gz +0 -0
  455. package/dist/components/snk-filter-assistent-mode2.js.gz +0 -0
  456. package/dist/components/snk-filter-bar.js.gz +0 -0
  457. package/dist/components/snk-filter-bar2.js.gz +0 -0
  458. package/dist/components/snk-filter-binary-select.js.gz +0 -0
  459. package/dist/components/snk-filter-checkbox-list.js.gz +0 -0
  460. package/dist/components/snk-filter-detail.js.gz +0 -0
  461. package/dist/components/snk-filter-detail2.js.gz +0 -0
  462. package/dist/components/snk-filter-field-search.js.gz +0 -0
  463. package/dist/components/snk-filter-field-search2.js.gz +0 -0
  464. package/dist/components/snk-filter-item.js.gz +0 -0
  465. package/dist/components/snk-filter-item2.js.gz +0 -0
  466. package/dist/components/snk-filter-list.js.gz +0 -0
  467. package/dist/components/snk-filter-modal-item.js.gz +0 -0
  468. package/dist/components/snk-filter-modal-item2.js.gz +0 -0
  469. package/dist/components/snk-filter-modal.js.gz +0 -0
  470. package/dist/components/snk-filter-multi-select.js.gz +0 -0
  471. package/dist/components/snk-filter-number.js.gz +0 -0
  472. package/dist/components/snk-filter-param-config.js.gz +0 -0
  473. package/dist/components/snk-filter-param-config2.js.gz +0 -0
  474. package/dist/components/snk-filter-period.js.gz +0 -0
  475. package/dist/components/snk-filter-search.js.gz +0 -0
  476. package/dist/components/snk-filter-text.js.gz +0 -0
  477. package/dist/components/snk-form-config.js.gz +0 -0
  478. package/dist/components/snk-form-config2.js.gz +0 -0
  479. package/dist/components/snk-form-summary.js.gz +0 -0
  480. package/dist/components/snk-form-summary2.js.gz +0 -0
  481. package/dist/components/snk-form-view.js.gz +0 -0
  482. package/dist/components/snk-form-view2.js.gz +0 -0
  483. package/dist/components/snk-form.js.gz +0 -0
  484. package/dist/components/snk-grid-config.js.gz +0 -0
  485. package/dist/components/snk-grid-config2.js.gz +0 -0
  486. package/dist/components/snk-grid.js.gz +0 -0
  487. package/dist/components/snk-grid2.js +0 -1
  488. package/dist/components/snk-grid2.js.gz +0 -0
  489. package/dist/components/snk-guides-viewer.js.gz +0 -0
  490. package/dist/components/snk-personalized-filter-editor.js.gz +0 -0
  491. package/dist/components/snk-personalized-filter.js.gz +0 -0
  492. package/dist/components/snk-personalized-filter2.js.gz +0 -0
  493. package/dist/components/snk-pesquisa.js.gz +0 -0
  494. package/dist/components/snk-pesquisa2.js +118 -33
  495. package/dist/components/snk-pesquisa2.js.gz +0 -0
  496. package/dist/components/snk-print-selector.js.gz +0 -0
  497. package/dist/components/snk-select-box.js.gz +0 -0
  498. package/dist/components/snk-select-box2.js.gz +0 -0
  499. package/dist/components/snk-simple-bar.js.gz +0 -0
  500. package/dist/components/snk-simple-bar2.js.gz +0 -0
  501. package/dist/components/snk-simple-crud.js.gz +0 -0
  502. package/dist/components/snk-simple-crud2.js +1 -2
  503. package/dist/components/snk-simple-crud2.js.gz +0 -0
  504. package/dist/components/snk-simple-form-config.js.gz +0 -0
  505. package/dist/components/snk-simple-form-config2.js +1 -2
  506. package/dist/components/snk-simple-form-config2.js.gz +0 -0
  507. package/dist/components/snk-tab-config.js.gz +0 -0
  508. package/dist/components/snk-tab-config2.js.gz +0 -0
  509. package/dist/components/snk-taskbar.js.gz +0 -0
  510. package/dist/components/snk-taskbar2.js.gz +0 -0
  511. package/dist/components/taskbar-actions-button.js.gz +0 -0
  512. package/dist/components/taskbar-actions-button2.js.gz +0 -0
  513. package/dist/components/teste-pesquisa.js +13 -1
  514. package/dist/components/teste-pesquisa.js.gz +0 -0
  515. package/dist/esm/AuthorizationConfig-dcbd207a.js.gz +0 -0
  516. package/dist/esm/ConfigStorage-ff99377a.js.gz +0 -0
  517. package/dist/esm/{ContinuousInsertUtils-bab45060.js → ContinuousInsertUtils-15b5f1da.js} +2 -2
  518. package/dist/esm/ContinuousInsertUtils-15b5f1da.js.gz +0 -0
  519. package/dist/esm/DataFetcher-5034df59.js.gz +0 -0
  520. package/dist/esm/GetSelectedRecordsIDsInfo-9fa41508.js.gz +0 -0
  521. package/dist/esm/ISave-d8c8bc59.js.gz +0 -0
  522. package/dist/esm/ParamType-d5152b06.js.gz +0 -0
  523. package/dist/esm/PersonalizedFilterUtils-e2b38ef7.js.gz +0 -0
  524. package/dist/esm/PrintUtils-3e4ff0f5.js.gz +0 -0
  525. package/dist/esm/ResourceIDUtils-a114189a.js.gz +0 -0
  526. package/dist/esm/SnkFormConfigManager-a7770e24.js.gz +0 -0
  527. package/dist/esm/SnkMessageBuilder-6fff4a4c.js.gz +0 -0
  528. package/dist/esm/Sortable-83960219.js.gz +0 -0
  529. package/dist/esm/auth-fetcher-0b78ca31.js.gz +0 -0
  530. package/dist/esm/constants-7302ee87.js.gz +0 -0
  531. package/dist/esm/{dataunit-fetcher-56cb648b.js → dataunit-fetcher-481e159d.js} +1 -1
  532. package/dist/esm/dataunit-fetcher-481e159d.js.gz +0 -0
  533. package/dist/esm/field-search-f8b1d91e.js.gz +0 -0
  534. package/dist/esm/filter-item-type.enum-d45e026f.js.gz +0 -0
  535. package/dist/esm/filter-type.enum-a80c1b6b.js.gz +0 -0
  536. package/dist/esm/filterNumberVariation-8cee02ea.js.gz +0 -0
  537. package/dist/esm/form-config-fetcher-0c2620ef.js.gz +0 -0
  538. package/dist/esm/index-3aa4977a.js.gz +0 -0
  539. package/dist/esm/index-620ac460.js.gz +0 -0
  540. package/dist/esm/index-a7d3d3f1.js +4 -0
  541. package/dist/esm/index-a7d3d3f1.js.gz +0 -0
  542. package/dist/esm/index-ae591a44.js.gz +0 -0
  543. package/dist/esm/index-bdf75557.js.gz +0 -0
  544. package/dist/esm/index.js.gz +0 -0
  545. package/dist/esm/loader.js +1 -1
  546. package/dist/esm/loader.js.gz +0 -0
  547. package/dist/esm/{pesquisa-fetcher-24e5bba0.js → pesquisa-fetcher-c437c9b1.js} +176 -2
  548. package/dist/esm/pesquisa-fetcher-c437c9b1.js.gz +0 -0
  549. package/dist/esm/pesquisa-grid_2.entry.js +122 -0
  550. package/dist/esm/pesquisa-grid_2.entry.js.gz +0 -0
  551. package/dist/esm/polyfills/core-js.js.gz +0 -0
  552. package/dist/esm/polyfills/css-shim.js.gz +0 -0
  553. package/dist/esm/polyfills/dom.js.gz +0 -0
  554. package/dist/esm/polyfills/es5-html-element.js.gz +0 -0
  555. package/dist/esm/polyfills/index.js.gz +0 -0
  556. package/dist/esm/polyfills/system.js.gz +0 -0
  557. package/dist/esm/presentationMode-783bbf9d.js.gz +0 -0
  558. package/dist/esm/sankhyablocks.js +1 -1
  559. package/dist/esm/sankhyablocks.js.gz +0 -0
  560. package/dist/esm/snk-actions-button_5.entry.js +6 -6
  561. package/dist/esm/snk-actions-button_5.entry.js.gz +0 -0
  562. package/dist/esm/snk-actions-form.entry.js.gz +0 -0
  563. package/dist/esm/snk-application.entry.js +23 -8
  564. package/dist/esm/snk-application.entry.js.gz +0 -0
  565. package/dist/esm/snk-attach.entry.js +2 -2
  566. package/dist/esm/snk-attach.entry.js.gz +0 -0
  567. package/dist/esm/snk-client-confirm.entry.js.gz +0 -0
  568. package/dist/esm/snk-config-options_3.entry.js.gz +0 -0
  569. package/dist/esm/snk-configurator.entry.js.gz +0 -0
  570. package/dist/esm/snk-crud.entry.js +2 -2
  571. package/dist/esm/snk-crud.entry.js.gz +0 -0
  572. package/dist/esm/snk-custom-slot-elements.entry.js.gz +0 -0
  573. package/dist/esm/snk-data-exporter.entry.js +3 -3
  574. package/dist/esm/snk-data-exporter.entry.js.gz +0 -0
  575. package/dist/esm/{snk-data-unit-9fa7d2b9.js → snk-data-unit-d4ba54d7.js} +1 -1
  576. package/dist/esm/snk-data-unit-d4ba54d7.js.gz +0 -0
  577. package/dist/esm/snk-data-unit.entry.js +2 -2
  578. package/dist/esm/snk-data-unit.entry.js.gz +0 -0
  579. package/dist/esm/snk-detail-view.entry.js +3 -3
  580. package/dist/esm/snk-detail-view.entry.js.gz +0 -0
  581. package/dist/esm/snk-entity-list.entry.js.gz +0 -0
  582. package/dist/esm/snk-exporter-email-sender.entry.js.gz +0 -0
  583. package/dist/esm/snk-expression-group_2.entry.js.gz +0 -0
  584. package/dist/esm/snk-field-config.entry.js.gz +0 -0
  585. package/dist/esm/snk-filter-advanced-mode_2.entry.js.gz +0 -0
  586. package/dist/esm/snk-filter-bar_4.entry.js.gz +0 -0
  587. package/dist/esm/snk-filter-binary-select.entry.js.gz +0 -0
  588. package/dist/esm/snk-filter-checkbox-list.entry.js.gz +0 -0
  589. package/dist/esm/snk-filter-detail.entry.js.gz +0 -0
  590. package/dist/esm/snk-filter-field-search_2.entry.js.gz +0 -0
  591. package/dist/esm/snk-filter-modal-item.entry.js.gz +0 -0
  592. package/dist/esm/snk-filter-multi-select.entry.js.gz +0 -0
  593. package/dist/esm/snk-filter-number.entry.js.gz +0 -0
  594. package/dist/esm/snk-filter-period.entry.js.gz +0 -0
  595. package/dist/esm/snk-filter-search.entry.js.gz +0 -0
  596. package/dist/esm/snk-filter-text.entry.js.gz +0 -0
  597. package/dist/esm/snk-form-summary.entry.js.gz +0 -0
  598. package/dist/esm/snk-form-view.entry.js.gz +0 -0
  599. package/dist/esm/snk-grid.entry.js +3 -3
  600. package/dist/esm/snk-grid.entry.js.gz +0 -0
  601. package/dist/esm/{snk-guides-viewer-b740a1fe.js → snk-guides-viewer-3043422d.js} +2 -2
  602. package/dist/esm/snk-guides-viewer-3043422d.js.gz +0 -0
  603. package/dist/esm/snk-guides-viewer.entry.js +3 -3
  604. package/dist/esm/snk-guides-viewer.entry.js.gz +0 -0
  605. package/dist/esm/snk-personalized-filter-editor.entry.js.gz +0 -0
  606. package/dist/esm/snk-personalized-filter.entry.js.gz +0 -0
  607. package/dist/esm/snk-pesquisa.entry.js +105 -31
  608. package/dist/esm/snk-pesquisa.entry.js.gz +0 -0
  609. package/dist/esm/snk-print-selector.entry.js.gz +0 -0
  610. package/dist/esm/snk-simple-bar.entry.js.gz +0 -0
  611. package/dist/esm/snk-simple-crud.entry.js +3 -3
  612. package/dist/esm/snk-simple-crud.entry.js.gz +0 -0
  613. package/dist/esm/snk-tab-config.entry.js.gz +0 -0
  614. package/dist/esm/snk-taskbar.entry.js.gz +0 -0
  615. package/dist/esm/taskbar-elements-d59867f1.js.gz +0 -0
  616. package/dist/esm/teste-pesquisa.entry.js.gz +0 -0
  617. package/dist/index.cjs.js.gz +0 -0
  618. package/dist/index.js.gz +0 -0
  619. package/dist/sankhyablocks/index.esm.js.gz +0 -0
  620. package/dist/sankhyablocks/p-00278e07.js.gz +0 -0
  621. package/dist/sankhyablocks/{p-690b4311.entry.js → p-0085f149.entry.js} +1 -1
  622. package/dist/sankhyablocks/p-0085f149.entry.js.gz +0 -0
  623. package/dist/sankhyablocks/p-01ba23cd.entry.js.gz +0 -0
  624. package/dist/sankhyablocks/p-036b4807.entry.js.gz +0 -0
  625. package/dist/sankhyablocks/p-057fad05.js.gz +0 -0
  626. package/dist/sankhyablocks/{p-c629c07a.entry.js → p-08242e3f.entry.js} +1 -1
  627. package/dist/sankhyablocks/p-08242e3f.entry.js.gz +0 -0
  628. package/dist/sankhyablocks/{p-342eeb3b.js → p-0f3b2a32.js} +1 -1
  629. package/dist/sankhyablocks/p-0f3b2a32.js.gz +0 -0
  630. package/dist/sankhyablocks/p-118e769b.entry.js.gz +0 -0
  631. package/dist/sankhyablocks/p-16a1dd18.entry.js.gz +0 -0
  632. package/dist/sankhyablocks/p-17425c72.js.gz +0 -0
  633. package/dist/sankhyablocks/p-1a68fb59.js.gz +0 -0
  634. package/dist/sankhyablocks/p-1db45d26.entry.js.gz +0 -0
  635. package/dist/sankhyablocks/p-21749402.js.gz +0 -0
  636. package/dist/sankhyablocks/p-21a81901.entry.js.gz +0 -0
  637. package/dist/sankhyablocks/{p-72a451c8.js → p-229c3615.js} +1 -1
  638. package/dist/sankhyablocks/p-229c3615.js.gz +0 -0
  639. package/dist/sankhyablocks/p-23736d75.js.gz +0 -0
  640. package/dist/sankhyablocks/p-26b0ce3e.entry.js.gz +0 -0
  641. package/dist/sankhyablocks/p-2d3f9482.entry.js.gz +0 -0
  642. package/dist/sankhyablocks/p-30cf616e.js.gz +0 -0
  643. package/dist/sankhyablocks/p-33718dfc.entry.js.gz +0 -0
  644. package/dist/sankhyablocks/p-35882caf.entry.js.gz +0 -0
  645. package/dist/sankhyablocks/{p-b619ee23.js → p-36598f95.js} +1 -1
  646. package/dist/sankhyablocks/p-36598f95.js.gz +0 -0
  647. package/dist/sankhyablocks/p-3ab6df3d.entry.js.gz +0 -0
  648. package/dist/sankhyablocks/p-3e6990a6.entry.js +1 -0
  649. package/dist/sankhyablocks/p-3e6990a6.entry.js.gz +0 -0
  650. package/dist/sankhyablocks/p-41793e17.entry.js.gz +0 -0
  651. package/dist/sankhyablocks/p-434817f0.entry.js.gz +0 -0
  652. package/dist/sankhyablocks/p-47178038.entry.js.gz +0 -0
  653. package/dist/sankhyablocks/p-4be4cdac.js +6 -0
  654. package/dist/sankhyablocks/p-4be4cdac.js.gz +0 -0
  655. package/dist/sankhyablocks/{p-eda55eef.entry.js → p-51cb6883.entry.js} +2 -2
  656. package/dist/sankhyablocks/p-51cb6883.entry.js.gz +0 -0
  657. package/dist/sankhyablocks/p-54a5d52a.entry.js.gz +0 -0
  658. package/dist/sankhyablocks/{p-47d24ac8.js → p-58fd3017.js} +1 -1
  659. package/dist/sankhyablocks/p-58fd3017.js.gz +0 -0
  660. package/dist/sankhyablocks/p-5f157b09.entry.js.gz +0 -0
  661. package/dist/sankhyablocks/p-619aeac8.entry.js.gz +0 -0
  662. package/dist/sankhyablocks/{p-0c55538b.entry.js → p-64c40311.entry.js} +1 -1
  663. package/dist/sankhyablocks/p-64c40311.entry.js.gz +0 -0
  664. package/dist/sankhyablocks/p-65650e05.entry.js.gz +0 -0
  665. package/dist/sankhyablocks/p-688dcb4c.js.gz +0 -0
  666. package/dist/sankhyablocks/p-6dc031de.js.gz +0 -0
  667. package/dist/sankhyablocks/p-763edad2.js.gz +0 -0
  668. package/dist/sankhyablocks/{p-50306605.entry.js → p-7d09f66c.entry.js} +1 -1
  669. package/dist/sankhyablocks/p-7d09f66c.entry.js.gz +0 -0
  670. package/dist/sankhyablocks/p-7dd49d15.js.gz +0 -0
  671. package/dist/sankhyablocks/p-7e2ded86.entry.js.gz +0 -0
  672. package/dist/sankhyablocks/p-7e7a7473.js.gz +0 -0
  673. package/dist/sankhyablocks/p-8002dcd0.entry.js.gz +0 -0
  674. package/dist/sankhyablocks/p-82274cb0.js.gz +0 -0
  675. package/dist/sankhyablocks/p-89c92727.entry.js.gz +0 -0
  676. package/dist/sankhyablocks/p-8b4fc28f.entry.js.gz +0 -0
  677. package/dist/sankhyablocks/p-8c235d4c.entry.js.gz +0 -0
  678. package/dist/sankhyablocks/p-8d884fab.js.gz +0 -0
  679. package/dist/sankhyablocks/p-933c0c0b.js.gz +0 -0
  680. package/dist/sankhyablocks/p-9531fd46.entry.js.gz +0 -0
  681. package/dist/sankhyablocks/p-95ce311a.js.gz +0 -0
  682. package/dist/sankhyablocks/p-9d3a025a.entry.js.gz +0 -0
  683. package/dist/sankhyablocks/{p-53ae0296.entry.js → p-a33e803a.entry.js} +1 -1
  684. package/dist/sankhyablocks/p-a33e803a.entry.js.gz +0 -0
  685. package/dist/sankhyablocks/p-ac8d1cd6.entry.js.gz +0 -0
  686. package/dist/sankhyablocks/p-acca8a69.js.gz +0 -0
  687. package/dist/sankhyablocks/{p-89da2953.entry.js → p-b299dc14.entry.js} +1 -1
  688. package/dist/sankhyablocks/p-b299dc14.entry.js.gz +0 -0
  689. package/dist/sankhyablocks/p-badbd2ca.entry.js +1 -0
  690. package/dist/sankhyablocks/p-badbd2ca.entry.js.gz +0 -0
  691. package/dist/sankhyablocks/p-bf2acf72.entry.js.gz +0 -0
  692. package/dist/sankhyablocks/p-c2e468c9.entry.js.gz +0 -0
  693. package/dist/sankhyablocks/p-c8622597.entry.js.gz +0 -0
  694. package/dist/sankhyablocks/p-d2d301a6.js.gz +0 -0
  695. package/dist/sankhyablocks/p-d9804798.js.gz +0 -0
  696. package/dist/sankhyablocks/p-dc36cfbf.js.gz +0 -0
  697. package/dist/sankhyablocks/{p-0d2a2e9e.entry.js → p-e2bd42c0.entry.js} +1 -1
  698. package/dist/sankhyablocks/p-e2bd42c0.entry.js.gz +0 -0
  699. package/dist/sankhyablocks/p-e8512d4b.entry.js +1 -0
  700. package/dist/sankhyablocks/p-e8512d4b.entry.js.gz +0 -0
  701. package/dist/sankhyablocks/p-e9432f45.entry.js.gz +0 -0
  702. package/dist/sankhyablocks/{p-8cf0a9fe.entry.js → p-ea837487.entry.js} +1 -1
  703. package/dist/sankhyablocks/p-ea837487.entry.js.gz +0 -0
  704. package/dist/sankhyablocks/p-eaad0aa8.js.gz +0 -0
  705. package/dist/sankhyablocks/p-f4184ce7.js.gz +0 -0
  706. package/dist/sankhyablocks/p-fa80e546.js.gz +0 -0
  707. package/dist/sankhyablocks/p-fa816fb2.js.gz +0 -0
  708. package/dist/sankhyablocks/p-fcc662c6.js.gz +0 -0
  709. package/dist/sankhyablocks/p-ff1990ad.js.gz +0 -0
  710. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  711. package/dist/sankhyablocks/sankhyablocks.esm.js.gz +0 -0
  712. package/dist/types/components/snk-application/snk-application.d.ts +1 -1
  713. package/dist/types/components/snk-pesquisa/pesquisa-grid/pesquisa-grid.d.ts +38 -0
  714. package/dist/types/components/snk-pesquisa/pesquisa-tree/pesquisa-tree.d.ts +28 -0
  715. package/dist/types/components/snk-pesquisa/pesquisaHelper.d.ts +19 -0
  716. package/dist/types/components/snk-pesquisa/snk-pesquisa.d.ts +35 -1
  717. package/dist/types/components.d.ts +148 -13
  718. package/dist/types/lib/http/data-fetcher/fetchers/pesquisa-fetcher.d.ts +10 -1
  719. package/package.json +1 -1
  720. package/react/components.d.ts +2 -0
  721. package/react/components.js +2 -0
  722. package/react/components.js.map +1 -1
  723. package/dist/cjs/ContinuousInsertUtils-414b772c.js.gz +0 -0
  724. package/dist/cjs/dataunit-fetcher-228016f4.js.gz +0 -0
  725. package/dist/cjs/pesquisa-fetcher-2ec4811b.js.gz +0 -0
  726. package/dist/cjs/snk-data-unit-3d9b6ed4.js.gz +0 -0
  727. package/dist/cjs/snk-guides-viewer-421555af.js.gz +0 -0
  728. package/dist/components/pesquisa-fetcher.js +0 -172
  729. package/dist/components/pesquisa-fetcher.js.gz +0 -0
  730. package/dist/esm/ContinuousInsertUtils-bab45060.js.gz +0 -0
  731. package/dist/esm/dataunit-fetcher-56cb648b.js.gz +0 -0
  732. package/dist/esm/pesquisa-fetcher-24e5bba0.js.gz +0 -0
  733. package/dist/esm/snk-data-unit-9fa7d2b9.js.gz +0 -0
  734. package/dist/esm/snk-guides-viewer-b740a1fe.js.gz +0 -0
  735. package/dist/sankhyablocks/p-0c55538b.entry.js.gz +0 -0
  736. package/dist/sankhyablocks/p-0d2a2e9e.entry.js.gz +0 -0
  737. package/dist/sankhyablocks/p-342eeb3b.js.gz +0 -0
  738. package/dist/sankhyablocks/p-47d24ac8.js.gz +0 -0
  739. package/dist/sankhyablocks/p-50306605.entry.js.gz +0 -0
  740. package/dist/sankhyablocks/p-53ae0296.entry.js.gz +0 -0
  741. package/dist/sankhyablocks/p-64ff0fb6.entry.js +0 -1
  742. package/dist/sankhyablocks/p-64ff0fb6.entry.js.gz +0 -0
  743. package/dist/sankhyablocks/p-690b4311.entry.js.gz +0 -0
  744. package/dist/sankhyablocks/p-72a451c8.js.gz +0 -0
  745. package/dist/sankhyablocks/p-89da2953.entry.js.gz +0 -0
  746. package/dist/sankhyablocks/p-8cf0a9fe.entry.js.gz +0 -0
  747. package/dist/sankhyablocks/p-b619ee23.js.gz +0 -0
  748. package/dist/sankhyablocks/p-c629c07a.entry.js.gz +0 -0
  749. package/dist/sankhyablocks/p-d1791da2.entry.js +0 -1
  750. package/dist/sankhyablocks/p-d1791da2.entry.js.gz +0 -0
  751. package/dist/sankhyablocks/p-e6683406.js +0 -6
  752. package/dist/sankhyablocks/p-e6683406.js.gz +0 -0
  753. package/dist/sankhyablocks/p-eda55eef.entry.js.gz +0 -0
@@ -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 a,WaitingChangeException as o,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 _}from"@sankhyalabs/ezui/dist/collection/utils";import{C as v}from"./p-763edad2.js";import{d as g,D as A,U as I}from"./p-00278e07.js";import{A as S,a as C}from"./p-82274cb0.js";import{P as b,D as N}from"./p-47d24ac8.js";import{P as T}from"./p-e6683406.js";import{S as E}from"./p-17425c72.js";import"./p-acca8a69.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 M{[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 R("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 R{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 a,WaitingChangeException as o,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-763edad2.js";import{d as g,D as A,U as I}from"./p-00278e07.js";import{A as S,a as N}from"./p-82274cb0.js";import{P as C,D as E}from"./p-58fd3017.js";import{P as b}from"./p-4be4cdac.js";import{S as T}from"./p-17425c72.js";import"./p-acca8a69.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 K{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 o||(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 o||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 "${a.objectToString(t)}"`;this._app.error(s,e)}}))}}class H{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 H;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 _.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,a)=>{const o=this.getDuPromissesStack(s),c=o.length>0;if(o.push(new J(r,a)),!c){const r=this.dataUnitFetcher.getDataUnit(t,n,e,i);r.loadMetadata().then((()=>{this.processResolveDataUnit(r,s,o)})).catch((t=>{for(;o.length>0;)o.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,a)=>{const o=this._duCache.get(s);o?r(o):this.createDataunit(t,s,e,i,n).then((t=>{r(t)})).catch((t=>a(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 _.alert(t,s,e,i)}async error(t,s,e,i){return _.error(t,s,e,i)}async success(t,s,e,i){return _.success(t,s,e,i)}async message(t,s,e,i){return _.message(t,s,e,i)}async confirm(t,s,e,i,n){return _.confirm(t,s,e,i,n)}async info(t,s){return _.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 M).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 N),this._dataUnitFetcher}get totalsFetcher(){return this._totalsFetcher||(this._totalsFetcher=new j),this._totalsFetcher}get pesquisaFetcher(){return this._pesquisaFetcher||(this._pesquisaFetcher=new T),this._pesquisaFetcher}get authFetcher(){return this._authFetcher||(this._authFetcher=new C),this._authFetcher}async executeSearch(t,s,e){const i=null==e?void 0:e.getField(s);if(i){const{mode:s,argument:n}=t,{ENTITYNAME:r,CODEFIELD:a,DESCRIPTIONFIELD:o,ROOTENTITY:c,DESCRIPTIONENTITY:h}=i.properties,u=i.dependencies;let l;const d={rootEntity:c,descriptionFieldName:o,codeFieldName:a,showInactives:!1,dataUnitId:e.dataUnitId};return null==u||u.filter((t=>t.masterFields)).forEach((t=>{var s;t.type===p.SEARCHING&&(null===(s=t.masterFields)||void 0===s?void 0:s.length)>0&&(l={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,n,{entity:r,entityDescription:h,criteria:l,searchOptions:d})}}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 a;return{value:r.highlightValue(t,s.__matchFields,null===(a=s[n])||void 0===a?void 0:a.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:o,searchOptions:c}=e;return new Promise("ADVANCED"===t?(t,e)=>{const i=document.createElement("snk-pesquisa");i[m.DATA_ELEMENT_ID_ATTRIBUTE_NAME]=`entity_${n}`,i.argument=s,i.searchLoader=t=>this.pesquisaFetcher.loadAdvancedSearch(n,t,o,c),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,o,c).then((e=>{let n=(e=a.stringToObject(e.json.$)).descriptionField,r=e.pkField;const o=[];e.data.forEach((t=>{let a=this.filterInvalidFields(e,t,i),c=this.filterMathFields(t.__matchFields,a,6,i);o.push(this.builOptionItem(s,t,c,n,r))})),t(o)})).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 _.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 K(this),this.messagesBuilder=new E,y.setContextValue("__EZUI__UPLOAD__ADD__URL__",`${I.getUrlBase()}/mge/upload/file`),y.setContextValue("__EZUI__SEARCH__OPTION__LOADER__",((t,s,e)=>this.executeSearch(t,s,e))),y.setContextValue("__EZUI__GRID_LICENSE__",z),this.registerPkChangeListener(),P.init(),v.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 o||(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 o||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 "${a.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,a)=>{const o=this.getDuPromissesStack(s),c=o.length>0;if(o.push(new J(r,a)),!c){const r=this.dataUnitFetcher.getDataUnit(t,n,e,i);r.loadMetadata().then((()=>{this.processResolveDataUnit(r,s,o)})).catch((t=>{for(;o.length>0;)o.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,a)=>{const o=this._duCache.get(s);o?r(o):this.createDataunit(t,s,e,i,n).then((t=>{r(t)})).catch((t=>a(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})));C.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 E),this._dataUnitFetcher}get totalsFetcher(){return this._totalsFetcher||(this._totalsFetcher=new j),this._totalsFetcher}get pesquisaFetcher(){return this._pesquisaFetcher||(this._pesquisaFetcher=new b),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:a,CODEFIELD:o,DESCRIPTIONFIELD:c,ROOTENTITY:h,DESCRIPTIONENTITY:u,ISHIERARCHYENTITY:l}=n.properties,p=n.dependencies;let w;const m={rootEntity:h,descriptionFieldName:c,codeFieldName:o,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:a,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 a;return{value:r.highlightValue(t,s.__matchFields,null===(a=s[n])||void 0===a?void 0:a.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:o,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,o,c),i.isHierarchyEntity=h,h&&(i.treeLoader=t=>this.pesquisaFetcher.loadTree(n,t,o,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,o,c).then((e=>{let n=(e=a.stringToObject(e.json.$)).descriptionField,r=e.pkField;const o=[];e.data.forEach((t=>{let a=this.filterInvalidFields(e,t,i),c=this.filterMathFields(t.__matchFields,a,6,i);o.push(this.builOptionItem(s,t,c,n,r))})),t(o)})).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}
@@ -1,4 +1,4 @@
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-00278e07.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._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._list.push(...t)}async clear(){this._list=[]}async delete(t){this._list=this._list.filter((e=>{for(const r of t)if(this._equalsFunction(e,r))return!1;return!0}))}async update(t){this._list=this._list.map((e=>{const r=t.find((t=>this._equalsFunction(e,t)));return null==r?e:r}))}async insert(t,e){const r=this._list.indexOf(t);-1!=r?this._list=this._list.slice(0,r).concat(e).concat(this._list.slice(r)):this._list.push(...e)}isOperating(){return!0}async isEmpty(){return Promise.resolve(0===this._list.length)}async count(){return Promise.resolve(this._list.length)}getFromCache(){return t.copy(this._list)}}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:b(i)})}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!) {
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-00278e07.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._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._list.push(...t)}async clear(){this._list=[]}async delete(t){this._list=this._list.filter((e=>{for(const r of t)if(this._equalsFunction(e,r))return!1;return!0}))}async update(t){this._list=this._list.map((e=>{const r=t.find((t=>this._equalsFunction(e,t)));return null==r?e:r}))}async insert(t,e){const r=this._list.indexOf(t);-1!=r?this._list=this._list.slice(0,r).concat(e).concat(this._list.slice(r)):this._list.push(...e)}isOperating(){return!0}async isEmpty(){return Promise.resolve(0===this._list.length)}async count(){return Promise.resolve(this._list.length)}getFromCache(){return t.copy(this._list)}}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
2
  $queryAlias$: fetchDataUnit(name: $name){
3
3
  name
4
4
  fields{
@@ -1 +1 @@
1
- import{r as i,c as t,h as s,g as e}from"./p-d2d301a6.js";import{UserInterface as n,StringUtils as o,ApplicationContext as h,ObjectUtils as a,DataType as r,JSUtils as d,FloatingManager as l,KeyboardManager as u,ElementIDUtils as c}from"@sankhyalabs/core";import{CSSVarsUtils as m}from"@sankhyalabs/ezui/dist/collection/utils";import{V as v,S as p}from"./p-95ce311a.js";import{T as g}from"./p-7e7a7473.js";import"./p-00278e07.js";import"./p-e6683406.js";import{C as f,S as C,R as S,b,a as k}from"./p-b619ee23.js";import{D as y,P as w}from"./p-30cf616e.js";import"./p-21749402.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import{I as E}from"./p-47d24ac8.js";import"./p-ff1990ad.js";import{F as _}from"./p-acca8a69.js";import{T as I,b as T,o as F}from"./p-23736d75.js";import{C as R}from"./p-763edad2.js";import{S as D}from"./p-fcc662c6.js";import{g as z}from"./p-7dd49d15.js";import{s as M}from"./p-6dc031de.js";import"./p-8d884fab.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";const O=["INSERT","REFRESH","PREVIOUS","NEXT","DIVIDER","MORE_OPTIONS"],L=["INSERT","REFRESH","PREVIOUS","NEXT","DIVIDER","CLONE","REMOVE","DIVIDER","MORE_OPTIONS"];class N extends f{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 z(this.dataUnit)}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__}async getRecords(){if(0===this.dataUnit.records.length)return Promise.resolve([]);const i=this.dataUnit.getSelectionInfo(),t=i.isEmpty()||i.isAllRecords()?await i.getAllRecords():i.records;return Promise.resolve(null==t?[]:t)}getHiddenOptions(){return[y.EXPORT_BY_EMAIL,y.EXPORT_PDF_TO_EMAIL,y.EXPORT_XLS_TO_EMAIL,y.EXPORT_PAGE_TO_PDF,y.EXPORT_PAGE_TO_XLS]}formatValue(i,t){const{id:s,descriptionFrom:e}=t,o=i[e||s];if(null==o)return"";if(null!=e)return o.label;if(this.dataUnit.getField(s).userInterface===n.SEARCH)return o.value;if(t.customFormatter){const s=this.getColumnsState().find((i=>t.id===i.name));return t.customFormatter.format(o,s,i.__record__id__)}return this.dataUnit.getFormattedValue(s,o)}}const P=class{constructor(s){i(this,s),this.dataStateChange=t(this,"dataStateChange",3),this.dataUnitReady=t(this,"dataUnitReady",3),this.actionClick=t(this,"actionClick",7),this.formItemsReady=t(this,"formItemsReady",7),this.configuratorSave=t(this,"configuratorSave",7),this.configuratorCancel=t(this,"configuratorCancel",7),this._multiSelectionListDataSource=new C,this._keyDownHandler=i=>this.keyDownListener(i),this._formConfigFetcher=new _,this._customEditors=new Map,this._customRenders=new Map,this._taskbarProcessor=new I({"snkSimpleCrudTaskbar.form_regular":this.getButtons(!1,[g.GRID_MODE],!0),"snkSimpleCrudTaskbar.grid_regular":this.getButtons(!1,[g.DATA_EXPORTER,g.FORM_MODE]),"snkSimpleCrudTaskbar.form_selected":this.getButtons(!0,[g.GRID_MODE],!0),"snkSimpleCrudTaskbar.grid_selected":this.getButtons(!0,[g.DATA_EXPORTER,g.FORM_MODE]),"snkSimpleCrudTaskbar.finish_edition":this.getFinishEditionButtonsCallback.bind(this)}),this._showPopUpGridConfig=!1,this._currentViewMode=v.GRID,this._config=void 0,this._fieldToGetFocus=void 0,this._customContainerId=`SNK-SIMPLE-CRUD-CUSTOM-CONTAINER-${o.generateUUID()}`,this.dataState=void 0,this.dataUnit=void 0,this.entityName=void 0,this.mode=p.SERVER,this.gridConfig=void 0,this.formConfig=void 0,this.enableLockManger=!1,this._formFields=[],this._fieldsProps=new Map,this._enableContinuousInsert=!0,this.multipleSelection=void 0,this.useCancelConfirm=!0,this.pageSize=150,this.resourceID=void 0,this.enableGridInsert=!1,this.taskbarManager=void 0,this.messagesBuilder=void 0,this.useEnterLikeTab=!1,this.actionsList=void 0,this.configName=void 0,this.showConfiguratorButtons=void 0,this.gridLegacyConfigName=void 0,this.formLegacyConfigName=void 0,this.ignoreReadOnlyFormFields=!1,this.autoFocus=!0,this.domainMessagesBuilder=void 0,this.autoLoad=void 0,this.outlineMode=!1}async addCustomEditor(i,t){if(this._grid&&this._form)return this._grid.addCustomEditor(i,t),void this._form.addCustomEditor(i,t);const s=new Map(this._customEditors);s.set(i,t),this._customEditors=s}async addGridCustomRender(i,t){if(this._grid)return void this._grid.addGridCustomRender(i,t);const s=new Map(this._customRenders);s.set(i,t),this._customRenders=s}handleResourceIDChanged(i,t){o.isEmpty(i)||i!==t&&(this.loadFormConfig(!0),this.loadGridConfig(!0))}async addCustomValueFormatter(i,t){this._grid.addCustomValueFormatter(i,t)}async removeCustomValueFormatter(i){this._grid.removeCustomValueFormatter(i)}async setFieldProp(i,t,s){const e=new Map(this._fieldsProps),n=this._fieldsProps.get(i);e.set(i,Object.assign(Object.assign({},n),{[t]:s})),this._fieldsProps=e}getFinishEditionButtonsCallback(){const i=["CANCEL","SAVE"];return this.enableGridInsert&&this._currentViewMode!==v.ATTACHMENT&&i.push(this._currentViewMode===v.GRID?g.FORM_MODE:g.GRID_MODE),i}getButtons(i,t,s){let e=i?L:O;return s&&(e=e.filter((i=>i!==g.REFRESH))),this.addConfigButton(this.resolveInMemoryBtns(e).concat(t))}addConfigButton(i){return void 0===this.configName?i:i.concat(g.CONFIGURATOR)}get application(){return h.getContextValue("__SNK__APPLICATION__")}resolveInMemoryBtns(i){const t=[...i];return this.mode===p.IN_MEMORY&&t.splice(1,1),t}async goToView(i){this._currentViewMode=i,this._viewStack&&this._viewStack.show(i)}actionClickListener(i){const t=i.detail;t===g.CONFIGURATOR?this._snkConfigurator.open():t===g.GRID_MODE?this.goToView(v.GRID):t===g.FORM_MODE&&this.goToView(v.FORM),i.stopPropagation()}async onChangeEntityName(i){if(this.dataUnit)return;const t=h.getContextValue("__SNK__APPLICATION__");this.dataUnit=await t.getDataUnit(i,null,null,this.configName)}onModeChange(){this.mode==p.IN_MEMORY&&this.initInMemoryDataUnit()}observeDataState(i,t){this.handleDataStateChange(i,t)}async observeFormLegacy(i,t){await this.handleUpdateFormLegacyConfig(i,t)}async observeGridLegacy(i,t){await this.handleUpdateGridLegacyConfig(i,t)}async handleDataStateChange(i,t){a.objectToString(t)!=a.objectToString(i)&&this.dataStateChange.emit(i),await this.processRmPrecision()}async processRmPrecision(){var i,t;const s=await this._snkDataUnit.getFieldsWithRmPrecision();for(const e of s||[]){if(!e)continue;const s=null===(t=null===(i=this.dataState)||void 0===i?void 0:i.rowMetadata)||void 0===t?void 0:t.getProp("rm_precision",e);(s||0===s)&&(await this.setFieldProp(e,"precision",s),await this.setFieldProp(e,"prettyPrecision",s))}this._rmPrecisionCustomValueFormatter.setDataState(this.dataState)}async handleUpdateGridLegacyConfig(i,t){null!=i&&i!=t&&this._gridConfigAlreadyLoaded&&await this.loadGridConfig(!0)}async handleUpdateFormLegacyConfig(i,t){null!=i&&i!=t&&this._formConfigAlreadyLoaded&&this.loadFormConfig(!0)}openConfig(i){this._snkConfigurator.close(),i===v.GRID?this.openGridConfig():i===v.FORM&&this.openFormConfig()}openGridConfig(){this._grid.getColumnsState().then((i=>{this._snkGridConfig.columns=i.filter((i=>i.name)),this._snkGridConfig.selectedIndex=0,this._showPopUpGridConfig=!0}))}async openFormConfig(){(this.formLegacyConfigName||this.configName)&&await this._snkSimpleFormConfig.show()}addGridLegacyConfigName(){this.gridLegacyConfigName&&this.configName&&R.addGridLegacyConfig(this.configName,this.gridLegacyConfigName)}loadGridConfig(i){if(void 0!==this.configName&&(null==this.gridConfig&&!this._gridConfigAlreadyLoaded||i))return this.addGridLegacyConfigName(),this._gridConfigAlreadyLoaded=!0,new Promise(((i,t)=>{R.loadGridConfig(this.configName,this.resolveResourceID()).then((t=>{this.setGridConfig(t),i()})).catch((i=>{t(i)}))}))}formConfigIsLoaded(){return null!=this.formConfig||this._formConfigAlreadyLoaded}async loadFormConfig(i=!1,t=!1){if(void 0===this.configName)return;if(null==this._formConfigManager&&(this._formConfigManager=new D(this.configName,this.resolveResourceID(),void 0,this.dataUnit),this._formConfigManager.setConfig(this.formConfig)),this.formConfigIsLoaded()&&!i)return;this._formConfigAlreadyLoaded=!0;let s=await this._formConfigFetcher.fetchLegacyConfigurableForm(this.formLegacyConfigName);if(null!=s)return this._formConfigManager.setConfig(s),void this.setFormConfig(s,t);this.setFormConfig(await this._formConfigManager.loadConfig())}async componentWillRender(){this._resourceID=await this.application.getResourceID(),this.dataExporterProviderStore(),this._taskbarProcessor.process(this.getTaskBarId(),this.taskbarManager,this.dataState,this.getTaskBarDisabledButtons()),void 0!==this.configName&&(null!=this.gridConfig||this._gridConfigAlreadyLoaded||(await this.addGridLegacyConfigName(),this.loadGridConfig(),this.loadFormConfig()))}componentDidRender(){this._rmPrecisionCustomValueFormatter.setGrid(this._grid),this.addGridCustomValueFormattters(),this.setFieldsProps(),this.setCustomRenders(),this.setCustomEditors()}componentWillLoad(){this.processMetadata(),this.onModeChange(),this.configDatasource(),this._rmPrecisionCustomValueFormatter=new S,this._continuousInsertUtils=new b(this.application,this.resolveResourceID(),this.configName),this.enableGridInsert&&this._continuousInsertUtils.getConfig().then((i=>this._enableContinuousInsert=i))}componentDidLoad(){m.applyVarsGrid(this._element,this._grid),this.initKeyboardManager()}setCustomRenders(){if(this._grid)for(const[i,t]of this._customRenders)this._grid.addGridCustomRender(i,t),this._customRenders.delete(i)}setCustomEditors(){if(this._grid&&this._form)for(const[i,t]of this._customEditors)this._grid.addCustomEditor(i,t),this._form.addCustomEditor(i,t),this._customEditors.delete(i)}configDatasource(){this._multiSelectionListDataSource.setApplication(this.application),this._multiSelectionListDataSource.setDataUnit(this.dataUnit)}setFieldsProps(){if(this._form)for(const[i,t]of this._fieldsProps){for(const s in t)this._form.setFieldProp(i,s,t[s]);this._fieldsProps.delete(i)}}getTaskBarId(){var i,t;return(null===(i=this.dataState)||void 0===i?void 0:i.isDirty)?"snkSimpleCrudTaskbar.finish_edition":(null===(t=this.dataState)||void 0===t?void 0:t.selectionInfo)&&!this.dataState.selectionInfo.isAllRecords()&&this.dataState.selectionInfo.length>0?this._currentViewMode===v.GRID?"snkSimpleCrudTaskbar.grid_selected":"snkSimpleCrudTaskbar.form_selected":this._currentViewMode===v.GRID?"snkSimpleCrudTaskbar.grid_regular":"snkSimpleCrudTaskbar.form_regular"}initInMemoryDataUnit(){this._inMemoryLoader=new E(this._metadata,void 0,{autoLoad:this.autoLoad}),this.dataUnit=this._inMemoryLoader.dataUnit,this.dataUnitReady.emit(this.dataUnit)}setMetadata(i){return this._inMemoryLoader?this._inMemoryLoader.metadata=i:this.dataUnit&&(this.dataUnit.metadata=i),Promise.resolve()}setRecords(i){return this._inMemoryLoader?this._inMemoryLoader.records=i:this.dataUnit&&(this.dataUnit.records=i),Promise.resolve()}getRecords(){return Promise.resolve(this.dataUnit.records)}async openConfigurator(){var i;null===(i=this._snkConfigurator)||void 0===i||i.open()}async closeConfigurator(){var i;null===(i=this._snkConfigurator)||void 0===i||i.close()}async updateConfig(){null==this._formConfigManager&&(this._formConfigManager=new D(this.configName,this.resolveResourceID())),this._formConfigManager.setConfig(this.formConfig)}processMetadata(){const i=this._element.querySelectorAll("snk-field-metadata"),t=[],s={fields:[],emptyConfig:!1};i.forEach((i=>{const e={name:i.getAttribute("name")||i.getAttribute("label"),label:i.getAttribute("label"),dataType:r[i.getAttribute("dataType")]||r.TEXT,userInterface:n[i.getAttribute("userInterface")]||n.SHORTTEXT,readOnly:"true"==i.getAttribute("readOnly"),required:"true"==i.getAttribute("required"),tab:i.getAttribute("tab")||void 0,visible:"false"!=i.getAttribute("visible")};s.fields.push({name:e.name,tab:e.tab,visible:e.visible}),t.push(e)})),t.length>0&&(this.formConfig||(this.formConfig=s),this._metadata={name:"SimpleCrud",label:"SimpleCrud",fields:t})}addGridCustomValueFormattters(){var i,t,s;const e=(null===(i=this._metadata)||void 0===i?void 0:i.fields)||(null===(s=null===(t=this.dataUnit)||void 0===t?void 0:t.metadata)||void 0===s?void 0:s.fields);if(!e)return;const n=[];e.forEach((i=>{var t;(null===(t=i.properties)||void 0===t?void 0:t.rm_precision)&&!n.includes(i.name)&&n.push(i.name)})),n.forEach((i=>{this.addCustomValueFormatter(i,this._rmPrecisionCustomValueFormatter)}))}onDataStateChange(i){this.dataState=Object.assign({},i.detail)}getTaskBarDisabledButtons(){var i,t,s,e,n,o;const h=[];return(null===(i=this.dataState)||void 0===i?void 0:i.hasNext)||h.push(g.NEXT),(null===(t=this.dataState)||void 0===t?void 0:t.hasPrevious)||h.push(g.PREVIOUS),(null===(e=null===(s=this.dataState)||void 0===s?void 0:s.selectionInfo)||void 0===e?void 0:e.isEmpty())&&h.push(g.FORM_MODE),(null===(o=null===(n=this.dataState)||void 0===n?void 0:n.selectionInfo)||void 0===o?void 0:o.length)>1&&h.push(g.CLONE),h}handleCancelEdit(){var i;(null===(i=this.dataState)||void 0===i?void 0:i.recordsIsEmpty)&&(this.goToView(v.GRID),this.dataUnit.clearSelection())}handleConfiguratorEvent(i,t){i.stopImmediatePropagation(),"SAVE"!==t?this.configuratorCancel.emit():this.configuratorSave.emit()}getColumnSearch(i,t){return null!=this._columnSearch||(this._moreOptions=i,this._columnSearch=T(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=>{var s;null!=t&&(this._grid.locateColumn(t.value),null===(s=i.hideActions)||void 0===s||s.call(i))}))),this._columnSearch}onSelectField(i,t){null!=i&&(this._fieldToGetFocus=i.value,t.hideActions())}getFieldSearch(i,t){return null!=this._fieldSearch||(this._moreOptions=i,i.addEventListener("ezPopoverOpen",(()=>this.findField())),this._fieldSearch=T(t,(({argument:i})=>this.fieldsOptionLoader(i)),(t=>this.onSelectField(t,i)))),this._fieldSearch}getFormFields(){var i,t;return null!==(t=null===(i=this.formConfig)||void 0===i?void 0:i.fields)&&void 0!==t?t:this._formFields}handleFormSetFields(i){a.equals(this._formFields,i)||(this._formFields=null!=i?i:[])}fieldsOptionLoader(i){const t=null==i?void 0:i.toLowerCase(),s=this.getFormFields().map((i=>{var t;return null===(t=this.dataUnit)||void 0===t?void 0:t.getField(i.name)})).filter((i=>{var s,e;return(null===(s=i.name)||void 0===s?void 0:s.toLowerCase().includes(t))||(null===(e=i.label)||void 0===e?void 0:e.toLowerCase().includes(t))})).map((i=>({value:i.name,label:i.label})));return Promise.resolve(s)}isGridInsertActive(){return this.enableGridInsert&&this.dataUnit.hasNewRecord()}getActionsList(){var i,t;const s=[{value:o.generateUUID(),label:null!==(t=null===(i=this.messagesBuilder)||void 0===i?void 0:i.getMessage("snkSimpleCrud.findColumn",void 0))&&void 0!==t?t:"Buscar",disableCloseOnSelect:!0,eagerInitialize:!0,itemBuilder:(i,t)=>this._currentViewMode===v.GRID?this.getColumnSearch(i,t):this.getFieldSearch(i,t)}];if(this.enableGridInsert&&s.push(this._continuousInsertUtils.actionContinuousInsert(this._enableContinuousInsert,(()=>{this._enableContinuousInsert=!this._enableContinuousInsert,this._continuousInsertUtils.handleSaveConfig(this._enableContinuousInsert)}))),this.isGridInsertActive())return s;if(null!=this.taskbarManager&&null!=this.taskbarManager.getMoreOptions){const i=this.getTopTaskBarId();return s.concat(this.taskbarManager.getMoreOptions(i,this.configName,this.dataState,this.actionsList))}return this.actionsList?s.concat(this.actionsList):s}getTopTaskBarId(){var i;return(null===(i=this.dataState)||void 0===i?void 0:i.isDirty)?`snkGridTopTaskbar.finish_edition${w.PRIMARY}`:`snkGridTopTaskbar.regular${w.PRIMARY}`}async keyDownListener(i){i.ctrlKey&&null!=i.key&&"F"===i.key.toUpperCase()&&null!=this._element&&(d.isHiddenElement(this._element)||(l.closeAll(),this._currentViewMode===v.GRID?await this.findColumn():await this.findField(),i.preventDefault()))}async findField(){await this.openSeach(this._fieldSearch)}async findColumn(){await this.openSeach(this._columnSearch)}async openSeach(i){await F(this._moreOptions,i)}clearFieldToFocusHandler(){this._fieldToGetFocus=void 0}connectedCallback(){window.addEventListener("keydown",this._keyDownHandler,{capture:!0})}disconnectedCallback(){window.removeEventListener("keydown",this._keyDownHandler)}gridConfigChangeHandler(i){i.stopPropagation(),this.configName&&R.saveGridConfig(i.detail,this.configName,this.resolveResourceID())}modalConfigChangeHandler(i){const t=i.detail;this._grid.setColumnsState(t.columns).then((()=>{this.setGridConfig(t),this.closeGridConfig(),this.dataExporterProviderStore()})),i.stopPropagation()}async dataExporterProviderStore(){if(null==this.dataUnit)return;if(null==this._grid)return;const i=new N(this.dataUnit,this._grid);M.set("exporterProviders",Object.assign(Object.assign({},M.get("exporterProviders")),{[this.getDataExporterStoreKey()]:i}))}getDataExporterStoreKey(){return`SnkSimpleCrudDataExporter:${null==this.configName?this.dataUnit.name:this.configName}`}setGridConfig(i){this.gridConfig=i,k.assertDefaultSorting(this.gridConfig,this.dataUnit)}setFormConfig(i,t){this.formConfig&&!t||(this.formConfig=i)}closeGridConfig(){this._showPopUpGridConfig=!1}getPageSize(){return this.mode===p.IN_MEMORY?0:null==this.pageSize?150:this.pageSize}resolveResourceID(){return o.isEmpty(this.resourceID)?this._resourceID:this.resourceID}getFormConfig(){var i;const t=null===(i=this._formConfigManager)||void 0===i?void 0:i.getConfig(this.dataUnit,this.ignoreReadOnlyFormFields);return this.configName||t?t:this.formConfig}updateFormConfig(){let i=this.formConfig;null==this.formLegacyConfigName&&(i=Object.assign(Object.assign({},this.formConfig),{fields:this.dataUnit.metadata.fields})),this.setFormConfig(i,!0),null==this._formConfigManager&&(this._formConfigManager=new D(this.configName,this.resolveResourceID())),this._formConfigManager.setConfig(this.formConfig)}handleDataUnitOnInsertionMode(){this.enableGridInsert||this.goToView(v.FORM)}async initKeyboardManager(){var i;const t=new u,s=this.dataUnit||await(null===(i=this._snkDataUnit)||void 0===i?void 0:i.getDataUnit());null!=s&&t.bind("F7",(()=>s.saveData()),{description:"Salva os dados.",element:this._element}).bind("F8",s.addRecord.bind(s),{description:"Adiciona um novo registro.",element:this._element}).bind("F9",s.removeSelectedRecords.bind(s),{description:"Remove o registro selecionado.",element:this._element}).bind("Escape",(()=>{s.isDirty()&&s.cancelEdition()}),{debounceTime:1e3,description:"Cancela uma ação.",element:this._element})}async handleFormConfigSaved(){await this.loadFormConfig(!0,!0)}renderTaskbarContent(){var i;return s("snk-taskbar",{class:this._currentViewMode===v.FORM&&`ez-box ${this.outlineMode?"ez-box--outline":"ez-box--shadow-xsmall"} ez-padding--small`,dataUnit:this.dataUnit,primaryButton:(null===(i=this.dataState)||void 0===i?void 0:i.isDirty)?"SAVE":"INSERT","data-element-id":"grid_left",messagesBuilder:this.messagesBuilder,buttons:this._taskbarProcessor.buttons,actionsList:this.getActionsList(),disabledButtons:this._taskbarProcessor.disabledButtons,customButtons:this._taskbarProcessor.customButtons,"data-exporter-store-key":this.getDataExporterStoreKey(),slot:"leftButtons",presentationMode:w.SECONDARY},s("slot",{name:"TASKBAR_CUSTOM_ELEMENTS"}))}render(){var i;if(null!=this.dataUnit)return s("snk-data-unit",{ref:i=>this._snkDataUnit=i,class:"simple-crud__container",dataUnit:this.dataUnit,useCancelConfirm:this.useCancelConfirm,onDataStateChange:i=>this.onDataStateChange(i),onCancelEdition:this.handleCancelEdit.bind(this),pageSize:this.getPageSize(),onInsertionMode:this.handleDataUnitOnInsertionMode.bind(this),onDataUnitReady:i=>this.dataUnitReady.emit(i.detail),ignoreSaveMessage:this._currentViewMode===v.GRID,onMessagesBuilderUpdated:i=>this.messagesBuilder=i.detail,onDataUnitFieldsHidded:this.updateFormConfig.bind(this),domainMessagesBuilder:this.domainMessagesBuilder},s("header",null,s("slot",{name:"snkSimpleCrudHeader"})),s("section",{class:`ez-box ${this.outlineMode?"ez-box--outline":"ez-box--shadow"} simple-crud__container-section`},s("ez-view-stack",{ref:i=>this._viewStack=i,"data-element-id":"simple-crud"},s("stack-item",null,s("ez-grid",{class:"ez-margin-bottom--large",ref:i=>this._grid=i,dataUnit:this.dataUnit,config:this.gridConfig,"no-header":!0,multipleSelection:this.multipleSelection,onEzDoubleClick:()=>this.goToView(v.FORM),onConfigChange:i=>this.gridConfigChangeHandler(i),columnfilterDataSource:this.dataUnit.name&&this.dataUnit.name.includes(E.IN_MEMORY_DATA_UNIT_NAME)?void 0:this._multiSelectionListDataSource,useEnterLikeTab:this.useEnterLikeTab,autoFocus:this.autoFocus,enableGridInsert:this.enableGridInsert,enableContinuousInsert:this._enableContinuousInsert,enableLockManger:this.enableLockManger,outlineMode:this.outlineMode},this.renderTaskbarContent(),s("div",{slot:"footer"},s("slot",{name:"snkSimpleCrudFooter"})))),s("stack-item",null,this.renderTaskbarContent(),s("ez-form",{ref:i=>this._form=i,class:"ez-margin-top--large",dataUnit:this.dataUnit,config:this.getFormConfig(),fieldToFocus:this._fieldToGetFocus,onEzFormSetFields:i=>this.handleFormSetFields(i.detail),onEzFormRequestClearFieldToFocus:this.clearFieldToFocusHandler.bind(this)}),s("snk-simple-form-config",{ref:i=>this._snkSimpleFormConfig=i,dataUnit:this.dataUnit,onSnkConfigSaved:this.handleFormConfigSaved.bind(this),configName:null!==(i=this.formLegacyConfigName)&&void 0!==i?i:this.configName})),this.messagesBuilder&&s("snk-configurator",{ref:i=>this._snkConfigurator=i,viewMode:this._currentViewMode,messagesBuilder:this.messagesBuilder,onConfigSelected:i=>this.goToView(i.detail),onOpenConfig:i=>this.openConfig(i.detail),showActionButtons:this.showConfiguratorButtons,onSave:i=>this.handleConfiguratorEvent(i,"SAVE"),onCancel:i=>this.handleConfiguratorEvent(i,"CANCEL"),resourceID:this.resolveResourceID(),customContainerId:this._customContainerId})),s("div",{id:`${this._customContainerId}`},s("slot",{name:"SnkConfigContainerSlot"}))),s("ez-modal",{modalSize:"small",closeEsc:!1,closeOutsideClick:!1,opened:this._showPopUpGridConfig,onEzCloseModal:()=>this.closeGridConfig()},s("snk-grid-config",{ref:i=>this._snkGridConfig=i,config:this.gridConfig,"data-element-id":this._element.getAttribute(c.DATA_ELEMENT_ID_ATTRIBUTE_NAME),selectedIndex:0,configName:this.configName,onConfigChange:i=>this.modalConfigChangeHandler(i),onConfigCancel:()=>this.closeGridConfig(),resourceID:this.resolveResourceID()})))}get _element(){return e(this)}static get watchers(){return{resourceID:["handleResourceIDChanged"],entityName:["onChangeEntityName"],mode:["onModeChange"],dataState:["observeDataState"],formLegacyConfigName:["observeFormLegacy"],gridLegacyConfigName:["observeGridLegacy"]}}};P.style=".sc-snk-simple-crud-h{display:flex;height:100%;width:100%;--snk-simple-crud-grid--min-height:300px}.simple-crud__container.sc-snk-simple-crud{display:grid;grid-template-rows:auto 1fr;height:100%;width:100%}.simple-crud__container-section.sc-snk-simple-crud{flex-wrap:unset;flex-direction:column}.simple-crud__form--hidden.sc-snk-simple-crud{display:none}ez-grid.sc-snk-simple-crud{--ez-grid__container--shadow:none;--ez-grid__container--shadow--outline:none;--ez-grid--min-height:var(--snk-simple-crud-grid--min-height)}ez-form.sc-snk-simple-crud{min-height:300px}";export{P as snk_simple_crud}
1
+ import{r as i,c as t,h as s,g as e}from"./p-d2d301a6.js";import{UserInterface as n,StringUtils as o,ApplicationContext as h,ObjectUtils as a,DataType as r,JSUtils as d,FloatingManager as l,KeyboardManager as u,ElementIDUtils as c}from"@sankhyalabs/core";import{CSSVarsUtils as m}from"@sankhyalabs/ezui/dist/collection/utils";import{V as v,S as p}from"./p-95ce311a.js";import{T as g}from"./p-7e7a7473.js";import"./p-00278e07.js";import"./p-4be4cdac.js";import{C as f,S as C,R as S,b,a as k}from"./p-36598f95.js";import{D as y,P as w}from"./p-30cf616e.js";import"./p-21749402.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import{I as E}from"./p-58fd3017.js";import"./p-ff1990ad.js";import{F as _}from"./p-acca8a69.js";import{T as I,b as T,o as F}from"./p-23736d75.js";import{C as R}from"./p-763edad2.js";import{S as D}from"./p-fcc662c6.js";import{g as z}from"./p-7dd49d15.js";import{s as M}from"./p-6dc031de.js";import"./p-8d884fab.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";const O=["INSERT","REFRESH","PREVIOUS","NEXT","DIVIDER","MORE_OPTIONS"],L=["INSERT","REFRESH","PREVIOUS","NEXT","DIVIDER","CLONE","REMOVE","DIVIDER","MORE_OPTIONS"];class N extends f{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 z(this.dataUnit)}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__}async getRecords(){if(0===this.dataUnit.records.length)return Promise.resolve([]);const i=this.dataUnit.getSelectionInfo(),t=i.isEmpty()||i.isAllRecords()?await i.getAllRecords():i.records;return Promise.resolve(null==t?[]:t)}getHiddenOptions(){return[y.EXPORT_BY_EMAIL,y.EXPORT_PDF_TO_EMAIL,y.EXPORT_XLS_TO_EMAIL,y.EXPORT_PAGE_TO_PDF,y.EXPORT_PAGE_TO_XLS]}formatValue(i,t){const{id:s,descriptionFrom:e}=t,o=i[e||s];if(null==o)return"";if(null!=e)return o.label;if(this.dataUnit.getField(s).userInterface===n.SEARCH)return o.value;if(t.customFormatter){const s=this.getColumnsState().find((i=>t.id===i.name));return t.customFormatter.format(o,s,i.__record__id__)}return this.dataUnit.getFormattedValue(s,o)}}const P=class{constructor(s){i(this,s),this.dataStateChange=t(this,"dataStateChange",3),this.dataUnitReady=t(this,"dataUnitReady",3),this.actionClick=t(this,"actionClick",7),this.formItemsReady=t(this,"formItemsReady",7),this.configuratorSave=t(this,"configuratorSave",7),this.configuratorCancel=t(this,"configuratorCancel",7),this._multiSelectionListDataSource=new C,this._keyDownHandler=i=>this.keyDownListener(i),this._formConfigFetcher=new _,this._customEditors=new Map,this._customRenders=new Map,this._taskbarProcessor=new I({"snkSimpleCrudTaskbar.form_regular":this.getButtons(!1,[g.GRID_MODE],!0),"snkSimpleCrudTaskbar.grid_regular":this.getButtons(!1,[g.DATA_EXPORTER,g.FORM_MODE]),"snkSimpleCrudTaskbar.form_selected":this.getButtons(!0,[g.GRID_MODE],!0),"snkSimpleCrudTaskbar.grid_selected":this.getButtons(!0,[g.DATA_EXPORTER,g.FORM_MODE]),"snkSimpleCrudTaskbar.finish_edition":this.getFinishEditionButtonsCallback.bind(this)}),this._showPopUpGridConfig=!1,this._currentViewMode=v.GRID,this._config=void 0,this._fieldToGetFocus=void 0,this._customContainerId=`SNK-SIMPLE-CRUD-CUSTOM-CONTAINER-${o.generateUUID()}`,this.dataState=void 0,this.dataUnit=void 0,this.entityName=void 0,this.mode=p.SERVER,this.gridConfig=void 0,this.formConfig=void 0,this.enableLockManger=!1,this._formFields=[],this._fieldsProps=new Map,this._enableContinuousInsert=!0,this.multipleSelection=void 0,this.useCancelConfirm=!0,this.pageSize=150,this.resourceID=void 0,this.enableGridInsert=!1,this.taskbarManager=void 0,this.messagesBuilder=void 0,this.useEnterLikeTab=!1,this.actionsList=void 0,this.configName=void 0,this.showConfiguratorButtons=void 0,this.gridLegacyConfigName=void 0,this.formLegacyConfigName=void 0,this.ignoreReadOnlyFormFields=!1,this.autoFocus=!0,this.domainMessagesBuilder=void 0,this.autoLoad=void 0,this.outlineMode=!1}async addCustomEditor(i,t){if(this._grid&&this._form)return this._grid.addCustomEditor(i,t),void this._form.addCustomEditor(i,t);const s=new Map(this._customEditors);s.set(i,t),this._customEditors=s}async addGridCustomRender(i,t){if(this._grid)return void this._grid.addGridCustomRender(i,t);const s=new Map(this._customRenders);s.set(i,t),this._customRenders=s}handleResourceIDChanged(i,t){o.isEmpty(i)||i!==t&&(this.loadFormConfig(!0),this.loadGridConfig(!0))}async addCustomValueFormatter(i,t){this._grid.addCustomValueFormatter(i,t)}async removeCustomValueFormatter(i){this._grid.removeCustomValueFormatter(i)}async setFieldProp(i,t,s){const e=new Map(this._fieldsProps),n=this._fieldsProps.get(i);e.set(i,Object.assign(Object.assign({},n),{[t]:s})),this._fieldsProps=e}getFinishEditionButtonsCallback(){const i=["CANCEL","SAVE"];return this.enableGridInsert&&this._currentViewMode!==v.ATTACHMENT&&i.push(this._currentViewMode===v.GRID?g.FORM_MODE:g.GRID_MODE),i}getButtons(i,t,s){let e=i?L:O;return s&&(e=e.filter((i=>i!==g.REFRESH))),this.addConfigButton(this.resolveInMemoryBtns(e).concat(t))}addConfigButton(i){return void 0===this.configName?i:i.concat(g.CONFIGURATOR)}get application(){return h.getContextValue("__SNK__APPLICATION__")}resolveInMemoryBtns(i){const t=[...i];return this.mode===p.IN_MEMORY&&t.splice(1,1),t}async goToView(i){this._currentViewMode=i,this._viewStack&&this._viewStack.show(i)}actionClickListener(i){const t=i.detail;t===g.CONFIGURATOR?this._snkConfigurator.open():t===g.GRID_MODE?this.goToView(v.GRID):t===g.FORM_MODE&&this.goToView(v.FORM),i.stopPropagation()}async onChangeEntityName(i){if(this.dataUnit)return;const t=h.getContextValue("__SNK__APPLICATION__");this.dataUnit=await t.getDataUnit(i,null,null,this.configName)}onModeChange(){this.mode==p.IN_MEMORY&&this.initInMemoryDataUnit()}observeDataState(i,t){this.handleDataStateChange(i,t)}async observeFormLegacy(i,t){await this.handleUpdateFormLegacyConfig(i,t)}async observeGridLegacy(i,t){await this.handleUpdateGridLegacyConfig(i,t)}async handleDataStateChange(i,t){a.objectToString(t)!=a.objectToString(i)&&this.dataStateChange.emit(i),await this.processRmPrecision()}async processRmPrecision(){var i,t;const s=await this._snkDataUnit.getFieldsWithRmPrecision();for(const e of s||[]){if(!e)continue;const s=null===(t=null===(i=this.dataState)||void 0===i?void 0:i.rowMetadata)||void 0===t?void 0:t.getProp("rm_precision",e);(s||0===s)&&(await this.setFieldProp(e,"precision",s),await this.setFieldProp(e,"prettyPrecision",s))}this._rmPrecisionCustomValueFormatter.setDataState(this.dataState)}async handleUpdateGridLegacyConfig(i,t){null!=i&&i!=t&&this._gridConfigAlreadyLoaded&&await this.loadGridConfig(!0)}async handleUpdateFormLegacyConfig(i,t){null!=i&&i!=t&&this._formConfigAlreadyLoaded&&this.loadFormConfig(!0)}openConfig(i){this._snkConfigurator.close(),i===v.GRID?this.openGridConfig():i===v.FORM&&this.openFormConfig()}openGridConfig(){this._grid.getColumnsState().then((i=>{this._snkGridConfig.columns=i.filter((i=>i.name)),this._snkGridConfig.selectedIndex=0,this._showPopUpGridConfig=!0}))}async openFormConfig(){(this.formLegacyConfigName||this.configName)&&await this._snkSimpleFormConfig.show()}addGridLegacyConfigName(){this.gridLegacyConfigName&&this.configName&&R.addGridLegacyConfig(this.configName,this.gridLegacyConfigName)}loadGridConfig(i){if(void 0!==this.configName&&(null==this.gridConfig&&!this._gridConfigAlreadyLoaded||i))return this.addGridLegacyConfigName(),this._gridConfigAlreadyLoaded=!0,new Promise(((i,t)=>{R.loadGridConfig(this.configName,this.resolveResourceID()).then((t=>{this.setGridConfig(t),i()})).catch((i=>{t(i)}))}))}formConfigIsLoaded(){return null!=this.formConfig||this._formConfigAlreadyLoaded}async loadFormConfig(i=!1,t=!1){if(void 0===this.configName)return;if(null==this._formConfigManager&&(this._formConfigManager=new D(this.configName,this.resolveResourceID(),void 0,this.dataUnit),this._formConfigManager.setConfig(this.formConfig)),this.formConfigIsLoaded()&&!i)return;this._formConfigAlreadyLoaded=!0;let s=await this._formConfigFetcher.fetchLegacyConfigurableForm(this.formLegacyConfigName);if(null!=s)return this._formConfigManager.setConfig(s),void this.setFormConfig(s,t);this.setFormConfig(await this._formConfigManager.loadConfig())}async componentWillRender(){this._resourceID=await this.application.getResourceID(),this.dataExporterProviderStore(),this._taskbarProcessor.process(this.getTaskBarId(),this.taskbarManager,this.dataState,this.getTaskBarDisabledButtons()),void 0!==this.configName&&(null!=this.gridConfig||this._gridConfigAlreadyLoaded||(await this.addGridLegacyConfigName(),this.loadGridConfig(),this.loadFormConfig()))}componentDidRender(){this._rmPrecisionCustomValueFormatter.setGrid(this._grid),this.addGridCustomValueFormattters(),this.setFieldsProps(),this.setCustomRenders(),this.setCustomEditors()}componentWillLoad(){this.processMetadata(),this.onModeChange(),this.configDatasource(),this._rmPrecisionCustomValueFormatter=new S,this._continuousInsertUtils=new b(this.application,this.resolveResourceID(),this.configName),this.enableGridInsert&&this._continuousInsertUtils.getConfig().then((i=>this._enableContinuousInsert=i))}componentDidLoad(){m.applyVarsGrid(this._element,this._grid),this.initKeyboardManager()}setCustomRenders(){if(this._grid)for(const[i,t]of this._customRenders)this._grid.addGridCustomRender(i,t),this._customRenders.delete(i)}setCustomEditors(){if(this._grid&&this._form)for(const[i,t]of this._customEditors)this._grid.addCustomEditor(i,t),this._form.addCustomEditor(i,t),this._customEditors.delete(i)}configDatasource(){this._multiSelectionListDataSource.setApplication(this.application),this._multiSelectionListDataSource.setDataUnit(this.dataUnit)}setFieldsProps(){if(this._form)for(const[i,t]of this._fieldsProps){for(const s in t)this._form.setFieldProp(i,s,t[s]);this._fieldsProps.delete(i)}}getTaskBarId(){var i,t;return(null===(i=this.dataState)||void 0===i?void 0:i.isDirty)?"snkSimpleCrudTaskbar.finish_edition":(null===(t=this.dataState)||void 0===t?void 0:t.selectionInfo)&&!this.dataState.selectionInfo.isAllRecords()&&this.dataState.selectionInfo.length>0?this._currentViewMode===v.GRID?"snkSimpleCrudTaskbar.grid_selected":"snkSimpleCrudTaskbar.form_selected":this._currentViewMode===v.GRID?"snkSimpleCrudTaskbar.grid_regular":"snkSimpleCrudTaskbar.form_regular"}initInMemoryDataUnit(){this._inMemoryLoader=new E(this._metadata,void 0,{autoLoad:this.autoLoad}),this.dataUnit=this._inMemoryLoader.dataUnit,this.dataUnitReady.emit(this.dataUnit)}setMetadata(i){return this._inMemoryLoader?this._inMemoryLoader.metadata=i:this.dataUnit&&(this.dataUnit.metadata=i),Promise.resolve()}setRecords(i){return this._inMemoryLoader?this._inMemoryLoader.records=i:this.dataUnit&&(this.dataUnit.records=i),Promise.resolve()}getRecords(){return Promise.resolve(this.dataUnit.records)}async openConfigurator(){var i;null===(i=this._snkConfigurator)||void 0===i||i.open()}async closeConfigurator(){var i;null===(i=this._snkConfigurator)||void 0===i||i.close()}async updateConfig(){null==this._formConfigManager&&(this._formConfigManager=new D(this.configName,this.resolveResourceID())),this._formConfigManager.setConfig(this.formConfig)}processMetadata(){const i=this._element.querySelectorAll("snk-field-metadata"),t=[],s={fields:[],emptyConfig:!1};i.forEach((i=>{const e={name:i.getAttribute("name")||i.getAttribute("label"),label:i.getAttribute("label"),dataType:r[i.getAttribute("dataType")]||r.TEXT,userInterface:n[i.getAttribute("userInterface")]||n.SHORTTEXT,readOnly:"true"==i.getAttribute("readOnly"),required:"true"==i.getAttribute("required"),tab:i.getAttribute("tab")||void 0,visible:"false"!=i.getAttribute("visible")};s.fields.push({name:e.name,tab:e.tab,visible:e.visible}),t.push(e)})),t.length>0&&(this.formConfig||(this.formConfig=s),this._metadata={name:"SimpleCrud",label:"SimpleCrud",fields:t})}addGridCustomValueFormattters(){var i,t,s;const e=(null===(i=this._metadata)||void 0===i?void 0:i.fields)||(null===(s=null===(t=this.dataUnit)||void 0===t?void 0:t.metadata)||void 0===s?void 0:s.fields);if(!e)return;const n=[];e.forEach((i=>{var t;(null===(t=i.properties)||void 0===t?void 0:t.rm_precision)&&!n.includes(i.name)&&n.push(i.name)})),n.forEach((i=>{this.addCustomValueFormatter(i,this._rmPrecisionCustomValueFormatter)}))}onDataStateChange(i){this.dataState=Object.assign({},i.detail)}getTaskBarDisabledButtons(){var i,t,s,e,n,o;const h=[];return(null===(i=this.dataState)||void 0===i?void 0:i.hasNext)||h.push(g.NEXT),(null===(t=this.dataState)||void 0===t?void 0:t.hasPrevious)||h.push(g.PREVIOUS),(null===(e=null===(s=this.dataState)||void 0===s?void 0:s.selectionInfo)||void 0===e?void 0:e.isEmpty())&&h.push(g.FORM_MODE),(null===(o=null===(n=this.dataState)||void 0===n?void 0:n.selectionInfo)||void 0===o?void 0:o.length)>1&&h.push(g.CLONE),h}handleCancelEdit(){var i;(null===(i=this.dataState)||void 0===i?void 0:i.recordsIsEmpty)&&(this.goToView(v.GRID),this.dataUnit.clearSelection())}handleConfiguratorEvent(i,t){i.stopImmediatePropagation(),"SAVE"!==t?this.configuratorCancel.emit():this.configuratorSave.emit()}getColumnSearch(i,t){return null!=this._columnSearch||(this._moreOptions=i,this._columnSearch=T(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=>{var s;null!=t&&(this._grid.locateColumn(t.value),null===(s=i.hideActions)||void 0===s||s.call(i))}))),this._columnSearch}onSelectField(i,t){null!=i&&(this._fieldToGetFocus=i.value,t.hideActions())}getFieldSearch(i,t){return null!=this._fieldSearch||(this._moreOptions=i,i.addEventListener("ezPopoverOpen",(()=>this.findField())),this._fieldSearch=T(t,(({argument:i})=>this.fieldsOptionLoader(i)),(t=>this.onSelectField(t,i)))),this._fieldSearch}getFormFields(){var i,t;return null!==(t=null===(i=this.formConfig)||void 0===i?void 0:i.fields)&&void 0!==t?t:this._formFields}handleFormSetFields(i){a.equals(this._formFields,i)||(this._formFields=null!=i?i:[])}fieldsOptionLoader(i){const t=null==i?void 0:i.toLowerCase(),s=this.getFormFields().map((i=>{var t;return null===(t=this.dataUnit)||void 0===t?void 0:t.getField(i.name)})).filter((i=>{var s,e;return(null===(s=i.name)||void 0===s?void 0:s.toLowerCase().includes(t))||(null===(e=i.label)||void 0===e?void 0:e.toLowerCase().includes(t))})).map((i=>({value:i.name,label:i.label})));return Promise.resolve(s)}isGridInsertActive(){return this.enableGridInsert&&this.dataUnit.hasNewRecord()}getActionsList(){var i,t;const s=[{value:o.generateUUID(),label:null!==(t=null===(i=this.messagesBuilder)||void 0===i?void 0:i.getMessage("snkSimpleCrud.findColumn",void 0))&&void 0!==t?t:"Buscar",disableCloseOnSelect:!0,eagerInitialize:!0,itemBuilder:(i,t)=>this._currentViewMode===v.GRID?this.getColumnSearch(i,t):this.getFieldSearch(i,t)}];if(this.enableGridInsert&&s.push(this._continuousInsertUtils.actionContinuousInsert(this._enableContinuousInsert,(()=>{this._enableContinuousInsert=!this._enableContinuousInsert,this._continuousInsertUtils.handleSaveConfig(this._enableContinuousInsert)}))),this.isGridInsertActive())return s;if(null!=this.taskbarManager&&null!=this.taskbarManager.getMoreOptions){const i=this.getTopTaskBarId();return s.concat(this.taskbarManager.getMoreOptions(i,this.configName,this.dataState,this.actionsList))}return this.actionsList?s.concat(this.actionsList):s}getTopTaskBarId(){var i;return(null===(i=this.dataState)||void 0===i?void 0:i.isDirty)?`snkGridTopTaskbar.finish_edition${w.PRIMARY}`:`snkGridTopTaskbar.regular${w.PRIMARY}`}async keyDownListener(i){i.ctrlKey&&null!=i.key&&"F"===i.key.toUpperCase()&&null!=this._element&&(d.isHiddenElement(this._element)||(l.closeAll(),this._currentViewMode===v.GRID?await this.findColumn():await this.findField(),i.preventDefault()))}async findField(){await this.openSeach(this._fieldSearch)}async findColumn(){await this.openSeach(this._columnSearch)}async openSeach(i){await F(this._moreOptions,i)}clearFieldToFocusHandler(){this._fieldToGetFocus=void 0}connectedCallback(){window.addEventListener("keydown",this._keyDownHandler,{capture:!0})}disconnectedCallback(){window.removeEventListener("keydown",this._keyDownHandler)}gridConfigChangeHandler(i){i.stopPropagation(),this.configName&&R.saveGridConfig(i.detail,this.configName,this.resolveResourceID())}modalConfigChangeHandler(i){const t=i.detail;this._grid.setColumnsState(t.columns).then((()=>{this.setGridConfig(t),this.closeGridConfig(),this.dataExporterProviderStore()})),i.stopPropagation()}async dataExporterProviderStore(){if(null==this.dataUnit)return;if(null==this._grid)return;const i=new N(this.dataUnit,this._grid);M.set("exporterProviders",Object.assign(Object.assign({},M.get("exporterProviders")),{[this.getDataExporterStoreKey()]:i}))}getDataExporterStoreKey(){return`SnkSimpleCrudDataExporter:${null==this.configName?this.dataUnit.name:this.configName}`}setGridConfig(i){this.gridConfig=i,k.assertDefaultSorting(this.gridConfig,this.dataUnit)}setFormConfig(i,t){this.formConfig&&!t||(this.formConfig=i)}closeGridConfig(){this._showPopUpGridConfig=!1}getPageSize(){return this.mode===p.IN_MEMORY?0:null==this.pageSize?150:this.pageSize}resolveResourceID(){return o.isEmpty(this.resourceID)?this._resourceID:this.resourceID}getFormConfig(){var i;const t=null===(i=this._formConfigManager)||void 0===i?void 0:i.getConfig(this.dataUnit,this.ignoreReadOnlyFormFields);return this.configName||t?t:this.formConfig}updateFormConfig(){let i=this.formConfig;null==this.formLegacyConfigName&&(i=Object.assign(Object.assign({},this.formConfig),{fields:this.dataUnit.metadata.fields})),this.setFormConfig(i,!0),null==this._formConfigManager&&(this._formConfigManager=new D(this.configName,this.resolveResourceID())),this._formConfigManager.setConfig(this.formConfig)}handleDataUnitOnInsertionMode(){this.enableGridInsert||this.goToView(v.FORM)}async initKeyboardManager(){var i;const t=new u,s=this.dataUnit||await(null===(i=this._snkDataUnit)||void 0===i?void 0:i.getDataUnit());null!=s&&t.bind("F7",(()=>s.saveData()),{description:"Salva os dados.",element:this._element}).bind("F8",s.addRecord.bind(s),{description:"Adiciona um novo registro.",element:this._element}).bind("F9",s.removeSelectedRecords.bind(s),{description:"Remove o registro selecionado.",element:this._element}).bind("Escape",(()=>{s.isDirty()&&s.cancelEdition()}),{debounceTime:1e3,description:"Cancela uma ação.",element:this._element})}async handleFormConfigSaved(){await this.loadFormConfig(!0,!0)}renderTaskbarContent(){var i;return s("snk-taskbar",{class:this._currentViewMode===v.FORM&&`ez-box ${this.outlineMode?"ez-box--outline":"ez-box--shadow-xsmall"} ez-padding--small`,dataUnit:this.dataUnit,primaryButton:(null===(i=this.dataState)||void 0===i?void 0:i.isDirty)?"SAVE":"INSERT","data-element-id":"grid_left",messagesBuilder:this.messagesBuilder,buttons:this._taskbarProcessor.buttons,actionsList:this.getActionsList(),disabledButtons:this._taskbarProcessor.disabledButtons,customButtons:this._taskbarProcessor.customButtons,"data-exporter-store-key":this.getDataExporterStoreKey(),slot:"leftButtons",presentationMode:w.SECONDARY},s("slot",{name:"TASKBAR_CUSTOM_ELEMENTS"}))}render(){var i;if(null!=this.dataUnit)return s("snk-data-unit",{ref:i=>this._snkDataUnit=i,class:"simple-crud__container",dataUnit:this.dataUnit,useCancelConfirm:this.useCancelConfirm,onDataStateChange:i=>this.onDataStateChange(i),onCancelEdition:this.handleCancelEdit.bind(this),pageSize:this.getPageSize(),onInsertionMode:this.handleDataUnitOnInsertionMode.bind(this),onDataUnitReady:i=>this.dataUnitReady.emit(i.detail),ignoreSaveMessage:this._currentViewMode===v.GRID,onMessagesBuilderUpdated:i=>this.messagesBuilder=i.detail,onDataUnitFieldsHidded:this.updateFormConfig.bind(this),domainMessagesBuilder:this.domainMessagesBuilder},s("header",null,s("slot",{name:"snkSimpleCrudHeader"})),s("section",{class:`ez-box ${this.outlineMode?"ez-box--outline":"ez-box--shadow"} simple-crud__container-section`},s("ez-view-stack",{ref:i=>this._viewStack=i,"data-element-id":"simple-crud"},s("stack-item",null,s("ez-grid",{class:"ez-margin-bottom--large",ref:i=>this._grid=i,dataUnit:this.dataUnit,config:this.gridConfig,"no-header":!0,multipleSelection:this.multipleSelection,onEzDoubleClick:()=>this.goToView(v.FORM),onConfigChange:i=>this.gridConfigChangeHandler(i),columnfilterDataSource:this.dataUnit.name&&this.dataUnit.name.includes(E.IN_MEMORY_DATA_UNIT_NAME)?void 0:this._multiSelectionListDataSource,useEnterLikeTab:this.useEnterLikeTab,autoFocus:this.autoFocus,enableGridInsert:this.enableGridInsert,enableContinuousInsert:this._enableContinuousInsert,enableLockManger:this.enableLockManger,outlineMode:this.outlineMode},this.renderTaskbarContent(),s("div",{slot:"footer"},s("slot",{name:"snkSimpleCrudFooter"})))),s("stack-item",null,this.renderTaskbarContent(),s("ez-form",{ref:i=>this._form=i,class:"ez-margin-top--large",dataUnit:this.dataUnit,config:this.getFormConfig(),fieldToFocus:this._fieldToGetFocus,onEzFormSetFields:i=>this.handleFormSetFields(i.detail),onEzFormRequestClearFieldToFocus:this.clearFieldToFocusHandler.bind(this)}),s("snk-simple-form-config",{ref:i=>this._snkSimpleFormConfig=i,dataUnit:this.dataUnit,onSnkConfigSaved:this.handleFormConfigSaved.bind(this),configName:null!==(i=this.formLegacyConfigName)&&void 0!==i?i:this.configName})),this.messagesBuilder&&s("snk-configurator",{ref:i=>this._snkConfigurator=i,viewMode:this._currentViewMode,messagesBuilder:this.messagesBuilder,onConfigSelected:i=>this.goToView(i.detail),onOpenConfig:i=>this.openConfig(i.detail),showActionButtons:this.showConfiguratorButtons,onSave:i=>this.handleConfiguratorEvent(i,"SAVE"),onCancel:i=>this.handleConfiguratorEvent(i,"CANCEL"),resourceID:this.resolveResourceID(),customContainerId:this._customContainerId})),s("div",{id:`${this._customContainerId}`},s("slot",{name:"SnkConfigContainerSlot"}))),s("ez-modal",{modalSize:"small",closeEsc:!1,closeOutsideClick:!1,opened:this._showPopUpGridConfig,onEzCloseModal:()=>this.closeGridConfig()},s("snk-grid-config",{ref:i=>this._snkGridConfig=i,config:this.gridConfig,"data-element-id":this._element.getAttribute(c.DATA_ELEMENT_ID_ATTRIBUTE_NAME),selectedIndex:0,configName:this.configName,onConfigChange:i=>this.modalConfigChangeHandler(i),onConfigCancel:()=>this.closeGridConfig(),resourceID:this.resolveResourceID()})))}get _element(){return e(this)}static get watchers(){return{resourceID:["handleResourceIDChanged"],entityName:["onChangeEntityName"],mode:["onModeChange"],dataState:["observeDataState"],formLegacyConfigName:["observeFormLegacy"],gridLegacyConfigName:["observeGridLegacy"]}}};P.style=".sc-snk-simple-crud-h{display:flex;height:100%;width:100%;--snk-simple-crud-grid--min-height:300px}.simple-crud__container.sc-snk-simple-crud{display:grid;grid-template-rows:auto 1fr;height:100%;width:100%}.simple-crud__container-section.sc-snk-simple-crud{flex-wrap:unset;flex-direction:column}.simple-crud__form--hidden.sc-snk-simple-crud{display:none}ez-grid.sc-snk-simple-crud{--ez-grid__container--shadow:none;--ez-grid__container--shadow--outline:none;--ez-grid--min-height:var(--snk-simple-crud-grid--min-height)}ez-form.sc-snk-simple-crud{min-height:300px}";export{P as snk_simple_crud}
Binary file
Binary file
Binary file
@@ -1 +1 @@
1
- import{r as t,h as e,H as i,g as s}from"./p-d2d301a6.js";import{ApplicationContext as o,ObjectUtils as r,UserInterface as n,DataType as l,ElementIDUtils as a}from"@sankhyalabs/core";import{ApplicationUtils as d,DialogType as h}from"@sankhyalabs/ezui/dist/collection/utils";import{D as c,a as u,b as p}from"./p-30cf616e.js";import{R as m}from"./p-95ce311a.js";import{D as v}from"./p-00278e07.js";import{S as x}from"./p-342eeb3b.js";import"./p-e6683406.js";import"./p-21749402.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-47d24ac8.js";import"./p-ff1990ad.js";import"./p-acca8a69.js";import"./p-8d884fab.js";import"./p-17425c72.js";import"@sankhyalabs/core/dist/dataunit/metadata/DataType";import"./p-7dd49d15.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";class g{constructor(t,e){this._selectedNumber=0,this._getMessage=t,this._selectedNumber=e}setExportOption(t,e){const i=this.getExportGroupName();t===c.EXPORT_TO_PDF&&e.push(this.getExportToPDF(i)),t===c.EXPORT_TO_XLS&&e.push(this.getExportToXLS(i)),this.setExportCurrentPage(t,e),this._selectedNumber>0&&this.setExportAllRecords(t,e),this.setExportByEmail(t,e)}setExportCurrentPage(t,e){var i;const s=[c.EXPORT_PAGE_TO_PDF,c.EXPORT_PAGE_TO_XLS];if(t===c.EXPORT_CURRENT_PAGE&&e.push(this.getCurrentPage()),s.includes(t)){let s=e.find((t=>t.id===c.EXPORT_CURRENT_PAGE));null==s&&(e.push(this.getCurrentPage()),s=e.find((t=>t.id===c.EXPORT_CURRENT_PAGE))),(null===(i=null==s?void 0:s.children)||void 0===i?void 0:i.length)||(s.children=[]),t===c.EXPORT_PAGE_TO_PDF&&s.children.push(this.getExportPageToPDF()),t===c.EXPORT_PAGE_TO_XLS&&s.children.push(this.getExportPageToXLS())}}setExportAllRecords(t,e){var i;const s=[c.EXPORT_ALL_RECORDS_TO_PDF,c.EXPORT_ALL_RECORDS_TO_XLS];if(t===c.EXPORT_ALL_RECORDS&&e.push(this.getAllRecords()),s.includes(t)){let s=e.find((t=>t.id===c.EXPORT_ALL_RECORDS));null==s&&(e.push(this.getAllRecords()),s=e.find((t=>t.id===c.EXPORT_ALL_RECORDS))),(null===(i=s.children)||void 0===i?void 0:i.length)||(s.children=[]),t===c.EXPORT_ALL_RECORDS_TO_PDF&&s.children.push(this.getExportAllRecordsToPDF()),t===c.EXPORT_ALL_RECORDS_TO_XLS&&s.children.push(this.getExportAllRecordsToXLS())}}setExportByEmail(t,e){t===c.EXPORT_BY_EMAIL&&e.push(this.getExportByEmail())}getExportToPDF(t){return{id:c.EXPORT_TO_PDF,label:"PDF (.pdf)",group:t}}getExportToXLS(t){return{id:c.EXPORT_TO_XLS,label:`${this._getMessage("snkDataExporter.label.spreadsheet")} (.xls)`,group:t}}getCurrentPage(){return{id:c.EXPORT_CURRENT_PAGE,label:this._getMessage("snkDataExporter.label.currentPage"),group:this._getMessage("snkDataExporter.group.custom")}}getAllRecords(){return{id:c.EXPORT_ALL_RECORDS,label:this._getMessage("snkDataExporter.label.allRecords"),group:this._getMessage("snkDataExporter.group.custom")}}getExportPageToPDF(){return{id:c.EXPORT_PAGE_TO_PDF,label:"PDF (.pdf)"}}getExportPageToXLS(){return{id:c.EXPORT_PAGE_TO_XLS,label:`${this._getMessage("snkDataExporter.label.spreadsheet")} (.xls)`}}getExportAllRecordsToPDF(){return{id:c.EXPORT_ALL_RECORDS_TO_PDF,label:"PDF (.pdf)"}}getExportAllRecordsToXLS(){return{id:c.EXPORT_ALL_RECORDS_TO_XLS,label:`${this._getMessage("snkDataExporter.label.spreadsheet")} (.xlsx)`}}getExportByEmail(){return{id:c.EXPORT_BY_EMAIL,label:`${this._getMessage("snkDataExporter.label.sendByEmail")}...`}}getExportGroupName(){return 1===this._selectedNumber?this._getMessage("snkDataExporter.group.export.selectedLine"):this._selectedNumber>1?this._getMessage("snkDataExporter.group.export.multiSelected").replace("{0}",this._selectedNumber.toString()):this._getMessage("snkDataExporter.group.export.default")}}function f(t){const e=[];let i=0;for(const s of t){if(i+=s.width,i>=760)break;e.push(s)}return e}function b(t){return Object.keys(c).find((e=>c[e]===t))}class E{constructor(t){this._provider=t}async getParsedColumns(){return f(await this._provider.getColumnsMetadata())}async getColumns(t){var e;return(null===(e=b(null==t?void 0:t.exportOption))||void 0===e?void 0:e.includes("PDF"))?await this.getParsedColumns():await this._provider.getColumnsMetadata()}async getParams(t){var e,i,s,o,r,n;const l=null===(i=(e=this._provider).getFilters)||void 0===i?void 0:i.call(e),a=await this.getColumns(t),d=null===(o=(s=this._provider).getOrders)||void 0===o?void 0:o.call(s),h=null===(n=(r=this._provider).getResourceURI)||void 0===n?void 0:n.call(r),u=this._provider.getSelectedIDs(),p=t.exportOption,m=[c.EXPORT_PAGE_TO_PDF,c.EXPORT_PAGE_TO_XLS];delete t.exportOption;let v=Object.assign({filters:l,columns:a,sort:d,resourceURI:h,selectedIDs:u.slice(0,this._provider.getExportLimit())},t);if(m.includes(p)||"page"==t.type){const t=this._provider.getOffset(),e=this._provider.getPageSize();v=Object.assign(Object.assign({},v),{offset:t,limit:e,selectedIDs:[]})}else"all"==t.type&&(v=Object.assign(Object.assign({},v),{offset:0,limit:this._provider.getExportLimit(),selectedIDs:[]}));return Promise.resolve(v)}async executeExport(t){const e=await this.getParams(t),{methodName:i}=e,s=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(s=Object.getOwnPropertySymbols(t);o<s.length;o++)e.indexOf(s[o])<0&&Object.prototype.propertyIsEnumerable.call(t,s[o])&&(i[s[o]]=t[s[o]])}return i}(e,["methodName"]),n=`${o.getContextValue("__SNK__APPLICATION__").getModuleName()}@DataExporterSPBean.${i}`,l={serviceName:n,requestBody:s};return new Promise(((t,e)=>{v.get().callServiceBroker(n,r.objectToString(l)).then((e=>t(this.getFormatResponse(e)))).catch((t=>e(t)))}))}getFormatResponse(t){var e;const i=null===(e=null==t?void 0:t.json)||void 0===e?void 0:e.$;if(null!=i)return r.stringToObject(i)}}class w{constructor(t){this._provider=t}async getParsedColumns(){return f(await this._provider.getColumnsMetadata())}async getColumns(t){var e;return(null===(e=b(null==t?void 0:t.exportOption))||void 0===e?void 0:e.includes("PDF"))?await this.getParsedColumns():await this._provider.getColumnsMetadata()}async executeExport(t){const{methodName:e,gridTitle:i}=t,s=await this._provider.getRecords(),o=await this.getColumns(t),[r,n]=this.getExecutor(e),l={serviceName:r,requestBody:{grid:{gridTitle:i,columns:this.buildColumnsObject(o),rows:this.buildRowsObject(o,s),customOptions:{xlsxExtension:!1}}}};return new Promise(((t,e)=>{v.get().callServiceBroker(r,l).then((e=>t(n(e)))).catch((t=>e(t)))}))}getExecutor(t){return"exportToPDF"===t?["GridPDFBuilderSP.buildPDFFromJson",t=>({fileSessionKey:t.chavePDF.valor,canPrint:"S"===t.permiteImprimir.valor,canExport:"S"===t.permiteExportar.valor,canSendEmail:"S"===t.canSendEmail.valor,useAppPrint:!0})]:["GridXLSBuilderSP.buildXLSFromJson",t=>({fileSessionKey:t.chaveXLS.valor,canPrint:!0,canExport:!0,canSendEmail:!0,useAppPrint:!1})]}buildColumnsObject(t){return{column:t.map(((t,e)=>{const{label:i,id:s,width:o,userInterface:r}=t;return Object.assign({index:e+1,id:s,label:i,width:o,presentationType:"P"},D[r]||{type:"S",align:"left"})}))}}buildRowsObject(t,e){return{row:e.map((e=>{const i={};return t.forEach(((t,s)=>i["c"+(s+1)]={$:this.formatValue(e,t)})),i}))}}formatValue(t,e){return null!=this._provider.formatValue?this._provider.formatValue(t,e):t[e.id]||""}}const D={[n.DATE]:{type:"D",align:"center"},[n.DATETIME]:{type:"H",align:"center"},[n.TIME]:{type:"I",align:"right"},[n.ELAPSEDTIME]:{type:"I",align:"right"},[n.DECIMALNUMBER]:{type:"F",align:"right"},[n.INTEGERNUMBER]:{type:"I",align:"right"},[n.SEARCH]:{type:"S",align:"right"}},k=class{constructor(e){t(this,e),this._selectedNumber=0,this._customPrefix="$custom$",this._releasedToExport=[c.EXPORT_TO_PDF,c.EXPORT_TO_XLS,c.EXPORT_BY_EMAIL,c.EXPORT_PDF_TO_EMAIL,c.EXPORT_XLS_TO_EMAIL,c.EXPORT_PAGE_TO_PDF,c.EXPORT_PAGE_TO_XLS,c.EXPORT_ALL_RECORDS_TO_PDF,c.EXPORT_ALL_RECORDS_TO_XLS],this._items=[],this._showDropdown=!1,this.provider=null,this.messagesBuilder=void 0}async exportByEmail(){const t=this._selectedNumber;this._snkEmailSender.open({type:t>0?"selection":"all",selectedRows:t,email:{attachments:[{name:this._appLabel}]},resolver:({type:t,format:e,email:{to:i,subject:s,message:o}})=>{var r;const n=null!==(r=p[null==e?void 0:e.toUpperCase()])&&void 0!==r?r:p.PDF;this.resolveExporter({type:t,methodName:n,to:i,subject:s,message:o,fileName:this._appLabel,gridTitle:this._appLabel},(()=>{this._snkEmailSender.close(),d.info(this.getMessage("snkDataExporter.message.emailSuccess"),{iconName:"check"})}))}})}getMessage(t,e){if(null==this.messagesBuilder){const t=x.getNearestInstance(this._element);t&&(this.messagesBuilder=t.messagesBuilder)}return this.messagesBuilder.getMessage(t,e)}positionDropdown(){var t;const e=null===(t=this._ezButton)||void 0===t?void 0:t.getBoundingClientRect();null!=e&&null!=this._dropdownParent&&(this._dropdownParent.style.top=e.y+e.height+5+"px",this._dropdownParent.style.left=e.x+"px")}closeDropdown(t){const e=null==t?void 0:t.target;null!=e&&(e.closest(".snk-data-exporter")||(this._showDropdown=!1))}setEvents(){document.removeEventListener("click",this.closeDropdown.bind(this)),document.addEventListener("click",this.closeDropdown.bind(this)),document.removeEventListener("scroll",this.positionDropdown.bind(this)),document.addEventListener("scroll",this.positionDropdown.bind(this))}controlDropdown(){this._showDropdown=!this._showDropdown}async resolveExporter(t,e){null!=this.provider&&null!=t&&null!=e&&this.getExporterStrategy().executeExport(t).then((t=>e(t))).catch((t=>{console.error(t);let{title:e,message:i,statusMessage:s}=t||{};d.error(e||this.getMessage("snkDataExporter.message.exportError"),s||i||this.getMessage("snkDataExporter.message.unknownFailure"))}))}getExporterStrategy(){return null==this.provider.getRecords?new E(this.provider):new w(this.provider)}getOptionKey(t){return Object.keys(c).find((e=>c[e]===t))}getExportType(t){return t===c.EXPORT_ALL_RECORDS_TO_PDF||t===c.EXPORT_ALL_RECORDS_TO_XLS?"all":t===c.EXPORT_PAGE_TO_PDF||t===c.EXPORT_PAGE_TO_XLS?"page":"selection"}async dispatchExporter(t){var e,i,s;const r=this.getOptionKey(t),n=null!==(e=u[r])&&void 0!==e?e:u.EXPORT_TO_PDF,l={methodName:c[`EXPORT_TO_${n}`],fileName:this._appLabel,gridTitle:this._appLabel,exportOption:t,limit:null===(s=null===(i=this.provider)||void 0===i?void 0:i.getExportLimit)||void 0===s?void 0:s.call(i),type:this.getExportType(t)};await this.resolveExporter(l,(t=>{t.canExport||n===u.EXPORT_TO_PDF?function({fileSessionKey:t,isDownload:e}){const i=o.getContextValue("__SNK__APPLICATION__");window.open(`${window.location.protocol}//${window.location.hostname}:${window.location.port}/mge/visualizadorArquivos.mge?chaveArquivo=${t}${e?"&download=S":""}`),d.info(function(t){var e;return null===(e=null==t?void 0:t.messagesBuilder)||void 0===e?void 0:e.getMessage("fileViewer.message.exportSuccess",void 0)}(i),{iconName:"check"})}(Object.assign(Object.assign({},t),{fileType:n})):d.error(this.getMessage("snkDataExporter.title.permission"),this.getMessage("snkDataExporter.message.exportPermission"))}))}async processExporter(t){var e,i,s,o,r,n,l;const a=null==t?void 0:t.detail,u=[c.EXPORT_PAGE_TO_PDF,c.EXPORT_PAGE_TO_XLS],p=null===(e=null==a?void 0:a.id)||void 0===e?void 0:e.includes(this._customPrefix);if((null==a?void 0:a.id)===c.EXPORT_CURRENT_PAGE)return;const m=null===(i=this.provider)||void 0===i?void 0:i.getSelectedIDs(),v=null===(s=this.provider)||void 0===s?void 0:s.getTotalRecords(),x=null===(r=null===(o=this.provider)||void 0===o?void 0:o.getPageSize)||void 0===r?void 0:r.call(o),g=null===(l=null===(n=this.provider)||void 0===n?void 0:n.getExportLimit)||void 0===l?void 0:l.call(n);let f=!1;if(u.includes(null==a?void 0:a.id)&&x<=g||p?f=!1:(null==m?void 0:m.length)?f=m.length>g:v>g&&(f=!0),f){const t=g.toLocaleString("pt-BR",{minimumFractionDigits:0}),e={title:this.getMessage("snkDataExporter.limitExceeded.title"),description:`\n ${this.getMessage("snkDataExporter.limitExceeded.description",{limit:t})}\n <br/><br/>\n <b>\n ${this.getMessage("snkDataExporter.limitExceeded.subdescription")}\n </b>\n `,cancel:this.getMessage("snkDataExporter.limitExceeded.cancel"),confirm:this.getMessage("snkDataExporter.limitExceeded.continue")};if(!await d.confirm(e.title,e.description,null,h.WARN,{labelCancel:e.cancel,labelConfirm:e.confirm}))return}if(p)return this.openPersonalizedReports(a.id),void(this._showDropdown=!1);this.getFilteredReleasedToExport().includes(null==a?void 0:a.id)&&(a.id===c.EXPORT_BY_EMAIL?this.exportByEmail():this.dispatchExporter(a.id),this._showDropdown=!1)}getFilteredReleasedToExport(){var t,e;if(null==this.provider)return this._releasedToExport;const i=null===(e=(t=this.provider).getHiddenOptions)||void 0===e?void 0:e.call(t);return null==i?this._releasedToExport:this._releasedToExport.filter((t=>!i.includes(t)))}loadItems(){const t=[];this.getFilteredReleasedToExport().forEach((e=>{var i;null===(i=this._itemBuilder)||void 0===i||i.setExportOption(e,t)})),this.loadPersonalizedItems(t)}async loadPersonalizedItems(t){var e,i;const s=null===(i=null===(e=this.provider)||void 0===e?void 0:e.getRecordID)||void 0===i?void 0:i.call(e);if(null==s)return void(this._items=t);const n=await function(t){const e=`${o.getContextValue("__SNK__APPLICATION__").getModuleName()}@DataExporterSPBean.getPersonalizedReports`,i={serviceName:e,requestBody:t};return new Promise(((t,s)=>v.get().callServiceBroker(e,r.objectToString(i)).then((e=>t(function(t){var e;const i=null===(e=null==t?void 0:t.json)||void 0===e?void 0:e.$;if(null!=i)return r.stringToObject(i)}(e)))).catch((t=>s(t)))))}({recordID:s});null==n||n.forEach((e=>{t.push({id:`${this._customPrefix}_${e.ID}`,label:e.label,group:this.getMessage("snkDataExporter.group.custom")})})),this._items=t}openPersonalizedReports(t){var e,i;const s=[],o=(null==t?void 0:t.replace(this._customPrefix,""))||"";null===(i=null===(e=this.provider)||void 0===e?void 0:e.getSelectedIDs)||void 0===i||i.call(e).forEach((({name:t,type:e,value:i},o)=>{const r={fields:[]};0===o&&(s[`PK_${t}`]={type:this.parseDataType(e),value:i},s.pks=[]);const n={nome:`PK_${t}`,tipo:this.parseDataType(e),valor:i};r.fields.push(n),s.pks.push(r)})),this._application.openApp(`${m}${o}`,s)}parseDataType(t){switch(t){case l.NUMBER:return"I";case l.DATE:return"D";default:return"S"}}loadDropdown(){var t;this._selectedNumber=(null===(t=this.provider)||void 0===t?void 0:t.getSelectedNumber())||0,this._itemBuilder=new g(this.getMessage.bind(this),this._selectedNumber),this.loadItems()}getElementID(t){return{[a.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:a.getInternalIDInfo(t)}}canShowDropdown(){var t;return this._showDropdown&&(null===(t=this._items)||void 0===t?void 0:t.length)>0}componentWillLoad(){var t;this._application=o.getContextValue("__SNK__APPLICATION__"),null===(t=this._application)||void 0===t||t.getAppLabel().then((t=>this._appLabel=t)),this.setEvents()}componentDidLoad(){null!=this._element&&(a.addIDInfo(this._element),this.positionDropdown())}componentWillUpdate(){var t;this._showDropdown&&!(null===(t=this._items)||void 0===t?void 0:t.length)&&this.loadDropdown()}componentDidUpdate(){var t;this._showDropdown?this.positionDropdown():(null===(t=this._items)||void 0===t?void 0:t.length)>0&&(this._items=[])}render(){return e(i,null,e("div",{class:`snk-data-exporter\n ${this.canShowDropdown()?" ez-elevation--16":""}\n `},e("ez-button",Object.assign({ref:t=>this._ezButton=t,iconName:"file-download",size:"small",mode:"icon",title:this.getMessage("snkDataExporter.group.export.title"),onClick:()=>this.controlDropdown()},this.getElementID("button"))),e("div",Object.assign({ref:t=>this._dropdownParent=t,class:`snk-data-exporter__dropdown\n ${this.canShowDropdown()?"snk-data-exporter__dropdown--show":""}\n `},this.getElementID("dropdown")),this.canShowDropdown()&&e("ez-dropdown",Object.assign({items:this._items,onEzClick:t=>this.processExporter(t)},this.getElementID("dropdown"))))),this.canShowDropdown()&&e("div",Object.assign({class:"ez-scrim ez-scrim--light"},this.getElementID("ezScrim"))),e("snk-exporter-email-sender",Object.assign({ref:t=>this._snkEmailSender=t,getMessage:(t,e)=>this.getMessage(t,e)},this.getElementID("snkExporterEmailSender"))))}get _element(){return s(this)}};k.style=".sc-snk-data-exporter-h{display:flex;width:fit-content;height:fit-content}.snk-data-exporter.sc-snk-data-exporter{display:flex;width:fit-content;height:fit-content}.snk-data-exporter__dropdown.sc-snk-data-exporter{display:none}.snk-data-exporter__dropdown--show.sc-snk-data-exporter{display:flex;flex-direction:column;position:fixed}.snk-data-exporter__dropdown.sc-snk-data-exporter>ez-dropdown.sc-snk-data-exporter{position:relative}";export{k as snk_data_exporter}
1
+ import{r as t,h as e,H as i,g as s}from"./p-d2d301a6.js";import{ApplicationContext as o,ObjectUtils as r,UserInterface as n,DataType as l,ElementIDUtils as a}from"@sankhyalabs/core";import{ApplicationUtils as d,DialogType as h}from"@sankhyalabs/ezui/dist/collection/utils";import{D as c,a as u,b as p}from"./p-30cf616e.js";import{R as m}from"./p-95ce311a.js";import{D as v}from"./p-00278e07.js";import{S as x}from"./p-0f3b2a32.js";import"./p-4be4cdac.js";import"./p-21749402.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-58fd3017.js";import"./p-ff1990ad.js";import"./p-acca8a69.js";import"./p-8d884fab.js";import"./p-17425c72.js";import"@sankhyalabs/core/dist/dataunit/metadata/DataType";import"./p-7dd49d15.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";class g{constructor(t,e){this._selectedNumber=0,this._getMessage=t,this._selectedNumber=e}setExportOption(t,e){const i=this.getExportGroupName();t===c.EXPORT_TO_PDF&&e.push(this.getExportToPDF(i)),t===c.EXPORT_TO_XLS&&e.push(this.getExportToXLS(i)),this.setExportCurrentPage(t,e),this._selectedNumber>0&&this.setExportAllRecords(t,e),this.setExportByEmail(t,e)}setExportCurrentPage(t,e){var i;const s=[c.EXPORT_PAGE_TO_PDF,c.EXPORT_PAGE_TO_XLS];if(t===c.EXPORT_CURRENT_PAGE&&e.push(this.getCurrentPage()),s.includes(t)){let s=e.find((t=>t.id===c.EXPORT_CURRENT_PAGE));null==s&&(e.push(this.getCurrentPage()),s=e.find((t=>t.id===c.EXPORT_CURRENT_PAGE))),(null===(i=null==s?void 0:s.children)||void 0===i?void 0:i.length)||(s.children=[]),t===c.EXPORT_PAGE_TO_PDF&&s.children.push(this.getExportPageToPDF()),t===c.EXPORT_PAGE_TO_XLS&&s.children.push(this.getExportPageToXLS())}}setExportAllRecords(t,e){var i;const s=[c.EXPORT_ALL_RECORDS_TO_PDF,c.EXPORT_ALL_RECORDS_TO_XLS];if(t===c.EXPORT_ALL_RECORDS&&e.push(this.getAllRecords()),s.includes(t)){let s=e.find((t=>t.id===c.EXPORT_ALL_RECORDS));null==s&&(e.push(this.getAllRecords()),s=e.find((t=>t.id===c.EXPORT_ALL_RECORDS))),(null===(i=s.children)||void 0===i?void 0:i.length)||(s.children=[]),t===c.EXPORT_ALL_RECORDS_TO_PDF&&s.children.push(this.getExportAllRecordsToPDF()),t===c.EXPORT_ALL_RECORDS_TO_XLS&&s.children.push(this.getExportAllRecordsToXLS())}}setExportByEmail(t,e){t===c.EXPORT_BY_EMAIL&&e.push(this.getExportByEmail())}getExportToPDF(t){return{id:c.EXPORT_TO_PDF,label:"PDF (.pdf)",group:t}}getExportToXLS(t){return{id:c.EXPORT_TO_XLS,label:`${this._getMessage("snkDataExporter.label.spreadsheet")} (.xls)`,group:t}}getCurrentPage(){return{id:c.EXPORT_CURRENT_PAGE,label:this._getMessage("snkDataExporter.label.currentPage"),group:this._getMessage("snkDataExporter.group.custom")}}getAllRecords(){return{id:c.EXPORT_ALL_RECORDS,label:this._getMessage("snkDataExporter.label.allRecords"),group:this._getMessage("snkDataExporter.group.custom")}}getExportPageToPDF(){return{id:c.EXPORT_PAGE_TO_PDF,label:"PDF (.pdf)"}}getExportPageToXLS(){return{id:c.EXPORT_PAGE_TO_XLS,label:`${this._getMessage("snkDataExporter.label.spreadsheet")} (.xls)`}}getExportAllRecordsToPDF(){return{id:c.EXPORT_ALL_RECORDS_TO_PDF,label:"PDF (.pdf)"}}getExportAllRecordsToXLS(){return{id:c.EXPORT_ALL_RECORDS_TO_XLS,label:`${this._getMessage("snkDataExporter.label.spreadsheet")} (.xlsx)`}}getExportByEmail(){return{id:c.EXPORT_BY_EMAIL,label:`${this._getMessage("snkDataExporter.label.sendByEmail")}...`}}getExportGroupName(){return 1===this._selectedNumber?this._getMessage("snkDataExporter.group.export.selectedLine"):this._selectedNumber>1?this._getMessage("snkDataExporter.group.export.multiSelected").replace("{0}",this._selectedNumber.toString()):this._getMessage("snkDataExporter.group.export.default")}}function f(t){const e=[];let i=0;for(const s of t){if(i+=s.width,i>=760)break;e.push(s)}return e}function b(t){return Object.keys(c).find((e=>c[e]===t))}class E{constructor(t){this._provider=t}async getParsedColumns(){return f(await this._provider.getColumnsMetadata())}async getColumns(t){var e;return(null===(e=b(null==t?void 0:t.exportOption))||void 0===e?void 0:e.includes("PDF"))?await this.getParsedColumns():await this._provider.getColumnsMetadata()}async getParams(t){var e,i,s,o,r,n;const l=null===(i=(e=this._provider).getFilters)||void 0===i?void 0:i.call(e),a=await this.getColumns(t),d=null===(o=(s=this._provider).getOrders)||void 0===o?void 0:o.call(s),h=null===(n=(r=this._provider).getResourceURI)||void 0===n?void 0:n.call(r),u=this._provider.getSelectedIDs(),p=t.exportOption,m=[c.EXPORT_PAGE_TO_PDF,c.EXPORT_PAGE_TO_XLS];delete t.exportOption;let v=Object.assign({filters:l,columns:a,sort:d,resourceURI:h,selectedIDs:u.slice(0,this._provider.getExportLimit())},t);if(m.includes(p)||"page"==t.type){const t=this._provider.getOffset(),e=this._provider.getPageSize();v=Object.assign(Object.assign({},v),{offset:t,limit:e,selectedIDs:[]})}else"all"==t.type&&(v=Object.assign(Object.assign({},v),{offset:0,limit:this._provider.getExportLimit(),selectedIDs:[]}));return Promise.resolve(v)}async executeExport(t){const e=await this.getParams(t),{methodName:i}=e,s=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(s=Object.getOwnPropertySymbols(t);o<s.length;o++)e.indexOf(s[o])<0&&Object.prototype.propertyIsEnumerable.call(t,s[o])&&(i[s[o]]=t[s[o]])}return i}(e,["methodName"]),n=`${o.getContextValue("__SNK__APPLICATION__").getModuleName()}@DataExporterSPBean.${i}`,l={serviceName:n,requestBody:s};return new Promise(((t,e)=>{v.get().callServiceBroker(n,r.objectToString(l)).then((e=>t(this.getFormatResponse(e)))).catch((t=>e(t)))}))}getFormatResponse(t){var e;const i=null===(e=null==t?void 0:t.json)||void 0===e?void 0:e.$;if(null!=i)return r.stringToObject(i)}}class w{constructor(t){this._provider=t}async getParsedColumns(){return f(await this._provider.getColumnsMetadata())}async getColumns(t){var e;return(null===(e=b(null==t?void 0:t.exportOption))||void 0===e?void 0:e.includes("PDF"))?await this.getParsedColumns():await this._provider.getColumnsMetadata()}async executeExport(t){const{methodName:e,gridTitle:i}=t,s=await this._provider.getRecords(),o=await this.getColumns(t),[r,n]=this.getExecutor(e),l={serviceName:r,requestBody:{grid:{gridTitle:i,columns:this.buildColumnsObject(o),rows:this.buildRowsObject(o,s),customOptions:{xlsxExtension:!1}}}};return new Promise(((t,e)=>{v.get().callServiceBroker(r,l).then((e=>t(n(e)))).catch((t=>e(t)))}))}getExecutor(t){return"exportToPDF"===t?["GridPDFBuilderSP.buildPDFFromJson",t=>({fileSessionKey:t.chavePDF.valor,canPrint:"S"===t.permiteImprimir.valor,canExport:"S"===t.permiteExportar.valor,canSendEmail:"S"===t.canSendEmail.valor,useAppPrint:!0})]:["GridXLSBuilderSP.buildXLSFromJson",t=>({fileSessionKey:t.chaveXLS.valor,canPrint:!0,canExport:!0,canSendEmail:!0,useAppPrint:!1})]}buildColumnsObject(t){return{column:t.map(((t,e)=>{const{label:i,id:s,width:o,userInterface:r}=t;return Object.assign({index:e+1,id:s,label:i,width:o,presentationType:"P"},D[r]||{type:"S",align:"left"})}))}}buildRowsObject(t,e){return{row:e.map((e=>{const i={};return t.forEach(((t,s)=>i["c"+(s+1)]={$:this.formatValue(e,t)})),i}))}}formatValue(t,e){return null!=this._provider.formatValue?this._provider.formatValue(t,e):t[e.id]||""}}const D={[n.DATE]:{type:"D",align:"center"},[n.DATETIME]:{type:"H",align:"center"},[n.TIME]:{type:"I",align:"right"},[n.ELAPSEDTIME]:{type:"I",align:"right"},[n.DECIMALNUMBER]:{type:"F",align:"right"},[n.INTEGERNUMBER]:{type:"I",align:"right"},[n.SEARCH]:{type:"S",align:"right"}},k=class{constructor(e){t(this,e),this._selectedNumber=0,this._customPrefix="$custom$",this._releasedToExport=[c.EXPORT_TO_PDF,c.EXPORT_TO_XLS,c.EXPORT_BY_EMAIL,c.EXPORT_PDF_TO_EMAIL,c.EXPORT_XLS_TO_EMAIL,c.EXPORT_PAGE_TO_PDF,c.EXPORT_PAGE_TO_XLS,c.EXPORT_ALL_RECORDS_TO_PDF,c.EXPORT_ALL_RECORDS_TO_XLS],this._items=[],this._showDropdown=!1,this.provider=null,this.messagesBuilder=void 0}async exportByEmail(){const t=this._selectedNumber;this._snkEmailSender.open({type:t>0?"selection":"all",selectedRows:t,email:{attachments:[{name:this._appLabel}]},resolver:({type:t,format:e,email:{to:i,subject:s,message:o}})=>{var r;const n=null!==(r=p[null==e?void 0:e.toUpperCase()])&&void 0!==r?r:p.PDF;this.resolveExporter({type:t,methodName:n,to:i,subject:s,message:o,fileName:this._appLabel,gridTitle:this._appLabel},(()=>{this._snkEmailSender.close(),d.info(this.getMessage("snkDataExporter.message.emailSuccess"),{iconName:"check"})}))}})}getMessage(t,e){if(null==this.messagesBuilder){const t=x.getNearestInstance(this._element);t&&(this.messagesBuilder=t.messagesBuilder)}return this.messagesBuilder.getMessage(t,e)}positionDropdown(){var t;const e=null===(t=this._ezButton)||void 0===t?void 0:t.getBoundingClientRect();null!=e&&null!=this._dropdownParent&&(this._dropdownParent.style.top=e.y+e.height+5+"px",this._dropdownParent.style.left=e.x+"px")}closeDropdown(t){const e=null==t?void 0:t.target;null!=e&&(e.closest(".snk-data-exporter")||(this._showDropdown=!1))}setEvents(){document.removeEventListener("click",this.closeDropdown.bind(this)),document.addEventListener("click",this.closeDropdown.bind(this)),document.removeEventListener("scroll",this.positionDropdown.bind(this)),document.addEventListener("scroll",this.positionDropdown.bind(this))}controlDropdown(){this._showDropdown=!this._showDropdown}async resolveExporter(t,e){null!=this.provider&&null!=t&&null!=e&&this.getExporterStrategy().executeExport(t).then((t=>e(t))).catch((t=>{console.error(t);let{title:e,message:i,statusMessage:s}=t||{};d.error(e||this.getMessage("snkDataExporter.message.exportError"),s||i||this.getMessage("snkDataExporter.message.unknownFailure"))}))}getExporterStrategy(){return null==this.provider.getRecords?new E(this.provider):new w(this.provider)}getOptionKey(t){return Object.keys(c).find((e=>c[e]===t))}getExportType(t){return t===c.EXPORT_ALL_RECORDS_TO_PDF||t===c.EXPORT_ALL_RECORDS_TO_XLS?"all":t===c.EXPORT_PAGE_TO_PDF||t===c.EXPORT_PAGE_TO_XLS?"page":"selection"}async dispatchExporter(t){var e,i,s;const r=this.getOptionKey(t),n=null!==(e=u[r])&&void 0!==e?e:u.EXPORT_TO_PDF,l={methodName:c[`EXPORT_TO_${n}`],fileName:this._appLabel,gridTitle:this._appLabel,exportOption:t,limit:null===(s=null===(i=this.provider)||void 0===i?void 0:i.getExportLimit)||void 0===s?void 0:s.call(i),type:this.getExportType(t)};await this.resolveExporter(l,(t=>{t.canExport||n===u.EXPORT_TO_PDF?function({fileSessionKey:t,isDownload:e}){const i=o.getContextValue("__SNK__APPLICATION__");window.open(`${window.location.protocol}//${window.location.hostname}:${window.location.port}/mge/visualizadorArquivos.mge?chaveArquivo=${t}${e?"&download=S":""}`),d.info(function(t){var e;return null===(e=null==t?void 0:t.messagesBuilder)||void 0===e?void 0:e.getMessage("fileViewer.message.exportSuccess",void 0)}(i),{iconName:"check"})}(Object.assign(Object.assign({},t),{fileType:n})):d.error(this.getMessage("snkDataExporter.title.permission"),this.getMessage("snkDataExporter.message.exportPermission"))}))}async processExporter(t){var e,i,s,o,r,n,l;const a=null==t?void 0:t.detail,u=[c.EXPORT_PAGE_TO_PDF,c.EXPORT_PAGE_TO_XLS],p=null===(e=null==a?void 0:a.id)||void 0===e?void 0:e.includes(this._customPrefix);if((null==a?void 0:a.id)===c.EXPORT_CURRENT_PAGE)return;const m=null===(i=this.provider)||void 0===i?void 0:i.getSelectedIDs(),v=null===(s=this.provider)||void 0===s?void 0:s.getTotalRecords(),x=null===(r=null===(o=this.provider)||void 0===o?void 0:o.getPageSize)||void 0===r?void 0:r.call(o),g=null===(l=null===(n=this.provider)||void 0===n?void 0:n.getExportLimit)||void 0===l?void 0:l.call(n);let f=!1;if(u.includes(null==a?void 0:a.id)&&x<=g||p?f=!1:(null==m?void 0:m.length)?f=m.length>g:v>g&&(f=!0),f){const t=g.toLocaleString("pt-BR",{minimumFractionDigits:0}),e={title:this.getMessage("snkDataExporter.limitExceeded.title"),description:`\n ${this.getMessage("snkDataExporter.limitExceeded.description",{limit:t})}\n <br/><br/>\n <b>\n ${this.getMessage("snkDataExporter.limitExceeded.subdescription")}\n </b>\n `,cancel:this.getMessage("snkDataExporter.limitExceeded.cancel"),confirm:this.getMessage("snkDataExporter.limitExceeded.continue")};if(!await d.confirm(e.title,e.description,null,h.WARN,{labelCancel:e.cancel,labelConfirm:e.confirm}))return}if(p)return this.openPersonalizedReports(a.id),void(this._showDropdown=!1);this.getFilteredReleasedToExport().includes(null==a?void 0:a.id)&&(a.id===c.EXPORT_BY_EMAIL?this.exportByEmail():this.dispatchExporter(a.id),this._showDropdown=!1)}getFilteredReleasedToExport(){var t,e;if(null==this.provider)return this._releasedToExport;const i=null===(e=(t=this.provider).getHiddenOptions)||void 0===e?void 0:e.call(t);return null==i?this._releasedToExport:this._releasedToExport.filter((t=>!i.includes(t)))}loadItems(){const t=[];this.getFilteredReleasedToExport().forEach((e=>{var i;null===(i=this._itemBuilder)||void 0===i||i.setExportOption(e,t)})),this.loadPersonalizedItems(t)}async loadPersonalizedItems(t){var e,i;const s=null===(i=null===(e=this.provider)||void 0===e?void 0:e.getRecordID)||void 0===i?void 0:i.call(e);if(null==s)return void(this._items=t);const n=await function(t){const e=`${o.getContextValue("__SNK__APPLICATION__").getModuleName()}@DataExporterSPBean.getPersonalizedReports`,i={serviceName:e,requestBody:t};return new Promise(((t,s)=>v.get().callServiceBroker(e,r.objectToString(i)).then((e=>t(function(t){var e;const i=null===(e=null==t?void 0:t.json)||void 0===e?void 0:e.$;if(null!=i)return r.stringToObject(i)}(e)))).catch((t=>s(t)))))}({recordID:s});null==n||n.forEach((e=>{t.push({id:`${this._customPrefix}_${e.ID}`,label:e.label,group:this.getMessage("snkDataExporter.group.custom")})})),this._items=t}openPersonalizedReports(t){var e,i;const s=[],o=(null==t?void 0:t.replace(this._customPrefix,""))||"";null===(i=null===(e=this.provider)||void 0===e?void 0:e.getSelectedIDs)||void 0===i||i.call(e).forEach((({name:t,type:e,value:i},o)=>{const r={fields:[]};0===o&&(s[`PK_${t}`]={type:this.parseDataType(e),value:i},s.pks=[]);const n={nome:`PK_${t}`,tipo:this.parseDataType(e),valor:i};r.fields.push(n),s.pks.push(r)})),this._application.openApp(`${m}${o}`,s)}parseDataType(t){switch(t){case l.NUMBER:return"I";case l.DATE:return"D";default:return"S"}}loadDropdown(){var t;this._selectedNumber=(null===(t=this.provider)||void 0===t?void 0:t.getSelectedNumber())||0,this._itemBuilder=new g(this.getMessage.bind(this),this._selectedNumber),this.loadItems()}getElementID(t){return{[a.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:a.getInternalIDInfo(t)}}canShowDropdown(){var t;return this._showDropdown&&(null===(t=this._items)||void 0===t?void 0:t.length)>0}componentWillLoad(){var t;this._application=o.getContextValue("__SNK__APPLICATION__"),null===(t=this._application)||void 0===t||t.getAppLabel().then((t=>this._appLabel=t)),this.setEvents()}componentDidLoad(){null!=this._element&&(a.addIDInfo(this._element),this.positionDropdown())}componentWillUpdate(){var t;this._showDropdown&&!(null===(t=this._items)||void 0===t?void 0:t.length)&&this.loadDropdown()}componentDidUpdate(){var t;this._showDropdown?this.positionDropdown():(null===(t=this._items)||void 0===t?void 0:t.length)>0&&(this._items=[])}render(){return e(i,null,e("div",{class:`snk-data-exporter\n ${this.canShowDropdown()?" ez-elevation--16":""}\n `},e("ez-button",Object.assign({ref:t=>this._ezButton=t,iconName:"file-download",size:"small",mode:"icon",title:this.getMessage("snkDataExporter.group.export.title"),onClick:()=>this.controlDropdown()},this.getElementID("button"))),e("div",Object.assign({ref:t=>this._dropdownParent=t,class:`snk-data-exporter__dropdown\n ${this.canShowDropdown()?"snk-data-exporter__dropdown--show":""}\n `},this.getElementID("dropdown")),this.canShowDropdown()&&e("ez-dropdown",Object.assign({items:this._items,onEzClick:t=>this.processExporter(t)},this.getElementID("dropdown"))))),this.canShowDropdown()&&e("div",Object.assign({class:"ez-scrim ez-scrim--light"},this.getElementID("ezScrim"))),e("snk-exporter-email-sender",Object.assign({ref:t=>this._snkEmailSender=t,getMessage:(t,e)=>this.getMessage(t,e)},this.getElementID("snkExporterEmailSender"))))}get _element(){return s(this)}};k.style=".sc-snk-data-exporter-h{display:flex;width:fit-content;height:fit-content}.snk-data-exporter.sc-snk-data-exporter{display:flex;width:fit-content;height:fit-content}.snk-data-exporter__dropdown.sc-snk-data-exporter{display:none}.snk-data-exporter__dropdown--show.sc-snk-data-exporter{display:flex;flex-direction:column;position:fixed}.snk-data-exporter__dropdown.sc-snk-data-exporter>ez-dropdown.sc-snk-data-exporter{position:relative}";export{k as snk_data_exporter}
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1 +1 @@
1
- export{S as snk_guides_viewer}from"./p-72a451c8.js";import"./p-d2d301a6.js";import"@sankhyalabs/core";import"./p-fcc662c6.js";import"./p-763edad2.js";import"./p-acca8a69.js";import"./p-00278e07.js";import"./p-8d884fab.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-ff1990ad.js";import"./p-95ce311a.js";import"@sankhyalabs/ezui/dist/collection/utils/form";import"./p-23736d75.js";import"./p-7e7a7473.js";import"./p-30cf616e.js";import"./p-6dc031de.js";import"./p-e6683406.js";import"./p-21749402.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"./p-47d24ac8.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";import"@sankhyalabs/core/dist/dataunit/DataUnit";
1
+ export{S as snk_guides_viewer}from"./p-229c3615.js";import"./p-d2d301a6.js";import"@sankhyalabs/core";import"./p-fcc662c6.js";import"./p-763edad2.js";import"./p-acca8a69.js";import"./p-00278e07.js";import"./p-8d884fab.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-ff1990ad.js";import"./p-95ce311a.js";import"@sankhyalabs/ezui/dist/collection/utils/form";import"./p-23736d75.js";import"./p-7e7a7473.js";import"./p-30cf616e.js";import"./p-6dc031de.js";import"./p-4be4cdac.js";import"./p-21749402.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"./p-58fd3017.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";import"@sankhyalabs/core/dist/dataunit/DataUnit";
Binary file
@@ -1 +1 @@
1
- import{r as t,c as i,f as s,h as e,H as a}from"./p-d2d301a6.js";import{Action as o}from"@sankhyalabs/core";import{S as h}from"./p-fcc662c6.js";import{FormMetadata as n,buildFormMetadata as r}from"@sankhyalabs/ezui/dist/collection/utils/form";import"./p-00278e07.js";import"./p-e6683406.js";import{P as d}from"./p-30cf616e.js";import"./p-21749402.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-47d24ac8.js";import"./p-ff1990ad.js";import"./p-acca8a69.js";import{T as l}from"./p-7e7a7473.js";import{V as c}from"./p-95ce311a.js";import{S as m}from"./p-72a451c8.js";import{S as u}from"./p-17425c72.js";import"./p-763edad2.js";import"./p-8d884fab.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";import"./p-6dc031de.js";import"./p-23736d75.js";import"@sankhyalabs/core/dist/dataunit/DataUnit";class v{constructor(t,i,s){this._parentGuide=t,this._formMetadata=i,this._dataUnit=s}get id(){return this._parentGuide.id}buildGuideItem(t){const i=Object.assign({},this._parentGuide);delete i.expanded,delete i.children;const s=this._dataUnit.getSelectedRecord();if(!s)return i;const e=this._dataUnit.isNewRecord(s.__record__id__),a=Array.from(this._formMetadata.getAllSheets().values()).map((i=>{const{name:s,label:a}=i,o=null!=n.getDetailName(s.split("::").pop()),h=o&&e,r=this._parentGuide.id,d=o?`${r}::${s}`:`${r}__FORM:${s}`;return o&&t.has(d)&&!h?t.get(d).buildGuideItem(t):{id:d,label:a,disabled:h,tooltip:h?"Finalize o cadastro para ter acesso a esta guia.":void 0}})),o=a.shift();return o.label=e?"Novo Registro":s.__record__label__,o.children=a,i.children=[o],i}}const p=class{constructor(s){t(this,s),this.snkDetailGuidesChange=i(this,"snkDetailGuidesChange",7),this.snkSwitchGuide=i(this,"snkSwitchGuide",7),this.formItemsReady=i(this,"formItemsReady",7),this._disabledButtons=void 0,this._currentView=void 0,this.attachmentRegisterKey=void 0,this.formConfigManager=void 0,this.dataUnitName=void 0,this.resourceID=void 0,this.guideItemPath=void 0,this.entityName=void 0,this.label=void 0,this.dataUnit=void 0,this.selectedForm=void 0,this.dataState=void 0,this.messagesBuilder=void 0,this.branchGuide=void 0,this.canEdit=!0,this.taskbarCustomContainerId=void 0,this.customEditors=void 0,this.customRenders=void 0}observeDataUnit(t,i){null==t||t.subscribe(this.dataUnitActionHandler.bind(this)),null==i||i.unsubscribe(this.dataUnitActionHandler)}observerDataState(t,i){const s=!(null==i?void 0:i.insertionMode)&&(null==t?void 0:t.insertionMode),e=(null==i?void 0:i.insertionMode)&&!(null==t?void 0:t.insertionMode);if((s||e)&&this.loadMetadata(),null==this._formMetadata)return;const a=null==t?void 0:t.selectedRecord,o=null==i?void 0:i.selectedRecord;(null==a?void 0:a.__record__id__)!==(null==o?void 0:o.__record__id__)&&this.snkDetailGuidesChange.emit(new v(this.branchGuide,this._formMetadata,this.dataUnit)),s&&setTimeout((()=>{this.changeViewMode(c.FORM)}),0),e&&this.changeViewMode(c.GRID);const h=[];this.dataState.hasPrevious||h.push(l.PREVIOUS),this.dataState.hasNext||h.push(l.NEXT),this.dataState.insertionMode&&h.push(l.INSERT),this._disabledButtons=h}async changeViewMode(t){this.emitSwitchEvent(t)}async configGrid(){this._snkGrid&&this._snkGrid.showConfig()}async showUp(){this._snkFormView&&this._snkFormView.showUp(),this._snkGrid&&this._snkGrid.scrollIntoView({behavior:"smooth",block:"start"})}async addCustomEditor(t,i){var s;const e=this.normalizeBranchGuideId(null===(s=this.branchGuide)||void 0===s?void 0:s.id);this._snkGrid.addCustomEditor(t,i,e),this._snkFormView.addCustomEditor(t,i,e)}async observerPropsCustomEditor(t){for(const i in t)await this.addCustomEditor(i,t[i])}async addGridCustomRender(t,i){var s;const e=this.normalizeBranchGuideId(null===(s=this.branchGuide)||void 0===s?void 0:s.id);await this._snkGrid.addGridCustomRender(t,i,e)}onContentCardChanged(t){m.updateContentCard(t.detail.formName,t.detail.cardConfig,t.detail.propertyChanged,this.formConfigManager).then((()=>s(this))),t.stopPropagation()}async observeCustomRenders(t){for(const i in t){const s=t[i];await this.addGridCustomRender(i,s)}}updateLabel(){const t=this.guideItemPath?this.guideItemPath.length:0;if(t>0){const i=t>0?this.guideItemPath.map((t=>t.label)):void 0;this.label=i.pop(),this._levelPath=i.length>0?i.join(" / "):void 0}else this.label="",this._levelPath=void 0}getFormGuideId(t){var i;if(!t){if(null==(null===(i=this.dataState)||void 0===i?void 0:i.selectedRecord))return;const s=Array.from(this._formMetadata.getAllSheets().keys());if(!s||0==s.length)return;t=s[0]}return`${this.stripFormPattern(this.branchGuide.id)}__FORM:${t}`}stripFormPattern(t){return t.replace(p.REGEX_FORM_ID,"")}loadMetadata(){if(!this.dataUnit)return;if(!this.formConfigManager.isLoaded)return;const t=this.formConfigManager.getConfig(this.dataUnit);this._formMetadata=r(null==t||0===t.fields.length?void 0:t,this.dataUnit,!0)}dataUnitReadyHandler(t){this.dataUnit=t.detail,this.loadMetadata()}updateViewStack(t){var i,s;this._viewStack=t,this._currentView=this.selectedForm?1:0,null===(s=null===(i=this._viewStack)||void 0===i?void 0:i.show)||void 0===s||s.call(i,this._currentView)}getFormFields(){return this.selectedForm&&this._formMetadata?this._formMetadata.getSheet(this.selectedForm).fields:[]}emitSwitchEvent(t){const i=t===c.GRID?this.stripFormPattern(this.branchGuide.id):this.getFormGuideId();i&&this.snkSwitchGuide.emit(i)}handleAttachBack(){this._viewStack.show(c.GRID)}executeActionHandler(t){t.detail===l.GRID_MODE&&(this.emitSwitchEvent(c.GRID),t.stopPropagation()),t.detail!==l.FORM_MODE&&t.detail!==l.UPDATE||(this.emitSwitchEvent(c.FORM),t.stopPropagation()),t.detail===l.ATTACH&&(this._viewStack.show(c.ATTACHMENT),t.stopPropagation())}async getAttachmentRegisterKey(){if(this._snkDataUnit)return(await this._snkDataUnit.getSelectedRecordsIDsInfo()).map((({value:t})=>t)).join("_")}async handleDataStateChange({detail:t}){this.dataState=t,void 0!==t.selectedRecord&&this._snkDataUnit&&(this.attachmentRegisterKey=await this.getAttachmentRegisterKey())}componentWillLoad(){this._configName=`dynaform.${this.entityName}`,this.formConfigManager=new h(this._configName,this.resourceID,(()=>this.loadMetadata()),this.dataUnit),this.formConfigManager.loadConfig(),null==this.messagesBuilder&&(this.messagesBuilder=new u(this.entityName))}async componentDidLoad(){await this.observerPropsCustomEditor(this.customEditors),await this.observeCustomRenders(this.customRenders)}async dataUnitActionHandler(t){t.type===o.FIELD_INVALIDATED&&this.addErrorBadgeToBranchGuide()}addErrorBadgeToBranchGuide(){this.branchGuide=Object.assign(Object.assign({},this.branchGuide),{badge:"error"}),this.snkDetailGuidesChange.emit(new v(this.branchGuide,this._formMetadata,this.dataUnit))}normalizeBranchGuideId(t){return null==t?void 0:t.replace(/child\[(.*?)\]/g,"$1").replace(/::/g,">")}render(){return this.updateLabel(),e(a,null,e("snk-data-unit",{ref:t=>this._snkDataUnit=t,dataUnitName:`${this.dataUnitName}`,onDataUnitReady:t=>this.dataUnitReadyHandler(t),entityName:this.entityName,onDataStateChange:this.handleDataStateChange.bind(this),ignoreSaveMessage:this._currentView===c.GRID,messagesBuilder:this.messagesBuilder,configName:this._configName},e("ez-view-stack",{ref:t=>this.updateViewStack(t)},e("stack-item",null,e("div",{class:"ez-box ez-box--shadow grid-container"},e("div",{class:"ez-flex ez-title--primary ez-size-width--full ez-padding--large detail-header"},e("div",{class:"ez-flex ez-text ez-text--bold ez-flex--justify-start ez-flex--align-items-center"},this._levelPath?e("span",{class:"level-path"},this._levelPath+" /"):void 0,this.label)),e("snk-grid",{class:"ez-size-width--full ez-size-height--full",ref:t=>this._snkGrid=t,configName:this._configName,messagesBuilder:this.messagesBuilder,onGridDoubleClick:()=>this.emitSwitchEvent(c.FORM),onActionClick:t=>this.executeActionHandler(t),presentationMode:d.SECONDARY,canEdit:this.canEdit,isDetail:!0,taskbarCustomContainerId:this.taskbarCustomContainerId,gridHeaderCustomSlotId:"DETAIL_GRID_HEADER_CUSTOM_ELEMENTS",topTaskbarCustomSlotId:"DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS",outlineMode:!1}))),e("stack-item",null,e("snk-form-view",{ref:t=>this._snkFormView=t,canExpand:!1,canFix:!1,name:this.selectedForm,formMetadata:this._formMetadata,dataUnit:this.dataUnit,fields:this.getFormFields(),label:this.label,levelPath:this._levelPath,onFormItemsReady:({detail:t})=>this.formItemsReady.emit(t)},e("snk-taskbar",{key:"guideViewerTaskbar",class:"form-taskbar","data-element-id":"guideViewer",configName:this._configName,messagesBuilder:this.messagesBuilder,disabledButtons:this._disabledButtons,buttons:"INSERT,PREVIOUS,NEXT,DIVIDER,CLONE,REMOVE,MORE_OPTIONS,DIVIDER,GRID_MODE,CONFIGURATOR",primaryButton:"INSERT",presentationMode:d.SECONDARY,onActionClick:t=>this.executeActionHandler(t),dataUnit:this.dataUnit,resourceID:this.resourceID,customContainerId:this.taskbarCustomContainerId,customSlotId:"DETAIL_TASKBAR_CUSTOM_ELEMENTS"},e("slot",{name:"DETAIL_TASKBAR_CUSTOM_ELEMENTS"})))),e("stack-item",null,e("snk-attach",{registerKey:this.attachmentRegisterKey,messagesBuilder:this.messagesBuilder,entityName:this.entityName,onBack:this.handleAttachBack.bind(this)})))))}static get watchers(){return{dataUnit:["observeDataUnit"],dataState:["observerDataState"],customEditors:["observerPropsCustomEditor"],customRenders:["observeCustomRenders"]}}};p.REGEX_FORM_ID=/__FORM:[^:]+/g,p.style=".sc-snk-detail-view-h{display:flex;row-gap:24px;flex-direction:column;width:100%;height:100%}.level-path.sc-snk-detail-view{color:var(--color--title-primary, #2B3A54);font-weight:var(--text-weight--medium, 400);padding-right:3px}.form-taskbar.sc-snk-detail-view{padding-bottom:var(--space--medium)}.grid-container.sc-snk-detail-view{background-color:#FFF;min-height:100px}.detail-header.sc-snk-detail-view{padding-bottom:0}";export{p as snk_detail_view}
1
+ import{r as t,c as i,f as s,h as e,H as a}from"./p-d2d301a6.js";import{Action as o}from"@sankhyalabs/core";import{S as h}from"./p-fcc662c6.js";import{FormMetadata as n,buildFormMetadata as r}from"@sankhyalabs/ezui/dist/collection/utils/form";import"./p-00278e07.js";import"./p-4be4cdac.js";import{P as d}from"./p-30cf616e.js";import"./p-21749402.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-58fd3017.js";import"./p-ff1990ad.js";import"./p-acca8a69.js";import{T as l}from"./p-7e7a7473.js";import{V as c}from"./p-95ce311a.js";import{S as m}from"./p-229c3615.js";import{S as u}from"./p-17425c72.js";import"./p-763edad2.js";import"./p-8d884fab.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";import"./p-6dc031de.js";import"./p-23736d75.js";import"@sankhyalabs/core/dist/dataunit/DataUnit";class v{constructor(t,i,s){this._parentGuide=t,this._formMetadata=i,this._dataUnit=s}get id(){return this._parentGuide.id}buildGuideItem(t){const i=Object.assign({},this._parentGuide);delete i.expanded,delete i.children;const s=this._dataUnit.getSelectedRecord();if(!s)return i;const e=this._dataUnit.isNewRecord(s.__record__id__),a=Array.from(this._formMetadata.getAllSheets().values()).map((i=>{const{name:s,label:a}=i,o=null!=n.getDetailName(s.split("::").pop()),h=o&&e,r=this._parentGuide.id,d=o?`${r}::${s}`:`${r}__FORM:${s}`;return o&&t.has(d)&&!h?t.get(d).buildGuideItem(t):{id:d,label:a,disabled:h,tooltip:h?"Finalize o cadastro para ter acesso a esta guia.":void 0}})),o=a.shift();return o.label=e?"Novo Registro":s.__record__label__,o.children=a,i.children=[o],i}}const p=class{constructor(s){t(this,s),this.snkDetailGuidesChange=i(this,"snkDetailGuidesChange",7),this.snkSwitchGuide=i(this,"snkSwitchGuide",7),this.formItemsReady=i(this,"formItemsReady",7),this._disabledButtons=void 0,this._currentView=void 0,this.attachmentRegisterKey=void 0,this.formConfigManager=void 0,this.dataUnitName=void 0,this.resourceID=void 0,this.guideItemPath=void 0,this.entityName=void 0,this.label=void 0,this.dataUnit=void 0,this.selectedForm=void 0,this.dataState=void 0,this.messagesBuilder=void 0,this.branchGuide=void 0,this.canEdit=!0,this.taskbarCustomContainerId=void 0,this.customEditors=void 0,this.customRenders=void 0}observeDataUnit(t,i){null==t||t.subscribe(this.dataUnitActionHandler.bind(this)),null==i||i.unsubscribe(this.dataUnitActionHandler)}observerDataState(t,i){const s=!(null==i?void 0:i.insertionMode)&&(null==t?void 0:t.insertionMode),e=(null==i?void 0:i.insertionMode)&&!(null==t?void 0:t.insertionMode);if((s||e)&&this.loadMetadata(),null==this._formMetadata)return;const a=null==t?void 0:t.selectedRecord,o=null==i?void 0:i.selectedRecord;(null==a?void 0:a.__record__id__)!==(null==o?void 0:o.__record__id__)&&this.snkDetailGuidesChange.emit(new v(this.branchGuide,this._formMetadata,this.dataUnit)),s&&setTimeout((()=>{this.changeViewMode(c.FORM)}),0),e&&this.changeViewMode(c.GRID);const h=[];this.dataState.hasPrevious||h.push(l.PREVIOUS),this.dataState.hasNext||h.push(l.NEXT),this.dataState.insertionMode&&h.push(l.INSERT),this._disabledButtons=h}async changeViewMode(t){this.emitSwitchEvent(t)}async configGrid(){this._snkGrid&&this._snkGrid.showConfig()}async showUp(){this._snkFormView&&this._snkFormView.showUp(),this._snkGrid&&this._snkGrid.scrollIntoView({behavior:"smooth",block:"start"})}async addCustomEditor(t,i){var s;const e=this.normalizeBranchGuideId(null===(s=this.branchGuide)||void 0===s?void 0:s.id);this._snkGrid.addCustomEditor(t,i,e),this._snkFormView.addCustomEditor(t,i,e)}async observerPropsCustomEditor(t){for(const i in t)await this.addCustomEditor(i,t[i])}async addGridCustomRender(t,i){var s;const e=this.normalizeBranchGuideId(null===(s=this.branchGuide)||void 0===s?void 0:s.id);await this._snkGrid.addGridCustomRender(t,i,e)}onContentCardChanged(t){m.updateContentCard(t.detail.formName,t.detail.cardConfig,t.detail.propertyChanged,this.formConfigManager).then((()=>s(this))),t.stopPropagation()}async observeCustomRenders(t){for(const i in t){const s=t[i];await this.addGridCustomRender(i,s)}}updateLabel(){const t=this.guideItemPath?this.guideItemPath.length:0;if(t>0){const i=t>0?this.guideItemPath.map((t=>t.label)):void 0;this.label=i.pop(),this._levelPath=i.length>0?i.join(" / "):void 0}else this.label="",this._levelPath=void 0}getFormGuideId(t){var i;if(!t){if(null==(null===(i=this.dataState)||void 0===i?void 0:i.selectedRecord))return;const s=Array.from(this._formMetadata.getAllSheets().keys());if(!s||0==s.length)return;t=s[0]}return`${this.stripFormPattern(this.branchGuide.id)}__FORM:${t}`}stripFormPattern(t){return t.replace(p.REGEX_FORM_ID,"")}loadMetadata(){if(!this.dataUnit)return;if(!this.formConfigManager.isLoaded)return;const t=this.formConfigManager.getConfig(this.dataUnit);this._formMetadata=r(null==t||0===t.fields.length?void 0:t,this.dataUnit,!0)}dataUnitReadyHandler(t){this.dataUnit=t.detail,this.loadMetadata()}updateViewStack(t){var i,s;this._viewStack=t,this._currentView=this.selectedForm?1:0,null===(s=null===(i=this._viewStack)||void 0===i?void 0:i.show)||void 0===s||s.call(i,this._currentView)}getFormFields(){return this.selectedForm&&this._formMetadata?this._formMetadata.getSheet(this.selectedForm).fields:[]}emitSwitchEvent(t){const i=t===c.GRID?this.stripFormPattern(this.branchGuide.id):this.getFormGuideId();i&&this.snkSwitchGuide.emit(i)}handleAttachBack(){this._viewStack.show(c.GRID)}executeActionHandler(t){t.detail===l.GRID_MODE&&(this.emitSwitchEvent(c.GRID),t.stopPropagation()),t.detail!==l.FORM_MODE&&t.detail!==l.UPDATE||(this.emitSwitchEvent(c.FORM),t.stopPropagation()),t.detail===l.ATTACH&&(this._viewStack.show(c.ATTACHMENT),t.stopPropagation())}async getAttachmentRegisterKey(){if(this._snkDataUnit)return(await this._snkDataUnit.getSelectedRecordsIDsInfo()).map((({value:t})=>t)).join("_")}async handleDataStateChange({detail:t}){this.dataState=t,void 0!==t.selectedRecord&&this._snkDataUnit&&(this.attachmentRegisterKey=await this.getAttachmentRegisterKey())}componentWillLoad(){this._configName=`dynaform.${this.entityName}`,this.formConfigManager=new h(this._configName,this.resourceID,(()=>this.loadMetadata()),this.dataUnit),this.formConfigManager.loadConfig(),null==this.messagesBuilder&&(this.messagesBuilder=new u(this.entityName))}async componentDidLoad(){await this.observerPropsCustomEditor(this.customEditors),await this.observeCustomRenders(this.customRenders)}async dataUnitActionHandler(t){t.type===o.FIELD_INVALIDATED&&this.addErrorBadgeToBranchGuide()}addErrorBadgeToBranchGuide(){this.branchGuide=Object.assign(Object.assign({},this.branchGuide),{badge:"error"}),this.snkDetailGuidesChange.emit(new v(this.branchGuide,this._formMetadata,this.dataUnit))}normalizeBranchGuideId(t){return null==t?void 0:t.replace(/child\[(.*?)\]/g,"$1").replace(/::/g,">")}render(){return this.updateLabel(),e(a,null,e("snk-data-unit",{ref:t=>this._snkDataUnit=t,dataUnitName:`${this.dataUnitName}`,onDataUnitReady:t=>this.dataUnitReadyHandler(t),entityName:this.entityName,onDataStateChange:this.handleDataStateChange.bind(this),ignoreSaveMessage:this._currentView===c.GRID,messagesBuilder:this.messagesBuilder,configName:this._configName},e("ez-view-stack",{ref:t=>this.updateViewStack(t)},e("stack-item",null,e("div",{class:"ez-box ez-box--shadow grid-container"},e("div",{class:"ez-flex ez-title--primary ez-size-width--full ez-padding--large detail-header"},e("div",{class:"ez-flex ez-text ez-text--bold ez-flex--justify-start ez-flex--align-items-center"},this._levelPath?e("span",{class:"level-path"},this._levelPath+" /"):void 0,this.label)),e("snk-grid",{class:"ez-size-width--full ez-size-height--full",ref:t=>this._snkGrid=t,configName:this._configName,messagesBuilder:this.messagesBuilder,onGridDoubleClick:()=>this.emitSwitchEvent(c.FORM),onActionClick:t=>this.executeActionHandler(t),presentationMode:d.SECONDARY,canEdit:this.canEdit,isDetail:!0,taskbarCustomContainerId:this.taskbarCustomContainerId,gridHeaderCustomSlotId:"DETAIL_GRID_HEADER_CUSTOM_ELEMENTS",topTaskbarCustomSlotId:"DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS",outlineMode:!1}))),e("stack-item",null,e("snk-form-view",{ref:t=>this._snkFormView=t,canExpand:!1,canFix:!1,name:this.selectedForm,formMetadata:this._formMetadata,dataUnit:this.dataUnit,fields:this.getFormFields(),label:this.label,levelPath:this._levelPath,onFormItemsReady:({detail:t})=>this.formItemsReady.emit(t)},e("snk-taskbar",{key:"guideViewerTaskbar",class:"form-taskbar","data-element-id":"guideViewer",configName:this._configName,messagesBuilder:this.messagesBuilder,disabledButtons:this._disabledButtons,buttons:"INSERT,PREVIOUS,NEXT,DIVIDER,CLONE,REMOVE,MORE_OPTIONS,DIVIDER,GRID_MODE,CONFIGURATOR",primaryButton:"INSERT",presentationMode:d.SECONDARY,onActionClick:t=>this.executeActionHandler(t),dataUnit:this.dataUnit,resourceID:this.resourceID,customContainerId:this.taskbarCustomContainerId,customSlotId:"DETAIL_TASKBAR_CUSTOM_ELEMENTS"},e("slot",{name:"DETAIL_TASKBAR_CUSTOM_ELEMENTS"})))),e("stack-item",null,e("snk-attach",{registerKey:this.attachmentRegisterKey,messagesBuilder:this.messagesBuilder,entityName:this.entityName,onBack:this.handleAttachBack.bind(this)})))))}static get watchers(){return{dataUnit:["observeDataUnit"],dataState:["observerDataState"],customEditors:["observerPropsCustomEditor"],customRenders:["observeCustomRenders"]}}};p.REGEX_FORM_ID=/__FORM:[^:]+/g,p.style=".sc-snk-detail-view-h{display:flex;row-gap:24px;flex-direction:column;width:100%;height:100%}.level-path.sc-snk-detail-view{color:var(--color--title-primary, #2B3A54);font-weight:var(--text-weight--medium, 400);padding-right:3px}.form-taskbar.sc-snk-detail-view{padding-bottom:var(--space--medium)}.grid-container.sc-snk-detail-view{background-color:#FFF;min-height:100px}.detail-header.sc-snk-detail-view{padding-bottom:0}";export{p as snk_detail_view}
@@ -0,0 +1 @@
1
+ import{r as i,c as t,h as s,H as e}from"./p-d2d301a6.js";import{I as a}from"./p-58fd3017.js";import"./p-00278e07.js";import{P as o}from"./p-4be4cdac.js";import"@sankhyalabs/core";import"./p-30cf616e.js";import"./p-21749402.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-ff1990ad.js";import"./p-acca8a69.js";import{ApplicationUtils as n}from"@sankhyalabs/ezui/dist/collection/utils";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";import"./p-8d884fab.js";const r=class{constructor(s){i(this,s),this.pesquisaGridSelectItem=t(this,"pesquisaGridSelectItem",7),this._pesquisaFetcher=new o,this.metadata=void 0,this.dataSource=[],this.pkField=void 0,this.descriptionField=void 0,this.entityName=void 0,this._inMemoryLoader=void 0,this._dataunit=void 0,this._gridConfig=void 0}observeDataSource(i){this._inMemoryLoader&&this._dataunit&&i&&(this._inMemoryLoader.records=[...i])}async componentWillLoad(){this.initializeDataUnit(),this._gridConfig=await this._pesquisaFetcher.loadPesquisaGridConfig(this.entityName)}initializeDataUnit(){var i;this._inMemoryLoader=new a(this.metadata,null!==(i=this.dataSource)&&void 0!==i?i:[]),this._dataunit=this._inMemoryLoader.dataUnit,this._dataunit.pageSize=0}handleDbClick(i){this.pesquisaGridSelectItem.emit({value:i[this.pkField],label:i[this.descriptionField]})}async handleConfigChanged({detail:i}){var t;const s=null!==(t=null==i?void 0:i.columns)&&void 0!==t?t:[];await this._pesquisaFetcher.savePesquisaGridConfig(this.entityName,s)}render(){return s(e,null,s("ez-grid",{dataUnit:this._dataunit,config:this._gridConfig,canEdit:!1,suppressCheckboxColumn:!0,compact:!0,autoFocus:!1,onEzDoubleClick:({detail:i})=>this.handleDbClick(i),onConfigChange:async i=>this.handleConfigChanged(i)}))}static get watchers(){return{dataSource:["observeDataSource"]}}};r.style=".sc-pesquisa-grid-h{height:100vh;background:var(--background--xlight, #FFF);overflow-x:auto}ez-grid.sc-pesquisa-grid{--ez-grid__container--shadow:none;--ez-grid__header--shadow:none}";const l=class{constructor(s){i(this,s),this.pesquisaTreeSelectItem=t(this,"pesquisaTreeSelectItem",7),this.treeLoader=void 0,this.argument=void 0,this.allowsNonAnalytic=!1,this.items=[]}async applyFilter(){await this._tree.applyFilter(this.argument)}async loadTree(){if(!this.treeLoader||"function"!=typeof this.treeLoader)return;const i=await this.treeLoader((this.argument||"").trim());this.items=[...i]}expandOrCloseAllItems(i,t){return i.map((i=>Object.assign(Object.assign({},i),{expanded:t,children:i.children?this.expandOrCloseAllItems(i.children,t):void 0})))}handleExpandAll(){this.items=[...this.expandOrCloseAllItems(this.items,!0)]}handleCloseAll(){this.items=[...this.expandOrCloseAllItems(this.items,!1)]}handleDbClick(i){var t;this.allowsNonAnalytic||(null===(t=i.props)||void 0===t?void 0:t.analitico)?this.pesquisaTreeSelectItem.emit({value:i.id,label:i.label}):n.error("Erro","Há pelo menos um registro inválido selecionado. Você deve selecionar itens do tipo 'analítico'.")}async componentWillLoad(){await this.loadTree()}render(){return s(e,null,s("div",{class:"actions-container"},s("ez-button",{size:"small",mode:"icon",class:"ez-margin-right--small",iconName:"show-list",title:"Expandir",onClick:()=>this.handleExpandAll()}),s("ez-button",{size:"small",mode:"icon",iconName:"hide-list",title:"Recolher",onClick:()=>this.handleCloseAll()})),s("ez-tree",{ref:i=>this._tree=i,onEzDbClickItem:({detail:i})=>this.handleDbClick(i),items:this.items}))}};l.style=".sc-pesquisa-tree-h{--snk-pesquisa--tree__action-container--top:var(--space--sm);--snk-pesquisa--tree__action-container--right:var(--space--small);--snk-pesquisa--tree__min-height:var(--space--extra-large);background:var(--background--xlight, #FFF);position:relative;display:inline-block;min-height:var(--snk-pesquisa--tree__min-height)}.sc-pesquisa-tree-h:hover .actions-container.sc-pesquisa-tree{display:flex}.actions-container.sc-pesquisa-tree{flex-direction:row;position:absolute;top:var(--snk-pesquisa--tree__action-container--top);right:var(--snk-pesquisa--tree__action-container--right);display:none}";export{r as pesquisa_grid,l as pesquisa_tree}
Binary file
Binary file