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