@sankhyalabs/sankhyablocks 9.2.2 → 9.3.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (997) hide show
  1. package/dist/cjs/AuthorizationConfig-79ffae4b.js.gz +0 -0
  2. package/dist/cjs/{ConfigStorage-0ebc800f.js → ConfigStorage-8b6def32.js} +2 -2
  3. package/dist/cjs/ConfigStorage-8b6def32.js.gz +0 -0
  4. package/dist/cjs/{DataFetcher-602cdc72.js → DataFetcher-2c37b6a1.js} +51 -0
  5. package/dist/cjs/{DataFetcher-602cdc72.js.gz → DataFetcher-2c37b6a1.js.gz} +0 -0
  6. package/dist/cjs/FormConfigHelper-ebb77625.js.gz +0 -0
  7. package/dist/cjs/GetSelectedRecordsIDsInfo-bd50caf1.js.gz +0 -0
  8. package/dist/cjs/IFetchDataExporterParams-e78ec415.js.gz +0 -0
  9. package/dist/cjs/{ISave-18205d86.js → ISave-b22b3cf0.js} +1 -1
  10. package/dist/cjs/ISave-b22b3cf0.js.gz +0 -0
  11. package/dist/cjs/ParamType-90b440a0.js.gz +0 -0
  12. package/dist/cjs/PersonalizedFilterUtils-7259cf65.js.gz +0 -0
  13. package/dist/cjs/PrintUtils-bcaeb82f.js.gz +0 -0
  14. package/dist/cjs/ResourceIDUtils-5ff86aa7.js.gz +0 -0
  15. package/dist/cjs/{SnkFormConfigManager-4b651537.js → SnkFormConfigManager-477a27de.js} +2 -2
  16. package/dist/cjs/SnkFormConfigManager-477a27de.js.gz +0 -0
  17. package/dist/cjs/{ClientSideExporterProvider-bb0b2273.js → SnkMultiSelectionListDataSource-b7ab26ba.js} +78 -78
  18. package/dist/cjs/SnkMultiSelectionListDataSource-b7ab26ba.js.gz +0 -0
  19. package/dist/cjs/{auth-fetcher-82317d4d.js → auth-fetcher-78a90b36.js} +1 -1
  20. package/dist/cjs/auth-fetcher-78a90b36.js.gz +0 -0
  21. package/dist/cjs/config-header.cjs.entry.js.gz +0 -0
  22. package/dist/cjs/configs-button.cjs.entry.js.gz +0 -0
  23. package/dist/cjs/constants-6d82e405.js.gz +0 -0
  24. package/dist/cjs/{dataunit-fetcher-93077a2f.js → dataunit-fetcher-877944a9.js} +1 -1
  25. package/dist/cjs/dataunit-fetcher-877944a9.js.gz +0 -0
  26. package/dist/cjs/default-filters-a09bf82b.js.gz +0 -0
  27. package/dist/cjs/field-config_2.cjs.entry.js.gz +0 -0
  28. package/dist/cjs/fields-layout.cjs.entry.js.gz +0 -0
  29. package/dist/cjs/fields-selector.cjs.entry.js.gz +0 -0
  30. package/dist/cjs/filter-item-type.enum-a7ffdaa6.js.gz +0 -0
  31. package/dist/cjs/filter-type.enum-2bb46d2a.js.gz +0 -0
  32. package/dist/cjs/filter-validate-6993f6f2.js +30 -0
  33. package/dist/cjs/filter-validate-6993f6f2.js.gz +0 -0
  34. package/dist/cjs/filterNumberVariation-d65332da.js.gz +0 -0
  35. package/dist/cjs/{form-config-fetcher-05d210e7.js → form-config-fetcher-dee08eb4.js} +1 -1
  36. package/dist/cjs/form-config-fetcher-dee08eb4.js.gz +0 -0
  37. package/dist/cjs/guides-configurator.cjs.entry.js.gz +0 -0
  38. package/dist/cjs/index-13d05f03.js.gz +0 -0
  39. package/dist/cjs/index-1cf293c1.js +8 -8
  40. package/dist/cjs/index-1cf293c1.js.gz +0 -0
  41. package/dist/cjs/index-62760a9c.js.gz +0 -0
  42. package/dist/cjs/index-8d94b7e0.js.gz +0 -0
  43. package/dist/cjs/index-e3e39724.js.gz +0 -0
  44. package/dist/cjs/index.cjs.js.gz +0 -0
  45. package/dist/cjs/loader.cjs.js +1 -1
  46. package/dist/cjs/loader.cjs.js.gz +0 -0
  47. package/dist/cjs/pesquisa-grid_2.cjs.entry.js +4 -4
  48. package/dist/cjs/pesquisa-grid_2.cjs.entry.js.gz +0 -0
  49. package/dist/cjs/presentationMode-52ec3bdd.js.gz +0 -0
  50. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  51. package/dist/cjs/sankhyablocks.cjs.js.gz +0 -0
  52. package/dist/cjs/snk-actions-button_8.cjs.entry.js +5 -5
  53. package/dist/cjs/snk-actions-button_8.cjs.entry.js.gz +0 -0
  54. package/dist/cjs/snk-actions-form.cjs.entry.js.gz +0 -0
  55. package/dist/cjs/snk-application.cjs.entry.js +6 -6
  56. package/dist/cjs/snk-application.cjs.entry.js.gz +0 -0
  57. package/dist/cjs/snk-attach.cjs.entry.js +5 -5
  58. package/dist/cjs/snk-attach.cjs.entry.js.gz +0 -0
  59. package/dist/cjs/snk-client-confirm.cjs.entry.js.gz +0 -0
  60. package/dist/cjs/snk-configurator.cjs.entry.js.gz +0 -0
  61. package/dist/cjs/snk-crud.cjs.entry.js +5 -5
  62. package/dist/cjs/snk-crud.cjs.entry.js.gz +0 -0
  63. package/dist/cjs/snk-custom-slot-elements.cjs.entry.js.gz +0 -0
  64. package/dist/cjs/snk-data-exporter.cjs.entry.js +5 -5
  65. package/dist/cjs/snk-data-exporter.cjs.entry.js.gz +0 -0
  66. package/dist/cjs/{snk-data-unit-7cb76490.js → snk-data-unit-0cfa7622.js} +2 -2
  67. package/dist/cjs/snk-data-unit-0cfa7622.js.gz +0 -0
  68. package/dist/cjs/snk-data-unit.cjs.entry.js +3 -3
  69. package/dist/cjs/snk-data-unit.cjs.entry.js.gz +0 -0
  70. package/dist/cjs/snk-default-filter.cjs.entry.js.gz +0 -0
  71. package/dist/cjs/snk-detail-view.cjs.entry.js +7 -7
  72. package/dist/cjs/snk-detail-view.cjs.entry.js.gz +0 -0
  73. package/dist/cjs/snk-entity-list.cjs.entry.js +5 -2
  74. package/dist/cjs/snk-entity-list.cjs.entry.js.gz +0 -0
  75. package/dist/cjs/snk-exporter-email-sender.cjs.entry.js.gz +0 -0
  76. package/dist/cjs/snk-expression-group_2.cjs.entry.js.gz +0 -0
  77. package/dist/cjs/snk-filter-advanced-mode_2.cjs.entry.js.gz +0 -0
  78. package/dist/cjs/snk-filter-bar_4.cjs.entry.js +164 -100
  79. package/dist/cjs/snk-filter-bar_4.cjs.entry.js.gz +0 -0
  80. package/dist/cjs/snk-filter-binary-select.cjs.entry.js +23 -2
  81. package/dist/cjs/snk-filter-binary-select.cjs.entry.js.gz +0 -0
  82. package/dist/cjs/snk-filter-checkbox-list.cjs.entry.js +20 -2
  83. package/dist/cjs/snk-filter-checkbox-list.cjs.entry.js.gz +0 -0
  84. package/dist/cjs/snk-filter-detail.cjs.entry.js +25 -8
  85. package/dist/cjs/snk-filter-detail.cjs.entry.js.gz +0 -0
  86. package/dist/cjs/snk-filter-field-search_2.cjs.entry.js.gz +0 -0
  87. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +9 -14
  88. package/dist/cjs/snk-filter-modal-item.cjs.entry.js.gz +0 -0
  89. package/dist/cjs/snk-filter-multi-select.cjs.entry.js +16 -3
  90. package/dist/cjs/snk-filter-multi-select.cjs.entry.js.gz +0 -0
  91. package/dist/cjs/snk-filter-number.cjs.entry.js +34 -3
  92. package/dist/cjs/snk-filter-number.cjs.entry.js.gz +0 -0
  93. package/dist/cjs/snk-filter-period.cjs.entry.js +59 -14
  94. package/dist/cjs/snk-filter-period.cjs.entry.js.gz +0 -0
  95. package/dist/cjs/snk-filter-search.cjs.entry.js +14 -3
  96. package/dist/cjs/snk-filter-search.cjs.entry.js.gz +0 -0
  97. package/dist/cjs/snk-filter-text.cjs.entry.js +18 -1
  98. package/dist/cjs/snk-filter-text.cjs.entry.js.gz +0 -0
  99. package/dist/cjs/snk-form-summary.cjs.entry.js.gz +0 -0
  100. package/dist/cjs/snk-form-view.cjs.entry.js.gz +0 -0
  101. package/dist/cjs/snk-form_2.cjs.entry.js +4 -4
  102. package/dist/cjs/snk-form_2.cjs.entry.js.gz +0 -0
  103. package/dist/cjs/snk-grid.cjs.entry.js +38 -21
  104. package/dist/cjs/snk-grid.cjs.entry.js.gz +0 -0
  105. package/dist/cjs/{snk-guides-viewer-73d40f42.js → snk-guides-viewer-38277265.js} +5 -5
  106. package/dist/cjs/snk-guides-viewer-38277265.js.gz +0 -0
  107. package/dist/cjs/snk-guides-viewer.cjs.entry.js +7 -7
  108. package/dist/cjs/snk-guides-viewer.cjs.entry.js.gz +0 -0
  109. package/dist/cjs/snk-personalized-filter-editor.cjs.entry.js.gz +0 -0
  110. package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
  111. package/dist/cjs/snk-personalized-filter.cjs.entry.js.gz +0 -0
  112. package/dist/cjs/snk-pesquisa.cjs.entry.js +4 -4
  113. package/dist/cjs/snk-pesquisa.cjs.entry.js.gz +0 -0
  114. package/dist/cjs/snk-print-selector.cjs.entry.js.gz +0 -0
  115. package/dist/cjs/snk-simple-bar.cjs.entry.js.gz +0 -0
  116. package/dist/cjs/snk-simple-crud.cjs.entry.js +13 -13
  117. package/dist/cjs/snk-simple-crud.cjs.entry.js.gz +0 -0
  118. package/dist/cjs/snk-taskbar.cjs.entry.js.gz +0 -0
  119. package/dist/cjs/sortable.esm-9a110bb7.js.gz +0 -0
  120. package/dist/cjs/taskbar-elements-fb5d1e08.js.gz +0 -0
  121. package/dist/cjs/taskbar-processor-2fba34a8.js.gz +0 -0
  122. package/dist/cjs/teste-pesquisa.cjs.entry.js.gz +0 -0
  123. package/dist/collection/components/snk-actions-button/actions/enum/ActionsType.js.gz +0 -0
  124. package/dist/collection/components/snk-actions-button/actions/enum/ParamType.js.gz +0 -0
  125. package/dist/collection/components/snk-actions-button/actions/enum/RefreshType.js.gz +0 -0
  126. package/dist/collection/components/snk-actions-button/actions/executor/java.executor.js.gz +0 -0
  127. package/dist/collection/components/snk-actions-button/actions/executor/javascript.executor.js.gz +0 -0
  128. package/dist/collection/components/snk-actions-button/actions/executor/launch-screen.executor.js.gz +0 -0
  129. package/dist/collection/components/snk-actions-button/actions/executor/procedure.executor.js.gz +0 -0
  130. package/dist/collection/components/snk-actions-button/actions/factory/executor.factory.js.gz +0 -0
  131. package/dist/collection/components/snk-actions-button/actions/index.js.gz +0 -0
  132. package/dist/collection/components/snk-actions-button/actions/interfaces/IAction.js.gz +0 -0
  133. package/dist/collection/components/snk-actions-button/actions/interfaces/IExecSource.js.gz +0 -0
  134. package/dist/collection/components/snk-actions-button/actions/interfaces/IExecuteActions.js.gz +0 -0
  135. package/dist/collection/components/snk-actions-button/actions/interfaces/IExecuteActionsProps.js.gz +0 -0
  136. package/dist/collection/components/snk-actions-button/actions/interfaces/IResultParam.js.gz +0 -0
  137. package/dist/collection/components/snk-actions-button/clientEvent/index.js.gz +0 -0
  138. package/dist/collection/components/snk-actions-button/clientEvent/interfaces/IClientEventConfirm.js.gz +0 -0
  139. package/dist/collection/components/snk-actions-button/interfaces/index.js.gz +0 -0
  140. package/dist/collection/components/snk-actions-button/snk-actions-button.css.gz +0 -0
  141. package/dist/collection/components/snk-actions-button/snk-actions-button.js.gz +0 -0
  142. package/dist/collection/components/snk-actions-button/subcomponents/snk-actions-form.js.gz +0 -0
  143. package/dist/collection/components/snk-actions-button/subcomponents/snk-client-confirm.js.gz +0 -0
  144. package/dist/collection/components/snk-application/__mocks__/snk-application.js.gz +0 -0
  145. package/dist/collection/components/snk-application/errorhandler/snk-error-handler.js.gz +0 -0
  146. package/dist/collection/components/snk-application/request-listener/DebouncedRequestListener.js.gz +0 -0
  147. package/dist/collection/components/snk-application/request-listener/RequestListenerFactory.js.gz +0 -0
  148. package/dist/collection/components/snk-application/request-listener/RequestListenerLoadingBar.js.gz +0 -0
  149. package/dist/collection/components/snk-application/search-strategy/exec-prepared-search-plus.js.gz +0 -0
  150. package/dist/collection/components/snk-application/snk-application.css.gz +0 -0
  151. package/dist/collection/components/snk-application/snk-application.js.gz +0 -0
  152. package/dist/collection/components/snk-attach/interfaces/ICrudConfig.js.gz +0 -0
  153. package/dist/collection/components/snk-attach/interfaces/TFetcherType.js.gz +0 -0
  154. package/dist/collection/components/snk-attach/interfaces/index.js.gz +0 -0
  155. package/dist/collection/components/snk-attach/snk-attach.css.gz +0 -0
  156. package/dist/collection/components/snk-attach/snk-attach.js.gz +0 -0
  157. package/dist/collection/components/snk-attach/structure/builder/anexo-sistema-crud-config.builder.js.gz +0 -0
  158. package/dist/collection/components/snk-attach/structure/builder/attach-crud-config.builder.js.gz +0 -0
  159. package/dist/collection/components/snk-attach/structure/builder/taskbar-builder.js.gz +0 -0
  160. package/dist/collection/components/snk-attach/structure/fetcher/facade/fetcher.facade.js.gz +0 -0
  161. package/dist/collection/components/snk-attach/structure/fetcher/factory/anexo-sistema-data-unit.factory.js.gz +0 -0
  162. package/dist/collection/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.js.gz +0 -0
  163. package/dist/collection/components/snk-attach/structure/index.js.gz +0 -0
  164. package/dist/collection/components/snk-configurator/AuthorizationConfig.js.gz +0 -0
  165. package/dist/collection/components/snk-configurator/snk-configurator.css.gz +0 -0
  166. package/dist/collection/components/snk-configurator/snk-configurator.js.gz +0 -0
  167. package/dist/collection/components/snk-crud/interfaces/PropsCustomEditor.js.gz +0 -0
  168. package/dist/collection/components/snk-crud/interfaces/PropsCustomRender.js.gz +0 -0
  169. package/dist/collection/components/snk-crud/snk-crud.css.gz +0 -0
  170. package/dist/collection/components/snk-crud/snk-crud.js.gz +0 -0
  171. package/dist/collection/components/snk-crud/subcomponents/CardFormResizeObserver.js.gz +0 -0
  172. package/dist/collection/components/snk-crud/subcomponents/GuideBuilder.js.gz +0 -0
  173. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.css.gz +0 -0
  174. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js.gz +0 -0
  175. package/dist/collection/components/snk-crud/subcomponents/snk-form-summary.css.gz +0 -0
  176. package/dist/collection/components/snk-crud/subcomponents/snk-form-summary.js.gz +0 -0
  177. package/dist/collection/components/snk-crud/subcomponents/snk-form-view.css.gz +0 -0
  178. package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js.gz +0 -0
  179. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.css.gz +0 -0
  180. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js.gz +0 -0
  181. package/dist/collection/components/snk-custom-slot-elements/snk-custom-slot-elements.css.gz +0 -0
  182. package/dist/collection/components/snk-custom-slot-elements/snk-custom-slot-elements.js.gz +0 -0
  183. package/dist/collection/components/snk-data-exporter/data/attachment.js.gz +0 -0
  184. package/dist/collection/components/snk-data-exporter/data/email.js.gz +0 -0
  185. package/dist/collection/components/snk-data-exporter/data/export-config.js.gz +0 -0
  186. package/dist/collection/components/snk-data-exporter/data/export-result.js.gz +0 -0
  187. package/dist/collection/components/snk-data-exporter/data/report.js.gz +0 -0
  188. package/dist/collection/components/snk-data-exporter/exporter-email-sender/email-info-step.js.gz +0 -0
  189. package/dist/collection/components/snk-data-exporter/exporter-email-sender/options-step.js.gz +0 -0
  190. package/dist/collection/components/snk-data-exporter/exporter-email-sender/snk-exporter-email-sender.js.gz +0 -0
  191. package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js.gz +0 -0
  192. package/dist/collection/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.js.gz +0 -0
  193. package/dist/collection/components/snk-data-exporter/interfaces/IExporterProvider.js.gz +0 -0
  194. package/dist/collection/components/snk-data-exporter/interfaces/IExporterStrategy.js.gz +0 -0
  195. package/dist/collection/components/snk-data-exporter/interfaces/IRecordID.js.gz +0 -0
  196. package/dist/collection/components/snk-data-exporter/interfaces/ISelectedID.js.gz +0 -0
  197. package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js.gz +0 -0
  198. package/dist/collection/components/snk-data-exporter/providers/ServerSideExporterProvider.js.gz +0 -0
  199. package/dist/collection/components/snk-data-exporter/snk-data-exporter.css.gz +0 -0
  200. package/dist/collection/components/snk-data-exporter/snk-data-exporter.js.gz +0 -0
  201. package/dist/collection/components/snk-data-exporter/structure/ItemBuilder.js.gz +0 -0
  202. package/dist/collection/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.js.gz +0 -0
  203. package/dist/collection/components/snk-data-exporter/utils/ParserExport.js.gz +0 -0
  204. package/dist/collection/components/snk-data-unit/MultipleUpdateHelper.js.gz +0 -0
  205. package/dist/collection/components/snk-data-unit/snk-data-unit.js.gz +0 -0
  206. package/dist/collection/components/snk-data-unit/test/resources/metadataMock.js.gz +0 -0
  207. package/dist/collection/components/snk-data-unit/test/resources/parentMetadataMock.js.gz +0 -0
  208. package/dist/collection/components/snk-entity-list/snk-entity-list.css.gz +0 -0
  209. package/dist/collection/components/snk-entity-list/snk-entity-list.js +23 -3
  210. package/dist/collection/components/snk-entity-list/snk-entity-list.js.gz +0 -0
  211. package/dist/collection/components/snk-filter-bar/filter-item/dataunitfilter/data-unit-filter-builder.js.gz +0 -0
  212. package/dist/collection/components/snk-filter-bar/filter-item/editors/enum/filterNumberVariation.js.gz +0 -0
  213. package/dist/collection/components/snk-filter-bar/filter-item/editors/enum/presentationMode.js.gz +0 -0
  214. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.js +72 -2
  215. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.js.gz +0 -0
  216. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-checkbox-list.js +73 -2
  217. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-checkbox-list.js.gz +0 -0
  218. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.js +51 -5
  219. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.js.gz +0 -0
  220. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js +83 -3
  221. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js.gz +0 -0
  222. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js +118 -27
  223. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js.gz +0 -0
  224. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-search.js +49 -5
  225. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-search.js.gz +0 -0
  226. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js +71 -1
  227. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js.gz +0 -0
  228. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-personalized-filter-editor/snk-personalized-filter-editor.css.gz +0 -0
  229. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-personalized-filter-editor/snk-personalized-filter-editor.js.gz +0 -0
  230. package/dist/collection/components/snk-filter-bar/filter-item/filter-item-type-mask.enum.js.gz +0 -0
  231. package/dist/collection/components/snk-filter-bar/filter-item/filter-item-type.enum.js.gz +0 -0
  232. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +62 -11
  233. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js.gz +0 -0
  234. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.css.gz +0 -0
  235. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +70 -8
  236. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js.gz +0 -0
  237. package/dist/collection/components/snk-filter-bar/filter-list/snk-filter-list.js.gz +0 -0
  238. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.css +0 -4
  239. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.css.gz +0 -0
  240. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +112 -16
  241. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js.gz +0 -0
  242. package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-default-filter/snk-default-filter.css.gz +0 -0
  243. package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-default-filter/snk-default-filter.js.gz +0 -0
  244. package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.css.gz +0 -0
  245. package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js +8 -16
  246. package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js.gz +0 -0
  247. package/dist/collection/components/snk-filter-bar/snk-filter-bar.css.gz +0 -0
  248. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +106 -52
  249. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js.gz +0 -0
  250. package/dist/collection/components/snk-filter-bar/types/custom-element-filter.js.gz +0 -0
  251. package/dist/collection/components/snk-filter-bar/types/default-filters.js.gz +0 -0
  252. package/dist/collection/components/snk-filter-bar/types/filter-type.enum.js.gz +0 -0
  253. package/dist/collection/components/snk-filter-bar/utils/SnkFilterModalFactory.js +3 -1
  254. package/dist/collection/components/snk-filter-bar/utils/SnkFilterModalFactory.js.gz +0 -0
  255. package/dist/collection/components/snk-filter-bar/utils/filter-validate.js +24 -0
  256. package/dist/collection/components/snk-filter-bar/utils/filter-validate.js.gz +0 -0
  257. package/dist/collection/components/snk-filter-bar/utils/filters-mock.js.gz +0 -0
  258. package/dist/collection/components/snk-filter-field-search/interfaces/index.js.gz +0 -0
  259. package/dist/collection/components/snk-filter-field-search/snk-filter-field-search.css.gz +0 -0
  260. package/dist/collection/components/snk-filter-field-search/snk-filter-field-search.js.gz +0 -0
  261. package/dist/collection/components/snk-filter-field-search/subcomponents/index.js.gz +0 -0
  262. package/dist/collection/components/snk-filter-field-search/subcomponents/list-item.js.gz +0 -0
  263. package/dist/collection/components/snk-form/snk-form.css.gz +0 -0
  264. package/dist/collection/components/snk-form/snk-form.js.gz +0 -0
  265. package/dist/collection/components/snk-form-config/FormConfigHelper.js.gz +0 -0
  266. package/dist/collection/components/snk-form-config/SnkFormConfigManager.js.gz +0 -0
  267. package/dist/collection/components/snk-form-config/config-header/config-header.css.gz +0 -0
  268. package/dist/collection/components/snk-form-config/config-header/config-header.js.gz +0 -0
  269. package/dist/collection/components/snk-form-config/config-header/configs-button/configs-button.css.gz +0 -0
  270. package/dist/collection/components/snk-form-config/config-header/configs-button/configs-button.js.gz +0 -0
  271. package/dist/collection/components/snk-form-config/field-item/field-config/field-config.css.gz +0 -0
  272. package/dist/collection/components/snk-form-config/field-item/field-config/field-config.js.gz +0 -0
  273. package/dist/collection/components/snk-form-config/field-item/field-item.css.gz +0 -0
  274. package/dist/collection/components/snk-form-config/field-item/field-item.js.gz +0 -0
  275. package/dist/collection/components/snk-form-config/fields-layout/fields-layout.css.gz +0 -0
  276. package/dist/collection/components/snk-form-config/fields-layout/fields-layout.js.gz +0 -0
  277. package/dist/collection/components/snk-form-config/fields-selector/fields-selector.css.gz +0 -0
  278. package/dist/collection/components/snk-form-config/fields-selector/fields-selector.js.gz +0 -0
  279. package/dist/collection/components/snk-form-config/guides-configurator/guides-configurator.css.gz +0 -0
  280. package/dist/collection/components/snk-form-config/guides-configurator/guides-configurator.js.gz +0 -0
  281. package/dist/collection/components/snk-form-config/snk-form-config.css.gz +0 -0
  282. package/dist/collection/components/snk-form-config/snk-form-config.js.gz +0 -0
  283. package/dist/collection/components/snk-grid/filtercolumn/SnkMultiSelectionListDataSource.js.gz +0 -0
  284. package/dist/collection/components/snk-grid/snk-grid.css.gz +0 -0
  285. package/dist/collection/components/snk-grid/snk-grid.js +91 -16
  286. package/dist/collection/components/snk-grid/snk-grid.js.gz +0 -0
  287. package/dist/collection/components/snk-grid-config/snk-grid-config.css.gz +0 -0
  288. package/dist/collection/components/snk-grid-config/snk-grid-config.js.gz +0 -0
  289. package/dist/collection/components/snk-grid-config/snk-select-box/snk-select-box.css.gz +0 -0
  290. package/dist/collection/components/snk-grid-config/snk-select-box/snk-select-box.js.gz +0 -0
  291. package/dist/collection/components/snk-layout-form-config/snk-layout-form-config.css.gz +0 -0
  292. package/dist/collection/components/snk-layout-form-config/snk-layout-form-config.js.gz +0 -0
  293. package/dist/collection/components/snk-layout-form-config/snk-view-representation/snk-view-representation.css.gz +0 -0
  294. package/dist/collection/components/snk-layout-form-config/snk-view-representation/snk-view-representation.js.gz +0 -0
  295. package/dist/collection/components/snk-personalized-filter/interfaces/IExpressionGroup.js.gz +0 -0
  296. package/dist/collection/components/snk-personalized-filter/interfaces/IExpressionItem.js.gz +0 -0
  297. package/dist/collection/components/snk-personalized-filter/interfaces/IParameter.js.gz +0 -0
  298. package/dist/collection/components/snk-personalized-filter/interfaces/IPersonalizedFilter.js.gz +0 -0
  299. package/dist/collection/components/snk-personalized-filter/interfaces/ISystemFilterConfig.js.gz +0 -0
  300. package/dist/collection/components/snk-personalized-filter/interfaces/IUserFilterConfig.js.gz +0 -0
  301. package/dist/collection/components/snk-personalized-filter/interfaces/index.js.gz +0 -0
  302. package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.css.gz +0 -0
  303. package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js.gz +0 -0
  304. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-group/snk-expression-group.css.gz +0 -0
  305. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-group/snk-expression-group.js.gz +0 -0
  306. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/filter-operands/filter-operands.js.gz +0 -0
  307. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.css.gz +0 -0
  308. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.js.gz +0 -0
  309. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-advanced-mode/snk-filter-advanced-mode.css.gz +0 -0
  310. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-advanced-mode/snk-filter-advanced-mode.js.gz +0 -0
  311. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-assistent-mode/snk-filter-assistent-mode.css.gz +0 -0
  312. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-assistent-mode/snk-filter-assistent-mode.js.gz +0 -0
  313. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/snk-filter-param-config.css.gz +0 -0
  314. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/snk-filter-param-config.js.gz +0 -0
  315. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/utils/PersonalizedFilterUtils.js.gz +0 -0
  316. package/dist/collection/components/snk-pesquisa/pesquisa-grid/pesquisa-grid.css.gz +0 -0
  317. package/dist/collection/components/snk-pesquisa/pesquisa-grid/pesquisa-grid.js.gz +0 -0
  318. package/dist/collection/components/snk-pesquisa/pesquisa-tree/pesquisa-tree.css.gz +0 -0
  319. package/dist/collection/components/snk-pesquisa/pesquisa-tree/pesquisa-tree.js.gz +0 -0
  320. package/dist/collection/components/snk-pesquisa/pesquisaHelper.js.gz +0 -0
  321. package/dist/collection/components/snk-pesquisa/snk-pesquisa.css.gz +0 -0
  322. package/dist/collection/components/snk-pesquisa/snk-pesquisa.js.gz +0 -0
  323. package/dist/collection/components/snk-print-selector/snk-print-selector.css.gz +0 -0
  324. package/dist/collection/components/snk-print-selector/snk-print-selector.js.gz +0 -0
  325. package/dist/collection/components/snk-simple-bar/snk-simple-bar.css.gz +0 -0
  326. package/dist/collection/components/snk-simple-bar/snk-simple-bar.js.gz +0 -0
  327. package/dist/collection/components/snk-simple-crud/snk-simple-crud.constants.js.gz +0 -0
  328. package/dist/collection/components/snk-simple-crud/snk-simple-crud.css.gz +0 -0
  329. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js.gz +0 -0
  330. package/dist/collection/components/snk-simple-form-config/snk-simple-form-config.css.gz +0 -0
  331. package/dist/collection/components/snk-simple-form-config/snk-simple-form-config.js.gz +0 -0
  332. package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.css.gz +0 -0
  333. package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.js.gz +0 -0
  334. package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js.gz +0 -0
  335. package/dist/collection/components/snk-taskbar/elements/taskbar-split-button/taskbar-split-button.css.gz +0 -0
  336. package/dist/collection/components/snk-taskbar/elements/taskbar-split-button/taskbar-split-button.js.gz +0 -0
  337. package/dist/collection/components/snk-taskbar/processor/taskbar-processor.js.gz +0 -0
  338. package/dist/collection/components/snk-taskbar/snk-taskbar.css.gz +0 -0
  339. package/dist/collection/components/snk-taskbar/snk-taskbar.js.gz +0 -0
  340. package/dist/collection/components/teste-pesquisa/teste-pesquisa.css.gz +0 -0
  341. package/dist/collection/components/teste-pesquisa/teste-pesquisa.js.gz +0 -0
  342. package/dist/collection/index.js.gz +0 -0
  343. package/dist/collection/lib/@types/index.js.gz +0 -0
  344. package/dist/collection/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.js.gz +0 -0
  345. package/dist/collection/lib/applet-caller/applet-caller.js.gz +0 -0
  346. package/dist/collection/lib/auth/mgeauthorization.module.js.gz +0 -0
  347. package/dist/collection/lib/configs/ConfigStorage.js.gz +0 -0
  348. package/dist/collection/lib/configs/LayoutFormConfig.js.gz +0 -0
  349. package/dist/collection/lib/dataUnit/InMemoryLoader.js.gz +0 -0
  350. package/dist/collection/lib/dataUnit/ValueFormatter.js.gz +0 -0
  351. package/dist/collection/lib/dataUnit/dataUnitInMemoryUtils.js.gz +0 -0
  352. package/dist/collection/lib/dataUnit/interfaces/InMemoryLoaderConfig.js.gz +0 -0
  353. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +1 -0
  354. package/dist/collection/lib/http/data-fetcher/DataFetcher.js.gz +0 -0
  355. package/dist/collection/lib/http/data-fetcher/custom-xhr-override.js +39 -0
  356. package/dist/collection/lib/http/data-fetcher/custom-xhr-override.js.gz +0 -0
  357. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/anexo-sistema-fetcher.js.gz +0 -0
  358. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/attach-fetcher.js.gz +0 -0
  359. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/facade/attach-fetcher.facade.js.gz +0 -0
  360. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/index.js.gz +0 -0
  361. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/IDelete.js.gz +0 -0
  362. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/IDownloadKey.js.gz +0 -0
  363. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/ISave.js.gz +0 -0
  364. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/index.js.gz +0 -0
  365. package/dist/collection/lib/http/data-fetcher/fetchers/application-config-fetcher.js.gz +0 -0
  366. package/dist/collection/lib/http/data-fetcher/fetchers/auth-fetcher.js.gz +0 -0
  367. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.js.gz +0 -0
  368. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.js.gz +0 -0
  369. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.js.gz +0 -0
  370. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.js.gz +0 -0
  371. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/helpers/DataUnitDataLoaderHelper.js.gz +0 -0
  372. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IBuildRequestBodyLoadRowMetadata.js.gz +0 -0
  373. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadDataResult.js.gz +0 -0
  374. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadDataStrategy.js.gz +0 -0
  375. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadingInfo.js.gz +0 -0
  376. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRecordField.js.gz +0 -0
  377. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IResponseRecord.js.gz +0 -0
  378. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRowMetadata.js.gz +0 -0
  379. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DataUnitStrategy.js.gz +0 -0
  380. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js.gz +0 -0
  381. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/test/resources/metadataMock.js.gz +0 -0
  382. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IExporterColumnMetadata.js.gz +0 -0
  383. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams.js.gz +0 -0
  384. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterResponse.js.gz +0 -0
  385. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IPersonalizedReport.js.gz +0 -0
  386. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/permission-export-pdf.js.gz +0 -0
  387. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/personalized-reports-fetcher.js.gz +0 -0
  388. package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js.gz +0 -0
  389. package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js.gz +0 -0
  390. package/dist/collection/lib/http/data-fetcher/fetchers/grid-config-fetcher.js.gz +0 -0
  391. package/dist/collection/lib/http/data-fetcher/fetchers/parameters-fecher.js.gz +0 -0
  392. package/dist/collection/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.js.gz +0 -0
  393. package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js.gz +0 -0
  394. package/dist/collection/lib/http/data-fetcher/fetchers/resource-fetcher.js.gz +0 -0
  395. package/dist/collection/lib/http/data-fetcher/fetchers/totals-fetcher.js.gz +0 -0
  396. package/dist/collection/lib/http/data-fetcher/interfaces/IClientEventResponse.js.gz +0 -0
  397. package/dist/collection/lib/http/data-fetcher/recaller/GraphQLRecaller.js.gz +0 -0
  398. package/dist/collection/lib/http/data-fetcher/recaller/IDataFetcherRecaller.js.gz +0 -0
  399. package/dist/collection/lib/http/data-fetcher/recaller/ServiceBrokerRecaller.js.gz +0 -0
  400. package/dist/collection/lib/http/data-fetcher/state/LoadStateManager.js.gz +0 -0
  401. package/dist/collection/lib/index.js.gz +0 -0
  402. package/dist/collection/lib/message/SnkMessageBuilder.js.gz +0 -0
  403. package/dist/collection/lib/message/messageResourceEnUSUtils.js.gz +0 -0
  404. package/dist/collection/lib/message/messageResourceEsESUtils.js.gz +0 -0
  405. package/dist/collection/lib/message/messageResourcePtBRUtils.js.gz +0 -0
  406. package/dist/collection/lib/message/resources/en-us/continuousInsertUtils.msg.js.gz +0 -0
  407. package/dist/collection/lib/message/resources/en-us/crud-utils.msg.js.gz +0 -0
  408. package/dist/collection/lib/message/resources/en-us/dataFetcher.msg.js.gz +0 -0
  409. package/dist/collection/lib/message/resources/en-us/dataUnitDataLoaderHelper.msg.js.gz +0 -0
  410. package/dist/collection/lib/message/resources/en-us/file-viewer.msg.js.gz +0 -0
  411. package/dist/collection/lib/message/resources/en-us/snk-actions-button.msg.js.gz +0 -0
  412. package/dist/collection/lib/message/resources/en-us/snk-application.msg.js.gz +0 -0
  413. package/dist/collection/lib/message/resources/en-us/snk-attach.msg.js.gz +0 -0
  414. package/dist/collection/lib/message/resources/en-us/snk-configurator.msg.js.gz +0 -0
  415. package/dist/collection/lib/message/resources/en-us/snk-crud.msg.js.gz +0 -0
  416. package/dist/collection/lib/message/resources/en-us/snk-data-exporter.msg.js.gz +0 -0
  417. package/dist/collection/lib/message/resources/en-us/snk-data-unit.msg.js.gz +0 -0
  418. package/dist/collection/lib/message/resources/en-us/snk-entity-list.msg.js.gz +0 -0
  419. package/dist/collection/lib/message/resources/en-us/snk-error-handler.msg.js.gz +0 -0
  420. package/dist/collection/lib/message/resources/en-us/snk-exporter.msg.js.gz +0 -0
  421. package/dist/collection/lib/message/resources/en-us/snk-filter-bar.msg.js +1 -0
  422. package/dist/collection/lib/message/resources/en-us/snk-filter-bar.msg.js.gz +0 -0
  423. package/dist/collection/lib/message/resources/en-us/snk-filter-field-search.msg.js.gz +0 -0
  424. package/dist/collection/lib/message/resources/en-us/snk-filter-list.msg.js.gz +0 -0
  425. package/dist/collection/lib/message/resources/en-us/snk-filter-param-config.msg.js.gz +0 -0
  426. package/dist/collection/lib/message/resources/en-us/snk-form.msg.js.gz +0 -0
  427. package/dist/collection/lib/message/resources/en-us/snk-grid.msg.js +4 -0
  428. package/dist/collection/lib/message/resources/en-us/snk-grid.msg.js.gz +0 -0
  429. package/dist/collection/lib/message/resources/en-us/snk-layout-form-config.msg.js.gz +0 -0
  430. package/dist/collection/lib/message/resources/en-us/snk-personalized-filter.msg.js.gz +0 -0
  431. package/dist/collection/lib/message/resources/en-us/snk-pesquisa.msg.js.gz +0 -0
  432. package/dist/collection/lib/message/resources/en-us/snk-print-selector.msg.js.gz +0 -0
  433. package/dist/collection/lib/message/resources/en-us/snk-simple-bar.msg.js.gz +0 -0
  434. package/dist/collection/lib/message/resources/en-us/snk-simple-crud.msg.js.gz +0 -0
  435. package/dist/collection/lib/message/resources/en-us/snk-simple-form-config.msg.js.gz +0 -0
  436. package/dist/collection/lib/message/resources/en-us/snk-taskbar.msg.js.gz +0 -0
  437. package/dist/collection/lib/message/resources/es-es/continuousInsertUtils.msg.js.gz +0 -0
  438. package/dist/collection/lib/message/resources/es-es/crud-utils.msg.js.gz +0 -0
  439. package/dist/collection/lib/message/resources/es-es/dataFetcher.msg.js.gz +0 -0
  440. package/dist/collection/lib/message/resources/es-es/dataUnitDataLoaderHelper.msg.js.gz +0 -0
  441. package/dist/collection/lib/message/resources/es-es/file-viewer.msg.js.gz +0 -0
  442. package/dist/collection/lib/message/resources/es-es/snk-actions-button.msg.js.gz +0 -0
  443. package/dist/collection/lib/message/resources/es-es/snk-application.msg.js.gz +0 -0
  444. package/dist/collection/lib/message/resources/es-es/snk-attach.msg.js.gz +0 -0
  445. package/dist/collection/lib/message/resources/es-es/snk-configurator.msg.js.gz +0 -0
  446. package/dist/collection/lib/message/resources/es-es/snk-crud.msg.js.gz +0 -0
  447. package/dist/collection/lib/message/resources/es-es/snk-data-exporter.msg.js.gz +0 -0
  448. package/dist/collection/lib/message/resources/es-es/snk-data-unit.msg.js.gz +0 -0
  449. package/dist/collection/lib/message/resources/es-es/snk-entity-list.msg.js.gz +0 -0
  450. package/dist/collection/lib/message/resources/es-es/snk-error-handler.msg.js.gz +0 -0
  451. package/dist/collection/lib/message/resources/es-es/snk-exporter.msg.js.gz +0 -0
  452. package/dist/collection/lib/message/resources/es-es/snk-filter-bar.msg.js +1 -0
  453. package/dist/collection/lib/message/resources/es-es/snk-filter-bar.msg.js.gz +0 -0
  454. package/dist/collection/lib/message/resources/es-es/snk-filter-field-search.msg.js.gz +0 -0
  455. package/dist/collection/lib/message/resources/es-es/snk-filter-list.msg.js.gz +0 -0
  456. package/dist/collection/lib/message/resources/es-es/snk-filter-param-config.msg.js.gz +0 -0
  457. package/dist/collection/lib/message/resources/es-es/snk-form.msg.js.gz +0 -0
  458. package/dist/collection/lib/message/resources/es-es/snk-grid.msg.js +4 -0
  459. package/dist/collection/lib/message/resources/es-es/snk-grid.msg.js.gz +0 -0
  460. package/dist/collection/lib/message/resources/es-es/snk-layout-form-config.msg.js.gz +0 -0
  461. package/dist/collection/lib/message/resources/es-es/snk-personalized-filter.msg.js.gz +0 -0
  462. package/dist/collection/lib/message/resources/es-es/snk-pesquisa.msg.js.gz +0 -0
  463. package/dist/collection/lib/message/resources/es-es/snk-print-selector.msg.js.gz +0 -0
  464. package/dist/collection/lib/message/resources/es-es/snk-simple-bar.msg.js.gz +0 -0
  465. package/dist/collection/lib/message/resources/es-es/snk-simple-crud.msg.js.gz +0 -0
  466. package/dist/collection/lib/message/resources/es-es/snk-simple-form-config.msg.js.gz +0 -0
  467. package/dist/collection/lib/message/resources/es-es/snk-taskbar.msg.js.gz +0 -0
  468. package/dist/collection/lib/message/resources/pt-br/continuousInsertUtils.msg.js.gz +0 -0
  469. package/dist/collection/lib/message/resources/pt-br/crud-utils.msg.js.gz +0 -0
  470. package/dist/collection/lib/message/resources/pt-br/dataFetcher.msg.js.gz +0 -0
  471. package/dist/collection/lib/message/resources/pt-br/dataUnitDataLoaderHelper.msg.js.gz +0 -0
  472. package/dist/collection/lib/message/resources/pt-br/file-viewer.msg.js.gz +0 -0
  473. package/dist/collection/lib/message/resources/pt-br/snk-actions-button.msg.js.gz +0 -0
  474. package/dist/collection/lib/message/resources/pt-br/snk-application.msg.js.gz +0 -0
  475. package/dist/collection/lib/message/resources/pt-br/snk-attach.msg.js.gz +0 -0
  476. package/dist/collection/lib/message/resources/pt-br/snk-configurator.msg.js.gz +0 -0
  477. package/dist/collection/lib/message/resources/pt-br/snk-crud.msg.js.gz +0 -0
  478. package/dist/collection/lib/message/resources/pt-br/snk-data-exporter.msg.js.gz +0 -0
  479. package/dist/collection/lib/message/resources/pt-br/snk-data-unit.msg.js.gz +0 -0
  480. package/dist/collection/lib/message/resources/pt-br/snk-entity-list.msg.js.gz +0 -0
  481. package/dist/collection/lib/message/resources/pt-br/snk-error-handler.msg.js.gz +0 -0
  482. package/dist/collection/lib/message/resources/pt-br/snk-exporter.msg.js.gz +0 -0
  483. package/dist/collection/lib/message/resources/pt-br/snk-filter-bar.msg.js +1 -0
  484. package/dist/collection/lib/message/resources/pt-br/snk-filter-bar.msg.js.gz +0 -0
  485. package/dist/collection/lib/message/resources/pt-br/snk-filter-field-search.msg.js.gz +0 -0
  486. package/dist/collection/lib/message/resources/pt-br/snk-filter-list.msg.js.gz +0 -0
  487. package/dist/collection/lib/message/resources/pt-br/snk-filter-param-config.msg.js.gz +0 -0
  488. package/dist/collection/lib/message/resources/pt-br/snk-form.msg.js.gz +0 -0
  489. package/dist/collection/lib/message/resources/pt-br/snk-grid.msg.js +4 -0
  490. package/dist/collection/lib/message/resources/pt-br/snk-grid.msg.js.gz +0 -0
  491. package/dist/collection/lib/message/resources/pt-br/snk-layout-form-config.msg.js.gz +0 -0
  492. package/dist/collection/lib/message/resources/pt-br/snk-personalized-filter.msg.js.gz +0 -0
  493. package/dist/collection/lib/message/resources/pt-br/snk-pesquisa.msg.js.gz +0 -0
  494. package/dist/collection/lib/message/resources/pt-br/snk-print-selector.msg.js.gz +0 -0
  495. package/dist/collection/lib/message/resources/pt-br/snk-simple-bar.msg.js.gz +0 -0
  496. package/dist/collection/lib/message/resources/pt-br/snk-simple-crud.msg.js.gz +0 -0
  497. package/dist/collection/lib/message/resources/pt-br/snk-simple-form-config.msg.js.gz +0 -0
  498. package/dist/collection/lib/message/resources/pt-br/snk-taskbar.msg.js.gz +0 -0
  499. package/dist/collection/lib/resourceid/ResourceIDUtils.js.gz +0 -0
  500. package/dist/collection/lib/store/index.js.gz +0 -0
  501. package/dist/collection/lib/utils/ContinuousInsertUtils.js.gz +0 -0
  502. package/dist/collection/lib/utils/CrudUtils.js.gz +0 -0
  503. package/dist/collection/lib/utils/GetSelectedRecordsIDsInfo.js.gz +0 -0
  504. package/dist/collection/lib/utils/PrintUtils.js.gz +0 -0
  505. package/dist/collection/lib/utils/constants.js.gz +0 -0
  506. package/dist/collection/lib/utils/fileViewer/index.js.gz +0 -0
  507. package/dist/collection/lib/utils/fileViewer/interfaces/IFileViewerParams.js.gz +0 -0
  508. package/dist/collection/lib/utils/pesquisa.js.gz +0 -0
  509. package/dist/collection/lib/utils/urlutils.js.gz +0 -0
  510. package/dist/collection/lib/workspace/workspace.js.gz +0 -0
  511. package/dist/collection/sw.js.gz +0 -0
  512. package/dist/components/AuthorizationConfig.js.gz +0 -0
  513. package/dist/components/ConfigStorage.js.gz +0 -0
  514. package/dist/components/ContinuousInsertUtils.js.gz +0 -0
  515. package/dist/components/DataFetcher.js +51 -0
  516. package/dist/components/DataFetcher.js.gz +0 -0
  517. package/dist/components/GetSelectedRecordsIDsInfo.js.gz +0 -0
  518. package/dist/components/ISave.js.gz +0 -0
  519. package/dist/components/ParamType.js.gz +0 -0
  520. package/dist/components/PersonalizedFilterUtils.js.gz +0 -0
  521. package/dist/components/PrintUtils.js.gz +0 -0
  522. package/dist/components/ResourceIDUtils.js.gz +0 -0
  523. package/dist/components/SnkFormConfigManager.js.gz +0 -0
  524. package/dist/components/auth-fetcher.js.gz +0 -0
  525. package/dist/components/config-header.js.gz +0 -0
  526. package/dist/components/config-header2.js.gz +0 -0
  527. package/dist/components/configs-button.js.gz +0 -0
  528. package/dist/components/configs-button2.js.gz +0 -0
  529. package/dist/components/constants.js.gz +0 -0
  530. package/dist/components/dataunit-fetcher.js.gz +0 -0
  531. package/dist/components/field-config.js.gz +0 -0
  532. package/dist/components/field-config2.js.gz +0 -0
  533. package/dist/components/field-item.js.gz +0 -0
  534. package/dist/components/field-item2.js.gz +0 -0
  535. package/dist/components/fields-layout.js.gz +0 -0
  536. package/dist/components/fields-layout2.js.gz +0 -0
  537. package/dist/components/fields-selector.js.gz +0 -0
  538. package/dist/components/fields-selector2.js.gz +0 -0
  539. package/dist/components/filter-item-type.enum.js.gz +0 -0
  540. package/dist/components/filterNumberVariation.js.gz +0 -0
  541. package/dist/components/form-config-fetcher.js.gz +0 -0
  542. package/dist/components/guides-configurator.js.gz +0 -0
  543. package/dist/components/guides-configurator2.js.gz +0 -0
  544. package/dist/components/index.js.gz +0 -0
  545. package/dist/components/index2.js.gz +0 -0
  546. package/dist/components/pesquisa-grid.js.gz +0 -0
  547. package/dist/components/pesquisa-grid2.js.gz +0 -0
  548. package/dist/components/pesquisa-tree.js.gz +0 -0
  549. package/dist/components/pesquisa-tree2.js.gz +0 -0
  550. package/dist/components/presentationMode.js.gz +0 -0
  551. package/dist/components/snk-actions-button.js.gz +0 -0
  552. package/dist/components/snk-actions-button2.js.gz +0 -0
  553. package/dist/components/snk-actions-form.js.gz +0 -0
  554. package/dist/components/snk-application.js.gz +0 -0
  555. package/dist/components/snk-application2.js.gz +0 -0
  556. package/dist/components/snk-attach.js.gz +0 -0
  557. package/dist/components/snk-attach2.js.gz +0 -0
  558. package/dist/components/snk-client-confirm.js.gz +0 -0
  559. package/dist/components/snk-configurator.js.gz +0 -0
  560. package/dist/components/snk-configurator2.js.gz +0 -0
  561. package/dist/components/snk-crud.js +62 -44
  562. package/dist/components/snk-crud.js.gz +0 -0
  563. package/dist/components/snk-custom-slot-elements.js.gz +0 -0
  564. package/dist/components/snk-data-exporter.js.gz +0 -0
  565. package/dist/components/snk-data-exporter2.js.gz +0 -0
  566. package/dist/components/snk-data-unit.js.gz +0 -0
  567. package/dist/components/snk-data-unit2.js.gz +0 -0
  568. package/dist/components/snk-default-filter.js.gz +0 -0
  569. package/dist/components/snk-default-filter2.js.gz +0 -0
  570. package/dist/components/snk-detail-view.js.gz +0 -0
  571. package/dist/components/snk-detail-view2.js +89 -56
  572. package/dist/components/snk-detail-view2.js.gz +0 -0
  573. package/dist/components/snk-entity-list.js +6 -2
  574. package/dist/components/snk-entity-list.js.gz +0 -0
  575. package/dist/components/snk-exporter-email-sender.js.gz +0 -0
  576. package/dist/components/snk-exporter-email-sender2.js.gz +0 -0
  577. package/dist/components/snk-expression-group.js.gz +0 -0
  578. package/dist/components/snk-expression-group2.js.gz +0 -0
  579. package/dist/components/snk-expression-item.js.gz +0 -0
  580. package/dist/components/snk-expression-item2.js.gz +0 -0
  581. package/dist/components/snk-filter-advanced-mode.js.gz +0 -0
  582. package/dist/components/snk-filter-advanced-mode2.js.gz +0 -0
  583. package/dist/components/snk-filter-assistent-mode.js.gz +0 -0
  584. package/dist/components/snk-filter-assistent-mode2.js.gz +0 -0
  585. package/dist/components/snk-filter-bar.js.gz +0 -0
  586. package/dist/components/snk-filter-bar2.js +77 -93
  587. package/dist/components/snk-filter-bar2.js.gz +0 -0
  588. package/dist/components/snk-filter-binary-select.js +27 -3
  589. package/dist/components/snk-filter-binary-select.js.gz +0 -0
  590. package/dist/components/snk-filter-checkbox-list.js +24 -3
  591. package/dist/components/snk-filter-checkbox-list.js.gz +0 -0
  592. package/dist/components/snk-filter-detail.js.gz +0 -0
  593. package/dist/components/snk-filter-detail2.js +28 -9
  594. package/dist/components/snk-filter-detail2.js.gz +0 -0
  595. package/dist/components/snk-filter-field-search.js.gz +0 -0
  596. package/dist/components/snk-filter-field-search2.js.gz +0 -0
  597. package/dist/components/snk-filter-item.js.gz +0 -0
  598. package/dist/components/snk-filter-item2.js +70 -8
  599. package/dist/components/snk-filter-item2.js.gz +0 -0
  600. package/dist/components/snk-filter-list.js.gz +0 -0
  601. package/dist/components/snk-filter-modal-item.js.gz +0 -0
  602. package/dist/components/snk-filter-modal-item2.js +7 -12
  603. package/dist/components/snk-filter-modal-item2.js.gz +0 -0
  604. package/dist/components/snk-filter-modal.js +1 -325
  605. package/dist/components/snk-filter-modal.js.gz +0 -0
  606. package/dist/components/snk-filter-modal2.js +391 -0
  607. package/dist/components/snk-filter-modal2.js.gz +0 -0
  608. package/dist/components/snk-filter-multi-select.js +19 -4
  609. package/dist/components/snk-filter-multi-select.js.gz +0 -0
  610. package/dist/components/snk-filter-number.js +38 -4
  611. package/dist/components/snk-filter-number.js.gz +0 -0
  612. package/dist/components/snk-filter-param-config.js.gz +0 -0
  613. package/dist/components/snk-filter-param-config2.js.gz +0 -0
  614. package/dist/components/snk-filter-period.js +64 -16
  615. package/dist/components/snk-filter-period.js.gz +0 -0
  616. package/dist/components/snk-filter-search.js +17 -4
  617. package/dist/components/snk-filter-search.js.gz +0 -0
  618. package/dist/components/snk-filter-text.js +22 -2
  619. package/dist/components/snk-filter-text.js.gz +0 -0
  620. package/dist/components/snk-form-config.js.gz +0 -0
  621. package/dist/components/snk-form-config2.js.gz +0 -0
  622. package/dist/components/snk-form-summary.js.gz +0 -0
  623. package/dist/components/snk-form-summary2.js.gz +0 -0
  624. package/dist/components/snk-form-view.js.gz +0 -0
  625. package/dist/components/snk-form-view2.js.gz +0 -0
  626. package/dist/components/snk-form.js.gz +0 -0
  627. package/dist/components/snk-grid-config.js.gz +0 -0
  628. package/dist/components/snk-grid-config2.js.gz +0 -0
  629. package/dist/components/snk-grid.js.gz +0 -0
  630. package/dist/components/snk-grid2.js +65 -29
  631. package/dist/components/snk-grid2.js.gz +0 -0
  632. package/dist/components/snk-guides-viewer.js.gz +0 -0
  633. package/dist/components/snk-layout-form-config.js.gz +0 -0
  634. package/dist/components/snk-layout-form-config2.js.gz +0 -0
  635. package/dist/components/snk-personalized-filter-editor.js.gz +0 -0
  636. package/dist/components/snk-personalized-filter.js.gz +0 -0
  637. package/dist/components/snk-personalized-filter2.js.gz +0 -0
  638. package/dist/components/snk-pesquisa.js.gz +0 -0
  639. package/dist/components/snk-pesquisa2.js.gz +0 -0
  640. package/dist/components/snk-print-selector.js.gz +0 -0
  641. package/dist/components/snk-select-box.js.gz +0 -0
  642. package/dist/components/snk-select-box2.js.gz +0 -0
  643. package/dist/components/snk-simple-bar.js.gz +0 -0
  644. package/dist/components/snk-simple-bar2.js.gz +0 -0
  645. package/dist/components/snk-simple-crud.js.gz +0 -0
  646. package/dist/components/snk-simple-crud2.js.gz +0 -0
  647. package/dist/components/snk-simple-form-config.js.gz +0 -0
  648. package/dist/components/snk-simple-form-config2.js.gz +0 -0
  649. package/dist/components/snk-taskbar.js.gz +0 -0
  650. package/dist/components/snk-taskbar2.js.gz +0 -0
  651. package/dist/components/snk-view-representation.js.gz +0 -0
  652. package/dist/components/snk-view-representation2.js.gz +0 -0
  653. package/dist/components/sortable.esm.js.gz +0 -0
  654. package/dist/components/taskbar-actions-button.js.gz +0 -0
  655. package/dist/components/taskbar-actions-button2.js.gz +0 -0
  656. package/dist/components/taskbar-split-button.js.gz +0 -0
  657. package/dist/components/taskbar-split-button2.js.gz +0 -0
  658. package/dist/components/teste-pesquisa.js.gz +0 -0
  659. package/dist/esm/AuthorizationConfig-dcbd207a.js.gz +0 -0
  660. package/dist/esm/{ConfigStorage-fc4e3a42.js → ConfigStorage-22eace3a.js} +2 -2
  661. package/dist/esm/ConfigStorage-22eace3a.js.gz +0 -0
  662. package/dist/esm/{DataFetcher-01ce1a4f.js → DataFetcher-f6b2961a.js} +51 -0
  663. package/dist/esm/DataFetcher-f6b2961a.js.gz +0 -0
  664. package/dist/esm/FormConfigHelper-4e42f0b6.js.gz +0 -0
  665. package/dist/esm/GetSelectedRecordsIDsInfo-9fa41508.js.gz +0 -0
  666. package/dist/esm/IFetchDataExporterParams-d73bed3d.js.gz +0 -0
  667. package/dist/esm/{ISave-d36bade4.js → ISave-6b7b0423.js} +1 -1
  668. package/dist/esm/ISave-6b7b0423.js.gz +0 -0
  669. package/dist/esm/ParamType-d5152b06.js.gz +0 -0
  670. package/dist/esm/PersonalizedFilterUtils-2db38ff2.js.gz +0 -0
  671. package/dist/esm/PrintUtils-3e4ff0f5.js.gz +0 -0
  672. package/dist/esm/ResourceIDUtils-a114189a.js.gz +0 -0
  673. package/dist/esm/{SnkFormConfigManager-71dae34e.js → SnkFormConfigManager-968b97e7.js} +2 -2
  674. package/dist/esm/SnkFormConfigManager-968b97e7.js.gz +0 -0
  675. package/dist/esm/{ClientSideExporterProvider-21a99af1.js → SnkMultiSelectionListDataSource-1136c4e7.js} +83 -83
  676. package/dist/esm/SnkMultiSelectionListDataSource-1136c4e7.js.gz +0 -0
  677. package/dist/esm/{auth-fetcher-2e565c35.js → auth-fetcher-cf39e42b.js} +1 -1
  678. package/dist/esm/auth-fetcher-cf39e42b.js.gz +0 -0
  679. package/dist/esm/config-header.entry.js.gz +0 -0
  680. package/dist/esm/configs-button.entry.js.gz +0 -0
  681. package/dist/esm/constants-7b422de0.js.gz +0 -0
  682. package/dist/esm/{dataunit-fetcher-14ba162b.js → dataunit-fetcher-6314b19d.js} +1 -1
  683. package/dist/esm/dataunit-fetcher-6314b19d.js.gz +0 -0
  684. package/dist/esm/default-filters-50105e43.js.gz +0 -0
  685. package/dist/esm/field-config_2.entry.js.gz +0 -0
  686. package/dist/esm/fields-layout.entry.js.gz +0 -0
  687. package/dist/esm/fields-selector.entry.js.gz +0 -0
  688. package/dist/esm/filter-item-type.enum-d45e026f.js.gz +0 -0
  689. package/dist/esm/filter-type.enum-f6a8fe23.js.gz +0 -0
  690. package/dist/esm/filter-validate-d765d450.js +27 -0
  691. package/dist/esm/filter-validate-d765d450.js.gz +0 -0
  692. package/dist/esm/filterNumberVariation-8cee02ea.js.gz +0 -0
  693. package/dist/esm/{form-config-fetcher-a1ccc944.js → form-config-fetcher-bc6f0f1f.js} +1 -1
  694. package/dist/esm/form-config-fetcher-bc6f0f1f.js.gz +0 -0
  695. package/dist/esm/guides-configurator.entry.js.gz +0 -0
  696. package/dist/esm/index-446f9341.js.gz +0 -0
  697. package/dist/esm/index-479e1293.js +8 -8
  698. package/dist/esm/index-479e1293.js.gz +0 -0
  699. package/dist/esm/index-620ac460.js.gz +0 -0
  700. package/dist/esm/index-8acbae97.js.gz +0 -0
  701. package/dist/esm/index-b40568ff.js.gz +0 -0
  702. package/dist/esm/index.js.gz +0 -0
  703. package/dist/esm/loader.js +1 -1
  704. package/dist/esm/loader.js.gz +0 -0
  705. package/dist/esm/pesquisa-grid_2.entry.js +4 -4
  706. package/dist/esm/pesquisa-grid_2.entry.js.gz +0 -0
  707. package/dist/esm/polyfills/core-js.js.gz +0 -0
  708. package/dist/esm/polyfills/css-shim.js.gz +0 -0
  709. package/dist/esm/polyfills/dom.js.gz +0 -0
  710. package/dist/esm/polyfills/es5-html-element.js.gz +0 -0
  711. package/dist/esm/polyfills/index.js.gz +0 -0
  712. package/dist/esm/polyfills/system.js.gz +0 -0
  713. package/dist/esm/presentationMode-783bbf9d.js.gz +0 -0
  714. package/dist/esm/sankhyablocks.js +1 -1
  715. package/dist/esm/sankhyablocks.js.gz +0 -0
  716. package/dist/esm/snk-actions-button_8.entry.js +5 -5
  717. package/dist/esm/snk-actions-button_8.entry.js.gz +0 -0
  718. package/dist/esm/snk-actions-form.entry.js.gz +0 -0
  719. package/dist/esm/snk-application.entry.js +6 -6
  720. package/dist/esm/snk-application.entry.js.gz +0 -0
  721. package/dist/esm/snk-attach.entry.js +5 -5
  722. package/dist/esm/snk-attach.entry.js.gz +0 -0
  723. package/dist/esm/snk-client-confirm.entry.js.gz +0 -0
  724. package/dist/esm/snk-configurator.entry.js.gz +0 -0
  725. package/dist/esm/snk-crud.entry.js +5 -5
  726. package/dist/esm/snk-crud.entry.js.gz +0 -0
  727. package/dist/esm/snk-custom-slot-elements.entry.js.gz +0 -0
  728. package/dist/esm/snk-data-exporter.entry.js +5 -5
  729. package/dist/esm/snk-data-exporter.entry.js.gz +0 -0
  730. package/dist/esm/{snk-data-unit-b5e1c491.js → snk-data-unit-4acf4781.js} +2 -2
  731. package/dist/esm/snk-data-unit-4acf4781.js.gz +0 -0
  732. package/dist/esm/snk-data-unit.entry.js +3 -3
  733. package/dist/esm/snk-data-unit.entry.js.gz +0 -0
  734. package/dist/esm/snk-default-filter.entry.js.gz +0 -0
  735. package/dist/esm/snk-detail-view.entry.js +7 -7
  736. package/dist/esm/snk-detail-view.entry.js.gz +0 -0
  737. package/dist/esm/snk-entity-list.entry.js +5 -2
  738. package/dist/esm/snk-entity-list.entry.js.gz +0 -0
  739. package/dist/esm/snk-exporter-email-sender.entry.js.gz +0 -0
  740. package/dist/esm/snk-expression-group_2.entry.js.gz +0 -0
  741. package/dist/esm/snk-filter-advanced-mode_2.entry.js.gz +0 -0
  742. package/dist/esm/snk-filter-bar_4.entry.js +165 -101
  743. package/dist/esm/snk-filter-bar_4.entry.js.gz +0 -0
  744. package/dist/esm/snk-filter-binary-select.entry.js +23 -2
  745. package/dist/esm/snk-filter-binary-select.entry.js.gz +0 -0
  746. package/dist/esm/snk-filter-checkbox-list.entry.js +20 -2
  747. package/dist/esm/snk-filter-checkbox-list.entry.js.gz +0 -0
  748. package/dist/esm/snk-filter-detail.entry.js +25 -8
  749. package/dist/esm/snk-filter-detail.entry.js.gz +0 -0
  750. package/dist/esm/snk-filter-field-search_2.entry.js.gz +0 -0
  751. package/dist/esm/snk-filter-modal-item.entry.js +9 -14
  752. package/dist/esm/snk-filter-modal-item.entry.js.gz +0 -0
  753. package/dist/esm/snk-filter-multi-select.entry.js +16 -3
  754. package/dist/esm/snk-filter-multi-select.entry.js.gz +0 -0
  755. package/dist/esm/snk-filter-number.entry.js +34 -3
  756. package/dist/esm/snk-filter-number.entry.js.gz +0 -0
  757. package/dist/esm/snk-filter-period.entry.js +59 -14
  758. package/dist/esm/snk-filter-period.entry.js.gz +0 -0
  759. package/dist/esm/snk-filter-search.entry.js +14 -3
  760. package/dist/esm/snk-filter-search.entry.js.gz +0 -0
  761. package/dist/esm/snk-filter-text.entry.js +18 -1
  762. package/dist/esm/snk-filter-text.entry.js.gz +0 -0
  763. package/dist/esm/snk-form-summary.entry.js.gz +0 -0
  764. package/dist/esm/snk-form-view.entry.js.gz +0 -0
  765. package/dist/esm/snk-form_2.entry.js +4 -4
  766. package/dist/esm/snk-form_2.entry.js.gz +0 -0
  767. package/dist/esm/snk-grid.entry.js +31 -14
  768. package/dist/esm/snk-grid.entry.js.gz +0 -0
  769. package/dist/esm/{snk-guides-viewer-f800c9aa.js → snk-guides-viewer-19cb7f1f.js} +5 -5
  770. package/dist/esm/snk-guides-viewer-19cb7f1f.js.gz +0 -0
  771. package/dist/esm/snk-guides-viewer.entry.js +7 -7
  772. package/dist/esm/snk-guides-viewer.entry.js.gz +0 -0
  773. package/dist/esm/snk-personalized-filter-editor.entry.js.gz +0 -0
  774. package/dist/esm/snk-personalized-filter.entry.js +3 -3
  775. package/dist/esm/snk-personalized-filter.entry.js.gz +0 -0
  776. package/dist/esm/snk-pesquisa.entry.js +4 -4
  777. package/dist/esm/snk-pesquisa.entry.js.gz +0 -0
  778. package/dist/esm/snk-print-selector.entry.js.gz +0 -0
  779. package/dist/esm/snk-simple-bar.entry.js.gz +0 -0
  780. package/dist/esm/snk-simple-crud.entry.js +8 -8
  781. package/dist/esm/snk-simple-crud.entry.js.gz +0 -0
  782. package/dist/esm/snk-taskbar.entry.js.gz +0 -0
  783. package/dist/esm/sortable.esm-842f85a3.js.gz +0 -0
  784. package/dist/esm/taskbar-elements-faaf5d8f.js.gz +0 -0
  785. package/dist/esm/taskbar-processor-3436124c.js.gz +0 -0
  786. package/dist/esm/teste-pesquisa.entry.js.gz +0 -0
  787. package/dist/index.cjs.js.gz +0 -0
  788. package/dist/index.js.gz +0 -0
  789. package/dist/sankhyablocks/index.esm.js.gz +0 -0
  790. package/dist/sankhyablocks/p-0024d3fd.entry.js.gz +0 -0
  791. package/dist/sankhyablocks/p-093f58fa.entry.js +1 -0
  792. package/dist/sankhyablocks/p-093f58fa.entry.js.gz +0 -0
  793. package/dist/sankhyablocks/{p-87399df6.js → p-0a317e81.js} +1 -1
  794. package/dist/sankhyablocks/p-0a317e81.js.gz +0 -0
  795. package/dist/sankhyablocks/{p-aba06047.entry.js → p-0e1f0344.entry.js} +1 -1
  796. package/dist/sankhyablocks/p-0e1f0344.entry.js.gz +0 -0
  797. package/dist/sankhyablocks/p-0f3698af.js.gz +0 -0
  798. package/dist/sankhyablocks/p-11346b8d.entry.js.gz +0 -0
  799. package/dist/sankhyablocks/p-162bddae.entry.js.gz +0 -0
  800. package/dist/sankhyablocks/{p-7085fc67.entry.js → p-16c1c209.entry.js} +1 -1
  801. package/dist/sankhyablocks/p-16c1c209.entry.js.gz +0 -0
  802. package/dist/sankhyablocks/p-180716b2.entry.js.gz +0 -0
  803. package/dist/sankhyablocks/p-1a0caadb.js.gz +0 -0
  804. package/dist/sankhyablocks/p-1a68fb59.js.gz +0 -0
  805. package/dist/sankhyablocks/p-21107f0d.entry.js.gz +0 -0
  806. package/dist/sankhyablocks/p-27482793.entry.js.gz +0 -0
  807. package/dist/sankhyablocks/p-29cacaf3.entry.js +1 -0
  808. package/dist/sankhyablocks/p-29cacaf3.entry.js.gz +0 -0
  809. package/dist/sankhyablocks/p-2fdac5e6.entry.js.gz +0 -0
  810. package/dist/sankhyablocks/{p-41e5a485.entry.js → p-3c29939c.entry.js} +1 -1
  811. package/dist/sankhyablocks/p-3c29939c.entry.js.gz +0 -0
  812. package/dist/sankhyablocks/p-3d41f5a8.entry.js.gz +0 -0
  813. package/dist/sankhyablocks/p-3ed04f0d.entry.js +1 -0
  814. package/dist/sankhyablocks/p-3ed04f0d.entry.js.gz +0 -0
  815. package/dist/sankhyablocks/{p-e5571279.entry.js → p-44c5ec49.entry.js} +1 -1
  816. package/dist/sankhyablocks/p-44c5ec49.entry.js.gz +0 -0
  817. package/dist/sankhyablocks/p-471b34f4.entry.js.gz +0 -0
  818. package/dist/sankhyablocks/p-49ddc27a.entry.js +1 -0
  819. package/dist/sankhyablocks/p-49ddc27a.entry.js.gz +0 -0
  820. package/dist/sankhyablocks/p-4c763b10.entry.js +1 -0
  821. package/dist/sankhyablocks/p-4c763b10.entry.js.gz +0 -0
  822. package/dist/sankhyablocks/p-4eeb06fc.js +1 -0
  823. package/dist/sankhyablocks/p-4eeb06fc.js.gz +0 -0
  824. package/dist/sankhyablocks/p-505172c8.entry.js +1 -0
  825. package/dist/sankhyablocks/p-505172c8.entry.js.gz +0 -0
  826. package/dist/sankhyablocks/p-51833248.js.gz +0 -0
  827. package/dist/sankhyablocks/{p-6daf6629.entry.js → p-519f74be.entry.js} +1 -1
  828. package/dist/sankhyablocks/p-519f74be.entry.js.gz +0 -0
  829. package/dist/sankhyablocks/p-55798617.js.gz +0 -0
  830. package/dist/sankhyablocks/p-60dd1d27.entry.js.gz +0 -0
  831. package/dist/sankhyablocks/p-658f67a5.js +1 -0
  832. package/dist/sankhyablocks/p-658f67a5.js.gz +0 -0
  833. package/dist/sankhyablocks/p-667cab42.entry.js.gz +0 -0
  834. package/dist/sankhyablocks/p-6703336d.entry.js.gz +0 -0
  835. package/dist/sankhyablocks/p-688dcb4c.js.gz +0 -0
  836. package/dist/sankhyablocks/p-6a4b21dd.js.gz +0 -0
  837. package/dist/sankhyablocks/{p-0607d7a7.entry.js → p-701b024c.entry.js} +1 -1
  838. package/dist/sankhyablocks/p-701b024c.entry.js.gz +0 -0
  839. package/dist/sankhyablocks/p-72a9285d.entry.js +1 -0
  840. package/dist/sankhyablocks/p-72a9285d.entry.js.gz +0 -0
  841. package/dist/sankhyablocks/p-7345782c.entry.js.gz +0 -0
  842. package/dist/sankhyablocks/p-75af335e.entry.js.gz +0 -0
  843. package/dist/sankhyablocks/p-7b3ca294.entry.js.gz +0 -0
  844. package/dist/sankhyablocks/p-7dd49d15.js.gz +0 -0
  845. package/dist/sankhyablocks/p-7e250432.entry.js.gz +0 -0
  846. package/dist/sankhyablocks/p-7f7fe6c4.entry.js +1 -0
  847. package/dist/sankhyablocks/p-7f7fe6c4.entry.js.gz +0 -0
  848. package/dist/sankhyablocks/p-84345e7a.js.gz +0 -0
  849. package/dist/sankhyablocks/p-88b7bc09.js +1 -0
  850. package/dist/sankhyablocks/p-88b7bc09.js.gz +0 -0
  851. package/dist/sankhyablocks/{p-51209229.js → p-8d256def.js} +1 -1
  852. package/dist/sankhyablocks/p-8d256def.js.gz +0 -0
  853. package/dist/sankhyablocks/p-8d884fab.js.gz +0 -0
  854. package/dist/sankhyablocks/p-8f37b75b.entry.js +1 -0
  855. package/dist/sankhyablocks/p-8f37b75b.entry.js.gz +0 -0
  856. package/dist/sankhyablocks/p-8f3f2306.js.gz +0 -0
  857. package/dist/sankhyablocks/p-8f73da95.js.gz +0 -0
  858. package/dist/sankhyablocks/p-9019a32f.js.gz +0 -0
  859. package/dist/sankhyablocks/{p-e63cc25f.js → p-9062d640.js} +1 -1
  860. package/dist/sankhyablocks/p-9062d640.js.gz +0 -0
  861. package/dist/sankhyablocks/p-91a9abb6.entry.js.gz +0 -0
  862. package/dist/sankhyablocks/p-95c71f5e.entry.js.gz +0 -0
  863. package/dist/sankhyablocks/p-96d45943.entry.js +1 -0
  864. package/dist/sankhyablocks/p-96d45943.entry.js.gz +0 -0
  865. package/dist/sankhyablocks/p-988afe78.js.gz +0 -0
  866. package/dist/sankhyablocks/p-9a63f3f7.entry.js.gz +0 -0
  867. package/dist/sankhyablocks/p-a5108625.entry.js.gz +0 -0
  868. package/dist/sankhyablocks/{p-7b97f9af.entry.js → p-b2d7f4cd.entry.js} +1 -1
  869. package/dist/sankhyablocks/p-b2d7f4cd.entry.js.gz +0 -0
  870. package/dist/sankhyablocks/p-b568c1d4.js.gz +0 -0
  871. package/dist/sankhyablocks/{p-c3bab5f4.js → p-b7f5caf6.js} +1 -1
  872. package/dist/sankhyablocks/p-b7f5caf6.js.gz +0 -0
  873. package/dist/sankhyablocks/p-b987e15d.js.gz +0 -0
  874. package/dist/sankhyablocks/{p-7535d592.js → p-bf017a1f.js} +1 -1
  875. package/dist/sankhyablocks/p-bf017a1f.js.gz +0 -0
  876. package/dist/sankhyablocks/p-c3dbf441.entry.js.gz +0 -0
  877. package/dist/sankhyablocks/{p-3cdfd7fb.js → p-c71dcb2d.js} +1 -1
  878. package/dist/sankhyablocks/p-c71dcb2d.js.gz +0 -0
  879. package/dist/sankhyablocks/{p-dde9da7a.entry.js → p-c95f20d9.entry.js} +1 -1
  880. package/dist/sankhyablocks/p-c95f20d9.entry.js.gz +0 -0
  881. package/dist/sankhyablocks/p-c98e2085.js +1 -0
  882. package/dist/sankhyablocks/p-c98e2085.js.gz +0 -0
  883. package/dist/sankhyablocks/p-cb4343c4.entry.js +1 -0
  884. package/dist/sankhyablocks/p-cb4343c4.entry.js.gz +0 -0
  885. package/dist/sankhyablocks/{p-dfbe4d7f.entry.js → p-d03ae54e.entry.js} +1 -1
  886. package/dist/sankhyablocks/p-d03ae54e.entry.js.gz +0 -0
  887. package/dist/sankhyablocks/p-d235314c.entry.js +1 -0
  888. package/dist/sankhyablocks/p-d235314c.entry.js.gz +0 -0
  889. package/dist/sankhyablocks/{p-907d090b.entry.js → p-d725b0c7.entry.js} +1 -1
  890. package/dist/sankhyablocks/p-d725b0c7.entry.js.gz +0 -0
  891. package/dist/sankhyablocks/p-d75a732c.js +1 -0
  892. package/dist/sankhyablocks/p-d75a732c.js.gz +0 -0
  893. package/dist/sankhyablocks/p-d8d8169b.js.gz +0 -0
  894. package/dist/sankhyablocks/p-dc36cfbf.js.gz +0 -0
  895. package/dist/sankhyablocks/{p-7a1d3cb6.entry.js → p-df7979fd.entry.js} +1 -1
  896. package/dist/sankhyablocks/p-df7979fd.entry.js.gz +0 -0
  897. package/dist/sankhyablocks/p-e258de96.entry.js +1 -0
  898. package/dist/sankhyablocks/p-e258de96.entry.js.gz +0 -0
  899. package/dist/sankhyablocks/p-eaad0aa8.js.gz +0 -0
  900. package/dist/sankhyablocks/p-f4184ce7.js.gz +0 -0
  901. package/dist/sankhyablocks/{p-b6b42620.entry.js → p-f8e87cf1.entry.js} +1 -1
  902. package/dist/sankhyablocks/p-f8e87cf1.entry.js.gz +0 -0
  903. package/dist/sankhyablocks/p-f8f29e1a.entry.js.gz +0 -0
  904. package/dist/sankhyablocks/p-fa80e546.js.gz +0 -0
  905. package/dist/sankhyablocks/p-ff1990ad.js.gz +0 -0
  906. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  907. package/dist/sankhyablocks/sankhyablocks.esm.js.gz +0 -0
  908. package/dist/types/components/snk-entity-list/snk-entity-list.d.ts +8 -4
  909. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.d.ts +12 -0
  910. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-checkbox-list.d.ts +12 -0
  911. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.d.ts +12 -4
  912. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-number.d.ts +16 -4
  913. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-period.d.ts +17 -3
  914. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-search.d.ts +10 -2
  915. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-text.d.ts +12 -0
  916. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +8 -3
  917. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +27 -4
  918. package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +17 -3
  919. package/dist/types/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.d.ts +2 -3
  920. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +15 -2
  921. package/dist/types/components/snk-filter-bar/utils/SnkFilterModalFactory.d.ts +4 -2
  922. package/dist/types/components/snk-filter-bar/utils/filter-validate.d.ts +11 -0
  923. package/dist/types/components/snk-grid/snk-grid.d.ts +22 -9
  924. package/dist/types/components.d.ts +203 -18
  925. package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +1 -0
  926. package/package.json +1 -1
  927. package/dist/cjs/ClientSideExporterProvider-bb0b2273.js.gz +0 -0
  928. package/dist/cjs/ConfigStorage-0ebc800f.js.gz +0 -0
  929. package/dist/cjs/ISave-18205d86.js.gz +0 -0
  930. package/dist/cjs/SnkFormConfigManager-4b651537.js.gz +0 -0
  931. package/dist/cjs/auth-fetcher-82317d4d.js.gz +0 -0
  932. package/dist/cjs/dataunit-fetcher-93077a2f.js.gz +0 -0
  933. package/dist/cjs/form-config-fetcher-05d210e7.js.gz +0 -0
  934. package/dist/cjs/snk-data-unit-7cb76490.js.gz +0 -0
  935. package/dist/cjs/snk-guides-viewer-73d40f42.js.gz +0 -0
  936. package/dist/esm/ClientSideExporterProvider-21a99af1.js.gz +0 -0
  937. package/dist/esm/ConfigStorage-fc4e3a42.js.gz +0 -0
  938. package/dist/esm/DataFetcher-01ce1a4f.js.gz +0 -0
  939. package/dist/esm/ISave-d36bade4.js.gz +0 -0
  940. package/dist/esm/SnkFormConfigManager-71dae34e.js.gz +0 -0
  941. package/dist/esm/auth-fetcher-2e565c35.js.gz +0 -0
  942. package/dist/esm/dataunit-fetcher-14ba162b.js.gz +0 -0
  943. package/dist/esm/form-config-fetcher-a1ccc944.js.gz +0 -0
  944. package/dist/esm/snk-data-unit-b5e1c491.js.gz +0 -0
  945. package/dist/esm/snk-guides-viewer-f800c9aa.js.gz +0 -0
  946. package/dist/sankhyablocks/p-0607d7a7.entry.js.gz +0 -0
  947. package/dist/sankhyablocks/p-07b14811.entry.js +0 -1
  948. package/dist/sankhyablocks/p-07b14811.entry.js.gz +0 -0
  949. package/dist/sankhyablocks/p-082e7ba8.entry.js +0 -1
  950. package/dist/sankhyablocks/p-082e7ba8.entry.js.gz +0 -0
  951. package/dist/sankhyablocks/p-25209340.entry.js +0 -1
  952. package/dist/sankhyablocks/p-25209340.entry.js.gz +0 -0
  953. package/dist/sankhyablocks/p-3143bb44.entry.js +0 -1
  954. package/dist/sankhyablocks/p-3143bb44.entry.js.gz +0 -0
  955. package/dist/sankhyablocks/p-353b4a74.js +0 -1
  956. package/dist/sankhyablocks/p-353b4a74.js.gz +0 -0
  957. package/dist/sankhyablocks/p-398cdd67.entry.js +0 -1
  958. package/dist/sankhyablocks/p-398cdd67.entry.js.gz +0 -0
  959. package/dist/sankhyablocks/p-3a10f9ea.entry.js +0 -1
  960. package/dist/sankhyablocks/p-3a10f9ea.entry.js.gz +0 -0
  961. package/dist/sankhyablocks/p-3cdfd7fb.js.gz +0 -0
  962. package/dist/sankhyablocks/p-41e5a485.entry.js.gz +0 -0
  963. package/dist/sankhyablocks/p-51209229.js.gz +0 -0
  964. package/dist/sankhyablocks/p-5bab470d.entry.js +0 -1
  965. package/dist/sankhyablocks/p-5bab470d.entry.js.gz +0 -0
  966. package/dist/sankhyablocks/p-65517fcf.js +0 -1
  967. package/dist/sankhyablocks/p-65517fcf.js.gz +0 -0
  968. package/dist/sankhyablocks/p-6daf6629.entry.js.gz +0 -0
  969. package/dist/sankhyablocks/p-7085fc67.entry.js.gz +0 -0
  970. package/dist/sankhyablocks/p-7535d592.js.gz +0 -0
  971. package/dist/sankhyablocks/p-7a1d3cb6.entry.js.gz +0 -0
  972. package/dist/sankhyablocks/p-7b97f9af.entry.js.gz +0 -0
  973. package/dist/sankhyablocks/p-87399df6.js.gz +0 -0
  974. package/dist/sankhyablocks/p-907d090b.entry.js.gz +0 -0
  975. package/dist/sankhyablocks/p-9fd87bfd.entry.js +0 -1
  976. package/dist/sankhyablocks/p-9fd87bfd.entry.js.gz +0 -0
  977. package/dist/sankhyablocks/p-a76e6d51.entry.js +0 -1
  978. package/dist/sankhyablocks/p-a76e6d51.entry.js.gz +0 -0
  979. package/dist/sankhyablocks/p-aba06047.entry.js.gz +0 -0
  980. package/dist/sankhyablocks/p-ae2ebab7.js +0 -1
  981. package/dist/sankhyablocks/p-ae2ebab7.js.gz +0 -0
  982. package/dist/sankhyablocks/p-b21aa190.entry.js +0 -1
  983. package/dist/sankhyablocks/p-b21aa190.entry.js.gz +0 -0
  984. package/dist/sankhyablocks/p-b6b42620.entry.js.gz +0 -0
  985. package/dist/sankhyablocks/p-c3bab5f4.js.gz +0 -0
  986. package/dist/sankhyablocks/p-c6a8a8bc.entry.js +0 -1
  987. package/dist/sankhyablocks/p-c6a8a8bc.entry.js.gz +0 -0
  988. package/dist/sankhyablocks/p-c8932b14.entry.js +0 -1
  989. package/dist/sankhyablocks/p-c8932b14.entry.js.gz +0 -0
  990. package/dist/sankhyablocks/p-dc8bb41f.js +0 -1
  991. package/dist/sankhyablocks/p-dc8bb41f.js.gz +0 -0
  992. package/dist/sankhyablocks/p-dde9da7a.entry.js.gz +0 -0
  993. package/dist/sankhyablocks/p-dfbe4d7f.entry.js.gz +0 -0
  994. package/dist/sankhyablocks/p-dff65083.entry.js +0 -1
  995. package/dist/sankhyablocks/p-dff65083.entry.js.gz +0 -0
  996. package/dist/sankhyablocks/p-e5571279.entry.js.gz +0 -0
  997. package/dist/sankhyablocks/p-e63cc25f.js.gz +0 -0
@@ -1 +1 @@
1
- import{r as t,c as s,h as i,H as e,F as a}from"./p-d8d8169b.js";import{I as o}from"./p-e63cc25f.js";import"./p-65517fcf.js";import{P as r}from"./p-7535d592.js";import"@sankhyalabs/core";import"./p-0f3698af.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-ff1990ad.js";import"./p-51209229.js";import"./p-9019a32f.js";import{ApplicationUtils as n}from"@sankhyalabs/ezui/dist/collection/utils";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";import"./p-8d884fab.js";const h=class{constructor(i){t(this,i),this.pesquisaGridSelectItem=s(this,"pesquisaGridSelectItem",7),this._pesquisaFetcher=new r,this.metadata=void 0,this.dataSource=[],this.pkField=void 0,this.descriptionField=void 0,this.entityName=void 0,this.shouldLoadConfig=!1,this._gridConfig=void 0,this._inMemoryLoader=void 0,this._dataunit=void 0}observeDataSource(t){this._inMemoryLoader&&this._dataunit&&t&&(this._inMemoryLoader.records=[...t])}observeMetadata(){this.initializeDataUnit()}async observeShouldLoadConfig(t){t&&!this._gridConfig&&await this.loadGridConfig()}async loadGridConfig(){this._gridConfig=await this._pesquisaFetcher.loadPesquisaGridConfig(this.entityName)}initializeDataUnit(){var t;this.metadata&&!this._dataunit&&(this._inMemoryLoader=new o(this.metadata,null!==(t=this.dataSource)&&void 0!==t?t:[]),this._dataunit=this._inMemoryLoader.dataUnit,this._dataunit.pageSize=0)}handleDbClick(t){this.pesquisaGridSelectItem.emit({value:t[this.pkField],label:t[this.descriptionField]})}async handleConfigChanged({detail:t}){var s;const i=null!==(s=null==t?void 0:t.columns)&&void 0!==s?s:[];await this._pesquisaFetcher.savePesquisaGridConfig(this.entityName,i)}render(){if(this.metadata&&this._dataunit)return i(e,null,i("ez-grid",{dataUnit:this._dataunit,config:this._gridConfig,mode:"simple",autoFocus:!1,onEzDoubleClick:({detail:t})=>this.handleDbClick(t),onConfigChange:async t=>this.handleConfigChanged(t)}))}static get watchers(){return{dataSource:["observeDataSource"],metadata:["observeMetadata"],shouldLoadConfig:["observeShouldLoadConfig"]}}};h.style=".sc-pesquisa-grid-h{background:var(--background--xlight, #FFF);overflow-x:auto}ez-grid.sc-pesquisa-grid{--ez-grid__container--shadow:none;--ez-grid__header--shadow:none}";const l=class{constructor(i){t(this,i),this.pesquisaTreeSelectItem=s(this,"pesquisaTreeSelectItem",7),this.treeLoader=void 0,this.argument=void 0,this.allowsNonAnalytic=!1,this.shouldLoadTree=!1,this.messagesBuilder=void 0,this.items=[]}async applyFilter(){await this._tree.applyFilter(this.argument)}async observeShouldLoadTree(t){!t||this.items.length>0||await this.loadTree()}async loadTree(){if(!this.shouldLoadTree)return;if(!this.treeLoader||"function"!=typeof this.treeLoader)return;const t=await this.treeLoader((this.argument||"").trim());this.items=[...t]}expandOrCloseAllItems(t,s){return t.map((t=>Object.assign(Object.assign({},t),{expanded:s,children:t.children?this.expandOrCloseAllItems(t.children,s):void 0})))}handleExpandAll(){this.items=[...this.expandOrCloseAllItems(this.items,!0)]}handleCloseAll(){this.items=[...this.expandOrCloseAllItems(this.items,!1)]}handleDbClick(t){var s;if(this.allowsNonAnalytic||(null===(s=t.props)||void 0===s?void 0:s.analitico))this.pesquisaTreeSelectItem.emit({value:t.id,label:t.label});else{const t=this.getMessage("snkPesquisa.tree.errorTitle"),s=this.getMessage("snkPesquisa.tree.nonAnalyticError");n.error(t,s)}}renderEmptyMessage(){return i("div",{class:"ez-flex ez-flex--justify-center ez-flex--align-items-center ez-margin--large ez-text ez-text--xlarge ez-text--secondary"},i("span",null,this.getMessage("snkPesquisa.tree.emptyMessage")))}getMessage(t,s){return this.messagesBuilder.getMessage(t,s)}render(){var t;return i(e,null,(null===(t=this.items)||void 0===t?void 0:t.length)?i(a,null,i("div",{class:"actions-container"},i("ez-button",{size:"small",mode:"icon",class:"ez-margin-right--small",iconName:"show-list",title:this.getMessage("snkPesquisa.tree.expandButton"),onClick:()=>this.handleExpandAll()}),i("ez-button",{size:"small",mode:"icon",iconName:"hide-list",title:this.getMessage("snkPesquisa.tree.collapseButton"),onClick:()=>this.handleCloseAll()})),i("ez-tree",{ref:t=>this._tree=t,onEzDbClickItem:({detail:t})=>this.handleDbClick(t),items:this.items})):this.renderEmptyMessage())}static get watchers(){return{shouldLoadTree:["observeShouldLoadTree"]}}};l.style=".sc-pesquisa-tree-h{--snk-pesquisa--tree__action-container--top:var(--space--sm);--snk-pesquisa--tree__action-container--right:var(--space--small);--snk-pesquisa--tree__min-height:var(--space--extra-large);background:var(--background--xlight, #FFF);position:relative;min-height:var(--snk-pesquisa--tree__min-height);height:100%;display:block;overflow-y:auto}.sc-pesquisa-tree-h:hover .actions-container.sc-pesquisa-tree{display:flex}.actions-container.sc-pesquisa-tree{flex-direction:row;position:absolute;top:var(--snk-pesquisa--tree__action-container--top);right:var(--snk-pesquisa--tree__action-container--right);display:none}";export{h as pesquisa_grid,l as pesquisa_tree}
1
+ import{r as t,c as s,h as i,H as e,F as a}from"./p-d8d8169b.js";import{I as o}from"./p-9062d640.js";import"./p-d75a732c.js";import{P as r}from"./p-bf017a1f.js";import"@sankhyalabs/core";import"./p-0f3698af.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-ff1990ad.js";import"./p-8d256def.js";import"./p-9019a32f.js";import{ApplicationUtils as n}from"@sankhyalabs/ezui/dist/collection/utils";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";import"./p-8d884fab.js";const h=class{constructor(i){t(this,i),this.pesquisaGridSelectItem=s(this,"pesquisaGridSelectItem",7),this._pesquisaFetcher=new r,this.metadata=void 0,this.dataSource=[],this.pkField=void 0,this.descriptionField=void 0,this.entityName=void 0,this.shouldLoadConfig=!1,this._gridConfig=void 0,this._inMemoryLoader=void 0,this._dataunit=void 0}observeDataSource(t){this._inMemoryLoader&&this._dataunit&&t&&(this._inMemoryLoader.records=[...t])}observeMetadata(){this.initializeDataUnit()}async observeShouldLoadConfig(t){t&&!this._gridConfig&&await this.loadGridConfig()}async loadGridConfig(){this._gridConfig=await this._pesquisaFetcher.loadPesquisaGridConfig(this.entityName)}initializeDataUnit(){var t;this.metadata&&!this._dataunit&&(this._inMemoryLoader=new o(this.metadata,null!==(t=this.dataSource)&&void 0!==t?t:[]),this._dataunit=this._inMemoryLoader.dataUnit,this._dataunit.pageSize=0)}handleDbClick(t){this.pesquisaGridSelectItem.emit({value:t[this.pkField],label:t[this.descriptionField]})}async handleConfigChanged({detail:t}){var s;const i=null!==(s=null==t?void 0:t.columns)&&void 0!==s?s:[];await this._pesquisaFetcher.savePesquisaGridConfig(this.entityName,i)}render(){if(this.metadata&&this._dataunit)return i(e,null,i("ez-grid",{dataUnit:this._dataunit,config:this._gridConfig,mode:"simple",autoFocus:!1,onEzDoubleClick:({detail:t})=>this.handleDbClick(t),onConfigChange:async t=>this.handleConfigChanged(t)}))}static get watchers(){return{dataSource:["observeDataSource"],metadata:["observeMetadata"],shouldLoadConfig:["observeShouldLoadConfig"]}}};h.style=".sc-pesquisa-grid-h{background:var(--background--xlight, #FFF);overflow-x:auto}ez-grid.sc-pesquisa-grid{--ez-grid__container--shadow:none;--ez-grid__header--shadow:none}";const l=class{constructor(i){t(this,i),this.pesquisaTreeSelectItem=s(this,"pesquisaTreeSelectItem",7),this.treeLoader=void 0,this.argument=void 0,this.allowsNonAnalytic=!1,this.shouldLoadTree=!1,this.messagesBuilder=void 0,this.items=[]}async applyFilter(){await this._tree.applyFilter(this.argument)}async observeShouldLoadTree(t){!t||this.items.length>0||await this.loadTree()}async loadTree(){if(!this.shouldLoadTree)return;if(!this.treeLoader||"function"!=typeof this.treeLoader)return;const t=await this.treeLoader((this.argument||"").trim());this.items=[...t]}expandOrCloseAllItems(t,s){return t.map((t=>Object.assign(Object.assign({},t),{expanded:s,children:t.children?this.expandOrCloseAllItems(t.children,s):void 0})))}handleExpandAll(){this.items=[...this.expandOrCloseAllItems(this.items,!0)]}handleCloseAll(){this.items=[...this.expandOrCloseAllItems(this.items,!1)]}handleDbClick(t){var s;if(this.allowsNonAnalytic||(null===(s=t.props)||void 0===s?void 0:s.analitico))this.pesquisaTreeSelectItem.emit({value:t.id,label:t.label});else{const t=this.getMessage("snkPesquisa.tree.errorTitle"),s=this.getMessage("snkPesquisa.tree.nonAnalyticError");n.error(t,s)}}renderEmptyMessage(){return i("div",{class:"ez-flex ez-flex--justify-center ez-flex--align-items-center ez-margin--large ez-text ez-text--xlarge ez-text--secondary"},i("span",null,this.getMessage("snkPesquisa.tree.emptyMessage")))}getMessage(t,s){return this.messagesBuilder.getMessage(t,s)}render(){var t;return i(e,null,(null===(t=this.items)||void 0===t?void 0:t.length)?i(a,null,i("div",{class:"actions-container"},i("ez-button",{size:"small",mode:"icon",class:"ez-margin-right--small",iconName:"show-list",title:this.getMessage("snkPesquisa.tree.expandButton"),onClick:()=>this.handleExpandAll()}),i("ez-button",{size:"small",mode:"icon",iconName:"hide-list",title:this.getMessage("snkPesquisa.tree.collapseButton"),onClick:()=>this.handleCloseAll()})),i("ez-tree",{ref:t=>this._tree=t,onEzDbClickItem:({detail:t})=>this.handleDbClick(t),items:this.items})):this.renderEmptyMessage())}static get watchers(){return{shouldLoadTree:["observeShouldLoadTree"]}}};l.style=".sc-pesquisa-tree-h{--snk-pesquisa--tree__action-container--top:var(--space--sm);--snk-pesquisa--tree__action-container--right:var(--space--small);--snk-pesquisa--tree__min-height:var(--space--extra-large);background:var(--background--xlight, #FFF);position:relative;min-height:var(--snk-pesquisa--tree__min-height);height:100%;display:block;overflow-y:auto}.sc-pesquisa-tree-h:hover .actions-container.sc-pesquisa-tree{display:flex}.actions-container.sc-pesquisa-tree{flex-direction:row;position:absolute;top:var(--snk-pesquisa--tree__action-container--top);right:var(--snk-pesquisa--tree__action-container--right);display:none}";export{h as pesquisa_grid,l as pesquisa_tree}
Binary file
@@ -1 +1 @@
1
- import{r as i,c as t,h as e,F as s,g as r}from"./p-d8d8169b.js";import{ObjectUtils as n,StringUtils as a,Action as d,KeyboardManager as o,ElementIDUtils as h}from"@sankhyalabs/core";import{S as l}from"./p-ae2ebab7.js";import{buildFormMetadata as u,FormMetadata as v}from"@sankhyalabs/ezui/dist/collection/utils/form";import{T as c}from"./p-1a0caadb.js";import{T as g}from"./p-b987e15d.js";import{V as m}from"./p-9019a32f.js";import"./p-65517fcf.js";import"./p-7535d592.js";import{P as k}from"./p-0f3698af.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-e63cc25f.js";import"./p-ff1990ad.js";import"./p-51209229.js";import{SelectionMode as p}from"@sankhyalabs/core/dist/dataunit/DataUnit";import{buildFieldSearch as f,SHORTCUT_SEARCH_FIELD as w}from"@sankhyalabs/ezui/dist/collection/utils";const b="__FORM:",_=class{constructor(e){i(this,e),this.snkMasterFormConfigChange=t(this,"snkMasterFormConfigChange",7),this.exit=t(this,"exit",7),this.actionClick=t(this,"actionClick",7),this.formItemsReady=t(this,"formItemsReady",7),this._guideBuilders=new Map,this.dataUnit=void 0,this.dataState=void 0,this.configName=void 0,this.entityPath=void 0,this.actionsList=void 0,this.recordsValidator=void 0,this.masterFormConfig=void 0,this.selectedGuide=void 0,this.taskbarManager=void 0,this.messagesBuilder=void 0,this.canEdit=!0,this.presentationMode=void 0,this.resourceID=void 0,this.detailTaskbarCustomContainerId=void 0,this.formLegacyConfigName=void 0,this.enableGridInsert=!1,this.ignoreReadOnlyFormFields=void 0,this.getCustomTitle=void 0,this._hasToCreateFieldSearch=!0,this._breadcrumbItems=[],this._guides=void 0,this._formEditorConfigManager=void 0,this._formEditorDataUnit=void 0,this._fieldToGetFocus=void 0,this._customEditors=void 0,this._customRenders=void 0,this._fieldsProps={},this._mainForm=void 0}observeDataUnit(){this.loadGuides(!0)}observeDataState(i,t){var e,s,r,a,d,o;const h=null!==(s=null===(e=null==i?void 0:i.selectionInfo)||void 0===e?void 0:e.recordIds)&&void 0!==s?s:null===(r=null==i?void 0:i.selectedRecord)||void 0===r?void 0:r.__record__id__,l=null!==(d=null===(a=null==t?void 0:t.selectionInfo)||void 0===a?void 0:a.recordIds)&&void 0!==d?d:null===(o=null==t?void 0:t.selectedRecord)||void 0===o?void 0:o.__record__id__;n.equals(h,l)||this.loadGuides((null==t?void 0:t.insertionMode)!=(null==i?void 0:i.insertionMode))}observeMasterFormConfig(){this.loadGuides(this.noGuideSelected()),this.snkMasterFormConfigChange.emit(this.masterFormConfig)}async showFormConfig(i=!1){const t=!i||null==this._currentDetail;this._formEditorConfigManager=t?this._configManager:this._currentDetail.formConfigManager,this._formEditorDataUnit=t?this.dataUnit:this._currentDetail.dataUnit}async addCustomEditor(i,t){this._customEditors=Object.assign(Object.assign({},this._customEditors),{[i]:t})}async addGridCustomRender(i,t){this._customRenders=Object.assign(Object.assign({},this._customRenders),{[i]:t})}async setFieldProp(i,t,e){const s={[i]:Object.assign(Object.assign({},this._fieldsProps[i]),{[t]:e})};this._fieldsProps=Object.assign(Object.assign({},this._fieldsProps),s)}async setFocus(){this._container.focus()}exitViewer(){!this.enableGridInsert&&this.dataUnit.isDirty()?this.dataUnit.cancelEdition({after:()=>this.exit.emit()}):this.exit.emit()}onActionClick(i){i.detail===g.CONFIGURATOR&&"master"!=i.target.dataset.taskbarOwner&&(this._snkConfigurator.open(),i.stopImmediatePropagation(),i.stopPropagation())}onContentCardChanged(i){_.updateContentCard(i.detail.formName,i.detail.cardConfig,i.detail.propertyChanged,this._configManager).then((()=>this.masterFormConfig=this._configManager.getConfig(this.dataUnit)))}getMessage(i){var t,e;if(this.dataUnit.isMultipleEdition){const i=null!==(e=null===(t=this.dataUnit.getSelectionInfo())||void 0===t?void 0:t.records)&&void 0!==e?e:[];return this.messagesBuilder.getMessage("snkCrud.multipleEdition.editing",{COUNT:i.length})}return this.messagesBuilder.getMessage(i,this.dataUnit.getSelectedRecord())}loadGuides(i){if(!this.dataUnit)return;if(!this._configManager.isLoaded)return;this._masterFormMetadata=u(this.masterFormConfig,this.dataUnit,!0);const t=this._masterFormMetadata.getAllSheets(),e=this.dataUnit.getSelectedRecord(),s=this.hasToDisableDetails(e),r=[];Array.from(t.values()).forEach((i=>{const t={id:i.name,label:i.label};this.isDetail(i.name)&&s&&(t.tooltip=this.getMessage("snkCrud.detail.tooltip.needSingleSelection"),t.disabled=!0),r.push(t)})),this._guides=r,this._guideNavigator&&this._guideNavigator.updateItem(this._guides),i&&(this.selectedGuide=this._guides.length>0?this._guides[0]:void 0)}hasToDisableDetails(i){return!i||this.dataUnit.isNewRecord(i.__record__id__)||this.dataUnit.isMultipleEdition}isDetail(i){return null!=v.getDetailName(i)}updateGuide(i){this._guideBuilders.set(i.id,i);const t=i.buildGuideItem(this._guideBuilders);this._guideNavigator&&(this._guideNavigator.updateItem(t).then((()=>{this._guideNavigator.getCurrentPath().then((i=>{this._breadcrumbItems=i}))})),this._guides=this._guides.map((i=>i.id===t.id?Object.assign(Object.assign(Object.assign({},i),t),void 0!==t.children?{}:{children:void 0}):i)))}getTaskBarId(){var i;return(null===(i=this.dataState)||void 0===i?void 0:i.isDirty)?C.FINISH_EDITION:this.dataUnit.isMultipleEdition?C.MUTIPLE_EDITION:C.REGULAR}loadTaskbarProcessor(){const i={};i[C.REGULAR]=this.buildBtnsRegularMode(),i[C.FINISH_EDITION]=[g.CANCEL,g.SAVE,this.handleAddGridMode()],i[C.MUTIPLE_EDITION]=[g.CANCEL],this._taskbarProcessor=new c(i),this._taskbarProcessor.process(this.getTaskBarId(),this.taskbarManager,this.dataState,this.buildDisabledButtons(),this.buildInvisibleButtons())}buildBtnsRegularMode(){var i,t;const e=[g.ATTACH,g.CLONE,g.REMOVE,g.MORE_OPTIONS,g.ACTIONS_BUTTON,g.DIVIDER,g.GRID_MODE,g.CONFIGURATOR];return(null===(t=null===(i=this.dataState)||void 0===i?void 0:i.selectionInfo)||void 0===t?void 0:t.length)<=1&&e.unshift(g.PREVIOUS,g.NEXT,g.DIVIDER),this.presentationMode==k.SECONDARY?e.unshift(g.INSERT):e.push(g.INSERT),e}buildDisabledButtons(){var i,t,e,s,r,n;const a=[];return(null===(i=this.dataState)||void 0===i?void 0:i.hasPrevious)||a.push(g.PREVIOUS),(null===(t=this.dataState)||void 0===t?void 0:t.hasNext)||a.push(g.NEXT),(null===(s=null===(e=this.dataState)||void 0===e?void 0:e.selectionInfo)||void 0===s?void 0:s.length)>1&&a.push(g.CLONE),(null===(n=null===(r=this.dataState)||void 0===r?void 0:r.selectionInfo)||void 0===n?void 0:n.isAllRecords())&&a.push(g.REMOVE),a}handleAddGridMode(){return this.enableGridInsert?g.GRID_MODE:""}buildInvisibleButtons(){const i=[];return this.dataState&&this.dataState.selectionInfo.mode===p.ALL_RECORDS&&i.push(g.ACTIONS_BUTTON),i}static updateContentCard(i,t,e,s){return s.saveCardState(i,t,e)}static buildFixedForms(i){var t;const r=null===(t=i.formConfig)||void 0===t?void 0:t.cardsState;if(null!=r)return e(s,null,Array.from(r.entries()).filter((([t,e])=>(null==e?void 0:e.fixed)&&t!=i.selectedForm)).sort((([,i],[,t])=>((null==i?void 0:i.fixSequence)||0)-((null==t?void 0:t.fixSequence)||0))).map((([t,s])=>{var r,n;const a=i.formMetadata.getSheet(t);if(null!=a)return e("snk-form-view",{levelPath:i.levelPath,label:a.label,name:t,fields:a.fields,formMetadata:i.formMetadata,dataUnit:i.dataUnit,recordsValidator:i.recordsValidator,contracted:"CONTRACTED"===(null==s?void 0:s.presentation),fixed:null==s?void 0:s.fixed,summaryFields:null===(n=null===(r=i.formConfig)||void 0===r?void 0:r.summary)||void 0===n?void 0:n.get(t),fieldToFocus:i.fieldToFocus,key:t,onSnkRequestClearFieldToFocus:()=>{var t;return null===(t=i.onRequestClearFieldToFocus)||void 0===t?void 0:t.call(i)},customEditors:i.propsCustomEditor,fieldsProps:i.fieldsProps})})))}wrapDetail(i,t){if(0===i.length)return t;const s=i.pop(),r=v.getDetailName(s);return r?this.wrapDetail(i,e("snk-data-unit",{dataUnitName:`${this.getDataUnitName(i,r)}`,entityName:r},t)):void 0}getDataUnitName(i,t){if(i.length>0){const e=i.map((i=>v.getDetailName(i)));return`${this.entityPath}/${e.join("/")}/${t}`}return`${this.entityPath}/${t}`}getContent(){var i,t,s,r,n;if(!this.selectedGuide)return;const a=this.selectedGuide.id;let d;const o=a.split("::"),h=o.pop(),l=v.getDetailName(h);let u=a;if(l||o.length>0){let t,s;if(a.includes(b)){[u,t]=a.split(b);const e=(null===(i=this._breadcrumbItems)||void 0===i?void 0:i.length)||0;s=e>1?this._breadcrumbItems[e-2]:this.selectedGuide}else s=this.selectedGuide;d=this.wrapDetail(o,e("snk-detail-view",{ref:i=>this._currentDetail=i,dataUnitName:this.getDataUnitName(o,l),onSnkDetailGuidesChange:i=>this.updateGuide(i.detail),entityName:l,selectedForm:t,branchGuide:s,guideItemPath:this._breadcrumbItems,key:`detail${u}`,canEdit:this.canEdit,onSnkSwitchGuide:i=>this._guideNavigator.selectGuide(i.detail),resourceID:this.resourceID,taskbarCustomContainerId:this.detailTaskbarCustomContainerId,customEditors:this._customEditors,customRenders:this._customRenders,presentationMode:this.presentationMode}))}else{const i=this.selectedGuide.id,o=this._masterFormMetadata.getSheet(i);if(o){const h=null===(s=null===(t=this.masterFormConfig)||void 0===t?void 0:t.cardsState)||void 0===s?void 0:s.get(i);d=e("snk-form-view",{ref:i=>this._mainForm=i,fixed:null==h?void 0:h.fixed,summaryFields:null===(n=null===(r=this.masterFormConfig)||void 0===r?void 0:r.summary)||void 0===n?void 0:n.get(i),name:i,label:o.label,fields:o.fields,dataUnit:this.dataUnit,formMetadata:this._masterFormMetadata,recordsValidator:this.recordsValidator,fieldToFocus:this._fieldToGetFocus,key:a,onSnkRequestClearFieldToFocus:()=>this.clearFieldToFocusHandler(),customEditors:this._customEditors,fieldsProps:this._fieldsProps,fieldSearch:this._fieldSearch},this.presentationMode==k.SECONDARY&&this.buildTaskBar())}}return d}onBreadcrumbClickHandler(i){null!=(null==i?void 0:i.id)&&this._guideNavigator.selectGuide(i.id)}updateSelectedGuideHandler(i){this._guideHasChanged=this.selectedGuide!=i,this.selectedGuide=i,this._guideNavigator.getCurrentPath().then((i=>{this._breadcrumbItems=i})),this.resetGuideBadge(i)}changeGuideHandler(i){var t;null===(t=this._guideNavigator)||void 0===t||t.selectGuide(i)}clearFieldToFocusHandler(){this._fieldToGetFocus=void 0}resetGuideBadge(i){var t;this._guides=[...null===(t=this._guides)||void 0===t?void 0:t.map((t=>this.canClearGuideBadge(t,i.id)?Object.assign(Object.assign({},t),{badge:null}):t))]}canClearGuideBadge(i,t){return i.id===t||this.isIncludedInChildrenList(i,t)}isIncludedInChildrenList(i,t){return this.hasChildren(i)&&this.getChildrenIdList(i).includes(t)}hasChildren(i){return i.children&&Array.isArray(i.children)}getChildrenIdList(i){return i.children.map((i=>i.id))}getConfigViewMode(){return m.GRID}changeConfigViewMode(i){this._currentDetail&&this._currentDetail.changeViewMode(i)}openConfig(i){this._snkConfigurator.close(),this._currentDetail&&(i===m.FORM?this.showFormConfig(!0):this._currentDetail.configGrid())}noGuideSelected(){var i;return void 0===this.selectedGuide||"__main"===(null===(i=this.selectedGuide)||void 0===i?void 0:i.id)}addFormLegacyConfigName(){this.formLegacyConfigName&&this._configManager.addFormLegacyConfig(this.formLegacyConfigName)}setMasterFormConfig(i){this.masterFormConfig=i}componentWillLoad(){if(null==this.resourceID)throw new Error(this.getMessage("snkCrud.errors.resourceIDNotProvided"));this._configManager=new l(this.configName,this.resourceID,this.setMasterFormConfig.bind(this),this.dataUnit),this.addFormLegacyConfigName(),this._configManager.loadConfig()}componentDidRender(){this._guideHasChanged&&(this._currentDetail?this._currentDetail.showUp():this._mainForm&&this._mainForm.showUp(),this._guideHasChanged=!1)}getFieldsSearch(i){return(null==this._fieldSearch||this._hasToCreateFieldSearch)&&(this._hasToCreateFieldSearch=!1,this._fieldSearch=f(i,(({argument:i})=>this.fieldsOptionLoader(i)),(i=>this.onSelectField(i)))),this._fieldSearch}fieldsOptionLoader(i){return Promise.resolve(this._configManager.getFieldsList(i).map((i=>({value:i.name,label:i.label}))))}onSelectField(i){if(null==i)return;this._fieldToGetFocus=i.value;const t=this.getGuideName(i.value);t!==this.selectedGuide.id&&this.changeGuideHandler(t)}getActionsList(){var i;return[].concat(null!=this.taskbarManager&&null!=this.taskbarManager.getMoreOptions?null!==(i=this.taskbarManager.getMoreOptions(this.getTaskBarId(),this.configName,this.dataState,this.actionsList))&&void 0!==i?i:[]:this.actionsList)}getSettingsListForm(){return[{value:a.generateUUID(),label:this.getMessage("snkCrud.findColumn"),disableCloseOnSelect:!0,eagerInitialize:!0,itemBuilder:(i,t)=>this.getFieldsSearch(t)}]}buildTaskBar(){var i;return e("div",{class:"snk-guides-viewer__header-taskbar "+(this.presentationMode!=k.SECONDARY?"ez-align--right":"ez-padding-bottom--medium")},e("snk-taskbar",{key:"guideViewerTaskbar","data-element-id":"guideViewer",configName:this.configName,buttons:this._taskbarProcessor.buttons,disabledButtons:this._taskbarProcessor.disabledButtons,customButtons:this._taskbarProcessor.customButtons,actionsList:this.getActionsList(),actionsSettingsList:this.getSettingsListForm(),messagesBuilder:this.messagesBuilder,presentationMode:this.presentationMode,primaryButton:(null===(i=this.dataState)||void 0===i?void 0:i.isDirty)?g.SAVE:g.INSERT,"data-taskbar-owner":"master",dataUnit:this.dataUnit,resourceID:this.resourceID,customSlotId:"GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS",alignRigth:!0},e("slot",{name:"GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS"})))}async dataUnitActionHandler(i){var t;switch(i.type){case d.EDITION_CANCELED:case d.DATA_SAVED:this.dataUnit.isMultipleEdition&&(this.exitViewer(),this.dataUnit.isMultipleEdition=!1);break;case d.FIELD_INVALIDATED:const e=this.getGuideName(null===(t=i.payload)||void 0===t?void 0:t.fieldName);await this.addErrorBadgeToGuide(e),await this.openGuideNavigator(e);break;case d.METADATA_LOADED:case d.MULTIPLE_EDITION_CHANGED:this.loadGuides(this.noGuideSelected())}}async addErrorBadgeToGuide(i){var t;this._guides=[...null===(t=this._guides)||void 0===t?void 0:t.map((t=>Object.assign(Object.assign({},t),{badge:this.getBadge(t,i)})))]}async openGuideNavigator(i){this.selectedGuide.id!==i&&await this._guideNavigator.openGuideNavidator()}getBadge(i,t){var e;return this.selectedGuide.id===t?null:t===i.id?"error":null!==(e=i.badge)&&void 0!==e?e:null}getGuideName(i){var t;for(const e of this._masterFormMetadata.getAllSheets()){const s=null===(t=e[1])||void 0===t?void 0:t.fields;for(const t of s)if(t.name===i)return e[0]}return""}getTitle(){var i,t;return null!==(t=null===(i=this.getCustomTitle)||void 0===i?void 0:i.call(this))&&void 0!==t?t:this.getMessage("snkCrud.title")}getTitleTooltip(){if(this.dataUnit.isMultipleEdition)return this.buildRecordIdsArray()}buildRecordIdsArray(){var i,t;const e=null!==(t=null===(i=this.dataUnit.getSelectionInfo())||void 0===i?void 0:i.records)&&void 0!==t?t:[];return 0===e.length?"[]":`[${e.map((i=>this.messagesBuilder.getMessage("snkCrud.title",i))).join(", ")}]`}componentDidLoad(){this.dataUnit.subscribe(this.dataUnitActionHandler.bind(this)),this.initKeyboardManager()}disconnectedCallback(){var i;null===(i=this._keyboardManager)||void 0===i||i.unbindAllShortcutKeys()}async initKeyboardManager(){this._keyboardManager=new o({propagate:!1,element:this._element}),this._keyboardManager.bind(w,(async()=>{this._mainForm&&await this._mainForm.showSearchField()}),{description:this.getMessage("snkSimpleCrud.findFields"),element:this._element})}render(){var i,t;if(null!=this._formEditorConfigManager)return e("snk-form-config",{ref:i=>this._container=i,tabindex:-1,dataUnit:this._formEditorDataUnit,messagesBuilder:this.messagesBuilder,configManager:this._formEditorConfigManager,onConfigClose:()=>this._formEditorConfigManager=null});if(!this.dataUnit||!this._configManager.isLoaded)return;this.loadTaskbarProcessor();const s=this._guides&&this._guides.length>1;return e("section",{class:"snk-guides-viewer",ref:i=>this._container=i,tabindex:-1},e("div",{class:"ez-row snk-guides-viewer__header"},e("div",{class:"snk-guides-viewer__header-breadcrumb ez-flex--align-items-center ez-flex-item--align-center ez-padding-left--large",key:"header"},e("ez-button",{onClick:()=>this.exitViewer(),title:this.getMessage("snkCrud.goBackTitle"),mode:"icon",iconName:"arrow_back",class:"ez-padding-right--medium",size:"small"}),e("div",{class:"ez-flex ez-flex--column ez-flex-item--auto"},e("h1",{class:"ez-title ez-title--primary ez-title--xlarge",title:this.getTitleTooltip()},this.getTitle()),(null===(i=this._breadcrumbItems)||void 0===i?void 0:i.length)>1&&e("div",{class:"ez-margin-top--extra-small"},e("ez-breadcrumb",Object.assign({items:this._breadcrumbItems,onSelectedItem:i=>this.onBreadcrumbClickHandler(null==i?void 0:i.detail)},{[h.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:`${h.getInternalIDInfo("breadcrumb")}`}))))),this.presentationMode!=k.SECONDARY&&this.buildTaskBar()),e("div",{class:"snk-guides-viewer__container"},s?e("ez-guide-navigator",{ref:i=>this._guideNavigator=i,class:"snk-guides-viewer__guide-navigator",items:this._guides,selectedId:this.selectedGuide?this.selectedGuide.id:void 0,onEzSelectionChange:i=>this.updateSelectedGuideHandler(i.detail)}):e("div",null),e("div",{class:"snk-guides-viewer__detail-container"},_.buildFixedForms({formConfig:this.masterFormConfig,formMetadata:this._masterFormMetadata,selectedForm:null===(t=this.selectedGuide)||void 0===t?void 0:t.id,dataUnit:this.dataUnit,recordsValidator:this.recordsValidator,fieldToFocus:this._fieldToGetFocus,onRequestClearFieldToFocus:this.clearFieldToFocusHandler.bind(this),propsCustomEditor:this._customEditors,fieldsProps:this._fieldsProps}),this.getContent())),e("snk-configurator",{ref:i=>this._snkConfigurator=i,viewMode:this.getConfigViewMode(),onConfigSelected:i=>this.changeConfigViewMode(i.detail),messagesBuilder:this.messagesBuilder,onOpenConfig:i=>this.openConfig(i.detail),resourceID:this.resourceID}))}get _element(){return r(this)}static get watchers(){return{dataUnit:["observeDataUnit"],dataState:["observeDataState"],masterFormConfig:["observeMasterFormConfig"]}}};var C;!function(i){i.FINISH_EDITION="snkGuideViewer.finish_edition",i.MUTIPLE_EDITION="snkGuideViewer.multiple_edition",i.REGULAR="snkGuideViewer.regular"}(C||(C={})),_.style=".sc-snk-guides-viewer-h{--snk-guides-viewer--space-large:var(--space--large, 24px);--snk-guides-viewer--space-small:var(--space--2xs, 8px);--snk-guides-viewer__header--min-height:68px;--snk-guides-viewer__header--z-index:var(--more-visible, 2);--snk-guides-viewer__header--background-color:var(--background--body, #fafcff);--snk-guides-viewer__guide-navigator--width:340px;display:block}snk-form-view.sc-snk-guides-viewer{width:100%}.snk-guides-viewer.sc-snk-guides-viewer{position:relative;padding-left:0px;padding-top:0px;padding-right:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__detail-container.sc-snk-guides-viewer{display:flex;row-gap:24px;flex-direction:column}.snk-guides-viewer__header.sc-snk-guides-viewer{position:sticky;align-items:center;top:0;z-index:var(--snk-guides-viewer__header--z-index);background-color:var(--snk-guides-viewer__header--background-color);min-height:var(--snk-guides-viewer__header--min-height);width:calc(100% + (var(--snk-guides-viewer--space-large) * 2));padding-left:var(--snk-guides-viewer--space-large);padding-right:var(--snk-guides-viewer--space-large);padding-top:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-small);margin-left:calc(var(--snk-guides-viewer--space-large) * -1);margin-right:calc(var(--snk-guides-viewer--space-large) * -1);margin-bottom:var(--snk-guides-viewer--space-small)}.snk-guides-viewer__header-breadcrumb.sc-snk-guides-viewer{width:25%;display:flex}.snk-guides-viewer__header-taskbar.sc-snk-guides-viewer{width:75%}.snk-guides-viewer__container.sc-snk-guides-viewer{display:grid;grid-template-columns:minmax(0, auto) minmax(0, 100%);height:100%;column-gap:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__guide-navigator.sc-snk-guides-viewer{position:sticky;top:calc(var(--snk-guides-viewer__header--min-height) + var(--snk-guides-viewer--space-small));height:calc(100vh - var(--snk-guides-viewer__header--min-height) - var(--snk-guides-viewer--space-large) - var(--snk-guides-viewer--space-small))}.snk-guides-viewer__guide-navigator[open].sc-snk-guides-viewer{width:var(--snk-guides-viewer__guide-navigator--width);max-width:var(--snk-guides-viewer__guide-navigator--width);min-width:var(--snk-guides-viewer__guide-navigator--width)}.snk-guides-viewer__detail-content.sc-snk-guides-viewer{min-height:100%;align-items:flex-start;align-content:flex-start}";export{_ as S}
1
+ import{r as i,c as t,h as e,F as s,g as r}from"./p-d8d8169b.js";import{ObjectUtils as n,StringUtils as a,Action as d,KeyboardManager as o,ElementIDUtils as h}from"@sankhyalabs/core";import{S as l}from"./p-658f67a5.js";import{buildFormMetadata as u,FormMetadata as v}from"@sankhyalabs/ezui/dist/collection/utils/form";import{T as c}from"./p-1a0caadb.js";import{T as g}from"./p-b987e15d.js";import{V as m}from"./p-9019a32f.js";import"./p-d75a732c.js";import"./p-bf017a1f.js";import{P as k}from"./p-0f3698af.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-9062d640.js";import"./p-ff1990ad.js";import"./p-8d256def.js";import{SelectionMode as p}from"@sankhyalabs/core/dist/dataunit/DataUnit";import{buildFieldSearch as f,SHORTCUT_SEARCH_FIELD as w}from"@sankhyalabs/ezui/dist/collection/utils";const b="__FORM:",_=class{constructor(e){i(this,e),this.snkMasterFormConfigChange=t(this,"snkMasterFormConfigChange",7),this.exit=t(this,"exit",7),this.actionClick=t(this,"actionClick",7),this.formItemsReady=t(this,"formItemsReady",7),this._guideBuilders=new Map,this.dataUnit=void 0,this.dataState=void 0,this.configName=void 0,this.entityPath=void 0,this.actionsList=void 0,this.recordsValidator=void 0,this.masterFormConfig=void 0,this.selectedGuide=void 0,this.taskbarManager=void 0,this.messagesBuilder=void 0,this.canEdit=!0,this.presentationMode=void 0,this.resourceID=void 0,this.detailTaskbarCustomContainerId=void 0,this.formLegacyConfigName=void 0,this.enableGridInsert=!1,this.ignoreReadOnlyFormFields=void 0,this.getCustomTitle=void 0,this._hasToCreateFieldSearch=!0,this._breadcrumbItems=[],this._guides=void 0,this._formEditorConfigManager=void 0,this._formEditorDataUnit=void 0,this._fieldToGetFocus=void 0,this._customEditors=void 0,this._customRenders=void 0,this._fieldsProps={},this._mainForm=void 0}observeDataUnit(){this.loadGuides(!0)}observeDataState(i,t){var e,s,r,a,d,o;const h=null!==(s=null===(e=null==i?void 0:i.selectionInfo)||void 0===e?void 0:e.recordIds)&&void 0!==s?s:null===(r=null==i?void 0:i.selectedRecord)||void 0===r?void 0:r.__record__id__,l=null!==(d=null===(a=null==t?void 0:t.selectionInfo)||void 0===a?void 0:a.recordIds)&&void 0!==d?d:null===(o=null==t?void 0:t.selectedRecord)||void 0===o?void 0:o.__record__id__;n.equals(h,l)||this.loadGuides((null==t?void 0:t.insertionMode)!=(null==i?void 0:i.insertionMode))}observeMasterFormConfig(){this.loadGuides(this.noGuideSelected()),this.snkMasterFormConfigChange.emit(this.masterFormConfig)}async showFormConfig(i=!1){const t=!i||null==this._currentDetail;this._formEditorConfigManager=t?this._configManager:this._currentDetail.formConfigManager,this._formEditorDataUnit=t?this.dataUnit:this._currentDetail.dataUnit}async addCustomEditor(i,t){this._customEditors=Object.assign(Object.assign({},this._customEditors),{[i]:t})}async addGridCustomRender(i,t){this._customRenders=Object.assign(Object.assign({},this._customRenders),{[i]:t})}async setFieldProp(i,t,e){const s={[i]:Object.assign(Object.assign({},this._fieldsProps[i]),{[t]:e})};this._fieldsProps=Object.assign(Object.assign({},this._fieldsProps),s)}async setFocus(){this._container.focus()}exitViewer(){!this.enableGridInsert&&this.dataUnit.isDirty()?this.dataUnit.cancelEdition({after:()=>this.exit.emit()}):this.exit.emit()}onActionClick(i){i.detail===g.CONFIGURATOR&&"master"!=i.target.dataset.taskbarOwner&&(this._snkConfigurator.open(),i.stopImmediatePropagation(),i.stopPropagation())}onContentCardChanged(i){_.updateContentCard(i.detail.formName,i.detail.cardConfig,i.detail.propertyChanged,this._configManager).then((()=>this.masterFormConfig=this._configManager.getConfig(this.dataUnit)))}getMessage(i){var t,e;if(this.dataUnit.isMultipleEdition){const i=null!==(e=null===(t=this.dataUnit.getSelectionInfo())||void 0===t?void 0:t.records)&&void 0!==e?e:[];return this.messagesBuilder.getMessage("snkCrud.multipleEdition.editing",{COUNT:i.length})}return this.messagesBuilder.getMessage(i,this.dataUnit.getSelectedRecord())}loadGuides(i){if(!this.dataUnit)return;if(!this._configManager.isLoaded)return;this._masterFormMetadata=u(this.masterFormConfig,this.dataUnit,!0);const t=this._masterFormMetadata.getAllSheets(),e=this.dataUnit.getSelectedRecord(),s=this.hasToDisableDetails(e),r=[];Array.from(t.values()).forEach((i=>{const t={id:i.name,label:i.label};this.isDetail(i.name)&&s&&(t.tooltip=this.getMessage("snkCrud.detail.tooltip.needSingleSelection"),t.disabled=!0),r.push(t)})),this._guides=r,this._guideNavigator&&this._guideNavigator.updateItem(this._guides),i&&(this.selectedGuide=this._guides.length>0?this._guides[0]:void 0)}hasToDisableDetails(i){return!i||this.dataUnit.isNewRecord(i.__record__id__)||this.dataUnit.isMultipleEdition}isDetail(i){return null!=v.getDetailName(i)}updateGuide(i){this._guideBuilders.set(i.id,i);const t=i.buildGuideItem(this._guideBuilders);this._guideNavigator&&(this._guideNavigator.updateItem(t).then((()=>{this._guideNavigator.getCurrentPath().then((i=>{this._breadcrumbItems=i}))})),this._guides=this._guides.map((i=>i.id===t.id?Object.assign(Object.assign(Object.assign({},i),t),void 0!==t.children?{}:{children:void 0}):i)))}getTaskBarId(){var i;return(null===(i=this.dataState)||void 0===i?void 0:i.isDirty)?C.FINISH_EDITION:this.dataUnit.isMultipleEdition?C.MUTIPLE_EDITION:C.REGULAR}loadTaskbarProcessor(){const i={};i[C.REGULAR]=this.buildBtnsRegularMode(),i[C.FINISH_EDITION]=[g.CANCEL,g.SAVE,this.handleAddGridMode()],i[C.MUTIPLE_EDITION]=[g.CANCEL],this._taskbarProcessor=new c(i),this._taskbarProcessor.process(this.getTaskBarId(),this.taskbarManager,this.dataState,this.buildDisabledButtons(),this.buildInvisibleButtons())}buildBtnsRegularMode(){var i,t;const e=[g.ATTACH,g.CLONE,g.REMOVE,g.MORE_OPTIONS,g.ACTIONS_BUTTON,g.DIVIDER,g.GRID_MODE,g.CONFIGURATOR];return(null===(t=null===(i=this.dataState)||void 0===i?void 0:i.selectionInfo)||void 0===t?void 0:t.length)<=1&&e.unshift(g.PREVIOUS,g.NEXT,g.DIVIDER),this.presentationMode==k.SECONDARY?e.unshift(g.INSERT):e.push(g.INSERT),e}buildDisabledButtons(){var i,t,e,s,r,n;const a=[];return(null===(i=this.dataState)||void 0===i?void 0:i.hasPrevious)||a.push(g.PREVIOUS),(null===(t=this.dataState)||void 0===t?void 0:t.hasNext)||a.push(g.NEXT),(null===(s=null===(e=this.dataState)||void 0===e?void 0:e.selectionInfo)||void 0===s?void 0:s.length)>1&&a.push(g.CLONE),(null===(n=null===(r=this.dataState)||void 0===r?void 0:r.selectionInfo)||void 0===n?void 0:n.isAllRecords())&&a.push(g.REMOVE),a}handleAddGridMode(){return this.enableGridInsert?g.GRID_MODE:""}buildInvisibleButtons(){const i=[];return this.dataState&&this.dataState.selectionInfo.mode===p.ALL_RECORDS&&i.push(g.ACTIONS_BUTTON),i}static updateContentCard(i,t,e,s){return s.saveCardState(i,t,e)}static buildFixedForms(i){var t;const r=null===(t=i.formConfig)||void 0===t?void 0:t.cardsState;if(null!=r)return e(s,null,Array.from(r.entries()).filter((([t,e])=>(null==e?void 0:e.fixed)&&t!=i.selectedForm)).sort((([,i],[,t])=>((null==i?void 0:i.fixSequence)||0)-((null==t?void 0:t.fixSequence)||0))).map((([t,s])=>{var r,n;const a=i.formMetadata.getSheet(t);if(null!=a)return e("snk-form-view",{levelPath:i.levelPath,label:a.label,name:t,fields:a.fields,formMetadata:i.formMetadata,dataUnit:i.dataUnit,recordsValidator:i.recordsValidator,contracted:"CONTRACTED"===(null==s?void 0:s.presentation),fixed:null==s?void 0:s.fixed,summaryFields:null===(n=null===(r=i.formConfig)||void 0===r?void 0:r.summary)||void 0===n?void 0:n.get(t),fieldToFocus:i.fieldToFocus,key:t,onSnkRequestClearFieldToFocus:()=>{var t;return null===(t=i.onRequestClearFieldToFocus)||void 0===t?void 0:t.call(i)},customEditors:i.propsCustomEditor,fieldsProps:i.fieldsProps})})))}wrapDetail(i,t){if(0===i.length)return t;const s=i.pop(),r=v.getDetailName(s);return r?this.wrapDetail(i,e("snk-data-unit",{dataUnitName:`${this.getDataUnitName(i,r)}`,entityName:r},t)):void 0}getDataUnitName(i,t){if(i.length>0){const e=i.map((i=>v.getDetailName(i)));return`${this.entityPath}/${e.join("/")}/${t}`}return`${this.entityPath}/${t}`}getContent(){var i,t,s,r,n;if(!this.selectedGuide)return;const a=this.selectedGuide.id;let d;const o=a.split("::"),h=o.pop(),l=v.getDetailName(h);let u=a;if(l||o.length>0){let t,s;if(a.includes(b)){[u,t]=a.split(b);const e=(null===(i=this._breadcrumbItems)||void 0===i?void 0:i.length)||0;s=e>1?this._breadcrumbItems[e-2]:this.selectedGuide}else s=this.selectedGuide;d=this.wrapDetail(o,e("snk-detail-view",{ref:i=>this._currentDetail=i,dataUnitName:this.getDataUnitName(o,l),onSnkDetailGuidesChange:i=>this.updateGuide(i.detail),entityName:l,selectedForm:t,branchGuide:s,guideItemPath:this._breadcrumbItems,key:`detail${u}`,canEdit:this.canEdit,onSnkSwitchGuide:i=>this._guideNavigator.selectGuide(i.detail),resourceID:this.resourceID,taskbarCustomContainerId:this.detailTaskbarCustomContainerId,customEditors:this._customEditors,customRenders:this._customRenders,presentationMode:this.presentationMode}))}else{const i=this.selectedGuide.id,o=this._masterFormMetadata.getSheet(i);if(o){const h=null===(s=null===(t=this.masterFormConfig)||void 0===t?void 0:t.cardsState)||void 0===s?void 0:s.get(i);d=e("snk-form-view",{ref:i=>this._mainForm=i,fixed:null==h?void 0:h.fixed,summaryFields:null===(n=null===(r=this.masterFormConfig)||void 0===r?void 0:r.summary)||void 0===n?void 0:n.get(i),name:i,label:o.label,fields:o.fields,dataUnit:this.dataUnit,formMetadata:this._masterFormMetadata,recordsValidator:this.recordsValidator,fieldToFocus:this._fieldToGetFocus,key:a,onSnkRequestClearFieldToFocus:()=>this.clearFieldToFocusHandler(),customEditors:this._customEditors,fieldsProps:this._fieldsProps,fieldSearch:this._fieldSearch},this.presentationMode==k.SECONDARY&&this.buildTaskBar())}}return d}onBreadcrumbClickHandler(i){null!=(null==i?void 0:i.id)&&this._guideNavigator.selectGuide(i.id)}updateSelectedGuideHandler(i){this._guideHasChanged=this.selectedGuide!=i,this.selectedGuide=i,this._guideNavigator.getCurrentPath().then((i=>{this._breadcrumbItems=i})),this.resetGuideBadge(i)}changeGuideHandler(i){var t;null===(t=this._guideNavigator)||void 0===t||t.selectGuide(i)}clearFieldToFocusHandler(){this._fieldToGetFocus=void 0}resetGuideBadge(i){var t;this._guides=[...null===(t=this._guides)||void 0===t?void 0:t.map((t=>this.canClearGuideBadge(t,i.id)?Object.assign(Object.assign({},t),{badge:null}):t))]}canClearGuideBadge(i,t){return i.id===t||this.isIncludedInChildrenList(i,t)}isIncludedInChildrenList(i,t){return this.hasChildren(i)&&this.getChildrenIdList(i).includes(t)}hasChildren(i){return i.children&&Array.isArray(i.children)}getChildrenIdList(i){return i.children.map((i=>i.id))}getConfigViewMode(){return m.GRID}changeConfigViewMode(i){this._currentDetail&&this._currentDetail.changeViewMode(i)}openConfig(i){this._snkConfigurator.close(),this._currentDetail&&(i===m.FORM?this.showFormConfig(!0):this._currentDetail.configGrid())}noGuideSelected(){var i;return void 0===this.selectedGuide||"__main"===(null===(i=this.selectedGuide)||void 0===i?void 0:i.id)}addFormLegacyConfigName(){this.formLegacyConfigName&&this._configManager.addFormLegacyConfig(this.formLegacyConfigName)}setMasterFormConfig(i){this.masterFormConfig=i}componentWillLoad(){if(null==this.resourceID)throw new Error(this.getMessage("snkCrud.errors.resourceIDNotProvided"));this._configManager=new l(this.configName,this.resourceID,this.setMasterFormConfig.bind(this),this.dataUnit),this.addFormLegacyConfigName(),this._configManager.loadConfig()}componentDidRender(){this._guideHasChanged&&(this._currentDetail?this._currentDetail.showUp():this._mainForm&&this._mainForm.showUp(),this._guideHasChanged=!1)}getFieldsSearch(i){return(null==this._fieldSearch||this._hasToCreateFieldSearch)&&(this._hasToCreateFieldSearch=!1,this._fieldSearch=f(i,(({argument:i})=>this.fieldsOptionLoader(i)),(i=>this.onSelectField(i)))),this._fieldSearch}fieldsOptionLoader(i){return Promise.resolve(this._configManager.getFieldsList(i).map((i=>({value:i.name,label:i.label}))))}onSelectField(i){if(null==i)return;this._fieldToGetFocus=i.value;const t=this.getGuideName(i.value);t!==this.selectedGuide.id&&this.changeGuideHandler(t)}getActionsList(){var i;return[].concat(null!=this.taskbarManager&&null!=this.taskbarManager.getMoreOptions?null!==(i=this.taskbarManager.getMoreOptions(this.getTaskBarId(),this.configName,this.dataState,this.actionsList))&&void 0!==i?i:[]:this.actionsList)}getSettingsListForm(){return[{value:a.generateUUID(),label:this.getMessage("snkCrud.findColumn"),disableCloseOnSelect:!0,eagerInitialize:!0,itemBuilder:(i,t)=>this.getFieldsSearch(t)}]}buildTaskBar(){var i;return e("div",{class:"snk-guides-viewer__header-taskbar "+(this.presentationMode!=k.SECONDARY?"ez-align--right":"ez-padding-bottom--medium")},e("snk-taskbar",{key:"guideViewerTaskbar","data-element-id":"guideViewer",configName:this.configName,buttons:this._taskbarProcessor.buttons,disabledButtons:this._taskbarProcessor.disabledButtons,customButtons:this._taskbarProcessor.customButtons,actionsList:this.getActionsList(),actionsSettingsList:this.getSettingsListForm(),messagesBuilder:this.messagesBuilder,presentationMode:this.presentationMode,primaryButton:(null===(i=this.dataState)||void 0===i?void 0:i.isDirty)?g.SAVE:g.INSERT,"data-taskbar-owner":"master",dataUnit:this.dataUnit,resourceID:this.resourceID,customSlotId:"GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS",alignRigth:!0},e("slot",{name:"GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS"})))}async dataUnitActionHandler(i){var t;switch(i.type){case d.EDITION_CANCELED:case d.DATA_SAVED:this.dataUnit.isMultipleEdition&&(this.exitViewer(),this.dataUnit.isMultipleEdition=!1);break;case d.FIELD_INVALIDATED:const e=this.getGuideName(null===(t=i.payload)||void 0===t?void 0:t.fieldName);await this.addErrorBadgeToGuide(e),await this.openGuideNavigator(e);break;case d.METADATA_LOADED:case d.MULTIPLE_EDITION_CHANGED:this.loadGuides(this.noGuideSelected())}}async addErrorBadgeToGuide(i){var t;this._guides=[...null===(t=this._guides)||void 0===t?void 0:t.map((t=>Object.assign(Object.assign({},t),{badge:this.getBadge(t,i)})))]}async openGuideNavigator(i){this.selectedGuide.id!==i&&await this._guideNavigator.openGuideNavidator()}getBadge(i,t){var e;return this.selectedGuide.id===t?null:t===i.id?"error":null!==(e=i.badge)&&void 0!==e?e:null}getGuideName(i){var t;for(const e of this._masterFormMetadata.getAllSheets()){const s=null===(t=e[1])||void 0===t?void 0:t.fields;for(const t of s)if(t.name===i)return e[0]}return""}getTitle(){var i,t;return null!==(t=null===(i=this.getCustomTitle)||void 0===i?void 0:i.call(this))&&void 0!==t?t:this.getMessage("snkCrud.title")}getTitleTooltip(){if(this.dataUnit.isMultipleEdition)return this.buildRecordIdsArray()}buildRecordIdsArray(){var i,t;const e=null!==(t=null===(i=this.dataUnit.getSelectionInfo())||void 0===i?void 0:i.records)&&void 0!==t?t:[];return 0===e.length?"[]":`[${e.map((i=>this.messagesBuilder.getMessage("snkCrud.title",i))).join(", ")}]`}componentDidLoad(){this.dataUnit.subscribe(this.dataUnitActionHandler.bind(this)),this.initKeyboardManager()}disconnectedCallback(){var i;null===(i=this._keyboardManager)||void 0===i||i.unbindAllShortcutKeys()}async initKeyboardManager(){this._keyboardManager=new o({propagate:!1,element:this._element}),this._keyboardManager.bind(w,(async()=>{this._mainForm&&await this._mainForm.showSearchField()}),{description:this.getMessage("snkSimpleCrud.findFields"),element:this._element})}render(){var i,t;if(null!=this._formEditorConfigManager)return e("snk-form-config",{ref:i=>this._container=i,tabindex:-1,dataUnit:this._formEditorDataUnit,messagesBuilder:this.messagesBuilder,configManager:this._formEditorConfigManager,onConfigClose:()=>this._formEditorConfigManager=null});if(!this.dataUnit||!this._configManager.isLoaded)return;this.loadTaskbarProcessor();const s=this._guides&&this._guides.length>1;return e("section",{class:"snk-guides-viewer",ref:i=>this._container=i,tabindex:-1},e("div",{class:"ez-row snk-guides-viewer__header"},e("div",{class:"snk-guides-viewer__header-breadcrumb ez-flex--align-items-center ez-flex-item--align-center ez-padding-left--large",key:"header"},e("ez-button",{onClick:()=>this.exitViewer(),title:this.getMessage("snkCrud.goBackTitle"),mode:"icon",iconName:"arrow_back",class:"ez-padding-right--medium",size:"small"}),e("div",{class:"ez-flex ez-flex--column ez-flex-item--auto"},e("h1",{class:"ez-title ez-title--primary ez-title--xlarge",title:this.getTitleTooltip()},this.getTitle()),(null===(i=this._breadcrumbItems)||void 0===i?void 0:i.length)>1&&e("div",{class:"ez-margin-top--extra-small"},e("ez-breadcrumb",Object.assign({items:this._breadcrumbItems,onSelectedItem:i=>this.onBreadcrumbClickHandler(null==i?void 0:i.detail)},{[h.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:`${h.getInternalIDInfo("breadcrumb")}`}))))),this.presentationMode!=k.SECONDARY&&this.buildTaskBar()),e("div",{class:"snk-guides-viewer__container"},s?e("ez-guide-navigator",{ref:i=>this._guideNavigator=i,class:"snk-guides-viewer__guide-navigator",items:this._guides,selectedId:this.selectedGuide?this.selectedGuide.id:void 0,onEzSelectionChange:i=>this.updateSelectedGuideHandler(i.detail)}):e("div",null),e("div",{class:"snk-guides-viewer__detail-container"},_.buildFixedForms({formConfig:this.masterFormConfig,formMetadata:this._masterFormMetadata,selectedForm:null===(t=this.selectedGuide)||void 0===t?void 0:t.id,dataUnit:this.dataUnit,recordsValidator:this.recordsValidator,fieldToFocus:this._fieldToGetFocus,onRequestClearFieldToFocus:this.clearFieldToFocusHandler.bind(this),propsCustomEditor:this._customEditors,fieldsProps:this._fieldsProps}),this.getContent())),e("snk-configurator",{ref:i=>this._snkConfigurator=i,viewMode:this.getConfigViewMode(),onConfigSelected:i=>this.changeConfigViewMode(i.detail),messagesBuilder:this.messagesBuilder,onOpenConfig:i=>this.openConfig(i.detail),resourceID:this.resourceID}))}get _element(){return r(this)}static get watchers(){return{dataUnit:["observeDataUnit"],dataState:["observeDataState"],masterFormConfig:["observeMasterFormConfig"]}}};var C;!function(i){i.FINISH_EDITION="snkGuideViewer.finish_edition",i.MUTIPLE_EDITION="snkGuideViewer.multiple_edition",i.REGULAR="snkGuideViewer.regular"}(C||(C={})),_.style=".sc-snk-guides-viewer-h{--snk-guides-viewer--space-large:var(--space--large, 24px);--snk-guides-viewer--space-small:var(--space--2xs, 8px);--snk-guides-viewer__header--min-height:68px;--snk-guides-viewer__header--z-index:var(--more-visible, 2);--snk-guides-viewer__header--background-color:var(--background--body, #fafcff);--snk-guides-viewer__guide-navigator--width:340px;display:block}snk-form-view.sc-snk-guides-viewer{width:100%}.snk-guides-viewer.sc-snk-guides-viewer{position:relative;padding-left:0px;padding-top:0px;padding-right:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__detail-container.sc-snk-guides-viewer{display:flex;row-gap:24px;flex-direction:column}.snk-guides-viewer__header.sc-snk-guides-viewer{position:sticky;align-items:center;top:0;z-index:var(--snk-guides-viewer__header--z-index);background-color:var(--snk-guides-viewer__header--background-color);min-height:var(--snk-guides-viewer__header--min-height);width:calc(100% + (var(--snk-guides-viewer--space-large) * 2));padding-left:var(--snk-guides-viewer--space-large);padding-right:var(--snk-guides-viewer--space-large);padding-top:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-small);margin-left:calc(var(--snk-guides-viewer--space-large) * -1);margin-right:calc(var(--snk-guides-viewer--space-large) * -1);margin-bottom:var(--snk-guides-viewer--space-small)}.snk-guides-viewer__header-breadcrumb.sc-snk-guides-viewer{width:25%;display:flex}.snk-guides-viewer__header-taskbar.sc-snk-guides-viewer{width:75%}.snk-guides-viewer__container.sc-snk-guides-viewer{display:grid;grid-template-columns:minmax(0, auto) minmax(0, 100%);height:100%;column-gap:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__guide-navigator.sc-snk-guides-viewer{position:sticky;top:calc(var(--snk-guides-viewer__header--min-height) + var(--snk-guides-viewer--space-small));height:calc(100vh - var(--snk-guides-viewer__header--min-height) - var(--snk-guides-viewer--space-large) - var(--snk-guides-viewer--space-small))}.snk-guides-viewer__guide-navigator[open].sc-snk-guides-viewer{width:var(--snk-guides-viewer__guide-navigator--width);max-width:var(--snk-guides-viewer__guide-navigator--width);min-width:var(--snk-guides-viewer__guide-navigator--width)}.snk-guides-viewer__detail-content.sc-snk-guides-viewer{min-height:100%;align-items:flex-start;align-content:flex-start}";export{_ as S}
Binary file
@@ -1,4 +1,4 @@
1
- import{UserInterface as e,DataType as t,ApplicationContext as n,ErrorException as i}from"@sankhyalabs/core";import{d as o,D as r}from"./p-65517fcf.js";function a(e){const t=(n=e.fieldsMetadata)&&n.length?n.map((e=>({name:e.fieldName,label:e.description,dataType:u(e.type),userInterface:l(e),properties:s(e)}))):[];var n;return{label:e.entityDescription,name:e.descriptionField,fields:t}}function s(e){const t={};return t.options=function(e){const t=e.options;if(!t)return;const n=[];return Object.keys(t).forEach((e=>{n.push({label:e,value:t[e]})})),n}(e),t.mask=function(e){const t=e.uiType;return t?String(t).toLowerCase():void 0}(e),t}function l(t){const n=t.options;return n&&Object.keys(n).length>0?e.OPTIONSELECTOR:"D"===t.type?e.DATE:"H"===t.type?e.DATETIME:"T"===t.type?e.TIME:"I"===t.type?e.INTEGERNUMBER:void 0}function u(e){switch(e){case"F":case"I":return t.NUMBER;case"D":case"H":return t.DATE;case"B":return t.OBJECT;default:return t.TEXT}}function c(e){return Object.assign({id:e.codigo,label:`${e.caminho} - ${e.descricao}`,bold:"N"===e.analitico,props:{analitico:"S"===e.analitico}},e.no&&{children:e.no.map(c)})}var d,v,f;!function(e){e[e.GRID=0]="GRID",e[e.CARDS=1]="CARDS",e[e.TREE=2]="TREE"}(d||(d={}));class m{constructor(){this._defaultPageSize=100,this._templateByQuery=new Map,this._searchListenersByDataUnit=new Map,this.buldTemplates()}buldTemplates(){this._templateByQuery.set("search",o.gql`query($entityName: String! $argument: String $criteria: InputSearchCriteria $options: InputSearchOptions) {
1
+ import{UserInterface as e,DataType as t,ApplicationContext as n,ErrorException as i}from"@sankhyalabs/core";import{d as o,D as r}from"./p-d75a732c.js";function a(e){const t=(n=e.fieldsMetadata)&&n.length?n.map((e=>({name:e.fieldName,label:e.description,dataType:u(e.type),userInterface:l(e),properties:s(e)}))):[];var n;return{label:e.entityDescription,name:e.descriptionField,fields:t}}function s(e){const t={};return t.options=function(e){const t=e.options;if(!t)return;const n=[];return Object.keys(t).forEach((e=>{n.push({label:e,value:t[e]})})),n}(e),t.mask=function(e){const t=e.uiType;return t?String(t).toLowerCase():void 0}(e),t}function l(t){const n=t.options;return n&&Object.keys(n).length>0?e.OPTIONSELECTOR:"D"===t.type?e.DATE:"H"===t.type?e.DATETIME:"T"===t.type?e.TIME:"I"===t.type?e.INTEGERNUMBER:void 0}function u(e){switch(e){case"F":case"I":return t.NUMBER;case"D":case"H":return t.DATE;case"B":return t.OBJECT;default:return t.TEXT}}function c(e){return Object.assign({id:e.codigo,label:`${e.caminho} - ${e.descricao}`,bold:"N"===e.analitico,props:{analitico:"S"===e.analitico}},e.no&&{children:e.no.map(c)})}var d,v,f;!function(e){e[e.GRID=0]="GRID",e[e.CARDS=1]="CARDS",e[e.TREE=2]="TREE"}(d||(d={}));class m{constructor(){this._defaultPageSize=100,this._templateByQuery=new Map,this._searchListenersByDataUnit=new Map,this.buldTemplates()}buldTemplates(){this._templateByQuery.set("search",o.gql`query($entityName: String! $argument: String $criteria: InputSearchCriteria $options: InputSearchOptions) {
2
2
  $queryAlias$: search(entityName: $entityName argument: $argument criteria: $criteria options: $options){
3
3
  value
4
4
  label
@@ -1,4 +1,4 @@
1
- import{R as e,F as t}from"./p-51209229.js";import{D as i,d as s}from"./p-65517fcf.js";import{F as r}from"./p-ff1990ad.js";import{ObjectUtils as a}from"@sankhyalabs/core";var n;function l(e,t){if(null==e)return e;if(e instanceof Date)return e.toISOString();if("object"==typeof e){if(e instanceof Array)return e.map((e=>l(r.MULTI_LIST===t?function(e,t){var i={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(i[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(e);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(e,s[r])&&(i[s[r]]=e[s[r]])}return i}(e,["label"]):e)));{const i=Object.assign({},e);return Object.keys(e).forEach((s=>{void 0!==e[s]?i[s]=l(e[s],t):delete i[s]})),i}}return e}class o{constructor(){this.DEFAULT_RESOURCE="_default",this.templateByQuery=new Map,this.buildTemplates()}resolveURI(e,t,i){let s="filter-assistent-config://"+e;return t&&(s+="."+t),i&&(s+=this.DEFAULT_RESOURCE),s}resolveLegacyConfigName(e,t){if(!e)return"";let i=`?legacyResourceID=${e}`;return t&&(i+=this.DEFAULT_RESOURCE),i}buildTemplates(){this.templateByQuery.set("fetchFilterFields",s.gql`
1
+ import{R as e,F as t}from"./p-8d256def.js";import{D as i,d as s}from"./p-d75a732c.js";import{F as r}from"./p-ff1990ad.js";import{ObjectUtils as a}from"@sankhyalabs/core";var n;function l(e,t){if(null==e)return e;if(e instanceof Date)return e.toISOString();if("object"==typeof e){if(e instanceof Array)return e.map((e=>l(r.MULTI_LIST===t?function(e,t){var i={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(i[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(e);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(e,s[r])&&(i[s[r]]=e[s[r]])}return i}(e,["label"]):e)));{const i=Object.assign({},e);return Object.keys(e).forEach((s=>{void 0!==e[s]?i[s]=l(e[s],t):delete i[s]})),i}}return e}class o{constructor(){this.DEFAULT_RESOURCE="_default",this.templateByQuery=new Map,this.buildTemplates()}resolveURI(e,t,i){let s="filter-assistent-config://"+e;return t&&(s+="."+t),i&&(s+=this.DEFAULT_RESOURCE),s}resolveLegacyConfigName(e,t){if(!e)return"";let i=`?legacyResourceID=${e}`;return t&&(i+=this.DEFAULT_RESOURCE),i}buildTemplates(){this.templateByQuery.set("fetchFilterFields",s.gql`
2
2
  query($name: String!) {
3
3
  $queryAlias$: fetchFilterFields(name: $name){
4
4
  currentLink {
@@ -1 +1 @@
1
- import{r as t,c as i,h as e}from"./p-d8d8169b.js";import{ApplicationContext as a,DataType as s,Action as n,UserInterface as o,StringUtils as r,DataUnitLoaderUtils as l,DataUnit as d}from"@sankhyalabs/core";import{D as h,S as c}from"./p-65517fcf.js";import{S as v}from"./p-7535d592.js";import"./p-0f3698af.js";import{P as u,D as m,I as A}from"./p-e63cc25f.js";import"./p-ff1990ad.js";import"./p-51209229.js";import{V as O}from"./p-9019a32f.js";import{A as p}from"./p-dc8bb41f.js";import{T as w}from"./p-b987e15d.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";import"./p-55798617.js";class k{constructor(t){this.dataUnitName=t}async save({dataUnit:t,record:i,updatingFields:e,operation:a}){var s,n;const o="INSERT"==a,r=o?e:i;if(!o&&(null==e?void 0:e.DESCRICAO)&&(null==e?void 0:e.DESCRICAO)!==(null==i?void 0:i.DESCRICAO))throw new Error(v.DESCRIPTION_CANNOT_BE_CHANGED);const l={anexo:{codata:o?null==e?void 0:e.REGISTER_KEY:null==i?void 0:i.CODATA,sequencia:(null==r?void 0:r.SEQUENCIA)||"0",tipo:(null==r?void 0:r.TIPO)||"N",descricao:null==r?void 0:r.DESCRICAO,arquivo:null===(n=null===(s=e.CAMINHO_ARQUIVO)||void 0===s?void 0:s[0])||void 0===n?void 0:n.name,ehInclusao:o?"S":"N",ehArquivoRepositorio:"N"}};return new Promise(((i,a)=>{h.get().callServiceBroker("Attach.save",JSON.stringify(l)).then((a=>{var s;return i([Object.assign(Object.assign(Object.assign({},a),e),{__owner__dataunit__name__:null!==(s=this.dataUnitName)&&void 0!==s?s:t})])})).catch((t=>a(t)))}))}async edit(t){throw new Error("Method not implemented.")}async delete(t){var i={anexo:{codata:t.CODATA,tipo:t.TIPO,descricao:t.DESCRICAO}};const e=await h.get().callServiceBroker("Attach.remove",JSON.stringify(i));return Promise.resolve(e)}async getDownloadKey(t){var i,e,a;if("S"==t.EHARQUIVOREPOSITORIO){const a={config:{path:t.ARQUIVO,tipoconteudo:t.TIPOCONTEUDO}},s=await h.get().callServiceBroker("RepositorioArquivoSP.abreArquivo",JSON.stringify(a));return Promise.resolve({chave:{valor:null===(e=null===(i=null==s?void 0:s.responseBody)||void 0===i?void 0:i.chave)||void 0===e?void 0:e.valor}})}const s={anexo:{codata:t.CODATA,codemp:t.CODEMP,sequencia:t.SEQUENCIA,tipo:t.TIPO,descricao:t.DESCRICAO,tipoConteudo:t.TIPOCONTEUDO}},n=await h.get().callServiceBroker("Attach.view",JSON.stringify(s));return(null==n?void 0:n.chaveAnexo)?Promise.resolve({chave:{valor:null===(a=null==n?void 0:n.chaveAnexo)||void 0===a?void 0:a.idChaveAnexo}}):Promise.reject(new Error("File not found."))}}const S="AnexoSistemaSP.salvar",I="AnexoSistemaSP.excluir",f="AnexoSistemaSP.baixar";class y{constructor(t,i){var e;this.entityName=t,this.dataUnitName=i,this.validateFields=t=>{if(t.LINK&&t.NOMEARQUIVO)throw new Error(v.LINK_AND_FILE_AT_THE_SAME_TIME);if(!t.LINK&&!t.NOMEARQUIVO)throw new Error(v.ANY_LINK_OR_FILE_FILLED);if(!this._registerKey)throw new Error("Register key can not be null")},this.resourceID=window.resourceID||(null===(e=window.workspace)||void 0===e?void 0:e.resourceID)}set registerKey(t){this._registerKey=t}async save(t){var i,e;let{updatingFields:a}=t;a=Object.assign(Object.assign({},a),{NOMEARQUIVO:null===(i=a.NOMEARQUIVO)||void 0===i?void 0:i[0]});try{this.validateFields(a);const t=a.LINK?null:a.NOMEARQUIVO,i={serviceName:S,requestBody:{params:{resourceID:this.resourceID,description:a.DESCRICAO,fileSelect:t?1:0,keySession:null===(e=null==t?void 0:t.properties)||void 0===e?void 0:e.fileNameTmp,nameAttach:null==t?void 0:t.name,link:a.LINK,nameEntity:this.entityName,pkEntity:this._registerKey,typeAcess:a.TIPOACESSO,typeApres:a.TIPOAPRES}}},s=await h.get().callServiceBroker(S,JSON.stringify(i));return Promise.resolve([Object.assign(Object.assign(Object.assign({},s),a),{ARQUIVOOULINK:a.LINK?a.LINK:null==t?void 0:t.name,__owner__dataunit__name__:this.dataUnitName})])}catch(t){return Promise.reject(t)}}async edit(t){var i,e,a;let{updatingFields:s,record:n}=t;const o=t=>void 0!==s[t]?s[t]:n[t],r=o("NOMEARQUIVO"),l=null===(e=null===(i=s.NOMEARQUIVO)||void 0===i?void 0:i[0])||void 0===e?void 0:e.downloadURL;s=Object.assign(Object.assign({},s),{DESCRICAO:o("DESCRICAO"),LINK:o("LINK"),TIPOACESSO:o("TIPOACESSO"),TIPOAPRES:o("TIPOAPRES"),CHAVEARQUIVO:n.CHAVEARQUIVO,NOMEARQUIVO:null==r?void 0:r[0]});const d=s.LINK?null:s.NOMEARQUIVO;try{this.validateFields(s);const t={serviceName:S,requestBody:{params:{resourceID:this.resourceID,nuAttach:null==n?void 0:n.NUATTACH,description:s.DESCRICAO,fileSelect:l?1:0,keySession:null===(a=null==d?void 0:d.properties)||void 0===a?void 0:a.fileNameTmp,keyAttach:s.CHAVEARQUIVO,nameAttach:null==d?void 0:d.name,link:s.LINK,nameEntity:this.entityName,pkEntity:this._registerKey,typeAcess:s.TIPOACESSO,typeApres:s.TIPOAPRES}}},i=await h.get().callServiceBroker(S,JSON.stringify(t));return Promise.resolve([Object.assign(Object.assign(Object.assign({},i),s),{ARQUIVOOULINK:s.LINK?s.LINK:null==d?void 0:d.name,__owner__dataunit__name__:this.dataUnitName})])}catch(t){return Promise.reject(t)}}delete(t){var i;const e=(null===(i=t.NOMEARQUIVO)||void 0===i?void 0:i[0])||{},a={serviceName:I,requestBody:{paramsDelete:{keyAttach:t.CHAVEARQUIVO,nameAttach:null==e?void 0:e.name,nameEntity:t.NOMEINSTANCIA,nuAttach:t.NUATTACH,pkEntity:t.PKREGISTRO}}};return new Promise(((t,i)=>{h.get().callServiceBroker(I,JSON.stringify(a)).then((i=>t(i))).catch((t=>i(t)))}))}getDownloadKey(t){var i;const e=(null===(i=t.NOMEARQUIVO)||void 0===i?void 0:i[0])||{},a={serviceName:f,requestBody:{paramsDown:{nameAttach:null==e?void 0:e.name,nameEntity:t.NOMEINSTANCIA,nuAttach:t.NUATTACH,pkEntity:t.PKREGISTRO,keyAttach:t.CHAVEARQUIVO}}};return new Promise(((t,i)=>{h.get().callServiceBroker(f,JSON.stringify(a)).then((i=>t(i))).catch((t=>i(t)))}))}}class _{constructor(t,i){this.entityName=t,this.getMessage=i,this._application=a.getContextValue("__SNK__APPLICATION__")}initLoaders(t,i,e){this.loader||(this.loader=t.dataLoader),t.dataLoader=(t,i)=>this.dataLoader(t,i),t.saveLoader=(t,a)=>this.saveLoader(a,i).then((t=>(t.length&&e(),t))),t.removeLoader=(t,a)=>this.removeLoader(t,a,i).then((t=>(t.length&&e(),t)))}metadataLoader(t){throw new Error("Method not implemented.")}dataLoader(t,i){return new Promise((e=>{this.loader(t,i).then((t=>{const i=((null==t?void 0:t.records)||[]).map((t=>{let i;return t.LINK||(i=[{name:t.NOMEARQUIVO}]),Object.assign(Object.assign({},t),{ARQUIVOOULINK:t.LINK?t.LINK:t.NOMEARQUIVO,NOMEARQUIVO:i})}));e(Object.assign(Object.assign({},t),{records:i}))}))}))}saveLoader(t,i){return new Promise((e=>{var a;const s=Array.isArray(t)?t[0]:{};((null===(a=null==s?void 0:s.record)||void 0===a?void 0:a.NUATTACH)>=0?i.edit.bind(i):i.save.bind(i))(s).then((t=>{e(t)})).catch((t=>t.message===v.LINK_AND_FILE_AT_THE_SAME_TIME?(this._application.alert(this.getMessage("snkAttach.alertValidation.fileAndLinkAtTheSameTime.title"),this.getMessage("snkAttach.alertValidation.fileAndLinkAtTheSameTime.message")),e([])):t.message===v.ANY_LINK_OR_FILE_FILLED?(this._application.alert(this.getMessage("snkAttach.alertValidation.anyLinkOrFileFilled.title"),this.getMessage("snkAttach.alertValidation.anyLinkOrFileFilled.message")),e([])):t.message?(this._application.error(t.title||t.name,t.message),e([])):void e([])))}))}removeLoader(t,i,e){return new Promise((a=>{const{records:s}=t.getSelectionInfo(),n=s[0];e.delete(n).then((()=>(u.removeRecords(t,[n]),a(i))))}))}getFilters(t){return[{name:"AttachmentsByPK",expression:"this.PKREGISTRO = :PKREGISTRO",params:[{name:"PKREGISTRO",dataType:s.TEXT,value:`${t}_${this.entityName}`}]}]}getInterceptions(t,i,e){return new Promise((a=>i.type===n.EDITION_CANCELED?t.isDirty()?this._application.confirm(this.getMessage("snkAttach.cancelConfirmation.title"),this.getMessage("snkAttach.cancelConfirmation.message")).then((t=>t?(e.goToView(O.GRID),a(i)):a(void 0))):a(i):i.type===n.DATA_SAVED?(t.loadData(),a(i)):void a(i)))}}let b;const g=t=>(b||(b=new c),b.getMessage(t)),N={grid:{columns:[{name:"CODATA",orderIndex:0,width:0},{name:"DESCRICAO",orderIndex:1,width:0},{name:"ARQUIVO",orderIndex:2,width:0},{name:"DTALTER",orderIndex:3,width:0},{name:"USUARIO",orderIndex:4,width:0}]},form:{emptyConfig:!1,fields:[{name:"DESCRICAO",label:g("snkAttach.attachMetadata.lblDescription"),visible:!0,readOnly:!1,required:!0},{name:"CAMINHO_ARQUIVO",label:g("snkAttach.attachMetadata.lblFile"),visible:!0,readOnly:!1,required:!0}]}},E={name:"Attach",label:"Attach List",fields:[{name:"CODATA",label:g("snkAttach.attachMetadata.lblCode"),dataType:s.TEXT},{name:"DESCRICAO",label:g("snkAttach.attachMetadata.lblDescription"),dataType:s.TEXT,readOnly:!1},{name:"ARQUIVO",label:g("snkAttach.attachMetadata.lblFileOrLink"),dataType:s.TEXT},{name:"USUARIO",label:g("snkAttach.attachMetadata.lblUser"),dataType:s.TEXT},{name:"DTALTER",label:g("snkAttach.attachMetadata.lblDate"),dataType:s.TEXT},{name:"CAMINHO_ARQUIVO",label:g("snkAttach.attachMetadata.lblFileUpload"),dataType:s.OBJECT,userInterface:o.FILE,readOnly:!1,required:!0,visible:!0,properties:{subTitle:g("snkAttach.attachMetadata.lblSubTitle"),MAX_FILES:1,STORAGESTRATEGY:"SESSION",INTERNAL_FILENAME:"Attach.upload"}}]};class C{constructor(t){this.getMessage=t,this._records=[],this._application=a.getContextValue("__SNK__APPLICATION__")}initLoaders(t,i,e){t.metadataLoader=t=>this.metadataLoader(t),t.dataLoader=(t,i)=>this.dataLoader(t,i),t.saveLoader=(t,a)=>this.saveLoader(a,i).then((t=>(t.length&&e(),t))),t.removeLoader=(t,a)=>this.removeLoader(t,a,i).then((t=>(t.length&&e(),t)))}metadataLoader(t){return Promise.resolve(E)}async dataLoader(t,i){if(!i.source)return Promise.resolve({records:this._records});if(!Number.isNaN(Number(i.source))){const t={criteria:{codata:i.source,tipoAnexo:"N"}},e=await this._application.getDataFetcher(),{anexos:{anexo:a=[]}}=await e.callServiceBroker("Attach.load",JSON.stringify(t)),s=[];a.forEach((t=>{s.push(Object.assign({__record__id__:r.generateUUID(),CAMINHO_ARQUIVO:[{name:null==t?void 0:t.ARQUIVO}]},t))})),this._records=s}return l.buildLoadDataResponse(this._records,t,i)}saveLoader(t,i){return new Promise((e=>{const a=Array.isArray(t)?t[0]:{};i.save(a).then(e).catch((t=>t.message===v.DESCRIPTION_CANNOT_BE_CHANGED?(this._application.alert(this.getMessage("snkAttach.alertValidation.descriptionCannotBeChanged.title"),this.getMessage("snkAttach.alertValidation.descriptionCannotBeChanged.message")),e([])):t.message===v.LINK_AND_FILE_AT_THE_SAME_TIME?(this._application.alert(this.getMessage("snkAttach.alertValidation.fileAndLinkAtTheSameTime.title"),this.getMessage("snkAttach.alertValidation.fileAndLinkAtTheSameTime.message")),e([])):t.message===v.ANY_LINK_OR_FILE_FILLED?(this._application.alert(this.getMessage("snkAttach.alertValidation.anyLinkOrFileFilled.title"),this.getMessage("snkAttach.alertValidation.anyLinkOrFileFilled.message")),e([])):t.message?(this._application.error(t.title||t.name,t.message),e([])):void e([])))}))}removeLoader(t,i,e){return new Promise((a=>{t.getSelectionInfo().records.forEach((async t=>{this._application.hasAccess(p.REMOVE).then((async s=>{s&&(await e.delete(t),a(i))}))}))}))}getFilters(){throw new Error("Method not implemented.")}getInterceptions(t,i,e){return new Promise((a=>{var s,o,r,l,d,h;switch(i.type){case n.EDITION_CANCELED:return t.isDirty()?this._application.confirm(this.getMessage("snkAttach.cancelConfirmation.title"),this.getMessage("snkAttach.cancelConfirmation.message")).then((t=>t?(e.goToView(O.GRID),a(i)):a(void 0))):a(i);case n.DATA_SAVED:return t.loadData(void 0,void 0,!1,null===(r=null===(o=null===(s=null==i?void 0:i.payload)||void 0===s?void 0:s.records)||void 0===o?void 0:o[0])||void 0===r?void 0:r.REGISTER_KEY),a(i);case n.RECORDS_REMOVED:return t.loadData(void 0,void 0,!1,null===(h=null===(d=null===(l=null==i?void 0:i.payload)||void 0===l?void 0:l.cachedRecords)||void 0===d?void 0:d[0])||void 0===h?void 0:h.CODATA),a(i)}a(i)}))}}let L;const R=t=>{var i;if(!L){const t=a.getContextValue("__SNK__APPLICATION__");L=null==t?void 0:t.messagesBuilder}return null===(i=null==L?void 0:L.getMessage)||void 0===i?void 0:i.call(L,t,null)},T={DOWNLOAD:{hint:R("snkAttach.taskbar.titleDownload"),name:"DOWNLOAD",iconName:"file-download"},LINK:{hint:R("snkAttach.taskbar.titleLink"),name:"LINK",iconName:"launch"}},x=()=>{const t=[w.REMOVE,"DOWNLOAD","LINK"];return{getButtons:(t,i,e)=>{const a=e.indexOf(w.REFRESH);if((null==i?void 0:i.insertionMode)||(null==i?void 0:i.isDirty))return e.reverse();-1!==a&&e.splice(a,1);const{selectedRecord:s}=i||{},n=(null==s?void 0:s.LINK)?T.LINK:T.DOWNLOAD;e.splice(e.indexOf(w.DIVIDER)+1,0,w.REMOVE,n,w.DIVIDER);const o=[w.CLONE,w.DATA_EXPORTER],r=Array.from(new Set(e.filter((t=>!o.includes(t)))));return r.splice(r.indexOf(n)+1,0,w.DIVIDER),r},isEnabled:(i,e,a)=>{const s=void 0!==(null==e?void 0:e.selectedRecord);return!(t.includes(a)&&!s)}}},P={grid:{columns:[{name:"ARQUIVOOULINK",orderIndex:0,width:0},{name:"DESCRICAO",orderIndex:1,width:0},{name:"DHCAD",orderIndex:2,width:0},{name:"DHALTER",orderIndex:3,width:0},{name:"TIPOAPRES",orderIndex:4,width:0},{name:"TIPOACESSO",orderIndex:5,width:0},{name:"CODUSU",orderIndex:6,width:0},{name:"CODUSUALT",orderIndex:7,width:0}]},form:{emptyConfig:!1,fields:[{name:"DESCRICAO",required:!0},{name:"TIPOAPRES",required:!0},{name:"TIPOACESSO",required:!0},{name:"LINK"},{name:"NOMEARQUIVO"}]}},D=class{constructor(e){t(this,e),this.back=i(this,"back",7),this.handleTaskbarClick=async({detail:t})=>{if(["DOWNLOAD","LINK"].includes(t))return this.downloadAttachment(this._currentDataUnit.getSelectedRecord());"Attach"===this.fetcherType&&["SAVE"].includes(t)&&this._currentDataUnit.isDirty()&&await this._currentDataUnit.setFieldValue("REGISTER_KEY",this.registerKey)},this.handleBack=()=>{this._currentDataUnit.cancelEdition().then((t=>{t&&this.back.emit()}))},this.handleFinish=()=>{if(!this._currentDataUnit.isDirty())return this.back.emit();this.validateAnexoSistema()&&this._currentDataUnit.saveData().then((()=>{this.showFinishedToast(),this.back.emit()}))},this.gridLegacyConfigName=void 0,this.fetcherType=void 0,this.fetcher=void 0,this.dataUnit=void 0,this.dataUnitBuilder=void 0,this.registerKey=void 0,this.entityName=void 0,this.messagesBuilder=void 0,this._currentFetcher=void 0,this._currentDataUnit=void 0,this.crudConfig=void 0}async registerKeyWatcher(t,i){var e;null==this._currentDataUnit&&this.loadAttachmentDataUnit(),i!==t&&(this._currentFetcher instanceof y&&(this._currentFetcher.registerKey=t),await(null===(e=this._currentDataUnit)||void 0===e?void 0:e.loadData()))}getAnexoSistemaFetcherInstance(){var t;const i=new y(this.entityName,null===(t=this._currentDataUnit)||void 0===t?void 0:t.name);return i.registerKey=this.registerKey,i}async initAttach(){var t,i,e,a,s;if(this.fetcherType||this.registerKey){if(this.fetcherType||(this.fetcherType="AnexoSistema"),this.returnToGridMode(),"AnexoSistema"===this.fetcherType)return this._currentFetcher=this.getAnexoSistemaFetcherInstance(),null===(t=this._currentDataUnitBuilder)||void 0===t||t.initLoaders(this._currentDataUnit,this._currentFetcher,this.returnToGridMode.bind(this)),void await(null===(i=this._currentDataUnit)||void 0===i?void 0:i.loadData());if("Attach"===this.fetcherType&&(null===(e=this.registerKey)||void 0===e?void 0:e.split("_").length)>1)return;await(null===(a=this._currentDataUnit)||void 0===a?void 0:a.loadMetadata()),await(null===(s=this._currentDataUnit)||void 0===s?void 0:s.loadData(void 0,void 0,!0,this.registerKey))}}getMessage(t,i){if(this.messagesBuilder)return this.messagesBuilder.getMessage(t,i)}showFinishedToast(){this._application.info(this.getMessage("snkAttach.finishedMessage"),{iconName:"check"})}downloadAttachment(t){if(!t)throw new Error(this.getMessage("snkAttach.alertValidation.noRecordSelected.message"));t.LINK?window.open(`${t.LINK}`):this._currentFetcher.getDownloadKey(t).then((({chave:i})=>{var e;let a=!1;(null===(e=null==t?void 0:t.ARQUIVO)||void 0===e?void 0:e.endsWith(".pdf"))||(a=!0),window.open(`/mge/visualizadorArquivos.mge?chaveArquivo=${i.valor}${a?"&forcarDownload=S":""}`)}))}returnToGridMode(){var t;null===(t=this._currentDataUnit)||void 0===t||t.clearSelection(),this._crudElement&&this._crudElement.goToView(O.GRID)}async loadAttachmentDataUnit(){try{switch(this.fetcherType){case"AnexoSistema":await this.loadAnexoSistema();break;case"Attach":await this.loadAttach();break;default:this._currentFetcher=this.fetcher,this._currentDataUnit=this.dataUnit,this._currentDataUnitBuilder=this.dataUnitBuilder}}catch(t){throw new Error("There was an error while creating the data unit")}}async loadAnexoSistema(){var t,i;let e;this._currentDataUnit=(new m).getDataUnit("AnexoSistema","br.com.sankhya.core.v3.anexoSistema"),this._currentFetcher=this.getAnexoSistemaFetcherInstance(),this._currentDataUnit.metadata||(await(null===(t=this._currentDataUnit)||void 0===t?void 0:t.loadMetadata()),this.crudConfig=this.entityName?{form:null==P?void 0:P.form}:Object.assign({},P),e={grid:null==P?void 0:P.grid}),this.initDataUnitLoaders(),this._currentDataUnit.addFilterProvider({getFilter:()=>this._currentDataUnitBuilder.getFilters(this.registerKey)}),this._currentDataUnit.addInterceptor({interceptAction:t=>this._currentDataUnitBuilder.getInterceptions(this._currentDataUnit,t,this._crudElement)}),await(null===(i=this._currentDataUnit)||void 0===i?void 0:i.loadData()),this.disableEditFieldsNotInForm(e)}async loadAttach(){var t,i;let e;this._currentFetcher=new k,this._currentDataUnit=new d(A.IN_MEMORY_DATA_UNIT_NAME),this._currentDataUnit.pageSize=150,this.initDataUnitLoaders(),this._currentDataUnit.addInterceptor({interceptAction:t=>{var i;return t.type===n.METADATA_LOADED&&(this.crudConfig=this.entityName?{form:null==N?void 0:N.form}:Object.assign({},N),e={grid:null==N?void 0:N.grid},null===(i=this._crudElement)||void 0===i||i.updateConfig()),this._currentDataUnitBuilder.getInterceptions(this._currentDataUnit,t,this._crudElement)}}),this._currentDataUnit.metadata||(await(null===(t=this._currentDataUnit)||void 0===t?void 0:t.loadMetadata()),this.crudConfig=this.entityName?{form:null==N?void 0:N.form}:Object.assign({},N),e={grid:null==N?void 0:N.grid},await(null===(i=this._currentDataUnit)||void 0===i?void 0:i.loadData(void 0,void 0,!0,this.registerKey)),this.disableEditFieldsNotInForm(e))}initDataUnitLoaders(){var t,i;"AnexoSistema"===this.fetcherType&&(this._currentFetcher=this.getAnexoSistemaFetcherInstance(),this._currentDataUnitBuilder=new _(this.entityName,this.getMessage.bind(this)),null===(t=this._currentDataUnitBuilder)||void 0===t||t.initLoaders(this._currentDataUnit,this._currentFetcher,this.returnToGridMode.bind(this))),"Attach"===this.fetcherType&&(this._currentFetcher=new k,this._currentDataUnitBuilder=new C(this.getMessage.bind(this)),null===(i=this._currentDataUnitBuilder)||void 0===i||i.initLoaders(this._currentDataUnit,this._currentFetcher,(async()=>{this.returnToGridMode(),await this._currentDataUnit.loadData(void 0,void 0,!0,this.registerKey)})))}disableEditFieldsNotInForm(t){var i,e,a,s,n;const o=(null===(e=null===(i=this._crudElement)||void 0===i?void 0:i.gridConfig)||void 0===e?void 0:e.columns)||(null===(a=null==t?void 0:t.grid)||void 0===a?void 0:a.columns)||(null===(n=null===(s=this.crudConfig)||void 0===s?void 0:s.grid)||void 0===n?void 0:n.columns);this.getGridLegacyConfigName()&&this._currentDataUnit.disableField("ARQUIVOOULINK"),null==o||o.forEach((t=>{var i,e;const a=t.name;(null===(e=null===(i=this.crudConfig)||void 0===i?void 0:i.form)||void 0===e?void 0:e.fields.some((t=>(null==t?void 0:t.name)===a)))||this._currentDataUnit.disableField(a)}))}validateAnexoSistema(){var t;if(this._currentFetcher instanceof y)try{let i=this._currentDataUnit.getSelectedRecord();i=Object.assign(Object.assign({},i),{NOMEARQUIVO:null===(t=i.NOMEARQUIVO)||void 0===t?void 0:t[0]}),this._currentFetcher.validateFields(i)}catch(t){if(t.message===v.LINK_AND_FILE_AT_THE_SAME_TIME)return this._application.alert(this.getMessage("snkAttach.alertValidation.fileAndLinkAtTheSameTime.title"),this.getMessage("snkAttach.alertValidation.fileAndLinkAtTheSameTime.message")),!1;if(t.message===v.ANY_LINK_OR_FILE_FILLED)return this._application.alert(this.getMessage("snkAttach.alertValidation.anyLinkOrFileFilled.title"),this.getMessage("snkAttach.alertValidation.anyLinkOrFileFilled.message")),!1}return!0}async componentWillLoad(){this._application=a.getContextValue("__SNK__APPLICATION__"),await this.initAttach()}componentWillRender(){this.fetcherType||(this.fetcherType="AnexoSistema"),null==this._currentDataUnit&&this.loadAttachmentDataUnit()}async handleOnDataStateChange({detail:t}){"Attach"===this.fetcherType&&(t.insertionMode?this._currentDataUnit.enableField("DESCRICAO"):this._currentDataUnit.disableField("DESCRICAO"),await this._currentDataUnit.loadMetadata())}getGridLegacyConfigName(){return this.gridLegacyConfigName?this.gridLegacyConfigName:this.entityName?"GrdCfgHtml5:grdcfg.dynaform.anexo."+this.entityName:this.entityName}render(){var t,i;return this._currentDataUnit?e("main",{class:"snk-attach__main"},e("header",{class:"snk-attach__header"},e("snk-simple-bar",{onExit:this.handleBack,messagesBuilder:this.messagesBuilder},e("div",{slot:"rightSlot"},e("ez-button",{class:"ez-button--primary",label:this.getMessage("snkAttach.finish"),onClick:this.handleFinish})))),e("div",{class:"snk-attach__crud-section ez-size-height--full ez-size-width--full ez-flex ez-flex--column"},e("div",{class:"ez-box__container"},e("snk-simple-crud",{ref:t=>this._crudElement=t,dataUnit:this._currentDataUnit,taskbarManager:x(),gridConfig:null===(t=this.crudConfig)||void 0===t?void 0:t.grid,formConfig:null===(i=this.crudConfig)||void 0===i?void 0:i.form,useCancelConfirm:!1,onActionClick:this.handleTaskbarClick,messagesBuilder:this.messagesBuilder,onDataStateChange:this.handleOnDataStateChange.bind(this),multipleSelection:!0,configName:this.entityName,ignoreReadOnlyFormFields:!!this.entityName,gridLegacyConfigName:this.getGridLegacyConfigName()},e("div",{slot:"snkSimpleCrudHeader"},e("div",{class:"ez-flex ez-flex--column"},e("span",{class:"ez-title--primary ez-text ez-text--large ez-text--bold ez-padding-bottom--medium"},this.getMessage("snkAttach.title")),e("span",{class:"ez-text ez-text--medium ez-text--secondary ez-padding-bottom--medium"},this.getMessage("snkAttach.description")))))))):null}static get watchers(){return{registerKey:["registerKeyWatcher"]}}};D.style=".snk-attach__header.sc-snk-attach,.snk-attach__crud-section.sc-snk-attach{padding:0 var(--space--lg)}.snk-attach__file-info.sc-snk-attach{padding:var(--space--small);max-width:50%}.snk-attach__main.sc-snk-attach{height:85%}.ez-box__container.sc-snk-attach{height:100%}";export{D as snk_attach}
1
+ import{r as t,c as i,h as e}from"./p-d8d8169b.js";import{ApplicationContext as a,DataType as s,Action as n,UserInterface as o,StringUtils as r,DataUnitLoaderUtils as l,DataUnit as d}from"@sankhyalabs/core";import{D as h,S as c}from"./p-d75a732c.js";import{S as v}from"./p-bf017a1f.js";import"./p-0f3698af.js";import{P as u,D as m,I as A}from"./p-9062d640.js";import"./p-ff1990ad.js";import"./p-8d256def.js";import{V as O}from"./p-9019a32f.js";import{A as p}from"./p-c98e2085.js";import{T as w}from"./p-b987e15d.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";import"./p-55798617.js";class k{constructor(t){this.dataUnitName=t}async save({dataUnit:t,record:i,updatingFields:e,operation:a}){var s,n;const o="INSERT"==a,r=o?e:i;if(!o&&(null==e?void 0:e.DESCRICAO)&&(null==e?void 0:e.DESCRICAO)!==(null==i?void 0:i.DESCRICAO))throw new Error(v.DESCRIPTION_CANNOT_BE_CHANGED);const l={anexo:{codata:o?null==e?void 0:e.REGISTER_KEY:null==i?void 0:i.CODATA,sequencia:(null==r?void 0:r.SEQUENCIA)||"0",tipo:(null==r?void 0:r.TIPO)||"N",descricao:null==r?void 0:r.DESCRICAO,arquivo:null===(n=null===(s=e.CAMINHO_ARQUIVO)||void 0===s?void 0:s[0])||void 0===n?void 0:n.name,ehInclusao:o?"S":"N",ehArquivoRepositorio:"N"}};return new Promise(((i,a)=>{h.get().callServiceBroker("Attach.save",JSON.stringify(l)).then((a=>{var s;return i([Object.assign(Object.assign(Object.assign({},a),e),{__owner__dataunit__name__:null!==(s=this.dataUnitName)&&void 0!==s?s:t})])})).catch((t=>a(t)))}))}async edit(t){throw new Error("Method not implemented.")}async delete(t){var i={anexo:{codata:t.CODATA,tipo:t.TIPO,descricao:t.DESCRICAO}};const e=await h.get().callServiceBroker("Attach.remove",JSON.stringify(i));return Promise.resolve(e)}async getDownloadKey(t){var i,e,a;if("S"==t.EHARQUIVOREPOSITORIO){const a={config:{path:t.ARQUIVO,tipoconteudo:t.TIPOCONTEUDO}},s=await h.get().callServiceBroker("RepositorioArquivoSP.abreArquivo",JSON.stringify(a));return Promise.resolve({chave:{valor:null===(e=null===(i=null==s?void 0:s.responseBody)||void 0===i?void 0:i.chave)||void 0===e?void 0:e.valor}})}const s={anexo:{codata:t.CODATA,codemp:t.CODEMP,sequencia:t.SEQUENCIA,tipo:t.TIPO,descricao:t.DESCRICAO,tipoConteudo:t.TIPOCONTEUDO}},n=await h.get().callServiceBroker("Attach.view",JSON.stringify(s));return(null==n?void 0:n.chaveAnexo)?Promise.resolve({chave:{valor:null===(a=null==n?void 0:n.chaveAnexo)||void 0===a?void 0:a.idChaveAnexo}}):Promise.reject(new Error("File not found."))}}const S="AnexoSistemaSP.salvar",I="AnexoSistemaSP.excluir",f="AnexoSistemaSP.baixar";class y{constructor(t,i){var e;this.entityName=t,this.dataUnitName=i,this.validateFields=t=>{if(t.LINK&&t.NOMEARQUIVO)throw new Error(v.LINK_AND_FILE_AT_THE_SAME_TIME);if(!t.LINK&&!t.NOMEARQUIVO)throw new Error(v.ANY_LINK_OR_FILE_FILLED);if(!this._registerKey)throw new Error("Register key can not be null")},this.resourceID=window.resourceID||(null===(e=window.workspace)||void 0===e?void 0:e.resourceID)}set registerKey(t){this._registerKey=t}async save(t){var i,e;let{updatingFields:a}=t;a=Object.assign(Object.assign({},a),{NOMEARQUIVO:null===(i=a.NOMEARQUIVO)||void 0===i?void 0:i[0]});try{this.validateFields(a);const t=a.LINK?null:a.NOMEARQUIVO,i={serviceName:S,requestBody:{params:{resourceID:this.resourceID,description:a.DESCRICAO,fileSelect:t?1:0,keySession:null===(e=null==t?void 0:t.properties)||void 0===e?void 0:e.fileNameTmp,nameAttach:null==t?void 0:t.name,link:a.LINK,nameEntity:this.entityName,pkEntity:this._registerKey,typeAcess:a.TIPOACESSO,typeApres:a.TIPOAPRES}}},s=await h.get().callServiceBroker(S,JSON.stringify(i));return Promise.resolve([Object.assign(Object.assign(Object.assign({},s),a),{ARQUIVOOULINK:a.LINK?a.LINK:null==t?void 0:t.name,__owner__dataunit__name__:this.dataUnitName})])}catch(t){return Promise.reject(t)}}async edit(t){var i,e,a;let{updatingFields:s,record:n}=t;const o=t=>void 0!==s[t]?s[t]:n[t],r=o("NOMEARQUIVO"),l=null===(e=null===(i=s.NOMEARQUIVO)||void 0===i?void 0:i[0])||void 0===e?void 0:e.downloadURL;s=Object.assign(Object.assign({},s),{DESCRICAO:o("DESCRICAO"),LINK:o("LINK"),TIPOACESSO:o("TIPOACESSO"),TIPOAPRES:o("TIPOAPRES"),CHAVEARQUIVO:n.CHAVEARQUIVO,NOMEARQUIVO:null==r?void 0:r[0]});const d=s.LINK?null:s.NOMEARQUIVO;try{this.validateFields(s);const t={serviceName:S,requestBody:{params:{resourceID:this.resourceID,nuAttach:null==n?void 0:n.NUATTACH,description:s.DESCRICAO,fileSelect:l?1:0,keySession:null===(a=null==d?void 0:d.properties)||void 0===a?void 0:a.fileNameTmp,keyAttach:s.CHAVEARQUIVO,nameAttach:null==d?void 0:d.name,link:s.LINK,nameEntity:this.entityName,pkEntity:this._registerKey,typeAcess:s.TIPOACESSO,typeApres:s.TIPOAPRES}}},i=await h.get().callServiceBroker(S,JSON.stringify(t));return Promise.resolve([Object.assign(Object.assign(Object.assign({},i),s),{ARQUIVOOULINK:s.LINK?s.LINK:null==d?void 0:d.name,__owner__dataunit__name__:this.dataUnitName})])}catch(t){return Promise.reject(t)}}delete(t){var i;const e=(null===(i=t.NOMEARQUIVO)||void 0===i?void 0:i[0])||{},a={serviceName:I,requestBody:{paramsDelete:{keyAttach:t.CHAVEARQUIVO,nameAttach:null==e?void 0:e.name,nameEntity:t.NOMEINSTANCIA,nuAttach:t.NUATTACH,pkEntity:t.PKREGISTRO}}};return new Promise(((t,i)=>{h.get().callServiceBroker(I,JSON.stringify(a)).then((i=>t(i))).catch((t=>i(t)))}))}getDownloadKey(t){var i;const e=(null===(i=t.NOMEARQUIVO)||void 0===i?void 0:i[0])||{},a={serviceName:f,requestBody:{paramsDown:{nameAttach:null==e?void 0:e.name,nameEntity:t.NOMEINSTANCIA,nuAttach:t.NUATTACH,pkEntity:t.PKREGISTRO,keyAttach:t.CHAVEARQUIVO}}};return new Promise(((t,i)=>{h.get().callServiceBroker(f,JSON.stringify(a)).then((i=>t(i))).catch((t=>i(t)))}))}}class _{constructor(t,i){this.entityName=t,this.getMessage=i,this._application=a.getContextValue("__SNK__APPLICATION__")}initLoaders(t,i,e){this.loader||(this.loader=t.dataLoader),t.dataLoader=(t,i)=>this.dataLoader(t,i),t.saveLoader=(t,a)=>this.saveLoader(a,i).then((t=>(t.length&&e(),t))),t.removeLoader=(t,a)=>this.removeLoader(t,a,i).then((t=>(t.length&&e(),t)))}metadataLoader(t){throw new Error("Method not implemented.")}dataLoader(t,i){return new Promise((e=>{this.loader(t,i).then((t=>{const i=((null==t?void 0:t.records)||[]).map((t=>{let i;return t.LINK||(i=[{name:t.NOMEARQUIVO}]),Object.assign(Object.assign({},t),{ARQUIVOOULINK:t.LINK?t.LINK:t.NOMEARQUIVO,NOMEARQUIVO:i})}));e(Object.assign(Object.assign({},t),{records:i}))}))}))}saveLoader(t,i){return new Promise((e=>{var a;const s=Array.isArray(t)?t[0]:{};((null===(a=null==s?void 0:s.record)||void 0===a?void 0:a.NUATTACH)>=0?i.edit.bind(i):i.save.bind(i))(s).then((t=>{e(t)})).catch((t=>t.message===v.LINK_AND_FILE_AT_THE_SAME_TIME?(this._application.alert(this.getMessage("snkAttach.alertValidation.fileAndLinkAtTheSameTime.title"),this.getMessage("snkAttach.alertValidation.fileAndLinkAtTheSameTime.message")),e([])):t.message===v.ANY_LINK_OR_FILE_FILLED?(this._application.alert(this.getMessage("snkAttach.alertValidation.anyLinkOrFileFilled.title"),this.getMessage("snkAttach.alertValidation.anyLinkOrFileFilled.message")),e([])):t.message?(this._application.error(t.title||t.name,t.message),e([])):void e([])))}))}removeLoader(t,i,e){return new Promise((a=>{const{records:s}=t.getSelectionInfo(),n=s[0];e.delete(n).then((()=>(u.removeRecords(t,[n]),a(i))))}))}getFilters(t){return[{name:"AttachmentsByPK",expression:"this.PKREGISTRO = :PKREGISTRO",params:[{name:"PKREGISTRO",dataType:s.TEXT,value:`${t}_${this.entityName}`}]}]}getInterceptions(t,i,e){return new Promise((a=>i.type===n.EDITION_CANCELED?t.isDirty()?this._application.confirm(this.getMessage("snkAttach.cancelConfirmation.title"),this.getMessage("snkAttach.cancelConfirmation.message")).then((t=>t?(e.goToView(O.GRID),a(i)):a(void 0))):a(i):i.type===n.DATA_SAVED?(t.loadData(),a(i)):void a(i)))}}let b;const g=t=>(b||(b=new c),b.getMessage(t)),N={grid:{columns:[{name:"CODATA",orderIndex:0,width:0},{name:"DESCRICAO",orderIndex:1,width:0},{name:"ARQUIVO",orderIndex:2,width:0},{name:"DTALTER",orderIndex:3,width:0},{name:"USUARIO",orderIndex:4,width:0}]},form:{emptyConfig:!1,fields:[{name:"DESCRICAO",label:g("snkAttach.attachMetadata.lblDescription"),visible:!0,readOnly:!1,required:!0},{name:"CAMINHO_ARQUIVO",label:g("snkAttach.attachMetadata.lblFile"),visible:!0,readOnly:!1,required:!0}]}},E={name:"Attach",label:"Attach List",fields:[{name:"CODATA",label:g("snkAttach.attachMetadata.lblCode"),dataType:s.TEXT},{name:"DESCRICAO",label:g("snkAttach.attachMetadata.lblDescription"),dataType:s.TEXT,readOnly:!1},{name:"ARQUIVO",label:g("snkAttach.attachMetadata.lblFileOrLink"),dataType:s.TEXT},{name:"USUARIO",label:g("snkAttach.attachMetadata.lblUser"),dataType:s.TEXT},{name:"DTALTER",label:g("snkAttach.attachMetadata.lblDate"),dataType:s.TEXT},{name:"CAMINHO_ARQUIVO",label:g("snkAttach.attachMetadata.lblFileUpload"),dataType:s.OBJECT,userInterface:o.FILE,readOnly:!1,required:!0,visible:!0,properties:{subTitle:g("snkAttach.attachMetadata.lblSubTitle"),MAX_FILES:1,STORAGESTRATEGY:"SESSION",INTERNAL_FILENAME:"Attach.upload"}}]};class C{constructor(t){this.getMessage=t,this._records=[],this._application=a.getContextValue("__SNK__APPLICATION__")}initLoaders(t,i,e){t.metadataLoader=t=>this.metadataLoader(t),t.dataLoader=(t,i)=>this.dataLoader(t,i),t.saveLoader=(t,a)=>this.saveLoader(a,i).then((t=>(t.length&&e(),t))),t.removeLoader=(t,a)=>this.removeLoader(t,a,i).then((t=>(t.length&&e(),t)))}metadataLoader(t){return Promise.resolve(E)}async dataLoader(t,i){if(!i.source)return Promise.resolve({records:this._records});if(!Number.isNaN(Number(i.source))){const t={criteria:{codata:i.source,tipoAnexo:"N"}},e=await this._application.getDataFetcher(),{anexos:{anexo:a=[]}}=await e.callServiceBroker("Attach.load",JSON.stringify(t)),s=[];a.forEach((t=>{s.push(Object.assign({__record__id__:r.generateUUID(),CAMINHO_ARQUIVO:[{name:null==t?void 0:t.ARQUIVO}]},t))})),this._records=s}return l.buildLoadDataResponse(this._records,t,i)}saveLoader(t,i){return new Promise((e=>{const a=Array.isArray(t)?t[0]:{};i.save(a).then(e).catch((t=>t.message===v.DESCRIPTION_CANNOT_BE_CHANGED?(this._application.alert(this.getMessage("snkAttach.alertValidation.descriptionCannotBeChanged.title"),this.getMessage("snkAttach.alertValidation.descriptionCannotBeChanged.message")),e([])):t.message===v.LINK_AND_FILE_AT_THE_SAME_TIME?(this._application.alert(this.getMessage("snkAttach.alertValidation.fileAndLinkAtTheSameTime.title"),this.getMessage("snkAttach.alertValidation.fileAndLinkAtTheSameTime.message")),e([])):t.message===v.ANY_LINK_OR_FILE_FILLED?(this._application.alert(this.getMessage("snkAttach.alertValidation.anyLinkOrFileFilled.title"),this.getMessage("snkAttach.alertValidation.anyLinkOrFileFilled.message")),e([])):t.message?(this._application.error(t.title||t.name,t.message),e([])):void e([])))}))}removeLoader(t,i,e){return new Promise((a=>{t.getSelectionInfo().records.forEach((async t=>{this._application.hasAccess(p.REMOVE).then((async s=>{s&&(await e.delete(t),a(i))}))}))}))}getFilters(){throw new Error("Method not implemented.")}getInterceptions(t,i,e){return new Promise((a=>{var s,o,r,l,d,h;switch(i.type){case n.EDITION_CANCELED:return t.isDirty()?this._application.confirm(this.getMessage("snkAttach.cancelConfirmation.title"),this.getMessage("snkAttach.cancelConfirmation.message")).then((t=>t?(e.goToView(O.GRID),a(i)):a(void 0))):a(i);case n.DATA_SAVED:return t.loadData(void 0,void 0,!1,null===(r=null===(o=null===(s=null==i?void 0:i.payload)||void 0===s?void 0:s.records)||void 0===o?void 0:o[0])||void 0===r?void 0:r.REGISTER_KEY),a(i);case n.RECORDS_REMOVED:return t.loadData(void 0,void 0,!1,null===(h=null===(d=null===(l=null==i?void 0:i.payload)||void 0===l?void 0:l.cachedRecords)||void 0===d?void 0:d[0])||void 0===h?void 0:h.CODATA),a(i)}a(i)}))}}let L;const R=t=>{var i;if(!L){const t=a.getContextValue("__SNK__APPLICATION__");L=null==t?void 0:t.messagesBuilder}return null===(i=null==L?void 0:L.getMessage)||void 0===i?void 0:i.call(L,t,null)},T={DOWNLOAD:{hint:R("snkAttach.taskbar.titleDownload"),name:"DOWNLOAD",iconName:"file-download"},LINK:{hint:R("snkAttach.taskbar.titleLink"),name:"LINK",iconName:"launch"}},x=()=>{const t=[w.REMOVE,"DOWNLOAD","LINK"];return{getButtons:(t,i,e)=>{const a=e.indexOf(w.REFRESH);if((null==i?void 0:i.insertionMode)||(null==i?void 0:i.isDirty))return e.reverse();-1!==a&&e.splice(a,1);const{selectedRecord:s}=i||{},n=(null==s?void 0:s.LINK)?T.LINK:T.DOWNLOAD;e.splice(e.indexOf(w.DIVIDER)+1,0,w.REMOVE,n,w.DIVIDER);const o=[w.CLONE,w.DATA_EXPORTER],r=Array.from(new Set(e.filter((t=>!o.includes(t)))));return r.splice(r.indexOf(n)+1,0,w.DIVIDER),r},isEnabled:(i,e,a)=>{const s=void 0!==(null==e?void 0:e.selectedRecord);return!(t.includes(a)&&!s)}}},P={grid:{columns:[{name:"ARQUIVOOULINK",orderIndex:0,width:0},{name:"DESCRICAO",orderIndex:1,width:0},{name:"DHCAD",orderIndex:2,width:0},{name:"DHALTER",orderIndex:3,width:0},{name:"TIPOAPRES",orderIndex:4,width:0},{name:"TIPOACESSO",orderIndex:5,width:0},{name:"CODUSU",orderIndex:6,width:0},{name:"CODUSUALT",orderIndex:7,width:0}]},form:{emptyConfig:!1,fields:[{name:"DESCRICAO",required:!0},{name:"TIPOAPRES",required:!0},{name:"TIPOACESSO",required:!0},{name:"LINK"},{name:"NOMEARQUIVO"}]}},D=class{constructor(e){t(this,e),this.back=i(this,"back",7),this.handleTaskbarClick=async({detail:t})=>{if(["DOWNLOAD","LINK"].includes(t))return this.downloadAttachment(this._currentDataUnit.getSelectedRecord());"Attach"===this.fetcherType&&["SAVE"].includes(t)&&this._currentDataUnit.isDirty()&&await this._currentDataUnit.setFieldValue("REGISTER_KEY",this.registerKey)},this.handleBack=()=>{this._currentDataUnit.cancelEdition().then((t=>{t&&this.back.emit()}))},this.handleFinish=()=>{if(!this._currentDataUnit.isDirty())return this.back.emit();this.validateAnexoSistema()&&this._currentDataUnit.saveData().then((()=>{this.showFinishedToast(),this.back.emit()}))},this.gridLegacyConfigName=void 0,this.fetcherType=void 0,this.fetcher=void 0,this.dataUnit=void 0,this.dataUnitBuilder=void 0,this.registerKey=void 0,this.entityName=void 0,this.messagesBuilder=void 0,this._currentFetcher=void 0,this._currentDataUnit=void 0,this.crudConfig=void 0}async registerKeyWatcher(t,i){var e;null==this._currentDataUnit&&this.loadAttachmentDataUnit(),i!==t&&(this._currentFetcher instanceof y&&(this._currentFetcher.registerKey=t),await(null===(e=this._currentDataUnit)||void 0===e?void 0:e.loadData()))}getAnexoSistemaFetcherInstance(){var t;const i=new y(this.entityName,null===(t=this._currentDataUnit)||void 0===t?void 0:t.name);return i.registerKey=this.registerKey,i}async initAttach(){var t,i,e,a,s;if(this.fetcherType||this.registerKey){if(this.fetcherType||(this.fetcherType="AnexoSistema"),this.returnToGridMode(),"AnexoSistema"===this.fetcherType)return this._currentFetcher=this.getAnexoSistemaFetcherInstance(),null===(t=this._currentDataUnitBuilder)||void 0===t||t.initLoaders(this._currentDataUnit,this._currentFetcher,this.returnToGridMode.bind(this)),void await(null===(i=this._currentDataUnit)||void 0===i?void 0:i.loadData());if("Attach"===this.fetcherType&&(null===(e=this.registerKey)||void 0===e?void 0:e.split("_").length)>1)return;await(null===(a=this._currentDataUnit)||void 0===a?void 0:a.loadMetadata()),await(null===(s=this._currentDataUnit)||void 0===s?void 0:s.loadData(void 0,void 0,!0,this.registerKey))}}getMessage(t,i){if(this.messagesBuilder)return this.messagesBuilder.getMessage(t,i)}showFinishedToast(){this._application.info(this.getMessage("snkAttach.finishedMessage"),{iconName:"check"})}downloadAttachment(t){if(!t)throw new Error(this.getMessage("snkAttach.alertValidation.noRecordSelected.message"));t.LINK?window.open(`${t.LINK}`):this._currentFetcher.getDownloadKey(t).then((({chave:i})=>{var e;let a=!1;(null===(e=null==t?void 0:t.ARQUIVO)||void 0===e?void 0:e.endsWith(".pdf"))||(a=!0),window.open(`/mge/visualizadorArquivos.mge?chaveArquivo=${i.valor}${a?"&forcarDownload=S":""}`)}))}returnToGridMode(){var t;null===(t=this._currentDataUnit)||void 0===t||t.clearSelection(),this._crudElement&&this._crudElement.goToView(O.GRID)}async loadAttachmentDataUnit(){try{switch(this.fetcherType){case"AnexoSistema":await this.loadAnexoSistema();break;case"Attach":await this.loadAttach();break;default:this._currentFetcher=this.fetcher,this._currentDataUnit=this.dataUnit,this._currentDataUnitBuilder=this.dataUnitBuilder}}catch(t){throw new Error("There was an error while creating the data unit")}}async loadAnexoSistema(){var t,i;let e;this._currentDataUnit=(new m).getDataUnit("AnexoSistema","br.com.sankhya.core.v3.anexoSistema"),this._currentFetcher=this.getAnexoSistemaFetcherInstance(),this._currentDataUnit.metadata||(await(null===(t=this._currentDataUnit)||void 0===t?void 0:t.loadMetadata()),this.crudConfig=this.entityName?{form:null==P?void 0:P.form}:Object.assign({},P),e={grid:null==P?void 0:P.grid}),this.initDataUnitLoaders(),this._currentDataUnit.addFilterProvider({getFilter:()=>this._currentDataUnitBuilder.getFilters(this.registerKey)}),this._currentDataUnit.addInterceptor({interceptAction:t=>this._currentDataUnitBuilder.getInterceptions(this._currentDataUnit,t,this._crudElement)}),await(null===(i=this._currentDataUnit)||void 0===i?void 0:i.loadData()),this.disableEditFieldsNotInForm(e)}async loadAttach(){var t,i;let e;this._currentFetcher=new k,this._currentDataUnit=new d(A.IN_MEMORY_DATA_UNIT_NAME),this._currentDataUnit.pageSize=150,this.initDataUnitLoaders(),this._currentDataUnit.addInterceptor({interceptAction:t=>{var i;return t.type===n.METADATA_LOADED&&(this.crudConfig=this.entityName?{form:null==N?void 0:N.form}:Object.assign({},N),e={grid:null==N?void 0:N.grid},null===(i=this._crudElement)||void 0===i||i.updateConfig()),this._currentDataUnitBuilder.getInterceptions(this._currentDataUnit,t,this._crudElement)}}),this._currentDataUnit.metadata||(await(null===(t=this._currentDataUnit)||void 0===t?void 0:t.loadMetadata()),this.crudConfig=this.entityName?{form:null==N?void 0:N.form}:Object.assign({},N),e={grid:null==N?void 0:N.grid},await(null===(i=this._currentDataUnit)||void 0===i?void 0:i.loadData(void 0,void 0,!0,this.registerKey)),this.disableEditFieldsNotInForm(e))}initDataUnitLoaders(){var t,i;"AnexoSistema"===this.fetcherType&&(this._currentFetcher=this.getAnexoSistemaFetcherInstance(),this._currentDataUnitBuilder=new _(this.entityName,this.getMessage.bind(this)),null===(t=this._currentDataUnitBuilder)||void 0===t||t.initLoaders(this._currentDataUnit,this._currentFetcher,this.returnToGridMode.bind(this))),"Attach"===this.fetcherType&&(this._currentFetcher=new k,this._currentDataUnitBuilder=new C(this.getMessage.bind(this)),null===(i=this._currentDataUnitBuilder)||void 0===i||i.initLoaders(this._currentDataUnit,this._currentFetcher,(async()=>{this.returnToGridMode(),await this._currentDataUnit.loadData(void 0,void 0,!0,this.registerKey)})))}disableEditFieldsNotInForm(t){var i,e,a,s,n;const o=(null===(e=null===(i=this._crudElement)||void 0===i?void 0:i.gridConfig)||void 0===e?void 0:e.columns)||(null===(a=null==t?void 0:t.grid)||void 0===a?void 0:a.columns)||(null===(n=null===(s=this.crudConfig)||void 0===s?void 0:s.grid)||void 0===n?void 0:n.columns);this.getGridLegacyConfigName()&&this._currentDataUnit.disableField("ARQUIVOOULINK"),null==o||o.forEach((t=>{var i,e;const a=t.name;(null===(e=null===(i=this.crudConfig)||void 0===i?void 0:i.form)||void 0===e?void 0:e.fields.some((t=>(null==t?void 0:t.name)===a)))||this._currentDataUnit.disableField(a)}))}validateAnexoSistema(){var t;if(this._currentFetcher instanceof y)try{let i=this._currentDataUnit.getSelectedRecord();i=Object.assign(Object.assign({},i),{NOMEARQUIVO:null===(t=i.NOMEARQUIVO)||void 0===t?void 0:t[0]}),this._currentFetcher.validateFields(i)}catch(t){if(t.message===v.LINK_AND_FILE_AT_THE_SAME_TIME)return this._application.alert(this.getMessage("snkAttach.alertValidation.fileAndLinkAtTheSameTime.title"),this.getMessage("snkAttach.alertValidation.fileAndLinkAtTheSameTime.message")),!1;if(t.message===v.ANY_LINK_OR_FILE_FILLED)return this._application.alert(this.getMessage("snkAttach.alertValidation.anyLinkOrFileFilled.title"),this.getMessage("snkAttach.alertValidation.anyLinkOrFileFilled.message")),!1}return!0}async componentWillLoad(){this._application=a.getContextValue("__SNK__APPLICATION__"),await this.initAttach()}componentWillRender(){this.fetcherType||(this.fetcherType="AnexoSistema"),null==this._currentDataUnit&&this.loadAttachmentDataUnit()}async handleOnDataStateChange({detail:t}){"Attach"===this.fetcherType&&(t.insertionMode?this._currentDataUnit.enableField("DESCRICAO"):this._currentDataUnit.disableField("DESCRICAO"),await this._currentDataUnit.loadMetadata())}getGridLegacyConfigName(){return this.gridLegacyConfigName?this.gridLegacyConfigName:this.entityName?"GrdCfgHtml5:grdcfg.dynaform.anexo."+this.entityName:this.entityName}render(){var t,i;return this._currentDataUnit?e("main",{class:"snk-attach__main"},e("header",{class:"snk-attach__header"},e("snk-simple-bar",{onExit:this.handleBack,messagesBuilder:this.messagesBuilder},e("div",{slot:"rightSlot"},e("ez-button",{class:"ez-button--primary",label:this.getMessage("snkAttach.finish"),onClick:this.handleFinish})))),e("div",{class:"snk-attach__crud-section ez-size-height--full ez-size-width--full ez-flex ez-flex--column"},e("div",{class:"ez-box__container"},e("snk-simple-crud",{ref:t=>this._crudElement=t,dataUnit:this._currentDataUnit,taskbarManager:x(),gridConfig:null===(t=this.crudConfig)||void 0===t?void 0:t.grid,formConfig:null===(i=this.crudConfig)||void 0===i?void 0:i.form,useCancelConfirm:!1,onActionClick:this.handleTaskbarClick,messagesBuilder:this.messagesBuilder,onDataStateChange:this.handleOnDataStateChange.bind(this),multipleSelection:!0,configName:this.entityName,ignoreReadOnlyFormFields:!!this.entityName,gridLegacyConfigName:this.getGridLegacyConfigName()},e("div",{slot:"snkSimpleCrudHeader"},e("div",{class:"ez-flex ez-flex--column"},e("span",{class:"ez-title--primary ez-text ez-text--large ez-text--bold ez-padding-bottom--medium"},this.getMessage("snkAttach.title")),e("span",{class:"ez-text ez-text--medium ez-text--secondary ez-padding-bottom--medium"},this.getMessage("snkAttach.description")))))))):null}static get watchers(){return{registerKey:["registerKeyWatcher"]}}};D.style=".snk-attach__header.sc-snk-attach,.snk-attach__crud-section.sc-snk-attach{padding:0 var(--space--lg)}.snk-attach__file-info.sc-snk-attach{padding:var(--space--small);max-width:50%}.snk-attach__main.sc-snk-attach{height:85%}.ez-box__container.sc-snk-attach{height:100%}";export{D as snk_attach}
@@ -0,0 +1 @@
1
+ import{ObjectUtils as t}from"@sankhyalabs/core";import{R as a}from"./p-8d256def.js";class e extends a{getData(a){const e=`cfg://auth/${a}`;return new Promise(((a,s)=>{this.loadResource(e).then((e=>{let s=t.stringToObject(e);s&&"object"==typeof s&&a(s)})).catch((t=>{s(t)}))}))}}var s;!function(t){t.INSERT="I",t.UPDATE="A",t.REMOVE="E",t.SHOW="C",t.CONFIG="F",t.CONFIG_NUMBER="N",t.CLONE="D",t.CONFIG_GRID="G"}(s||(s={}));export{s as A,e as a}
@@ -0,0 +1 @@
1
+ import{r as t,c as s,h as i,g as e}from"./p-d8d8169b.js";import{ElementIDUtils as h,ApplicationContext as r}from"@sankhyalabs/core";import{F as a}from"./p-ff1990ad.js";const o=class{constructor(i){t(this,i),this.valueChanged=s(this,"valueChanged",7),this._isSearchPlus=!1,this.config=void 0,this.value=void 0,this.errorMessage=void 0}async ezChangeListener(t){this.errorMessage=void 0,this.value=this._isSearchPlus?await this._searchInput.getValueAsync():this._searchInput.value,this.valueChanged.emit(this.value)}componentDidLoad(){this._element&&h.addIDInfo(this._element,"filterContentEditor")}doSearch(t,s,i=!1){const e=r.getContextValue("__SNK__APPLICATION__"),h=i?e.executePreparedSearchPlus:e.executePreparedSearch;return new Promise(((i,r)=>{h.bind(e)(t,s,this.config.props.searchContext).then((t=>{i(t)})).catch((t=>{r(t)}))}))}async setFocus(){this._searchInput.setFocus()}async clearValue(){this.value=this.config.value,this._searchInput&&(this._searchInput.value=this.config.value)}getInputItem(){var t;return this._isSearchPlus=1==(null===(t=this.config.props)||void 0===t?void 0:t.useSearchPlus),i("ez-tooltip",{active:!1===this.config.enabled,message:this.config.disabledMessage,type:"warning"},i(this._isSearchPlus?"ez-search-plus":"ez-search",{id:this.config.id,suppressEmptyOption:!0,value:this.config.value,label:this.config.label,enabled:this.config.enabled,ref:t=>this._searchInput=t,optionLoader:({mode:t,argument:s})=>this.doSearch(t,s,this._isSearchPlus),errorMessage:this.errorMessage}))}render(){if(this.config&&this.config.type===a.SEARCH)return this.getInputItem()}get _element(){return e(this)}};export{o as snk_filter_search}
@@ -1 +1 @@
1
- import{r as i,c as t,h as s,g as e,H as h}from"./p-d8d8169b.js";import{ElementIDUtils as a,ObjectUtils as o,ApplicationContext as n}from"@sankhyalabs/core";import{S as d}from"./p-ae2ebab7.js";import{R as l}from"./p-688dcb4c.js";import{buildFormConfigFromDataUnit as r}from"@sankhyalabs/ezui/dist/collection/utils/form";import{b as c,a as f,g,u as m,c as u}from"./p-8f73da95.js";import{a as v,G as p}from"./p-9019a32f.js";import{ApplicationUtils as C}from"@sankhyalabs/ezui/dist/collection/utils";import{U as b}from"./p-51209229.js";import"./p-3cdfd7fb.js";import"./p-65517fcf.js";import"./p-8d884fab.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-ff1990ad.js";const y=class{constructor(s){i(this,s),this.exit=t(this,"exit",7),this.actionClick=t(this,"actionClick",7),this.formItemsReady=t(this,"formItemsReady",7),this._customEditors=new Map,this._dataUnit=void 0,this._dataState=void 0,this._showFormConfig=!1,this._configManager=void 0,this.configName=void 0,this.recordsValidator=void 0,this.messagesBuilder=void 0,this.formLegacyConfigName=void 0,this.resourceID=void 0}async showConfig(){this._showFormConfig=!0}async hideConfig(){this._showFormConfig=!1}async addCustomEditor(i,t){if(this._form)return void this._form.addCustomEditor(i,t);const s=new Map(this._customEditors);s.set(i,t),this._customEditors=s}async setFieldProp(i,t,s){await this._form.setFieldProp(i,t,s)}async validate(){await this._form.validate()}closeConfig(){this.hideConfig()}dataunitReady(){a.addIDInfo(this._element,null,{dataUnit:this._dataUnit})}setCustomEditors(){if(this._form)for(const[i,t]of this._customEditors)this._form.addCustomEditor(i,t),this._customEditors.delete(i)}async componentDidRender(){this.setCustomEditors()}async componentWillLoad(){let i=this._element.parentElement;for(;i;){if("SNK-DATA-UNIT"===i.tagName.toUpperCase()){this._snkDataUnit=i,this._dataUnit=this._snkDataUnit.dataUnit,this._dataState=this._snkDataUnit.dataState,this._dataUnit?this.dataunitReady():this._snkDataUnit.addEventListener("dataUnitReady",(i=>{this._dataUnit=i.detail})),this._snkDataUnit.addEventListener("dataStateChange",this.handleDataStateChange.bind(this));break}i=i.parentElement}null==this.resourceID&&(this.resourceID=await l.getResourceID()),this._configManager=new d(this.configName,this.resourceID,void 0,this._dataUnit),this.addFormLegacyConfig(),await this._configManager.loadConfig()}async handleDataStateChange(i){var t;this._dataState=i.detail;const s=await this._snkDataUnit.getFieldsWithRmPrecision();for(const i of s||[]){if(!i)continue;const s=null===(t=this._dataState.rowMetadata)||void 0===t?void 0:t.getProp("rm_precision",i);(s||0===s)&&(await this.setFieldProp(i,"precision",s),await this.setFieldProp(i,"prettyPrecision",s))}}addFormLegacyConfig(){this.formLegacyConfigName&&this._configManager.addFormLegacyConfig(this.formLegacyConfigName)}render(){if(this._dataUnit&&this._dataState)return s("section",null,s("div",{class:"ez-row"},s("div",{class:"ez-col ez-col--sd-12"},s("ez-form",{ref:i=>this._form=i,key:"ezForm"+this._snkDataUnit.entityName,"data-element-id":"embedded",dataUnit:this._dataUnit,config:this._configManager.getConfig(this._dataUnit),recordsValidator:this.recordsValidator,class:this._showFormConfig?"snk-form__form--hidden":""}),this._showFormConfig&&s("snk-form-config",{messagesBuilder:this.messagesBuilder,dataUnit:this._dataUnit,configManager:this._configManager,onConfigClose:()=>this.closeConfig()}))))}get _element(){return e(this)}};y.style=".sc-snk-form-h{--snk-form__header--min-height:94px;display:block}.snk-form__form--hidden.sc-snk-form{display:none}";const k=class{constructor(s){i(this,s),this.configClose=t(this,"configClose",7),this.configChange=t(this,"configChange",7),this.guidesMap=new Map,this.availableFields=[],this.guidesList=[],this.groupsList=[],this.selectedGuide=void 0,this._formConfig={},this.configOptions=[],this.originalConfigSelected=void 0,this.configSelected=void 0,this.hasChanges=!1,this.optionConfigChanged=!1,this.dataUnit=void 0,this.configManager=void 0,this.ignoreReadOnlyFormFields=void 0,this.messagesBuilder=void 0}handleFieldConfigChanged(){this.hasChanges=!0}async handleFormConfigOptionSelected({detail:i}){this.configSelected=i,await this.loadConfigByUser(),this.selectedGuide=void 0,this.optionConfigChanged=!o.equals(this.configSelected,this.originalConfigSelected),this.configSelected.origin===b.DEFAULT&&(this.hasChanges=!1)}async handleAddFieldToGuide({detail:i}){var t;this.selectedGuide?(this.availableFields=[...this.availableFields.filter((t=>t.name!==i.name))],await(null===(t=this.refFieldsLayout)||void 0===t?void 0:t.addFieldToLayout(i))):this.showNoGuideSelectedDialog()}async handleSetFieldAsAvailable({detail:i}){this.availableFields.some((t=>t.name===i.name))||(this.availableFields=[...this.availableFields,i])}async handleRemoveFieldFromAvailable({detail:i}){this.availableFields=this.availableFields.filter((t=>t.name!==i.name))}observeSelectedGuide(i){var t;const s=null!==(t=this.guidesMap.get(null==i?void 0:i.name))&&void 0!==t?t:[];this.groupsList=[...s]}observeConfigManager(){this.loadFormConfig()}showNoGuideSelectedDialog(){const i=this.getMessage("snkFormConfig.noGuideSelected.title"),t=this.getMessage("snkFormConfig.noGuideSelected.message");C.alert(i,t)}getMessage(i,t){return this.messagesBuilder.getMessage(i,t)}async initializeUserConfig(){if(null!=this.configManager)try{const i=await this.configManager.fetchUserAvailableConfigs();this.configOptions=i;const t=null==this._formConfig||this._formConfig.defaultConfiguration?b.DEFAULT:b.USER;this.configSelected=i.find((i=>i.origin===t)),this.originalConfigSelected=i.find((i=>i.origin===t))}catch(i){console.error(this.getMessage("snkFormConfig.errors.failFetchUserConfig")),console.error(i)}}async loadConfigByUser(){this.configManager&&this.configSelected&&(this.isConfigDefaultSelected()?await this.handleLoadDefaultConfig():this.loadFormConfig())}async handleLoadDefaultConfig(){const i=await this.configManager.fetchDefaultConfig();if(i)return void this.loadFormConfig(i);const t=this.configManager.getEmptyConfig();t&&this.loadFormConfig(t)}isConfigDefaultSelected(){return this.configSelected.origin===b.DEFAULT}loadFormConfig(i){this._formConfig=i||this.getConfig(),this.loadGuides(),this.initializeAvailableFields()}initializeAvailableFields(){var i;if(null==(null===(i=this._formConfig)||void 0===i?void 0:i.fields))return;const t=[...this._formConfig.fields];this.availableFields=this.dataUnit.metadata.fields.filter((({name:i,visible:s,properties:e})=>{const h=t.some((({name:t})=>t===i));return h||!0!==e.visibleOnConfig||s?!0===s&&!1===h:e.visibleOnConfig}))}loadGuides(){var i;this.guidesList=[...c(this._formConfig,this.getMessage("snkFormConfig.form.mainArea"))],this.guidesMap=f(null===(i=this._formConfig)||void 0===i?void 0:i.fields,this.guidesList,this.dataUnit,this.getMessage("snkFormConfig.form.tabGeneral"))}getConfig(){let i=this.configManager.getConfig(this.dataUnit,!1);return i.fields&&0===i.fields.length&&(i=void 0),null==i&&(i=r(this.dataUnit)),o.copy(i)}handleSelectGuide({detail:i}){this.selectedGuide=i}handleLayoutChanged({detail:i}){this.hasChanges=!0,this.groupsList=[...i],this.guidesMap.set(this.selectedGuide.name,[...i])}getIsDefaultConfig(){var i;return(null===(i=this.configSelected)||void 0===i?void 0:i.origin)===b.DEFAULT&&!0===this.optionConfigChanged&&!1===this.hasChanges}getTabsToSave(){return this.guidesList.map((i=>({name:i.name,label:i.name===v.main?i.name:i.label,order:i.name===v.main?0:i.order,visible:i.visible})))}async handleSaveConfig(){var i;const t=await this.configManager.saveConfig(this.buildConfigToSave());this.configSelected=null===(i=this.configOptions)||void 0===i?void 0:i.find((i=>i.origin===(this.hasChanges?b.USER:b.DEFAULT))),this.originalConfigSelected=this.configSelected,this.hasChanges=!1,this.optionConfigChanged=!1,C.info(this.getMessage("snkFormConfig.info.successfullyConfigSaved"),{iconName:"check"}),this.configChange.emit(t)}buildConfigToSave(){if(this.getIsDefaultConfig()){const i=this._formConfig;return i.defaultConfiguration=!0,i}const i=o.copy(this._formConfig);return i.tabs=this.getTabsToSave(),i.fields=g(this.guidesMap),i.defaultConfiguration=!1,i}handleAvailableFieldListChanged({detail:i}){this.availableFields=[...i]}handleSetFieldListAsAvailable({detail:i}){this.availableFields=[...this.availableFields,...i]}handleGuideDeleted({detail:i}){var t,s;const e=i.name,h=null!==(t=this.guidesMap.get(e))&&void 0!==t?t:[],a=[];h.forEach((i=>a.push(...i.fields))),this.availableFields=[...this.availableFields,...a],this.guidesList=[...this.guidesList.filter((i=>i.name!==e))],this.guidesMap.delete(e),(null===(s=this.selectedGuide)||void 0===s?void 0:s.name)===e&&(this.selectedGuide=void 0),this.hasChanges=!0}handleGuideListChanged({detail:i}){this.hasChanges=!0,this.guidesList=[...i]}handleGuideRenamed({detail:i}){var t;const s=null!==(t=this.guidesMap.get(this.selectedGuide.name))&&void 0!==t?t:[],e=m(s,i);this.guidesMap.delete(this.selectedGuide.name),this.guidesMap.set(i,e);const h={name:i,label:i,visible:this.selectedGuide.visible,order:this.selectedGuide.order};this.guidesList=[...this.guidesList.map((i=>i.name===this.selectedGuide.name?h:i))],this.groupsList=[...e],this.selectedGuide=h,this.hasChanges=!0}handleCreateNewGuide(){const i=u(this.guidesList,this.getMessage.bind(this)),t={name:i,label:i,visible:!0,order:this.guidesList.length+1},s={name:p.noGroup,fields:[]};this.guidesList=[...this.guidesList,t],this.guidesMap.set(i,[s]),this.selectedGuide=t,this.hasChanges=!0}getGuideNames(){return[...this.guidesList.map((i=>i.name.toLowerCase())),this.getMessage("snkFormConfig.form.mainArea").toLowerCase()]}async componentWillRender(){if(null==this.messagesBuilder){const i=n.getContextValue("__SNK__APPLICATION__");this.messagesBuilder=i.messagesBuilder}}async componentWillLoad(){this.loadFormConfig(),await this.initializeUserConfig()}render(){return s(h,null,s("config-header",{configOptions:this.configOptions,selectedConfig:this.configSelected,messagesBuilder:this.messagesBuilder,hasChanges:this.hasChanges,optionConfigChanged:this.optionConfigChanged,onConfigClose:()=>this.configClose.emit(),onSaveConfig:async()=>await this.handleSaveConfig()}),s("div",{class:"ez-padding--medium"},s("div",{class:"ez-flex sidebarNavigator__container"},s("guides-configurator",{messagesBuilder:this.messagesBuilder,guidesList:this.guidesList,selectedGuide:this.selectedGuide,onGuideSelected:this.handleSelectGuide.bind(this),onGuideListChanged:this.handleGuideListChanged.bind(this),onCreateNewGuide:this.handleCreateNewGuide.bind(this),onGuideDeleted:this.handleGuideDeleted.bind(this)}),s("fields-layout",{ref:i=>this.refFieldsLayout=i,selectedGuide:this.selectedGuide,guideNames:this.getGuideNames(),groupsList:this.groupsList,messagesBuilder:this.messagesBuilder,dataUnit:this.dataUnit,onGuideRenamed:this.handleGuideRenamed.bind(this),onLayoutChanged:this.handleLayoutChanged.bind(this),onSetFieldListAsAvailable:this.handleSetFieldListAsAvailable.bind(this)}),s("fields-selector",{dataUnit:this.dataUnit,availableFields:this.availableFields,onFieldListChanged:this.handleAvailableFieldListChanged.bind(this),messagesBuilder:this.messagesBuilder}))))}static get watchers(){return{selectedGuide:["observeSelectedGuide"],configManager:["observeConfigManager"]}}};k.style='.sc-snk-form-config-h{display:flex;flex-direction:column;height:100vh;width:100vw;font-family:var(--font-pattern, "Roboto");background:white;color:#2b3a54;--snk-form-config-container-height:calc(100vh - 95px);outline:none}.sidebarNavigator__container.sc-snk-form-config{height:var(--snk-form-config-container-height);gap:20px;align-items:flex-start}.guide-header.sc-snk-form-config{display:flex;width:100%;padding-bottom:12px;border-bottom:1px solid #dce0e8;height:30px;font-weight:500;font-size:16px}';export{y as snk_form,k as snk_form_config}
1
+ import{r as i,c as t,h as s,g as e,H as h}from"./p-d8d8169b.js";import{ElementIDUtils as a,ObjectUtils as o,ApplicationContext as n}from"@sankhyalabs/core";import{S as d}from"./p-658f67a5.js";import{R as l}from"./p-688dcb4c.js";import{buildFormConfigFromDataUnit as r}from"@sankhyalabs/ezui/dist/collection/utils/form";import{b as c,a as f,g,u as m,c as u}from"./p-8f73da95.js";import{a as v,G as p}from"./p-9019a32f.js";import{ApplicationUtils as C}from"@sankhyalabs/ezui/dist/collection/utils";import{U as b}from"./p-8d256def.js";import"./p-c71dcb2d.js";import"./p-d75a732c.js";import"./p-8d884fab.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-ff1990ad.js";const y=class{constructor(s){i(this,s),this.exit=t(this,"exit",7),this.actionClick=t(this,"actionClick",7),this.formItemsReady=t(this,"formItemsReady",7),this._customEditors=new Map,this._dataUnit=void 0,this._dataState=void 0,this._showFormConfig=!1,this._configManager=void 0,this.configName=void 0,this.recordsValidator=void 0,this.messagesBuilder=void 0,this.formLegacyConfigName=void 0,this.resourceID=void 0}async showConfig(){this._showFormConfig=!0}async hideConfig(){this._showFormConfig=!1}async addCustomEditor(i,t){if(this._form)return void this._form.addCustomEditor(i,t);const s=new Map(this._customEditors);s.set(i,t),this._customEditors=s}async setFieldProp(i,t,s){await this._form.setFieldProp(i,t,s)}async validate(){await this._form.validate()}closeConfig(){this.hideConfig()}dataunitReady(){a.addIDInfo(this._element,null,{dataUnit:this._dataUnit})}setCustomEditors(){if(this._form)for(const[i,t]of this._customEditors)this._form.addCustomEditor(i,t),this._customEditors.delete(i)}async componentDidRender(){this.setCustomEditors()}async componentWillLoad(){let i=this._element.parentElement;for(;i;){if("SNK-DATA-UNIT"===i.tagName.toUpperCase()){this._snkDataUnit=i,this._dataUnit=this._snkDataUnit.dataUnit,this._dataState=this._snkDataUnit.dataState,this._dataUnit?this.dataunitReady():this._snkDataUnit.addEventListener("dataUnitReady",(i=>{this._dataUnit=i.detail})),this._snkDataUnit.addEventListener("dataStateChange",this.handleDataStateChange.bind(this));break}i=i.parentElement}null==this.resourceID&&(this.resourceID=await l.getResourceID()),this._configManager=new d(this.configName,this.resourceID,void 0,this._dataUnit),this.addFormLegacyConfig(),await this._configManager.loadConfig()}async handleDataStateChange(i){var t;this._dataState=i.detail;const s=await this._snkDataUnit.getFieldsWithRmPrecision();for(const i of s||[]){if(!i)continue;const s=null===(t=this._dataState.rowMetadata)||void 0===t?void 0:t.getProp("rm_precision",i);(s||0===s)&&(await this.setFieldProp(i,"precision",s),await this.setFieldProp(i,"prettyPrecision",s))}}addFormLegacyConfig(){this.formLegacyConfigName&&this._configManager.addFormLegacyConfig(this.formLegacyConfigName)}render(){if(this._dataUnit&&this._dataState)return s("section",null,s("div",{class:"ez-row"},s("div",{class:"ez-col ez-col--sd-12"},s("ez-form",{ref:i=>this._form=i,key:"ezForm"+this._snkDataUnit.entityName,"data-element-id":"embedded",dataUnit:this._dataUnit,config:this._configManager.getConfig(this._dataUnit),recordsValidator:this.recordsValidator,class:this._showFormConfig?"snk-form__form--hidden":""}),this._showFormConfig&&s("snk-form-config",{messagesBuilder:this.messagesBuilder,dataUnit:this._dataUnit,configManager:this._configManager,onConfigClose:()=>this.closeConfig()}))))}get _element(){return e(this)}};y.style=".sc-snk-form-h{--snk-form__header--min-height:94px;display:block}.snk-form__form--hidden.sc-snk-form{display:none}";const k=class{constructor(s){i(this,s),this.configClose=t(this,"configClose",7),this.configChange=t(this,"configChange",7),this.guidesMap=new Map,this.availableFields=[],this.guidesList=[],this.groupsList=[],this.selectedGuide=void 0,this._formConfig={},this.configOptions=[],this.originalConfigSelected=void 0,this.configSelected=void 0,this.hasChanges=!1,this.optionConfigChanged=!1,this.dataUnit=void 0,this.configManager=void 0,this.ignoreReadOnlyFormFields=void 0,this.messagesBuilder=void 0}handleFieldConfigChanged(){this.hasChanges=!0}async handleFormConfigOptionSelected({detail:i}){this.configSelected=i,await this.loadConfigByUser(),this.selectedGuide=void 0,this.optionConfigChanged=!o.equals(this.configSelected,this.originalConfigSelected),this.configSelected.origin===b.DEFAULT&&(this.hasChanges=!1)}async handleAddFieldToGuide({detail:i}){var t;this.selectedGuide?(this.availableFields=[...this.availableFields.filter((t=>t.name!==i.name))],await(null===(t=this.refFieldsLayout)||void 0===t?void 0:t.addFieldToLayout(i))):this.showNoGuideSelectedDialog()}async handleSetFieldAsAvailable({detail:i}){this.availableFields.some((t=>t.name===i.name))||(this.availableFields=[...this.availableFields,i])}async handleRemoveFieldFromAvailable({detail:i}){this.availableFields=this.availableFields.filter((t=>t.name!==i.name))}observeSelectedGuide(i){var t;const s=null!==(t=this.guidesMap.get(null==i?void 0:i.name))&&void 0!==t?t:[];this.groupsList=[...s]}observeConfigManager(){this.loadFormConfig()}showNoGuideSelectedDialog(){const i=this.getMessage("snkFormConfig.noGuideSelected.title"),t=this.getMessage("snkFormConfig.noGuideSelected.message");C.alert(i,t)}getMessage(i,t){return this.messagesBuilder.getMessage(i,t)}async initializeUserConfig(){if(null!=this.configManager)try{const i=await this.configManager.fetchUserAvailableConfigs();this.configOptions=i;const t=null==this._formConfig||this._formConfig.defaultConfiguration?b.DEFAULT:b.USER;this.configSelected=i.find((i=>i.origin===t)),this.originalConfigSelected=i.find((i=>i.origin===t))}catch(i){console.error(this.getMessage("snkFormConfig.errors.failFetchUserConfig")),console.error(i)}}async loadConfigByUser(){this.configManager&&this.configSelected&&(this.isConfigDefaultSelected()?await this.handleLoadDefaultConfig():this.loadFormConfig())}async handleLoadDefaultConfig(){const i=await this.configManager.fetchDefaultConfig();if(i)return void this.loadFormConfig(i);const t=this.configManager.getEmptyConfig();t&&this.loadFormConfig(t)}isConfigDefaultSelected(){return this.configSelected.origin===b.DEFAULT}loadFormConfig(i){this._formConfig=i||this.getConfig(),this.loadGuides(),this.initializeAvailableFields()}initializeAvailableFields(){var i;if(null==(null===(i=this._formConfig)||void 0===i?void 0:i.fields))return;const t=[...this._formConfig.fields];this.availableFields=this.dataUnit.metadata.fields.filter((({name:i,visible:s,properties:e})=>{const h=t.some((({name:t})=>t===i));return h||!0!==e.visibleOnConfig||s?!0===s&&!1===h:e.visibleOnConfig}))}loadGuides(){var i;this.guidesList=[...c(this._formConfig,this.getMessage("snkFormConfig.form.mainArea"))],this.guidesMap=f(null===(i=this._formConfig)||void 0===i?void 0:i.fields,this.guidesList,this.dataUnit,this.getMessage("snkFormConfig.form.tabGeneral"))}getConfig(){let i=this.configManager.getConfig(this.dataUnit,!1);return i.fields&&0===i.fields.length&&(i=void 0),null==i&&(i=r(this.dataUnit)),o.copy(i)}handleSelectGuide({detail:i}){this.selectedGuide=i}handleLayoutChanged({detail:i}){this.hasChanges=!0,this.groupsList=[...i],this.guidesMap.set(this.selectedGuide.name,[...i])}getIsDefaultConfig(){var i;return(null===(i=this.configSelected)||void 0===i?void 0:i.origin)===b.DEFAULT&&!0===this.optionConfigChanged&&!1===this.hasChanges}getTabsToSave(){return this.guidesList.map((i=>({name:i.name,label:i.name===v.main?i.name:i.label,order:i.name===v.main?0:i.order,visible:i.visible})))}async handleSaveConfig(){var i;const t=await this.configManager.saveConfig(this.buildConfigToSave());this.configSelected=null===(i=this.configOptions)||void 0===i?void 0:i.find((i=>i.origin===(this.hasChanges?b.USER:b.DEFAULT))),this.originalConfigSelected=this.configSelected,this.hasChanges=!1,this.optionConfigChanged=!1,C.info(this.getMessage("snkFormConfig.info.successfullyConfigSaved"),{iconName:"check"}),this.configChange.emit(t)}buildConfigToSave(){if(this.getIsDefaultConfig()){const i=this._formConfig;return i.defaultConfiguration=!0,i}const i=o.copy(this._formConfig);return i.tabs=this.getTabsToSave(),i.fields=g(this.guidesMap),i.defaultConfiguration=!1,i}handleAvailableFieldListChanged({detail:i}){this.availableFields=[...i]}handleSetFieldListAsAvailable({detail:i}){this.availableFields=[...this.availableFields,...i]}handleGuideDeleted({detail:i}){var t,s;const e=i.name,h=null!==(t=this.guidesMap.get(e))&&void 0!==t?t:[],a=[];h.forEach((i=>a.push(...i.fields))),this.availableFields=[...this.availableFields,...a],this.guidesList=[...this.guidesList.filter((i=>i.name!==e))],this.guidesMap.delete(e),(null===(s=this.selectedGuide)||void 0===s?void 0:s.name)===e&&(this.selectedGuide=void 0),this.hasChanges=!0}handleGuideListChanged({detail:i}){this.hasChanges=!0,this.guidesList=[...i]}handleGuideRenamed({detail:i}){var t;const s=null!==(t=this.guidesMap.get(this.selectedGuide.name))&&void 0!==t?t:[],e=m(s,i);this.guidesMap.delete(this.selectedGuide.name),this.guidesMap.set(i,e);const h={name:i,label:i,visible:this.selectedGuide.visible,order:this.selectedGuide.order};this.guidesList=[...this.guidesList.map((i=>i.name===this.selectedGuide.name?h:i))],this.groupsList=[...e],this.selectedGuide=h,this.hasChanges=!0}handleCreateNewGuide(){const i=u(this.guidesList,this.getMessage.bind(this)),t={name:i,label:i,visible:!0,order:this.guidesList.length+1},s={name:p.noGroup,fields:[]};this.guidesList=[...this.guidesList,t],this.guidesMap.set(i,[s]),this.selectedGuide=t,this.hasChanges=!0}getGuideNames(){return[...this.guidesList.map((i=>i.name.toLowerCase())),this.getMessage("snkFormConfig.form.mainArea").toLowerCase()]}async componentWillRender(){if(null==this.messagesBuilder){const i=n.getContextValue("__SNK__APPLICATION__");this.messagesBuilder=i.messagesBuilder}}async componentWillLoad(){this.loadFormConfig(),await this.initializeUserConfig()}render(){return s(h,null,s("config-header",{configOptions:this.configOptions,selectedConfig:this.configSelected,messagesBuilder:this.messagesBuilder,hasChanges:this.hasChanges,optionConfigChanged:this.optionConfigChanged,onConfigClose:()=>this.configClose.emit(),onSaveConfig:async()=>await this.handleSaveConfig()}),s("div",{class:"ez-padding--medium"},s("div",{class:"ez-flex sidebarNavigator__container"},s("guides-configurator",{messagesBuilder:this.messagesBuilder,guidesList:this.guidesList,selectedGuide:this.selectedGuide,onGuideSelected:this.handleSelectGuide.bind(this),onGuideListChanged:this.handleGuideListChanged.bind(this),onCreateNewGuide:this.handleCreateNewGuide.bind(this),onGuideDeleted:this.handleGuideDeleted.bind(this)}),s("fields-layout",{ref:i=>this.refFieldsLayout=i,selectedGuide:this.selectedGuide,guideNames:this.getGuideNames(),groupsList:this.groupsList,messagesBuilder:this.messagesBuilder,dataUnit:this.dataUnit,onGuideRenamed:this.handleGuideRenamed.bind(this),onLayoutChanged:this.handleLayoutChanged.bind(this),onSetFieldListAsAvailable:this.handleSetFieldListAsAvailable.bind(this)}),s("fields-selector",{dataUnit:this.dataUnit,availableFields:this.availableFields,onFieldListChanged:this.handleAvailableFieldListChanged.bind(this),messagesBuilder:this.messagesBuilder}))))}static get watchers(){return{selectedGuide:["observeSelectedGuide"],configManager:["observeConfigManager"]}}};k.style='.sc-snk-form-config-h{display:flex;flex-direction:column;height:100vh;width:100vw;font-family:var(--font-pattern, "Roboto");background:white;color:#2b3a54;--snk-form-config-container-height:calc(100vh - 95px);outline:none}.sidebarNavigator__container.sc-snk-form-config{height:var(--snk-form-config-container-height);gap:20px;align-items:flex-start}.guide-header.sc-snk-form-config{display:flex;width:100%;padding-bottom:12px;border-bottom:1px solid #dce0e8;height:30px;font-weight:500;font-size:16px}';export{y as snk_form,k as snk_form_config}
@@ -0,0 +1 @@
1
+ import{r as i,c as t,h as s,H as l}from"./p-d8d8169b.js";import{ObjectUtils as e,ApplicationContext as o}from"@sankhyalabs/core";const n=class{constructor(s){i(this,s),this.valueChanged=t(this,"valueChanged",7),this._ezListSource=[],this.config=void 0,this.rightListSlotBuilder=void 0,this.maxHeightList="",this.value=void 0,this.errorMessage=void 0}async reloadList(){this.loadListSource()}observeConfig(){var i,t;null===(t=null===(i=this._searchElement)||void 0===i?void 0:i.clearValue)||void 0===t||t.call(i)}ezListChangeListener(i){var t,s;this.errorMessage=void 0;const l=e.copy(this.config);null===(t=this.getListConfigValue(l))||void 0===t||t.forEach((t=>{var s,l;t&&t.id===(null===(s=i.detail)||void 0===s?void 0:s.id)&&(t.check=null===(l=i.detail)||void 0===l?void 0:l.check)})),this.config=e.copy(l),this.valueChanged.emit(null===(s=this.config)||void 0===s?void 0:s.value)}loadListSource(){var i;this._ezListSource=[],null===(i=this.getListConfigValue(this.config))||void 0===i||i.forEach((i=>{i&&this._ezListSource.push({label:`${i.id} - ${i.label}`,check:i.check,id:i.id})}))}componentDidLoad(){var i,t,s,l,e;let n=this.getListConfigValue(this.config),a=[];Array.isArray(n)?a=n:a.push(null===(t=null===(i=this.config)||void 0===i?void 0:i.value)||void 0===t?void 0:t.members),this.config.value=a,this._entityName=null===(e=null===(l=null===(s=this.config)||void 0===s?void 0:s.props)||void 0===l?void 0:l.searchContext)||void 0===e?void 0:e.entity,this._application=o.getContextValue("__SNK__APPLICATION__"),this.loadListSource()}optionLoader(i){var t,s,l,e,o,n;const{mode:a,argument:d}=i;if(void 0===this._application)return;const v=null!==(l=null===(s=null===(t=this.config)||void 0===t?void 0:t.props)||void 0===s?void 0:s.searchContext)&&void 0!==l?l:{},r=null===(o=null===(e=this.config)||void 0===e?void 0:e.props)||void 0===o?void 0:o.criteria,h=Object.assign(Object.assign({criteria:r},v),{entityDescription:null===(n=this.config)||void 0===n?void 0:n.label,entity:this._entityName});return this._application.executePreparedSearch(a,d,h)}onEzSearchChange(i){var t,s,l,o;const n=e.isEmptySafetyCheck(i.detail),a=null===(t=this.getListConfigValue(this.config))||void 0===t?void 0:t.find((t=>{var s;return("number"==typeof t.id?String(t.id):t.id)===(null===(s=i.detail)||void 0===s?void 0:s.value)}));n||a||(this.config=Object.assign(Object.assign({},this.config),{value:[...null!==(l=null===(s=this.config)||void 0===s?void 0:s.value)&&void 0!==l?l:[],{id:i.detail.value,check:!0,label:i.detail.label}]}),this.loadListSource(),this.value=this.config.value,this.valueChanged.emit(null===(o=this.config)||void 0===o?void 0:o.value))}getMessage(i,t){var s;return null===(s=this._application)||void 0===s?void 0:s.messagesBuilder.getMessage(i,t)}getListConfigValue(i){var t,s,l,e;return null!==(e=null!==(s=null===(t=i.value)||void 0===t?void 0:t.elements)&&void 0!==s?s:null===(l=null==i?void 0:i.value)||void 0===l?void 0:l.members)&&void 0!==e?e:null==i?void 0:i.value}render(){var i,t,e,o,n;const a=1==(null===(i=this.config.props)||void 0===i?void 0:i.useSearchPlus);return s(l,null,s("ez-tooltip",{active:!this.config.enabled,message:this.config.disabledMessage,type:"warning"},s(a?"ez-search-plus":"ez-search",{ref:i=>this._searchElement=i,optionLoader:i=>this.optionLoader(i),label:null===(t=this.config)||void 0===t?void 0:t.label,enabled:null===(e=this.config)||void 0===e?void 0:e.enabled,onEzChange:i=>this.onEzSearchChange(i),suppressEmptyOption:!0,stopPropagateEnterKeyEvent:!0}),(null===(o=this._ezListSource)||void 0===o?void 0:o.length)>0&&s("label",{class:"label"},this.getMessage("snkEntityList.selected")),s("div",{style:this.maxHeightList?{"max-height":this.maxHeightList}:{},class:{"snk-entity-list--overflow":!!this.maxHeightList}},s("ez-list",{ref:i=>this._ezList=i,id:"snkEntityList",enabled:null===(n=this.config)||void 0===n?void 0:n.enabled,listMode:"check",dataSource:this._ezListSource,hoverFeedback:!0,itemSlotBuilder:this.rightListSlotBuilder,onEzCheckChange:i=>this.ezListChangeListener(i)})),this.errorMessage&&s("span",{class:"ez-text ez-text--small ez-text--error ez-margin-horizontal--medium"},this.errorMessage)))}static get watchers(){return{config:["observeConfig"]}}};n.style=".sc-snk-entity-list-h{--snk-entity-list--label--font-size:var(--text--medium, 14px);--snk-entity-list--label--font-family:var(--font-pattern, Arial);--snk-entity-list--label--color:var(--title--primary, #000);--snk-entity-list--label--disabled--color:var(--text--disable, #AFB6C0)}.label.sc-snk-entity-list{flex-shrink:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--snk-entity-list--label--color);font-size:var(--snk-entity-list--label--font-size);font-family:var(--snk-entity-list--label--font-family);cursor:default;padding-left:var(--space--small);padding-bottom:var(--space--extra-small)}.snk-entity-list--overflow.sc-snk-entity-list{overflow:auto}.snk-entity-list--overflow.sc-snk-entity-list::-webkit-scrollbar{width:var(--space--small);min-width:var(--space--small);max-width:var(--space--small)}";export{n as snk_entity_list}
@@ -1 +1 @@
1
- import{r as s,h as i,H as e,g as t}from"./p-d8d8169b.js";import{ObjectUtils as a,StringUtils as r,ApplicationContext as n,ElementIDUtils as o}from"@sankhyalabs/core";import{P as l,b as c,a as h}from"./p-7535d592.js";import"./p-65517fcf.js";import"./p-0f3698af.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-e63cc25f.js";import"./p-ff1990ad.js";import"./p-51209229.js";import"./p-9019a32f.js";import"./p-8d884fab.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";const u=class{constructor(i){s(this,i),this._mdByName={},this._startHighlightTag="<span class='card-item__highlight'>",this._endHighlightTag="</span>",this._specialCharsRegex=/[[.\-\$\+\*,_\&\(\)%\/\\#@!:\|\=\'\"]/gim,this._charsWithAccentuation="ÁÉÍÓÚ_ÃÕ_ÂÊÎÔÛ_ÀÈÌÒÙ_Ü_Ç_áéíóú_ãõ_âêîôû_àèìòù_ü_ç",this._charsWithoutAccentuation="AEIOU_AO_AEIOU_AEIOU_U_C_aeiou_ao_aeiou_aeiou_u_c",this._changeDeboucingTimeout=null,this._limitCharsToSearch=3,this._deboucingTime=450,this._gridDataSource=[],this.pesquisaFetcher=new l,this._itemList=void 0,this._startLoading=!1,this._presentationMode="list",this._currentView=void 0,this._valideDataSource=!1,this.searchLoader=void 0,this.treeLoader=void 0,this.selectItem=void 0,this.entityName=void 0,this.argument=void 0,this.isHierarchyEntity=!1,this.allowsNonAnalytic=!1}observeArgument(){this._textInput&&(this._textInput.value=this.argument)}clearSearch(){this.argument="",this._itemList=void 0}buildDetails(s,i){let e={};for(let t=0;t<s.length;t++){const a=s[t],r=i[a.fieldName];e[a.description]=this.highlightValue(i.__matchFields,a.options&&a.options[r]||r,s,!0)}return e}buildFirstFields(s,i,e=6){return s&&Array.isArray(s)&&s.forEach((s=>{let e=this.removeReference(i,this._mdByName[s]);e&&i.unshift(e)})),i=i.slice(0,e)}doSearch(s){this.searchLoader&&"function"==typeof this.searchLoader&&(this._startLoading=!0,this.searchLoader(s).then((s=>{s&&this.processSearchResponse(s)})).finally((()=>{this._startLoading=!1})))}processSearchResponse(s){let i=(s=a.stringToObject(s.json.$)).descriptionField,e=s.pkField;e&&(this._gridMetadata=c(s),this._gridDataSource=[...s.data],this._pkField=e,this._descriptionField=i,this._itemList=this.buildCardItemList(s,e,i))}buildCardItemList(s,i,e){var t;return null===(t=s.data)||void 0===t?void 0:t.map((t=>{var a;let r=this.filterFieldsMetadata(s,t),n=this.buildFirstFields(t.__matchFields,r);return{key:this.highlightValue(t.__matchFields,null===(a=t[i])||void 0===a?void 0:a.toString(),n,!0),title:e?this.highlightValue(t.__matchFields,t[e],n,!0):"",details:this.buildDetails(n,t)}}))}filterFieldsMetadata(s,i){return s.fieldsMetadata.filter((e=>{let t=!r.isEmpty(i[e.fieldName])&&!1!==e.visible&&"B"!==e.type&&s.pkField!==e.fieldName&&s.descriptionField!==e.fieldName&&(e.isPrimaryKey||!e.isLinkField)&&!("S"===e.type&&"H"===e.presentationType);return t&&(this._mdByName[e.fieldName]=e),("string"!=typeof i[e.fieldName]||!(i[e.fieldName].indexOf("<img")>-1||i[e.fieldName].indexOf("<svg")>-1))&&t}))}removeAtIndex(s,i){if(i>=0&&i<s.length)return s.splice(i,1)[0]}removeReference(s,i){let e=this.indexOf(s,i);return this.removeAtIndex(s,e)}indexOf(s,i){let e=-1;return Array.isArray(s)&&this.find(s,((s,t)=>(e=t,this.equals(i,s)))),e}equals(s,i){return a.objectToString(s)===a.objectToString(i)}find(s,i){if(s)for(let e=0,t=s.length;e<t;e++)if(i(s[e],e,s))return s[e]}highlightValue(s,i,e,t){let a=this.replaceHtmlEntities(i);if(this.argument&&(t||this.isIn(s,e.fieldName))){const s=this.getArgumentNumber();let i=(isNaN(s)?this.argument:s.toString()).split(/%|,|\s+/),t=0,r=this.replaceAccentuatedChars(a);i.forEach((s=>{if(s){s=this.replaceAccentuatedChars(s);let i=this.getSpecialCharacters(s);null!=i&&i.length>0&&(s=this.removeSpecialCharacters(s)),(e.mask||"CGC_CPF"===e.uiType||"Phone"===e.uiType)&&(s=s.split("").join("\\.?\\-?\\/?\\(?\\)?"));let n=new RegExp(s,"ig");n.lastIndex=t;let o=n.exec(r);if(o&&o.length>0){t=o.index;let s=o[0].length,i=a.substring(t,t+s),e=(null==i?void 0:i.trim())?this._startHighlightTag+i+this._endHighlightTag:"",n=a.substring(0,t),l=a.substring(t+s);a=n+e+l,t+=e.length,r=this.replaceAccentuatedChars(a)}}}))}return a}replaceHtmlEntities(s){return null==s?s:String(s).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}replaceAccentuatedChars(s){return null==s?s:this.replaceToSpace(s,["&amp;","&lt;","&gt;","&quot;"]).replace(/[^\w ]/g,(s=>{let i=this._charsWithAccentuation.indexOf(s);return i>-1&&(s=this._charsWithoutAccentuation.charAt(i)),s||""}))}replaceToSpace(s,i=[]){return null==s||i.forEach((i=>{const e=new RegExp(i,"g");let t="";for(let s=0;s<i.length;s++)t+=" ";s=String(s).replace(e,t)})),s}isIn(s,i){return this.indexOf(s,i)>-1}getSpecialCharacters(s){let i,e=[];for(;i=this._specialCharsRegex.exec(s);)e.push(s[i.index]);return e}removeSpecialCharacters(s){return this.getSpecialCharacters(s).forEach((i=>{s=this.replaceAll(s,i,"")})),s}replaceAll(s,i,e){let t=(null!=s?s:"").indexOf(i);for(;t>-1;)t=(s=s.replace(i,e)).indexOf(i);return s}getArgumentNumber(){return Number(this.argument||void 0)}createOption(s){let{key:i,title:e}=s;const t=new RegExp(this._startHighlightTag,"g"),a=new RegExp(this._endHighlightTag,"g");e=r.decodeHtmlEntities(e);const n={value:null==i?void 0:i.replace(t,"").replace(a,""),label:null==e?void 0:e.replace(t,"").replace(a,"")};this.selectItem(n)}onChangeValue(s){var i;if(this.clearDeboucingTimeout(),this._startLoading)return void(this._changeDeboucingTimeout=setTimeout((()=>{this.onChangeValue(s)}),this._deboucingTime));if(this.argument=(s.detail||"").trim(),this.isHierarchyEntity&&"list"===this._presentationMode)return void(null===(i=this._pesquisaTree)||void 0===i||i.applyFilter());const e=this.getArgumentNumber();this.argument&&(!isNaN(e)||this.argument.length>=this._limitCharsToSearch)?this._changeDeboucingTimeout=setTimeout((()=>{this.doSearch(this.argument),this._valideDataSource=!0}),this._deboucingTime):(this._itemList=void 0,this._gridDataSource=[],this._valideDataSource=!1)}clearDeboucingTimeout(){this._changeDeboucingTimeout&&(clearTimeout(this._changeDeboucingTimeout),this._changeDeboucingTimeout=void 0)}onClickSearch(){this.doSearch((this.argument||"").trim()),this._valideDataSource=!0}getMessageView(){if(this._startLoading)return this.getMessage("snkPesquisa.search.waitMessage");if(!this._itemList)return this.getMessage("snkPesquisa.search.initialMessage");const s=this._itemList.length;return s<1?this.getMessage("snkPesquisa.search.noResultsMessage"):1===s?this.getMessage("snkPesquisa.search.resultsFoundSingular"):this.getMessage("snkPesquisa.search.resultsFoundPlural",{COUNT:s})}async componentWillLoad(){var s;this._application=n.getContextValue("__SNK__APPLICATION__"),this._messagesBuilder=null===(s=this._application)||void 0===s?void 0:s.messagesBuilder;const i=await this.pesquisaFetcher.loadPresentationConfig(this.entityName);this._presentationMode="list"===i?"list":"table"}async componentDidLoad(){o.addIDInfo(this._element),await this.chooseViewMode()}getMessage(s,i){return this._messagesBuilder.getMessage(s,i)}async handleChangeViewMode(){this._presentationMode="list"===this._presentationMode?"table":"list",await this.chooseViewMode(),await this.pesquisaFetcher.savePresentationConfig(this.entityName,this._presentationMode)}async chooseViewMode(){var s,i;if("list"!==this._presentationMode)return await(null===(s=this._viewStack)||void 0===s?void 0:s.show(h.GRID)),void(this._currentView=h.GRID);const e=this.isHierarchyEntity?h.TREE:h.CARDS;await(null===(i=this._viewStack)||void 0===i?void 0:i.show(e)),this._currentView=e}hideLimitMessage(){return!this._itemList||this._itemList.length<100}hideRecordsMessage(){return"list"===this._presentationMode&&this.isHierarchyEntity}getButtonModeInfo(){return"list"===this._presentationMode?{iconName:"table",title:this.getMessage("snkPesquisa.viewMode.tableMode")}:this.isHierarchyEntity?{iconName:"hierarchical-tree",title:this.getMessage("snkPesquisa.viewMode.tableMode")}:{iconName:"list",title:this.getMessage("snkPesquisa.viewMode.listMode")}}render(){var s,t;return i(e,null,i("div",{class:"snk-pesquisa"},i("div",{class:"snk-pesquisa__input"},i("ez-text-input",{label:this.getMessage("snkPesquisa.search.label"),class:"ez-margin-right--medium",canShowError:!1,ref:s=>this._textInput=s,onEzChange:s=>this.onChangeValue(s),value:this.argument,"data-element-id":"searchInput"},i("ez-icon",{slot:"leftIcon",iconName:"search"}),this.argument&&(null===(s=this._textInput)||void 0===s?void 0:s.value)?i("button",{slot:"rightIcon",class:"snk-pesquisa__btn",onClick:()=>this.clearSearch()},i("ez-icon",{iconName:"close"})):void 0),i("ez-button",{class:"ez-button--primary",label:this.getMessage("snkPesquisa.search.button"),onClick:()=>this.onClickSearch()}),i("ez-button",{class:"ez-margin-left--medium",mode:"icon",iconName:this.getButtonModeInfo().iconName,title:this.getButtonModeInfo().title,onClick:async()=>await this.handleChangeViewMode()})),i("div",{class:"snk-pesquisa__records-label "+(this._currentView===h.TREE?"hidden":"")},i("label",{class:"snk-pesquisa__records "+(this.hideRecordsMessage()?"hidden":"")},this.getMessageView()),i("label",{class:"snk-pesquisa__records-limit "+(this.hideLimitMessage()?"hidden":"")},this.getMessage("snkPesquisa.search.limitMessage"))),i("div",{class:"snk-pesquisa__content"},i("ez-view-stack",{ref:s=>this._viewStack=s,"data-element-id":"simple-crud"},i("stack-item",null,this._valideDataSource&&i("pesquisa-grid",{metadata:this._gridMetadata,dataSource:this._gridDataSource,pkField:this._pkField,descriptionField:this._descriptionField,entityName:this.entityName,shouldLoadConfig:this._currentView===h.GRID,onPesquisaGridSelectItem:({detail:s})=>this.selectItem(s)})),i("stack-item",null,i("div",{class:"snk-pesquisa__cards-container"},null===(t=this._itemList)||void 0===t?void 0:t.map((s=>i("ez-card-item",{onEzClick:s=>this.createOption(s.detail),item:s}))))),i("stack-item",null,i("pesquisa-tree",{ref:s=>this._pesquisaTree=s,argument:this.argument,treeLoader:this.treeLoader,allowsNonAnalytic:this.allowsNonAnalytic,shouldLoadTree:this._currentView===h.TREE,onPesquisaTreeSelectItem:({detail:s})=>this.selectItem(s),messagesBuilder:this._messagesBuilder}))))))}get _element(){return t(this)}static get watchers(){return{argument:["observeArgument"]}}};u.style=".sc-snk-pesquisa-h{--snk-pesquisa--font-size:var(--text--medium, 14px);--snk-pesquisa--font-family:var(--font-pattern, Arial);--snk-pesquisa--font-weight:var(--text-weight--medium, 400);--snk-pesquisa__records--color:var(--text--primary, #626e82);--snk-pesquisa__records--color-secondary:var(--text--secondary, #626e82);--snk-pesquisa__records--padding-vertical:var(--space--medium, 12px);--snk-pesquisa__content--padding-right:var(--space--small, 6px);--snk-pesquisa__btn--color:var(--title--primary, #2B3A54);--snk-pesquisa__btn-disabled--color:var(--text--disable, #AFB6C0);--snk-pesquisa__btn-hover--color:var(--color--primary, #4e4e4e);--snk-pesquisa__scrollbar--color-default:var(--scrollbar--default, #626e82);--snk-pesquisa__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--snk-pesquisa__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--snk-pesquisa__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--snk-pesquisa__scrollbar--border-radius:var(--border--radius-small, 6px);--snk-pesquisa__scrollbar--width:var(--space--small, 6px);height:100%;display:flex;flex-direction:column;overflow-y:auto}.snk-pesquisa.sc-snk-pesquisa{display:flex;flex-direction:column;height:100%}.snk-pesquisa__input.sc-snk-pesquisa{display:flex;width:100%;box-sizing:border-box;padding-top:4px;padding-right:4px}.snk-pesquisa__input.sc-snk-pesquisa ez-icon.sc-snk-pesquisa{--ez-icon--color:inherit;font-weight:var(--text-weight--large, 600)}.snk-pesquisa__content.sc-snk-pesquisa{display:flex;flex-direction:column;overflow-y:hidden;scrollbar-width:thin;scrollbar-color:var(--snk-pesquisa__scrollbar--color-clicked) var(--snk-pesquisa__scrollbar--color-background);padding-right:var(--snk-pesquisa__content--padding-right);height:100vh}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar{background-color:var(--snk-pesquisa__scrollbar--color-background);width:var(--snk-pesquisa__scrollbar--width);max-width:var(--snk-pesquisa__scrollbar--width);min-width:var(--snk-pesquisa__scrollbar--width)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-track{background-color:var(--snk-pesquisa__scrollbar--color-background);border-radius:var(--snk-pesquisa__scrollbar--border-radius)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb{background-color:var(--snk-pesquisa__scrollbar--color-default);border-radius:var(--snk-pesquisa__scrollbar--border-radius)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:vertical:hover,.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--snk-pesquisa__scrollbar--color-hover)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:vertical:active,.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--snk-pesquisa__scrollbar--color-clicked)}.snk-pesquisa__records-label.sc-snk-pesquisa{display:flex;flex-direction:row;justify-content:space-between;font-family:var(--snk-pesquisa--font-family);font-weight:var(--snk-pesquisa--font-weight);font-size:var(--snk-pesquisa--font-size);padding-bottom:var(--snk-pesquisa__records--padding-vertical);padding-top:var(--snk-pesquisa__records--padding-vertical)}.snk-pesquisa__records-label.hidden.sc-snk-pesquisa{display:none}.snk-pesquisa__records.sc-snk-pesquisa{color:var(--snk-pesquisa__records--color)}.snk-pesquisa__records-limit.sc-snk-pesquisa{color:var(--snk-pesquisa__records--color-secondary)}.snk-pesquisa__records-limit.hidden.sc-snk-pesquisa,.snk-pesquisa__records.hidden.sc-snk-pesquisa{visibility:hidden}.snk-pesquisa__btn.sc-snk-pesquisa{outline:none;border:none;background:none;cursor:pointer;color:var(--snk-pesquisa__btn--color)}.snk-pesquisa__btn.sc-snk-pesquisa:disabled{cursor:unset;color:var(--snk-pesquisa__btn-disabled--color)}.snk-pesquisa__btn.sc-snk-pesquisa:disabled:hover{cursor:unset;color:var(--snk-pesquisa__btn-disabled--color)}.snk-pesquisa__btn.sc-snk-pesquisa:hover{color:var(--snk-pesquisa__btn-hover--color)}.snk-pesquisa__cards-container.sc-snk-pesquisa{height:100%;overflow-y:auto}";export{u as snk_pesquisa}
1
+ import{r as s,h as i,H as e,g as t}from"./p-d8d8169b.js";import{ObjectUtils as a,StringUtils as r,ApplicationContext as n,ElementIDUtils as o}from"@sankhyalabs/core";import{P as l,b as c,a as h}from"./p-bf017a1f.js";import"./p-d75a732c.js";import"./p-0f3698af.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-9062d640.js";import"./p-ff1990ad.js";import"./p-8d256def.js";import"./p-9019a32f.js";import"./p-8d884fab.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";const u=class{constructor(i){s(this,i),this._mdByName={},this._startHighlightTag="<span class='card-item__highlight'>",this._endHighlightTag="</span>",this._specialCharsRegex=/[[.\-\$\+\*,_\&\(\)%\/\\#@!:\|\=\'\"]/gim,this._charsWithAccentuation="ÁÉÍÓÚ_ÃÕ_ÂÊÎÔÛ_ÀÈÌÒÙ_Ü_Ç_áéíóú_ãõ_âêîôû_àèìòù_ü_ç",this._charsWithoutAccentuation="AEIOU_AO_AEIOU_AEIOU_U_C_aeiou_ao_aeiou_aeiou_u_c",this._changeDeboucingTimeout=null,this._limitCharsToSearch=3,this._deboucingTime=450,this._gridDataSource=[],this.pesquisaFetcher=new l,this._itemList=void 0,this._startLoading=!1,this._presentationMode="list",this._currentView=void 0,this._valideDataSource=!1,this.searchLoader=void 0,this.treeLoader=void 0,this.selectItem=void 0,this.entityName=void 0,this.argument=void 0,this.isHierarchyEntity=!1,this.allowsNonAnalytic=!1}observeArgument(){this._textInput&&(this._textInput.value=this.argument)}clearSearch(){this.argument="",this._itemList=void 0}buildDetails(s,i){let e={};for(let t=0;t<s.length;t++){const a=s[t],r=i[a.fieldName];e[a.description]=this.highlightValue(i.__matchFields,a.options&&a.options[r]||r,s,!0)}return e}buildFirstFields(s,i,e=6){return s&&Array.isArray(s)&&s.forEach((s=>{let e=this.removeReference(i,this._mdByName[s]);e&&i.unshift(e)})),i=i.slice(0,e)}doSearch(s){this.searchLoader&&"function"==typeof this.searchLoader&&(this._startLoading=!0,this.searchLoader(s).then((s=>{s&&this.processSearchResponse(s)})).finally((()=>{this._startLoading=!1})))}processSearchResponse(s){let i=(s=a.stringToObject(s.json.$)).descriptionField,e=s.pkField;e&&(this._gridMetadata=c(s),this._gridDataSource=[...s.data],this._pkField=e,this._descriptionField=i,this._itemList=this.buildCardItemList(s,e,i))}buildCardItemList(s,i,e){var t;return null===(t=s.data)||void 0===t?void 0:t.map((t=>{var a;let r=this.filterFieldsMetadata(s,t),n=this.buildFirstFields(t.__matchFields,r);return{key:this.highlightValue(t.__matchFields,null===(a=t[i])||void 0===a?void 0:a.toString(),n,!0),title:e?this.highlightValue(t.__matchFields,t[e],n,!0):"",details:this.buildDetails(n,t)}}))}filterFieldsMetadata(s,i){return s.fieldsMetadata.filter((e=>{let t=!r.isEmpty(i[e.fieldName])&&!1!==e.visible&&"B"!==e.type&&s.pkField!==e.fieldName&&s.descriptionField!==e.fieldName&&(e.isPrimaryKey||!e.isLinkField)&&!("S"===e.type&&"H"===e.presentationType);return t&&(this._mdByName[e.fieldName]=e),("string"!=typeof i[e.fieldName]||!(i[e.fieldName].indexOf("<img")>-1||i[e.fieldName].indexOf("<svg")>-1))&&t}))}removeAtIndex(s,i){if(i>=0&&i<s.length)return s.splice(i,1)[0]}removeReference(s,i){let e=this.indexOf(s,i);return this.removeAtIndex(s,e)}indexOf(s,i){let e=-1;return Array.isArray(s)&&this.find(s,((s,t)=>(e=t,this.equals(i,s)))),e}equals(s,i){return a.objectToString(s)===a.objectToString(i)}find(s,i){if(s)for(let e=0,t=s.length;e<t;e++)if(i(s[e],e,s))return s[e]}highlightValue(s,i,e,t){let a=this.replaceHtmlEntities(i);if(this.argument&&(t||this.isIn(s,e.fieldName))){const s=this.getArgumentNumber();let i=(isNaN(s)?this.argument:s.toString()).split(/%|,|\s+/),t=0,r=this.replaceAccentuatedChars(a);i.forEach((s=>{if(s){s=this.replaceAccentuatedChars(s);let i=this.getSpecialCharacters(s);null!=i&&i.length>0&&(s=this.removeSpecialCharacters(s)),(e.mask||"CGC_CPF"===e.uiType||"Phone"===e.uiType)&&(s=s.split("").join("\\.?\\-?\\/?\\(?\\)?"));let n=new RegExp(s,"ig");n.lastIndex=t;let o=n.exec(r);if(o&&o.length>0){t=o.index;let s=o[0].length,i=a.substring(t,t+s),e=(null==i?void 0:i.trim())?this._startHighlightTag+i+this._endHighlightTag:"",n=a.substring(0,t),l=a.substring(t+s);a=n+e+l,t+=e.length,r=this.replaceAccentuatedChars(a)}}}))}return a}replaceHtmlEntities(s){return null==s?s:String(s).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}replaceAccentuatedChars(s){return null==s?s:this.replaceToSpace(s,["&amp;","&lt;","&gt;","&quot;"]).replace(/[^\w ]/g,(s=>{let i=this._charsWithAccentuation.indexOf(s);return i>-1&&(s=this._charsWithoutAccentuation.charAt(i)),s||""}))}replaceToSpace(s,i=[]){return null==s||i.forEach((i=>{const e=new RegExp(i,"g");let t="";for(let s=0;s<i.length;s++)t+=" ";s=String(s).replace(e,t)})),s}isIn(s,i){return this.indexOf(s,i)>-1}getSpecialCharacters(s){let i,e=[];for(;i=this._specialCharsRegex.exec(s);)e.push(s[i.index]);return e}removeSpecialCharacters(s){return this.getSpecialCharacters(s).forEach((i=>{s=this.replaceAll(s,i,"")})),s}replaceAll(s,i,e){let t=(null!=s?s:"").indexOf(i);for(;t>-1;)t=(s=s.replace(i,e)).indexOf(i);return s}getArgumentNumber(){return Number(this.argument||void 0)}createOption(s){let{key:i,title:e}=s;const t=new RegExp(this._startHighlightTag,"g"),a=new RegExp(this._endHighlightTag,"g");e=r.decodeHtmlEntities(e);const n={value:null==i?void 0:i.replace(t,"").replace(a,""),label:null==e?void 0:e.replace(t,"").replace(a,"")};this.selectItem(n)}onChangeValue(s){var i;if(this.clearDeboucingTimeout(),this._startLoading)return void(this._changeDeboucingTimeout=setTimeout((()=>{this.onChangeValue(s)}),this._deboucingTime));if(this.argument=(s.detail||"").trim(),this.isHierarchyEntity&&"list"===this._presentationMode)return void(null===(i=this._pesquisaTree)||void 0===i||i.applyFilter());const e=this.getArgumentNumber();this.argument&&(!isNaN(e)||this.argument.length>=this._limitCharsToSearch)?this._changeDeboucingTimeout=setTimeout((()=>{this.doSearch(this.argument),this._valideDataSource=!0}),this._deboucingTime):(this._itemList=void 0,this._gridDataSource=[],this._valideDataSource=!1)}clearDeboucingTimeout(){this._changeDeboucingTimeout&&(clearTimeout(this._changeDeboucingTimeout),this._changeDeboucingTimeout=void 0)}onClickSearch(){this.doSearch((this.argument||"").trim()),this._valideDataSource=!0}getMessageView(){if(this._startLoading)return this.getMessage("snkPesquisa.search.waitMessage");if(!this._itemList)return this.getMessage("snkPesquisa.search.initialMessage");const s=this._itemList.length;return s<1?this.getMessage("snkPesquisa.search.noResultsMessage"):1===s?this.getMessage("snkPesquisa.search.resultsFoundSingular"):this.getMessage("snkPesquisa.search.resultsFoundPlural",{COUNT:s})}async componentWillLoad(){var s;this._application=n.getContextValue("__SNK__APPLICATION__"),this._messagesBuilder=null===(s=this._application)||void 0===s?void 0:s.messagesBuilder;const i=await this.pesquisaFetcher.loadPresentationConfig(this.entityName);this._presentationMode="list"===i?"list":"table"}async componentDidLoad(){o.addIDInfo(this._element),await this.chooseViewMode()}getMessage(s,i){return this._messagesBuilder.getMessage(s,i)}async handleChangeViewMode(){this._presentationMode="list"===this._presentationMode?"table":"list",await this.chooseViewMode(),await this.pesquisaFetcher.savePresentationConfig(this.entityName,this._presentationMode)}async chooseViewMode(){var s,i;if("list"!==this._presentationMode)return await(null===(s=this._viewStack)||void 0===s?void 0:s.show(h.GRID)),void(this._currentView=h.GRID);const e=this.isHierarchyEntity?h.TREE:h.CARDS;await(null===(i=this._viewStack)||void 0===i?void 0:i.show(e)),this._currentView=e}hideLimitMessage(){return!this._itemList||this._itemList.length<100}hideRecordsMessage(){return"list"===this._presentationMode&&this.isHierarchyEntity}getButtonModeInfo(){return"list"===this._presentationMode?{iconName:"table",title:this.getMessage("snkPesquisa.viewMode.tableMode")}:this.isHierarchyEntity?{iconName:"hierarchical-tree",title:this.getMessage("snkPesquisa.viewMode.tableMode")}:{iconName:"list",title:this.getMessage("snkPesquisa.viewMode.listMode")}}render(){var s,t;return i(e,null,i("div",{class:"snk-pesquisa"},i("div",{class:"snk-pesquisa__input"},i("ez-text-input",{label:this.getMessage("snkPesquisa.search.label"),class:"ez-margin-right--medium",canShowError:!1,ref:s=>this._textInput=s,onEzChange:s=>this.onChangeValue(s),value:this.argument,"data-element-id":"searchInput"},i("ez-icon",{slot:"leftIcon",iconName:"search"}),this.argument&&(null===(s=this._textInput)||void 0===s?void 0:s.value)?i("button",{slot:"rightIcon",class:"snk-pesquisa__btn",onClick:()=>this.clearSearch()},i("ez-icon",{iconName:"close"})):void 0),i("ez-button",{class:"ez-button--primary",label:this.getMessage("snkPesquisa.search.button"),onClick:()=>this.onClickSearch()}),i("ez-button",{class:"ez-margin-left--medium",mode:"icon",iconName:this.getButtonModeInfo().iconName,title:this.getButtonModeInfo().title,onClick:async()=>await this.handleChangeViewMode()})),i("div",{class:"snk-pesquisa__records-label "+(this._currentView===h.TREE?"hidden":"")},i("label",{class:"snk-pesquisa__records "+(this.hideRecordsMessage()?"hidden":"")},this.getMessageView()),i("label",{class:"snk-pesquisa__records-limit "+(this.hideLimitMessage()?"hidden":"")},this.getMessage("snkPesquisa.search.limitMessage"))),i("div",{class:"snk-pesquisa__content"},i("ez-view-stack",{ref:s=>this._viewStack=s,"data-element-id":"simple-crud"},i("stack-item",null,this._valideDataSource&&i("pesquisa-grid",{metadata:this._gridMetadata,dataSource:this._gridDataSource,pkField:this._pkField,descriptionField:this._descriptionField,entityName:this.entityName,shouldLoadConfig:this._currentView===h.GRID,onPesquisaGridSelectItem:({detail:s})=>this.selectItem(s)})),i("stack-item",null,i("div",{class:"snk-pesquisa__cards-container"},null===(t=this._itemList)||void 0===t?void 0:t.map((s=>i("ez-card-item",{onEzClick:s=>this.createOption(s.detail),item:s}))))),i("stack-item",null,i("pesquisa-tree",{ref:s=>this._pesquisaTree=s,argument:this.argument,treeLoader:this.treeLoader,allowsNonAnalytic:this.allowsNonAnalytic,shouldLoadTree:this._currentView===h.TREE,onPesquisaTreeSelectItem:({detail:s})=>this.selectItem(s),messagesBuilder:this._messagesBuilder}))))))}get _element(){return t(this)}static get watchers(){return{argument:["observeArgument"]}}};u.style=".sc-snk-pesquisa-h{--snk-pesquisa--font-size:var(--text--medium, 14px);--snk-pesquisa--font-family:var(--font-pattern, Arial);--snk-pesquisa--font-weight:var(--text-weight--medium, 400);--snk-pesquisa__records--color:var(--text--primary, #626e82);--snk-pesquisa__records--color-secondary:var(--text--secondary, #626e82);--snk-pesquisa__records--padding-vertical:var(--space--medium, 12px);--snk-pesquisa__content--padding-right:var(--space--small, 6px);--snk-pesquisa__btn--color:var(--title--primary, #2B3A54);--snk-pesquisa__btn-disabled--color:var(--text--disable, #AFB6C0);--snk-pesquisa__btn-hover--color:var(--color--primary, #4e4e4e);--snk-pesquisa__scrollbar--color-default:var(--scrollbar--default, #626e82);--snk-pesquisa__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--snk-pesquisa__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--snk-pesquisa__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--snk-pesquisa__scrollbar--border-radius:var(--border--radius-small, 6px);--snk-pesquisa__scrollbar--width:var(--space--small, 6px);height:100%;display:flex;flex-direction:column;overflow-y:auto}.snk-pesquisa.sc-snk-pesquisa{display:flex;flex-direction:column;height:100%}.snk-pesquisa__input.sc-snk-pesquisa{display:flex;width:100%;box-sizing:border-box;padding-top:4px;padding-right:4px}.snk-pesquisa__input.sc-snk-pesquisa ez-icon.sc-snk-pesquisa{--ez-icon--color:inherit;font-weight:var(--text-weight--large, 600)}.snk-pesquisa__content.sc-snk-pesquisa{display:flex;flex-direction:column;overflow-y:hidden;scrollbar-width:thin;scrollbar-color:var(--snk-pesquisa__scrollbar--color-clicked) var(--snk-pesquisa__scrollbar--color-background);padding-right:var(--snk-pesquisa__content--padding-right);height:100vh}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar{background-color:var(--snk-pesquisa__scrollbar--color-background);width:var(--snk-pesquisa__scrollbar--width);max-width:var(--snk-pesquisa__scrollbar--width);min-width:var(--snk-pesquisa__scrollbar--width)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-track{background-color:var(--snk-pesquisa__scrollbar--color-background);border-radius:var(--snk-pesquisa__scrollbar--border-radius)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb{background-color:var(--snk-pesquisa__scrollbar--color-default);border-radius:var(--snk-pesquisa__scrollbar--border-radius)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:vertical:hover,.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--snk-pesquisa__scrollbar--color-hover)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:vertical:active,.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--snk-pesquisa__scrollbar--color-clicked)}.snk-pesquisa__records-label.sc-snk-pesquisa{display:flex;flex-direction:row;justify-content:space-between;font-family:var(--snk-pesquisa--font-family);font-weight:var(--snk-pesquisa--font-weight);font-size:var(--snk-pesquisa--font-size);padding-bottom:var(--snk-pesquisa__records--padding-vertical);padding-top:var(--snk-pesquisa__records--padding-vertical)}.snk-pesquisa__records-label.hidden.sc-snk-pesquisa{display:none}.snk-pesquisa__records.sc-snk-pesquisa{color:var(--snk-pesquisa__records--color)}.snk-pesquisa__records-limit.sc-snk-pesquisa{color:var(--snk-pesquisa__records--color-secondary)}.snk-pesquisa__records-limit.hidden.sc-snk-pesquisa,.snk-pesquisa__records.hidden.sc-snk-pesquisa{visibility:hidden}.snk-pesquisa__btn.sc-snk-pesquisa{outline:none;border:none;background:none;cursor:pointer;color:var(--snk-pesquisa__btn--color)}.snk-pesquisa__btn.sc-snk-pesquisa:disabled{cursor:unset;color:var(--snk-pesquisa__btn-disabled--color)}.snk-pesquisa__btn.sc-snk-pesquisa:disabled:hover{cursor:unset;color:var(--snk-pesquisa__btn-disabled--color)}.snk-pesquisa__btn.sc-snk-pesquisa:hover{color:var(--snk-pesquisa__btn-hover--color)}.snk-pesquisa__cards-container.sc-snk-pesquisa{height:100%;overflow-y:auto}";export{u as snk_pesquisa}