@sankhyalabs/sankhyablocks 8.16.0-dev.12 → 8.16.0-dev.120

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 (641) hide show
  1. package/dist/cjs/ClientSideExporterProvider-0ce2bcd9.js +378 -0
  2. package/dist/cjs/{ConfigStorage-e49214c6.js → ConfigStorage-48ba265b.js} +47 -19
  3. package/dist/cjs/{DataFetcher-77729a93.js → DataFetcher-1afdb18e.js} +231 -84
  4. package/dist/cjs/FormConfigHelper-c664dbae.js +260 -0
  5. package/dist/cjs/{RecordIDUtils-3735135c.js → GetSelectedRecordsIDsInfo-bd50caf1.js} +10 -10
  6. package/dist/cjs/IFetchDataExporterParams-e78ec415.js +8 -0
  7. package/dist/cjs/ISave-c76e2c51.js +397 -0
  8. package/dist/cjs/{PersonalizedFilterUtils-0184ffbb.js → PersonalizedFilterUtils-7259cf65.js} +1 -1
  9. package/dist/cjs/{SnkFormConfigManager-beebf47a.js → SnkFormConfigManager-aa4631bd.js} +74 -17
  10. package/dist/cjs/{SnkMessageBuilder-cceebbae.js → SnkMessageBuilder-e3b7850b.js} +67 -30
  11. package/dist/cjs/{auth-fetcher-29bb791c.js → auth-fetcher-1687ac0a.js} +1 -1
  12. package/dist/cjs/config-header.cjs.entry.js +79 -0
  13. package/dist/cjs/configs-button.cjs.entry.js +61 -0
  14. package/dist/cjs/{constants-35ddd366.js → constants-6d82e405.js} +18 -38
  15. package/dist/cjs/{dataunit-fetcher-d4873076.js → dataunit-fetcher-a723f0dc.js} +225 -175
  16. package/dist/cjs/default-filters-a09bf82b.js +8 -0
  17. package/dist/cjs/field-config_2.cjs.entry.js +324 -0
  18. package/dist/cjs/fields-layout.cjs.entry.js +341 -0
  19. package/dist/cjs/fields-selector.cjs.entry.js +74 -0
  20. package/dist/cjs/{filter-type.enum-b14ce507.js → filter-type.enum-2bb46d2a.js} +1 -0
  21. package/dist/cjs/{form-config-fetcher-feb08214.js → form-config-fetcher-40d3f752.js} +56 -2
  22. package/dist/cjs/guides-configurator.cjs.entry.js +164 -0
  23. package/dist/cjs/{index-102ba62d.js → index-0ad2baeb.js} +4 -5
  24. package/dist/cjs/{index-f9e81701.js → index-1cf293c1.js} +46 -40
  25. package/dist/cjs/{index-c5771aba.js → index-62760a9c.js} +5 -0
  26. package/dist/cjs/{index-1dfc7a6e.js → index-e3e39724.js} +5 -0
  27. package/dist/cjs/loader.cjs.js +2 -2
  28. package/dist/cjs/pesquisa-grid_2.cjs.entry.js +155 -0
  29. package/dist/cjs/sankhyablocks.cjs.js +2 -2
  30. package/dist/cjs/{snk-actions-button_4.cjs.entry.js → snk-actions-button_8.cjs.entry.js} +265 -47
  31. package/dist/cjs/snk-actions-form.cjs.entry.js +1 -1
  32. package/dist/cjs/snk-application.cjs.entry.js +472 -80
  33. package/dist/cjs/snk-attach.cjs.entry.js +93 -52
  34. package/dist/cjs/snk-client-confirm.cjs.entry.js +1 -1
  35. package/dist/cjs/snk-configurator.cjs.entry.js +11 -4
  36. package/dist/cjs/snk-crud.cjs.entry.js +60 -86
  37. package/dist/cjs/snk-custom-slot-elements.cjs.entry.js +1 -1
  38. package/dist/cjs/snk-data-exporter.cjs.entry.js +37 -29
  39. package/dist/cjs/{snk-data-unit-8af43aa3.js → snk-data-unit-3684c96e.js} +276 -38
  40. package/dist/cjs/snk-data-unit.cjs.entry.js +6 -6
  41. package/dist/cjs/snk-default-filter.cjs.entry.js +77 -0
  42. package/dist/cjs/snk-detail-view.cjs.entry.js +71 -19
  43. package/dist/cjs/snk-entity-list.cjs.entry.js +3 -8
  44. package/dist/cjs/snk-exporter-email-sender.cjs.entry.js +1 -1
  45. package/dist/cjs/snk-expression-group_2.cjs.entry.js +10 -8
  46. package/dist/cjs/snk-filter-advanced-mode_2.cjs.entry.js +5 -4
  47. package/dist/cjs/snk-filter-bar_4.cjs.entry.js +1492 -0
  48. package/dist/cjs/snk-filter-binary-select.cjs.entry.js +2 -2
  49. package/dist/cjs/snk-filter-checkbox-list.cjs.entry.js +2 -2
  50. package/dist/cjs/snk-filter-detail.cjs.entry.js +3 -3
  51. package/dist/cjs/snk-filter-field-search_2.cjs.entry.js +3 -3
  52. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +5 -5
  53. package/dist/cjs/snk-filter-multi-select.cjs.entry.js +1 -1
  54. package/dist/cjs/snk-filter-number.cjs.entry.js +2 -2
  55. package/dist/cjs/snk-filter-period.cjs.entry.js +1 -1
  56. package/dist/cjs/snk-filter-search.cjs.entry.js +19 -6
  57. package/dist/cjs/snk-filter-text.cjs.entry.js +3 -2
  58. package/dist/cjs/snk-form-summary.cjs.entry.js +1 -1
  59. package/dist/cjs/snk-form-view.cjs.entry.js +20 -8
  60. package/dist/cjs/snk-form_2.cjs.entry.js +433 -0
  61. package/dist/cjs/snk-grid.cjs.entry.js +136 -53
  62. package/dist/cjs/{snk-guides-viewer-aafc3073.js → snk-guides-viewer-edc0a00a.js} +151 -74
  63. package/dist/cjs/snk-guides-viewer.cjs.entry.js +14 -14
  64. package/dist/cjs/snk-personalized-filter-editor.cjs.entry.js +5 -5
  65. package/dist/cjs/snk-personalized-filter.cjs.entry.js +55 -20
  66. package/dist/cjs/snk-pesquisa.cjs.entry.js +117 -32
  67. package/dist/cjs/snk-print-selector.cjs.entry.js +2 -2
  68. package/dist/cjs/snk-simple-bar.cjs.entry.js +2 -2
  69. package/dist/cjs/snk-simple-crud.cjs.entry.js +239 -201
  70. package/dist/cjs/snk-taskbar.cjs.entry.js +85 -45
  71. package/dist/cjs/sortable.esm-9a110bb7.js +2668 -0
  72. package/dist/cjs/{taskbar-elements-9ad1f9c0.js → taskbar-elements-3b74cd21.js} +14 -3
  73. package/dist/cjs/{field-search-f56aa7d6.js → taskbar-processor-2fba34a8.js} +5 -36
  74. package/dist/cjs/teste-pesquisa.cjs.entry.js +1 -1
  75. package/dist/collection/collection-manifest.json +23 -43
  76. package/dist/collection/components/snk-actions-button/actions/index.js +16 -13
  77. package/dist/collection/components/snk-actions-button/interfaces/index.js +1 -0
  78. package/dist/collection/components/snk-actions-button/snk-actions-button.js +27 -26
  79. package/dist/collection/components/snk-application/errorhandler/snk-error-handler.js +5 -2
  80. package/dist/collection/components/snk-application/request-listener/DebouncedRequestListener.js +29 -0
  81. package/dist/collection/components/snk-application/request-listener/RequestListenerFactory.js +16 -0
  82. package/dist/collection/components/snk-application/request-listener/RequestListenerLoadingBar.js +52 -0
  83. package/dist/collection/components/snk-application/search-strategy/exec-prepared-search-plus.js +107 -0
  84. package/dist/collection/components/snk-application/snk-application.css +36 -0
  85. package/dist/collection/components/snk-application/snk-application.js +450 -72
  86. package/dist/collection/components/snk-attach/snk-attach.js +51 -16
  87. package/dist/collection/components/snk-attach/structure/builder/taskbar-builder.js +8 -4
  88. package/dist/collection/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.js +19 -18
  89. package/dist/collection/components/snk-configurator/snk-configurator.css +1 -1
  90. package/dist/collection/components/snk-configurator/snk-configurator.js +26 -1
  91. package/dist/collection/components/snk-crud/snk-crud.js +200 -76
  92. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.css +10 -1
  93. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +84 -6
  94. package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js +54 -7
  95. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.css +6 -6
  96. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +197 -81
  97. package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js +8 -8
  98. package/dist/collection/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.js +9 -2
  99. package/dist/collection/components/snk-data-exporter/interfaces/IExporterProvider.js +41 -10
  100. package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js +18 -6
  101. package/dist/collection/components/snk-data-exporter/providers/ServerSideExporterProvider.js +1 -1
  102. package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +10 -9
  103. package/dist/collection/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.js +4 -4
  104. package/dist/collection/components/snk-data-exporter/utils/ParserExport.js +1 -1
  105. package/dist/collection/components/snk-data-unit/MultipleUpdateHelper.js +128 -0
  106. package/dist/collection/components/snk-data-unit/snk-data-unit.js +156 -37
  107. package/dist/collection/components/snk-entity-list/snk-entity-list.js +2 -7
  108. package/dist/collection/components/snk-filter-bar/filter-item/dataunitfilter/data-unit-filter-builder.js +4 -4
  109. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.js +1 -1
  110. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-checkbox-list.js +1 -1
  111. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js +1 -1
  112. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-search.js +18 -5
  113. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js +2 -1
  114. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-personalized-filter-editor/snk-personalized-filter-editor.css +13 -0
  115. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-personalized-filter-editor/snk-personalized-filter-editor.js +3 -3
  116. package/dist/collection/components/snk-filter-bar/filter-item/filter-item-type-mask.enum.js +8 -0
  117. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +10 -4
  118. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.css +1 -1
  119. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +83 -13
  120. package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-default-filter/snk-default-filter.css +34 -0
  121. package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-default-filter/snk-default-filter.js +142 -0
  122. package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +3 -6
  123. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +144 -45
  124. package/dist/collection/components/snk-filter-bar/types/default-filters.js +6 -0
  125. package/dist/collection/components/snk-filter-bar/types/filter-type.enum.js +1 -0
  126. package/dist/collection/components/snk-filter-bar/utils/SnkFilterModalFactory.js +4 -4
  127. package/dist/collection/components/snk-form/snk-form.js +2 -2
  128. package/dist/collection/components/snk-form-config/FormConfigHelper.js +245 -0
  129. package/dist/collection/components/snk-form-config/SnkFormConfigManager.js +74 -17
  130. package/dist/collection/components/snk-form-config/config-header/config-header.css +18 -0
  131. package/dist/collection/components/snk-form-config/config-header/config-header.js +236 -0
  132. package/dist/collection/components/snk-form-config/config-header/configs-button/configs-button.css +41 -0
  133. package/dist/collection/components/snk-form-config/config-header/configs-button/configs-button.js +170 -0
  134. package/dist/collection/components/snk-form-config/field-item/field-config/field-config.css +21 -0
  135. package/dist/collection/components/snk-form-config/field-item/field-config/field-config.js +408 -0
  136. package/dist/collection/components/snk-form-config/field-item/field-item.css +108 -0
  137. package/dist/collection/components/snk-form-config/field-item/field-item.js +206 -0
  138. package/dist/collection/components/snk-form-config/fields-layout/fields-layout.css +133 -0
  139. package/dist/collection/components/snk-form-config/fields-layout/fields-layout.js +578 -0
  140. package/dist/collection/components/snk-form-config/fields-selector/fields-selector.css +38 -0
  141. package/dist/collection/components/snk-form-config/fields-selector/fields-selector.js +146 -0
  142. package/dist/collection/components/snk-form-config/guides-configurator/guides-configurator.css +132 -0
  143. package/dist/collection/components/snk-form-config/guides-configurator/guides-configurator.js +317 -0
  144. package/dist/collection/components/snk-form-config/snk-form-config.css +17 -225
  145. package/dist/collection/components/snk-form-config/snk-form-config.js +288 -939
  146. package/dist/collection/components/snk-grid/filtercolumn/SnkMultiSelectionListDataSource.js +2 -2
  147. package/dist/collection/components/snk-grid/snk-grid.css +9 -0
  148. package/dist/collection/components/snk-grid/snk-grid.js +307 -51
  149. package/dist/collection/components/snk-grid-config/snk-grid-config.css +1 -1
  150. package/dist/collection/components/snk-grid-config/snk-grid-config.js +2 -0
  151. package/dist/collection/components/snk-layout-form-config/snk-layout-form-config.css +3 -0
  152. package/dist/collection/components/snk-layout-form-config/snk-layout-form-config.js +73 -0
  153. package/dist/collection/components/snk-layout-form-config/snk-view-representation/snk-view-representation.css +78 -0
  154. package/dist/collection/components/snk-layout-form-config/snk-view-representation/snk-view-representation.js +57 -0
  155. package/dist/collection/components/snk-personalized-filter/interfaces/index.js +5 -0
  156. package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js +67 -13
  157. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-group/snk-expression-group.css +3 -0
  158. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-group/snk-expression-group.js +20 -1
  159. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.js +22 -3
  160. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-assistent-mode/snk-filter-assistent-mode.js +20 -1
  161. package/dist/collection/components/snk-pesquisa/pesquisa-grid/pesquisa-grid.css +9 -0
  162. package/dist/collection/components/snk-pesquisa/pesquisa-grid/pesquisa-grid.js +226 -0
  163. package/dist/collection/components/snk-pesquisa/pesquisa-tree/pesquisa-tree.css +28 -0
  164. package/dist/collection/components/snk-pesquisa/pesquisa-tree/pesquisa-tree.js +208 -0
  165. package/dist/collection/components/snk-pesquisa/pesquisaHelper.js +99 -0
  166. package/dist/collection/components/snk-pesquisa/snk-pesquisa.css +35 -6
  167. package/dist/collection/components/snk-pesquisa/snk-pesquisa.js +181 -32
  168. package/dist/collection/components/snk-print-selector/snk-print-selector.js +1 -1
  169. package/dist/collection/components/snk-simple-bar/snk-simple-bar.js +1 -1
  170. package/dist/collection/components/snk-simple-crud/snk-simple-crud.css +1 -1
  171. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +361 -123
  172. package/dist/collection/components/snk-simple-form-config/snk-simple-form-config.css +22 -0
  173. package/dist/collection/components/snk-simple-form-config/snk-simple-form-config.js +181 -0
  174. package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.css +13 -0
  175. package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.js +1 -1
  176. package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +11 -0
  177. package/dist/collection/components/snk-taskbar/elements/taskbar-split-button/taskbar-split-button.css +0 -0
  178. package/dist/collection/components/snk-taskbar/elements/taskbar-split-button/taskbar-split-button.js +220 -0
  179. package/dist/collection/components/snk-taskbar/processor/taskbar-processor.js +5 -1
  180. package/dist/collection/components/snk-taskbar/snk-taskbar.js +145 -42
  181. package/dist/collection/lib/@types/index.js +5 -0
  182. package/dist/collection/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.js +11 -5
  183. package/dist/collection/lib/configs/ConfigStorage.js +16 -8
  184. package/dist/collection/lib/configs/LayoutFormConfig.js +25 -0
  185. package/dist/collection/lib/dataUnit/InMemoryLoader.js +12 -103
  186. package/dist/collection/lib/dataUnit/dataUnitInMemoryUtils.js +11 -32
  187. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +44 -29
  188. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/anexo-sistema-fetcher.js +7 -5
  189. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.js +59 -14
  190. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.js +21 -7
  191. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.js +5 -2
  192. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/helpers/DataUnitDataLoaderHelper.js +108 -0
  193. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +23 -14
  194. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams.js +6 -1
  195. package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js +59 -5
  196. package/dist/collection/lib/http/data-fetcher/fetchers/parameters-fecher.js +7 -1
  197. package/dist/collection/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.js +29 -9
  198. package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +133 -9
  199. package/dist/collection/lib/index.js +1 -0
  200. package/dist/collection/lib/message/SnkMessageBuilder.js +1 -0
  201. package/dist/collection/lib/message/resources/snk-crud.msg.js +1 -1
  202. package/dist/collection/lib/message/resources/snk-data-unit.msg.js +28 -23
  203. package/dist/collection/lib/message/resources/snk-filter-bar.msg.js +6 -0
  204. package/dist/collection/lib/message/resources/snk-form.msg.js +16 -2
  205. package/dist/collection/lib/message/resources/snk-grid.msg.js +5 -1
  206. package/dist/collection/lib/message/resources/snk-personalized-filter.msg.js +6 -1
  207. package/dist/collection/lib/message/resources/snk-simple-crud.msg.js +2 -1
  208. package/dist/collection/lib/message/resources/snk-taskbar.msg.js +1 -0
  209. package/dist/collection/lib/utils/ContinuousInsertUtils.js +31 -0
  210. package/dist/collection/lib/utils/CrudUtils.js +25 -16
  211. package/dist/collection/{components/snk-data-exporter/utils/RecordIDUtils.js → lib/utils/GetSelectedRecordsIDsInfo.js} +9 -9
  212. package/dist/collection/lib/utils/constants.js +17 -1
  213. package/dist/collection/sw.js +46 -0
  214. package/dist/components/ConfigStorage.js +45 -17
  215. package/dist/components/ContinuousInsertUtils.js +416 -0
  216. package/dist/components/DataFetcher.js +231 -84
  217. package/dist/{esm/RecordIDUtils-87d02110.js → components/GetSelectedRecordsIDsInfo.js} +10 -10
  218. package/dist/components/ISave.js +391 -1
  219. package/dist/components/PersonalizedFilterUtils.js +6 -1
  220. package/dist/components/SnkFormConfigManager.js +72 -15
  221. package/dist/components/SnkMessageBuilder.js +67 -30
  222. package/dist/components/{snk-tab-config.d.ts → config-header.d.ts} +4 -4
  223. package/dist/components/config-header.js +6 -0
  224. package/dist/components/config-header2.js +103 -0
  225. package/dist/components/configs-button.d.ts +11 -0
  226. package/dist/components/configs-button.js +6 -0
  227. package/dist/components/configs-button2.js +76 -0
  228. package/dist/components/constants.js +18 -34
  229. package/dist/components/dataunit-fetcher.js +243 -190
  230. package/dist/components/field-config.d.ts +11 -0
  231. package/dist/components/field-config.js +6 -0
  232. package/dist/components/field-config2.js +525 -0
  233. package/dist/components/field-item.d.ts +11 -0
  234. package/dist/components/field-item.js +6 -0
  235. package/dist/components/field-item2.js +93 -0
  236. package/dist/components/fields-layout.d.ts +11 -0
  237. package/dist/components/fields-layout.js +6 -0
  238. package/dist/components/fields-layout2.js +370 -0
  239. package/dist/components/{snk-field-config.d.ts → fields-selector.d.ts} +4 -4
  240. package/dist/components/fields-selector.js +6 -0
  241. package/dist/components/fields-selector2.js +98 -0
  242. package/dist/components/form-config-fetcher.js +55 -1
  243. package/dist/components/guides-configurator.d.ts +11 -0
  244. package/dist/components/guides-configurator.js +6 -0
  245. package/dist/components/guides-configurator2.js +182 -0
  246. package/dist/components/index.d.ts +14 -3
  247. package/dist/components/index.js +14 -3
  248. package/dist/components/index2.js +3 -4
  249. package/dist/components/pesquisa-grid.d.ts +11 -0
  250. package/dist/components/pesquisa-grid.js +6 -0
  251. package/dist/components/pesquisa-grid2.js +102 -0
  252. package/dist/components/pesquisa-tree.d.ts +11 -0
  253. package/dist/components/pesquisa-tree.js +6 -0
  254. package/dist/components/pesquisa-tree2.js +91 -0
  255. package/dist/components/snk-actions-button2.js +44 -40
  256. package/dist/components/snk-application2.js +494 -77
  257. package/dist/components/snk-attach2.js +114 -73
  258. package/dist/components/snk-configurator2.js +23 -3
  259. package/dist/components/snk-crud.js +169 -139
  260. package/dist/components/snk-data-exporter2.js +35 -21
  261. package/dist/components/snk-data-unit2.js +275 -74
  262. package/dist/components/{snk-config-options.d.ts → snk-default-filter.d.ts} +4 -4
  263. package/dist/components/snk-default-filter.js +6 -0
  264. package/dist/components/snk-default-filter2.js +97 -0
  265. package/dist/components/snk-detail-view2.js +347 -165
  266. package/dist/components/snk-entity-list.js +2 -7
  267. package/dist/components/snk-expression-group2.js +4 -2
  268. package/dist/components/snk-expression-item2.js +5 -3
  269. package/dist/components/snk-filter-assistent-mode2.js +4 -2
  270. package/dist/components/snk-filter-bar2.js +97 -54
  271. package/dist/components/snk-filter-binary-select.js +1 -1
  272. package/dist/components/snk-filter-checkbox-list.js +1 -1
  273. package/dist/components/snk-filter-item2.js +10 -4
  274. package/dist/components/snk-filter-modal-item2.js +1 -0
  275. package/dist/components/snk-filter-modal.js +63 -10
  276. package/dist/components/snk-filter-number.js +1 -1
  277. package/dist/components/snk-filter-search.js +18 -5
  278. package/dist/components/snk-filter-text.js +2 -1
  279. package/dist/components/snk-form-config2.js +253 -928
  280. package/dist/components/snk-form-view2.js +22 -8
  281. package/dist/components/snk-form.js +35 -11
  282. package/dist/components/snk-grid-config2.js +3 -1
  283. package/dist/components/snk-grid2.js +173 -75
  284. package/dist/components/snk-layout-form-config.d.ts +11 -0
  285. package/dist/components/snk-layout-form-config.js +6 -0
  286. package/dist/components/snk-layout-form-config2.js +73 -0
  287. package/dist/components/snk-personalized-filter-editor.js +4 -4
  288. package/dist/components/snk-personalized-filter2.js +50 -14
  289. package/dist/components/snk-pesquisa2.js +132 -33
  290. package/dist/components/snk-print-selector.js +1 -1
  291. package/dist/components/snk-simple-bar2.js +1 -1
  292. package/dist/components/snk-simple-crud2.js +248 -203
  293. package/dist/components/snk-simple-form-config.d.ts +11 -0
  294. package/dist/components/snk-simple-form-config.js +6 -0
  295. package/dist/components/snk-simple-form-config2.js +121 -0
  296. package/dist/components/snk-taskbar2.js +109 -51
  297. package/dist/components/snk-view-representation.d.ts +11 -0
  298. package/dist/components/snk-view-representation.js +6 -0
  299. package/dist/components/snk-view-representation2.js +41 -0
  300. package/dist/components/sortable.esm.js +2666 -0
  301. package/dist/components/taskbar-actions-button2.js +2 -2
  302. package/dist/components/taskbar-split-button.d.ts +11 -0
  303. package/dist/components/taskbar-split-button.js +6 -0
  304. package/dist/components/taskbar-split-button2.js +87 -0
  305. package/dist/components/teste-pesquisa.js +13 -1
  306. package/dist/esm/ClientSideExporterProvider-3ed744fd.js +367 -0
  307. package/dist/esm/{ConfigStorage-e476378d.js → ConfigStorage-79b9e180.js} +47 -19
  308. package/dist/esm/{DataFetcher-773a3e4b.js → DataFetcher-88e56266.js} +231 -84
  309. package/dist/esm/FormConfigHelper-49fe72ca.js +248 -0
  310. package/dist/esm/GetSelectedRecordsIDsInfo-9fa41508.js +41 -0
  311. package/dist/esm/IFetchDataExporterParams-d73bed3d.js +8 -0
  312. package/dist/esm/ISave-5efafc97.js +394 -0
  313. package/dist/esm/{PersonalizedFilterUtils-e2b38ef7.js → PersonalizedFilterUtils-2db38ff2.js} +1 -1
  314. package/dist/esm/{SnkFormConfigManager-298cd647.js → SnkFormConfigManager-b4b93298.js} +74 -17
  315. package/dist/esm/{SnkMessageBuilder-ae87b754.js → SnkMessageBuilder-9c269caf.js} +67 -30
  316. package/dist/esm/{auth-fetcher-a411f73c.js → auth-fetcher-3510520e.js} +1 -1
  317. package/dist/esm/config-header.entry.js +75 -0
  318. package/dist/esm/configs-button.entry.js +57 -0
  319. package/dist/esm/{constants-8457af36.js → constants-7b422de0.js} +18 -34
  320. package/dist/esm/{dataunit-fetcher-3d2ec959.js → dataunit-fetcher-0e025732.js} +227 -174
  321. package/dist/esm/default-filters-50105e43.js +8 -0
  322. package/dist/esm/field-config_2.entry.js +319 -0
  323. package/dist/esm/fields-layout.entry.js +337 -0
  324. package/dist/esm/fields-selector.entry.js +70 -0
  325. package/dist/esm/{filter-type.enum-a80c1b6b.js → filter-type.enum-f6a8fe23.js} +1 -0
  326. package/dist/esm/{form-config-fetcher-e0382e5a.js → form-config-fetcher-fa208a6c.js} +56 -2
  327. package/dist/esm/guides-configurator.entry.js +160 -0
  328. package/dist/esm/{index-a7d3d3f1.js → index-479e1293.js} +46 -40
  329. package/dist/esm/{index-ae591a44.js → index-8acbae97.js} +6 -1
  330. package/dist/esm/{index-3aa4977a.js → index-b40568ff.js} +6 -1
  331. package/dist/esm/{index-bdf75557.js → index-b72af127.js} +4 -5
  332. package/dist/esm/loader.js +3 -3
  333. package/dist/esm/pesquisa-grid_2.entry.js +150 -0
  334. package/dist/esm/sankhyablocks.js +3 -3
  335. package/dist/esm/{snk-actions-button_4.entry.js → snk-actions-button_8.entry.js} +264 -50
  336. package/dist/esm/snk-actions-form.entry.js +1 -1
  337. package/dist/esm/snk-application.entry.js +472 -80
  338. package/dist/esm/snk-attach.entry.js +94 -53
  339. package/dist/esm/snk-client-confirm.entry.js +1 -1
  340. package/dist/esm/snk-configurator.entry.js +11 -4
  341. package/dist/esm/snk-crud.entry.js +61 -87
  342. package/dist/esm/snk-custom-slot-elements.entry.js +1 -1
  343. package/dist/esm/snk-data-exporter.entry.js +37 -29
  344. package/dist/esm/{snk-data-unit-008cb9aa.js → snk-data-unit-027bca56.js} +276 -38
  345. package/dist/esm/snk-data-unit.entry.js +6 -6
  346. package/dist/esm/snk-default-filter.entry.js +73 -0
  347. package/dist/esm/snk-detail-view.entry.js +72 -20
  348. package/dist/esm/snk-entity-list.entry.js +3 -8
  349. package/dist/esm/snk-exporter-email-sender.entry.js +1 -1
  350. package/dist/esm/snk-expression-group_2.entry.js +10 -8
  351. package/dist/esm/snk-filter-advanced-mode_2.entry.js +5 -4
  352. package/dist/esm/snk-filter-bar_4.entry.js +1485 -0
  353. package/dist/esm/snk-filter-binary-select.entry.js +2 -2
  354. package/dist/esm/snk-filter-checkbox-list.entry.js +2 -2
  355. package/dist/esm/snk-filter-detail.entry.js +3 -3
  356. package/dist/esm/snk-filter-field-search_2.entry.js +3 -3
  357. package/dist/esm/snk-filter-modal-item.entry.js +5 -5
  358. package/dist/esm/snk-filter-multi-select.entry.js +1 -1
  359. package/dist/esm/snk-filter-number.entry.js +2 -2
  360. package/dist/esm/snk-filter-period.entry.js +1 -1
  361. package/dist/esm/snk-filter-search.entry.js +19 -6
  362. package/dist/esm/snk-filter-text.entry.js +3 -2
  363. package/dist/esm/snk-form-summary.entry.js +1 -1
  364. package/dist/esm/snk-form-view.entry.js +20 -8
  365. package/dist/esm/snk-form_2.entry.js +428 -0
  366. package/dist/esm/snk-grid.entry.js +129 -46
  367. package/dist/esm/{snk-guides-viewer-62124f3d.js → snk-guides-viewer-32f3d3ab.js} +152 -75
  368. package/dist/esm/snk-guides-viewer.entry.js +14 -14
  369. package/dist/esm/snk-personalized-filter-editor.entry.js +5 -5
  370. package/dist/esm/snk-personalized-filter.entry.js +55 -20
  371. package/dist/esm/snk-pesquisa.entry.js +117 -32
  372. package/dist/esm/snk-print-selector.entry.js +2 -2
  373. package/dist/esm/snk-simple-bar.entry.js +2 -2
  374. package/dist/esm/snk-simple-crud.entry.js +227 -189
  375. package/dist/esm/snk-taskbar.entry.js +86 -46
  376. package/dist/esm/sortable.esm-842f85a3.js +2666 -0
  377. package/dist/esm/{taskbar-elements-d59867f1.js → taskbar-elements-171476d4.js} +14 -3
  378. package/dist/esm/{field-search-efbe307f.js → taskbar-processor-3436124c.js} +6 -35
  379. package/dist/esm/teste-pesquisa.entry.js +1 -1
  380. package/dist/sankhyablocks/p-0024d3fd.entry.js +1 -0
  381. package/dist/sankhyablocks/p-09e60995.entry.js +11 -0
  382. package/dist/sankhyablocks/p-0cb295c1.entry.js +1 -0
  383. package/dist/sankhyablocks/p-0f3698af.js +1 -0
  384. package/dist/sankhyablocks/p-1456d7cb.entry.js +1 -0
  385. package/dist/sankhyablocks/{p-9531fd46.entry.js → p-180716b2.entry.js} +1 -1
  386. package/dist/sankhyablocks/p-19156e59.entry.js +1 -0
  387. package/dist/sankhyablocks/p-1a0caadb.js +1 -0
  388. package/dist/sankhyablocks/p-21107f0d.entry.js +1 -0
  389. package/dist/sankhyablocks/{p-118e769b.entry.js → p-27482793.entry.js} +1 -1
  390. package/dist/sankhyablocks/p-2bde486e.js +1 -0
  391. package/dist/sankhyablocks/{p-26b0ce3e.entry.js → p-2fdac5e6.entry.js} +1 -1
  392. package/dist/sankhyablocks/p-349d1968.entry.js +1 -0
  393. package/dist/sankhyablocks/p-35e73c5d.js +1 -0
  394. package/dist/sankhyablocks/p-398cdd67.entry.js +1 -0
  395. package/dist/sankhyablocks/p-3a48bff3.entry.js +1 -0
  396. package/dist/sankhyablocks/{p-72fc257b.entry.js → p-3d41f5a8.entry.js} +1 -1
  397. package/dist/sankhyablocks/p-3f24c9b2.js +1 -0
  398. package/dist/sankhyablocks/{p-8002dcd0.entry.js → p-471b34f4.entry.js} +1 -1
  399. package/dist/sankhyablocks/{p-7e2ded86.entry.js → p-49d968e2.entry.js} +1 -1
  400. package/dist/sankhyablocks/p-4d2ff2fb.entry.js +1 -0
  401. package/dist/sankhyablocks/p-51833248.js +7 -0
  402. package/dist/sankhyablocks/p-601b252b.js +26 -0
  403. package/dist/sankhyablocks/p-60dd1d27.entry.js +1 -0
  404. package/dist/sankhyablocks/p-6416975c.js +56 -0
  405. package/dist/sankhyablocks/p-65c5d430.entry.js +1 -0
  406. package/dist/sankhyablocks/{p-21a81901.entry.js → p-667cab42.entry.js} +1 -1
  407. package/dist/sankhyablocks/p-67d6d0c8.entry.js +1 -0
  408. package/dist/sankhyablocks/p-6a4b21dd.js +1 -0
  409. package/dist/sankhyablocks/p-6dd38d7b.js +6 -0
  410. package/dist/sankhyablocks/p-71a05822.entry.js +1 -0
  411. package/dist/sankhyablocks/p-72c8c847.entry.js +1 -0
  412. package/dist/sankhyablocks/{p-0cd3c0a9.js → p-73285a8a.js} +1 -1
  413. package/dist/sankhyablocks/{p-ac8d1cd6.entry.js → p-7345782c.entry.js} +1 -1
  414. package/dist/sankhyablocks/p-763b04fa.js +1 -0
  415. package/dist/sankhyablocks/p-7993b2e3.js +60 -0
  416. package/dist/sankhyablocks/p-7dd49d15.js +1 -0
  417. package/dist/sankhyablocks/p-7de79adf.js +1 -0
  418. package/dist/sankhyablocks/p-7e250432.entry.js +1 -0
  419. package/dist/sankhyablocks/p-83c100f2.entry.js +1 -0
  420. package/dist/sankhyablocks/p-84345e7a.js +1 -0
  421. package/dist/sankhyablocks/p-86bd4478.entry.js +1 -0
  422. package/dist/sankhyablocks/p-8f3f2306.js +1 -0
  423. package/dist/sankhyablocks/p-9019a32f.js +1 -0
  424. package/dist/sankhyablocks/{p-54a5d52a.entry.js → p-90805683.entry.js} +1 -1
  425. package/dist/sankhyablocks/p-91a9abb6.entry.js +1 -0
  426. package/dist/sankhyablocks/p-9751c42f.entry.js +1 -0
  427. package/dist/sankhyablocks/{p-057fad05.js → p-988afe78.js} +1 -1
  428. package/dist/sankhyablocks/{p-16a1dd18.entry.js → p-9a63f3f7.entry.js} +1 -1
  429. package/dist/sankhyablocks/p-9ad3557c.entry.js +1 -0
  430. package/dist/sankhyablocks/p-9fd87bfd.entry.js +1 -0
  431. package/dist/sankhyablocks/p-a06bf7b9.entry.js +1 -0
  432. package/dist/sankhyablocks/p-a349689a.js +1 -0
  433. package/dist/sankhyablocks/p-a5bb2f93.entry.js +1 -0
  434. package/dist/sankhyablocks/p-a6513fcb.js +1 -0
  435. package/dist/sankhyablocks/{p-41f8bfa3.entry.js → p-a76e6d51.entry.js} +1 -1
  436. package/dist/sankhyablocks/p-b568c1d4.js +1 -0
  437. package/dist/sankhyablocks/p-bd665460.entry.js +1 -0
  438. package/dist/sankhyablocks/p-c3324d79.entry.js +1 -0
  439. package/dist/sankhyablocks/{p-bf2acf72.entry.js → p-c6a8a8bc.entry.js} +1 -1
  440. package/dist/sankhyablocks/{p-9dfda04a.entry.js → p-c926cf6b.entry.js} +1 -1
  441. package/dist/sankhyablocks/p-cfd0a4c6.entry.js +1 -0
  442. package/dist/sankhyablocks/p-d67526b6.entry.js +1 -0
  443. package/dist/sankhyablocks/{p-d2d301a6.js → p-d8d8169b.js} +1 -1
  444. package/dist/sankhyablocks/p-d9491f6f.entry.js +1 -0
  445. package/dist/sankhyablocks/p-dff65083.entry.js +1 -0
  446. package/dist/sankhyablocks/p-e3521eae.entry.js +1 -0
  447. package/dist/sankhyablocks/p-e7cccc45.entry.js +1 -0
  448. package/dist/sankhyablocks/{p-33718dfc.entry.js → p-e824d565.entry.js} +1 -1
  449. package/dist/sankhyablocks/p-fbba7e3d.js +1 -0
  450. package/dist/sankhyablocks/p-fc0b609e.js +1 -0
  451. package/dist/sankhyablocks/p-ff7060bc.entry.js +1 -0
  452. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  453. package/dist/types/components/snk-actions-button/actions/index.d.ts +1 -0
  454. package/dist/types/components/snk-actions-button/interfaces/index.d.ts +3 -0
  455. package/dist/types/components/snk-actions-button/snk-actions-button.d.ts +3 -2
  456. package/dist/types/components/snk-application/request-listener/DebouncedRequestListener.d.ts +11 -0
  457. package/dist/types/components/snk-application/request-listener/RequestListenerFactory.d.ts +12 -0
  458. package/dist/types/components/snk-application/request-listener/RequestListenerLoadingBar.d.ts +13 -0
  459. package/dist/types/components/snk-application/search-strategy/exec-prepared-search-plus.d.ts +5 -0
  460. package/dist/types/components/snk-application/snk-application.d.ts +55 -16
  461. package/dist/types/components/snk-attach/snk-attach.d.ts +2 -0
  462. package/dist/types/components/snk-configurator/snk-configurator.d.ts +6 -0
  463. package/dist/types/components/snk-crud/snk-crud.d.ts +34 -3
  464. package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +17 -0
  465. package/dist/types/components/snk-crud/subcomponents/snk-form-view.d.ts +11 -1
  466. package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +26 -7
  467. package/dist/types/components/snk-data-exporter/data/export-result.d.ts +2 -1
  468. package/dist/types/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.d.ts +1 -0
  469. package/dist/types/components/snk-data-exporter/interfaces/IExporterProvider.d.ts +9 -1
  470. package/dist/types/components/snk-data-exporter/interfaces/IRecordID.d.ts +1 -0
  471. package/dist/types/components/snk-data-exporter/providers/ClientSideExporterProvider.d.ts +3 -1
  472. package/dist/types/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.d.ts +3 -3
  473. package/dist/types/components/snk-data-exporter/utils/ParserExport.d.ts +1 -1
  474. package/dist/types/components/snk-data-unit/MultipleUpdateHelper.d.ts +9 -0
  475. package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +19 -0
  476. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-search.d.ts +5 -3
  477. package/dist/types/components/snk-filter-bar/filter-item/filter-item-type-mask.enum.d.ts +7 -0
  478. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +2 -0
  479. package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +16 -4
  480. package/dist/types/components/snk-filter-bar/filter-modal/subcomponents/snk-default-filter/snk-default-filter.d.ts +27 -0
  481. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +19 -4
  482. package/dist/types/components/snk-filter-bar/types/default-filters.d.ts +5 -0
  483. package/dist/types/components/snk-filter-bar/types/filter-type.enum.d.ts +2 -1
  484. package/dist/types/components/snk-filter-bar/utils/SnkFilterModalFactory.d.ts +3 -3
  485. package/dist/types/components/snk-form-config/FormConfigHelper.d.ts +31 -0
  486. package/dist/types/components/snk-form-config/SnkFormConfigManager.d.ts +10 -5
  487. package/dist/types/components/snk-form-config/config-header/config-header.d.ts +23 -0
  488. package/dist/types/components/snk-form-config/config-header/configs-button/configs-button.d.ts +19 -0
  489. package/dist/types/components/snk-form-config/field-item/field-config/field-config.d.ts +56 -0
  490. package/dist/types/components/snk-form-config/fields-layout/fields-layout.d.ts +63 -0
  491. package/dist/types/components/snk-form-config/fields-selector/fields-selector.d.ts +18 -0
  492. package/dist/types/components/snk-form-config/guides-configurator/guides-configurator.d.ts +42 -0
  493. package/dist/types/components/snk-form-config/snk-form-config.d.ts +53 -118
  494. package/dist/types/components/snk-grid/filtercolumn/SnkMultiSelectionListDataSource.d.ts +2 -1
  495. package/dist/types/components/snk-grid/snk-grid.d.ts +53 -5
  496. package/dist/types/components/snk-grid-config/snk-grid-config.d.ts +1 -0
  497. package/dist/types/components/snk-layout-form-config/snk-layout-form-config.d.ts +15 -0
  498. package/dist/types/components/snk-layout-form-config/snk-view-representation/snk-view-representation.d.ts +10 -0
  499. package/dist/types/components/snk-personalized-filter/interfaces/index.d.ts +4 -0
  500. package/dist/types/components/snk-personalized-filter/snk-personalized-filter.d.ts +7 -1
  501. package/dist/types/components/snk-personalized-filter/subcomponents/snk-expression-group/snk-expression-group.d.ts +4 -0
  502. package/dist/types/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.d.ts +4 -0
  503. package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-assistent-mode/snk-filter-assistent-mode.d.ts +4 -0
  504. package/dist/types/components/snk-pesquisa/pesquisa-grid/pesquisa-grid.d.ts +44 -0
  505. package/dist/types/components/snk-pesquisa/pesquisa-tree/pesquisa-tree.d.ts +33 -0
  506. package/dist/types/components/snk-pesquisa/pesquisaHelper.d.ts +24 -0
  507. package/dist/types/components/snk-pesquisa/snk-pesquisa.d.ts +36 -1
  508. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +55 -15
  509. package/dist/types/components/snk-simple-form-config/snk-simple-form-config.d.ts +34 -0
  510. package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +2 -1
  511. package/dist/types/components/snk-taskbar/elements/taskbar-split-button/taskbar-split-button.d.ts +44 -0
  512. package/dist/types/components/snk-taskbar/processor/taskbar-processor.d.ts +1 -0
  513. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +18 -0
  514. package/dist/types/components.d.ts +902 -213
  515. package/dist/types/lib/@types/index.d.ts +4 -0
  516. package/dist/types/lib/configs/ConfigStorage.d.ts +4 -2
  517. package/dist/types/lib/configs/LayoutFormConfig.d.ts +11 -0
  518. package/dist/types/lib/dataUnit/InMemoryLoader.d.ts +4 -11
  519. package/dist/types/lib/dataUnit/dataUnitInMemoryUtils.d.ts +9 -2
  520. package/dist/types/lib/dataUnit/interfaces/InMemoryLoaderConfig.d.ts +2 -2
  521. package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +1 -0
  522. package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/anexo-sistema-fetcher.d.ts +3 -2
  523. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.d.ts +9 -1
  524. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.d.ts +4 -0
  525. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.d.ts +1 -1
  526. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/helpers/DataUnitDataLoaderHelper.d.ts +6 -0
  527. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadingInfo.d.ts +4 -0
  528. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.d.ts +3 -3
  529. package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams.d.ts +6 -2
  530. package/dist/types/lib/http/data-fetcher/fetchers/form-config-fetcher.d.ts +14 -2
  531. package/dist/types/lib/http/data-fetcher/fetchers/parameters-fecher.d.ts +1 -0
  532. package/dist/types/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.d.ts +8 -4
  533. package/dist/types/lib/http/data-fetcher/fetchers/pesquisa-fetcher.d.ts +21 -2
  534. package/dist/types/lib/index.d.ts +1 -0
  535. package/dist/types/lib/message/SnkMessageBuilder.d.ts +2 -1
  536. package/dist/types/lib/utils/ContinuousInsertUtils.d.ts +10 -0
  537. package/dist/types/lib/utils/CrudUtils.d.ts +1 -0
  538. package/dist/types/lib/utils/GetSelectedRecordsIDsInfo.d.ts +3 -0
  539. package/dist/types/lib/utils/constants.d.ts +14 -0
  540. package/package.json +10 -7
  541. package/react/components.d.ts +14 -3
  542. package/react/components.js +14 -3
  543. package/react/components.js.map +1 -1
  544. package/dist/cjs/IExporterProvider-10b7fed5.js +0 -230
  545. package/dist/cjs/ISave-e91b70a7.js +0 -9
  546. package/dist/cjs/Sortable-fb1c4cbb.js +0 -2853
  547. package/dist/cjs/pesquisa-fetcher-a1d0353f.js +0 -166
  548. package/dist/cjs/snk-config-options.cjs.entry.js +0 -239
  549. package/dist/cjs/snk-field-config.cjs.entry.js +0 -60
  550. package/dist/cjs/snk-filter-bar.cjs.entry.js +0 -714
  551. package/dist/cjs/snk-filter-item.cjs.entry.js +0 -312
  552. package/dist/cjs/snk-filter-list.cjs.entry.js +0 -152
  553. package/dist/cjs/snk-filter-modal.cjs.entry.js +0 -249
  554. package/dist/cjs/snk-form-config.cjs.entry.js +0 -1002
  555. package/dist/cjs/snk-form.cjs.entry.js +0 -143
  556. package/dist/cjs/snk-tab-config.cjs.entry.js +0 -332
  557. package/dist/collection/components/snk-form-config/subcomponents/snk-config-options/snk-config-options.css +0 -16
  558. package/dist/collection/components/snk-form-config/subcomponents/snk-config-options/snk-config-options.js +0 -344
  559. package/dist/collection/components/snk-form-config/subcomponents/snk-field-config/snk-field-config.css +0 -219
  560. package/dist/collection/components/snk-form-config/subcomponents/snk-field-config/snk-field-config.js +0 -184
  561. package/dist/collection/components/snk-form-config/subcomponents/snk-tab-config/snk-tab-config.css +0 -323
  562. package/dist/collection/components/snk-form-config/subcomponents/snk-tab-config/snk-tab-config.js +0 -527
  563. package/dist/collection/components/snk-taskbar/subcomponents/field-search.js +0 -31
  564. package/dist/components/IExporterProvider.js +0 -298
  565. package/dist/components/pesquisa-fetcher.js +0 -164
  566. package/dist/components/snk-config-options.js +0 -6
  567. package/dist/components/snk-config-options2.js +0 -255
  568. package/dist/components/snk-field-config.js +0 -6
  569. package/dist/components/snk-field-config2.js +0 -76
  570. package/dist/components/snk-tab-config.js +0 -6
  571. package/dist/components/snk-tab-config2.js +0 -3202
  572. package/dist/esm/IExporterProvider-d597f27d.js +0 -221
  573. package/dist/esm/ISave-d8c8bc59.js +0 -9
  574. package/dist/esm/Sortable-83960219.js +0 -2851
  575. package/dist/esm/pesquisa-fetcher-a87445a0.js +0 -164
  576. package/dist/esm/snk-config-options.entry.js +0 -235
  577. package/dist/esm/snk-field-config.entry.js +0 -56
  578. package/dist/esm/snk-filter-bar.entry.js +0 -710
  579. package/dist/esm/snk-filter-item.entry.js +0 -308
  580. package/dist/esm/snk-filter-list.entry.js +0 -148
  581. package/dist/esm/snk-filter-modal.entry.js +0 -245
  582. package/dist/esm/snk-form-config.entry.js +0 -998
  583. package/dist/esm/snk-form.entry.js +0 -139
  584. package/dist/esm/snk-tab-config.entry.js +0 -328
  585. package/dist/sankhyablocks/p-01ba23cd.entry.js +0 -1
  586. package/dist/sankhyablocks/p-091ce761.js +0 -60
  587. package/dist/sankhyablocks/p-162b9a59.entry.js +0 -11
  588. package/dist/sankhyablocks/p-181975f1.js +0 -26
  589. package/dist/sankhyablocks/p-1db45d26.entry.js +0 -1
  590. package/dist/sankhyablocks/p-21749402.js +0 -1
  591. package/dist/sankhyablocks/p-25f1fc39.js +0 -6
  592. package/dist/sankhyablocks/p-2e9c764c.entry.js +0 -1
  593. package/dist/sankhyablocks/p-30cf616e.js +0 -1
  594. package/dist/sankhyablocks/p-3287a6cc.js +0 -56
  595. package/dist/sankhyablocks/p-3ab6df3d.entry.js +0 -1
  596. package/dist/sankhyablocks/p-3b60db06.entry.js +0 -1
  597. package/dist/sankhyablocks/p-3c50e9d4.entry.js +0 -1
  598. package/dist/sankhyablocks/p-421bec84.entry.js +0 -1
  599. package/dist/sankhyablocks/p-42f7b05d.entry.js +0 -1
  600. package/dist/sankhyablocks/p-51999ab5.entry.js +0 -1
  601. package/dist/sankhyablocks/p-594bc21d.js +0 -1
  602. package/dist/sankhyablocks/p-5f016aed.js +0 -1
  603. package/dist/sankhyablocks/p-62f34e6f.entry.js +0 -1
  604. package/dist/sankhyablocks/p-65f8c11c.entry.js +0 -1
  605. package/dist/sankhyablocks/p-684a2590.entry.js +0 -1
  606. package/dist/sankhyablocks/p-6dc031de.js +0 -1
  607. package/dist/sankhyablocks/p-70001ac1.js +0 -1
  608. package/dist/sankhyablocks/p-70a4af56.entry.js +0 -1
  609. package/dist/sankhyablocks/p-74c665d5.entry.js +0 -1
  610. package/dist/sankhyablocks/p-7663f597.entry.js +0 -1
  611. package/dist/sankhyablocks/p-76a65660.js +0 -1
  612. package/dist/sankhyablocks/p-7c4aabe2.js +0 -1
  613. package/dist/sankhyablocks/p-7e7a7473.js +0 -1
  614. package/dist/sankhyablocks/p-88aa931b.entry.js +0 -1
  615. package/dist/sankhyablocks/p-89451692.entry.js +0 -1
  616. package/dist/sankhyablocks/p-8eb67fa4.entry.js +0 -1
  617. package/dist/sankhyablocks/p-933c0c0b.js +0 -1
  618. package/dist/sankhyablocks/p-939e15d3.entry.js +0 -1
  619. package/dist/sankhyablocks/p-95df461f.entry.js +0 -1
  620. package/dist/sankhyablocks/p-96a89d58.entry.js +0 -1
  621. package/dist/sankhyablocks/p-9863d682.js +0 -1
  622. package/dist/sankhyablocks/p-9d3a025a.entry.js +0 -1
  623. package/dist/sankhyablocks/p-aaa3ee68.entry.js +0 -1
  624. package/dist/sankhyablocks/p-b0ef4383.js +0 -1
  625. package/dist/sankhyablocks/p-b11aa1e0.entry.js +0 -1
  626. package/dist/sankhyablocks/p-bd008859.entry.js +0 -1
  627. package/dist/sankhyablocks/p-c2495304.js +0 -1
  628. package/dist/sankhyablocks/p-c8622597.entry.js +0 -1
  629. package/dist/sankhyablocks/p-cc935517.js +0 -1
  630. package/dist/sankhyablocks/p-d1791da2.entry.js +0 -1
  631. package/dist/sankhyablocks/p-d3f53df2.entry.js +0 -1
  632. package/dist/sankhyablocks/p-d65d98ed.entry.js +0 -1
  633. package/dist/sankhyablocks/p-d9804798.js +0 -1
  634. package/dist/sankhyablocks/p-e8763234.entry.js +0 -1
  635. package/dist/sankhyablocks/p-f2809746.entry.js +0 -1
  636. package/dist/sankhyablocks/p-fa816fb2.js +0 -1
  637. package/dist/types/components/snk-data-exporter/utils/RecordIDUtils.d.ts +0 -3
  638. package/dist/types/components/snk-form-config/subcomponents/snk-config-options/snk-config-options.d.ts +0 -57
  639. package/dist/types/components/snk-form-config/subcomponents/snk-field-config/snk-field-config.d.ts +0 -43
  640. package/dist/types/components/snk-form-config/subcomponents/snk-tab-config/snk-tab-config.d.ts +0 -105
  641. package/dist/types/components/snk-taskbar/subcomponents/field-search.d.ts +0 -4
@@ -0,0 +1,1492 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index$1 = require('./index-1cf293c1.js');
6
+ const core = require('@sankhyalabs/core');
7
+ const EzScrollDirection = require('@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection');
8
+ const ConfigStorage = require('./ConfigStorage-48ba265b.js');
9
+ const DataType = require('@sankhyalabs/core/dist/dataunit/metadata/DataType');
10
+ const filterItemType_enum = require('./filter-item-type.enum-a7ffdaa6.js');
11
+ const index = require('./index-62760a9c.js');
12
+ const filterNumberVariation = require('./filterNumberVariation-d65332da.js');
13
+ const utils = require('@sankhyalabs/ezui/dist/collection/utils');
14
+ const PersonalizedFilterUtils = require('./PersonalizedFilterUtils-7259cf65.js');
15
+ const ezModalContainer = require('@sankhyalabs/ezui/dist/collection/components/ez-modal-container');
16
+ const filterType_enum = require('./filter-type.enum-2bb46d2a.js');
17
+ const defaultFilters = require('./default-filters-a09bf82b.js');
18
+ require('./form-config-fetcher-40d3f752.js');
19
+ require('./DataFetcher-1afdb18e.js');
20
+ require('./PrintUtils-bcaeb82f.js');
21
+ require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
22
+
23
+ const buildFilter = (item) => {
24
+ switch (item.type) {
25
+ case filterItemType_enum.FilterItemType.DEFAULT_FILTER:
26
+ return buildDefault(item);
27
+ case filterItemType_enum.FilterItemType.BINARY_SELECT:
28
+ return buildBinary(item);
29
+ case filterItemType_enum.FilterItemType.MULTI_SELECT:
30
+ return buildMultSelect(item);
31
+ case filterItemType_enum.FilterItemType.MULTI_LIST:
32
+ return buildMultiList(item);
33
+ case filterItemType_enum.FilterItemType.PERIOD:
34
+ return buildPeriod(item);
35
+ case filterItemType_enum.FilterItemType.SEARCH:
36
+ return buildSearch(item);
37
+ case filterItemType_enum.FilterItemType.TEXT:
38
+ return buildText(item);
39
+ case filterItemType_enum.FilterItemType.NUMBER:
40
+ return buildNumber(item);
41
+ case filterItemType_enum.FilterItemType.PERSONALIZED:
42
+ return buildPersonalized(item);
43
+ case filterItemType_enum.FilterItemType.CHECK_BOX_LIST:
44
+ return buildCheckboxList(item);
45
+ default:
46
+ return undefined;
47
+ }
48
+ };
49
+ function buildDefault(item) {
50
+ return { name: item.id, expression: item.props.expression, params: [] };
51
+ }
52
+ function buildBinary(item) {
53
+ const { id, value, props } = item;
54
+ const options = props.options;
55
+ const selectedOption = options.find(opt => opt.name === value);
56
+ return { name: id, expression: selectedOption.expression, params: [] };
57
+ }
58
+ function buildMultSelect(item) {
59
+ const { id, value, props } = item;
60
+ return { name: id, expression: props.expression, params: [{ name: id, dataType: core.DataType.TEXT, value }] };
61
+ }
62
+ function buildMultiList(item) {
63
+ const { id, value, props } = item;
64
+ const parsedValues = parseMultiListValues(value);
65
+ if (parsedValues.length > 0) {
66
+ return {
67
+ name: id,
68
+ expression: props.expression,
69
+ params: [{
70
+ name: id,
71
+ dataType: core.DataType.TEXT,
72
+ value: JSON.stringify(parsedValues)
73
+ }]
74
+ };
75
+ }
76
+ }
77
+ function buildCheckboxList(item) {
78
+ var _a;
79
+ const { id, value, props } = item;
80
+ const selectedOptionNames = Object.entries(value !== null && value !== void 0 ? value : {})
81
+ .filter(([_, valueChecked]) => valueChecked === true)
82
+ .map(([key, _]) => key);
83
+ const selectedOptionsObject = (_a = props.options) === null || _a === void 0 ? void 0 : _a.filter(option => selectedOptionNames.includes(option.name));
84
+ return { name: id, expression: buildCheckboxListExpression(selectedOptionsObject), params: [] };
85
+ }
86
+ function buildCheckboxListExpression(options) {
87
+ let expression = "";
88
+ options.forEach((option, index) => {
89
+ var _a;
90
+ expression += ` ${index > 0 ? ((_a = option.operand) !== null && _a !== void 0 ? _a : 'OR') : ''} ${option.expression}`;
91
+ });
92
+ return expression.trim();
93
+ }
94
+ function parseMultiListValues(multiListValue) {
95
+ var _a, _b;
96
+ const value = (_b = (_a = multiListValue === null || multiListValue === void 0 ? void 0 : multiListValue.elements) !== null && _a !== void 0 ? _a : multiListValue === null || multiListValue === void 0 ? void 0 : multiListValue.members) !== null && _b !== void 0 ? _b : multiListValue;
97
+ return value.filter(item => item === null || item === void 0 ? void 0 : item.check).map(({ id }) => Number.isNaN(+id) ? String(id) : Number(id));
98
+ }
99
+ function buildPeriod(item) {
100
+ const { id, value, props } = item;
101
+ let { end, start } = value;
102
+ if (typeof end === "string") {
103
+ end = new Date(end);
104
+ }
105
+ if (typeof start === "string") {
106
+ start = new Date(start);
107
+ }
108
+ const params = [];
109
+ let expression;
110
+ if (end && start) {
111
+ expression = props.expression.fullfill;
112
+ params.push({ name: `${id}.START`, dataType: core.DataType.DATE, value: DataType.toString(core.DataType.DATE, start) }, { name: `${id}.END`, dataType: core.DataType.DATE, value: DataType.toString(core.DataType.DATE, end) });
113
+ }
114
+ else {
115
+ if (start) {
116
+ expression = props.expression.onlystart;
117
+ params.push({ name: id, dataType: core.DataType.DATE, value: DataType.toString(core.DataType.DATE, start) });
118
+ }
119
+ else {
120
+ expression = props.expression.onlyend;
121
+ params.push({ name: id, dataType: core.DataType.DATE, value: DataType.toString(core.DataType.DATE, end) });
122
+ }
123
+ }
124
+ return { name: id, expression, params };
125
+ }
126
+ function buildSearch(item) {
127
+ const { id, value, props } = item;
128
+ const expression = props.expression;
129
+ return { name: id, expression, params: [{ name: id, dataType: core.DataType.TEXT, value: DataType.toString(core.DataType.TEXT, value === null || value === void 0 ? void 0 : value.value) }] };
130
+ }
131
+ function buildText(item) {
132
+ let { id, value, props } = item;
133
+ const expression = props.expression;
134
+ if (!core.StringUtils.isEmpty(props.likeAs)) {
135
+ value = buildLikeValue(value, props.likeAs);
136
+ }
137
+ return { name: id, expression, params: [{ name: id, dataType: core.DataType.TEXT, value: DataType.toString(core.DataType.TEXT, value) }] };
138
+ }
139
+ function buildNumber(item) {
140
+ const { id, value, props } = item;
141
+ const variation = props.variation;
142
+ if (variation === filterNumberVariation.FilterNumberVariation.INTERVAL) {
143
+ const { start, end } = value !== null && value !== void 0 ? value : { start: 0, end: 0 };
144
+ if (!isNaN(start) && !isNaN(end)) {
145
+ return {
146
+ name: id,
147
+ expression: props.intervalExpression.fullfill,
148
+ params: [
149
+ { name: `${id}.START`, dataType: core.DataType.NUMBER, value: DataType.toString(core.DataType.NUMBER, start) },
150
+ { name: `${id}.END`, dataType: core.DataType.NUMBER, value: DataType.toString(core.DataType.NUMBER, end) }
151
+ ]
152
+ };
153
+ }
154
+ if (!isNaN(start)) {
155
+ return {
156
+ name: id,
157
+ expression: props.intervalExpression.onlystart,
158
+ params: [
159
+ { name: id, dataType: core.DataType.NUMBER, value: DataType.toString(core.DataType.NUMBER, start) }
160
+ ]
161
+ };
162
+ }
163
+ if (!isNaN(end)) {
164
+ return {
165
+ name: id,
166
+ expression: props.intervalExpression.onlyend,
167
+ params: [
168
+ { name: id, dataType: core.DataType.NUMBER, value: DataType.toString(core.DataType.NUMBER, end) }
169
+ ]
170
+ };
171
+ }
172
+ }
173
+ const expression = props.expression;
174
+ return { name: id, expression, params: [{ name: id, dataType: core.DataType.NUMBER, value: DataType.toString(core.DataType.NUMBER, value) }] };
175
+ }
176
+ function buildLikeValue(valueAsString, likeAs) {
177
+ if (likeAs === "CONTANIS") {
178
+ return `%${valueAsString}%`;
179
+ }
180
+ else if (likeAs === "STARTS_WITH") {
181
+ return `${valueAsString}%`;
182
+ }
183
+ else if (likeAs === "ENDS_WITH") {
184
+ return `%${valueAsString}`;
185
+ }
186
+ return valueAsString;
187
+ }
188
+ function buildPersonalized(item) {
189
+ const { id, groupedItems = [] } = item;
190
+ const activeFilters = groupedItems.filter(groupItem => !!groupItem.visible);
191
+ const filters = activeFilters.map(item => {
192
+ var _a;
193
+ const expression = item.props.expression;
194
+ const params = (((_a = item.props.personalizedFilter) === null || _a === void 0 ? void 0 : _a.parameters) || []).map((param, index) => {
195
+ const valuesArray = Array.from(item.value || 0);
196
+ const dataType = param.dataType;
197
+ let paramValue = (index >= 0 && index < valuesArray.length ? valuesArray[index] : null);
198
+ if (paramValue != undefined && typeof paramValue === "object" && "value" in paramValue) {
199
+ paramValue = paramValue["value"];
200
+ }
201
+ if (paramValue == undefined && dataType === core.DataType.BOOLEAN) {
202
+ paramValue = false;
203
+ }
204
+ return { name: param.name, dataType, value: typeof paramValue === "string" ? paramValue : DataType.toString(dataType, paramValue) };
205
+ });
206
+ return { expression, name: item.id, params };
207
+ });
208
+ const expression = filters.map(filter => `(${filter.expression})`).join(` ${index.FilterOperand.AND} `);
209
+ const params = filters.flatMap(filter => filter.params);
210
+ return { name: id, expression, params };
211
+ }
212
+
213
+ class SnkFilterModalFactory {
214
+ constructor({ filterConfig, configName, onComplete, getMessage, disablePersonalizedFilter, onAddPersonalizedFilter, onEditPersonalizedFilter, onDeletePersonalizedFilter }) {
215
+ this._filterConfig = filterConfig;
216
+ this._configName = configName;
217
+ this._onComplete = onComplete;
218
+ this._getMessage = getMessage;
219
+ this._disablePersonalizedFilter = disablePersonalizedFilter;
220
+ this._addPersonalizedFilterFn = onAddPersonalizedFilter;
221
+ this._editPersonalizedFilterFn = onEditPersonalizedFilter;
222
+ this._onDeletePersonalizedFilter = onDeletePersonalizedFilter;
223
+ }
224
+ applyFilters(newFilterConfig) {
225
+ this._onComplete(newFilterConfig);
226
+ this._closeModal();
227
+ }
228
+ buildFilterModal() {
229
+ const filterModal = document.createElement("snk-filter-modal");
230
+ filterModal.className = "ez-size-height--full";
231
+ filterModal.filters = this._filterConfig;
232
+ filterModal.configName = this._configName;
233
+ filterModal.disablePersonalizedFilter = this._disablePersonalizedFilter;
234
+ filterModal.getMessage = this._getMessage.bind(this);
235
+ filterModal.applyFilters = this.applyFilters.bind(this);
236
+ filterModal.closeModal = () => this._closeModal();
237
+ filterModal.addPersonalizedFilter = (isDefault) => this._addPersonalizedFilterFn(isDefault);
238
+ filterModal.editPersonalizedFilter = (id, isDefault) => this._editPersonalizedFilterFn(id, isDefault);
239
+ filterModal.deletePersonalizedFilter = (filter, configName, isDefault) => this._onDeletePersonalizedFilter(filter, configName, isDefault);
240
+ return filterModal;
241
+ }
242
+ async showModal() {
243
+ const filterModal = this.buildFilterModal();
244
+ const modalProps = {
245
+ content: filterModal,
246
+ position: 'right',
247
+ heightMode: 'full',
248
+ closeOutsideClick: false,
249
+ useScrimLight: true
250
+ };
251
+ this._closeModal = await utils.ApplicationUtils.showModal(modalProps);
252
+ }
253
+ async closeModal() {
254
+ this._closeModal();
255
+ }
256
+ }
257
+
258
+ const snkFilterBarCss = ".sc-snk-filter-bar-h{display:grid;grid-template-columns:1fr minmax(100px, 100%) 1fr 1fr;--snk-personalized-filter--z-index:var(--elevation--20, 20);--snk-personalized-filter--background-color:var(--background--xlight, #fff)}.snk-filter-bar__title.sc-snk-filter-bar{max-width:260px;display:inline-block;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-size:16px;font-family:var(--font-pattern, Arial);font-weight:var(--text-weight--large, 600);color:var(--color--title-primary, #2B3A54);margin-top:12px}[data-mode=\"hidden\"].sc-snk-filter-bar-h{width:0px;height:0px}[data-mode=\"button\"].sc-snk-filter-bar-h{grid-template-columns:1fr;width:fit-content}.snk-filter__popover-container.sc-snk-filter-bar{display:flex;cursor:auto}.filter-bar__personalized-filter.sc-snk-filter-bar{display:flex;flex-direction:column;position:fixed;top:0;left:0;width:100%;height:100%;overflow:auto;z-index:var(--snk-personalized-filter--z-index);background-color:var(--snk-personalized-filter--background-color)}.snk-filter__popover.sc-snk-filter-bar{display:flex;flex-direction:column;position:absolute;width:fit-content;height:fit-content;min-width:265px;background-color:var(--background--xlight, #fff);border-radius:var(--border--radius-medium, 12px);box-shadow:var(--shadow, 0px 0px 16px 0px #000)}.snk-filter-item__editor-header.sc-snk-filter-bar{flex-grow:1;font-weight:var(--text-weight--medium, 400);color:var(--color--title-primary, #2B3A54)}.snk-filter__popover-rule.sc-snk-filter-bar{border-style:solid;border-color:var(--color--disable-secondary, #F2F5F8);border-radius:1px;border-width:1px;width:100%}.editor__ez-check.sc-snk-filter-bar{--ez-check__label--padding-left:0}.snk-filter-item__editor-header-button.sc-snk-filter-bar{cursor:pointer;background-color:transparent;border:none;padding:3px;outline-color:var(--color--primary)}.snk-filter-bar__divider.sc-snk-filter-bar{margin-bottom:var(--space--small);height:80%}.snk-filter-bar__filter-item-container.sc-snk-filter-bar{display:flex;align-items:start}.snk-filter-bar__scroller.sc-snk-filter-bar .sc-snk-filter-bar:first-child{margin-left:var(--space-extra-small, 3px)}.snk-filter-bar__filter-list-items-container.sc-snk-filter-bar{overflow-y:auto;max-height:360px;margin-top:var(--space--small, 6px)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar{cursor:pointer;border-radius:var(--border--radius-small, 6px);border:none;background-color:transparent}.snk-filter-bar__filter-list-item__label.sc-snk-filter-bar{color:var(--title--primary)}.snk-filter-bar__filter-list-item__label--secondary.sc-snk-filter-bar{color:var(--text--primary)}.snk-filter-bar__filter-list-item__icon.sc-snk-filter-bar{--ez-icon--color:var(--title--primary)}.snk-filter-bar__filter-list-item__icon--secondary.sc-snk-filter-bar{--ez-icon--color:var(--text--secondary)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar:focus-visible{outline:none;background-color:var(--background--medium)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar:hover{background-color:var(--background--medium)}.snk-filter-bar__filter-list-items-container--empty.sc-snk-filter-bar{width:100%;height:100px;display:flex;justify-content:center;align-self:center;align-items:center}.snk-filter-bar__filter-list-items-button--active.sc-snk-filter-bar{position:relative}.snk-filter-bar__filter-list-items-button--active.sc-snk-filter-bar::after{display:flex;position:absolute;content:\"\";width:8px;height:8px;top:7px;left:17px;background-color:var(--icon--alert--color, #008561);border-radius:50%}.snk-filter-bar__filter-modal-item.sc-snk-filter-bar{--modal-item-border-width:2px;display:flex;flex-direction:row;margin-left:var(--modal-item-border-width);border-radius:var(--border--radius-medium, 12px);background-color:var(--background--medium, #f0f3f7);border:none;width:100%}.snk-filter-bar__filter-modal-item.sc-snk-filter-bar:focus-visible{outline:var(--color--primary) solid var(--modal-item-border-width)}.snk-filter-bar__filter-modal-item__check.sc-snk-filter-bar{width:auto}.snk-filter-bar__filter-modal-item__label.sc-snk-filter-bar{font-weight:var(--text-weight--medium)}.snk-filter-bar__filter-modal-content.sc-snk-filter-bar{display:grid;grid-template-rows:auto auto 1fr auto;width:99%;height:100%}";
259
+
260
+ const SnkFilterBar = class {
261
+ constructor(hostRef) {
262
+ index$1.registerInstance(this, hostRef);
263
+ this.configUpdated = index$1.createEvent(this, "configUpdated", 7);
264
+ this._updateSequence = [];
265
+ this._loadingPending = false;
266
+ this._configUpdated = false;
267
+ this._firstLoad = true;
268
+ this._pendingVariables = false;
269
+ this._isDefaultFilter = false;
270
+ this._customfiltersToBeUpdated = [];
271
+ this._resolveLoading = undefined;
272
+ this._calculateSortIndex = (item) => {
273
+ if (!item.visible)
274
+ return 0;
275
+ if (item.hardFixed)
276
+ return 1000000; //campos Hard Fixed não variam a ordem
277
+ let index = item.fixed ? 100000 : 0;
278
+ index += this.hasValidValue(item) ? 10000 : 0;
279
+ index += this._updateSequence.lastIndexOf(item.id) + 1;
280
+ return index;
281
+ };
282
+ this._filtersComparator = (a, b) => {
283
+ return this._calculateSortIndex(b) - this._calculateSortIndex(a);
284
+ };
285
+ this.enableLockManagerLoadingComp = false;
286
+ this.customFilterBarConfig = undefined;
287
+ this.dataUnit = undefined;
288
+ this.title = undefined;
289
+ this.configName = undefined;
290
+ this.resourceID = undefined;
291
+ this.mode = "regular";
292
+ this.filterConfig = undefined;
293
+ this.messagesBuilder = undefined;
294
+ this.disablePersonalizedFilter = undefined;
295
+ this.filterBarLegacyConfigName = undefined;
296
+ this.autoLoad = undefined;
297
+ this.afterApplyConfig = undefined;
298
+ this.allowDefault = undefined;
299
+ this.scrollerLocked = false;
300
+ this.showPersonalizedFilter = false;
301
+ this.personalizedFilterId = undefined;
302
+ }
303
+ hasValidValue(item) {
304
+ if (item.value === undefined || item.value === null)
305
+ return false;
306
+ if (!Array.isArray(item.value))
307
+ return true;
308
+ return item.value.some(filterItem => filterItem.check === true);
309
+ }
310
+ observeFilterConfig(newValue, oldValue) {
311
+ if (core.ObjectUtils.equals(newValue, oldValue))
312
+ return;
313
+ this.handleFilterConfigsChanged(oldValue, newValue);
314
+ }
315
+ handleFilterConfigsChanged(oldValue, newValue) {
316
+ if (oldValue != undefined && newValue == undefined) {
317
+ this._loadingPending = true;
318
+ this._configUpdated = true;
319
+ }
320
+ else {
321
+ const oldItems = new Map(oldValue ? oldValue.map(item => [item.id, item]) : undefined);
322
+ if (oldItems.size === 0 && newValue.length > 0) {
323
+ this._loadingPending = true;
324
+ this._configUpdated = false;
325
+ }
326
+ else {
327
+ newValue.forEach(newItem => {
328
+ const oldItem = oldItems.get(newItem.id);
329
+ if (oldItem != undefined) {
330
+ this._configUpdated = this._configUpdated || core.ObjectUtils.objectToString(oldItem) != core.ObjectUtils.objectToString(newItem);
331
+ this._loadingPending = this._loadingPending || core.ObjectUtils.objectToString(oldItem.value) !== core.ObjectUtils.objectToString(newItem.value);
332
+ if (!this._loadingPending) {
333
+ const groupedChanged = core.ObjectUtils.objectToString(oldItem.groupedItems) != core.ObjectUtils.objectToString(newItem.groupedItems);
334
+ this._configUpdated = this._configUpdated || groupedChanged;
335
+ this._loadingPending = this._loadingPending || groupedChanged;
336
+ }
337
+ }
338
+ else {
339
+ this._configUpdated = true;
340
+ this._loadingPending = this._loadingPending || newItem.value != undefined;
341
+ }
342
+ });
343
+ }
344
+ }
345
+ if (this._loadingPending || this._configUpdated)
346
+ this.configUpdated.emit(newValue);
347
+ this.processAfterUpdateConfig();
348
+ }
349
+ /**
350
+ * Faz o recarregamento da filterbar buscando o state no servidor.
351
+ */
352
+ async reload() {
353
+ this.loadConfigFromStorage(true);
354
+ }
355
+ /**
356
+ * Retorna um item de filtro pelo ID.
357
+ */
358
+ async getFilterItem(id) {
359
+ const item = this.filterConfig.find(item => item.id === id);
360
+ return Promise.resolve(core.ObjectUtils.copy(item));
361
+ }
362
+ /**
363
+ * Atualiza um item do filtro.
364
+ *
365
+ * @param filterItem - Item com as informações atualizadas, caso o item não seja encontrado no array ele mão será modificado
366
+ */
367
+ async updateFilterItem(newFilterItem) {
368
+ const itemIndex = this.filterConfig.findIndex(item => item.id === newFilterItem.id);
369
+ if (itemIndex == -1) {
370
+ console.warn("[SnkFilterBar.updateFilterItem] FilterItem não encontrado, o mesmo não será atualizado.");
371
+ return Promise.resolve();
372
+ }
373
+ this._loadingPending = true;
374
+ this.updateFilter(newFilterItem);
375
+ return Promise.resolve();
376
+ }
377
+ /**
378
+ * Adiciona um item de filtro.
379
+ *
380
+ * @param filterItem - Item a ser adicionado, caso o item já exista com o ID ele não será adicionado novamente
381
+ */
382
+ async addFilterItem(filterItem) {
383
+ const itemIndex = this.filterConfig.findIndex(item => item.id === filterItem.id);
384
+ if (itemIndex > -1) {
385
+ console.warn("[SnkFilterBar.addFilterItem] FilterItem já existe , o mesmo não será adicionado novamente.");
386
+ return Promise.resolve();
387
+ }
388
+ this.filterConfig.push(filterItem);
389
+ this._loadingPending = true;
390
+ this.updateFilter(filterItem);
391
+ return Promise.resolve();
392
+ }
393
+ /**
394
+ * Remove um item de filtro.
395
+ *
396
+ * @param filterID - ID do a ser adicionado
397
+ *
398
+ * @returns {Promise<SnkFilterItemConfig|undefined>} - Retorna o item de filtro removido, ou undefined caso não encontrado.
399
+ */
400
+ async removeFilterItem(filterID) {
401
+ const itemIndex = this.filterConfig.findIndex(item => item.id === filterID);
402
+ if (itemIndex == -1) {
403
+ console.warn("[SnkFilterBar.removeFilterItem] FilterItem não encontrado");
404
+ return Promise.resolve(undefined);
405
+ }
406
+ const itemToRemove = this.filterConfig[itemIndex];
407
+ this.filterConfig = this.filterConfig.filter(item => item.id !== filterID);
408
+ return Promise.resolve(itemToRemove);
409
+ }
410
+ componentDidLoad() {
411
+ if (this._element) {
412
+ const dataInfo = { dataUnit: this.dataUnit };
413
+ core.ElementIDUtils.addIDInfo(this._element, null, dataInfo);
414
+ }
415
+ }
416
+ processPendingFilter() {
417
+ if (this._pendingVariables) {
418
+ const popUp = this._element.querySelector("#filter-PERSONALIZED_FILTER_GROUP");
419
+ if (popUp) {
420
+ popUp.showUp(true).then(() => {
421
+ this.processAfterUpdateConfig();
422
+ });
423
+ }
424
+ }
425
+ else {
426
+ this.processAfterUpdateConfig();
427
+ }
428
+ }
429
+ getPersonalizedFilterItem() {
430
+ return this.filterConfig.find(item => item.type === filterItemType_enum.FilterItemType.PERSONALIZED);
431
+ }
432
+ async processAfterUpdateConfig() {
433
+ var _a;
434
+ if (this._loadingPending) {
435
+ if (await this._application.isLoadedByPk() && !this._configUpdated)
436
+ return;
437
+ const personalizedFilter = this.getPersonalizedFilterItem();
438
+ this._pendingVariables = !PersonalizedFilterUtils.PersonalizedFilterUtils.validateVariableValues(personalizedFilter);
439
+ if (this._pendingVariables) {
440
+ return;
441
+ }
442
+ this._loadingPending = false;
443
+ this.doLoadData(this.dataUnit.getLastLoadRequest() != undefined);
444
+ }
445
+ if (this._configUpdated) {
446
+ this._configUpdated = false;
447
+ ConfigStorage.ConfigStorage.saveFilterBarConfig(this.filterConfig, this.configName, this.resourceID);
448
+ (_a = this.afterApplyConfig) === null || _a === void 0 ? void 0 : _a.call(this);
449
+ }
450
+ }
451
+ async doLoadData(forceReload = false) {
452
+ try {
453
+ if (this._firstLoad && this.autoLoad === false) {
454
+ return;
455
+ }
456
+ if (this._firstLoad && !forceReload && this.autoLoad === undefined) {
457
+ let autoLoad = await this._application.getBooleanParam("global.carregar.registros.iniciar.tela");
458
+ if (!autoLoad) {
459
+ return;
460
+ }
461
+ }
462
+ this.dataUnit.loadData(undefined, undefined, true);
463
+ }
464
+ finally {
465
+ this._firstLoad = false;
466
+ }
467
+ }
468
+ /**
469
+ * Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
470
+ * através de um pequeno modulo na estrutura da aplicação:
471
+ * - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
472
+ * Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-filter-bar.msg.ts"
473
+ */
474
+ getMessage(key, params, defaultValue) {
475
+ var _a;
476
+ if (this.messagesBuilder == undefined && this._application) {
477
+ this.messagesBuilder = this._application.messagesBuilder;
478
+ }
479
+ return ((_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage(key, params)) || defaultValue;
480
+ }
481
+ getFilter(_dataUnit) {
482
+ var _a;
483
+ const filters = [];
484
+ (_a = this.filterConfig) === null || _a === void 0 ? void 0 : _a.filter(item => this.isActiveFilter(item)).forEach(item => {
485
+ const filter = buildFilter(item);
486
+ if (filter) {
487
+ filters.push(filter);
488
+ }
489
+ });
490
+ return filters;
491
+ }
492
+ isActiveFilter(item) {
493
+ /*
494
+ - O filtro padrão também deve sempre ser condiderado ativo, pois, sempre deve
495
+ ser aplicado.
496
+ */
497
+ if (item.type === filterItemType_enum.FilterItemType.DEFAULT_FILTER) {
498
+ return true;
499
+ }
500
+ return this.filterActiveFilter(item) && (item.groupedItems || item.value != undefined);
501
+ }
502
+ async registryFilterProvider() {
503
+ this.dataUnit.addFilterProvider(this);
504
+ if (this.filterConfig) {
505
+ await this.doLoadData();
506
+ }
507
+ }
508
+ itemFocused(selectedItem) {
509
+ this._element.querySelectorAll("snk-filter-item,snk-filter-list").forEach(item => {
510
+ if (item.id === selectedItem) {
511
+ if (item.tagName.toLowerCase() === "snk-filter-item" && item.getClientRects()[0].x < 0) {
512
+ item.scrollIntoView({ behavior: "auto", inline: 'nearest' });
513
+ }
514
+ }
515
+ else {
516
+ item["hideDetail"]();
517
+ }
518
+ });
519
+ }
520
+ filterActiveFilter(item) {
521
+ return item.visible || item.removalBlocked;
522
+ }
523
+ filterPersonalizedItems(item) {
524
+ return item.type === filterItemType_enum.FilterItemType.PERSONALIZED;
525
+ }
526
+ getPersonalizedFilterVariableItems() {
527
+ return this.filterConfig
528
+ .filter(this.filterPersonalizedItems)
529
+ .map(item => {
530
+ const itemId = `filter-${item.id}`;
531
+ return (index$1.h("snk-filter-item", { key: item.id, id: itemId, config: Object.assign({}, item), onFocusin: () => this.itemFocused(itemId), onVisibleChanged: (evt) => this.scrollerLocked = evt.detail, onFilterChange: (event) => this.updateFilter(event.detail), getMessage: (key, props) => this.getMessage(key, props), showChips: false }));
532
+ });
533
+ }
534
+ getFilterItems() {
535
+ const pinnedItems = [];
536
+ const unpinnedItems = [];
537
+ this.filterConfig.sort((a, b) => this._filtersComparator(a, b))
538
+ .filter(this.filterActiveFilter)
539
+ .forEach((item, index) => {
540
+ item = core.ObjectUtils.copy(item);
541
+ const itemId = `filter-${item.id}`;
542
+ const filterItem = (index$1.h("snk-filter-item", { onVisibleChanged: (evt) => this.scrollerLocked = evt.detail, onFilterChange: (event) => this.updateFilter(event.detail), onFocusin: () => this.itemFocused(itemId), id: itemId, config: item, class: index > 0 ? "ez-padding-left--medium" : "", getMessage: (key, props) => this.getMessage(key, props), key: item.id }));
543
+ if (item.fixed || item.hardFixed) {
544
+ pinnedItems.push(filterItem);
545
+ }
546
+ else {
547
+ unpinnedItems.push(filterItem);
548
+ }
549
+ return filterItem;
550
+ });
551
+ const elements = [];
552
+ elements.push(...pinnedItems);
553
+ if (pinnedItems.length > 0 && unpinnedItems.length > 0) {
554
+ elements.push(index$1.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-filter-bar__divider" }));
555
+ }
556
+ elements.push(...unpinnedItems);
557
+ return elements;
558
+ }
559
+ calculateUpdateSequence(item) {
560
+ if (item) {
561
+ this._updateSequence = this._updateSequence.filter(itemId => item.id !== itemId);
562
+ this._updateSequence.push(item.id);
563
+ }
564
+ }
565
+ normalizeItem(item) {
566
+ const normalized = Object.assign({}, item);
567
+ const optionals = ["props", "value", "hardFixed", "fixed"];
568
+ optionals.forEach(prop => {
569
+ if (normalized[prop] == undefined) {
570
+ delete normalized[prop];
571
+ }
572
+ });
573
+ if (item.value === "") {
574
+ delete item.value;
575
+ }
576
+ return normalized;
577
+ }
578
+ updateFilter(newItem) {
579
+ this.filterConfig = this.filterConfig.map(item => {
580
+ newItem = this.normalizeItem(newItem);
581
+ if (item.id === newItem.id) {
582
+ if (core.ObjectUtils.objectToString(item) != core.ObjectUtils.objectToString(newItem)) {
583
+ this.calculateUpdateSequence(newItem);
584
+ }
585
+ return newItem;
586
+ }
587
+ return item;
588
+ }).sort((a, b) => this._filtersComparator(a, b));
589
+ }
590
+ loadPermitions() {
591
+ this._application.isUserSup().then(value => this.allowDefault = value);
592
+ }
593
+ addFilterBarLegacyConfigName() {
594
+ if (this.filterBarLegacyConfigName) {
595
+ ConfigStorage.ConfigStorage.addFilterBarLegacyConfig(this.configName, this.filterBarLegacyConfigName);
596
+ }
597
+ }
598
+ async loadConfigFromStorage(clearCache) {
599
+ try {
600
+ if (clearCache) {
601
+ await ConfigStorage.ConfigStorage.deleteFilterBarConfigCache(this.configName, this.resourceID);
602
+ }
603
+ let config;
604
+ if (this.customFilterBarConfig) {
605
+ config = await this.customFilterBarConfig(this.configName, this.resourceID, { contextURI: this.dataUnit.name });
606
+ }
607
+ else {
608
+ config = await ConfigStorage.ConfigStorage.loadFilterBarConfig(this.configName, this.resourceID, { contextURI: this.dataUnit.name });
609
+ }
610
+ this.filterConfig = config.map(item => this.normalizeItem(item));
611
+ this.filterConfig.sort((a, b) => this._filtersComparator(a, b));
612
+ }
613
+ catch (e) {
614
+ throw new core.ErrorException(this.getMessage("snkFilterBar.failToLoadConfig"), e);
615
+ }
616
+ }
617
+ async attachDataUnit() {
618
+ if (this.dataUnit == undefined) {
619
+ let parent = this._element.parentElement;
620
+ while (parent) {
621
+ if (parent.tagName.toUpperCase() === "SNK-DATA-UNIT") {
622
+ const snkDataUnit = parent;
623
+ this.dataUnit = snkDataUnit.dataUnit;
624
+ if (this.dataUnit) {
625
+ await this.registryFilterProvider();
626
+ }
627
+ else {
628
+ snkDataUnit.addEventListener("dataUnitReady", async (evt) => {
629
+ this.dataUnit = evt.detail;
630
+ await this.registryFilterProvider();
631
+ });
632
+ }
633
+ break;
634
+ }
635
+ }
636
+ parent = parent.parentElement;
637
+ }
638
+ else {
639
+ await this.registryFilterProvider();
640
+ }
641
+ }
642
+ /**
643
+ * Emitido quando acontece a alteração do estado do filtro.
644
+ */
645
+ filterChangeListener(evt) {
646
+ this.updateFilter(evt.detail);
647
+ }
648
+ /**
649
+ * Abre o modal de filtros
650
+ */
651
+ async showFilterModal() {
652
+ const callbackOnApplyFilter = (filters) => {
653
+ var _a;
654
+ this.filterConfig = filters.map(this.normalizeItem).sort((a, b) => this._filtersComparator(a, b));
655
+ (_a = this.afterApplyConfig) === null || _a === void 0 ? void 0 : _a.call(this);
656
+ };
657
+ let filtersConfigCopy = core.ObjectUtils.copy(this.filterConfig);
658
+ filtersConfigCopy = filtersConfigCopy.sort((itemA, itemB) => {
659
+ return itemA.originOrder - itemB.originOrder;
660
+ });
661
+ const factoryParams = {
662
+ filterConfig: filtersConfigCopy,
663
+ configName: this.configName,
664
+ onComplete: callbackOnApplyFilter,
665
+ disablePersonalizedFilter: this.disablePersonalizedFilter,
666
+ getMessage: (key, props) => this.getMessage(key, props),
667
+ onAddPersonalizedFilter: (isDefault) => this.addPersonalizedFilter(isDefault),
668
+ onEditPersonalizedFilter: (id, isDefault) => this.editPersonalizedFilter(id, isDefault),
669
+ onDeletePersonalizedFilter: (filter, configName, isDefault) => this.deletePersonalizedFilter(filter, filterItemType_enum.FilterItemType.PERSONALIZED, configName, isDefault),
670
+ };
671
+ this._filterModalFactory = new SnkFilterModalFactory(factoryParams);
672
+ await this._filterModalFactory.showModal();
673
+ }
674
+ addPersonalizedFilter(isDefault = false) {
675
+ this._filterModalFactory.closeModal();
676
+ this._isDefaultFilter = isDefault;
677
+ this.personalizedFilterId = undefined;
678
+ this.showPersonalizedFilter = true;
679
+ window.requestAnimationFrame(() => {
680
+ this._elPersonalizedFilter.createPersonalizedFilter();
681
+ });
682
+ }
683
+ editPersonalizedFilter(id, isDefault = false) {
684
+ this._filterModalFactory.closeModal();
685
+ this._isDefaultFilter = isDefault;
686
+ this.showPersonalizedFilter = true;
687
+ this.personalizedFilterId = id;
688
+ }
689
+ deletePersonalizedFilter(filter, filterItemType, configName, isDefault = false) {
690
+ if (isDefault) {
691
+ ConfigStorage.ConfigStorage.removeDefaultFilter(filter, this.resourceID, configName);
692
+ this._isDefaultFilter = false;
693
+ return;
694
+ }
695
+ if (filterItemType === filterItemType_enum.FilterItemType.PERSONALIZED) {
696
+ ConfigStorage.ConfigStorage.removePersonalizedFilter(filter, this.resourceID, configName);
697
+ }
698
+ }
699
+ handleHidePersonalizedFilter(reloadFilterBar) {
700
+ if (reloadFilterBar) {
701
+ this.loadConfigFromStorage().then(() => {
702
+ this.hidePersonalizedFilter();
703
+ });
704
+ }
705
+ else {
706
+ this.hidePersonalizedFilter();
707
+ }
708
+ }
709
+ hidePersonalizedFilter() {
710
+ this.personalizedFilterId = undefined;
711
+ this.showPersonalizedFilter = false;
712
+ this._isDefaultFilter = false;
713
+ }
714
+ async componentWillLoad() {
715
+ var _a;
716
+ try {
717
+ this._application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
718
+ await this.attachDataUnit();
719
+ if (this._application) {
720
+ if (this._application.enableLockManagerLoadingApp && this.enableLockManagerLoadingComp) {
721
+ const appLoadLockerID = core.LockManager.addLockManagerCtxId(this._element);
722
+ this._resolveLoading = core.LockManager.lock(appLoadLockerID, core.LockManagerOperation.APP_LOADING);
723
+ }
724
+ await Promise.all([
725
+ this.loadPermitions(),
726
+ this.addFilterBarLegacyConfigName(),
727
+ this.loadConfigFromStorage(),
728
+ ]);
729
+ }
730
+ }
731
+ finally {
732
+ (_a = this._resolveLoading) === null || _a === void 0 ? void 0 : _a.call(this);
733
+ }
734
+ }
735
+ componentDidRender() {
736
+ this.processPendingFilter();
737
+ }
738
+ render() {
739
+ if (!this.dataUnit || !this.filterConfig || this.filterConfig.length === 0) {
740
+ return undefined;
741
+ }
742
+ if (this.showPersonalizedFilter) {
743
+ return index$1.h("snk-personalized-filter", { class: "filter-bar__personalized-filter", filterId: this.personalizedFilterId, ref: (el) => this._elPersonalizedFilter = el, isDefaultFilter: this._isDefaultFilter, onEzCancel: () => this.handleHidePersonalizedFilter(false), onEzAfterSave: () => this.handleHidePersonalizedFilter(true), entityUri: this.dataUnit.name, configName: this.configName, resourceID: this.resourceID });
744
+ }
745
+ if (this.mode !== "regular") {
746
+ return (index$1.h(index$1.Host, { "data-mode": this.mode }, this.getPersonalizedFilterVariableItems(), this.mode === 'button' && (index$1.h("ez-button", { class: "ez-margin-left--medium", size: "small", label: this.getMessage('snkFilterBar.filters', undefined, 'Filtros'), onClick: this.showFilterModal.bind(this) }))));
747
+ }
748
+ return (index$1.h(index$1.Host, null, index$1.h("div", null, index$1.h("span", { class: "snk-filter-bar__title", title: this.title, "data-tooltip": this.title, "data-flow": "bottom" }, this.title)), index$1.h("ez-scroller", { class: "snk-filter-bar__scroller", direction: EzScrollDirection.EzScrollDirection.HORIZONTAL, activeShadow: true, locked: this.scrollerLocked }, index$1.h("section", { class: "snk-filter-bar__filter-item-container" }, this.getFilterItems())), index$1.h("ez-button", { class: "ez-padding-left--medium ez-margin-top--extra-small", size: "small", label: this.getMessage('snkFilterBar.filters', undefined, 'Filtros'), onClick: this.showFilterModal.bind(this) }, index$1.h("ez-icon", { slot: "leftIcon", iconName: "plus", class: "ez-padding-right--small" }))));
749
+ }
750
+ get _element() { return index$1.getElement(this); }
751
+ static get watchers() { return {
752
+ "filterConfig": ["observeFilterConfig"]
753
+ }; }
754
+ };
755
+ SnkFilterBar.style = snkFilterBarCss;
756
+
757
+ const SnkFilterItem = class {
758
+ constructor(hostRef) {
759
+ index$1.registerInstance(this, hostRef);
760
+ this.visibleChanged = index$1.createEvent(this, "visibleChanged", 7);
761
+ this.filterChange = index$1.createEvent(this, "filterChange", 3);
762
+ this.innerClickCheck = (_floatingContainer, node) => {
763
+ if (node.id != core.FloatingManager.MODAL_ELEMENT_ID) {
764
+ return true;
765
+ }
766
+ this.detailIsVisible = false;
767
+ return false;
768
+ };
769
+ this.detailIsVisible = undefined;
770
+ this.config = undefined;
771
+ this.getMessage = undefined;
772
+ this.showChips = true;
773
+ }
774
+ observeDetailIsVisible(value) {
775
+ this.visibleChanged.emit(value);
776
+ }
777
+ /**
778
+ * Exibe os detalhes de um item da lista.
779
+ */
780
+ async showUp(open = false) {
781
+ return new Promise(resolve => {
782
+ var _a;
783
+ this._filterItemElement.scrollIntoView({ behavior: "auto", block: "nearest", inline: "nearest" });
784
+ if (open) {
785
+ this._closeCallback = resolve;
786
+ (_a = this._chipElement) === null || _a === void 0 ? void 0 : _a.blur();
787
+ window.requestAnimationFrame(() => {
788
+ this._floatingID = core.FloatingManager.float(this._popover, this._popoverContainer, this.getFloatOptions());
789
+ this._popover.show();
790
+ this.detailIsVisible = true;
791
+ });
792
+ }
793
+ });
794
+ }
795
+ updatePosition() {
796
+ if (this._floatingID == undefined) {
797
+ return;
798
+ }
799
+ core.FloatingManager.updateFloatPosition(this._popover, this._popoverContainer, this.getFloatOptions());
800
+ }
801
+ getFloatOptions() {
802
+ return {
803
+ autoClose: true,
804
+ innerClickTest: this.innerClickCheck,
805
+ backClickListener: () => this.onDetailCloseCallback(),
806
+ left: this.getOffsetLeft(),
807
+ top: this.getOffsetTop(),
808
+ useOverlay: true,
809
+ overlayClassName: 'ez-scrim ez-scrim--light',
810
+ isFixed: true
811
+ };
812
+ }
813
+ getOffsetLeft() {
814
+ const padding = getComputedStyle(this._filterItemElement).getPropertyValue("padding-left");
815
+ const rect = this._filterItemElement.getBoundingClientRect();
816
+ // Width baseado no conteudo do snk-filter-detail. Nesse momento ele retorna 0px pois ainda não foi criado em tela.
817
+ const filterDetailWidth = 430;
818
+ const adjustRightPosition = filterDetailWidth - (document.body.clientWidth - rect.left);
819
+ return `calc(${rect.x}px + ${padding} - ${adjustRightPosition > 0 ? adjustRightPosition : 0}px)`;
820
+ }
821
+ getOffsetTop() {
822
+ const rect = this._filterItemElement.getBoundingClientRect();
823
+ return (rect.y + rect.height) + "px";
824
+ }
825
+ controlScrollPage() {
826
+ window.removeEventListener("scroll", this.updatePosition.bind(this));
827
+ window.addEventListener("scroll", this.updatePosition.bind(this));
828
+ }
829
+ getConfigChanges() {
830
+ var _a;
831
+ const configToBeCleared = this.config;
832
+ if (!!((_a = configToBeCleared.groupedItems) === null || _a === void 0 ? void 0 : _a.length)) {
833
+ configToBeCleared.visible = false;
834
+ configToBeCleared.groupedItems = configToBeCleared.groupedItems.map(item => (Object.assign(Object.assign({}, item), { visible: false })));
835
+ }
836
+ const hasMultiValues = configToBeCleared.type === filterItemType_enum.FilterItemType.MULTI_LIST && Array.isArray(configToBeCleared.value);
837
+ const newValue = hasMultiValues ? configToBeCleared.value.map((valueItem) => (Object.assign(Object.assign({}, valueItem), { check: false }))) : undefined;
838
+ return Object.assign(Object.assign({}, configToBeCleared), { value: newValue });
839
+ }
840
+ /**
841
+ * Oculta os detalhes de um item da lista.
842
+ */
843
+ async hideDetail() {
844
+ if (this.detailIsVisible) {
845
+ if (this._floatingID != undefined) {
846
+ core.FloatingManager.close(this._floatingID);
847
+ }
848
+ }
849
+ }
850
+ onDetailCloseCallback() {
851
+ this._floatingID = undefined;
852
+ this.detailIsVisible = false;
853
+ if (this._closeCallback) {
854
+ this._closeCallback();
855
+ this._closeCallback = undefined;
856
+ }
857
+ }
858
+ //---------------------------------------------
859
+ // Event handlers
860
+ //---------------------------------------------
861
+ clickListener(evt) {
862
+ if ([this._chipElement, this._leftIconElement, this._rightIconElement].includes(evt.target)) {
863
+ if (evt.target === this._rightIconElement && this.canClearFilter()) {
864
+ const configChanged = this.getConfigChanges();
865
+ this.filterChange.emit(configChanged);
866
+ }
867
+ else {
868
+ if (this.detailIsVisible) {
869
+ this.hideDetail();
870
+ }
871
+ else {
872
+ this.showUp(true);
873
+ }
874
+ }
875
+ evt.preventDefault();
876
+ evt.stopImmediatePropagation();
877
+ evt.stopPropagation();
878
+ }
879
+ }
880
+ mouseDownListener(evt) {
881
+ if (this.detailIsVisible && [this._chipElement, this._leftIconElement, this._rightIconElement].includes(evt.target)) {
882
+ evt.preventDefault();
883
+ evt.stopImmediatePropagation();
884
+ evt.stopPropagation();
885
+ }
886
+ }
887
+ getLabel(isTooltipLabel = false) {
888
+ var _a, _b;
889
+ const { type, value, label, props, groupedItems = [] } = this.config;
890
+ if (value || groupedItems.length) {
891
+ if (type === filterItemType_enum.FilterItemType.BINARY_SELECT) {
892
+ const [optOne, optTwo] = props.options;
893
+ const tooltip = this.getMessage('snkFilterBar.binarySelectTooltip');
894
+ if (optOne.name === value) {
895
+ return isTooltipLabel ? `${tooltip} ${String(optOne.label).toLowerCase()}` : optOne.label;
896
+ }
897
+ if (optTwo.name === value) {
898
+ return isTooltipLabel ? `${tooltip} ${String(optTwo.label).toLowerCase()}` : optTwo.label;
899
+ }
900
+ }
901
+ if (type === filterItemType_enum.FilterItemType.MULTI_SELECT) {
902
+ const opt = props.options.find(opt => opt.value === value);
903
+ return `${label}: ${opt.label}`;
904
+ }
905
+ if (type === filterItemType_enum.FilterItemType.PERIOD) {
906
+ let { end, start } = value;
907
+ if (typeof end === "string") {
908
+ end = new Date(end);
909
+ end.setMinutes(end.getMinutes() + end.getTimezoneOffset());
910
+ }
911
+ if (typeof start === "string") {
912
+ start = new Date(start);
913
+ start.setMinutes(start.getMinutes() + start.getTimezoneOffset());
914
+ }
915
+ const dateFormater = new Intl.DateTimeFormat("pt-BR");
916
+ if (end && start) {
917
+ const isSameYear = start.getFullYear() === end.getFullYear();
918
+ const formatOptions = Object.assign({ day: '2-digit', month: '2-digit' }, ((!isSameYear || isTooltipLabel) && { year: '2-digit' }));
919
+ const startLabel = core.DateUtils.formatDate(start, formatOptions);
920
+ const endLabel = core.DateUtils.formatDate(end, formatOptions);
921
+ if (isTooltipLabel) {
922
+ return this.getMessage('snkFilterBar.fullPeriodTooltip', { LABEL: label, START_LABEL: startLabel, END_LABEL: endLabel });
923
+ }
924
+ return `${label}: ${startLabel} \u2192 ${endLabel}`;
925
+ }
926
+ else {
927
+ if (start) {
928
+ return `${label}: ${this.getMessage('snkFilterBar.onlyStartToltip')} ${dateFormater.format(start)}`;
929
+ }
930
+ else if (end) {
931
+ return `${label}: ${this.getMessage('snkFilterBar.onlyEndToltip')} ${dateFormater.format(end)}`;
932
+ }
933
+ else {
934
+ return label;
935
+ }
936
+ }
937
+ }
938
+ if (type === filterItemType_enum.FilterItemType.SEARCH) {
939
+ return `${label}: ${value.value} - ${value.label}`;
940
+ }
941
+ if (type === filterItemType_enum.FilterItemType.PERSONALIZED) {
942
+ const activeCount = this.calculateActiveCount(groupedItems);
943
+ if (activeCount <= 0)
944
+ return label;
945
+ return `${label}: ${this.getMessage('snkFilterBar.personalizedCount', { activeCount })}`;
946
+ }
947
+ if (type === filterItemType_enum.FilterItemType.MULTI_LIST) {
948
+ const selectedOptions = ((_a = value.elements) !== null && _a !== void 0 ? _a : value).filter(item => item === null || item === void 0 ? void 0 : item.check);
949
+ return this.getLabelFromCheckedOptions(selectedOptions, label, isTooltipLabel);
950
+ }
951
+ if (type === filterItemType_enum.FilterItemType.CHECK_BOX_LIST) {
952
+ const selectedValues = Object.entries(value !== null && value !== void 0 ? value : {})
953
+ .filter(([_, value]) => value === true)
954
+ .map(([key, _]) => key);
955
+ const options = (_b = props.options) !== null && _b !== void 0 ? _b : [];
956
+ const selectedOptions = options.filter(option => selectedValues.includes(option.name));
957
+ return this.getLabelFromCheckedOptions(selectedOptions, label, isTooltipLabel);
958
+ }
959
+ if (type === filterItemType_enum.FilterItemType.NUMBER && props.variation === filterNumberVariation.FilterNumberVariation.INTERVAL) {
960
+ const { start, end } = value;
961
+ if (!isNaN(start) && !isNaN(end)) {
962
+ return this.getMessage('snkFilterBar.fullIntervalTooltip', { LABEL: label, START_LABEL: start, END_LABEL: end });
963
+ }
964
+ if (!isNaN(start)) {
965
+ return `${label}: ${this.getMessage('snkFilterBar.onlyStartToltip')} ${Number(start)}`;
966
+ }
967
+ if (!isNaN(end)) {
968
+ return `${label}: ${this.getMessage('snkFilterBar.onlyEndToltip')} ${Number(end)}`;
969
+ }
970
+ }
971
+ if (this.config.mask) {
972
+ const _maskFormatter = new core.MaskFormatter(this.config.mask);
973
+ return `${label}: ${_maskFormatter.format(value)}`;
974
+ }
975
+ return `${label}: ${value}`;
976
+ }
977
+ return label;
978
+ }
979
+ getLabelFromCheckedOptions(selectedOptions, label, isTooltipLabel) {
980
+ const checkedAmount = selectedOptions.length;
981
+ if (checkedAmount === 0) {
982
+ return `${label}`;
983
+ }
984
+ if (checkedAmount > 1) {
985
+ if (isTooltipLabel) {
986
+ const selectedOptionsDescrptions = selectedOptions.map(item => item.label);
987
+ return `${label}: ${selectedOptionsDescrptions.join(',')}`;
988
+ }
989
+ return `${label}: ${checkedAmount} ${this.getMessage('snkFilterBar.multiListToltip')}`;
990
+ }
991
+ return `${label}: ${selectedOptions[0].label}`;
992
+ }
993
+ calculateActiveCount(groupedItems) {
994
+ return groupedItems.reduce((total, item) => {
995
+ if (!!item.visible)
996
+ return total + 1;
997
+ return total;
998
+ }, 0);
999
+ }
1000
+ componentDidLoad() {
1001
+ if (this._filterItemElement) {
1002
+ core.ElementIDUtils.addIDInfo(this._filterItemElement);
1003
+ this._idSnkFilterDetail = `filterDetail_${this.config.id}`;
1004
+ }
1005
+ this.controlScrollPage();
1006
+ }
1007
+ componentDidRender() {
1008
+ if (this._floatingID == undefined) {
1009
+ if (this._popover) {
1010
+ this._popover.remove();
1011
+ }
1012
+ }
1013
+ }
1014
+ /**
1015
+ * Emitido quando o estado do filtro é alterado.
1016
+ */
1017
+ filterChangeListener() {
1018
+ this.hideDetail();
1019
+ }
1020
+ canClearFilter() {
1021
+ const { value, groupedItems = [] } = this.config;
1022
+ if (value != undefined && this.config.type === filterItemType_enum.FilterItemType.MULTI_LIST) {
1023
+ return value.some((item) => item.check);
1024
+ }
1025
+ return value !== undefined || groupedItems.some(item => item.visible);
1026
+ }
1027
+ getRightIconName() {
1028
+ if (this.canClearFilter())
1029
+ return "close";
1030
+ return this.detailIsVisible ? "chevron-up" : "chevron-down";
1031
+ }
1032
+ getLeftIconName() {
1033
+ switch (this.config.type) {
1034
+ case filterItemType_enum.FilterItemType.PERIOD:
1035
+ return "calendar";
1036
+ case filterItemType_enum.FilterItemType.PERSONALIZED:
1037
+ return "tune";
1038
+ }
1039
+ return undefined;
1040
+ }
1041
+ hasActiveElements(value) {
1042
+ var _a, _b, _c;
1043
+ return ((_c = (_b = ((_a = value === null || value === void 0 ? void 0 : value.elements) !== null && _a !== void 0 ? _a : value)) === null || _b === void 0 ? void 0 : _b.filter(val => val === null || val === void 0 ? void 0 : val.check)) === null || _c === void 0 ? void 0 : _c.length) > 0;
1044
+ }
1045
+ hasActiveValue(config) {
1046
+ return (config.type !== filterItemType_enum.FilterItemType.MULTI_LIST && config.value !== undefined) || this.hasActiveElements(config.value);
1047
+ }
1048
+ getEnabledChip() {
1049
+ if (this.config.type === filterItemType_enum.FilterItemType.PERSONALIZED) {
1050
+ const { groupedItems = [] } = this.config;
1051
+ return groupedItems.some(item => item.visible);
1052
+ }
1053
+ return this.hasActiveValue(this.config);
1054
+ }
1055
+ render() {
1056
+ const leftIcon = this.getLeftIconName();
1057
+ return (index$1.h(index$1.Host, null, this.showChips && (index$1.h("ez-chip", { id: this.config.id, ref: ref => this._chipElement = ref, label: this.getLabel(), value: this.getEnabledChip() }, leftIcon && (index$1.h("ez-icon", { ref: ref => this._leftIconElement = ref, iconName: leftIcon, class: "ez-padding-right--small", slot: "leftIcon" })), index$1.h("ez-icon", { ref: ref => this._rightIconElement = ref, iconName: this.getRightIconName(), class: "ez-padding-left--small", slot: "rightIcon", id: "removeFilter" }))), index$1.h("section", { class: "ez-margin-top--small sc-snk-filter-bar snk-filter__popover-container", ref: elem => this._popoverContainer = elem }, index$1.h("snk-filter-detail", { config: this.config, getMessage: this.getMessage, class: "sc-snk-filter-bar snk-filter__popover ez-padding--small ez-elevation--16", ref: elem => this._popover = elem, key: this.config.id, "data-element-id": this._idSnkFilterDetail, showHardFixed: this.showChips }))));
1058
+ }
1059
+ get _filterItemElement() { return index$1.getElement(this); }
1060
+ static get watchers() { return {
1061
+ "detailIsVisible": ["observeDetailIsVisible"]
1062
+ }; }
1063
+ };
1064
+
1065
+ const SHOW_MORE_ITEM_NAME = "__SHOWMORE__";
1066
+ const MAX_FILTERS = 5;
1067
+ const SnkFilterList = class {
1068
+ constructor(hostRef) {
1069
+ index$1.registerInstance(this, hostRef);
1070
+ this.snkItemSelected = index$1.createEvent(this, "snkItemSelected", 7);
1071
+ this._preselection = -1;
1072
+ this.innerClickCheck = (_floatingContainer, node) => {
1073
+ if (node.id != core.FloatingManager.MODAL_ELEMENT_ID) {
1074
+ return true;
1075
+ }
1076
+ this._detailIsVisible = false;
1077
+ return false;
1078
+ };
1079
+ this._filterArgument = undefined;
1080
+ this._showAll = undefined;
1081
+ this.label = undefined;
1082
+ this.iconName = undefined;
1083
+ this.items = undefined;
1084
+ this.getMessage = undefined;
1085
+ this.emptyText = undefined;
1086
+ this.findFilterText = undefined;
1087
+ this.buttonClass = undefined;
1088
+ }
1089
+ showDetail() {
1090
+ this._preselection = -1;
1091
+ this._floatingID = core.FloatingManager.float(this._popover, this._popoverContainer, {
1092
+ autoClose: true,
1093
+ innerClickTest: this.innerClickCheck,
1094
+ backClickListener: () => this.onListCloseCallback(),
1095
+ useOverlay: true
1096
+ });
1097
+ this._detailIsVisible = true;
1098
+ this._showAll = false;
1099
+ this._filterArgument = "";
1100
+ this._filterInput.setFocus();
1101
+ }
1102
+ /**
1103
+ * Oculta os detalhes do componente snk-filter-list.
1104
+ */
1105
+ async hideDetail() {
1106
+ if (this._floatingID != undefined) {
1107
+ core.FloatingManager.close(this._floatingID);
1108
+ }
1109
+ }
1110
+ onListCloseCallback() {
1111
+ this._floatingID = undefined;
1112
+ this._detailIsVisible = false;
1113
+ }
1114
+ buttonClick() {
1115
+ if (this._detailIsVisible) {
1116
+ this.hideDetail();
1117
+ }
1118
+ else {
1119
+ this.showDetail();
1120
+ }
1121
+ }
1122
+ componentDidLoad() {
1123
+ if (this._element) {
1124
+ core.ElementIDUtils.addIDInfo(this._element);
1125
+ }
1126
+ }
1127
+ componentDidRender() {
1128
+ if (this._floatingID == undefined) {
1129
+ if (this._popover) {
1130
+ this._popover.remove();
1131
+ }
1132
+ }
1133
+ }
1134
+ buildIdElement(buttonElement, name) {
1135
+ if (!buttonElement)
1136
+ return;
1137
+ const dataElement = { id: name };
1138
+ buttonElement.removeAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME);
1139
+ core.ElementIDUtils.addIDInfoIfNotExists(buttonElement, "filterItemList", dataElement);
1140
+ }
1141
+ buildItemElement(item) {
1142
+ const itemId = ++this._selectableItemsCount;
1143
+ return (index$1.h("button", { ref: elem => elem && this.buildIdElement(elem, item.label), id: `filter-item${itemId}`, onFocusin: () => this._preselection = itemId, class: `ez-col ez-col--sd-12 ez-align--middle ez-padding--small sc-snk-filter-bar snk-filter-bar__filter-list-item`, onClick: () => this.itemSelected(item.name), name: item.label, key: itemId }, item.iconName ? index$1.h("ez-icon", { iconName: item.iconName, size: "small", class: `ez-padding-right--extra-small sc-snk-filter-bar snk-filter-bar__filter-list-item__icon ${item.iconClass || ""}` }) : undefined, index$1.h("div", { class: `ez-text ez-text--medium ez-text--primary ez-padding--extra-small sc-snk-filter-bar snk-filter-bar__filter-list-item__label ${item.labelClass || ""}` }, item.label)));
1144
+ }
1145
+ itemSelected(itemName) {
1146
+ if (itemName === SHOW_MORE_ITEM_NAME) {
1147
+ this._showAll = true;
1148
+ }
1149
+ else {
1150
+ this.hideDetail();
1151
+ this.snkItemSelected.emit(itemName);
1152
+ }
1153
+ }
1154
+ getFilterItems() {
1155
+ const items = this.items ? core.ArrayUtils.applyStringFilter(this._filterArgument, this.items.filter(item => item.kind === "FILTER")) : [];
1156
+ if (items.length === 0) {
1157
+ return index$1.h("div", { class: "ez-text ez-text--medium ez-text--primary ez-padding--extra-small sc-snk-filter-bar snk-filter-bar__filter-list-items-container--empty" }, this.emptyText);
1158
+ }
1159
+ const hideItems = !this._filterArgument && !this._showAll && (items.length > MAX_FILTERS + 1);
1160
+ if (hideItems) {
1161
+ items.splice(MAX_FILTERS);
1162
+ items.push({ kind: "INTERNAL", label: "Mostrar mais", iconName: "dots-horizontal", name: SHOW_MORE_ITEM_NAME, iconClass: "snk-filter-bar__filter-list-item__icon--secondary", labelClass: "snk-filter-bar__filter-list-item__label--secondary" });
1163
+ }
1164
+ this._selectableItemsCount = 0;
1165
+ return index$1.h("div", { class: "sc-snk-filter-bar snk-filter-bar__filter-list-items-container" }, items.map(item => this.buildItemElement(item)));
1166
+ }
1167
+ getFooterItems() {
1168
+ return this.items.filter(item => item.kind === "FOOTER");
1169
+ }
1170
+ keyDownHandler(event) {
1171
+ switch (event.key) {
1172
+ case "ArrowDown":
1173
+ this.changePreselection(this._preselection + 1);
1174
+ //Paramos a propagação do evento para evitar scroll indesejado
1175
+ event.stopImmediatePropagation();
1176
+ event.stopPropagation();
1177
+ event.preventDefault();
1178
+ break;
1179
+ case "ArrowUp":
1180
+ this.changePreselection(this._preselection - 1);
1181
+ //Paramos a propagação do evento para evitar scroll indesejado
1182
+ event.stopImmediatePropagation();
1183
+ event.stopPropagation();
1184
+ event.preventDefault();
1185
+ break;
1186
+ }
1187
+ }
1188
+ changePreselection(newSelection) {
1189
+ if (newSelection < 0) {
1190
+ newSelection = this._selectableItemsCount;
1191
+ }
1192
+ this._preselection = newSelection > this._selectableItemsCount ? 0 : newSelection;
1193
+ if (this._preselection === 0) {
1194
+ this._filterInput.setFocus();
1195
+ }
1196
+ else {
1197
+ const item = this._element.querySelector(`#filter-item${this._preselection}`);
1198
+ if (item) {
1199
+ item.focus();
1200
+ }
1201
+ }
1202
+ }
1203
+ render() {
1204
+ return (index$1.h(index$1.Host, { class: "ez-flex ez-flex--column" }, index$1.h("ez-button", { class: this.buttonClass, label: this.label, onClick: () => this.buttonClick(), mode: this.iconName ? "icon" : undefined, iconName: this.iconName, size: "small" }, index$1.h("slot", { name: "leftIcon" })), index$1.h("section", { class: "ez-margin-top--small sc-snk-filter-bar snk-filter__popover-container", ref: elem => this._popoverContainer = elem }, index$1.h("div", { class: "sc-snk-filter-bar snk-filter__popover ez-padding--small ez-elevation--4", ref: elem => this._popover = elem }, index$1.h("ez-filter-input", { ref: ref => this._filterInput = ref, "data-element-id": "serachFilters", mode: "slim", label: this.findFilterText, value: this._filterArgument, onEzChange: (evt) => this._filterArgument = evt.detail, onFocus: () => this._preselection = 0 }), this.getFilterItems(), index$1.h("hr", { class: "sc-snk-filter-bar snk-filter__popover-rule" }), this.items ? this.getFooterItems().map(item => this.buildItemElement(item)) : undefined))));
1205
+ }
1206
+ get _element() { return index$1.getElement(this); }
1207
+ };
1208
+
1209
+ const snkFilterModalCss = "ez-modal{--ez-modal-content-padding:24px 12px}.snk-filter-modal__container{width:344px;max-width:344px;min-width:344px;overflow:hidden}.snk-filter-modal__content{display:flex;flex-direction:column;gap:var(--space--medium, 12px);padding-right:var(--space--3xs, 4px)}.snk-filter-modal__collapsible-box{border:var(--border--small, 1px solid) var(--color--strokes, #DCE0E8);border-radius:var(--border--radius-medium);padding:var(--space--medium, 12px) var(--space--small, 6px)}.snk-filter-modal__rendered-items{max-height:760px;overflow-x:hidden;overflow-y:auto}.snk-filter-modal__rendered-items::-webkit-scrollbar{width:var(--space--small);min-width:var(--space--small);max-width:var(--space--small)}";
1210
+
1211
+ const SnkFilterModal = class {
1212
+ constructor(hostRef) {
1213
+ index$1.registerInstance(this, hostRef);
1214
+ this.getMessage = undefined;
1215
+ this.configName = undefined;
1216
+ this.filters = undefined;
1217
+ this.applyFilters = undefined;
1218
+ this.closeModal = undefined;
1219
+ this.addPersonalizedFilter = undefined;
1220
+ this.editPersonalizedFilter = undefined;
1221
+ this.deletePersonalizedFilter = undefined;
1222
+ this.filtersToDelete = [];
1223
+ this.filterDefaultToDelete = undefined;
1224
+ this.disablePersonalizedFilter = undefined;
1225
+ }
1226
+ /**
1227
+ * Emitido quando um filtro personalizado é deletado.
1228
+ */
1229
+ deletePersonalizedFilterListener(event) {
1230
+ this.filtersToDelete.push(event.detail);
1231
+ }
1232
+ getCustomMessage(key, params) {
1233
+ var _a;
1234
+ return (_a = this.getMessage) === null || _a === void 0 ? void 0 : _a.call(this, `snkFilterBar.filterModal.${key}`, params);
1235
+ }
1236
+ //TODO: tratar clear all dos filtros personalizados
1237
+ handleClearAll() {
1238
+ const { customFilters, quickFilters, otherFilters, multiListFilters } = this.filters.reduce((acc, filter) => {
1239
+ if (filter.type === filterItemType_enum.FilterItemType.MULTI_LIST) {
1240
+ acc.multiListFilters.push(filter);
1241
+ return acc;
1242
+ }
1243
+ if (filter.filterType === filterType_enum.FilterType.QUICK_FILTER) {
1244
+ acc.quickFilters.push(filter);
1245
+ return acc;
1246
+ }
1247
+ if (filter.filterType === filterType_enum.FilterType.CUSTOM_FILTER) {
1248
+ acc.customFilters.push(filter);
1249
+ return acc;
1250
+ }
1251
+ if (filter.filterType === filterType_enum.FilterType.OTHER_FILTERS) {
1252
+ acc.otherFilters.push(filter);
1253
+ return acc;
1254
+ }
1255
+ return acc;
1256
+ }, { quickFilters: [], customFilters: [], otherFilters: [], multiListFilters: [] });
1257
+ this.handleClearFilterList(quickFilters);
1258
+ this.handleClearCustomFilters(customFilters);
1259
+ this.handleClearOthersFilters(otherFilters);
1260
+ multiListFilters.forEach(multiListFilter => this.handleClearSigleFilter(multiListFilter));
1261
+ }
1262
+ handleClearOthersFilters(otherFilters) {
1263
+ this.filters = this.filters.map(filter => otherFilters.includes(filter) ? (Object.assign(Object.assign({}, filter), { value: undefined })) : filter);
1264
+ }
1265
+ handleClearCustomFilters(customFilters) {
1266
+ this.filters.forEach((filter, index) => {
1267
+ if (filter.filterType === filterType_enum.FilterType.CUSTOM_FILTER)
1268
+ this.filters[index] = this.clearAllCustomFilter(customFilters).shift();
1269
+ });
1270
+ }
1271
+ clearAllCustomFilter(filterConfigSnapshot) {
1272
+ return filterConfigSnapshot.map(filterItem => {
1273
+ const copy = Object.assign({}, filterItem);
1274
+ delete copy.value;
1275
+ copy.visible = false;
1276
+ if (copy.groupedItems) {
1277
+ copy.groupedItems = this.clearAllCustomFilter(copy.groupedItems);
1278
+ }
1279
+ return copy;
1280
+ });
1281
+ }
1282
+ hasChangeToSave() {
1283
+ const hasChangesPersonalizedFilters = core.ObjectUtils.objectToString(this.filters) !== core.ObjectUtils.objectToString(this._originalFilterConfig);
1284
+ return hasChangesPersonalizedFilters;
1285
+ }
1286
+ handleClose() {
1287
+ const hasChangesToSave = this.hasChangeToSave();
1288
+ if (!hasChangesToSave) {
1289
+ this.closeModal();
1290
+ return;
1291
+ }
1292
+ return utils.ApplicationUtils.confirm(this.getCustomMessage('validations.notSaved.title'), this.getCustomMessage('validations.notSaved.message')).then((cancelAction) => {
1293
+ if (cancelAction)
1294
+ this.closeModal();
1295
+ });
1296
+ }
1297
+ handleApplyFilters() {
1298
+ const filterPersonalized = this.filters.find(filter => filter.filterType === filterType_enum.FilterType.CUSTOM_FILTER || filter.filterType === filterType_enum.FilterType.DEFAULT_FILTER);
1299
+ if (this.isValidCustomFilter(filterPersonalized)) {
1300
+ this.applyFilters(this.filters);
1301
+ }
1302
+ if (this.filtersToDelete.length > 0) {
1303
+ this.filtersToDelete.forEach(filter => {
1304
+ this.deletePersonalizedFilter(filter, this.configName);
1305
+ });
1306
+ this.filtersToDelete = [];
1307
+ }
1308
+ if (this.filterDefaultToDelete) {
1309
+ this.deletePersonalizedFilter(this.filterDefaultToDelete, this.configName, true);
1310
+ this._defaultFilter = undefined;
1311
+ this.filterDefaultToDelete = undefined;
1312
+ }
1313
+ }
1314
+ isValidCustomFilter(filterPersonalized) {
1315
+ const isValid = PersonalizedFilterUtils.PersonalizedFilterUtils.validateVariableValues(filterPersonalized);
1316
+ if (!isValid) {
1317
+ utils.ApplicationUtils.alert(this.getCustomMessage('validations.notFullFilled.title'), this.getCustomMessage('validations.notFullFilled.message'));
1318
+ return false;
1319
+ }
1320
+ return true;
1321
+ }
1322
+ modalActionListener(evt) {
1323
+ const modalAction = evt.detail;
1324
+ switch (modalAction) {
1325
+ case ezModalContainer.ModalAction.CANCEL:
1326
+ this.handleClearAll();
1327
+ break;
1328
+ case ezModalContainer.ModalAction.OK:
1329
+ this.handleApplyFilters();
1330
+ break;
1331
+ case ezModalContainer.ModalAction.CLOSE:
1332
+ this.handleClose();
1333
+ break;
1334
+ }
1335
+ }
1336
+ handleFilterChange(filterConfig) {
1337
+ this.filters = this.filters.map(filter => filter.id === filterConfig.id ? filterConfig : filter);
1338
+ }
1339
+ handleClearFilterList(filterList) {
1340
+ this.filters = this.filters.map(filter => filterList.includes(filter) ? (Object.assign(Object.assign({}, filter), { value: undefined })) : filter);
1341
+ }
1342
+ handleClearSigleFilter(filterItem) {
1343
+ if (filterItemType_enum.FilterItemType.MULTI_LIST === filterItem.type) {
1344
+ let filterItemCopy = core.ObjectUtils.copy(filterItem);
1345
+ this.uncheckFilterValues(filterItemCopy.value);
1346
+ const filterListCopy = core.ObjectUtils.copy(this.filters);
1347
+ const index = filterListCopy.findIndex(item => item.id === filterItem.id);
1348
+ filterListCopy.splice(index, 1, filterItemCopy);
1349
+ this.filters = core.ObjectUtils.copy(filterListCopy);
1350
+ return;
1351
+ }
1352
+ if (filterItemType_enum.FilterItemType.CHECK_BOX_LIST === filterItem.type) {
1353
+ const filterListCopy = core.ObjectUtils.copy(this.filters);
1354
+ filterListCopy.find(filter => filter.id === filterItem.id).value = undefined;
1355
+ this.filters = core.ObjectUtils.copy(filterListCopy);
1356
+ return;
1357
+ }
1358
+ const filter = this.filters.find(filter => filter.id === filterItem.id);
1359
+ filter.value = undefined;
1360
+ this.filters = core.ObjectUtils.copy(this.filters);
1361
+ }
1362
+ uncheckFilterValues(valueList) {
1363
+ valueList.forEach(value => {
1364
+ if (!!value) {
1365
+ value.check = false;
1366
+ }
1367
+ });
1368
+ return valueList;
1369
+ }
1370
+ renderFilterItem(filterItem, fullRow) {
1371
+ return (index$1.h("snk-filter-modal-item", { class: fullRow ? 'ez-col ez-col--sd-12' : 'ez-col ez-col--sd-6 ez-padding--small', filterItem: filterItem, configName: this.configName, onFilterChange: (event) => this.handleFilterChange(event.detail), onEditPersonalizedFilter: evt => this.editPersonalizedFilter(evt.detail), onAddPersonalizedFilter: () => this.addPersonalizedFilter() }));
1372
+ }
1373
+ isDefaultFilterNumberVariation(filter) {
1374
+ var _a;
1375
+ return filter.type === filterItemType_enum.FilterItemType.NUMBER
1376
+ && (!filter.props.variation || ((_a = filter.props) === null || _a === void 0 ? void 0 : _a.variation) === filterNumberVariation.FilterNumberVariation.DEFAULT);
1377
+ }
1378
+ mountFiltersLines(filters) {
1379
+ const MAX_LINE_LENGTH = 2;
1380
+ let currentLine = 0;
1381
+ let forceAddCurrent = false;
1382
+ const filtersLines = {};
1383
+ for (let curr = 0; curr < filters.length; curr++) {
1384
+ filtersLines[currentLine] = filtersLines[currentLine] || [];
1385
+ const item = filters[curr];
1386
+ const isLast = curr === filters.length - 1;
1387
+ const currentItemMatch = item.type === filterItemType_enum.FilterItemType.TEXT || this.isDefaultFilterNumberVariation(item);
1388
+ const nextItemMatch = isLast ? false : filters[curr + 1].type === filterItemType_enum.FilterItemType.TEXT || this.isDefaultFilterNumberVariation(filters[curr + 1]);
1389
+ if ((currentItemMatch && nextItemMatch) || forceAddCurrent) {
1390
+ filtersLines[currentLine].push(item);
1391
+ forceAddCurrent = filtersLines[currentLine].length < MAX_LINE_LENGTH;
1392
+ if (filtersLines[currentLine].length === MAX_LINE_LENGTH)
1393
+ ++currentLine;
1394
+ continue;
1395
+ }
1396
+ filtersLines[currentLine] = filtersLines[currentLine] || [];
1397
+ filtersLines[currentLine].push(item);
1398
+ ++currentLine;
1399
+ }
1400
+ return Object.values(filtersLines);
1401
+ }
1402
+ renderFilterLine(filters) {
1403
+ const fullLine = filters.length === 1;
1404
+ return filters.map((filter) => this.renderFilterItem(filter, fullLine));
1405
+ }
1406
+ getIformedFiltersCount(listItems) {
1407
+ let countInformedItens = 0;
1408
+ listItems.forEach(item => {
1409
+ var _a, _b, _c, _d, _e, _f;
1410
+ if (filterItemType_enum.FilterItemType.MULTI_LIST === item.type) {
1411
+ countInformedItens += (_e = (_d = (_c = ((_b = (_a = item.value) === null || _a === void 0 ? void 0 : _a.elements) !== null && _b !== void 0 ? _b : item.value)) === null || _c === void 0 ? void 0 : _c.filter(value => value === null || value === void 0 ? void 0 : value.check)) === null || _d === void 0 ? void 0 : _d.length) !== null && _e !== void 0 ? _e : 0;
1412
+ return;
1413
+ }
1414
+ if (filterItemType_enum.FilterItemType.CHECK_BOX_LIST === item.type) {
1415
+ countInformedItens += Object.entries((_f = item.value) !== null && _f !== void 0 ? _f : {})
1416
+ .filter(([_, value]) => value === true)
1417
+ .map(([key, _]) => key).length;
1418
+ return;
1419
+ }
1420
+ if (item.groupedItems != undefined) {
1421
+ countInformedItens = item.groupedItems.filter(item => item.visible).length;
1422
+ return;
1423
+ }
1424
+ if (!!item.value) {
1425
+ countInformedItens++;
1426
+ }
1427
+ });
1428
+ return countInformedItens;
1429
+ }
1430
+ renderCollapsibleFilterBox(label, listItems, isSingleItem, shouldRenderFooter = true) {
1431
+ if (!listItems.length)
1432
+ return null;
1433
+ const appliedFilters = this.getIformedFiltersCount(listItems);
1434
+ const lines = this.mountFiltersLines(listItems);
1435
+ return (index$1.h("ez-collapsible-box", { class: "snk-filter-modal__collapsible-box", headerSize: "medium", value: true, label: label }, !!appliedFilters && (index$1.h("ez-badge", { class: "ez-badge--primary-subtle", slot: "rightSlot", label: appliedFilters === null || appliedFilters === void 0 ? void 0 : appliedFilters.toString() })), index$1.h("div", { class: "ez-row snk-filter-modal__rendered-items" }, lines.map(this.renderFilterLine.bind(this))), shouldRenderFooter && (index$1.h("div", { class: "ez-flex ez-flex--justify-end grow" }, index$1.h("ez-button", { class: "ez-button--tertiary", size: "medium", label: "Limpar", onClick: () => isSingleItem ? this.handleClearSigleFilter(listItems[0]) : this.handleClearFilterList(listItems) })))));
1436
+ }
1437
+ handleDeleteFilter() {
1438
+ this._application.confirm(this.getMessage('snkPersonalizedFilter.deleteConfirm.title'), this.getMessage('snkPersonalizedFilter.info.deleteDefaultFilterConfirm'), "alert-circle-inverted", "critical").then((actionConfirmed) => {
1439
+ if (!actionConfirmed) {
1440
+ return;
1441
+ }
1442
+ this.filterDefaultToDelete = this._defaultFilter;
1443
+ this.filters = this.filters.filter(filter => filter.id !== filterType_enum.FilterType.DEFAULT_FILTER);
1444
+ });
1445
+ }
1446
+ handleActionSelectedDefaultFilter({ detail: action }) {
1447
+ switch (action) {
1448
+ case defaultFilters.ActionDefaultFilter.CREATE:
1449
+ this.addPersonalizedFilter(true);
1450
+ break;
1451
+ case defaultFilters.ActionDefaultFilter.EDIT:
1452
+ this.editPersonalizedFilter(this._defaultFilter.id, true);
1453
+ break;
1454
+ case defaultFilters.ActionDefaultFilter.REMOVE:
1455
+ this.handleDeleteFilter();
1456
+ break;
1457
+ }
1458
+ }
1459
+ getCustomFilter(filters) {
1460
+ const customFilters = filters.filter((filter) => filter.filterType === filterType_enum.FilterType.CUSTOM_FILTER);
1461
+ return customFilters;
1462
+ }
1463
+ getDefaultFilter(filters) {
1464
+ const defaultFilter = filters.find((item) => item.id === index.DefaultFilter.id);
1465
+ return defaultFilter;
1466
+ }
1467
+ componentWillLoad() {
1468
+ this._application = core.ApplicationContext.getContextValue('__SNK__APPLICATION__');
1469
+ }
1470
+ componentWillRender() {
1471
+ this._modalTitle = this.getCustomMessage('title');
1472
+ this._okButtonLabel = this.getCustomMessage('okButtonLabel');
1473
+ this._cancelButtonLabel = this.getCustomMessage('cancelButtonLabel');
1474
+ }
1475
+ componentDidLoad() {
1476
+ if (!this._originalFilterConfig)
1477
+ this._originalFilterConfig = this.filters;
1478
+ }
1479
+ render() {
1480
+ this._defaultFilter = this.getDefaultFilter(this.filters);
1481
+ const customFilters = this.getCustomFilter(this.filters);
1482
+ const quickFilters = this.filters.filter(filter => filter.filterType === filterType_enum.FilterType.QUICK_FILTER);
1483
+ const otherFilters = this.filters.filter(filter => filter.filterType === filterType_enum.FilterType.OTHER_FILTERS);
1484
+ return (index$1.h("ez-modal-container", { class: "snk-filter-modal__container", modalTitle: this._modalTitle, cancelButtonLabel: this._cancelButtonLabel, okButtonLabel: this._okButtonLabel, onEzModalAction: this.modalActionListener.bind(this) }, index$1.h("div", { class: "snk-filter-modal__content ez-col--sd-12" }, index$1.h("snk-default-filter", { getMessage: this.getCustomMessage.bind(this), hasDefaultFilter: !!this._defaultFilter, onActionSelected: this.handleActionSelectedDefaultFilter.bind(this) }), !this.disablePersonalizedFilter && this.renderCollapsibleFilterBox(this.getCustomMessage('customFilters'), customFilters, false, false), this.renderCollapsibleFilterBox(this.getCustomMessage('quickFilters'), quickFilters, false), otherFilters.map(filter => this.renderCollapsibleFilterBox(filter.label, [filter], true)))));
1485
+ }
1486
+ };
1487
+ SnkFilterModal.style = snkFilterModalCss;
1488
+
1489
+ exports.snk_filter_bar = SnkFilterBar;
1490
+ exports.snk_filter_item = SnkFilterItem;
1491
+ exports.snk_filter_list = SnkFilterList;
1492
+ exports.snk_filter_modal = SnkFilterModal;