@sankhyalabs/sankhyablocks 10.1.0-rc.5 → 10.1.0-rc.7

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 (913) hide show
  1. package/dist/cjs/AuthorizationConfig-79ffae4b.js.gz +0 -0
  2. package/dist/cjs/{ConfigStorage-2c528adc.js → ConfigStorage-b96ff235.js} +2 -2
  3. package/dist/cjs/ConfigStorage-b96ff235.js.gz +0 -0
  4. package/dist/cjs/{DataFetcher-36fd8b26.js → DataFetcher-c24cdc3d.js} +11 -22
  5. package/dist/cjs/DataFetcher-c24cdc3d.js.gz +0 -0
  6. package/dist/cjs/FormConfigHelper-1e8bb464.js.gz +0 -0
  7. package/dist/cjs/GetSelectedRecordsIDsInfo-bd50caf1.js.gz +0 -0
  8. package/dist/cjs/IFetchDataExporterParams-e78ec415.js.gz +0 -0
  9. package/dist/cjs/{ISave-a43d8683.js → ISave-f1aecaa6.js} +1 -1
  10. package/dist/cjs/ISave-f1aecaa6.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/ServicesNumberingConfig-69038a0f.js.gz +0 -0
  16. package/dist/cjs/{SnkFormConfigManager-b3ff72a3.js → SnkFormConfigManager-b4f72038.js} +2 -2
  17. package/dist/cjs/SnkFormConfigManager-b4f72038.js.gz +0 -0
  18. package/dist/cjs/{SnkMultiSelectionListDataSource-ca893d61.js → SnkMultiSelectionListDataSource-b7529c7e.js} +4 -4
  19. package/dist/cjs/SnkMultiSelectionListDataSource-b7529c7e.js.gz +0 -0
  20. package/dist/cjs/{auth-fetcher-35ec1416.js → auth-fetcher-33a7361c.js} +1 -1
  21. package/dist/cjs/auth-fetcher-33a7361c.js.gz +0 -0
  22. package/dist/cjs/config-header.cjs.entry.js.gz +0 -0
  23. package/dist/cjs/configs-button.cjs.entry.js.gz +0 -0
  24. package/dist/cjs/constants-6d82e405.js.gz +0 -0
  25. package/dist/cjs/{dataunit-fetcher-a71276bb.js → dataunit-fetcher-75ba0c0a.js} +1 -1
  26. package/dist/cjs/dataunit-fetcher-75ba0c0a.js.gz +0 -0
  27. package/dist/cjs/default-filters-a09bf82b.js.gz +0 -0
  28. package/dist/cjs/field-config_2.cjs.entry.js.gz +0 -0
  29. package/dist/cjs/fields-layout.cjs.entry.js.gz +0 -0
  30. package/dist/cjs/fields-selector.cjs.entry.js.gz +0 -0
  31. package/dist/cjs/filter-item-type.enum-a7ffdaa6.js.gz +0 -0
  32. package/dist/cjs/filter-type.enum-2bb46d2a.js.gz +0 -0
  33. package/dist/cjs/filter-validate-cb4ed41a.js.gz +0 -0
  34. package/dist/cjs/filterNumberVariation-d65332da.js.gz +0 -0
  35. package/dist/cjs/{form-config-fetcher-37296a56.js → form-config-fetcher-6b2f0c28.js} +1 -1
  36. package/dist/cjs/form-config-fetcher-6b2f0c28.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.gz +0 -0
  40. package/dist/cjs/index-62760a9c.js.gz +0 -0
  41. package/dist/cjs/index-8d94b7e0.js.gz +0 -0
  42. package/dist/cjs/index-e3e39724.js.gz +0 -0
  43. package/dist/cjs/index.cjs.js.gz +0 -0
  44. package/dist/cjs/loader.cjs.js.gz +0 -0
  45. package/dist/cjs/pesquisa-grid_2.cjs.entry.js +4 -4
  46. package/dist/cjs/pesquisa-grid_2.cjs.entry.js.gz +0 -0
  47. package/dist/cjs/presentationMode-52ec3bdd.js.gz +0 -0
  48. package/dist/cjs/sankhyablocks.cjs.js.gz +0 -0
  49. package/dist/cjs/snk-actions-button_9.cjs.entry.js +5 -5
  50. package/dist/cjs/snk-actions-button_9.cjs.entry.js.gz +0 -0
  51. package/dist/cjs/snk-actions-form.cjs.entry.js.gz +0 -0
  52. package/dist/cjs/snk-application.cjs.entry.js +6 -6
  53. package/dist/cjs/snk-application.cjs.entry.js.gz +0 -0
  54. package/dist/cjs/snk-attach.cjs.entry.js +5 -5
  55. package/dist/cjs/snk-attach.cjs.entry.js.gz +0 -0
  56. package/dist/cjs/snk-client-confirm.cjs.entry.js.gz +0 -0
  57. package/dist/cjs/snk-configurator.cjs.entry.js.gz +0 -0
  58. package/dist/cjs/snk-crud.cjs.entry.js +5 -5
  59. package/dist/cjs/snk-crud.cjs.entry.js.gz +0 -0
  60. package/dist/cjs/snk-custom-slot-elements.cjs.entry.js.gz +0 -0
  61. package/dist/cjs/snk-data-exporter.cjs.entry.js +5 -5
  62. package/dist/cjs/snk-data-exporter.cjs.entry.js.gz +0 -0
  63. package/dist/cjs/{snk-data-unit-c2a0d85c.js → snk-data-unit-9ac89fd5.js} +2 -2
  64. package/dist/cjs/snk-data-unit-9ac89fd5.js.gz +0 -0
  65. package/dist/cjs/snk-data-unit.cjs.entry.js +3 -3
  66. package/dist/cjs/snk-data-unit.cjs.entry.js.gz +0 -0
  67. package/dist/cjs/snk-default-filter.cjs.entry.js.gz +0 -0
  68. package/dist/cjs/snk-detail-view.cjs.entry.js +7 -7
  69. package/dist/cjs/snk-detail-view.cjs.entry.js.gz +0 -0
  70. package/dist/cjs/snk-entity-list.cjs.entry.js.gz +0 -0
  71. package/dist/cjs/snk-exporter-email-sender.cjs.entry.js.gz +0 -0
  72. package/dist/cjs/snk-expression-group_2.cjs.entry.js.gz +0 -0
  73. package/dist/cjs/snk-filter-advanced-mode_2.cjs.entry.js.gz +0 -0
  74. package/dist/cjs/snk-filter-bar_4.cjs.entry.js +27 -7
  75. package/dist/cjs/snk-filter-bar_4.cjs.entry.js.gz +0 -0
  76. package/dist/cjs/snk-filter-binary-select.cjs.entry.js.gz +0 -0
  77. package/dist/cjs/snk-filter-checkbox-list.cjs.entry.js.gz +0 -0
  78. package/dist/cjs/snk-filter-detail.cjs.entry.js.gz +0 -0
  79. package/dist/cjs/snk-filter-field-search_2.cjs.entry.js.gz +0 -0
  80. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
  81. package/dist/cjs/snk-filter-modal-item.cjs.entry.js.gz +0 -0
  82. package/dist/cjs/snk-filter-multi-select.cjs.entry.js.gz +0 -0
  83. package/dist/cjs/snk-filter-number.cjs.entry.js +1 -1
  84. package/dist/cjs/snk-filter-number.cjs.entry.js.gz +0 -0
  85. package/dist/cjs/snk-filter-period.cjs.entry.js +10 -5
  86. package/dist/cjs/snk-filter-period.cjs.entry.js.gz +0 -0
  87. package/dist/cjs/snk-filter-search.cjs.entry.js.gz +0 -0
  88. package/dist/cjs/snk-filter-text.cjs.entry.js +1 -1
  89. package/dist/cjs/snk-filter-text.cjs.entry.js.gz +0 -0
  90. package/dist/cjs/snk-form-summary.cjs.entry.js.gz +0 -0
  91. package/dist/cjs/snk-form-view.cjs.entry.js.gz +0 -0
  92. package/dist/cjs/snk-form_2.cjs.entry.js +4 -4
  93. package/dist/cjs/snk-form_2.cjs.entry.js.gz +0 -0
  94. package/dist/cjs/snk-grid.cjs.entry.js +6 -6
  95. package/dist/cjs/snk-grid.cjs.entry.js.gz +0 -0
  96. package/dist/cjs/{snk-guides-viewer-dee5ddd6.js → snk-guides-viewer-0d694e37.js} +5 -5
  97. package/dist/cjs/snk-guides-viewer-0d694e37.js.gz +0 -0
  98. package/dist/cjs/snk-guides-viewer.cjs.entry.js +7 -7
  99. package/dist/cjs/snk-guides-viewer.cjs.entry.js.gz +0 -0
  100. package/dist/cjs/snk-personalized-filter-editor.cjs.entry.js.gz +0 -0
  101. package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
  102. package/dist/cjs/snk-personalized-filter.cjs.entry.js.gz +0 -0
  103. package/dist/cjs/snk-pesquisa.cjs.entry.js +4 -4
  104. package/dist/cjs/snk-pesquisa.cjs.entry.js.gz +0 -0
  105. package/dist/cjs/snk-print-selector.cjs.entry.js.gz +0 -0
  106. package/dist/cjs/snk-simple-bar.cjs.entry.js.gz +0 -0
  107. package/dist/cjs/snk-simple-crud.cjs.entry.js +7 -7
  108. package/dist/cjs/snk-simple-crud.cjs.entry.js.gz +0 -0
  109. package/dist/cjs/snk-taskbar.cjs.entry.js.gz +0 -0
  110. package/dist/cjs/sortable.esm-9a110bb7.js.gz +0 -0
  111. package/dist/cjs/taskbar-elements-fb5d1e08.js.gz +0 -0
  112. package/dist/cjs/taskbar-processor-2fba34a8.js.gz +0 -0
  113. package/dist/cjs/teste-pesquisa.cjs.entry.js.gz +0 -0
  114. package/dist/collection/components/snk-actions-button/actions/enum/ActionsType.js.gz +0 -0
  115. package/dist/collection/components/snk-actions-button/actions/enum/ParamType.js.gz +0 -0
  116. package/dist/collection/components/snk-actions-button/actions/enum/RefreshType.js.gz +0 -0
  117. package/dist/collection/components/snk-actions-button/actions/executor/java.executor.js.gz +0 -0
  118. package/dist/collection/components/snk-actions-button/actions/executor/javascript.executor.js.gz +0 -0
  119. package/dist/collection/components/snk-actions-button/actions/executor/launch-screen.executor.js.gz +0 -0
  120. package/dist/collection/components/snk-actions-button/actions/executor/procedure.executor.js.gz +0 -0
  121. package/dist/collection/components/snk-actions-button/actions/factory/executor.factory.js.gz +0 -0
  122. package/dist/collection/components/snk-actions-button/actions/index.js.gz +0 -0
  123. package/dist/collection/components/snk-actions-button/actions/interfaces/IAction.js.gz +0 -0
  124. package/dist/collection/components/snk-actions-button/actions/interfaces/IExecSource.js.gz +0 -0
  125. package/dist/collection/components/snk-actions-button/actions/interfaces/IExecuteActions.js.gz +0 -0
  126. package/dist/collection/components/snk-actions-button/actions/interfaces/IExecuteActionsProps.js.gz +0 -0
  127. package/dist/collection/components/snk-actions-button/actions/interfaces/IResultParam.js.gz +0 -0
  128. package/dist/collection/components/snk-actions-button/clientEvent/index.js.gz +0 -0
  129. package/dist/collection/components/snk-actions-button/clientEvent/interfaces/IClientEventConfirm.js.gz +0 -0
  130. package/dist/collection/components/snk-actions-button/interfaces/index.js.gz +0 -0
  131. package/dist/collection/components/snk-actions-button/snk-actions-button.css.gz +0 -0
  132. package/dist/collection/components/snk-actions-button/snk-actions-button.js.gz +0 -0
  133. package/dist/collection/components/snk-actions-button/subcomponents/snk-actions-form.js.gz +0 -0
  134. package/dist/collection/components/snk-actions-button/subcomponents/snk-client-confirm.js.gz +0 -0
  135. package/dist/collection/components/snk-application/__mocks__/snk-application.js.gz +0 -0
  136. package/dist/collection/components/snk-application/errorhandler/snk-error-handler.js.gz +0 -0
  137. package/dist/collection/components/snk-application/request-listener/DebouncedRequestListener.js.gz +0 -0
  138. package/dist/collection/components/snk-application/request-listener/RequestListenerFactory.js.gz +0 -0
  139. package/dist/collection/components/snk-application/request-listener/RequestListenerLoadingBar.js.gz +0 -0
  140. package/dist/collection/components/snk-application/search-strategy/exec-prepared-search-plus.js.gz +0 -0
  141. package/dist/collection/components/snk-application/snk-application.css.gz +0 -0
  142. package/dist/collection/components/snk-application/snk-application.js.gz +0 -0
  143. package/dist/collection/components/snk-attach/interfaces/ICrudConfig.js.gz +0 -0
  144. package/dist/collection/components/snk-attach/interfaces/TFetcherType.js.gz +0 -0
  145. package/dist/collection/components/snk-attach/interfaces/index.js.gz +0 -0
  146. package/dist/collection/components/snk-attach/snk-attach.css.gz +0 -0
  147. package/dist/collection/components/snk-attach/snk-attach.js.gz +0 -0
  148. package/dist/collection/components/snk-attach/structure/builder/anexo-sistema-crud-config.builder.js.gz +0 -0
  149. package/dist/collection/components/snk-attach/structure/builder/attach-crud-config.builder.js.gz +0 -0
  150. package/dist/collection/components/snk-attach/structure/builder/taskbar-builder.js.gz +0 -0
  151. package/dist/collection/components/snk-attach/structure/fetcher/facade/fetcher.facade.js.gz +0 -0
  152. package/dist/collection/components/snk-attach/structure/fetcher/factory/anexo-sistema-data-unit.factory.js.gz +0 -0
  153. package/dist/collection/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.js.gz +0 -0
  154. package/dist/collection/components/snk-attach/structure/index.js.gz +0 -0
  155. package/dist/collection/components/snk-configurator/AuthorizationConfig.js.gz +0 -0
  156. package/dist/collection/components/snk-configurator/snk-configurator.css.gz +0 -0
  157. package/dist/collection/components/snk-configurator/snk-configurator.js.gz +0 -0
  158. package/dist/collection/components/snk-crud/interfaces/PropsCustomEditor.js.gz +0 -0
  159. package/dist/collection/components/snk-crud/interfaces/PropsCustomRender.js.gz +0 -0
  160. package/dist/collection/components/snk-crud/snk-crud.css.gz +0 -0
  161. package/dist/collection/components/snk-crud/snk-crud.js.gz +0 -0
  162. package/dist/collection/components/snk-crud/subcomponents/CardFormResizeObserver.js.gz +0 -0
  163. package/dist/collection/components/snk-crud/subcomponents/GuideBuilder.js.gz +0 -0
  164. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.css.gz +0 -0
  165. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js.gz +0 -0
  166. package/dist/collection/components/snk-crud/subcomponents/snk-form-summary.css.gz +0 -0
  167. package/dist/collection/components/snk-crud/subcomponents/snk-form-summary.js.gz +0 -0
  168. package/dist/collection/components/snk-crud/subcomponents/snk-form-view.css.gz +0 -0
  169. package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js.gz +0 -0
  170. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.css.gz +0 -0
  171. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js.gz +0 -0
  172. package/dist/collection/components/snk-custom-slot-elements/snk-custom-slot-elements.css.gz +0 -0
  173. package/dist/collection/components/snk-custom-slot-elements/snk-custom-slot-elements.js.gz +0 -0
  174. package/dist/collection/components/snk-data-exporter/data/attachment.js.gz +0 -0
  175. package/dist/collection/components/snk-data-exporter/data/email.js.gz +0 -0
  176. package/dist/collection/components/snk-data-exporter/data/export-config.js.gz +0 -0
  177. package/dist/collection/components/snk-data-exporter/data/export-result.js.gz +0 -0
  178. package/dist/collection/components/snk-data-exporter/data/report.js.gz +0 -0
  179. package/dist/collection/components/snk-data-exporter/exporter-email-sender/email-info-step.js.gz +0 -0
  180. package/dist/collection/components/snk-data-exporter/exporter-email-sender/options-step.js.gz +0 -0
  181. package/dist/collection/components/snk-data-exporter/exporter-email-sender/snk-exporter-email-sender.js.gz +0 -0
  182. package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js.gz +0 -0
  183. package/dist/collection/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.js.gz +0 -0
  184. package/dist/collection/components/snk-data-exporter/interfaces/IExporterProvider.js.gz +0 -0
  185. package/dist/collection/components/snk-data-exporter/interfaces/IExporterStrategy.js.gz +0 -0
  186. package/dist/collection/components/snk-data-exporter/interfaces/IRecordID.js.gz +0 -0
  187. package/dist/collection/components/snk-data-exporter/interfaces/ISelectedID.js.gz +0 -0
  188. package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js.gz +0 -0
  189. package/dist/collection/components/snk-data-exporter/providers/ServerSideExporterProvider.js.gz +0 -0
  190. package/dist/collection/components/snk-data-exporter/snk-data-exporter.css.gz +0 -0
  191. package/dist/collection/components/snk-data-exporter/snk-data-exporter.js.gz +0 -0
  192. package/dist/collection/components/snk-data-exporter/structure/ItemBuilder.js.gz +0 -0
  193. package/dist/collection/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.js.gz +0 -0
  194. package/dist/collection/components/snk-data-exporter/utils/ParserExport.js.gz +0 -0
  195. package/dist/collection/components/snk-data-unit/MultipleUpdateHelper.js.gz +0 -0
  196. package/dist/collection/components/snk-data-unit/snk-data-unit.js.gz +0 -0
  197. package/dist/collection/components/snk-data-unit/test/resources/metadataMock.js.gz +0 -0
  198. package/dist/collection/components/snk-data-unit/test/resources/parentMetadataMock.js.gz +0 -0
  199. package/dist/collection/components/snk-entity-list/snk-entity-list.css.gz +0 -0
  200. package/dist/collection/components/snk-entity-list/snk-entity-list.js.gz +0 -0
  201. package/dist/collection/components/snk-filter-bar/filter-item/dataunitfilter/data-unit-filter-builder.js.gz +0 -0
  202. package/dist/collection/components/snk-filter-bar/filter-item/editors/enum/filterNumberVariation.js.gz +0 -0
  203. package/dist/collection/components/snk-filter-bar/filter-item/editors/enum/presentationMode.js.gz +0 -0
  204. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.js.gz +0 -0
  205. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-checkbox-list.js.gz +0 -0
  206. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.js.gz +0 -0
  207. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js +1 -1
  208. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js.gz +0 -0
  209. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js +11 -6
  210. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js.gz +0 -0
  211. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-search.js.gz +0 -0
  212. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js +1 -1
  213. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js.gz +0 -0
  214. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-personalized-filter-editor/snk-personalized-filter-editor.css.gz +0 -0
  215. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-personalized-filter-editor/snk-personalized-filter-editor.js.gz +0 -0
  216. package/dist/collection/components/snk-filter-bar/filter-item/filter-item-type-mask.enum.js.gz +0 -0
  217. package/dist/collection/components/snk-filter-bar/filter-item/filter-item-type.enum.js.gz +0 -0
  218. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js.gz +0 -0
  219. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.css.gz +0 -0
  220. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +4 -0
  221. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js.gz +0 -0
  222. package/dist/collection/components/snk-filter-bar/filter-list/snk-filter-list.js.gz +0 -0
  223. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.css.gz +0 -0
  224. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +9 -1
  225. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js.gz +0 -0
  226. package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-default-filter/snk-default-filter.css.gz +0 -0
  227. package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-default-filter/snk-default-filter.js.gz +0 -0
  228. package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.css.gz +0 -0
  229. package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js.gz +0 -0
  230. package/dist/collection/components/snk-filter-bar/snk-filter-bar.css.gz +0 -0
  231. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +12 -3
  232. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js.gz +0 -0
  233. package/dist/collection/components/snk-filter-bar/types/custom-element-filter.js.gz +0 -0
  234. package/dist/collection/components/snk-filter-bar/types/default-filters.js.gz +0 -0
  235. package/dist/collection/components/snk-filter-bar/types/filter-type.enum.js.gz +0 -0
  236. package/dist/collection/components/snk-filter-bar/utils/SnkFilterModalFactory.js.gz +0 -0
  237. package/dist/collection/components/snk-filter-bar/utils/filter-validate.js.gz +0 -0
  238. package/dist/collection/components/snk-filter-bar/utils/filters-mock.js.gz +0 -0
  239. package/dist/collection/components/snk-filter-field-search/interfaces/index.js.gz +0 -0
  240. package/dist/collection/components/snk-filter-field-search/snk-filter-field-search.css.gz +0 -0
  241. package/dist/collection/components/snk-filter-field-search/snk-filter-field-search.js.gz +0 -0
  242. package/dist/collection/components/snk-filter-field-search/subcomponents/index.js.gz +0 -0
  243. package/dist/collection/components/snk-filter-field-search/subcomponents/list-item.js.gz +0 -0
  244. package/dist/collection/components/snk-form/snk-form.css.gz +0 -0
  245. package/dist/collection/components/snk-form/snk-form.js.gz +0 -0
  246. package/dist/collection/components/snk-form-config/FormConfigHelper.js.gz +0 -0
  247. package/dist/collection/components/snk-form-config/SnkFormConfigManager.js.gz +0 -0
  248. package/dist/collection/components/snk-form-config/config-header/config-header.css.gz +0 -0
  249. package/dist/collection/components/snk-form-config/config-header/config-header.js.gz +0 -0
  250. package/dist/collection/components/snk-form-config/config-header/configs-button/configs-button.css.gz +0 -0
  251. package/dist/collection/components/snk-form-config/config-header/configs-button/configs-button.js.gz +0 -0
  252. package/dist/collection/components/snk-form-config/field-item/field-config/field-config.css.gz +0 -0
  253. package/dist/collection/components/snk-form-config/field-item/field-config/field-config.js.gz +0 -0
  254. package/dist/collection/components/snk-form-config/field-item/field-item.css.gz +0 -0
  255. package/dist/collection/components/snk-form-config/field-item/field-item.js.gz +0 -0
  256. package/dist/collection/components/snk-form-config/fields-layout/fields-layout.css.gz +0 -0
  257. package/dist/collection/components/snk-form-config/fields-layout/fields-layout.js.gz +0 -0
  258. package/dist/collection/components/snk-form-config/fields-selector/fields-selector.css.gz +0 -0
  259. package/dist/collection/components/snk-form-config/fields-selector/fields-selector.js.gz +0 -0
  260. package/dist/collection/components/snk-form-config/guides-configurator/guides-configurator.css.gz +0 -0
  261. package/dist/collection/components/snk-form-config/guides-configurator/guides-configurator.js.gz +0 -0
  262. package/dist/collection/components/snk-form-config/snk-form-config.css.gz +0 -0
  263. package/dist/collection/components/snk-form-config/snk-form-config.js.gz +0 -0
  264. package/dist/collection/components/snk-grid/filtercolumn/SnkMultiSelectionListDataSource.js.gz +0 -0
  265. package/dist/collection/components/snk-grid/snk-grid.css.gz +0 -0
  266. package/dist/collection/components/snk-grid/snk-grid.js.gz +0 -0
  267. package/dist/collection/components/snk-grid-config/snk-grid-config.css.gz +0 -0
  268. package/dist/collection/components/snk-grid-config/snk-grid-config.js.gz +0 -0
  269. package/dist/collection/components/snk-grid-config/snk-select-box/snk-select-box.css.gz +0 -0
  270. package/dist/collection/components/snk-grid-config/snk-select-box/snk-select-box.js.gz +0 -0
  271. package/dist/collection/components/snk-layout-form-config/snk-layout-form-config.css.gz +0 -0
  272. package/dist/collection/components/snk-layout-form-config/snk-layout-form-config.js.gz +0 -0
  273. package/dist/collection/components/snk-layout-form-config/snk-view-representation/snk-view-representation.css.gz +0 -0
  274. package/dist/collection/components/snk-layout-form-config/snk-view-representation/snk-view-representation.js.gz +0 -0
  275. package/dist/collection/components/snk-numbering-config/services/ServicesNumberingConfig.js.gz +0 -0
  276. package/dist/collection/components/snk-numbering-config/snk-numbering-config.css.gz +0 -0
  277. package/dist/collection/components/snk-numbering-config/snk-numbering-config.js.gz +0 -0
  278. package/dist/collection/components/snk-personalized-filter/interfaces/IExpressionGroup.js.gz +0 -0
  279. package/dist/collection/components/snk-personalized-filter/interfaces/IExpressionItem.js.gz +0 -0
  280. package/dist/collection/components/snk-personalized-filter/interfaces/IParameter.js.gz +0 -0
  281. package/dist/collection/components/snk-personalized-filter/interfaces/IPersonalizedFilter.js.gz +0 -0
  282. package/dist/collection/components/snk-personalized-filter/interfaces/ISystemFilterConfig.js.gz +0 -0
  283. package/dist/collection/components/snk-personalized-filter/interfaces/IUserFilterConfig.js.gz +0 -0
  284. package/dist/collection/components/snk-personalized-filter/interfaces/index.js.gz +0 -0
  285. package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.css.gz +0 -0
  286. package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js.gz +0 -0
  287. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-group/snk-expression-group.css.gz +0 -0
  288. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-group/snk-expression-group.js.gz +0 -0
  289. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/filter-operands/filter-operands.js.gz +0 -0
  290. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.css.gz +0 -0
  291. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.js.gz +0 -0
  292. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-advanced-mode/snk-filter-advanced-mode.css.gz +0 -0
  293. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-advanced-mode/snk-filter-advanced-mode.js.gz +0 -0
  294. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-assistent-mode/snk-filter-assistent-mode.css.gz +0 -0
  295. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-assistent-mode/snk-filter-assistent-mode.js.gz +0 -0
  296. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/snk-filter-param-config.css.gz +0 -0
  297. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/snk-filter-param-config.js.gz +0 -0
  298. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/utils/PersonalizedFilterUtils.js.gz +0 -0
  299. package/dist/collection/components/snk-pesquisa/pesquisa-grid/pesquisa-grid.css.gz +0 -0
  300. package/dist/collection/components/snk-pesquisa/pesquisa-grid/pesquisa-grid.js.gz +0 -0
  301. package/dist/collection/components/snk-pesquisa/pesquisa-tree/pesquisa-tree.css.gz +0 -0
  302. package/dist/collection/components/snk-pesquisa/pesquisa-tree/pesquisa-tree.js.gz +0 -0
  303. package/dist/collection/components/snk-pesquisa/pesquisaHelper.js.gz +0 -0
  304. package/dist/collection/components/snk-pesquisa/snk-pesquisa.css.gz +0 -0
  305. package/dist/collection/components/snk-pesquisa/snk-pesquisa.js.gz +0 -0
  306. package/dist/collection/components/snk-print-selector/snk-print-selector.css.gz +0 -0
  307. package/dist/collection/components/snk-print-selector/snk-print-selector.js.gz +0 -0
  308. package/dist/collection/components/snk-simple-bar/snk-simple-bar.css.gz +0 -0
  309. package/dist/collection/components/snk-simple-bar/snk-simple-bar.js.gz +0 -0
  310. package/dist/collection/components/snk-simple-crud/snk-simple-crud.constants.js.gz +0 -0
  311. package/dist/collection/components/snk-simple-crud/snk-simple-crud.css.gz +0 -0
  312. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js.gz +0 -0
  313. package/dist/collection/components/snk-simple-form-config/snk-simple-form-config.css.gz +0 -0
  314. package/dist/collection/components/snk-simple-form-config/snk-simple-form-config.js.gz +0 -0
  315. package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.css.gz +0 -0
  316. package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.js.gz +0 -0
  317. package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js.gz +0 -0
  318. package/dist/collection/components/snk-taskbar/elements/taskbar-split-button/taskbar-split-button.css.gz +0 -0
  319. package/dist/collection/components/snk-taskbar/elements/taskbar-split-button/taskbar-split-button.js.gz +0 -0
  320. package/dist/collection/components/snk-taskbar/processor/taskbar-processor.js.gz +0 -0
  321. package/dist/collection/components/snk-taskbar/snk-taskbar.css.gz +0 -0
  322. package/dist/collection/components/snk-taskbar/snk-taskbar.js.gz +0 -0
  323. package/dist/collection/components/teste-pesquisa/teste-pesquisa.css.gz +0 -0
  324. package/dist/collection/components/teste-pesquisa/teste-pesquisa.js.gz +0 -0
  325. package/dist/collection/index.js.gz +0 -0
  326. package/dist/collection/lib/@types/index.js.gz +0 -0
  327. package/dist/collection/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.js.gz +0 -0
  328. package/dist/collection/lib/applet-caller/applet-caller.js.gz +0 -0
  329. package/dist/collection/lib/auth/mgeauthorization.module.js.gz +0 -0
  330. package/dist/collection/lib/configs/ConfigStorage.js.gz +0 -0
  331. package/dist/collection/lib/configs/LayoutFormConfig.js.gz +0 -0
  332. package/dist/collection/lib/dataUnit/InMemoryLoader.js.gz +0 -0
  333. package/dist/collection/lib/dataUnit/ValueFormatter.js.gz +0 -0
  334. package/dist/collection/lib/dataUnit/dataUnitInMemoryUtils.js.gz +0 -0
  335. package/dist/collection/lib/dataUnit/interfaces/InMemoryLoaderConfig.js.gz +0 -0
  336. package/dist/collection/lib/http/data-fetcher/DataFetcher.js.gz +0 -0
  337. package/dist/collection/lib/http/data-fetcher/custom-xhr-override.js.gz +0 -0
  338. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/anexo-sistema-fetcher.js.gz +0 -0
  339. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/attach-fetcher.js.gz +0 -0
  340. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/facade/attach-fetcher.facade.js.gz +0 -0
  341. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/index.js.gz +0 -0
  342. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/IDelete.js.gz +0 -0
  343. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/IDownloadKey.js.gz +0 -0
  344. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/ISave.js.gz +0 -0
  345. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/index.js.gz +0 -0
  346. package/dist/collection/lib/http/data-fetcher/fetchers/application-config-fetcher.js.gz +0 -0
  347. package/dist/collection/lib/http/data-fetcher/fetchers/auth-fetcher.js.gz +0 -0
  348. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.js.gz +0 -0
  349. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.js.gz +0 -0
  350. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.js.gz +0 -0
  351. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.js.gz +0 -0
  352. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/helpers/DataUnitDataLoaderHelper.js.gz +0 -0
  353. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IBuildRequestBodyLoadRowMetadata.js.gz +0 -0
  354. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadDataResult.js.gz +0 -0
  355. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadDataStrategy.js.gz +0 -0
  356. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadingInfo.js.gz +0 -0
  357. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRecordField.js.gz +0 -0
  358. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IResponseRecord.js.gz +0 -0
  359. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRowMetadata.js.gz +0 -0
  360. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DataUnitStrategy.js.gz +0 -0
  361. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js.gz +0 -0
  362. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/test/resources/metadataMock.js.gz +0 -0
  363. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IExporterColumnMetadata.js.gz +0 -0
  364. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams.js.gz +0 -0
  365. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterResponse.js.gz +0 -0
  366. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IPersonalizedReport.js.gz +0 -0
  367. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/permission-export-pdf.js.gz +0 -0
  368. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/personalized-reports-fetcher.js.gz +0 -0
  369. package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js.gz +0 -0
  370. package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js.gz +0 -0
  371. package/dist/collection/lib/http/data-fetcher/fetchers/grid-config-fetcher.js.gz +0 -0
  372. package/dist/collection/lib/http/data-fetcher/fetchers/parameters-fecher.js.gz +0 -0
  373. package/dist/collection/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.js.gz +0 -0
  374. package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js.gz +0 -0
  375. package/dist/collection/lib/http/data-fetcher/fetchers/resource-fetcher.js.gz +0 -0
  376. package/dist/collection/lib/http/data-fetcher/fetchers/totals-fetcher.js.gz +0 -0
  377. package/dist/collection/lib/http/data-fetcher/interfaces/IClientEventResponse.js.gz +0 -0
  378. package/dist/collection/lib/http/data-fetcher/recaller/GraphQLRecaller.js.gz +0 -0
  379. package/dist/collection/lib/http/data-fetcher/recaller/IDataFetcherRecaller.js.gz +0 -0
  380. package/dist/collection/lib/http/data-fetcher/recaller/ServiceBrokerRecaller.js.gz +0 -0
  381. package/dist/collection/lib/http/data-fetcher/state/LoadStateManager.js.gz +0 -0
  382. package/dist/collection/lib/index.js.gz +0 -0
  383. package/dist/collection/lib/message/SnkMessageBuilder.js +11 -2
  384. package/dist/collection/lib/message/SnkMessageBuilder.js.gz +0 -0
  385. package/dist/collection/lib/message/messageResourceEnUSUtils.js.gz +0 -0
  386. package/dist/collection/lib/message/messageResourceEsESUtils.js.gz +0 -0
  387. package/dist/collection/lib/message/messageResourcePtBRUtils.js.gz +0 -0
  388. package/dist/collection/lib/message/resources/en-us/continuousInsertUtils.msg.js.gz +0 -0
  389. package/dist/collection/lib/message/resources/en-us/crud-utils.msg.js.gz +0 -0
  390. package/dist/collection/lib/message/resources/en-us/dataFetcher.msg.js.gz +0 -0
  391. package/dist/collection/lib/message/resources/en-us/dataUnitDataLoaderHelper.msg.js.gz +0 -0
  392. package/dist/collection/lib/message/resources/en-us/file-viewer.msg.js.gz +0 -0
  393. package/dist/collection/lib/message/resources/en-us/snk-actions-button.msg.js.gz +0 -0
  394. package/dist/collection/lib/message/resources/en-us/snk-application.msg.js.gz +0 -0
  395. package/dist/collection/lib/message/resources/en-us/snk-attach.msg.js.gz +0 -0
  396. package/dist/collection/lib/message/resources/en-us/snk-configurator.msg.js.gz +0 -0
  397. package/dist/collection/lib/message/resources/en-us/snk-crud.msg.js.gz +0 -0
  398. package/dist/collection/lib/message/resources/en-us/snk-data-exporter.msg.js.gz +0 -0
  399. package/dist/collection/lib/message/resources/en-us/snk-data-unit.msg.js.gz +0 -0
  400. package/dist/collection/lib/message/resources/en-us/snk-entity-list.msg.js.gz +0 -0
  401. package/dist/collection/lib/message/resources/en-us/snk-error-handler.msg.js.gz +0 -0
  402. package/dist/collection/lib/message/resources/en-us/snk-exporter.msg.js.gz +0 -0
  403. package/dist/collection/lib/message/resources/en-us/snk-filter-bar.msg.js.gz +0 -0
  404. package/dist/collection/lib/message/resources/en-us/snk-filter-field-search.msg.js.gz +0 -0
  405. package/dist/collection/lib/message/resources/en-us/snk-filter-list.msg.js.gz +0 -0
  406. package/dist/collection/lib/message/resources/en-us/snk-filter-param-config.msg.js.gz +0 -0
  407. package/dist/collection/lib/message/resources/en-us/snk-form.msg.js.gz +0 -0
  408. package/dist/collection/lib/message/resources/en-us/snk-grid.msg.js.gz +0 -0
  409. package/dist/collection/lib/message/resources/en-us/snk-layout-form-config.msg.js.gz +0 -0
  410. package/dist/collection/lib/message/resources/en-us/snk-numbering-config.msg.js.gz +0 -0
  411. package/dist/collection/lib/message/resources/en-us/snk-personalized-filter.msg.js.gz +0 -0
  412. package/dist/collection/lib/message/resources/en-us/snk-pesquisa.msg.js.gz +0 -0
  413. package/dist/collection/lib/message/resources/en-us/snk-print-selector.msg.js.gz +0 -0
  414. package/dist/collection/lib/message/resources/en-us/snk-simple-bar.msg.js.gz +0 -0
  415. package/dist/collection/lib/message/resources/en-us/snk-simple-crud.msg.js.gz +0 -0
  416. package/dist/collection/lib/message/resources/en-us/snk-simple-form-config.msg.js.gz +0 -0
  417. package/dist/collection/lib/message/resources/en-us/snk-taskbar.msg.js.gz +0 -0
  418. package/dist/collection/lib/message/resources/es-es/continuousInsertUtils.msg.js.gz +0 -0
  419. package/dist/collection/lib/message/resources/es-es/crud-utils.msg.js.gz +0 -0
  420. package/dist/collection/lib/message/resources/es-es/dataFetcher.msg.js.gz +0 -0
  421. package/dist/collection/lib/message/resources/es-es/dataUnitDataLoaderHelper.msg.js.gz +0 -0
  422. package/dist/collection/lib/message/resources/es-es/file-viewer.msg.js.gz +0 -0
  423. package/dist/collection/lib/message/resources/es-es/snk-actions-button.msg.js.gz +0 -0
  424. package/dist/collection/lib/message/resources/es-es/snk-application.msg.js.gz +0 -0
  425. package/dist/collection/lib/message/resources/es-es/snk-attach.msg.js.gz +0 -0
  426. package/dist/collection/lib/message/resources/es-es/snk-configurator.msg.js.gz +0 -0
  427. package/dist/collection/lib/message/resources/es-es/snk-crud.msg.js.gz +0 -0
  428. package/dist/collection/lib/message/resources/es-es/snk-data-exporter.msg.js.gz +0 -0
  429. package/dist/collection/lib/message/resources/es-es/snk-data-unit.msg.js.gz +0 -0
  430. package/dist/collection/lib/message/resources/es-es/snk-entity-list.msg.js.gz +0 -0
  431. package/dist/collection/lib/message/resources/es-es/snk-error-handler.msg.js.gz +0 -0
  432. package/dist/collection/lib/message/resources/es-es/snk-exporter.msg.js.gz +0 -0
  433. package/dist/collection/lib/message/resources/es-es/snk-filter-bar.msg.js.gz +0 -0
  434. package/dist/collection/lib/message/resources/es-es/snk-filter-field-search.msg.js.gz +0 -0
  435. package/dist/collection/lib/message/resources/es-es/snk-filter-list.msg.js.gz +0 -0
  436. package/dist/collection/lib/message/resources/es-es/snk-filter-param-config.msg.js.gz +0 -0
  437. package/dist/collection/lib/message/resources/es-es/snk-form.msg.js.gz +0 -0
  438. package/dist/collection/lib/message/resources/es-es/snk-grid.msg.js.gz +0 -0
  439. package/dist/collection/lib/message/resources/es-es/snk-layout-form-config.msg.js.gz +0 -0
  440. package/dist/collection/lib/message/resources/es-es/snk-numbering-config.msg.js.gz +0 -0
  441. package/dist/collection/lib/message/resources/es-es/snk-personalized-filter.msg.js.gz +0 -0
  442. package/dist/collection/lib/message/resources/es-es/snk-pesquisa.msg.js.gz +0 -0
  443. package/dist/collection/lib/message/resources/es-es/snk-print-selector.msg.js.gz +0 -0
  444. package/dist/collection/lib/message/resources/es-es/snk-simple-bar.msg.js.gz +0 -0
  445. package/dist/collection/lib/message/resources/es-es/snk-simple-crud.msg.js.gz +0 -0
  446. package/dist/collection/lib/message/resources/es-es/snk-simple-form-config.msg.js.gz +0 -0
  447. package/dist/collection/lib/message/resources/es-es/snk-taskbar.msg.js.gz +0 -0
  448. package/dist/collection/lib/message/resources/pt-br/continuousInsertUtils.msg.js.gz +0 -0
  449. package/dist/collection/lib/message/resources/pt-br/crud-utils.msg.js.gz +0 -0
  450. package/dist/collection/lib/message/resources/pt-br/dataFetcher.msg.js.gz +0 -0
  451. package/dist/collection/lib/message/resources/pt-br/dataUnitDataLoaderHelper.msg.js.gz +0 -0
  452. package/dist/collection/lib/message/resources/pt-br/file-viewer.msg.js.gz +0 -0
  453. package/dist/collection/lib/message/resources/pt-br/snk-actions-button.msg.js.gz +0 -0
  454. package/dist/collection/lib/message/resources/pt-br/snk-application.msg.js.gz +0 -0
  455. package/dist/collection/lib/message/resources/pt-br/snk-attach.msg.js.gz +0 -0
  456. package/dist/collection/lib/message/resources/pt-br/snk-configurator.msg.js.gz +0 -0
  457. package/dist/collection/lib/message/resources/pt-br/snk-crud.msg.js.gz +0 -0
  458. package/dist/collection/lib/message/resources/pt-br/snk-data-exporter.msg.js.gz +0 -0
  459. package/dist/collection/lib/message/resources/pt-br/snk-data-unit.msg.js.gz +0 -0
  460. package/dist/collection/lib/message/resources/pt-br/snk-entity-list.msg.js.gz +0 -0
  461. package/dist/collection/lib/message/resources/pt-br/snk-error-handler.msg.js.gz +0 -0
  462. package/dist/collection/lib/message/resources/pt-br/snk-exporter.msg.js.gz +0 -0
  463. package/dist/collection/lib/message/resources/pt-br/snk-filter-bar.msg.js.gz +0 -0
  464. package/dist/collection/lib/message/resources/pt-br/snk-filter-field-search.msg.js.gz +0 -0
  465. package/dist/collection/lib/message/resources/pt-br/snk-filter-list.msg.js.gz +0 -0
  466. package/dist/collection/lib/message/resources/pt-br/snk-filter-param-config.msg.js.gz +0 -0
  467. package/dist/collection/lib/message/resources/pt-br/snk-form.msg.js.gz +0 -0
  468. package/dist/collection/lib/message/resources/pt-br/snk-grid.msg.js.gz +0 -0
  469. package/dist/collection/lib/message/resources/pt-br/snk-layout-form-config.msg.js.gz +0 -0
  470. package/dist/collection/lib/message/resources/pt-br/snk-numbering-config.msg.js.gz +0 -0
  471. package/dist/collection/lib/message/resources/pt-br/snk-personalized-filter.msg.js.gz +0 -0
  472. package/dist/collection/lib/message/resources/pt-br/snk-pesquisa.msg.js.gz +0 -0
  473. package/dist/collection/lib/message/resources/pt-br/snk-print-selector.msg.js.gz +0 -0
  474. package/dist/collection/lib/message/resources/pt-br/snk-simple-bar.msg.js.gz +0 -0
  475. package/dist/collection/lib/message/resources/pt-br/snk-simple-crud.msg.js.gz +0 -0
  476. package/dist/collection/lib/message/resources/pt-br/snk-simple-form-config.msg.js.gz +0 -0
  477. package/dist/collection/lib/message/resources/pt-br/snk-taskbar.msg.js.gz +0 -0
  478. package/dist/collection/lib/resourceid/ResourceIDUtils.js.gz +0 -0
  479. package/dist/collection/lib/store/index.js.gz +0 -0
  480. package/dist/collection/lib/utils/ContinuousInsertUtils.js.gz +0 -0
  481. package/dist/collection/lib/utils/CrudUtils.js.gz +0 -0
  482. package/dist/collection/lib/utils/GetSelectedRecordsIDsInfo.js.gz +0 -0
  483. package/dist/collection/lib/utils/PrintUtils.js.gz +0 -0
  484. package/dist/collection/lib/utils/constants.js.gz +0 -0
  485. package/dist/collection/lib/utils/fileViewer/index.js.gz +0 -0
  486. package/dist/collection/lib/utils/fileViewer/interfaces/IFileViewerParams.js.gz +0 -0
  487. package/dist/collection/lib/utils/pesquisa.js.gz +0 -0
  488. package/dist/collection/lib/utils/urlutils.js.gz +0 -0
  489. package/dist/collection/lib/workspace/workspace.js.gz +0 -0
  490. package/dist/collection/sw.js.gz +0 -0
  491. package/dist/components/AuthorizationConfig.js.gz +0 -0
  492. package/dist/components/ConfigStorage.js.gz +0 -0
  493. package/dist/components/ContinuousInsertUtils.js.gz +0 -0
  494. package/dist/components/DataFetcher.js +11 -2
  495. package/dist/components/DataFetcher.js.gz +0 -0
  496. package/dist/components/GetSelectedRecordsIDsInfo.js.gz +0 -0
  497. package/dist/components/ISave.js.gz +0 -0
  498. package/dist/components/ParamType.js.gz +0 -0
  499. package/dist/components/PersonalizedFilterUtils.js.gz +0 -0
  500. package/dist/components/PrintUtils.js.gz +0 -0
  501. package/dist/components/ResourceIDUtils.js.gz +0 -0
  502. package/dist/components/SnkFormConfigManager.js.gz +0 -0
  503. package/dist/components/auth-fetcher.js.gz +0 -0
  504. package/dist/components/config-header.js.gz +0 -0
  505. package/dist/components/config-header2.js.gz +0 -0
  506. package/dist/components/configs-button.js.gz +0 -0
  507. package/dist/components/configs-button2.js.gz +0 -0
  508. package/dist/components/constants.js.gz +0 -0
  509. package/dist/components/dataunit-fetcher.js.gz +0 -0
  510. package/dist/components/field-config.js.gz +0 -0
  511. package/dist/components/field-config2.js.gz +0 -0
  512. package/dist/components/field-item.js.gz +0 -0
  513. package/dist/components/field-item2.js.gz +0 -0
  514. package/dist/components/fields-layout.js.gz +0 -0
  515. package/dist/components/fields-layout2.js.gz +0 -0
  516. package/dist/components/fields-selector.js.gz +0 -0
  517. package/dist/components/fields-selector2.js.gz +0 -0
  518. package/dist/components/filter-item-type.enum.js.gz +0 -0
  519. package/dist/components/filterNumberVariation.js.gz +0 -0
  520. package/dist/components/form-config-fetcher.js.gz +0 -0
  521. package/dist/components/guides-configurator.js.gz +0 -0
  522. package/dist/components/guides-configurator2.js.gz +0 -0
  523. package/dist/components/index.js.gz +0 -0
  524. package/dist/components/index2.js.gz +0 -0
  525. package/dist/components/pesquisa-grid.js.gz +0 -0
  526. package/dist/components/pesquisa-grid2.js.gz +0 -0
  527. package/dist/components/pesquisa-tree.js.gz +0 -0
  528. package/dist/components/pesquisa-tree2.js.gz +0 -0
  529. package/dist/components/presentationMode.js.gz +0 -0
  530. package/dist/components/snk-actions-button.js.gz +0 -0
  531. package/dist/components/snk-actions-button2.js.gz +0 -0
  532. package/dist/components/snk-actions-form.js.gz +0 -0
  533. package/dist/components/snk-application.js.gz +0 -0
  534. package/dist/components/snk-application2.js.gz +0 -0
  535. package/dist/components/snk-attach.js.gz +0 -0
  536. package/dist/components/snk-attach2.js.gz +0 -0
  537. package/dist/components/snk-client-confirm.js.gz +0 -0
  538. package/dist/components/snk-configurator.js.gz +0 -0
  539. package/dist/components/snk-configurator2.js.gz +0 -0
  540. package/dist/components/snk-crud.js.gz +0 -0
  541. package/dist/components/snk-custom-slot-elements.js.gz +0 -0
  542. package/dist/components/snk-data-exporter.js.gz +0 -0
  543. package/dist/components/snk-data-exporter2.js.gz +0 -0
  544. package/dist/components/snk-data-unit.js.gz +0 -0
  545. package/dist/components/snk-data-unit2.js.gz +0 -0
  546. package/dist/components/snk-default-filter.js.gz +0 -0
  547. package/dist/components/snk-default-filter2.js.gz +0 -0
  548. package/dist/components/snk-detail-view.js.gz +0 -0
  549. package/dist/components/snk-detail-view2.js.gz +0 -0
  550. package/dist/components/snk-entity-list.js.gz +0 -0
  551. package/dist/components/snk-exporter-email-sender.js.gz +0 -0
  552. package/dist/components/snk-exporter-email-sender2.js.gz +0 -0
  553. package/dist/components/snk-expression-group.js.gz +0 -0
  554. package/dist/components/snk-expression-group2.js.gz +0 -0
  555. package/dist/components/snk-expression-item.js.gz +0 -0
  556. package/dist/components/snk-expression-item2.js.gz +0 -0
  557. package/dist/components/snk-filter-advanced-mode.js.gz +0 -0
  558. package/dist/components/snk-filter-advanced-mode2.js.gz +0 -0
  559. package/dist/components/snk-filter-assistent-mode.js.gz +0 -0
  560. package/dist/components/snk-filter-assistent-mode2.js.gz +0 -0
  561. package/dist/components/snk-filter-bar.js.gz +0 -0
  562. package/dist/components/snk-filter-bar2.js +12 -3
  563. package/dist/components/snk-filter-bar2.js.gz +0 -0
  564. package/dist/components/snk-filter-binary-select.js.gz +0 -0
  565. package/dist/components/snk-filter-checkbox-list.js.gz +0 -0
  566. package/dist/components/snk-filter-detail.js.gz +0 -0
  567. package/dist/components/snk-filter-detail2.js.gz +0 -0
  568. package/dist/components/snk-filter-field-search.js.gz +0 -0
  569. package/dist/components/snk-filter-field-search2.js.gz +0 -0
  570. package/dist/components/snk-filter-item.js.gz +0 -0
  571. package/dist/components/snk-filter-item2.js +4 -0
  572. package/dist/components/snk-filter-item2.js.gz +0 -0
  573. package/dist/components/snk-filter-list.js.gz +0 -0
  574. package/dist/components/snk-filter-modal-item.js.gz +0 -0
  575. package/dist/components/snk-filter-modal-item2.js.gz +0 -0
  576. package/dist/components/snk-filter-modal.js.gz +0 -0
  577. package/dist/components/snk-filter-modal2.js +9 -2
  578. package/dist/components/snk-filter-modal2.js.gz +0 -0
  579. package/dist/components/snk-filter-multi-select.js.gz +0 -0
  580. package/dist/components/snk-filter-number.js +1 -1
  581. package/dist/components/snk-filter-number.js.gz +0 -0
  582. package/dist/components/snk-filter-param-config.js.gz +0 -0
  583. package/dist/components/snk-filter-param-config2.js.gz +0 -0
  584. package/dist/components/snk-filter-period.js +10 -5
  585. package/dist/components/snk-filter-period.js.gz +0 -0
  586. package/dist/components/snk-filter-search.js.gz +0 -0
  587. package/dist/components/snk-filter-text.js +1 -1
  588. package/dist/components/snk-filter-text.js.gz +0 -0
  589. package/dist/components/snk-form-config.js.gz +0 -0
  590. package/dist/components/snk-form-config2.js.gz +0 -0
  591. package/dist/components/snk-form-summary.js.gz +0 -0
  592. package/dist/components/snk-form-summary2.js.gz +0 -0
  593. package/dist/components/snk-form-view.js.gz +0 -0
  594. package/dist/components/snk-form-view2.js.gz +0 -0
  595. package/dist/components/snk-form.js.gz +0 -0
  596. package/dist/components/snk-grid-config.js.gz +0 -0
  597. package/dist/components/snk-grid-config2.js.gz +0 -0
  598. package/dist/components/snk-grid.js.gz +0 -0
  599. package/dist/components/snk-grid2.js.gz +0 -0
  600. package/dist/components/snk-guides-viewer.js.gz +0 -0
  601. package/dist/components/snk-layout-form-config.js.gz +0 -0
  602. package/dist/components/snk-layout-form-config2.js.gz +0 -0
  603. package/dist/components/snk-numbering-config.js.gz +0 -0
  604. package/dist/components/snk-numbering-config2.js.gz +0 -0
  605. package/dist/components/snk-personalized-filter-editor.js.gz +0 -0
  606. package/dist/components/snk-personalized-filter.js.gz +0 -0
  607. package/dist/components/snk-personalized-filter2.js.gz +0 -0
  608. package/dist/components/snk-pesquisa.js.gz +0 -0
  609. package/dist/components/snk-pesquisa2.js.gz +0 -0
  610. package/dist/components/snk-print-selector.js.gz +0 -0
  611. package/dist/components/snk-select-box.js.gz +0 -0
  612. package/dist/components/snk-select-box2.js.gz +0 -0
  613. package/dist/components/snk-simple-bar.js.gz +0 -0
  614. package/dist/components/snk-simple-bar2.js.gz +0 -0
  615. package/dist/components/snk-simple-crud.js.gz +0 -0
  616. package/dist/components/snk-simple-crud2.js.gz +0 -0
  617. package/dist/components/snk-simple-form-config.js.gz +0 -0
  618. package/dist/components/snk-simple-form-config2.js.gz +0 -0
  619. package/dist/components/snk-taskbar.js.gz +0 -0
  620. package/dist/components/snk-taskbar2.js.gz +0 -0
  621. package/dist/components/snk-view-representation.js.gz +0 -0
  622. package/dist/components/snk-view-representation2.js.gz +0 -0
  623. package/dist/components/sortable.esm.js.gz +0 -0
  624. package/dist/components/taskbar-actions-button.js.gz +0 -0
  625. package/dist/components/taskbar-actions-button2.js.gz +0 -0
  626. package/dist/components/taskbar-split-button.js.gz +0 -0
  627. package/dist/components/taskbar-split-button2.js.gz +0 -0
  628. package/dist/components/teste-pesquisa.js.gz +0 -0
  629. package/dist/esm/AuthorizationConfig-dcbd207a.js.gz +0 -0
  630. package/dist/esm/{ConfigStorage-eb0dad92.js → ConfigStorage-9eb9cd0a.js} +2 -2
  631. package/dist/esm/ConfigStorage-9eb9cd0a.js.gz +0 -0
  632. package/dist/esm/{DataFetcher-727f545c.js → DataFetcher-8c9be33f.js} +11 -2
  633. package/dist/esm/{DataFetcher-727f545c.js.gz → DataFetcher-8c9be33f.js.gz} +0 -0
  634. package/dist/esm/FormConfigHelper-b9cf7758.js.gz +0 -0
  635. package/dist/esm/GetSelectedRecordsIDsInfo-9fa41508.js.gz +0 -0
  636. package/dist/esm/IFetchDataExporterParams-d73bed3d.js.gz +0 -0
  637. package/dist/esm/{ISave-e130962a.js → ISave-30cc0eee.js} +1 -1
  638. package/dist/esm/ISave-30cc0eee.js.gz +0 -0
  639. package/dist/esm/ParamType-d5152b06.js.gz +0 -0
  640. package/dist/esm/PersonalizedFilterUtils-2db38ff2.js.gz +0 -0
  641. package/dist/esm/PrintUtils-3e4ff0f5.js.gz +0 -0
  642. package/dist/esm/ResourceIDUtils-a114189a.js.gz +0 -0
  643. package/dist/esm/ServicesNumberingConfig-2f7b050e.js.gz +0 -0
  644. package/dist/esm/{SnkFormConfigManager-58544896.js → SnkFormConfigManager-93ff3178.js} +2 -2
  645. package/dist/esm/SnkFormConfigManager-93ff3178.js.gz +0 -0
  646. package/dist/esm/{SnkMultiSelectionListDataSource-411fd553.js → SnkMultiSelectionListDataSource-3916b4df.js} +4 -4
  647. package/dist/esm/SnkMultiSelectionListDataSource-3916b4df.js.gz +0 -0
  648. package/dist/esm/{auth-fetcher-1278c5c6.js → auth-fetcher-fbe8792a.js} +1 -1
  649. package/dist/esm/auth-fetcher-fbe8792a.js.gz +0 -0
  650. package/dist/esm/config-header.entry.js.gz +0 -0
  651. package/dist/esm/configs-button.entry.js.gz +0 -0
  652. package/dist/esm/constants-7b422de0.js.gz +0 -0
  653. package/dist/esm/{dataunit-fetcher-288a8bd8.js → dataunit-fetcher-07e525dc.js} +1 -1
  654. package/dist/esm/dataunit-fetcher-07e525dc.js.gz +0 -0
  655. package/dist/esm/default-filters-50105e43.js.gz +0 -0
  656. package/dist/esm/field-config_2.entry.js.gz +0 -0
  657. package/dist/esm/fields-layout.entry.js.gz +0 -0
  658. package/dist/esm/fields-selector.entry.js.gz +0 -0
  659. package/dist/esm/filter-item-type.enum-d45e026f.js.gz +0 -0
  660. package/dist/esm/filter-type.enum-f6a8fe23.js.gz +0 -0
  661. package/dist/esm/filter-validate-faf51fa9.js.gz +0 -0
  662. package/dist/esm/filterNumberVariation-8cee02ea.js.gz +0 -0
  663. package/dist/esm/{form-config-fetcher-d65f7148.js → form-config-fetcher-2da29748.js} +1 -1
  664. package/dist/esm/form-config-fetcher-2da29748.js.gz +0 -0
  665. package/dist/esm/guides-configurator.entry.js.gz +0 -0
  666. package/dist/esm/index-446f9341.js.gz +0 -0
  667. package/dist/esm/index-479e1293.js.gz +0 -0
  668. package/dist/esm/index-620ac460.js.gz +0 -0
  669. package/dist/esm/index-8acbae97.js.gz +0 -0
  670. package/dist/esm/index-b40568ff.js.gz +0 -0
  671. package/dist/esm/index.js.gz +0 -0
  672. package/dist/esm/loader.js.gz +0 -0
  673. package/dist/esm/pesquisa-grid_2.entry.js +4 -4
  674. package/dist/esm/pesquisa-grid_2.entry.js.gz +0 -0
  675. package/dist/esm/polyfills/core-js.js.gz +0 -0
  676. package/dist/esm/polyfills/css-shim.js.gz +0 -0
  677. package/dist/esm/polyfills/dom.js.gz +0 -0
  678. package/dist/esm/polyfills/es5-html-element.js.gz +0 -0
  679. package/dist/esm/polyfills/index.js.gz +0 -0
  680. package/dist/esm/polyfills/system.js.gz +0 -0
  681. package/dist/esm/presentationMode-783bbf9d.js.gz +0 -0
  682. package/dist/esm/sankhyablocks.js.gz +0 -0
  683. package/dist/esm/snk-actions-button_9.entry.js +5 -5
  684. package/dist/esm/snk-actions-button_9.entry.js.gz +0 -0
  685. package/dist/esm/snk-actions-form.entry.js.gz +0 -0
  686. package/dist/esm/snk-application.entry.js +6 -6
  687. package/dist/esm/snk-application.entry.js.gz +0 -0
  688. package/dist/esm/snk-attach.entry.js +5 -5
  689. package/dist/esm/snk-attach.entry.js.gz +0 -0
  690. package/dist/esm/snk-client-confirm.entry.js.gz +0 -0
  691. package/dist/esm/snk-configurator.entry.js.gz +0 -0
  692. package/dist/esm/snk-crud.entry.js +5 -5
  693. package/dist/esm/snk-crud.entry.js.gz +0 -0
  694. package/dist/esm/snk-custom-slot-elements.entry.js.gz +0 -0
  695. package/dist/esm/snk-data-exporter.entry.js +5 -5
  696. package/dist/esm/snk-data-exporter.entry.js.gz +0 -0
  697. package/dist/esm/{snk-data-unit-d102cdf8.js → snk-data-unit-bc70b88f.js} +2 -2
  698. package/dist/esm/{snk-data-unit-d102cdf8.js.gz → snk-data-unit-bc70b88f.js.gz} +0 -0
  699. package/dist/esm/snk-data-unit.entry.js +3 -3
  700. package/dist/esm/snk-data-unit.entry.js.gz +0 -0
  701. package/dist/esm/snk-default-filter.entry.js.gz +0 -0
  702. package/dist/esm/snk-detail-view.entry.js +7 -7
  703. package/dist/esm/snk-detail-view.entry.js.gz +0 -0
  704. package/dist/esm/snk-entity-list.entry.js.gz +0 -0
  705. package/dist/esm/snk-exporter-email-sender.entry.js.gz +0 -0
  706. package/dist/esm/snk-expression-group_2.entry.js.gz +0 -0
  707. package/dist/esm/snk-filter-advanced-mode_2.entry.js.gz +0 -0
  708. package/dist/esm/snk-filter-bar_4.entry.js +28 -8
  709. package/dist/esm/snk-filter-bar_4.entry.js.gz +0 -0
  710. package/dist/esm/snk-filter-binary-select.entry.js.gz +0 -0
  711. package/dist/esm/snk-filter-checkbox-list.entry.js.gz +0 -0
  712. package/dist/esm/snk-filter-detail.entry.js.gz +0 -0
  713. package/dist/esm/snk-filter-field-search_2.entry.js.gz +0 -0
  714. package/dist/esm/snk-filter-modal-item.entry.js +3 -3
  715. package/dist/esm/snk-filter-modal-item.entry.js.gz +0 -0
  716. package/dist/esm/snk-filter-multi-select.entry.js.gz +0 -0
  717. package/dist/esm/snk-filter-number.entry.js +1 -1
  718. package/dist/esm/snk-filter-number.entry.js.gz +0 -0
  719. package/dist/esm/snk-filter-period.entry.js +10 -5
  720. package/dist/esm/snk-filter-period.entry.js.gz +0 -0
  721. package/dist/esm/snk-filter-search.entry.js.gz +0 -0
  722. package/dist/esm/snk-filter-text.entry.js +1 -1
  723. package/dist/esm/snk-filter-text.entry.js.gz +0 -0
  724. package/dist/esm/snk-form-summary.entry.js.gz +0 -0
  725. package/dist/esm/snk-form-view.entry.js.gz +0 -0
  726. package/dist/esm/snk-form_2.entry.js +4 -4
  727. package/dist/esm/snk-form_2.entry.js.gz +0 -0
  728. package/dist/esm/snk-grid.entry.js +6 -6
  729. package/dist/esm/snk-grid.entry.js.gz +0 -0
  730. package/dist/esm/{snk-guides-viewer-3bf6463a.js → snk-guides-viewer-19b420c7.js} +5 -5
  731. package/dist/esm/snk-guides-viewer-19b420c7.js.gz +0 -0
  732. package/dist/esm/snk-guides-viewer.entry.js +7 -7
  733. package/dist/esm/snk-guides-viewer.entry.js.gz +0 -0
  734. package/dist/esm/snk-personalized-filter-editor.entry.js.gz +0 -0
  735. package/dist/esm/snk-personalized-filter.entry.js +3 -3
  736. package/dist/esm/snk-personalized-filter.entry.js.gz +0 -0
  737. package/dist/esm/snk-pesquisa.entry.js +4 -4
  738. package/dist/esm/snk-pesquisa.entry.js.gz +0 -0
  739. package/dist/esm/snk-print-selector.entry.js.gz +0 -0
  740. package/dist/esm/snk-simple-bar.entry.js.gz +0 -0
  741. package/dist/esm/snk-simple-crud.entry.js +7 -7
  742. package/dist/esm/snk-simple-crud.entry.js.gz +0 -0
  743. package/dist/esm/snk-taskbar.entry.js.gz +0 -0
  744. package/dist/esm/sortable.esm-842f85a3.js.gz +0 -0
  745. package/dist/esm/taskbar-elements-faaf5d8f.js.gz +0 -0
  746. package/dist/esm/taskbar-processor-3436124c.js.gz +0 -0
  747. package/dist/esm/teste-pesquisa.entry.js.gz +0 -0
  748. package/dist/index.cjs.js.gz +0 -0
  749. package/dist/index.js.gz +0 -0
  750. package/dist/sankhyablocks/index.esm.js.gz +0 -0
  751. package/dist/sankhyablocks/{p-6b804983.entry.js → p-02e80f2d.entry.js} +1 -1
  752. package/dist/sankhyablocks/p-02e80f2d.entry.js.gz +0 -0
  753. package/dist/sankhyablocks/p-07c5289b.entry.js.gz +0 -0
  754. package/dist/sankhyablocks/{p-1f274f8e.entry.js → p-0c12833d.entry.js} +1 -1
  755. package/dist/sankhyablocks/p-0c12833d.entry.js.gz +0 -0
  756. package/dist/sankhyablocks/{p-1077ce69.entry.js → p-0d85b1fc.entry.js} +1 -1
  757. package/dist/sankhyablocks/p-0d85b1fc.entry.js.gz +0 -0
  758. package/dist/sankhyablocks/p-0f3698af.js.gz +0 -0
  759. package/dist/sankhyablocks/{p-02459408.js → p-1273039f.js} +1 -1
  760. package/dist/sankhyablocks/p-1273039f.js.gz +0 -0
  761. package/dist/sankhyablocks/p-162bddae.entry.js.gz +0 -0
  762. package/dist/sankhyablocks/p-180716b2.entry.js.gz +0 -0
  763. package/dist/sankhyablocks/p-1a0caadb.js.gz +0 -0
  764. package/dist/sankhyablocks/p-1a68fb59.js.gz +0 -0
  765. package/dist/sankhyablocks/{p-8981bc46.entry.js → p-1c2258d7.entry.js} +1 -1
  766. package/dist/sankhyablocks/p-1c2258d7.entry.js.gz +0 -0
  767. package/dist/sankhyablocks/p-1e9c546e.entry.js.gz +0 -0
  768. package/dist/sankhyablocks/p-21107f0d.entry.js.gz +0 -0
  769. package/dist/sankhyablocks/p-27482793.entry.js.gz +0 -0
  770. package/dist/sankhyablocks/p-279f1ef9.entry.js.gz +0 -0
  771. package/dist/sankhyablocks/p-2fdac5e6.entry.js.gz +0 -0
  772. package/dist/sankhyablocks/{p-513912ed.js → p-3810bd66.js} +1 -1
  773. package/dist/sankhyablocks/p-3810bd66.js.gz +0 -0
  774. package/dist/sankhyablocks/p-3b167a03.entry.js.gz +0 -0
  775. package/dist/sankhyablocks/p-3d41f5a8.entry.js.gz +0 -0
  776. package/dist/sankhyablocks/{p-328236dd.js → p-403c0168.js} +1 -1
  777. package/dist/sankhyablocks/p-403c0168.js.gz +0 -0
  778. package/dist/sankhyablocks/{p-50dd4ef8.js → p-42e248cd.js} +2 -2
  779. package/dist/sankhyablocks/p-42e248cd.js.gz +0 -0
  780. package/dist/sankhyablocks/p-471b34f4.entry.js.gz +0 -0
  781. package/dist/sankhyablocks/p-49ddc27a.entry.js.gz +0 -0
  782. package/dist/sankhyablocks/{p-ad4b3547.js → p-50735892.js} +1 -1
  783. package/dist/sankhyablocks/p-50735892.js.gz +0 -0
  784. package/dist/sankhyablocks/p-51833248.js.gz +0 -0
  785. package/dist/sankhyablocks/p-5340c04e.entry.js.gz +0 -0
  786. package/dist/sankhyablocks/p-547dbd09.entry.js +1 -0
  787. package/dist/sankhyablocks/p-547dbd09.entry.js.gz +0 -0
  788. package/dist/sankhyablocks/p-55798617.js.gz +0 -0
  789. package/dist/sankhyablocks/{p-a992ae16.entry.js → p-56f2e975.entry.js} +1 -1
  790. package/dist/sankhyablocks/p-56f2e975.entry.js.gz +0 -0
  791. package/dist/sankhyablocks/{p-9732e099.entry.js → p-57c5b8b8.entry.js} +1 -1
  792. package/dist/sankhyablocks/p-57c5b8b8.entry.js.gz +0 -0
  793. package/dist/sankhyablocks/{p-a4736498.entry.js → p-5a65b696.entry.js} +1 -1
  794. package/dist/sankhyablocks/p-5a65b696.entry.js.gz +0 -0
  795. package/dist/sankhyablocks/{p-00c3c94b.js → p-5d9d7196.js} +1 -1
  796. package/dist/sankhyablocks/p-5d9d7196.js.gz +0 -0
  797. package/dist/sankhyablocks/p-60dd1d27.entry.js.gz +0 -0
  798. package/dist/sankhyablocks/p-667cab42.entry.js.gz +0 -0
  799. package/dist/sankhyablocks/p-688dcb4c.js.gz +0 -0
  800. package/dist/sankhyablocks/p-6a4b21dd.js.gz +0 -0
  801. package/dist/sankhyablocks/p-7345782c.entry.js.gz +0 -0
  802. package/dist/sankhyablocks/{p-b201e0c0.entry.js → p-7537ab18.entry.js} +1 -1
  803. package/dist/sankhyablocks/p-7537ab18.entry.js.gz +0 -0
  804. package/dist/sankhyablocks/p-75af335e.entry.js.gz +0 -0
  805. package/dist/sankhyablocks/p-76e66fd9.js.gz +0 -0
  806. package/dist/sankhyablocks/p-7dd49d15.js.gz +0 -0
  807. package/dist/sankhyablocks/p-7e250432.entry.js.gz +0 -0
  808. package/dist/sankhyablocks/p-7f7fe6c4.entry.js.gz +0 -0
  809. package/dist/sankhyablocks/{p-3c18c65a.entry.js → p-81329e1c.entry.js} +1 -1
  810. package/dist/sankhyablocks/p-81329e1c.entry.js.gz +0 -0
  811. package/dist/sankhyablocks/p-825098c1.entry.js.gz +0 -0
  812. package/dist/sankhyablocks/p-84345e7a.js.gz +0 -0
  813. package/dist/sankhyablocks/{p-de18d737.entry.js → p-8a9090b0.entry.js} +1 -1
  814. package/dist/sankhyablocks/p-8a9090b0.entry.js.gz +0 -0
  815. package/dist/sankhyablocks/p-8d884fab.js.gz +0 -0
  816. package/dist/sankhyablocks/p-8f3f2306.js.gz +0 -0
  817. package/dist/sankhyablocks/{p-bce53657.entry.js → p-8f67fb18.entry.js} +1 -1
  818. package/dist/sankhyablocks/p-8f67fb18.entry.js.gz +0 -0
  819. package/dist/sankhyablocks/p-9019a32f.js.gz +0 -0
  820. package/dist/sankhyablocks/p-91a9abb6.entry.js.gz +0 -0
  821. package/dist/sankhyablocks/p-96d45943.entry.js.gz +0 -0
  822. package/dist/sankhyablocks/{p-45437447.entry.js → p-986a8960.entry.js} +1 -1
  823. package/dist/sankhyablocks/p-986a8960.entry.js.gz +0 -0
  824. package/dist/sankhyablocks/p-988afe78.js.gz +0 -0
  825. package/dist/sankhyablocks/{p-093f58fa.entry.js → p-99a11017.entry.js} +1 -1
  826. package/dist/sankhyablocks/{p-093f58fa.entry.js.gz → p-99a11017.entry.js.gz} +0 -0
  827. package/dist/sankhyablocks/p-9a63f3f7.entry.js.gz +0 -0
  828. package/dist/sankhyablocks/{p-dfdd0035.entry.js → p-9dec2162.entry.js} +1 -1
  829. package/dist/sankhyablocks/p-9dec2162.entry.js.gz +0 -0
  830. package/dist/sankhyablocks/{p-d0209a52.js → p-9f202f85.js} +1 -1
  831. package/dist/sankhyablocks/p-9f202f85.js.gz +0 -0
  832. package/dist/sankhyablocks/{p-4157ea10.js → p-a17e9ecd.js} +1 -1
  833. package/dist/sankhyablocks/p-a17e9ecd.js.gz +0 -0
  834. package/dist/sankhyablocks/p-a97038ee.entry.js +1 -0
  835. package/dist/sankhyablocks/p-a97038ee.entry.js.gz +0 -0
  836. package/dist/sankhyablocks/{p-4c763b10.entry.js → p-a9b16874.entry.js} +1 -1
  837. package/dist/sankhyablocks/p-a9b16874.entry.js.gz +0 -0
  838. package/dist/sankhyablocks/p-b568c1d4.js.gz +0 -0
  839. package/dist/sankhyablocks/p-b7e891cc.entry.js.gz +0 -0
  840. package/dist/sankhyablocks/p-b987e15d.js.gz +0 -0
  841. package/dist/sankhyablocks/p-c3dbf441.entry.js.gz +0 -0
  842. package/dist/sankhyablocks/p-c4fcf1fb.entry.js.gz +0 -0
  843. package/dist/sankhyablocks/p-cad964b5.js.gz +0 -0
  844. package/dist/sankhyablocks/p-cb4343c4.entry.js.gz +0 -0
  845. package/dist/sankhyablocks/{p-ccd1ab5b.js → p-cdda05e3.js} +1 -1
  846. package/dist/sankhyablocks/p-cdda05e3.js.gz +0 -0
  847. package/dist/sankhyablocks/p-d68904a9.js.gz +0 -0
  848. package/dist/sankhyablocks/p-d8d8169b.js.gz +0 -0
  849. package/dist/sankhyablocks/{p-8f4a718b.entry.js → p-d8f25b9e.entry.js} +1 -1
  850. package/dist/sankhyablocks/p-d8f25b9e.entry.js.gz +0 -0
  851. package/dist/sankhyablocks/p-dc36cfbf.js.gz +0 -0
  852. package/dist/sankhyablocks/p-e258de96.entry.js.gz +0 -0
  853. package/dist/sankhyablocks/{p-0acb3a2a.js → p-e400dc69.js} +1 -1
  854. package/dist/sankhyablocks/p-e400dc69.js.gz +0 -0
  855. package/dist/sankhyablocks/p-e679c75a.entry.js +1 -0
  856. package/dist/sankhyablocks/p-e679c75a.entry.js.gz +0 -0
  857. package/dist/sankhyablocks/p-eaad0aa8.js.gz +0 -0
  858. package/dist/sankhyablocks/p-f4184ce7.js.gz +0 -0
  859. package/dist/sankhyablocks/p-fa80e546.js.gz +0 -0
  860. package/dist/sankhyablocks/p-ff1990ad.js.gz +0 -0
  861. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  862. package/dist/sankhyablocks/sankhyablocks.esm.js.gz +0 -0
  863. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-period.d.ts +1 -0
  864. package/package.json +1 -1
  865. package/dist/cjs/ConfigStorage-2c528adc.js.gz +0 -0
  866. package/dist/cjs/DataFetcher-36fd8b26.js.gz +0 -0
  867. package/dist/cjs/ISave-a43d8683.js.gz +0 -0
  868. package/dist/cjs/SnkFormConfigManager-b3ff72a3.js.gz +0 -0
  869. package/dist/cjs/SnkMultiSelectionListDataSource-ca893d61.js.gz +0 -0
  870. package/dist/cjs/auth-fetcher-35ec1416.js.gz +0 -0
  871. package/dist/cjs/dataunit-fetcher-a71276bb.js.gz +0 -0
  872. package/dist/cjs/form-config-fetcher-37296a56.js.gz +0 -0
  873. package/dist/cjs/snk-data-unit-c2a0d85c.js.gz +0 -0
  874. package/dist/cjs/snk-guides-viewer-dee5ddd6.js.gz +0 -0
  875. package/dist/esm/ConfigStorage-eb0dad92.js.gz +0 -0
  876. package/dist/esm/ISave-e130962a.js.gz +0 -0
  877. package/dist/esm/SnkFormConfigManager-58544896.js.gz +0 -0
  878. package/dist/esm/SnkMultiSelectionListDataSource-411fd553.js.gz +0 -0
  879. package/dist/esm/auth-fetcher-1278c5c6.js.gz +0 -0
  880. package/dist/esm/dataunit-fetcher-288a8bd8.js.gz +0 -0
  881. package/dist/esm/form-config-fetcher-d65f7148.js.gz +0 -0
  882. package/dist/esm/snk-guides-viewer-3bf6463a.js.gz +0 -0
  883. package/dist/sankhyablocks/p-00c3c94b.js.gz +0 -0
  884. package/dist/sankhyablocks/p-02459408.js.gz +0 -0
  885. package/dist/sankhyablocks/p-0acb3a2a.js.gz +0 -0
  886. package/dist/sankhyablocks/p-1077ce69.entry.js.gz +0 -0
  887. package/dist/sankhyablocks/p-1f274f8e.entry.js.gz +0 -0
  888. package/dist/sankhyablocks/p-328236dd.js.gz +0 -0
  889. package/dist/sankhyablocks/p-3c18c65a.entry.js.gz +0 -0
  890. package/dist/sankhyablocks/p-3ed04f0d.entry.js +0 -1
  891. package/dist/sankhyablocks/p-3ed04f0d.entry.js.gz +0 -0
  892. package/dist/sankhyablocks/p-4157ea10.js.gz +0 -0
  893. package/dist/sankhyablocks/p-45437447.entry.js.gz +0 -0
  894. package/dist/sankhyablocks/p-4c763b10.entry.js.gz +0 -0
  895. package/dist/sankhyablocks/p-50dd4ef8.js.gz +0 -0
  896. package/dist/sankhyablocks/p-513912ed.js.gz +0 -0
  897. package/dist/sankhyablocks/p-52557e37.entry.js +0 -1
  898. package/dist/sankhyablocks/p-52557e37.entry.js.gz +0 -0
  899. package/dist/sankhyablocks/p-6b804983.entry.js.gz +0 -0
  900. package/dist/sankhyablocks/p-6bf4cfbf.entry.js +0 -1
  901. package/dist/sankhyablocks/p-6bf4cfbf.entry.js.gz +0 -0
  902. package/dist/sankhyablocks/p-8981bc46.entry.js.gz +0 -0
  903. package/dist/sankhyablocks/p-8f4a718b.entry.js.gz +0 -0
  904. package/dist/sankhyablocks/p-9732e099.entry.js.gz +0 -0
  905. package/dist/sankhyablocks/p-a4736498.entry.js.gz +0 -0
  906. package/dist/sankhyablocks/p-a992ae16.entry.js.gz +0 -0
  907. package/dist/sankhyablocks/p-ad4b3547.js.gz +0 -0
  908. package/dist/sankhyablocks/p-b201e0c0.entry.js.gz +0 -0
  909. package/dist/sankhyablocks/p-bce53657.entry.js.gz +0 -0
  910. package/dist/sankhyablocks/p-ccd1ab5b.js.gz +0 -0
  911. package/dist/sankhyablocks/p-d0209a52.js.gz +0 -0
  912. package/dist/sankhyablocks/p-de18d737.entry.js.gz +0 -0
  913. package/dist/sankhyablocks/p-dfdd0035.entry.js.gz +0 -0
@@ -1 +1 @@
1
- import{r as t,c as i,h as e,H as s,g as r}from"./p-d8d8169b.js";import{ElementIDUtils as o,ObjectUtils as a}from"@sankhyalabs/core";import{C as l}from"./p-4157ea10.js";import{E as n}from"./p-1a68fb59.js";import{F as h}from"./p-ff1990ad.js";import{F as d}from"./p-b568c1d4.js";import"./p-02459408.js";import"./p-ccd1ab5b.js";import"./p-8d884fab.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";const p=class{constructor(e){t(this,e),this.filterChange=i(this,"filterChange",7),this.editPersonalizedFilter=i(this,"editPersonalizedFilter",7),this.addPersonalizedFilter=i(this,"addPersonalizedFilter",7),this.filterItem=void 0,this.configName=void 0,this.resourceID=void 0}getContentEditorConfig(){const t={presentationMode:n.MODAL};switch(this.filterItem.type){case h.BINARY_SELECT:return{tag:"snk-filter-binary-select",props:t};case h.MULTI_SELECT:return{tag:"snk-filter-multi-select"};case h.PERIOD:return{tag:"snk-filter-period",props:t};case h.SEARCH:return{tag:"snk-filter-search"};case h.NUMBER:return{tag:"snk-filter-number",props:t};case h.PERSONALIZED:return this.buildSnkFilterPersonalizedProps();case h.CHECK_BOX_LIST:return{tag:"snk-filter-checkbox-list",props:t};case h.MULTI_LIST:return{tag:"snk-entity-list",props:{maxHeightList:"640px",rightListSlotBuilder:t=>this.buildRightSlot(t)}}}return{tag:"snk-filter-text"}}buildSnkFilterPersonalizedProps(){return{tag:"snk-personalized-filter-editor",props:{onEditFilter:t=>this.editPersonalizedFilter.emit(t.detail),onAddFilter:()=>this.addPersonalizedFilter.emit()}}}isVisible(t){return!!this.filterItem.visible||void 0!==t}updateFilterValue(t){var i,e;const s=void 0!==(null==t?void 0:t.value)?t.value:t;this.filterItem=Object.assign(Object.assign({},this.filterItem),null!=this.filterItem.groupedItems?{visible:s>0,value:s,groupedItems:t.items}:{value:this.filterItem.type===(h.SEARCH||h.CHECK_BOX_LIST)?t:s,visible:this.isVisible(s)}),this._editor&&(this._editor.config=this.filterItem),null===(e=null===(i=this._editor)||void 0===i?void 0:i.reloadList)||void 0===e||e.call(i),this.filterChange.emit(this.filterItem)}handleDeleteFilter(t,i){i===h.PERSONALIZED&&l.removePersonalizedFilter(t,this.resourceID,this.configName)}componentDidLoad(){if(this._element){o.addIDInfo(this._element);const t=this._element.getAttribute(o.DATA_ELEMENT_ID_ATTRIBUTE_NAME);this._idContentEditor=`${t}_${this.filterItem.id}`}}buildRightSlot(t){return e("ez-icon",{iconName:"delete",onClick:()=>this.removeValueFromConfig(t)})}removeValueFromConfig(t){var i,e,s;const r=null===(e=null===(i=this.filterItem)||void 0===i?void 0:i.value)||void 0===e?void 0:e.findIndex((({id:i})=>i===t.id)),o=a.copy(this.filterItem);null===(s=null==o?void 0:o.value)||void 0===s||s.splice(r,1),this.updateFilterValue(o.value)}canShowDetailModal(){const{CUSTOM_FILTER:t,OTHER_FILTERS:i}=d;return![t,i].includes(this.filterItem.filterType)&&this.filterItem.type!==h.BINARY_SELECT}render(){const{tag:t,props:i}=this.getContentEditorConfig();return e(s,null,e("div",{class:"ez-flex ez-flex--column grow"},this.canShowDetailModal()&&e("label",{class:"ez-text ez-text--medium ez-text--primary ez-margin-bottom--extra-small",htmlFor:`filter-item-${this.filterItem.id}`},this.filterItem.detailModal),e(t,Object.assign({ref:t=>this._editor=t,id:`filter-item-${this.filterItem.id}`,config:this.filterItem,value:this.filterItem.value,onValueChanged:t=>this.updateFilterValue(t.detail),"data-element-id":this._idContentEditor},i))))}get _element(){return r(this)}};p.style=".grow{flex-grow:1}.gap{gap:4px}";export{p as snk_filter_modal_item}
1
+ import{r as t,c as i,h as e,H as s,g as r}from"./p-d8d8169b.js";import{ElementIDUtils as o,ObjectUtils as a}from"@sankhyalabs/core";import{C as l}from"./p-a17e9ecd.js";import{E as n}from"./p-1a68fb59.js";import{F as h}from"./p-ff1990ad.js";import{F as d}from"./p-b568c1d4.js";import"./p-1273039f.js";import"./p-cdda05e3.js";import"./p-8d884fab.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";const p=class{constructor(e){t(this,e),this.filterChange=i(this,"filterChange",7),this.editPersonalizedFilter=i(this,"editPersonalizedFilter",7),this.addPersonalizedFilter=i(this,"addPersonalizedFilter",7),this.filterItem=void 0,this.configName=void 0,this.resourceID=void 0}getContentEditorConfig(){const t={presentationMode:n.MODAL};switch(this.filterItem.type){case h.BINARY_SELECT:return{tag:"snk-filter-binary-select",props:t};case h.MULTI_SELECT:return{tag:"snk-filter-multi-select"};case h.PERIOD:return{tag:"snk-filter-period",props:t};case h.SEARCH:return{tag:"snk-filter-search"};case h.NUMBER:return{tag:"snk-filter-number",props:t};case h.PERSONALIZED:return this.buildSnkFilterPersonalizedProps();case h.CHECK_BOX_LIST:return{tag:"snk-filter-checkbox-list",props:t};case h.MULTI_LIST:return{tag:"snk-entity-list",props:{maxHeightList:"640px",rightListSlotBuilder:t=>this.buildRightSlot(t)}}}return{tag:"snk-filter-text"}}buildSnkFilterPersonalizedProps(){return{tag:"snk-personalized-filter-editor",props:{onEditFilter:t=>this.editPersonalizedFilter.emit(t.detail),onAddFilter:()=>this.addPersonalizedFilter.emit()}}}isVisible(t){return!!this.filterItem.visible||void 0!==t}updateFilterValue(t){var i,e;const s=void 0!==(null==t?void 0:t.value)?t.value:t;this.filterItem=Object.assign(Object.assign({},this.filterItem),null!=this.filterItem.groupedItems?{visible:s>0,value:s,groupedItems:t.items}:{value:this.filterItem.type===(h.SEARCH||h.CHECK_BOX_LIST)?t:s,visible:this.isVisible(s)}),this._editor&&(this._editor.config=this.filterItem),null===(e=null===(i=this._editor)||void 0===i?void 0:i.reloadList)||void 0===e||e.call(i),this.filterChange.emit(this.filterItem)}handleDeleteFilter(t,i){i===h.PERSONALIZED&&l.removePersonalizedFilter(t,this.resourceID,this.configName)}componentDidLoad(){if(this._element){o.addIDInfo(this._element);const t=this._element.getAttribute(o.DATA_ELEMENT_ID_ATTRIBUTE_NAME);this._idContentEditor=`${t}_${this.filterItem.id}`}}buildRightSlot(t){return e("ez-icon",{iconName:"delete",onClick:()=>this.removeValueFromConfig(t)})}removeValueFromConfig(t){var i,e,s;const r=null===(e=null===(i=this.filterItem)||void 0===i?void 0:i.value)||void 0===e?void 0:e.findIndex((({id:i})=>i===t.id)),o=a.copy(this.filterItem);null===(s=null==o?void 0:o.value)||void 0===s||s.splice(r,1),this.updateFilterValue(o.value)}canShowDetailModal(){const{CUSTOM_FILTER:t,OTHER_FILTERS:i}=d;return![t,i].includes(this.filterItem.filterType)&&this.filterItem.type!==h.BINARY_SELECT}render(){const{tag:t,props:i}=this.getContentEditorConfig();return e(s,null,e("div",{class:"ez-flex ez-flex--column grow"},this.canShowDetailModal()&&e("label",{class:"ez-text ez-text--medium ez-text--primary ez-margin-bottom--extra-small",htmlFor:`filter-item-${this.filterItem.id}`},this.filterItem.detailModal),e(t,Object.assign({ref:t=>this._editor=t,id:`filter-item-${this.filterItem.id}`,config:this.filterItem,value:this.filterItem.value,onValueChanged:t=>this.updateFilterValue(t.detail),"data-element-id":this._idContentEditor},i))))}get _element(){return r(this)}};p.style=".grow{flex-grow:1}.gap{gap:4px}";export{p as snk_filter_modal_item}
Binary file
@@ -1,4 +1,4 @@
1
- import{d as e,D as t}from"./p-ccd1ab5b.js";import{ObjectUtils as n}from"@sankhyalabs/core";class o{constructor(){this.templateByQuery=new Map,this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchResource",e.gql`query($name: String!) {
1
+ import{d as e,D as t}from"./p-cdda05e3.js";import{ObjectUtils as n}from"@sankhyalabs/core";class o{constructor(){this.templateByQuery=new Map,this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchResource",e.gql`query($name: String!) {
2
2
  $queryAlias$: fetchResource(name: $name){
3
3
  resource
4
4
  }
Binary file
Binary file
@@ -1 +1 @@
1
- import{r as i,c as t,h as s,g as e}from"./p-d8d8169b.js";import{StringUtils as n,ApplicationContext as o,ObjectUtils as h,Action as a,DataType as r,UserInterface as d,KeyboardManager as l,ElementIDUtils as u}from"@sankhyalabs/core";import{CSSVarsUtils as c,buildFieldSearch as m}from"@sankhyalabs/ezui/dist/collection/utils";import{V as p,S as g}from"./p-9019a32f.js";import{T as v}from"./p-b987e15d.js";import"./p-ccd1ab5b.js";import"./p-328236dd.js";import{S as f,R as C,b,a as S,c as k}from"./p-0acb3a2a.js";import{P as y}from"./p-0f3698af.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import{I as w}from"./p-50dd4ef8.js";import"./p-ff1990ad.js";import{F}from"./p-02459408.js";import{T as E}from"./p-1a0caadb.js";import{C as T}from"./p-4157ea10.js";import{S as I}from"./p-ad4b3547.js";import{s as _}from"./p-55798617.js";import"./p-8d884fab.js";import"./p-7dd49d15.js";import"./p-8f3f2306.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";const z=["INSERT","REFRESH","PREVIOUS","NEXT","DIVIDER","MORE_OPTIONS"],R=["INSERT","REFRESH","PREVIOUS","NEXT","DIVIDER","CLONE","REMOVE","DIVIDER","MORE_OPTIONS"],M=class{constructor(s){i(this,s),this.dataStateChange=t(this,"dataStateChange",3),this.dataUnitReady=t(this,"dataUnitReady",3),this.actionClick=t(this,"actionClick",7),this.formItemsReady=t(this,"formItemsReady",7),this.configuratorSave=t(this,"configuratorSave",7),this.configuratorCancel=t(this,"configuratorCancel",7),this._multiSelectionListDataSource=new f,this._formConfigFetcher=new F,this._customEditors=new Map,this._customRenders=new Map,this._container=void 0,this._showPopUpGridConfig=!1,this._currentViewMode=p.GRID,this._config=void 0,this._fieldToGetFocus=void 0,this._customContainerId=`SNK-SIMPLE-CRUD-CUSTOM-CONTAINER-${n.generateUUID()}`,this.enableLockManagerLoadingComp=!1,this.enableLockManagerTaskbarClick=!1,this.dataState=void 0,this.dataUnit=void 0,this.entityName=void 0,this.mode=g.SERVER,this.gridConfig=void 0,this.formConfig=void 0,this._formFields=[],this._fieldsProps=new Map,this.enableContinuousInsert=!1,this.multipleSelection=void 0,this.useCancelConfirm=!0,this.pageSize=150,this.resourceID=void 0,this.enableGridInsert=!1,this.paginationCounterMode="auto",this.taskbarManager=void 0,this.messagesBuilder=void 0,this.useEnterLikeTab=!1,this.actionsList=void 0,this.configName=void 0,this.showConfiguratorButtons=!1,this.gridLegacyConfigName=void 0,this.formLegacyConfigName=void 0,this.ignoreReadOnlyFormFields=!1,this.autoFocus=!0,this.domainMessagesBuilder=void 0,this.multipleEditionEnabled=!0,this.layoutFormConfig=!0,this.autoLoad=void 0,this.outlineMode=!1}async addCustomEditor(i,t){if(this._grid&&this._form)return this._grid.addCustomEditor(i,t),void this._form.addCustomEditor(i,t);const s=new Map(this._customEditors);s.set(i,t),this._customEditors=s}async addGridCustomRender(i,t){if(this._grid)return void this._grid.addGridCustomRender(i,t);const s=new Map(this._customRenders);s.set(i,t),this._customRenders=s}async handleResourceIDChanged(i,t){n.isEmpty(i)||i!==t&&(await this.loadFormConfig(!0),await this.loadGridConfig(!0))}async addCustomValueFormatter(i,t){this._grid.addCustomValueFormatter(i,t)}async removeCustomValueFormatter(i){this._grid.removeCustomValueFormatter(i)}async setFieldProp(i,t,s){const e=new Map(this._fieldsProps),n=this._fieldsProps.get(i);e.set(i,Object.assign(Object.assign({},n),{[t]:s})),this._fieldsProps=e}loadTaskbarProcessor(){const i={};i[D.FORM_REGULAR]=this.getButtons(!1,[v.GRID_MODE],!0),i[D.GRID_REGULAR]=this.getButtons(!1,[v.DATA_EXPORTER,v.FORM_MODE]),i[D.FORM_SELECTED]=this.getButtons(!0,[v.GRID_MODE],!0),i[D.GRID_SELECTED]=this.getGridSelectedButtonsCallBack.bind(this),i[D.FINISH_EDITION]=this.getFinishEditionButtonsCallback.bind(this),i[D.MULTIPLE_EDITION]=[v.CANCEL],this._taskbarProcessor=new E(i)}getGridSelectedButtonsCallBack(){var i,t,s;return this.multipleEditionEnabled&&1!==(null===(s=null===(t=null===(i=this.dataState)||void 0===i?void 0:i.selectionInfo)||void 0===t?void 0:t.records)||void 0===s?void 0:s.length)?this.getButtons(!0,[v.UPDATE_MULTIPLE,v.DATA_EXPORTER,v.FORM_MODE]):this.getButtons(!0,[v.DATA_EXPORTER,v.FORM_MODE])}getFinishEditionButtonsCallback(){const i=[v.CANCEL,v.SAVE];return this.enableGridInsert&&this._currentViewMode!==p.ATTACHMENT&&i.push(this._currentViewMode===p.GRID?v.FORM_MODE:v.GRID_MODE),i}getButtons(i,t,s){let e=i?R:z;return(s||this.mode===g.IN_MEMORY)&&(e=e.filter((i=>i!==v.REFRESH))),this.addConfigButton(e.concat(t))}addConfigButton(i){return void 0===this.configName||this.configName&&this.gridLegacyConfigName?i:i.concat(v.CONFIGURATOR)}get application(){return o.getContextValue("__SNK__APPLICATION__")}async goToView(i){this._currentViewMode=i,this._viewStack&&(i===p.GRID&&(this.dataUnit.isMultipleEdition=!1),this._viewStack.show(i)),i===p.GRID&&requestAnimationFrame((()=>this.focusToGrid())),i===p.FORM&&requestAnimationFrame((()=>this.focusToForm()))}actionClickListener(i){this.handleTaskbarAction(i.detail),i.stopPropagation()}handleTaskbarAction(i){switch(i){case v.CONFIGURATOR:this._snkConfigurator.open();break;case v.GRID_MODE:this.goToView(p.GRID);break;case v.FORM_MODE:this.goToView(p.FORM);break;case v.UPDATE_MULTIPLE:this.dataUnit.isMultipleEdition=!0,this.goToView(p.FORM)}}async onChangeEntityName(i){if(this.dataUnit)return;const t=o.getContextValue("__SNK__APPLICATION__");this.dataUnit=await t.getDataUnit(i,null,null,this.configName)}onModeChange(){this.mode==g.IN_MEMORY&&this.initInMemoryDataUnit()}observeDataState(i,t){this.handleDataStateChange(i,t)}async observeFormLegacy(i,t){await this.handleUpdateFormLegacyConfig(i,t)}async observeGridLegacy(i,t){await this.handleUpdateGridLegacyConfig(i,t)}async handleDataStateChange(i,t){h.objectToString(t)!=h.objectToString(i)&&this.dataStateChange.emit(i),await this.processRmPrecision()}async processRmPrecision(){var i,t;const s=await this._snkDataUnit.getFieldsWithRmPrecision();for(const e of s||[]){if(!e)continue;const s=null===(t=null===(i=this.dataState)||void 0===i?void 0:i.rowMetadata)||void 0===t?void 0:t.getProp("rm_precision",e);(s||0===s)&&(await this.setFieldProp(e,"precision",s),await this.setFieldProp(e,"prettyPrecision",s))}this._rmPrecisionCustomValueFormatter.setDataState(this.dataState)}async handleUpdateGridLegacyConfig(i,t){null!=i&&i!=t&&this._gridConfigAlreadyLoaded&&await this.loadGridConfig(!0)}async handleUpdateFormLegacyConfig(i,t){null!=i&&i!=t&&this._formConfigAlreadyLoaded&&await this.loadFormConfig(!0)}openConfig(i){this._snkConfigurator.close(),i===p.GRID?this.openGridConfig():i===p.FORM&&this.openFormConfig()}openGridConfig(){this._grid.getColumnsState().then((i=>{this._snkGridConfig.columns=i.filter((i=>i.name)),this._snkGridConfig.selectedIndex=0,this._showPopUpGridConfig=!0}))}async openFormConfig(){(this.formLegacyConfigName||this.configName)&&await this._snkSimpleFormConfig.show()}addGridLegacyConfigName(){this.gridLegacyConfigName&&this.configName&&T.addGridLegacyConfig(this.configName,this.gridLegacyConfigName)}loadGridConfig(i){if(void 0!==this.configName&&(null==this.gridConfig&&!this._gridConfigAlreadyLoaded||i))return this.addGridLegacyConfigName(),this._gridConfigAlreadyLoaded=!0,new Promise(((i,t)=>{T.loadGridConfig(this.configName,this.resolveResourceID()).then((t=>{this.setGridConfig(t),i()})).catch((i=>{t(i)}))}))}formConfigIsLoaded(){return null!=this.formConfig||this._formConfigAlreadyLoaded}async loadFormConfig(i=!1,t=!1){if(void 0===this.configName)return;if(null==this._formConfigManager&&(this._formConfigManager=new I(this.configName,this.resolveResourceID(),void 0,this.dataUnit),this._formConfigManager.setConfig(this.formConfig)),this.formConfigIsLoaded()&&!i)return;this._formConfigAlreadyLoaded=!0;let s=await this._formConfigFetcher.fetchLegacyConfigurableForm(this.formLegacyConfigName);if(null!=s)return this._formConfigManager.setConfig(s),void this.setFormConfig(s,t);this.setFormConfig(await this._formConfigManager.loadConfig())}async componentWillRender(){this.loadTaskbarProcessor(),this._resourceID=await this.application.getResourceID(),this.dataExporterProviderStore(),this.dataExporterProviderStore(),this._taskbarProcessor.process(this.getTaskBarId(),this.taskbarManager,this.dataState,this.getTaskBarDisabledButtons()),void 0!==this.configName&&(null!=this.gridConfig||this._gridConfigAlreadyLoaded||(await this.addGridLegacyConfigName(),await this.loadGridConfig(),await this.loadFormConfig()))}componentDidRender(){this._rmPrecisionCustomValueFormatter.setGrid(this._grid),this.addGridCustomValueFormattters(),this.setFieldsProps(),this.setCustomRenders(),this.setCustomEditors()}componentWillLoad(){this.processMetadata(),this.onModeChange(),this.configDatasource(),this._rmPrecisionCustomValueFormatter=new C,this._continuousInsertUtils=new b(this.application,this.resolveResourceID(),this.configName),this.enableGridInsert&&this._continuousInsertUtils.getConfig().then((i=>this.enableContinuousInsert=i))}componentDidLoad(){c.applyVarsGrid(this._element,this._grid),this.initKeyboardManager(),this.dataUnit.subscribe(this.dataUnitActionHandler.bind(this))}async dataUnitActionHandler(i){i.type!==a.EDITION_CANCELED&&i.type!==a.DATA_SAVED||this.dataUnit.isMultipleEdition&&this.goToView(p.GRID)}getMessage(i,t){var s;return null===(s=this.messagesBuilder)||void 0===s?void 0:s.getMessage(i,t)}disconnectedCallback(){var i;null===(i=this._keyboardManager)||void 0===i||i.unbindAllShortcutKeys()}setCustomRenders(){if(this._grid)for(const[i,t]of this._customRenders)this._grid.addGridCustomRender(i,t),this._customRenders.delete(i)}setCustomEditors(){if(this._grid&&this._form)for(const[i,t]of this._customEditors)this._grid.addCustomEditor(i,t),this._form.addCustomEditor(i,t),this._customEditors.delete(i)}configDatasource(){this._multiSelectionListDataSource.setApplication(this.application),this._multiSelectionListDataSource.setDataUnit(this.dataUnit)}setFieldsProps(){if(this._form)for(const[i,t]of this._fieldsProps){for(const s in t)this._form.setFieldProp(i,s,t[s]);this._fieldsProps.delete(i)}}getTaskBarId(){var i,t;return(null===(i=this.dataState)||void 0===i?void 0:i.isDirty)?D.FINISH_EDITION:this.dataUnit.isMultipleEdition?D.MULTIPLE_EDITION:(null===(t=this.dataState)||void 0===t?void 0:t.selectionInfo)&&!this.dataState.selectionInfo.isAllRecords()&&this.dataState.selectionInfo.length>0?this._currentViewMode===p.GRID?D.GRID_SELECTED:D.FORM_SELECTED:this._currentViewMode===p.GRID?D.GRID_REGULAR:D.FORM_REGULAR}initInMemoryDataUnit(){this._inMemoryLoader=new w(this._metadata,void 0,{autoLoad:this.autoLoad}),this.dataUnit=this._inMemoryLoader.dataUnit,this.dataUnitReady.emit(this.dataUnit)}setMetadata(i){return this._inMemoryLoader?this._inMemoryLoader.metadata=i:this.dataUnit&&(this.dataUnit.metadata=i),Promise.resolve()}setRecords(i){return this._inMemoryLoader?this._inMemoryLoader.records=i:this.dataUnit&&(this.dataUnit.records=i),Promise.resolve()}getRecords(){return Promise.resolve(this.dataUnit.records)}async openConfigurator(){var i;null===(i=this._snkConfigurator)||void 0===i||i.open()}async closeConfigurator(){var i;null===(i=this._snkConfigurator)||void 0===i||i.close()}async updateConfig(){null==this._formConfigManager&&(this._formConfigManager=new I(this.configName,this.resolveResourceID())),this._formConfigManager.setConfig(this.formConfig)}processMetadata(){const i=this._element.querySelectorAll("snk-field-metadata"),t=[],s={fields:[],emptyConfig:!1};i.forEach((i=>{const e={name:i.getAttribute("name")||i.getAttribute("label"),label:i.getAttribute("label"),dataType:r[i.getAttribute("dataType")]||r.TEXT,userInterface:d[i.getAttribute("userInterface")]||d.SHORTTEXT,readOnly:"true"==i.getAttribute("readOnly"),required:"true"==i.getAttribute("required"),tab:i.getAttribute("tab")||void 0,visible:"false"!=i.getAttribute("visible")};s.fields.push({name:e.name,tab:e.tab,visible:e.visible}),t.push(e)})),t.length>0&&(this.formConfig||(this.formConfig=s),this._metadata={name:"SimpleCrud",label:"SimpleCrud",fields:t})}addGridCustomValueFormattters(){var i,t,s;const e=(null===(i=this._metadata)||void 0===i?void 0:i.fields)||(null===(s=null===(t=this.dataUnit)||void 0===t?void 0:t.metadata)||void 0===s?void 0:s.fields);if(!e)return;const n=[];e.forEach((i=>{var t;(null===(t=i.properties)||void 0===t?void 0:t.rm_precision)&&!n.includes(i.name)&&n.push(i.name)})),n.forEach((i=>{this.addCustomValueFormatter(i,this._rmPrecisionCustomValueFormatter)}))}onDataStateChange(i){this.dataState=Object.assign({},i.detail)}getTaskBarDisabledButtons(){var i,t,s,e,n,o;const h=[];return(null===(i=this.dataState)||void 0===i?void 0:i.hasNext)||h.push(v.NEXT),(null===(t=this.dataState)||void 0===t?void 0:t.hasPrevious)||h.push(v.PREVIOUS),(null===(e=null===(s=this.dataState)||void 0===s?void 0:s.selectionInfo)||void 0===e?void 0:e.isEmpty())&&h.push(v.FORM_MODE),(null===(o=null===(n=this.dataState)||void 0===n?void 0:n.selectionInfo)||void 0===o?void 0:o.length)>1&&h.push(v.CLONE),h}handleCancelEdit(){var i;(null===(i=this.dataState)||void 0===i?void 0:i.recordsIsEmpty)&&(this.goToView(p.GRID),this.dataUnit.clearSelection())}handleConfiguratorEvent(i,t){i.stopImmediatePropagation(),"SAVE"!==t?this.configuratorCancel.emit():this.configuratorSave.emit()}onSelectField(i){null!=i&&(this._fieldToGetFocus=i.value)}getFieldSearch(i,t){return null!=this._fieldSearch||(this._splitButtonForm=i,this._fieldSearch=m(t,(({argument:i})=>this.fieldsOptionLoader(i)),(i=>this.onSelectField(i)))),this._fieldSearch}getFormFields(){var i,t;return null!==(t=null===(i=this.formConfig)||void 0===i?void 0:i.fields)&&void 0!==t?t:this._formFields}handleFormSetFields(i){h.equals(this._formFields,i)||(this._formFields=null!=i?i:[])}fieldsOptionLoader(i){const t=null==i?void 0:i.toLowerCase(),s=this.getFormFields().map((i=>{var t;return null===(t=this.dataUnit)||void 0===t?void 0:t.getField(i.name)})).filter((i=>{var s,e;return(null===(s=i.name)||void 0===s?void 0:s.toLowerCase().includes(t))||(null===(e=i.label)||void 0===e?void 0:e.toLowerCase().includes(t))})).map((i=>({value:i.name,label:i.label})));return Promise.resolve(s)}isGridInsertActive(){return this.enableGridInsert&&this.dataUnit.hasNewRecord()}getColumnSearch(i,t){return null!=this._columnSearch||(this._splitButton=i,this._columnSearch=m(t,(({argument:i})=>new Promise((t=>{this._grid.filterColumns(i).then((i=>{t(i.filter((i=>!i.hidden)).map((i=>({label:i.label,value:i.name}))))}))}))),(i=>{null!=i&&this._grid.locateColumn(i.value)}))),this._columnSearch}getActionsList(){const i=[];if(this.enableGridInsert&&i.push(this._continuousInsertUtils.actionContinuousInsert(this.enableContinuousInsert,(()=>{this.enableContinuousInsert=!this.enableContinuousInsert,this._continuousInsertUtils.handleSaveConfig(this.enableContinuousInsert)}))),this.isGridInsertActive())return i;if(null!=this.taskbarManager&&null!=this.taskbarManager.getMoreOptions){const t=this.getTopTaskBarId();return i.concat(this.taskbarManager.getMoreOptions(t,this.configName,this.dataState,this.actionsList))}return i.concat(this.actionsList)}getSettingsListGrid(){return[{value:n.generateUUID(),label:this.getMessage("snkSimpleCrud.findColumn"),disableCloseOnSelect:!0,eagerInitialize:!0,itemBuilder:(i,t)=>this.getColumnSearch(i,t)}]}getSettingsListForm(){return[{value:n.generateUUID(),label:this.getMessage("snkSimpleCrud.findFields"),disableCloseOnSelect:!0,eagerInitialize:!0,itemBuilder:(i,t)=>this.getFieldSearch(i,t)}]}getTopTaskBarId(){var i;return(null===(i=this.dataState)||void 0===i?void 0:i.isDirty)?`snkGridTopTaskbar.finish_edition${y.PRIMARY}`:`snkGridTopTaskbar.regular${y.PRIMARY}`}clearFieldToFocusHandler(){this._fieldToGetFocus=void 0}gridConfigChangeHandler(i){i.stopPropagation(),this.configName&&T.saveGridConfig(i.detail,this.configName,this.resolveResourceID())}modalConfigChangeHandler(i){const t=i.detail;this._grid.setColumnsState(t.columns).then((()=>{this.setGridConfig(t),this.closeGridConfig(),this.dataExporterProviderStore()})),i.stopPropagation()}async dataExporterProviderStore(){if(null==this.dataUnit)return;if(null==this._grid)return;const i=new k(this.dataUnit,this._grid);_.set("exporterProviders",Object.assign(Object.assign({},_.get("exporterProviders")),{[this.getDataExporterStoreKey()]:i}))}getDataExporterStoreKey(){return`SnkSimpleCrudDataExporter:${null==this.configName?this.dataUnit.name:this.configName}`}setGridConfig(i){this.gridConfig=i,S.assertDefaultSorting(this.gridConfig,this.dataUnit)}setFormConfig(i,t){this.formConfig&&!t||(this.formConfig=i)}closeGridConfig(){this._showPopUpGridConfig=!1}getPageSize(){return this.mode===g.IN_MEMORY?0:null==this.pageSize?150:this.pageSize}resolveResourceID(){return n.isEmpty(this.resourceID)?this._resourceID:this.resourceID}getFormConfig(){var i;const t=null===(i=this._formConfigManager)||void 0===i?void 0:i.getConfig(this.dataUnit,this.ignoreReadOnlyFormFields);return this.configName||t?t:this.formConfig}updateFormConfig(){let i=this.formConfig;null==this.formLegacyConfigName&&(i=Object.assign(Object.assign({},this.formConfig),{fields:this.dataUnit.metadata.fields})),this.setFormConfig(i,!0),null==this._formConfigManager&&(this._formConfigManager=new I(this.configName,this.resolveResourceID())),this._formConfigManager.setConfig(this.formConfig)}handleDataUnitOnInsertionMode(){this.enableGridInsert||this.goToView(p.FORM)}async initKeyboardManager(){var i;this._keyboardManager=new l({propagate:!1,element:this._element});const t=this.dataUnit||await(null===(i=this._snkDataUnit)||void 0===i?void 0:i.getDataUnit());null!=t&&this._keyboardManager.bind("F7",(()=>t.saveData()),{description:this.getMessage("snkSimpleCrud.keyboardShortcuts.saveData"),element:this._element}).bind("F8",t.addRecord.bind(t),{description:this.getMessage("snkSimpleCrud.keyboardShortcuts.addRecord"),element:this._element}).bind("F9",t.removeSelectedRecords.bind(t),{description:this.getMessage("snkSimpleCrud.keyboardShortcuts.removeRecord"),element:this._element}).bind("Escape",(()=>{t.isDirty()&&t.cancelEdition()}),{debounceTime:1e3,description:this.getMessage("snkSimpleCrud.keyboardShortcuts.cancelAction"),element:this._element})}async handleFormConfigSaved(){await this.loadFormConfig(!0,!0)}focusToGrid(){this._grid.focus()}focusToForm(){this._form.focus()}renderTaskbarContent(i){var t;return s("snk-taskbar",{class:"ez-box--no-outline ez-box "+(this._currentViewMode===p.FORM?(this.outlineMode?"ez-box--outline":"ez-box--shadow-xsmall")+" ez-padding--small":""),dataUnit:this.dataUnit,primaryButton:(null===(t=this.dataState)||void 0===t?void 0:t.isDirty)?"SAVE":"INSERT","data-element-id":"grid_left",messagesBuilder:this.messagesBuilder,buttons:this._taskbarProcessor.buttons,actionsList:this.getActionsList(),actionsSettingsList:i===p.GRID?this.getSettingsListGrid():this.getSettingsListForm(),disabledButtons:this._taskbarProcessor.disabledButtons,customButtons:this._taskbarProcessor.customButtons,"data-exporter-store-key":this.getDataExporterStoreKey(),slot:"leftButtons",presentationMode:y.SECONDARY,tabindex:"0"},s("slot",{name:"TASKBAR_CUSTOM_ELEMENTS"}))}render(){var i;if(null!=this.dataUnit)return s("snk-data-unit",{ref:i=>this._snkDataUnit=i,class:"simple-crud__container",dataUnit:this.dataUnit,useCancelConfirm:this.useCancelConfirm,onDataStateChange:i=>this.onDataStateChange(i),onCancelEdition:this.handleCancelEdit.bind(this),pageSize:this.getPageSize(),onInsertionMode:this.handleDataUnitOnInsertionMode.bind(this),onDataUnitReady:i=>this.dataUnitReady.emit(i.detail),onMessagesBuilderUpdated:i=>this.messagesBuilder=i.detail,onDataUnitFieldsHidded:this.updateFormConfig.bind(this),domainMessagesBuilder:this.domainMessagesBuilder},s("header",null,s("slot",{name:"snkSimpleCrudHeader"})),s("section",{class:`ez-box ez-box--no-outline ${this.outlineMode?"ez-box--outline":"ez-box--shadow"} simple-crud__container-section`,ref:i=>this._container=i,tabindex:"0"},s("ez-view-stack",{ref:i=>this._viewStack=i,"data-element-id":"simple-crud"},s("stack-item",null,s("ez-grid",{class:"ez-margin-bottom--large ez-box--no-outline",ref:i=>this._grid=i,dataUnit:this.dataUnit,config:this.gridConfig,"no-header":!0,multipleSelection:this.multipleSelection,onEzDoubleClick:()=>this.goToView(p.FORM),onConfigChange:i=>this.gridConfigChangeHandler(i),columnfilterDataSource:this.dataUnit.name&&this.dataUnit.name.includes(w.IN_MEMORY_DATA_UNIT_NAME)?void 0:this._multiSelectionListDataSource,useEnterLikeTab:this.useEnterLikeTab,autoFocus:this.autoFocus,enableGridInsert:this.enableGridInsert,enableContinuousInsert:this.enableContinuousInsert,enableLockManagerTaskbarClick:this.enableLockManagerTaskbarClick,enableLockManagerLoadingComp:this.enableLockManagerLoadingComp,outlineMode:this.outlineMode,tabindex:"0",paginationCounterMode:this.paginationCounterMode},this.renderTaskbarContent(p.GRID),s("div",{slot:"footer"},s("slot",{name:"snkSimpleCrudFooter"})))),s("stack-item",null,this.renderTaskbarContent(p.FORM),s("ez-form",{ref:i=>this._form=i,class:"ez-margin-top--large ez-box--no-outline",dataUnit:this.dataUnit,config:this.getFormConfig(),fieldToFocus:this._fieldToGetFocus,onEzFormSetFields:i=>this.handleFormSetFields(i.detail),onEzFormRequestClearFieldToFocus:this.clearFieldToFocusHandler.bind(this),elementFocusSearchField:this._container,tabindex:"0"}),s("snk-simple-form-config",{ref:i=>this._snkSimpleFormConfig=i,dataUnit:this.dataUnit,onSnkConfigSaved:this.handleFormConfigSaved.bind(this),configName:null!==(i=this.formLegacyConfigName)&&void 0!==i?i:this.configName,messagesBuilder:this.messagesBuilder})),this.messagesBuilder&&s("snk-configurator",{ref:i=>this._snkConfigurator=i,viewMode:this._currentViewMode,messagesBuilder:this.messagesBuilder,onConfigSelected:i=>this.goToView(i.detail),onOpenConfig:i=>this.openConfig(i.detail),showActionButtons:this.showConfiguratorButtons,onSave:i=>this.handleConfiguratorEvent(i,"SAVE"),onCancel:i=>this.handleConfiguratorEvent(i,"CANCEL"),resourceID:this.resolveResourceID(),customContainerId:this._customContainerId,layoutFormConfig:this.layoutFormConfig})),s("div",{id:`${this._customContainerId}`},s("slot",{name:"SnkConfigContainerSlot"}))),s("ez-popup",{size:"medium",heightMode:"auto",useHeader:!1,opened:this._showPopUpGridConfig,onEzClosePopup:()=>this.closeGridConfig()},s("snk-grid-config",{ref:i=>this._snkGridConfig=i,config:this.gridConfig,"data-element-id":this._element.getAttribute(u.DATA_ELEMENT_ID_ATTRIBUTE_NAME),selectedIndex:0,configName:this.configName,onConfigChange:i=>this.modalConfigChangeHandler(i),onConfigCancel:()=>this.closeGridConfig(),resourceID:this.resolveResourceID()})))}get _element(){return e(this)}static get watchers(){return{resourceID:["handleResourceIDChanged"],entityName:["onChangeEntityName"],mode:["onModeChange"],dataState:["observeDataState"],formLegacyConfigName:["observeFormLegacy"],gridLegacyConfigName:["observeGridLegacy"]}}};var D;!function(i){i.FORM_REGULAR="snkSimpleCrudTaskbar.form_regular",i.GRID_REGULAR="snkSimpleCrudTaskbar.grid_regular",i.FORM_SELECTED="snkSimpleCrudTaskbar.form_selected",i.GRID_SELECTED="snkSimpleCrudTaskbar.grid_selected",i.FINISH_EDITION="snkSimpleCrudTaskbar.finish_edition",i.MULTIPLE_EDITION="snkSimpleCrudTaskbar.multiple_edition"}(D||(D={})),M.style=".sc-snk-simple-crud-h{display:flex;height:100%;width:100%;--snk-simple-crud-grid--min-height:300px}.simple-crud__container.sc-snk-simple-crud{display:grid;grid-template-rows:auto 1fr;height:100%;width:100%}.simple-crud__container-section.sc-snk-simple-crud{flex-wrap:unset;flex-direction:column}.simple-crud__form--hidden.sc-snk-simple-crud{display:none}ez-grid.sc-snk-simple-crud{--ez-grid__container--shadow:none;--ez-grid__container--shadow--outline:none;--ez-grid--min-height:var(--snk-simple-crud-grid--min-height)}ez-form.sc-snk-simple-crud{min-height:300px}";export{M as snk_simple_crud}
1
+ import{r as i,c as t,h as s,g as e}from"./p-d8d8169b.js";import{StringUtils as n,ApplicationContext as o,ObjectUtils as h,Action as a,DataType as r,UserInterface as d,KeyboardManager as l,ElementIDUtils as u}from"@sankhyalabs/core";import{CSSVarsUtils as c,buildFieldSearch as m}from"@sankhyalabs/ezui/dist/collection/utils";import{V as p,S as g}from"./p-9019a32f.js";import{T as v}from"./p-b987e15d.js";import"./p-cdda05e3.js";import"./p-403c0168.js";import{S as f,R as C,b,a as S,c as k}from"./p-e400dc69.js";import{P as y}from"./p-0f3698af.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import{I as w}from"./p-42e248cd.js";import"./p-ff1990ad.js";import{F}from"./p-1273039f.js";import{T as E}from"./p-1a0caadb.js";import{C as T}from"./p-a17e9ecd.js";import{S as I}from"./p-50735892.js";import{s as _}from"./p-55798617.js";import"./p-8d884fab.js";import"./p-7dd49d15.js";import"./p-8f3f2306.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";const z=["INSERT","REFRESH","PREVIOUS","NEXT","DIVIDER","MORE_OPTIONS"],R=["INSERT","REFRESH","PREVIOUS","NEXT","DIVIDER","CLONE","REMOVE","DIVIDER","MORE_OPTIONS"],M=class{constructor(s){i(this,s),this.dataStateChange=t(this,"dataStateChange",3),this.dataUnitReady=t(this,"dataUnitReady",3),this.actionClick=t(this,"actionClick",7),this.formItemsReady=t(this,"formItemsReady",7),this.configuratorSave=t(this,"configuratorSave",7),this.configuratorCancel=t(this,"configuratorCancel",7),this._multiSelectionListDataSource=new f,this._formConfigFetcher=new F,this._customEditors=new Map,this._customRenders=new Map,this._container=void 0,this._showPopUpGridConfig=!1,this._currentViewMode=p.GRID,this._config=void 0,this._fieldToGetFocus=void 0,this._customContainerId=`SNK-SIMPLE-CRUD-CUSTOM-CONTAINER-${n.generateUUID()}`,this.enableLockManagerLoadingComp=!1,this.enableLockManagerTaskbarClick=!1,this.dataState=void 0,this.dataUnit=void 0,this.entityName=void 0,this.mode=g.SERVER,this.gridConfig=void 0,this.formConfig=void 0,this._formFields=[],this._fieldsProps=new Map,this.enableContinuousInsert=!1,this.multipleSelection=void 0,this.useCancelConfirm=!0,this.pageSize=150,this.resourceID=void 0,this.enableGridInsert=!1,this.paginationCounterMode="auto",this.taskbarManager=void 0,this.messagesBuilder=void 0,this.useEnterLikeTab=!1,this.actionsList=void 0,this.configName=void 0,this.showConfiguratorButtons=!1,this.gridLegacyConfigName=void 0,this.formLegacyConfigName=void 0,this.ignoreReadOnlyFormFields=!1,this.autoFocus=!0,this.domainMessagesBuilder=void 0,this.multipleEditionEnabled=!0,this.layoutFormConfig=!0,this.autoLoad=void 0,this.outlineMode=!1}async addCustomEditor(i,t){if(this._grid&&this._form)return this._grid.addCustomEditor(i,t),void this._form.addCustomEditor(i,t);const s=new Map(this._customEditors);s.set(i,t),this._customEditors=s}async addGridCustomRender(i,t){if(this._grid)return void this._grid.addGridCustomRender(i,t);const s=new Map(this._customRenders);s.set(i,t),this._customRenders=s}async handleResourceIDChanged(i,t){n.isEmpty(i)||i!==t&&(await this.loadFormConfig(!0),await this.loadGridConfig(!0))}async addCustomValueFormatter(i,t){this._grid.addCustomValueFormatter(i,t)}async removeCustomValueFormatter(i){this._grid.removeCustomValueFormatter(i)}async setFieldProp(i,t,s){const e=new Map(this._fieldsProps),n=this._fieldsProps.get(i);e.set(i,Object.assign(Object.assign({},n),{[t]:s})),this._fieldsProps=e}loadTaskbarProcessor(){const i={};i[D.FORM_REGULAR]=this.getButtons(!1,[v.GRID_MODE],!0),i[D.GRID_REGULAR]=this.getButtons(!1,[v.DATA_EXPORTER,v.FORM_MODE]),i[D.FORM_SELECTED]=this.getButtons(!0,[v.GRID_MODE],!0),i[D.GRID_SELECTED]=this.getGridSelectedButtonsCallBack.bind(this),i[D.FINISH_EDITION]=this.getFinishEditionButtonsCallback.bind(this),i[D.MULTIPLE_EDITION]=[v.CANCEL],this._taskbarProcessor=new E(i)}getGridSelectedButtonsCallBack(){var i,t,s;return this.multipleEditionEnabled&&1!==(null===(s=null===(t=null===(i=this.dataState)||void 0===i?void 0:i.selectionInfo)||void 0===t?void 0:t.records)||void 0===s?void 0:s.length)?this.getButtons(!0,[v.UPDATE_MULTIPLE,v.DATA_EXPORTER,v.FORM_MODE]):this.getButtons(!0,[v.DATA_EXPORTER,v.FORM_MODE])}getFinishEditionButtonsCallback(){const i=[v.CANCEL,v.SAVE];return this.enableGridInsert&&this._currentViewMode!==p.ATTACHMENT&&i.push(this._currentViewMode===p.GRID?v.FORM_MODE:v.GRID_MODE),i}getButtons(i,t,s){let e=i?R:z;return(s||this.mode===g.IN_MEMORY)&&(e=e.filter((i=>i!==v.REFRESH))),this.addConfigButton(e.concat(t))}addConfigButton(i){return void 0===this.configName||this.configName&&this.gridLegacyConfigName?i:i.concat(v.CONFIGURATOR)}get application(){return o.getContextValue("__SNK__APPLICATION__")}async goToView(i){this._currentViewMode=i,this._viewStack&&(i===p.GRID&&(this.dataUnit.isMultipleEdition=!1),this._viewStack.show(i)),i===p.GRID&&requestAnimationFrame((()=>this.focusToGrid())),i===p.FORM&&requestAnimationFrame((()=>this.focusToForm()))}actionClickListener(i){this.handleTaskbarAction(i.detail),i.stopPropagation()}handleTaskbarAction(i){switch(i){case v.CONFIGURATOR:this._snkConfigurator.open();break;case v.GRID_MODE:this.goToView(p.GRID);break;case v.FORM_MODE:this.goToView(p.FORM);break;case v.UPDATE_MULTIPLE:this.dataUnit.isMultipleEdition=!0,this.goToView(p.FORM)}}async onChangeEntityName(i){if(this.dataUnit)return;const t=o.getContextValue("__SNK__APPLICATION__");this.dataUnit=await t.getDataUnit(i,null,null,this.configName)}onModeChange(){this.mode==g.IN_MEMORY&&this.initInMemoryDataUnit()}observeDataState(i,t){this.handleDataStateChange(i,t)}async observeFormLegacy(i,t){await this.handleUpdateFormLegacyConfig(i,t)}async observeGridLegacy(i,t){await this.handleUpdateGridLegacyConfig(i,t)}async handleDataStateChange(i,t){h.objectToString(t)!=h.objectToString(i)&&this.dataStateChange.emit(i),await this.processRmPrecision()}async processRmPrecision(){var i,t;const s=await this._snkDataUnit.getFieldsWithRmPrecision();for(const e of s||[]){if(!e)continue;const s=null===(t=null===(i=this.dataState)||void 0===i?void 0:i.rowMetadata)||void 0===t?void 0:t.getProp("rm_precision",e);(s||0===s)&&(await this.setFieldProp(e,"precision",s),await this.setFieldProp(e,"prettyPrecision",s))}this._rmPrecisionCustomValueFormatter.setDataState(this.dataState)}async handleUpdateGridLegacyConfig(i,t){null!=i&&i!=t&&this._gridConfigAlreadyLoaded&&await this.loadGridConfig(!0)}async handleUpdateFormLegacyConfig(i,t){null!=i&&i!=t&&this._formConfigAlreadyLoaded&&await this.loadFormConfig(!0)}openConfig(i){this._snkConfigurator.close(),i===p.GRID?this.openGridConfig():i===p.FORM&&this.openFormConfig()}openGridConfig(){this._grid.getColumnsState().then((i=>{this._snkGridConfig.columns=i.filter((i=>i.name)),this._snkGridConfig.selectedIndex=0,this._showPopUpGridConfig=!0}))}async openFormConfig(){(this.formLegacyConfigName||this.configName)&&await this._snkSimpleFormConfig.show()}addGridLegacyConfigName(){this.gridLegacyConfigName&&this.configName&&T.addGridLegacyConfig(this.configName,this.gridLegacyConfigName)}loadGridConfig(i){if(void 0!==this.configName&&(null==this.gridConfig&&!this._gridConfigAlreadyLoaded||i))return this.addGridLegacyConfigName(),this._gridConfigAlreadyLoaded=!0,new Promise(((i,t)=>{T.loadGridConfig(this.configName,this.resolveResourceID()).then((t=>{this.setGridConfig(t),i()})).catch((i=>{t(i)}))}))}formConfigIsLoaded(){return null!=this.formConfig||this._formConfigAlreadyLoaded}async loadFormConfig(i=!1,t=!1){if(void 0===this.configName)return;if(null==this._formConfigManager&&(this._formConfigManager=new I(this.configName,this.resolveResourceID(),void 0,this.dataUnit),this._formConfigManager.setConfig(this.formConfig)),this.formConfigIsLoaded()&&!i)return;this._formConfigAlreadyLoaded=!0;let s=await this._formConfigFetcher.fetchLegacyConfigurableForm(this.formLegacyConfigName);if(null!=s)return this._formConfigManager.setConfig(s),void this.setFormConfig(s,t);this.setFormConfig(await this._formConfigManager.loadConfig())}async componentWillRender(){this.loadTaskbarProcessor(),this._resourceID=await this.application.getResourceID(),this.dataExporterProviderStore(),this.dataExporterProviderStore(),this._taskbarProcessor.process(this.getTaskBarId(),this.taskbarManager,this.dataState,this.getTaskBarDisabledButtons()),void 0!==this.configName&&(null!=this.gridConfig||this._gridConfigAlreadyLoaded||(await this.addGridLegacyConfigName(),await this.loadGridConfig(),await this.loadFormConfig()))}componentDidRender(){this._rmPrecisionCustomValueFormatter.setGrid(this._grid),this.addGridCustomValueFormattters(),this.setFieldsProps(),this.setCustomRenders(),this.setCustomEditors()}componentWillLoad(){this.processMetadata(),this.onModeChange(),this.configDatasource(),this._rmPrecisionCustomValueFormatter=new C,this._continuousInsertUtils=new b(this.application,this.resolveResourceID(),this.configName),this.enableGridInsert&&this._continuousInsertUtils.getConfig().then((i=>this.enableContinuousInsert=i))}componentDidLoad(){c.applyVarsGrid(this._element,this._grid),this.initKeyboardManager(),this.dataUnit.subscribe(this.dataUnitActionHandler.bind(this))}async dataUnitActionHandler(i){i.type!==a.EDITION_CANCELED&&i.type!==a.DATA_SAVED||this.dataUnit.isMultipleEdition&&this.goToView(p.GRID)}getMessage(i,t){var s;return null===(s=this.messagesBuilder)||void 0===s?void 0:s.getMessage(i,t)}disconnectedCallback(){var i;null===(i=this._keyboardManager)||void 0===i||i.unbindAllShortcutKeys()}setCustomRenders(){if(this._grid)for(const[i,t]of this._customRenders)this._grid.addGridCustomRender(i,t),this._customRenders.delete(i)}setCustomEditors(){if(this._grid&&this._form)for(const[i,t]of this._customEditors)this._grid.addCustomEditor(i,t),this._form.addCustomEditor(i,t),this._customEditors.delete(i)}configDatasource(){this._multiSelectionListDataSource.setApplication(this.application),this._multiSelectionListDataSource.setDataUnit(this.dataUnit)}setFieldsProps(){if(this._form)for(const[i,t]of this._fieldsProps){for(const s in t)this._form.setFieldProp(i,s,t[s]);this._fieldsProps.delete(i)}}getTaskBarId(){var i,t;return(null===(i=this.dataState)||void 0===i?void 0:i.isDirty)?D.FINISH_EDITION:this.dataUnit.isMultipleEdition?D.MULTIPLE_EDITION:(null===(t=this.dataState)||void 0===t?void 0:t.selectionInfo)&&!this.dataState.selectionInfo.isAllRecords()&&this.dataState.selectionInfo.length>0?this._currentViewMode===p.GRID?D.GRID_SELECTED:D.FORM_SELECTED:this._currentViewMode===p.GRID?D.GRID_REGULAR:D.FORM_REGULAR}initInMemoryDataUnit(){this._inMemoryLoader=new w(this._metadata,void 0,{autoLoad:this.autoLoad}),this.dataUnit=this._inMemoryLoader.dataUnit,this.dataUnitReady.emit(this.dataUnit)}setMetadata(i){return this._inMemoryLoader?this._inMemoryLoader.metadata=i:this.dataUnit&&(this.dataUnit.metadata=i),Promise.resolve()}setRecords(i){return this._inMemoryLoader?this._inMemoryLoader.records=i:this.dataUnit&&(this.dataUnit.records=i),Promise.resolve()}getRecords(){return Promise.resolve(this.dataUnit.records)}async openConfigurator(){var i;null===(i=this._snkConfigurator)||void 0===i||i.open()}async closeConfigurator(){var i;null===(i=this._snkConfigurator)||void 0===i||i.close()}async updateConfig(){null==this._formConfigManager&&(this._formConfigManager=new I(this.configName,this.resolveResourceID())),this._formConfigManager.setConfig(this.formConfig)}processMetadata(){const i=this._element.querySelectorAll("snk-field-metadata"),t=[],s={fields:[],emptyConfig:!1};i.forEach((i=>{const e={name:i.getAttribute("name")||i.getAttribute("label"),label:i.getAttribute("label"),dataType:r[i.getAttribute("dataType")]||r.TEXT,userInterface:d[i.getAttribute("userInterface")]||d.SHORTTEXT,readOnly:"true"==i.getAttribute("readOnly"),required:"true"==i.getAttribute("required"),tab:i.getAttribute("tab")||void 0,visible:"false"!=i.getAttribute("visible")};s.fields.push({name:e.name,tab:e.tab,visible:e.visible}),t.push(e)})),t.length>0&&(this.formConfig||(this.formConfig=s),this._metadata={name:"SimpleCrud",label:"SimpleCrud",fields:t})}addGridCustomValueFormattters(){var i,t,s;const e=(null===(i=this._metadata)||void 0===i?void 0:i.fields)||(null===(s=null===(t=this.dataUnit)||void 0===t?void 0:t.metadata)||void 0===s?void 0:s.fields);if(!e)return;const n=[];e.forEach((i=>{var t;(null===(t=i.properties)||void 0===t?void 0:t.rm_precision)&&!n.includes(i.name)&&n.push(i.name)})),n.forEach((i=>{this.addCustomValueFormatter(i,this._rmPrecisionCustomValueFormatter)}))}onDataStateChange(i){this.dataState=Object.assign({},i.detail)}getTaskBarDisabledButtons(){var i,t,s,e,n,o;const h=[];return(null===(i=this.dataState)||void 0===i?void 0:i.hasNext)||h.push(v.NEXT),(null===(t=this.dataState)||void 0===t?void 0:t.hasPrevious)||h.push(v.PREVIOUS),(null===(e=null===(s=this.dataState)||void 0===s?void 0:s.selectionInfo)||void 0===e?void 0:e.isEmpty())&&h.push(v.FORM_MODE),(null===(o=null===(n=this.dataState)||void 0===n?void 0:n.selectionInfo)||void 0===o?void 0:o.length)>1&&h.push(v.CLONE),h}handleCancelEdit(){var i;(null===(i=this.dataState)||void 0===i?void 0:i.recordsIsEmpty)&&(this.goToView(p.GRID),this.dataUnit.clearSelection())}handleConfiguratorEvent(i,t){i.stopImmediatePropagation(),"SAVE"!==t?this.configuratorCancel.emit():this.configuratorSave.emit()}onSelectField(i){null!=i&&(this._fieldToGetFocus=i.value)}getFieldSearch(i,t){return null!=this._fieldSearch||(this._splitButtonForm=i,this._fieldSearch=m(t,(({argument:i})=>this.fieldsOptionLoader(i)),(i=>this.onSelectField(i)))),this._fieldSearch}getFormFields(){var i,t;return null!==(t=null===(i=this.formConfig)||void 0===i?void 0:i.fields)&&void 0!==t?t:this._formFields}handleFormSetFields(i){h.equals(this._formFields,i)||(this._formFields=null!=i?i:[])}fieldsOptionLoader(i){const t=null==i?void 0:i.toLowerCase(),s=this.getFormFields().map((i=>{var t;return null===(t=this.dataUnit)||void 0===t?void 0:t.getField(i.name)})).filter((i=>{var s,e;return(null===(s=i.name)||void 0===s?void 0:s.toLowerCase().includes(t))||(null===(e=i.label)||void 0===e?void 0:e.toLowerCase().includes(t))})).map((i=>({value:i.name,label:i.label})));return Promise.resolve(s)}isGridInsertActive(){return this.enableGridInsert&&this.dataUnit.hasNewRecord()}getColumnSearch(i,t){return null!=this._columnSearch||(this._splitButton=i,this._columnSearch=m(t,(({argument:i})=>new Promise((t=>{this._grid.filterColumns(i).then((i=>{t(i.filter((i=>!i.hidden)).map((i=>({label:i.label,value:i.name}))))}))}))),(i=>{null!=i&&this._grid.locateColumn(i.value)}))),this._columnSearch}getActionsList(){const i=[];if(this.enableGridInsert&&i.push(this._continuousInsertUtils.actionContinuousInsert(this.enableContinuousInsert,(()=>{this.enableContinuousInsert=!this.enableContinuousInsert,this._continuousInsertUtils.handleSaveConfig(this.enableContinuousInsert)}))),this.isGridInsertActive())return i;if(null!=this.taskbarManager&&null!=this.taskbarManager.getMoreOptions){const t=this.getTopTaskBarId();return i.concat(this.taskbarManager.getMoreOptions(t,this.configName,this.dataState,this.actionsList))}return i.concat(this.actionsList)}getSettingsListGrid(){return[{value:n.generateUUID(),label:this.getMessage("snkSimpleCrud.findColumn"),disableCloseOnSelect:!0,eagerInitialize:!0,itemBuilder:(i,t)=>this.getColumnSearch(i,t)}]}getSettingsListForm(){return[{value:n.generateUUID(),label:this.getMessage("snkSimpleCrud.findFields"),disableCloseOnSelect:!0,eagerInitialize:!0,itemBuilder:(i,t)=>this.getFieldSearch(i,t)}]}getTopTaskBarId(){var i;return(null===(i=this.dataState)||void 0===i?void 0:i.isDirty)?`snkGridTopTaskbar.finish_edition${y.PRIMARY}`:`snkGridTopTaskbar.regular${y.PRIMARY}`}clearFieldToFocusHandler(){this._fieldToGetFocus=void 0}gridConfigChangeHandler(i){i.stopPropagation(),this.configName&&T.saveGridConfig(i.detail,this.configName,this.resolveResourceID())}modalConfigChangeHandler(i){const t=i.detail;this._grid.setColumnsState(t.columns).then((()=>{this.setGridConfig(t),this.closeGridConfig(),this.dataExporterProviderStore()})),i.stopPropagation()}async dataExporterProviderStore(){if(null==this.dataUnit)return;if(null==this._grid)return;const i=new k(this.dataUnit,this._grid);_.set("exporterProviders",Object.assign(Object.assign({},_.get("exporterProviders")),{[this.getDataExporterStoreKey()]:i}))}getDataExporterStoreKey(){return`SnkSimpleCrudDataExporter:${null==this.configName?this.dataUnit.name:this.configName}`}setGridConfig(i){this.gridConfig=i,S.assertDefaultSorting(this.gridConfig,this.dataUnit)}setFormConfig(i,t){this.formConfig&&!t||(this.formConfig=i)}closeGridConfig(){this._showPopUpGridConfig=!1}getPageSize(){return this.mode===g.IN_MEMORY?0:null==this.pageSize?150:this.pageSize}resolveResourceID(){return n.isEmpty(this.resourceID)?this._resourceID:this.resourceID}getFormConfig(){var i;const t=null===(i=this._formConfigManager)||void 0===i?void 0:i.getConfig(this.dataUnit,this.ignoreReadOnlyFormFields);return this.configName||t?t:this.formConfig}updateFormConfig(){let i=this.formConfig;null==this.formLegacyConfigName&&(i=Object.assign(Object.assign({},this.formConfig),{fields:this.dataUnit.metadata.fields})),this.setFormConfig(i,!0),null==this._formConfigManager&&(this._formConfigManager=new I(this.configName,this.resolveResourceID())),this._formConfigManager.setConfig(this.formConfig)}handleDataUnitOnInsertionMode(){this.enableGridInsert||this.goToView(p.FORM)}async initKeyboardManager(){var i;this._keyboardManager=new l({propagate:!1,element:this._element});const t=this.dataUnit||await(null===(i=this._snkDataUnit)||void 0===i?void 0:i.getDataUnit());null!=t&&this._keyboardManager.bind("F7",(()=>t.saveData()),{description:this.getMessage("snkSimpleCrud.keyboardShortcuts.saveData"),element:this._element}).bind("F8",t.addRecord.bind(t),{description:this.getMessage("snkSimpleCrud.keyboardShortcuts.addRecord"),element:this._element}).bind("F9",t.removeSelectedRecords.bind(t),{description:this.getMessage("snkSimpleCrud.keyboardShortcuts.removeRecord"),element:this._element}).bind("Escape",(()=>{t.isDirty()&&t.cancelEdition()}),{debounceTime:1e3,description:this.getMessage("snkSimpleCrud.keyboardShortcuts.cancelAction"),element:this._element})}async handleFormConfigSaved(){await this.loadFormConfig(!0,!0)}focusToGrid(){this._grid.focus()}focusToForm(){this._form.focus()}renderTaskbarContent(i){var t;return s("snk-taskbar",{class:"ez-box--no-outline ez-box "+(this._currentViewMode===p.FORM?(this.outlineMode?"ez-box--outline":"ez-box--shadow-xsmall")+" ez-padding--small":""),dataUnit:this.dataUnit,primaryButton:(null===(t=this.dataState)||void 0===t?void 0:t.isDirty)?"SAVE":"INSERT","data-element-id":"grid_left",messagesBuilder:this.messagesBuilder,buttons:this._taskbarProcessor.buttons,actionsList:this.getActionsList(),actionsSettingsList:i===p.GRID?this.getSettingsListGrid():this.getSettingsListForm(),disabledButtons:this._taskbarProcessor.disabledButtons,customButtons:this._taskbarProcessor.customButtons,"data-exporter-store-key":this.getDataExporterStoreKey(),slot:"leftButtons",presentationMode:y.SECONDARY,tabindex:"0"},s("slot",{name:"TASKBAR_CUSTOM_ELEMENTS"}))}render(){var i;if(null!=this.dataUnit)return s("snk-data-unit",{ref:i=>this._snkDataUnit=i,class:"simple-crud__container",dataUnit:this.dataUnit,useCancelConfirm:this.useCancelConfirm,onDataStateChange:i=>this.onDataStateChange(i),onCancelEdition:this.handleCancelEdit.bind(this),pageSize:this.getPageSize(),onInsertionMode:this.handleDataUnitOnInsertionMode.bind(this),onDataUnitReady:i=>this.dataUnitReady.emit(i.detail),onMessagesBuilderUpdated:i=>this.messagesBuilder=i.detail,onDataUnitFieldsHidded:this.updateFormConfig.bind(this),domainMessagesBuilder:this.domainMessagesBuilder},s("header",null,s("slot",{name:"snkSimpleCrudHeader"})),s("section",{class:`ez-box ez-box--no-outline ${this.outlineMode?"ez-box--outline":"ez-box--shadow"} simple-crud__container-section`,ref:i=>this._container=i,tabindex:"0"},s("ez-view-stack",{ref:i=>this._viewStack=i,"data-element-id":"simple-crud"},s("stack-item",null,s("ez-grid",{class:"ez-margin-bottom--large ez-box--no-outline",ref:i=>this._grid=i,dataUnit:this.dataUnit,config:this.gridConfig,"no-header":!0,multipleSelection:this.multipleSelection,onEzDoubleClick:()=>this.goToView(p.FORM),onConfigChange:i=>this.gridConfigChangeHandler(i),columnfilterDataSource:this.dataUnit.name&&this.dataUnit.name.includes(w.IN_MEMORY_DATA_UNIT_NAME)?void 0:this._multiSelectionListDataSource,useEnterLikeTab:this.useEnterLikeTab,autoFocus:this.autoFocus,enableGridInsert:this.enableGridInsert,enableContinuousInsert:this.enableContinuousInsert,enableLockManagerTaskbarClick:this.enableLockManagerTaskbarClick,enableLockManagerLoadingComp:this.enableLockManagerLoadingComp,outlineMode:this.outlineMode,tabindex:"0",paginationCounterMode:this.paginationCounterMode},this.renderTaskbarContent(p.GRID),s("div",{slot:"footer"},s("slot",{name:"snkSimpleCrudFooter"})))),s("stack-item",null,this.renderTaskbarContent(p.FORM),s("ez-form",{ref:i=>this._form=i,class:"ez-margin-top--large ez-box--no-outline",dataUnit:this.dataUnit,config:this.getFormConfig(),fieldToFocus:this._fieldToGetFocus,onEzFormSetFields:i=>this.handleFormSetFields(i.detail),onEzFormRequestClearFieldToFocus:this.clearFieldToFocusHandler.bind(this),elementFocusSearchField:this._container,tabindex:"0"}),s("snk-simple-form-config",{ref:i=>this._snkSimpleFormConfig=i,dataUnit:this.dataUnit,onSnkConfigSaved:this.handleFormConfigSaved.bind(this),configName:null!==(i=this.formLegacyConfigName)&&void 0!==i?i:this.configName,messagesBuilder:this.messagesBuilder})),this.messagesBuilder&&s("snk-configurator",{ref:i=>this._snkConfigurator=i,viewMode:this._currentViewMode,messagesBuilder:this.messagesBuilder,onConfigSelected:i=>this.goToView(i.detail),onOpenConfig:i=>this.openConfig(i.detail),showActionButtons:this.showConfiguratorButtons,onSave:i=>this.handleConfiguratorEvent(i,"SAVE"),onCancel:i=>this.handleConfiguratorEvent(i,"CANCEL"),resourceID:this.resolveResourceID(),customContainerId:this._customContainerId,layoutFormConfig:this.layoutFormConfig})),s("div",{id:`${this._customContainerId}`},s("slot",{name:"SnkConfigContainerSlot"}))),s("ez-popup",{size:"medium",heightMode:"auto",useHeader:!1,opened:this._showPopUpGridConfig,onEzClosePopup:()=>this.closeGridConfig()},s("snk-grid-config",{ref:i=>this._snkGridConfig=i,config:this.gridConfig,"data-element-id":this._element.getAttribute(u.DATA_ELEMENT_ID_ATTRIBUTE_NAME),selectedIndex:0,configName:this.configName,onConfigChange:i=>this.modalConfigChangeHandler(i),onConfigCancel:()=>this.closeGridConfig(),resourceID:this.resolveResourceID()})))}get _element(){return e(this)}static get watchers(){return{resourceID:["handleResourceIDChanged"],entityName:["onChangeEntityName"],mode:["onModeChange"],dataState:["observeDataState"],formLegacyConfigName:["observeFormLegacy"],gridLegacyConfigName:["observeGridLegacy"]}}};var D;!function(i){i.FORM_REGULAR="snkSimpleCrudTaskbar.form_regular",i.GRID_REGULAR="snkSimpleCrudTaskbar.grid_regular",i.FORM_SELECTED="snkSimpleCrudTaskbar.form_selected",i.GRID_SELECTED="snkSimpleCrudTaskbar.grid_selected",i.FINISH_EDITION="snkSimpleCrudTaskbar.finish_edition",i.MULTIPLE_EDITION="snkSimpleCrudTaskbar.multiple_edition"}(D||(D={})),M.style=".sc-snk-simple-crud-h{display:flex;height:100%;width:100%;--snk-simple-crud-grid--min-height:300px}.simple-crud__container.sc-snk-simple-crud{display:grid;grid-template-rows:auto 1fr;height:100%;width:100%}.simple-crud__container-section.sc-snk-simple-crud{flex-wrap:unset;flex-direction:column}.simple-crud__form--hidden.sc-snk-simple-crud{display:none}ez-grid.sc-snk-simple-crud{--ez-grid__container--shadow:none;--ez-grid__container--shadow--outline:none;--ez-grid--min-height:var(--snk-simple-crud-grid--min-height)}ez-form.sc-snk-simple-crud{min-height:300px}";export{M as snk_simple_crud}
@@ -1 +1 @@
1
- import{ObjectUtils as t}from"@sankhyalabs/core";import{R as a}from"./p-02459408.js";class s extends a{getData(a){const s=`cfg://auth/${a}`;return new Promise(((a,e)=>{this.loadResource(s).then((s=>{let e=t.stringToObject(s);e&&"object"==typeof e&&a(e)})).catch((t=>{e(t)}))}))}}var e;!function(t){t.INSERT="I",t.UPDATE="A",t.REMOVE="E",t.SHOW="C",t.CONFIG="F",t.CONFIG_NUMBER="N",t.CLONE="D",t.CONFIG_GRID="G"}(e||(e={}));export{e as A,s as a}
1
+ import{ObjectUtils as t}from"@sankhyalabs/core";import{R as a}from"./p-1273039f.js";class s extends a{getData(a){const s=`cfg://auth/${a}`;return new Promise(((a,e)=>{this.loadResource(s).then((s=>{let e=t.stringToObject(s);e&&"object"==typeof e&&a(e)})).catch((t=>{e(t)}))}))}}var e;!function(t){t.INSERT="I",t.UPDATE="A",t.REMOVE="E",t.SHOW="C",t.CONFIG="F",t.CONFIG_NUMBER="N",t.CLONE="D",t.CONFIG_GRID="G"}(e||(e={}));export{e as A,s as a}
@@ -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-ccd1ab5b.js";function a(e){const t=(n=e.fieldsMetadata)&&n.length?n.map((e=>({name:e.fieldName,label:e.description,dataType:u(e.type),userInterface:l(e),properties:s(e)}))):[];var n;return{label:e.entityDescription,name:e.descriptionField,fields:t}}function s(e){const t={};return t.options=function(e){const t=e.options;if(!t)return;const n=[];return Object.keys(t).forEach((e=>{n.push({label:e,value:t[e]})})),n}(e),t.mask=function(e){const t=e.uiType;return t?String(t).toLowerCase():void 0}(e),t}function l(t){const n=t.options;return n&&Object.keys(n).length>0?e.OPTIONSELECTOR:"D"===t.type?e.DATE:"H"===t.type?e.DATETIME:"T"===t.type?e.TIME:"I"===t.type?e.INTEGERNUMBER:void 0}function u(e){switch(e){case"F":case"I":return t.NUMBER;case"D":case"H":return t.DATE;case"B":return t.OBJECT;default:return t.TEXT}}function c(e){return Object.assign({id:e.codigo,label:`${e.caminho} - ${e.descricao}`,bold:"N"===e.analitico,props:{analitico:"S"===e.analitico}},e.no&&{children:e.no.map(c)})}var d,v,f;!function(e){e[e.GRID=0]="GRID",e[e.CARDS=1]="CARDS",e[e.TREE=2]="TREE"}(d||(d={}));class m{constructor(){this._defaultPageSize=100,this._templateByQuery=new Map,this._searchListenersByDataUnit=new Map,this.buldTemplates()}buldTemplates(){this._templateByQuery.set("search",o.gql`query($entityName: String! $argument: String $criteria: InputSearchCriteria $options: InputSearchOptions) {
1
+ import{UserInterface as e,DataType as t,ApplicationContext as n,ErrorException as i}from"@sankhyalabs/core";import{d as o,D as r}from"./p-cdda05e3.js";function a(e){const t=(n=e.fieldsMetadata)&&n.length?n.map((e=>({name:e.fieldName,label:e.description,dataType:u(e.type),userInterface:l(e),properties:s(e)}))):[];var n;return{label:e.entityDescription,name:e.descriptionField,fields:t}}function s(e){const t={};return t.options=function(e){const t=e.options;if(!t)return;const n=[];return Object.keys(t).forEach((e=>{n.push({label:e,value:t[e]})})),n}(e),t.mask=function(e){const t=e.uiType;return t?String(t).toLowerCase():void 0}(e),t}function l(t){const n=t.options;return n&&Object.keys(n).length>0?e.OPTIONSELECTOR:"D"===t.type?e.DATE:"H"===t.type?e.DATETIME:"T"===t.type?e.TIME:"I"===t.type?e.INTEGERNUMBER:void 0}function u(e){switch(e){case"F":case"I":return t.NUMBER;case"D":case"H":return t.DATE;case"B":return t.OBJECT;default:return t.TEXT}}function c(e){return Object.assign({id:e.codigo,label:`${e.caminho} - ${e.descricao}`,bold:"N"===e.analitico,props:{analitico:"S"===e.analitico}},e.no&&{children:e.no.map(c)})}var d,v,f;!function(e){e[e.GRID=0]="GRID",e[e.CARDS=1]="CARDS",e[e.TREE=2]="TREE"}(d||(d={}));class m{constructor(){this._defaultPageSize=100,this._templateByQuery=new Map,this._searchListenersByDataUnit=new Map,this.buldTemplates()}buldTemplates(){this._templateByQuery.set("search",o.gql`query($entityName: String! $argument: String $criteria: InputSearchCriteria $options: InputSearchOptions) {
2
2
  $queryAlias$: search(entityName: $entityName argument: $argument criteria: $criteria options: $options){
3
3
  value
4
4
  label
@@ -1,4 +1,4 @@
1
- import{ObjectUtils as t,DataUnit as e,DataUnitInMemoryLoader as n,ApplicationContext as r,StringUtils as a,UserInterface as i,DataUnitStorage as o,DataType as s,ChangeOperation as c}from"@sankhyalabs/core";import{D as l,S as u,d}from"./p-ccd1ab5b.js";import{DISTINCT_FILTER_NAME_PREFIX as m}from"@sankhyalabs/ezui/dist/collection/utils/constants";import{DataUnitTransient as h}from"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import{ColumnFilterManager as f}from"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import p from"@sankhyalabs/core/dist/utils/SortingUtils";import{R as g}from"./p-688dcb4c.js";class _{constructor(t){this._list=[],this._listCopy=[],this._listLastUpdate=0,this._listCopyLastUpdate=0,this._equalsFunction=t}async load(t,e,n,r){let a=[].concat(this._list);null!=t&&(a=this._list.filter((e=>t(e)))),null!=e&&(a=a.sort(e));const i=a.length;if(null!=r){const t=n||0;a=a.slice(t,r?t+r:a.length)}return Promise.resolve({result:a,count:i})}async distict(t){const e=[];let n=!1;for(const r of this._list){const a=t(r);null!=a&&(null!=a.value?e.push(a):n=!0)}return n&&e.push({key:"",value:null}),Promise.resolve(new Map(e.map((t=>[t.key,t.value]))))}async push(t){this.updateList([...this._list,...t])}async clear(){this.updateList([])}async delete(t){const e=this._list.filter((e=>{for(const n of t)if(this._equalsFunction(e,n))return!1;return!0}));this.updateList(e)}async update(t){const e=this._list.map((e=>{const n=t.find((t=>this._equalsFunction(e,t)));return null==n?e:n}));this.updateList(e)}async insert(t,e){const n=this._list.indexOf(t);if(-1==n)return void this.push(e);const r=this._list.slice(0,n).concat(e).concat(this._list.slice(n));this.updateList(r)}isOperating(){return!0}async isEmpty(){return Promise.resolve(0===this._list.length)}async count(){return Promise.resolve(this._list.length)}getFromCache(){return this._listLastUpdate>this._listCopyLastUpdate&&(this._listCopyLastUpdate=this._listLastUpdate,this._listCopy=t.copy(this._list)),this._listCopy}updateList(t){this._list=t,this._listLastUpdate=Date.now()}}class b{static setLoadingStatus(t,e){this._loadingStatus.set(t.name,e)}static isCacheEnabled(t){return!0}static cacheRecords(t,e,n,r){b.setLoadingStatus(t,r),b.isCacheEnabled(t)?this.getRepository(t).push(e):n&&this._repositories.delete(t.name)}static getSortingFunction(t,e){return p.getSortingFunction(t,e)}static async getDistinct(t,e,n=!1){if(!b.isCacheEnabled(t))return Promise.resolve(f.compileDistinct(e,t));let r;const a=t.getLastLoadRequest();if(null!=a){const n=f.getColumnFilters(a.filters,e);r=f.getFilterFunction(t,Array.from(n.values()))}return new Promise(((a,i)=>{b.getRepository(t).distict((a=>{if(null!=r&&!r(a))return;const i=a[e];if(null==i)return{key:null,value:null};let o=null!=i.value?i.value:i;return(null==i?void 0:i.label)&&n?{key:null==i?void 0:i.label,value:t.getFormattedValue(e,o)}:{key:t.getFormattedValue(e,i),value:o}})).then((t=>{a(null!=t?Array.from(t.entries()).map((([t,e])=>({label:t,value:e,check:!0}))):void 0)})).catch((t=>i(t)))}))}static async loadData(t,n,r){try{if(b.isCacheEnabled(t)){if(["EZ_GRID_LOADING_SOURCE",e.CHANGING_PAGE_LOADING_SOURCE,e.ALL_RECORDS_SELECTION_SOURCE].includes(n.source)&&!await b.getRepository(t).isEmpty())return b.loadFromCache(t,n);b.getRepository(t).clear().catch((()=>{}))}return r(t,n)}catch(t){return console.error(t),Promise.reject(t)}}static insertRecords(t,e,n){b.isCacheEnabled(t)&&b.getRepository(t).insert(e,n)}static updateRecords(t,e){b.isCacheEnabled(t)&&b.getRepository(t).update(e)}static removeRecords(t,e){b.isCacheEnabled(t)&&b.getRepository(t).delete(e)}static async countRecords(t){return b.isCacheEnabled(t)?b.getRepository(t).count():Promise.resolve(0)}static getRepository(t){const e=t.name;return b._repositories.has(e)||b._repositories.set(e,new _(((t,e)=>t.__record__id__===e.__record__id__))),b._repositories.get(e)}static async loadFromCache(t,e){return new Promise(((n,r)=>{const a=f.getColumnFilters(e.filters,""),{limit:i,offset:o,sort:s}=e;b.getRepository(t).load(f.getFilterFunction(t,Array.from(a.values())),b.getSortingFunction(t,s),o,i).then((e=>{const r=b._loadingStatus.get(t.name),{count:a,result:s}=e,c=0==a?0:o+1,l=o+Math.min(s.length,i);n({records:s,paginationInfo:{count:a,currentPage:o/i,firstRecord:c,lastRecord:l,hasMore:r||l<a,total:r?void 0:a}})})).catch((t=>r(t)))}))}static getCachedRecords(t){return b.getRepository(t).getFromCache()}}b._repositories=new Map,b._loadingStatus=new Map;class v{constructor(t,e,r){this._dataUnitInMemoryLoader=new n(t,e,r)}get dataUnit(){return this._dataUnitInMemoryLoader.dataUnit}get records(){return this._dataUnitInMemoryLoader.records}set records(t){this._dataUnitInMemoryLoader.records=t}get metadata(){return this._dataUnitInMemoryLoader.metadata}set metadata(t){this._dataUnitInMemoryLoader.metadata=t}removeLoader(t,e){return this._dataUnitInMemoryLoader.removeLoader(t,e)}static getConvertedValue(t,e,r){return n.getConvertedValue(t,e,r)}}function y(t,e){var n,r;return void 0!==(null===(n=t[e])||void 0===n?void 0:n.value)?null===(r=t[e])||void 0===r?void 0:r.value:t[e]}v.IN_MEMORY_DATA_UNIT_NAME=n.IN_MEMORY_DATA_UNIT_NAME;class D{canSlice(){return!1}processSortingSide(t,e,n){var r;const a=[],o=[];if(null!=t.sort){if(0===n.length)return{localSorting:t.sort,serverSorting:[]};for(const n of t.sort){const t=e.getField(n.field);"true"===(null===(r=null==t?void 0:t.properties)||void 0===r?void 0:r.calculated)||(null==t?void 0:t.userInterface)===i.LONGTEXT?a.push(n):o.push(n)}}return{localSorting:a,serverSorting:o}}async load(t,e,n){var r,a;if(null==t.metadata)return Promise.resolve({records:[],loadingInfo:n});try{const i=null!==(a=null===(r=e.filters)||void 0===r?void 0:r.filter((t=>!t.name.startsWith("FILTRO_COLUNA_"))))&&void 0!==a?a:[],{localSorting:o,serverSorting:s}=this.processSortingSide(e,t,i),c=this.getFieldsList(t),u="DatasetSP.loadRecords",d=this.buildRequestBody(u,c,t,e,n,s,i),m=n.quiet?{urlParams:{quietMode:"true"}}:void 0,{result:h,pagerID:f,askRowsLimit:p}=await l.get().callServiceBroker(u,d,m),g=this.processRecords(t,c,h),_=null!=f,b=n.count+g.length,v=t.hasNewRecord(),y=o.length>0,D=!_&&y;return D&&v&&t.setWaitingToReload(!0),Promise.resolve({records:g,loadingInfo:Object.assign(Object.assign({},n),{pagerId:f,loadingInProgress:_,total:_?void 0:b,count:b,needReload:D&&!v,askRowsLimit:p,hasLocalSorting:y})})}catch(t){return console.error(t),Promise.reject(t)}}async loadRowMetadata(t,e,n,r={}){try{const a="DatasetSP.loadRowMetadata",i=await this.buildRequestBodyLoadRowMetadata({snkDataUnit:t,fieldName:e,metadataName:n,serviceName:a,updatedFields:r});return await l.get().callServiceBroker(a,i)}catch(t){return console.error(t),Promise.reject(t)}}async buildRequestBodyLoadRowMetadata({snkDataUnit:t,serviceName:e,fieldName:n,metadataName:r,updatedFields:a}){const i=t.dataUnit,o=O.parseDataUnitName(i.name).entityName,s=(await t.getSelectedRecordsIDsInfo()).reduce(((t,e)=>(t[e.name]=e.value,t)),{}),c=i.getSelectedRecord(),l=i.metadata.fields.filter((({standAlone:t,name:e})=>!t&&!e.includes("."))).map((({name:t})=>t)),u=l.reduce(((t,e,n)=>{const r=y(c,e),i=y(a,e);return t[n]=void 0!==i?i:r,t}),{});return JSON.stringify({serviceName:e,requestBody:{dataSetID:i.dataUnitId,entityName:o,standAlone:!1,metadataName:r,fieldName:n,fields:l,record:{pk:s,oldPk:s,values:u}}})}getFieldsList(t){let e=["__record__id__","__record__label__"];return t.metadata.fields.forEach((t=>{t.standAlone||(e=e.concat(this.getFieldNames(t)))})),e}getStandAloneFieldsList(t){let e={};return t.metadata.fields.forEach((t=>{t.standAlone&&(e=Object.assign(Object.assign({},e),{[t.name]:{fieldType:t.dataType,userType:t.userInterface}}))})),e}getFieldNames(t){const e=this.getSearchDescriptionField(t);return null==e?t.name:[t.name,e]}buildRequestBody(t,e,n,r,a,i,o){const s=n.dataUnitId,c=O.parseDataUnitName(n.name).entityName,l=!(!r.limit&&!r.offset),u={serviceName:t,requestBody:{dataSetID:s,fields:e,entityName:c,pageNumber:a.pageNumber,totalRecordsCount:a.count,pagerID:a.pagerId,standAlone:!1,standAloneFieldsMD:Object.assign({__record__id__:{fieldType:"S",userType:"P"},__record__label__:{fieldType:"S",userType:"P"}},this.getStandAloneFieldsList(n)),tryJoinedFields:!0,parallelLoader:l,crudListener:`br.com.sankhya.bff.${this.getModuleName()}.BFFDataUnitDatasetAdapter`,txProperties:this.getTxProperties(n,r,i,o),useDefaultRowsLimit:!1}};return JSON.stringify(u)}getModuleName(){return r.getContextValue("__SNK__APPLICATION__").getModuleName().replace("-bff","")}getTxProperties(t,e,n,r){const a={"__DATA_UNIT_ADAPTER__[dataUnitName]":t.name};0!==r.length&&(a["__DATA_UNIT_ADAPTER__[criteria]"]=JSON.stringify(r)),null!=n&&0!==n.length&&(a["__DATA_UNIT_ADAPTER__[sorting]"]=JSON.stringify(n)),null!=e.parentRecordId&&(a["__DATA_UNIT_ADAPTER__[parentRecordId]"]=e.parentRecordId);const i=t.getGlobalLoaderProps();return null==i||0===i.size||Array.from(i.entries()).forEach((([t,e])=>{a[t]=e})),a}processRecords(t,e,n){return n.map((n=>{const r={__record__id__:n[0],__record__label__:n[1],__record__metadata__:n[n.length-1]._rmd};return t.metadata.fields.forEach((t=>{r[t.name]=this.buildFieldValue(t,e,n)})),r}))}buildFieldValue(t,e,n){const r=e.indexOf(t.name);if(r<0)return null;const o=n[r];if(a.isEmpty(o))return null;const s=this.getSearchDescriptionField(t);if(null!=s){const t=e.indexOf(s);if(t>=0)return{value:o,label:n[t]}}return t.userInterface===i.SEARCH?isNaN(Number(o))?o:Number(o):v.getConvertedValue(t,o)}getSearchDescriptionField(t){if(![i.SEARCH,i.SEARCHPLUS].includes(t.userInterface))return;if(!t.properties)return;const{ENTITYNAME:e,mergedFrom:n,DESCRIPTIONFIELD:r}=t.properties;return a.isEmpty(r)?void 0:null!=n?`${n}.${e}.${r}`:`${e}.${r}`}}var P;!function(t){t.CANCEL="CANCEL",t.CONTINUE="CONTINUE",t.LOAD_ALL="LOAD_ALL"}(P||(P={}));class R{constructor(){}static async debounce(t,e){const n=t.name;R._debouncingTimeouts[n]&&(clearTimeout(R._debouncingTimeouts[n]),delete R._debouncingTimeouts[n]),R._debouncingTimeouts[n]=setTimeout((()=>{delete R._debouncingTimeouts[n],e()}),100)}static async loadData(t,e){return new Promise(((n,r)=>{R.debounce(t,(()=>{b.loadData(t,e,this.loadFromServer).then((t=>n(t))).catch((t=>r(t)))}))}))}static getCachedRecords(t){return b.getCachedRecords(t)}static async loadFromServer(t,e,n){try{n=R.registryLoading(t,n);const r=await R.callLoader(t,e,n);if(null==r)return;const a=r.records,i=R.buildPaginationInfo(a.length,e,r.loadingInfo),o=null==i?a:a.slice(0,i.lastRecord);return Promise.resolve({records:o,paginationInfo:i})}catch(t){return console.error(t),Promise.reject(t)}}static async callLoader(t,e,n,r){null==r&&(r=new D);const a=await r.load(t,e,n),i=a.loadingInfo;if(R.isOldRequest(t,i))return Promise.resolve(void 0);if(this.handleCache(r,i,t,a.records),t.cancelPagination)return this.handlePaginationCanceled(t,a);if(this.canFinishPagination(t,i))return Promise.resolve(a);const o=Object.assign(Object.assign({},e),{offset:i.count});let s=this.buildNewLoadingInfo(i);if(this.canProceedPagination(i))return this.recallLoader(t,o,s,r,a);const c=await async function(){return new Promise((t=>{const e=new u,{checkboxContainer:n,checkbox:r}=function(t){const e=document.createElement("div");e.style.marginBottom="14px",e.style.display="flex",e.style.alignItems="center";const{checkbox:n,checkboxLabel:r}=function(t){const e=document.createElement("input");e.type="checkbox",e.id="loadAll";const n=document.createElement("label");return n.htmlFor="loadAll",n.textContent=null==t?void 0:t.getMessage("dataUnitDataLoaderHelper.checkbox.loadAll"),n.style.marginLeft="5px",{checkbox:e,checkboxLabel:n}}(t);return e.appendChild(n),e.appendChild(r),{checkboxContainer:e,checkbox:n}}(e),a=function(t,e,n){const r=document.createElement("ez-popup");return r.opened=!0,r.size="x-small",r.ezTitle=null==n?void 0:n.getMessage("dataUnitDataLoaderHelper.pagination.title"),r.heightMode="auto",r.addEventListener("ezClosePopup",(()=>{document.body.removeChild(r),t(e.checked?P.LOAD_ALL:P.CONTINUE)}),{once:!0}),r.addEventListener("ezPopupAction",(()=>{document.body.removeChild(r),t(P.CANCEL)}),{once:!0}),r}(t,r,e),i=function(){const t=document.createElement("div");return t.style.display="flex",t.style.flexDirection="column",t.style.fontFamily="var(--font-pattern, Roboto)",t.style.fontSize="var(--text--medium)",t}(),o=function(){const t=document.createElement("div");return t.style.display="flex",t.style.flexDirection="row",t.style.justifyContent="end",t.style.gap="5px",t}();i.appendChild(n),i.appendChild(function(t){const e=document.createElement("div"),n=document.createElement("p"),r=document.createElement("p"),a=document.createElement("p");return a.style.fontWeight="var(--text-weight--large, 600)",n.textContent=null==t?void 0:t.getMessage("dataUnitDataLoaderHelper.pagination.line1"),r.textContent=null==t?void 0:t.getMessage("dataUnitDataLoaderHelper.pagination.line2"),a.textContent=null==t?void 0:t.getMessage("dataUnitDataLoaderHelper.pagination.line3"),e.appendChild(n),e.appendChild(r),e.appendChild(a),e}(e)),o.appendChild(function(t,e,n,r){const a=document.createElement("ez-button");return a.label=null==r?void 0:r.getMessage("dataUnitDataLoaderHelper.buttons.continue"),a.size="medium",a.onclick=()=>{document.body.removeChild(t),n(e.checked?P.LOAD_ALL:P.CONTINUE)},a}(a,r,t,e)),o.appendChild(function(t,e,n){const r=document.createElement("ez-button");return r.label=null==n?void 0:n.getMessage("dataUnitDataLoaderHelper.buttons.cancel"),r.size="medium",r.classList.add("ez-button--primary"),r.onclick=()=>{document.body.removeChild(t),e(P.CANCEL)},r}(a,t,e)),i.appendChild(o),a.appendChild(i),document.body.appendChild(a)}))}();return c===P.CANCEL?this.handlePaginationCanceled(t,a):(c===P.LOAD_ALL&&(s=Object.assign(Object.assign({},s),{loadAllRecords:!0})),s=Object.assign(Object.assign({},s),{lastRowLimitAsked:s.count}),this.recallLoader(t,o,s,r,a))}static buildNewLoadingInfo(t){return Object.assign(Object.assign({},t),{pageNumber:(t.pageNumber||0)+1,quiet:!0})}static handleCache(t,e,n,r){const a=!t.canSlice()||0===e.count;b.cacheRecords(n,r,a,e.loadingInProgress)}static recallLoader(t,e,n,r,a){return this.callLoader(t,e,n,r).then((e=>R.afterLoadingPage(t,e.loadingInfo))).catch((t=>console.error(t))),Promise.resolve(a)}static canFinishPagination(t,e){return!b.isCacheEnabled(t)||!e.loadingInProgress}static canProceedPagination(t){const{count:e,askRowsLimit:n,loadAllRecords:r,lastRowLimitAsked:a}=t;if(r)return!0;if(!e||!n)return!0;const i=Number(n);return e<i||e<i+(a||0)}static handlePaginationCanceled(t,e){t.cancelPagination=!1;let n=e.loadingInfo;return n=Object.assign(Object.assign({},n),{total:n.count,loadingInProgress:!1,pagerId:void 0,needReload:n.hasLocalSorting}),Promise.resolve({records:e.records,loadingInfo:n})}static afterLoadingPage(t,e){b.setLoadingStatus(t,e.loadingInProgress);const n=t.getPaginationInfo();if(null==n)return;const r=e.count;e.loadingInProgress?t.updatePagination(Object.assign(Object.assign({},n),{count:r,loadingInProgress:!0})):e.needReload?t.gotoPage(0):t.updatePagination(Object.assign(Object.assign({},n),{total:r,count:r,loadingInProgress:!1}))}static registryLoading(t,e){return null==e&&(e={requestTime:(new Date).getTime(),count:0}),R._requestTimeByDataUnit.set(t.name,e.requestTime),e}static isOldRequest(t,e){return R._requestTimeByDataUnit.get(t.name)>e.requestTime}static buildPaginationInfo(t,e,n){let{limit:r,offset:a}=e;if(!r)return;1===n.pageNumber&&(a=0);const{total:i,count:o,loadingInProgress:s,askRowsLimit:c}=n,l=0===o||0===t?0:a+1,u=a+Math.min(t,r);return{total:i,count:o,lastRecord:u,firstRecord:l,currentPage:a/r,hasMore:u<o||s,askRowsLimit:c}}}R._requestTimeByDataUnit=new Map,R._debouncingTimeouts={};const N=/dd:\/\/([^/]+)\/([^/?]+)/;class O{constructor(){this.templateByQuery=new Map,this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchDataUnit",d.gql`query($name: String!) {
1
+ import{ObjectUtils as t,DataUnit as e,DataUnitInMemoryLoader as n,ApplicationContext as r,StringUtils as a,UserInterface as i,DataUnitStorage as o,DataType as s,ChangeOperation as c}from"@sankhyalabs/core";import{D as l,S as u,d}from"./p-cdda05e3.js";import{DISTINCT_FILTER_NAME_PREFIX as m}from"@sankhyalabs/ezui/dist/collection/utils/constants";import{DataUnitTransient as h}from"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import{ColumnFilterManager as f}from"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import p from"@sankhyalabs/core/dist/utils/SortingUtils";import{R as g}from"./p-688dcb4c.js";class _{constructor(t){this._list=[],this._listCopy=[],this._listLastUpdate=0,this._listCopyLastUpdate=0,this._equalsFunction=t}async load(t,e,n,r){let a=[].concat(this._list);null!=t&&(a=this._list.filter((e=>t(e)))),null!=e&&(a=a.sort(e));const i=a.length;if(null!=r){const t=n||0;a=a.slice(t,r?t+r:a.length)}return Promise.resolve({result:a,count:i})}async distict(t){const e=[];let n=!1;for(const r of this._list){const a=t(r);null!=a&&(null!=a.value?e.push(a):n=!0)}return n&&e.push({key:"",value:null}),Promise.resolve(new Map(e.map((t=>[t.key,t.value]))))}async push(t){this.updateList([...this._list,...t])}async clear(){this.updateList([])}async delete(t){const e=this._list.filter((e=>{for(const n of t)if(this._equalsFunction(e,n))return!1;return!0}));this.updateList(e)}async update(t){const e=this._list.map((e=>{const n=t.find((t=>this._equalsFunction(e,t)));return null==n?e:n}));this.updateList(e)}async insert(t,e){const n=this._list.indexOf(t);if(-1==n)return void this.push(e);const r=this._list.slice(0,n).concat(e).concat(this._list.slice(n));this.updateList(r)}isOperating(){return!0}async isEmpty(){return Promise.resolve(0===this._list.length)}async count(){return Promise.resolve(this._list.length)}getFromCache(){return this._listLastUpdate>this._listCopyLastUpdate&&(this._listCopyLastUpdate=this._listLastUpdate,this._listCopy=t.copy(this._list)),this._listCopy}updateList(t){this._list=t,this._listLastUpdate=Date.now()}}class v{static setLoadingStatus(t,e){this._loadingStatus.set(t.name,e)}static isCacheEnabled(t){return!0}static cacheRecords(t,e,n,r){v.setLoadingStatus(t,r),v.isCacheEnabled(t)?this.getRepository(t).push(e):n&&this._repositories.delete(t.name)}static getSortingFunction(t,e){return p.getSortingFunction(t,e)}static async getDistinct(t,e,n=!1){if(!v.isCacheEnabled(t))return Promise.resolve(f.compileDistinct(e,t));let r;const a=t.getLastLoadRequest();if(null!=a){const n=f.getColumnFilters(a.filters,e);r=f.getFilterFunction(t,Array.from(n.values()))}return new Promise(((a,i)=>{v.getRepository(t).distict((a=>{if(null!=r&&!r(a))return;const i=a[e];if(null==i)return{key:null,value:null};let o=null!=i.value?i.value:i;return(null==i?void 0:i.label)&&n?{key:null==i?void 0:i.label,value:t.getFormattedValue(e,o)}:{key:t.getFormattedValue(e,i),value:o}})).then((t=>{a(null!=t?Array.from(t.entries()).map((([t,e])=>({label:t,value:e,check:!0}))):void 0)})).catch((t=>i(t)))}))}static async loadData(t,n,r){try{if(v.isCacheEnabled(t)){if(["EZ_GRID_LOADING_SOURCE",e.CHANGING_PAGE_LOADING_SOURCE,e.ALL_RECORDS_SELECTION_SOURCE].includes(n.source)&&!await v.getRepository(t).isEmpty())return v.loadFromCache(t,n);v.getRepository(t).clear().catch((()=>{}))}return r(t,n)}catch(t){return console.error(t),Promise.reject(t)}}static insertRecords(t,e,n){v.isCacheEnabled(t)&&v.getRepository(t).insert(e,n)}static updateRecords(t,e){v.isCacheEnabled(t)&&v.getRepository(t).update(e)}static removeRecords(t,e){v.isCacheEnabled(t)&&v.getRepository(t).delete(e)}static async countRecords(t){return v.isCacheEnabled(t)?v.getRepository(t).count():Promise.resolve(0)}static getRepository(t){const e=t.name;return v._repositories.has(e)||v._repositories.set(e,new _(((t,e)=>t.__record__id__===e.__record__id__))),v._repositories.get(e)}static async loadFromCache(t,e){return new Promise(((n,r)=>{const a=f.getColumnFilters(e.filters,""),{limit:i,offset:o,sort:s}=e;v.getRepository(t).load(f.getFilterFunction(t,Array.from(a.values())),v.getSortingFunction(t,s),o,i).then((e=>{const r=v._loadingStatus.get(t.name),{count:a,result:s}=e,c=0==a?0:o+1,l=o+Math.min(s.length,i);n({records:s,paginationInfo:{count:a,currentPage:o/i,firstRecord:c,lastRecord:l,hasMore:r||l<a,total:r?void 0:a}})})).catch((t=>r(t)))}))}static getCachedRecords(t){return v.getRepository(t).getFromCache()}}v._repositories=new Map,v._loadingStatus=new Map;class b{constructor(t,e,r){this._dataUnitInMemoryLoader=new n(t,e,r)}get dataUnit(){return this._dataUnitInMemoryLoader.dataUnit}get records(){return this._dataUnitInMemoryLoader.records}set records(t){this._dataUnitInMemoryLoader.records=t}get metadata(){return this._dataUnitInMemoryLoader.metadata}set metadata(t){this._dataUnitInMemoryLoader.metadata=t}removeLoader(t,e){return this._dataUnitInMemoryLoader.removeLoader(t,e)}static getConvertedValue(t,e,r){return n.getConvertedValue(t,e,r)}}function y(t,e){var n,r;return void 0!==(null===(n=t[e])||void 0===n?void 0:n.value)?null===(r=t[e])||void 0===r?void 0:r.value:t[e]}b.IN_MEMORY_DATA_UNIT_NAME=n.IN_MEMORY_DATA_UNIT_NAME;class D{canSlice(){return!1}processSortingSide(t,e,n){var r;const a=[],o=[];if(null!=t.sort){if(0===n.length)return{localSorting:t.sort,serverSorting:[]};for(const n of t.sort){const t=e.getField(n.field);"true"===(null===(r=null==t?void 0:t.properties)||void 0===r?void 0:r.calculated)||(null==t?void 0:t.userInterface)===i.LONGTEXT?a.push(n):o.push(n)}}return{localSorting:a,serverSorting:o}}async load(t,e,n){var r,a;if(null==t.metadata)return Promise.resolve({records:[],loadingInfo:n});try{const i=null!==(a=null===(r=e.filters)||void 0===r?void 0:r.filter((t=>!t.name.startsWith("FILTRO_COLUNA_"))))&&void 0!==a?a:[],{localSorting:o,serverSorting:s}=this.processSortingSide(e,t,i),c=this.getFieldsList(t),u="DatasetSP.loadRecords",d=this.buildRequestBody(u,c,t,e,n,s,i),m=n.quiet?{urlParams:{quietMode:"true"}}:void 0,{result:h,pagerID:f,askRowsLimit:p}=await l.get().callServiceBroker(u,d,m),g=this.processRecords(t,c,h),_=null!=f,v=n.count+g.length,b=t.hasNewRecord(),y=o.length>0,D=!_&&y;return D&&b&&t.setWaitingToReload(!0),Promise.resolve({records:g,loadingInfo:Object.assign(Object.assign({},n),{pagerId:f,loadingInProgress:_,total:_?void 0:v,count:v,needReload:D&&!b,askRowsLimit:p,hasLocalSorting:y})})}catch(t){return console.error(t),Promise.reject(t)}}async loadRowMetadata(t,e,n,r={}){try{const a="DatasetSP.loadRowMetadata",i=await this.buildRequestBodyLoadRowMetadata({snkDataUnit:t,fieldName:e,metadataName:n,serviceName:a,updatedFields:r});return await l.get().callServiceBroker(a,i)}catch(t){return console.error(t),Promise.reject(t)}}async buildRequestBodyLoadRowMetadata({snkDataUnit:t,serviceName:e,fieldName:n,metadataName:r,updatedFields:a}){const i=t.dataUnit,o=O.parseDataUnitName(i.name).entityName,s=(await t.getSelectedRecordsIDsInfo()).reduce(((t,e)=>(t[e.name]=e.value,t)),{}),c=i.getSelectedRecord(),l=i.metadata.fields.filter((({standAlone:t,name:e})=>!t&&!e.includes("."))).map((({name:t})=>t)),u=l.reduce(((t,e,n)=>{const r=y(c,e),i=y(a,e);return t[n]=void 0!==i?i:r,t}),{});return JSON.stringify({serviceName:e,requestBody:{dataSetID:i.dataUnitId,entityName:o,standAlone:!1,metadataName:r,fieldName:n,fields:l,record:{pk:s,oldPk:s,values:u}}})}getFieldsList(t){let e=["__record__id__","__record__label__"];return t.metadata.fields.forEach((t=>{t.standAlone||(e=e.concat(this.getFieldNames(t)))})),e}getStandAloneFieldsList(t){let e={};return t.metadata.fields.forEach((t=>{t.standAlone&&(e=Object.assign(Object.assign({},e),{[t.name]:{fieldType:t.dataType,userType:t.userInterface}}))})),e}getFieldNames(t){const e=this.getSearchDescriptionField(t);return null==e?t.name:[t.name,e]}buildRequestBody(t,e,n,r,a,i,o){const s=n.dataUnitId,c=O.parseDataUnitName(n.name).entityName,l=!(!r.limit&&!r.offset),u={serviceName:t,requestBody:{dataSetID:s,fields:e,entityName:c,pageNumber:a.pageNumber,totalRecordsCount:a.count,pagerID:a.pagerId,standAlone:!1,standAloneFieldsMD:Object.assign({__record__id__:{fieldType:"S",userType:"P"},__record__label__:{fieldType:"S",userType:"P"}},this.getStandAloneFieldsList(n)),tryJoinedFields:!0,parallelLoader:l,crudListener:`br.com.sankhya.bff.${this.getModuleName()}.BFFDataUnitDatasetAdapter`,txProperties:this.getTxProperties(n,r,i,o),useDefaultRowsLimit:!1}};return JSON.stringify(u)}getModuleName(){return r.getContextValue("__SNK__APPLICATION__").getModuleName().replace("-bff","")}getTxProperties(t,e,n,r){const a={"__DATA_UNIT_ADAPTER__[dataUnitName]":t.name};0!==r.length&&(a["__DATA_UNIT_ADAPTER__[criteria]"]=JSON.stringify(r)),null!=n&&0!==n.length&&(a["__DATA_UNIT_ADAPTER__[sorting]"]=JSON.stringify(n)),null!=e.parentRecordId&&(a["__DATA_UNIT_ADAPTER__[parentRecordId]"]=e.parentRecordId);const i=t.getGlobalLoaderProps();return null==i||0===i.size||Array.from(i.entries()).forEach((([t,e])=>{a[t]=e})),a}processRecords(t,e,n){return n.map((n=>{const r={__record__id__:n[0],__record__label__:n[1],__record__metadata__:n[n.length-1]._rmd};return t.metadata.fields.forEach((t=>{r[t.name]=this.buildFieldValue(t,e,n)})),r}))}buildFieldValue(t,e,n){const r=e.indexOf(t.name);if(r<0)return null;const o=n[r];if(a.isEmpty(o))return null;const s=this.getSearchDescriptionField(t);if(null!=s){const t=e.indexOf(s);if(t>=0)return{value:o,label:n[t]}}return t.userInterface===i.SEARCH?isNaN(Number(o))?o:Number(o):b.getConvertedValue(t,o)}getSearchDescriptionField(t){if(![i.SEARCH,i.SEARCHPLUS].includes(t.userInterface))return;if(!t.properties)return;const{ENTITYNAME:e,mergedFrom:n,DESCRIPTIONFIELD:r}=t.properties;return a.isEmpty(r)?void 0:null!=n?`${n}.${e}.${r}`:`${e}.${r}`}}var P;!function(t){t.CANCEL="CANCEL",t.CONTINUE="CONTINUE",t.LOAD_ALL="LOAD_ALL"}(P||(P={}));class R{constructor(){}static async debounce(t,e){const n=t.name;R._debouncingTimeouts[n]&&(clearTimeout(R._debouncingTimeouts[n]),delete R._debouncingTimeouts[n]),R._debouncingTimeouts[n]=setTimeout((()=>{delete R._debouncingTimeouts[n],e()}),100)}static async loadData(t,e){return new Promise(((n,r)=>{R.debounce(t,(()=>{v.loadData(t,e,this.loadFromServer).then((t=>n(t))).catch((t=>r(t)))}))}))}static getCachedRecords(t){return v.getCachedRecords(t)}static async loadFromServer(t,e,n){try{n=R.registryLoading(t,n);const r=await R.callLoader(t,e,n);if(null==r)return;const a=r.records,i=R.buildPaginationInfo(a.length,e,r.loadingInfo),o=null==i?a:a.slice(0,i.lastRecord);return Promise.resolve({records:o,paginationInfo:i})}catch(t){return console.error(t),Promise.reject(t)}}static async callLoader(t,e,n,r){null==r&&(r=new D);const a=await r.load(t,e,n),i=a.loadingInfo;if(R.isOldRequest(t,i))return Promise.resolve(void 0);if(this.handleCache(r,i,t,a.records),t.cancelPagination)return this.handlePaginationCanceled(t,a);if(this.canFinishPagination(t,i))return Promise.resolve(a);const o=Object.assign(Object.assign({},e),{offset:i.count});let s=this.buildNewLoadingInfo(i);if(this.canProceedPagination(i))return this.recallLoader(t,o,s,r,a);const c=await async function(){return new Promise((t=>{const e=new u,{checkboxContainer:n,checkbox:r}=function(t){const e=document.createElement("div");e.style.marginBottom="14px",e.style.display="flex",e.style.alignItems="center";const{checkbox:n,checkboxLabel:r}=function(t){const e=document.createElement("input");e.type="checkbox",e.id="loadAll";const n=document.createElement("label");return n.htmlFor="loadAll",n.textContent=null==t?void 0:t.getMessage("dataUnitDataLoaderHelper.checkbox.loadAll"),n.style.marginLeft="5px",{checkbox:e,checkboxLabel:n}}(t);return e.appendChild(n),e.appendChild(r),{checkboxContainer:e,checkbox:n}}(e),a=function(t,e,n){const r=document.createElement("ez-popup");return r.opened=!0,r.size="x-small",r.ezTitle=null==n?void 0:n.getMessage("dataUnitDataLoaderHelper.pagination.title"),r.heightMode="auto",r.addEventListener("ezClosePopup",(()=>{document.body.removeChild(r),t(e.checked?P.LOAD_ALL:P.CONTINUE)}),{once:!0}),r.addEventListener("ezPopupAction",(()=>{document.body.removeChild(r),t(P.CANCEL)}),{once:!0}),r}(t,r,e),i=function(){const t=document.createElement("div");return t.style.display="flex",t.style.flexDirection="column",t.style.fontFamily="var(--font-pattern, Roboto)",t.style.fontSize="var(--text--medium)",t}(),o=function(){const t=document.createElement("div");return t.style.display="flex",t.style.flexDirection="row",t.style.justifyContent="end",t.style.gap="5px",t}();i.appendChild(n),i.appendChild(function(t){const e=document.createElement("div"),n=document.createElement("p"),r=document.createElement("p"),a=document.createElement("p");return a.style.fontWeight="var(--text-weight--large, 600)",n.textContent=null==t?void 0:t.getMessage("dataUnitDataLoaderHelper.pagination.line1"),r.textContent=null==t?void 0:t.getMessage("dataUnitDataLoaderHelper.pagination.line2"),a.textContent=null==t?void 0:t.getMessage("dataUnitDataLoaderHelper.pagination.line3"),e.appendChild(n),e.appendChild(r),e.appendChild(a),e}(e)),o.appendChild(function(t,e,n,r){const a=document.createElement("ez-button");return a.label=null==r?void 0:r.getMessage("dataUnitDataLoaderHelper.buttons.continue"),a.size="medium",a.onclick=()=>{document.body.removeChild(t),n(e.checked?P.LOAD_ALL:P.CONTINUE)},a}(a,r,t,e)),o.appendChild(function(t,e,n){const r=document.createElement("ez-button");return r.label=null==n?void 0:n.getMessage("dataUnitDataLoaderHelper.buttons.cancel"),r.size="medium",r.classList.add("ez-button--primary"),r.onclick=()=>{document.body.removeChild(t),e(P.CANCEL)},r}(a,t,e)),i.appendChild(o),a.appendChild(i),document.body.appendChild(a)}))}();return c===P.CANCEL?this.handlePaginationCanceled(t,a):(c===P.LOAD_ALL&&(s=Object.assign(Object.assign({},s),{loadAllRecords:!0})),s=Object.assign(Object.assign({},s),{lastRowLimitAsked:s.count}),this.recallLoader(t,o,s,r,a))}static buildNewLoadingInfo(t){return Object.assign(Object.assign({},t),{pageNumber:(t.pageNumber||0)+1,quiet:!0})}static handleCache(t,e,n,r){const a=!t.canSlice()||0===e.count;v.cacheRecords(n,r,a,e.loadingInProgress)}static recallLoader(t,e,n,r,a){return this.callLoader(t,e,n,r).then((e=>R.afterLoadingPage(t,e.loadingInfo))).catch((t=>console.error(t))),Promise.resolve(a)}static canFinishPagination(t,e){return!v.isCacheEnabled(t)||!e.loadingInProgress}static canProceedPagination(t){const{count:e,askRowsLimit:n,loadAllRecords:r,lastRowLimitAsked:a}=t;if(r)return!0;if(!e||!n)return!0;const i=Number(n);return e<i||e<i+(a||0)}static handlePaginationCanceled(t,e){t.cancelPagination=!1;let n=e.loadingInfo;return n=Object.assign(Object.assign({},n),{total:n.count,loadingInProgress:!1,pagerId:void 0,needReload:n.hasLocalSorting}),Promise.resolve({records:e.records,loadingInfo:n})}static afterLoadingPage(t,e){v.setLoadingStatus(t,e.loadingInProgress);const n=t.getPaginationInfo();if(null==n)return;const r=e.count;e.loadingInProgress?t.updatePagination(Object.assign(Object.assign({},n),{count:r,loadingInProgress:!0})):e.needReload?t.gotoPage(0):t.updatePagination(Object.assign(Object.assign({},n),{total:r,count:r,loadingInProgress:!1}))}static registryLoading(t,e){return null==e&&(e={requestTime:(new Date).getTime(),count:0}),R._requestTimeByDataUnit.set(t.name,e.requestTime),e}static isOldRequest(t,e){return R._requestTimeByDataUnit.get(t.name)>e.requestTime}static buildPaginationInfo(t,e,n){let{limit:r,offset:a}=e;if(!r)return;1===n.pageNumber&&(a=0);const{total:i,count:o,loadingInProgress:s,askRowsLimit:c}=n,l=0===o||0===t?0:a+1,u=a+Math.min(t,r);return{total:i,count:o,lastRecord:u,firstRecord:l,currentPage:a/r,hasMore:u<o||s,askRowsLimit:c}}}R._requestTimeByDataUnit=new Map,R._debouncingTimeouts={};const N=/dd:\/\/([^/]+)\/([^/?]+)/;class O{constructor(){this.templateByQuery=new Map,this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchDataUnit",d.gql`query($name: String!) {
2
2
  $queryAlias$: fetchDataUnit(name: $name){
3
3
  name
4
4
  fields{
@@ -57,4 +57,4 @@ import{ObjectUtils as t,DataUnit as e,DataUnitInMemoryLoader as n,ApplicationCon
57
57
  }
58
58
  }`),this.templateByQuery.set("fetchDistinctColumn",d.gql`query($dataUnit: String!, $fieldName: String!, $argument: String, $filters: [InputFilter], $parentRecordId: String) {
59
59
  $queryAlias$: selectDistinct(dataUnit: $dataUnit, fieldName: $fieldName, argument: $argument, filters: $filters, parentRecordId: $parentRecordId)
60
- }`)}static parseDataUnitName(t){if(null==t)return;const e=N.exec(t);return e?{entityName:e[1],resourceID:e[2]}:void 0}getDataUnit(t,n,r,a){null==b.applicationResourceID&&g.getResourceID().then((t=>b.applicationResourceID=t));const i=`dd://${t}/${n}${a?"/"+a:""}`,o=null!=r?r.getChildDataunit(i):new e(i);return o.metadataLoader=t=>this.loadMetadata(t),o.dataLoader=(t,e)=>R.loadData(t,e),o.saveLoader=(t,e)=>this.saveData(o,e),o.removeLoader=(t,e)=>this.removeRecords(t,e),o.recordLoader=(t,e)=>this.loadRecord(t,e),o.allRecordsLoader=t=>R.getCachedRecords(t),o}loadMetadata(t){return new Promise(((e,n)=>{l.get().callGraphQL({values:{name:t.name},query:this.templateByQuery.get("fetchDataUnit")}).then((t=>{var n;const r={name:t.name,label:t.name,children:[...t.children],fields:[]};null===(n=t.fields)||void 0===n||n.forEach((t=>{let e;Array.isArray(t.properties)&&(e={},t.calculated&&(e.gridHeaderTooltip="Campos calculados não podem ser ordenados"),t.properties.forEach((t=>e[t.name]=t.value))),r.fields.push(Object.assign(Object.assign({},t),{properties:e}))})),r.fields.sort(((t,e)=>t.order-e.order)),e(r)})).catch((t=>{n(t)}))}))}loadSelectDistinct(t,e,n){const{parentRecordId:r,filters:a}=t.getLastLoadRequest()||{},i=a.filter((t=>t.name!==`${m}${e}`)),o={dataUnit:t.name,argument:n,fieldName:e,parentRecordId:r,filters:i};return new Promise(((t,e)=>{l.get().callGraphQL({values:o,query:this.templateByQuery.get("fetchDistinctColumn")}).then((e=>{t(e)})).catch((t=>{e(t)}))}))}addTransientProperties(t,e){const n=t.getGlobalLoaderProps();return null==n||0===n.size||(null==e&&(e={}),Array.from(n.entries()).forEach((([t,n])=>{e[`transient.${t}`]=n}))),e}getUpdatingFields(t,e){if(null==e)return;const n=Object.assign({},e);return Object.keys(n).forEach((e=>{const r=t.getField(e);null!=r&&r.standAlone&&delete n[e]})),this.addTransientProperties(t,n)}saveData(t,e){const n=[],r=[],a=e.map((e=>{const{dataUnit:a,record:i,operation:l}=e,u=o.get(a),d=this.getUpdatingFields(u,e.updatingFields);let m;null!=d&&(m=Object.entries(d).map((([t,e])=>{const n=u.getField(t);return{fieldName:t,dataType:n?n.dataType:s.TEXT,value:u.valueToString(t,e)}}))),a===t.name&&(l===c.INSERT||l===c.COPY?r.push(i.__record__id__):n.push(i.__record__id__));const h={dataUnit:a,fields:m,operation:l,recordId:i.__record__id__};return e.sourceId&&(h.sourceId=e.sourceId),i.__parent__record__id__&&(h.parentRecordId=i.__parent__record__id__),h}));return new Promise(((e,i)=>{const s=a.map((t=>function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(t);a<r.length;a++)e.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(t,r[a])&&(n[r[a]]=t[r[a]])}return n}(t,[])));l.get().callGraphQL({values:{changes:s},query:this.templateByQuery.get("saveData")}).then((a=>{const i=[];null==a||a.forEach((e=>{const n={__record__id__:e.id,__record__label__:e.label,__owner__dataunit__name__:e.ownerDataUnitName},r=o.get(n.__owner__dataunit__name__)||t;e.oldId&&(n.__old__id__=e.oldId),e.fields.forEach((({name:t,value:e})=>{var a;const i=null===(a=null==r?void 0:r.valueFromString)||void 0===a?void 0:a.call(r,t,e);n[t]=void 0!==i?i:e})),i.push(n)})),this.updateCache(t,i,n,r),e(i)})).catch((t=>{i(t)}))}))}updateCache(t,e,n,r){const a=new Map(e.map((t=>[t.__old__id__||t.__record__id__,t]))),i=r.map((t=>{const e=Object.assign({},a.get(t));return delete e.__old__id__,e}));i.length>0&&b.insertRecords(t,t.records[0],i);const o=n.map((t=>Object.assign({},a.get(t))));b.updateRecords(t,o)}getTransientInfo(t,e){const{records:n}=t.getSelectionInfo();return Object.entries(n.filter((t=>t.__record__id__==e))[0]).filter((([t])=>t.startsWith(h.DATA_UNIT_TRANSIENT_PREFIX_NAME))).map((([t,e])=>({fieldName:t,value:e,dataType:s.TEXT})))}removeRecords(t,e){const n=e.map((e=>({dataUnit:t.name,operation:c.DELETE,recordId:e,fields:this.getTransientInfo(t,e)})));return new Promise(((r,a)=>{l.get().callGraphQL({values:{changes:n},query:this.templateByQuery.get("saveData")}).then((()=>{b.removeRecords(t,t.records.filter((t=>e.includes(t.__record__id__)))),r(e)})).catch((t=>{a(t)}))}))}loadRecord(t,e){return new Promise(((n,r)=>{l.get().callGraphQL({values:{recordID:e,dataunit:t.name},query:this.templateByQuery.get("fetchDataRecord")}).then((e=>{const r=[];e.record.forEach((e=>{const n={__record__id__:e.id,__record__label__:e.label};e.fields.forEach((({name:e,value:r})=>{n[e]=t.valueFromString(e,r)})),r.push(n)})),n(r)})).catch((t=>{r(t)}))}))}}export{O as D,v as I,b as P,D as a,y as g}
60
+ }`)}static parseDataUnitName(t){if(null==t)return;const e=N.exec(t);return e?{entityName:e[1],resourceID:e[2]}:void 0}getDataUnit(t,n,r,a){null==v.applicationResourceID&&g.getResourceID().then((t=>v.applicationResourceID=t));const i=`dd://${t}/${n}${a?"/"+a:""}`,o=null!=r?r.getChildDataunit(i):new e(i);return o.metadataLoader=t=>this.loadMetadata(t),o.dataLoader=(t,e)=>R.loadData(t,e),o.saveLoader=(t,e)=>this.saveData(o,e),o.removeLoader=(t,e)=>this.removeRecords(t,e),o.recordLoader=(t,e)=>this.loadRecord(t,e),o.allRecordsLoader=t=>R.getCachedRecords(t),o}loadMetadata(t){return new Promise(((e,n)=>{l.get().callGraphQL({values:{name:t.name},query:this.templateByQuery.get("fetchDataUnit")}).then((t=>{var n;const r={name:t.name,label:t.name,children:[...t.children],fields:[]};null===(n=t.fields)||void 0===n||n.forEach((t=>{let e;Array.isArray(t.properties)&&(e={},t.calculated&&(e.gridHeaderTooltip="Campos calculados não podem ser ordenados"),t.properties.forEach((t=>e[t.name]=t.value))),r.fields.push(Object.assign(Object.assign({},t),{properties:e}))})),r.fields.sort(((t,e)=>t.order-e.order)),e(r)})).catch((t=>{n(t)}))}))}loadSelectDistinct(t,e,n){const{parentRecordId:r,filters:a}=t.getLastLoadRequest()||{},i=a.filter((t=>t.name!==`${m}${e}`)),o={dataUnit:t.name,argument:n,fieldName:e,parentRecordId:r,filters:i};return new Promise(((t,e)=>{l.get().callGraphQL({values:o,query:this.templateByQuery.get("fetchDistinctColumn")}).then((e=>{t(e)})).catch((t=>{e(t)}))}))}addTransientProperties(t,e){const n=t.getGlobalLoaderProps();return null==n||0===n.size||(null==e&&(e={}),Array.from(n.entries()).forEach((([t,n])=>{e[`transient.${t}`]=n}))),e}getUpdatingFields(t,e){if(null==e)return;const n=Object.assign({},e);return Object.keys(n).forEach((e=>{const r=t.getField(e);null!=r&&r.standAlone&&delete n[e]})),this.addTransientProperties(t,n)}saveData(t,e){const n=[],r=[],a=e.map((e=>{const{dataUnit:a,record:i,operation:l}=e,u=o.get(a),d=this.getUpdatingFields(u,e.updatingFields);let m;null!=d&&(m=Object.entries(d).map((([t,e])=>{const n=u.getField(t);return{fieldName:t,dataType:n?n.dataType:s.TEXT,value:u.valueToString(t,e)}}))),a===t.name&&(l===c.INSERT||l===c.COPY?r.push(i.__record__id__):n.push(i.__record__id__));const h={dataUnit:a,fields:m,operation:l,recordId:i.__record__id__};return e.sourceId&&(h.sourceId=e.sourceId),i.__parent__record__id__&&(h.parentRecordId=i.__parent__record__id__),h}));return new Promise(((e,i)=>{const s=a.map((t=>function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(t);a<r.length;a++)e.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(t,r[a])&&(n[r[a]]=t[r[a]])}return n}(t,[])));l.get().callGraphQL({values:{changes:s},query:this.templateByQuery.get("saveData")}).then((a=>{const i=[];null==a||a.forEach((e=>{const n={__record__id__:e.id,__record__label__:e.label,__owner__dataunit__name__:e.ownerDataUnitName},r=o.get(n.__owner__dataunit__name__)||t;e.oldId&&(n.__old__id__=e.oldId),e.fields.forEach((({name:t,value:e})=>{var a;const i=null===(a=null==r?void 0:r.valueFromString)||void 0===a?void 0:a.call(r,t,e);n[t]=void 0!==i?i:e})),i.push(n)})),this.updateCache(t,i,n,r),e(i)})).catch((t=>{i(t)}))}))}updateCache(t,e,n,r){const a=new Map(e.map((t=>[t.__old__id__||t.__record__id__,t]))),i=r.map((t=>{const e=Object.assign({},a.get(t));return delete e.__old__id__,e}));i.length>0&&v.insertRecords(t,t.records[0],i);const o=n.map((t=>Object.assign({},a.get(t))));v.updateRecords(t,o)}getTransientInfo(t,e){const{records:n}=t.getSelectionInfo();return Object.entries(n.filter((t=>t.__record__id__==e))[0]).filter((([t])=>t.startsWith(h.DATA_UNIT_TRANSIENT_PREFIX_NAME))).map((([t,e])=>({fieldName:t,value:e,dataType:s.TEXT})))}removeRecords(t,e){const n=e.map((e=>({dataUnit:t.name,operation:c.DELETE,recordId:e,fields:this.getTransientInfo(t,e)})));return new Promise(((r,a)=>{l.get().callGraphQL({values:{changes:n},query:this.templateByQuery.get("saveData")}).then((()=>{v.removeRecords(t,t.records.filter((t=>e.includes(t.__record__id__)))),r(e)})).catch((t=>{a(t)}))}))}loadRecord(t,e){return new Promise(((n,r)=>{l.get().callGraphQL({values:{recordID:e,dataunit:t.name},query:this.templateByQuery.get("fetchDataRecord")}).then((e=>{const r=[];e.record.forEach((e=>{const n={__record__id__:e.id,__record__label__:e.label};e.fields.forEach((({name:e,value:r})=>{n[e]=t.valueFromString(e,r)})),r.push(n)})),n(r)})).catch((t=>{r(t)}))}))}}export{O as D,b as I,v as P,D as a,y as g}
@@ -1 +1 @@
1
- import{ObjectUtils as t,StringUtils as i}from"@sankhyalabs/core";import{C as e}from"./p-4157ea10.js";import{F as s}from"./p-02459408.js";import{a as r}from"./p-9019a32f.js";class n{constructor(t,i,e,s){this._resourceID=i,this._configName=t,this._onConfigChange=e,this._dataUnit=s}addFormLegacyConfig(t){this._configName&&e.addFormLegacyConfig(this._configName,t)}async loadConfig(){return new Promise((t=>{e.loadFormConfig(this._configName,this._resourceID).then((i=>{i=this.buildFormMetadataUITabs(i),this.setConfig(i),t(i)})).catch((t=>{console.warn(t)}))}))}getEmptyConfig(){return this.buildFormMetadataUITabs({fields:[],emptyConfig:!0},!0)}saveConfig(i){const s=t.copy(i);return new Promise((t=>{e.saveFormConfig(i,this._configName,this._resourceID).then((i=>{this.setConfig(Object.assign(Object.assign({},s),i)),t(Object.assign(Object.assign({},s),i))}))}))}saveCardState(t,i,s){return new Promise((r=>{var n;const l=(null===(n=this._config)||void 0===n?void 0:n.cardsState)||new Map,o=l.get(t);l.set(t,"fixed"===s?this.updateFixSequence(Object.assign(Object.assign({},o),{fixed:i.fixed}),l):Object.assign(Object.assign({},o),{[s]:i[s]})),e.saveCardState(l,this._configName,this._resourceID).then((t=>{this._config=Object.assign(Object.assign({},this._config),{cardsState:l}),r(t)}))}))}updateFixSequence(t,i){let e=-1;return Array.from(i.values()).forEach((i=>{i.fixed||delete t.fixSequence,null!=i.fixSequence&&(e=Math.max(e,i.fixSequence))})),t.fixed?t.fixSequence=e+1:delete t.fixSequence,t}hasConfig(t){var i;const e=null!=t?t:this._config;return!(!e||!(null===(i=e.fields)||void 0===i?void 0:i.length))}getFieldsList(t,i=!1){var e,s;const r=null===(e=this._config)||void 0===e?void 0:e.fields;return this.hasConfig()&&!i?r.map((({label:t,name:i,readOnly:e,visible:s,required:r,tab:n,group:l})=>{var o;if(null==t){const t=null===(o=this._dataUnit)||void 0===o?void 0:o.getField(i);if(!t)return;return Object.assign(Object.assign({},t),{name:null!=i?i:t.name,readOnly:null!=e?e:t.readOnly,visible:null!=s?s:t.visible,required:null!=r?r:t.required,tab:n,group:l})}return{name:i,label:t,readOnly:e,visible:s,required:r,tab:n,group:l}})).filter((i=>this.isFieldVisible(i,t))):this._dataUnit&&(null===(s=this._dataUnit.metadata)||void 0===s?void 0:s.fields)?this._dataUnit.metadata.fields.filter((i=>this.isFieldVisible(i,t))).map((({label:t,name:i,readOnly:e,visible:s,required:r,properties:n})=>({label:t,name:i,readOnly:e,visible:s,required:r,tab:null==n?void 0:n.UITabName}))):[]}isFieldVisible(t,e){if(void 0===t||!1===t.visible)return!1;if(null==e)return!0;const s=i.replaceAccentuatedCharsLower((t.label||t.name).toLocaleLowerCase()),r=i.replaceAccentuatedCharsLower(e.toLocaleLowerCase());return s.includes(r)}getFormConfig(t,i,e=!1){let s=this.getFieldsList(void 0,e);return i&&(s=s.filter((i=>{if(t){const e=t.getField(i.name);if(e&&e.readOnly)return!1}return!i.readOnly}))),Object.assign(Object.assign({},this._config),{fields:s})}setConfig(t){this.isLoaded=!0;const{cardsState:i,summary:e,defaultVars:s}=this._config||{};this._config=Object.assign({},t),i&&(this._config.cardsState=i),e&&(this._config.summary=e),s&&(this._config.defaultVars=s),this._onConfigChange&&this._onConfigChange(Object.assign({},this._config))}getConfig(t,i){return this.getFormConfig(t,i)}getFormConfigFetcher(){return null==this._formConfigFetcher&&(this._formConfigFetcher=new s),this._formConfigFetcher}async fetchUserAvailableConfigs(){return null!=this._configName?Promise.resolve(void 0):this.getFormConfigFetcher().fetchUserAvailableConfigs(this._configName,this._resourceID)}async fetchLegacyConfig(){return this.getFormConfigFetcher().fetchLegacyConfig(this._configName,this._resourceID)}async fetchDefaultConfig(){return this.getFormConfigFetcher().fetchDefaultConfig(this._configName,this._resourceID)}parseObjectList(t){return t?Array.isArray(t)?t:[t]:[]}buildFormMetadataUITabs(t,i=!1){var e,s,n;const l=this.hasConfig(t);if(!i&&(!this._dataUnit||l))return t;(t=this.getFormConfig(this._dataUnit,!1,!0)).tabs=this.parseObjectList(t.tabs),t.emptyConfig=!1,t.defaultConfiguration=!0;const o=null!==(s=null===(e=this._dataUnit.metadata)||void 0===e?void 0:e.fields)&&void 0!==s?s:[];for(const i of o){const e=t.fields.find((t=>t.name===i.name)),s=null===(n=i.properties)||void 0===n?void 0:n.UITabName;s&&s!==r.main&&(t.tabs.some((t=>t.label===s))||t.tabs.push({label:s,name:s,order:0,visible:!0}),e&&(e.tab=s))}return t}}export{n as S}
1
+ import{ObjectUtils as t,StringUtils as i}from"@sankhyalabs/core";import{C as e}from"./p-a17e9ecd.js";import{F as s}from"./p-1273039f.js";import{a as r}from"./p-9019a32f.js";class n{constructor(t,i,e,s){this._resourceID=i,this._configName=t,this._onConfigChange=e,this._dataUnit=s}addFormLegacyConfig(t){this._configName&&e.addFormLegacyConfig(this._configName,t)}async loadConfig(){return new Promise((t=>{e.loadFormConfig(this._configName,this._resourceID).then((i=>{i=this.buildFormMetadataUITabs(i),this.setConfig(i),t(i)})).catch((t=>{console.warn(t)}))}))}getEmptyConfig(){return this.buildFormMetadataUITabs({fields:[],emptyConfig:!0},!0)}saveConfig(i){const s=t.copy(i);return new Promise((t=>{e.saveFormConfig(i,this._configName,this._resourceID).then((i=>{this.setConfig(Object.assign(Object.assign({},s),i)),t(Object.assign(Object.assign({},s),i))}))}))}saveCardState(t,i,s){return new Promise((r=>{var n;const l=(null===(n=this._config)||void 0===n?void 0:n.cardsState)||new Map,o=l.get(t);l.set(t,"fixed"===s?this.updateFixSequence(Object.assign(Object.assign({},o),{fixed:i.fixed}),l):Object.assign(Object.assign({},o),{[s]:i[s]})),e.saveCardState(l,this._configName,this._resourceID).then((t=>{this._config=Object.assign(Object.assign({},this._config),{cardsState:l}),r(t)}))}))}updateFixSequence(t,i){let e=-1;return Array.from(i.values()).forEach((i=>{i.fixed||delete t.fixSequence,null!=i.fixSequence&&(e=Math.max(e,i.fixSequence))})),t.fixed?t.fixSequence=e+1:delete t.fixSequence,t}hasConfig(t){var i;const e=null!=t?t:this._config;return!(!e||!(null===(i=e.fields)||void 0===i?void 0:i.length))}getFieldsList(t,i=!1){var e,s;const r=null===(e=this._config)||void 0===e?void 0:e.fields;return this.hasConfig()&&!i?r.map((({label:t,name:i,readOnly:e,visible:s,required:r,tab:n,group:l})=>{var o;if(null==t){const t=null===(o=this._dataUnit)||void 0===o?void 0:o.getField(i);if(!t)return;return Object.assign(Object.assign({},t),{name:null!=i?i:t.name,readOnly:null!=e?e:t.readOnly,visible:null!=s?s:t.visible,required:null!=r?r:t.required,tab:n,group:l})}return{name:i,label:t,readOnly:e,visible:s,required:r,tab:n,group:l}})).filter((i=>this.isFieldVisible(i,t))):this._dataUnit&&(null===(s=this._dataUnit.metadata)||void 0===s?void 0:s.fields)?this._dataUnit.metadata.fields.filter((i=>this.isFieldVisible(i,t))).map((({label:t,name:i,readOnly:e,visible:s,required:r,properties:n})=>({label:t,name:i,readOnly:e,visible:s,required:r,tab:null==n?void 0:n.UITabName}))):[]}isFieldVisible(t,e){if(void 0===t||!1===t.visible)return!1;if(null==e)return!0;const s=i.replaceAccentuatedCharsLower((t.label||t.name).toLocaleLowerCase()),r=i.replaceAccentuatedCharsLower(e.toLocaleLowerCase());return s.includes(r)}getFormConfig(t,i,e=!1){let s=this.getFieldsList(void 0,e);return i&&(s=s.filter((i=>{if(t){const e=t.getField(i.name);if(e&&e.readOnly)return!1}return!i.readOnly}))),Object.assign(Object.assign({},this._config),{fields:s})}setConfig(t){this.isLoaded=!0;const{cardsState:i,summary:e,defaultVars:s}=this._config||{};this._config=Object.assign({},t),i&&(this._config.cardsState=i),e&&(this._config.summary=e),s&&(this._config.defaultVars=s),this._onConfigChange&&this._onConfigChange(Object.assign({},this._config))}getConfig(t,i){return this.getFormConfig(t,i)}getFormConfigFetcher(){return null==this._formConfigFetcher&&(this._formConfigFetcher=new s),this._formConfigFetcher}async fetchUserAvailableConfigs(){return null!=this._configName?Promise.resolve(void 0):this.getFormConfigFetcher().fetchUserAvailableConfigs(this._configName,this._resourceID)}async fetchLegacyConfig(){return this.getFormConfigFetcher().fetchLegacyConfig(this._configName,this._resourceID)}async fetchDefaultConfig(){return this.getFormConfigFetcher().fetchDefaultConfig(this._configName,this._resourceID)}parseObjectList(t){return t?Array.isArray(t)?t:[t]:[]}buildFormMetadataUITabs(t,i=!1){var e,s,n;const l=this.hasConfig(t);if(!i&&(!this._dataUnit||l))return t;(t=this.getFormConfig(this._dataUnit,!1,!0)).tabs=this.parseObjectList(t.tabs),t.emptyConfig=!1,t.defaultConfiguration=!0;const o=null!==(s=null===(e=this._dataUnit.metadata)||void 0===e?void 0:e.fields)&&void 0!==s?s:[];for(const i of o){const e=t.fields.find((t=>t.name===i.name)),s=null===(n=i.properties)||void 0===n?void 0:n.UITabName;s&&s!==r.main&&(t.tabs.some((t=>t.label===s))||t.tabs.push({label:s,name:s,order:0,visible:!0}),e&&(e.tab=s))}return t}}export{n as S}
Binary file
@@ -0,0 +1 @@
1
+ export{S as snk_guides_viewer}from"./p-5d9d7196.js";import"./p-d8d8169b.js";import"@sankhyalabs/core";import"@sankhyalabs/core/dist/dataunit/DataUnit";import"@sankhyalabs/ezui/dist/collection/utils";import"@sankhyalabs/ezui/dist/collection/utils/form";import"./p-cdda05e3.js";import"./p-8d884fab.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-403c0168.js";import"./p-0f3698af.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"./p-42e248cd.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";import"./p-ff1990ad.js";import"./p-1273039f.js";import"./p-9019a32f.js";import"./p-50735892.js";import"./p-a17e9ecd.js";import"./p-b987e15d.js";import"./p-55798617.js";import"./p-1a0caadb.js";
Binary file
@@ -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-328236dd.js";import"./p-ccd1ab5b.js";import"./p-0f3698af.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-50dd4ef8.js";import"./p-ff1990ad.js";import"./p-02459408.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-403c0168.js";import"./p-cdda05e3.js";import"./p-0f3698af.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-42e248cd.js";import"./p-ff1990ad.js";import"./p-1273039f.js";import"./p-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 +1 @@
1
- import{r as i,c as t,h as e,F as s,H as n}from"./p-d8d8169b.js";import{StringUtils as l,ObjectUtils as a,ApplicationContext as r,ElementIDUtils as o}from"@sankhyalabs/core";import{P as h}from"./p-988afe78.js";import{P as d,C as c}from"./p-4157ea10.js";import{ApplicationUtils as f}from"@sankhyalabs/ezui/dist/collection/utils";import{a as p,D as z}from"./p-84345e7a.js";import{s as u}from"./p-55798617.js";import"./p-ff1990ad.js";import"./p-02459408.js";import"./p-ccd1ab5b.js";import"./p-8d884fab.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";const m=class{constructor(e){i(this,e),this.ezCancel=t(this,"ezCancel",7),this.ezSave=t(this,"ezSave",7),this.ezAfterSave=t(this,"ezAfterSave",7),this._personalizedFilterFetcher=new d,this._filterMetadataStorage=new Map,this._dataSourceFetcher={fetchData:async i=>{let t=null==i?void 0:i.uri;if(l.isEmpty(t)&&(t=this.entityUri),!this._filterMetadataStorage.has(t)){const i=await this._personalizedFilterFetcher.loadFields(t);this._filterMetadataStorage.set(t,i)}return this._filterMetadataStorage.get(t)}},this._filterAssistentMode=!0,this._filterAssistent=void 0,this.messagesBuilder=void 0,this.entityUri=void 0,this.filterId=void 0,this.configName=void 0,this.resourceID=void 0,this.isDefaultFilter=!1}async createPersonalizedFilter(){const i={name:"",active:!0,expression:"",parameters:[],assistent:{id:l.generateUUID(),items:[{id:l.generateUUID(),entityName:"",fieldName:"",description:"",fieldLabel:this.getMessage("snkPersonalizedFilter.info.labelDefaultValue"),type:void 0,expression:void 0,operand:void 0,paramVariable:!1,value:void 0,systemConfig:null,userConfig:null}],childrenGroups:[],operand:p.AND}};this.isDefaultFilter&&this.buildDataDefaultFilter(i),this._originalFilterAssistent=a.copy(i),this._filterAssistent=a.copy(i)}loadFilter(i,t){null!=i&&t!=i&&null!=this.resourceID&&(i!==z.id?c.loadPersonalizedFilter(i,this.resourceID,this.configName).then((i=>{const t=this.applyDefaultValues(i);this._filterAssistent=t,this._originalFilterAssistent=a.copy(t),this._filterAssistentMode=this._filterAssistent.hasOwnProperty("assistent")&&null!=this._filterAssistent.assistent})):c.loadDefaultFilter(i,this.resourceID,this.configName).then((i=>{const t=this.applyDefaultValues(i);this._filterAssistent=t,this._originalFilterAssistent=a.copy(t),this._filterAssistentMode=this._filterAssistent.hasOwnProperty("assistent")&&null!=this._filterAssistent.assistent})))}componentWillLoad(){var i;null==u.get(`filterFieldsDataSource.${this.entityUri}`)&&u.set(`filterFieldsDataSource.${this.entityUri}`,this._dataSourceFetcher),this.messagesBuilder||(this._application=r.getContextValue("__SNK__APPLICATION__"),this.messagesBuilder=null===(i=this._application)||void 0===i?void 0:i.messagesBuilder),this.loadFilter(this.filterId,void 0)}componentDidRender(){var i;null===(i=this._viewStackRef)||void 0===i||i.show(this._filterAssistentMode?0:1),this._elButtonMode&&this._elButtonMode.setAttribute(o.DATA_ELEMENT_ID_ATTRIBUTE_NAME,o.getInternalIDInfo(this._filterAssistentMode?"advancedMode_ezButton":"assistentMode_ezButton"))}buildDataDefaultFilter(i){i.name=z.name,i.id=z.id}getMessage(i,t){return this._application.messagesBuilder.getMessage(i,t)}async saveFilter(){let i;i=this.isDefaultFilter?await c.saveDefaultFilter(this._filterAssistent,this.resourceID,this.configName):await c.savePersonalizedFilter(this._filterAssistent,this.resourceID,this.configName),this._elButtonSave.enabled=!1,f.info(this.getMessage(`snkPersonalizedFilter.${this._filterAssistent.id?"confirmEdit":"confirmSave"}.title`),{iconName:"check"});const t=Object.assign(Object.assign({},i),this._filterAssistent);t.parameters=h.buildVariableParameters(this._filterAssistent.assistent),this._originalFilterAssistent=a.copy(t),this._filterAssistent=a.copy(t),this.ezAfterSave.emit()}removeFilter(){c.removePersonalizedFilter(this._filterAssistent,this.resourceID,this.configName)}hasChangesToSave(){return JSON.stringify(this._filterAssistent)===JSON.stringify(this._originalFilterAssistent)}async handleSave(){if(this._filterAssistentMode){if(!h.validateFields(this._filterAssistent.assistent)||!this._filterAssistent.name)return this._application.error(this.getMessage("snkPersonalizedFilter.error.title"),this.getMessage("snkPersonalizedFilter.error.description"));this.saveAssistentMode()}else{if(!this._filterAssistent.expression||!this._filterAssistent.name)return this._application.error(this.getMessage("snkPersonalizedFilter.error.title"),this.getMessage("snkPersonalizedFilter.error.description"));if(!await this.validateExpressionBeforeSaving())return;this.saveAdvancedMode()}}saveAssistentMode(){const{assistent:i,expression:t}=this._filterAssistent,e=i?h.buildGroupExpression(i):t;this._filterAssistent.expression=e,this.ezSave.emit(e),this.saveFilter()}saveAdvancedMode(){this._originalFilterAssistent.expression!==this._filterAssistent.expression&&this._filterAssistent.assistent?f.confirm(this.getMessage("snkPersonalizedFilter.confirmSaveModeAdvanced.title"),this.getMessage("snkPersonalizedFilter.confirmSaveModeAdvanced.description")).then((i=>{i&&this.saveAndTransformToAdvancedMode()})):this._filterAssistent.assistent?this.saveAssistentMode():this.saveAndTransformToAdvancedMode()}saveAndTransformToAdvancedMode(){this._filterAssistent.assistent=void 0,this.ezSave.emit(this._filterAssistent.expression),this.saveFilter()}async validateExpressionBeforeSaving(){const{valid:i,message:t=""}=await this._personalizedFilterFetcher.validatePersonalizedFilter(this.entityUri,this._filterAssistent.expression);return i||this._application.error(this.getMessage("snkPersonalizedFilter.errorValidation.title"),t.replace(/.*Exception: /,"")),i}handleCancel(){if(this.hasChangesToSave())return this.ezCancel.emit();f.confirm(this.getMessage("snkPersonalizedFilter.confirmCancel.title"),this.getMessage("snkPersonalizedFilter.confirmCancel.description")).then((i=>{var t;i&&(this._filterAssistent=a.copy(null!==(t=this._originalFilterAssistent)&&void 0!==t?t:{}),this.ezCancel.emit(),this._elButtonSave.enabled=!1)}))}handleTitleChange(i){this._filterAssistent=Object.assign(Object.assign({},this._filterAssistent),{name:i}),this._elButtonSave.enabled=!this.hasChangesToSave()}applyDefaultValues(i){return this.addLabelToItems(i),this.addFilterGroupCondition(i),i}addFilterGroupCondition(i){i.assistent&&!i.assistent.operand&&(i.assistent.operand=p.AND)}addLabelToItems(i){i.assistent&&i.assistent.items&&i.assistent.items.length>0&&i.assistent.items.forEach((t=>{if(null==t.fieldLabel){const e=(i.parameters||[]).find((i=>i.fieldName===t.fieldName));e&&(t.fieldLabel=e.label)}}))}handleExpressionChangeAdvancedMode(i){this._filterAssistent=Object.assign(Object.assign({},this._filterAssistent),{expression:i}),this._elButtonSave.enabled=!this.hasChangesToSave()}handleChangeFilterAssistentMode(i){this._elButtonSave.enabled=!this.hasChangesToSave(),this._filterAssistent=Object.assign({},i)}selectField(i){if(!("name"in i))return;const t=this.buildExpression(i.entityName,i.name,i.entityPath);this._elAdvancedMode.querySelector("ez-text-area").appendTextToSelection(t)}buildExpression(i,t,e){return e.length>0&&e.shift(),e.length>0?`${e.join("->")}->${t}`:`${i}.${t}`}onAddField(i){this._elAdvancedMode.querySelector("ez-text-area").setFocus(),i.setBlur(),this._elFilterFieldSearch&&this._elFilterFieldSearch.show(i,{horizontalGap:0,verticalGap:12,fromRight:!0})}renderButtonAddField(){if(!this._filterAssistentMode)return e(s,null,e("ez-button",{class:"snk-personalized-filter__button-mode",label:this.getMessage("snkPersonalizedFilter.info.addField"),enabled:!0,onClick:i=>this.onAddField(i.target)},e("ez-icon",{class:"ez-padding-right--small",slot:"leftIcon",iconName:"plus"})),e("snk-filter-field-search",{class:"ez-padding-left--medium",ref:i=>this._elFilterFieldSearch=i,onEzSelectFilterItem:i=>this.selectField(i.detail),fieldsDataSource:this._dataSourceFetcher}))}buildContainerPersonalizedFilter(){return e("ez-view-stack",{ref:i=>this._viewStackRef=i},e("stack-item",null,this._filterAssistentMode&&e("snk-filter-assistent-mode",{filterAssistent:this._filterAssistent,messagesBuilder:this.messagesBuilder,filterId:this.filterId,entityUri:this.entityUri,application:this._application,onEzChangeFilter:i=>this.handleChangeFilterAssistentMode(i.detail),isDefaultFilter:this.isDefaultFilter})),e("stack-item",null,e("snk-filter-advanced-mode",{ref:i=>this._elAdvancedMode=i,filterAssistent:this._filterAssistent,application:this._application,onEzExpressionChange:i=>this.handleExpressionChangeAdvancedMode(i.detail)})))}handleModeChange(){var i,t;if(this._filterAssistentMode)f.confirm(this.getMessage("snkPersonalizedFilter.confirmChangeModeAssistent.title"),this.getMessage("snkPersonalizedFilter.confirmChangeModeAssistent.description")).then((i=>{if(i&&(this._filterAssistentMode=!this._filterAssistentMode,!this.hasChangesToSave())){const i=h.buildGroupExpression(this._filterAssistent.assistent);this._filterAssistent.expression=i,this._elButtonSave.enabled=!this.hasChangesToSave()}}));else if((null===(i=this._filterAssistent)||void 0===i?void 0:i.expression)===(null===(t=this._originalFilterAssistent)||void 0===t?void 0:t.expression))this._filterAssistentMode=!this._filterAssistentMode;else{const i=this._filterAssistent.expression,t=h.buildGroupExpression(this._filterAssistent.assistent);i!==t?f.confirm(this.getMessage("snkPersonalizedFilter.confirmChangeModeAdvanced.title"),this.getMessage("snkPersonalizedFilter.confirmChangeModeAdvanced.description")).then((i=>{i&&(this._filterAssistent=Object.assign(Object.assign({},this._filterAssistent),{expression:t}),this._filterAssistentMode=!this._filterAssistentMode)})):this._filterAssistentMode=!this._filterAssistentMode}}buildTitle(){return this.getMessage(this.isDefaultFilter&&!this.filterId?"snkPersonalizedFilter.info.titleCreateDefault":this.isDefaultFilter&&this.filterId?"snkPersonalizedFilter.info.titleEditDefault":this.filterId?"snkPersonalizedFilter.info.titleEdit":"snkPersonalizedFilter.info.titleAdd")}render(){var i,t,s,l;if((null===(i=this._filterAssistent)||void 0===i?void 0:i.assistent)||!this._filterAssistentMode)return e(n,null,e("div",{class:"snk-personalized-filter"},e("div",null,e("snk-simple-bar",{label:this.buildTitle(),onExit:()=>this.handleCancel()},e("div",{class:"snk-personalized-filter__header-actions",slot:"rightSlot"},e("ez-button",{size:"small",label:this.getMessage("snkPersonalizedFilter.info.labelCancel"),onClick:()=>this.handleCancel()}),e("ez-button",{size:"small",ref:i=>this._elButtonSave=i,enabled:!1,class:"ez-button--primary",label:this.getMessage("snkPersonalizedFilter.info.labelSave"),onClick:this.handleSave.bind(this)})))),e("div",{class:"ez-box ez-margin-bottom--medium ez-box__main"},e("div",{class:"ez-box__container"},e("div",{class:"ez-flex ez-flex--column ez-size-width--full"},e("div",{class:"ez-flex"},e("ez-tooltip",{message:this.getMessage("snkPersonalizedFilter.info.textInputDisabled"),active:this.isDefaultFilter},e("ez-text-input",{class:"ez-padding-right--medium",label:this.getMessage("snkPersonalizedFilter.info.labelNameFilter"),value:null===(t=this._filterAssistent)||void 0===t?void 0:t.name,onEzChange:i=>this.handleTitleChange(i.detail),enabled:!this.isDefaultFilter})),this.renderButtonAddField(),e("ez-button",{ref:i=>this._elButtonMode=i,class:"snk-personalized-filter__button-mode",label:this.getMessage(this._filterAssistentMode?"snkPersonalizedFilter.info.activeModeAdvanced":"snkPersonalizedFilter.info.activeModeAssistent"),onClick:()=>this.handleModeChange(),"data-tooltip":this._filterAssistentMode||(null===(s=this._filterAssistent)||void 0===s?void 0:s.assistent)?void 0:this.getMessage("snkPersonalizedFilter.info.tooltipDisabledAssistentMode"),"data-flow":"bottom",enabled:!this._filterAssistent.name||Boolean(this._filterAssistentMode||(null===(l=this._filterAssistent)||void 0===l?void 0:l.assistent))})),this.buildContainerPersonalizedFilter())))))}static get watchers(){return{filterId:["loadFilter"]}}};m.style=".sc-snk-personalized-filter-h{display:flex;height:100%;padding:var(--space--large, 24px);--snk-personalized-filter--width:100%;--snk-personalized-filter--height:100%;--snk-personalized-filter--background-color-line:var(--color--disable-secondary);--snk-personalized-filter--margin-line:var(--border--radius-medium, 12px)}.snk-personalized-filter.sc-snk-personalized-filter{height:var(--snk-personalized-filter--width);width:var(--snk-personalized-filter--height)}.snk-personalized-filter__header-actions.sc-snk-personalized-filter{display:flex;gap:var(--space--medium)}.snk-personalized-filter__group.sc-snk-personalized-filter{flex:1}.snk-personalized-filter__expression-input--line.sc-snk-personalized-filter{width:100%;height:2px;background-color:var(--snk-personalized-filter--background-color-line);margin-top:var(--snk-personalized-filter--margin-line);margin-bottom:var(--snk-personalized-filter--margin-line)}.ez-box__main.sc-snk-personalized-filter{height:90%}.snk-personalized-filter__button-mode.sc-snk-personalized-filter{height:35px}";export{m as snk_personalized_filter}
1
+ import{r as i,c as t,h as e,F as s,H as n}from"./p-d8d8169b.js";import{StringUtils as l,ObjectUtils as a,ApplicationContext as r,ElementIDUtils as o}from"@sankhyalabs/core";import{P as h}from"./p-988afe78.js";import{P as d,C as c}from"./p-a17e9ecd.js";import{ApplicationUtils as f}from"@sankhyalabs/ezui/dist/collection/utils";import{a as p,D as z}from"./p-84345e7a.js";import{s as u}from"./p-55798617.js";import"./p-ff1990ad.js";import"./p-1273039f.js";import"./p-cdda05e3.js";import"./p-8d884fab.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";const m=class{constructor(e){i(this,e),this.ezCancel=t(this,"ezCancel",7),this.ezSave=t(this,"ezSave",7),this.ezAfterSave=t(this,"ezAfterSave",7),this._personalizedFilterFetcher=new d,this._filterMetadataStorage=new Map,this._dataSourceFetcher={fetchData:async i=>{let t=null==i?void 0:i.uri;if(l.isEmpty(t)&&(t=this.entityUri),!this._filterMetadataStorage.has(t)){const i=await this._personalizedFilterFetcher.loadFields(t);this._filterMetadataStorage.set(t,i)}return this._filterMetadataStorage.get(t)}},this._filterAssistentMode=!0,this._filterAssistent=void 0,this.messagesBuilder=void 0,this.entityUri=void 0,this.filterId=void 0,this.configName=void 0,this.resourceID=void 0,this.isDefaultFilter=!1}async createPersonalizedFilter(){const i={name:"",active:!0,expression:"",parameters:[],assistent:{id:l.generateUUID(),items:[{id:l.generateUUID(),entityName:"",fieldName:"",description:"",fieldLabel:this.getMessage("snkPersonalizedFilter.info.labelDefaultValue"),type:void 0,expression:void 0,operand:void 0,paramVariable:!1,value:void 0,systemConfig:null,userConfig:null}],childrenGroups:[],operand:p.AND}};this.isDefaultFilter&&this.buildDataDefaultFilter(i),this._originalFilterAssistent=a.copy(i),this._filterAssistent=a.copy(i)}loadFilter(i,t){null!=i&&t!=i&&null!=this.resourceID&&(i!==z.id?c.loadPersonalizedFilter(i,this.resourceID,this.configName).then((i=>{const t=this.applyDefaultValues(i);this._filterAssistent=t,this._originalFilterAssistent=a.copy(t),this._filterAssistentMode=this._filterAssistent.hasOwnProperty("assistent")&&null!=this._filterAssistent.assistent})):c.loadDefaultFilter(i,this.resourceID,this.configName).then((i=>{const t=this.applyDefaultValues(i);this._filterAssistent=t,this._originalFilterAssistent=a.copy(t),this._filterAssistentMode=this._filterAssistent.hasOwnProperty("assistent")&&null!=this._filterAssistent.assistent})))}componentWillLoad(){var i;null==u.get(`filterFieldsDataSource.${this.entityUri}`)&&u.set(`filterFieldsDataSource.${this.entityUri}`,this._dataSourceFetcher),this.messagesBuilder||(this._application=r.getContextValue("__SNK__APPLICATION__"),this.messagesBuilder=null===(i=this._application)||void 0===i?void 0:i.messagesBuilder),this.loadFilter(this.filterId,void 0)}componentDidRender(){var i;null===(i=this._viewStackRef)||void 0===i||i.show(this._filterAssistentMode?0:1),this._elButtonMode&&this._elButtonMode.setAttribute(o.DATA_ELEMENT_ID_ATTRIBUTE_NAME,o.getInternalIDInfo(this._filterAssistentMode?"advancedMode_ezButton":"assistentMode_ezButton"))}buildDataDefaultFilter(i){i.name=z.name,i.id=z.id}getMessage(i,t){return this._application.messagesBuilder.getMessage(i,t)}async saveFilter(){let i;i=this.isDefaultFilter?await c.saveDefaultFilter(this._filterAssistent,this.resourceID,this.configName):await c.savePersonalizedFilter(this._filterAssistent,this.resourceID,this.configName),this._elButtonSave.enabled=!1,f.info(this.getMessage(`snkPersonalizedFilter.${this._filterAssistent.id?"confirmEdit":"confirmSave"}.title`),{iconName:"check"});const t=Object.assign(Object.assign({},i),this._filterAssistent);t.parameters=h.buildVariableParameters(this._filterAssistent.assistent),this._originalFilterAssistent=a.copy(t),this._filterAssistent=a.copy(t),this.ezAfterSave.emit()}removeFilter(){c.removePersonalizedFilter(this._filterAssistent,this.resourceID,this.configName)}hasChangesToSave(){return JSON.stringify(this._filterAssistent)===JSON.stringify(this._originalFilterAssistent)}async handleSave(){if(this._filterAssistentMode){if(!h.validateFields(this._filterAssistent.assistent)||!this._filterAssistent.name)return this._application.error(this.getMessage("snkPersonalizedFilter.error.title"),this.getMessage("snkPersonalizedFilter.error.description"));this.saveAssistentMode()}else{if(!this._filterAssistent.expression||!this._filterAssistent.name)return this._application.error(this.getMessage("snkPersonalizedFilter.error.title"),this.getMessage("snkPersonalizedFilter.error.description"));if(!await this.validateExpressionBeforeSaving())return;this.saveAdvancedMode()}}saveAssistentMode(){const{assistent:i,expression:t}=this._filterAssistent,e=i?h.buildGroupExpression(i):t;this._filterAssistent.expression=e,this.ezSave.emit(e),this.saveFilter()}saveAdvancedMode(){this._originalFilterAssistent.expression!==this._filterAssistent.expression&&this._filterAssistent.assistent?f.confirm(this.getMessage("snkPersonalizedFilter.confirmSaveModeAdvanced.title"),this.getMessage("snkPersonalizedFilter.confirmSaveModeAdvanced.description")).then((i=>{i&&this.saveAndTransformToAdvancedMode()})):this._filterAssistent.assistent?this.saveAssistentMode():this.saveAndTransformToAdvancedMode()}saveAndTransformToAdvancedMode(){this._filterAssistent.assistent=void 0,this.ezSave.emit(this._filterAssistent.expression),this.saveFilter()}async validateExpressionBeforeSaving(){const{valid:i,message:t=""}=await this._personalizedFilterFetcher.validatePersonalizedFilter(this.entityUri,this._filterAssistent.expression);return i||this._application.error(this.getMessage("snkPersonalizedFilter.errorValidation.title"),t.replace(/.*Exception: /,"")),i}handleCancel(){if(this.hasChangesToSave())return this.ezCancel.emit();f.confirm(this.getMessage("snkPersonalizedFilter.confirmCancel.title"),this.getMessage("snkPersonalizedFilter.confirmCancel.description")).then((i=>{var t;i&&(this._filterAssistent=a.copy(null!==(t=this._originalFilterAssistent)&&void 0!==t?t:{}),this.ezCancel.emit(),this._elButtonSave.enabled=!1)}))}handleTitleChange(i){this._filterAssistent=Object.assign(Object.assign({},this._filterAssistent),{name:i}),this._elButtonSave.enabled=!this.hasChangesToSave()}applyDefaultValues(i){return this.addLabelToItems(i),this.addFilterGroupCondition(i),i}addFilterGroupCondition(i){i.assistent&&!i.assistent.operand&&(i.assistent.operand=p.AND)}addLabelToItems(i){i.assistent&&i.assistent.items&&i.assistent.items.length>0&&i.assistent.items.forEach((t=>{if(null==t.fieldLabel){const e=(i.parameters||[]).find((i=>i.fieldName===t.fieldName));e&&(t.fieldLabel=e.label)}}))}handleExpressionChangeAdvancedMode(i){this._filterAssistent=Object.assign(Object.assign({},this._filterAssistent),{expression:i}),this._elButtonSave.enabled=!this.hasChangesToSave()}handleChangeFilterAssistentMode(i){this._elButtonSave.enabled=!this.hasChangesToSave(),this._filterAssistent=Object.assign({},i)}selectField(i){if(!("name"in i))return;const t=this.buildExpression(i.entityName,i.name,i.entityPath);this._elAdvancedMode.querySelector("ez-text-area").appendTextToSelection(t)}buildExpression(i,t,e){return e.length>0&&e.shift(),e.length>0?`${e.join("->")}->${t}`:`${i}.${t}`}onAddField(i){this._elAdvancedMode.querySelector("ez-text-area").setFocus(),i.setBlur(),this._elFilterFieldSearch&&this._elFilterFieldSearch.show(i,{horizontalGap:0,verticalGap:12,fromRight:!0})}renderButtonAddField(){if(!this._filterAssistentMode)return e(s,null,e("ez-button",{class:"snk-personalized-filter__button-mode",label:this.getMessage("snkPersonalizedFilter.info.addField"),enabled:!0,onClick:i=>this.onAddField(i.target)},e("ez-icon",{class:"ez-padding-right--small",slot:"leftIcon",iconName:"plus"})),e("snk-filter-field-search",{class:"ez-padding-left--medium",ref:i=>this._elFilterFieldSearch=i,onEzSelectFilterItem:i=>this.selectField(i.detail),fieldsDataSource:this._dataSourceFetcher}))}buildContainerPersonalizedFilter(){return e("ez-view-stack",{ref:i=>this._viewStackRef=i},e("stack-item",null,this._filterAssistentMode&&e("snk-filter-assistent-mode",{filterAssistent:this._filterAssistent,messagesBuilder:this.messagesBuilder,filterId:this.filterId,entityUri:this.entityUri,application:this._application,onEzChangeFilter:i=>this.handleChangeFilterAssistentMode(i.detail),isDefaultFilter:this.isDefaultFilter})),e("stack-item",null,e("snk-filter-advanced-mode",{ref:i=>this._elAdvancedMode=i,filterAssistent:this._filterAssistent,application:this._application,onEzExpressionChange:i=>this.handleExpressionChangeAdvancedMode(i.detail)})))}handleModeChange(){var i,t;if(this._filterAssistentMode)f.confirm(this.getMessage("snkPersonalizedFilter.confirmChangeModeAssistent.title"),this.getMessage("snkPersonalizedFilter.confirmChangeModeAssistent.description")).then((i=>{if(i&&(this._filterAssistentMode=!this._filterAssistentMode,!this.hasChangesToSave())){const i=h.buildGroupExpression(this._filterAssistent.assistent);this._filterAssistent.expression=i,this._elButtonSave.enabled=!this.hasChangesToSave()}}));else if((null===(i=this._filterAssistent)||void 0===i?void 0:i.expression)===(null===(t=this._originalFilterAssistent)||void 0===t?void 0:t.expression))this._filterAssistentMode=!this._filterAssistentMode;else{const i=this._filterAssistent.expression,t=h.buildGroupExpression(this._filterAssistent.assistent);i!==t?f.confirm(this.getMessage("snkPersonalizedFilter.confirmChangeModeAdvanced.title"),this.getMessage("snkPersonalizedFilter.confirmChangeModeAdvanced.description")).then((i=>{i&&(this._filterAssistent=Object.assign(Object.assign({},this._filterAssistent),{expression:t}),this._filterAssistentMode=!this._filterAssistentMode)})):this._filterAssistentMode=!this._filterAssistentMode}}buildTitle(){return this.getMessage(this.isDefaultFilter&&!this.filterId?"snkPersonalizedFilter.info.titleCreateDefault":this.isDefaultFilter&&this.filterId?"snkPersonalizedFilter.info.titleEditDefault":this.filterId?"snkPersonalizedFilter.info.titleEdit":"snkPersonalizedFilter.info.titleAdd")}render(){var i,t,s,l;if((null===(i=this._filterAssistent)||void 0===i?void 0:i.assistent)||!this._filterAssistentMode)return e(n,null,e("div",{class:"snk-personalized-filter"},e("div",null,e("snk-simple-bar",{label:this.buildTitle(),onExit:()=>this.handleCancel()},e("div",{class:"snk-personalized-filter__header-actions",slot:"rightSlot"},e("ez-button",{size:"small",label:this.getMessage("snkPersonalizedFilter.info.labelCancel"),onClick:()=>this.handleCancel()}),e("ez-button",{size:"small",ref:i=>this._elButtonSave=i,enabled:!1,class:"ez-button--primary",label:this.getMessage("snkPersonalizedFilter.info.labelSave"),onClick:this.handleSave.bind(this)})))),e("div",{class:"ez-box ez-margin-bottom--medium ez-box__main"},e("div",{class:"ez-box__container"},e("div",{class:"ez-flex ez-flex--column ez-size-width--full"},e("div",{class:"ez-flex"},e("ez-tooltip",{message:this.getMessage("snkPersonalizedFilter.info.textInputDisabled"),active:this.isDefaultFilter},e("ez-text-input",{class:"ez-padding-right--medium",label:this.getMessage("snkPersonalizedFilter.info.labelNameFilter"),value:null===(t=this._filterAssistent)||void 0===t?void 0:t.name,onEzChange:i=>this.handleTitleChange(i.detail),enabled:!this.isDefaultFilter})),this.renderButtonAddField(),e("ez-button",{ref:i=>this._elButtonMode=i,class:"snk-personalized-filter__button-mode",label:this.getMessage(this._filterAssistentMode?"snkPersonalizedFilter.info.activeModeAdvanced":"snkPersonalizedFilter.info.activeModeAssistent"),onClick:()=>this.handleModeChange(),"data-tooltip":this._filterAssistentMode||(null===(s=this._filterAssistent)||void 0===s?void 0:s.assistent)?void 0:this.getMessage("snkPersonalizedFilter.info.tooltipDisabledAssistentMode"),"data-flow":"bottom",enabled:!this._filterAssistent.name||Boolean(this._filterAssistentMode||(null===(l=this._filterAssistent)||void 0===l?void 0:l.assistent))})),this.buildContainerPersonalizedFilter())))))}static get watchers(){return{filterId:["loadFilter"]}}};m.style=".sc-snk-personalized-filter-h{display:flex;height:100%;padding:var(--space--large, 24px);--snk-personalized-filter--width:100%;--snk-personalized-filter--height:100%;--snk-personalized-filter--background-color-line:var(--color--disable-secondary);--snk-personalized-filter--margin-line:var(--border--radius-medium, 12px)}.snk-personalized-filter.sc-snk-personalized-filter{height:var(--snk-personalized-filter--width);width:var(--snk-personalized-filter--height)}.snk-personalized-filter__header-actions.sc-snk-personalized-filter{display:flex;gap:var(--space--medium)}.snk-personalized-filter__group.sc-snk-personalized-filter{flex:1}.snk-personalized-filter__expression-input--line.sc-snk-personalized-filter{width:100%;height:2px;background-color:var(--snk-personalized-filter--background-color-line);margin-top:var(--snk-personalized-filter--margin-line);margin-bottom:var(--snk-personalized-filter--margin-line)}.ez-box__main.sc-snk-personalized-filter{height:90%}.snk-personalized-filter__button-mode.sc-snk-personalized-filter{height:35px}";export{m as snk_personalized_filter}