@sankhyalabs/sankhyablocks 9.2.0-dev.17 → 9.2.0-dev.19

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 (189) hide show
  1. package/dist/cjs/{ConfigStorage-0ebc800f.js → ConfigStorage-52c38bb9.js} +2 -2
  2. package/dist/cjs/{DataFetcher-602cdc72.js → DataFetcher-9af55840.js} +15 -0
  3. package/dist/cjs/{ISave-18205d86.js → ISave-c4918000.js} +1 -1
  4. package/dist/cjs/{SnkFormConfigManager-4b651537.js → SnkFormConfigManager-cef663d1.js} +2 -2
  5. package/dist/cjs/{ClientSideExporterProvider-bb0b2273.js → SnkMultiSelectionListDataSource-58ded10c.js} +78 -78
  6. package/dist/cjs/{auth-fetcher-82317d4d.js → auth-fetcher-a3a3bb16.js} +1 -1
  7. package/dist/cjs/{dataunit-fetcher-93077a2f.js → dataunit-fetcher-ae454648.js} +1 -1
  8. package/dist/cjs/filter-validate-6993f6f2.js +30 -0
  9. package/dist/cjs/{form-config-fetcher-05d210e7.js → form-config-fetcher-d7bb4f41.js} +1 -1
  10. package/dist/cjs/index-1cf293c1.js +8 -8
  11. package/dist/cjs/loader.cjs.js +1 -1
  12. package/dist/cjs/pesquisa-grid_2.cjs.entry.js +4 -4
  13. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  14. package/dist/cjs/snk-actions-button_8.cjs.entry.js +5 -5
  15. package/dist/cjs/snk-application.cjs.entry.js +6 -6
  16. package/dist/cjs/snk-attach.cjs.entry.js +5 -5
  17. package/dist/cjs/snk-crud.cjs.entry.js +5 -5
  18. package/dist/cjs/snk-data-exporter.cjs.entry.js +5 -5
  19. package/dist/cjs/{snk-data-unit-28d629e4.js → snk-data-unit-a59a7ade.js} +2 -2
  20. package/dist/cjs/snk-data-unit.cjs.entry.js +3 -3
  21. package/dist/cjs/snk-detail-view.cjs.entry.js +7 -7
  22. package/dist/cjs/snk-entity-list.cjs.entry.js +10 -3
  23. package/dist/cjs/snk-filter-bar_4.cjs.entry.js +164 -100
  24. package/dist/cjs/snk-filter-binary-select.cjs.entry.js +23 -2
  25. package/dist/cjs/snk-filter-checkbox-list.cjs.entry.js +20 -2
  26. package/dist/cjs/snk-filter-detail.cjs.entry.js +25 -8
  27. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +9 -14
  28. package/dist/cjs/snk-filter-multi-select.cjs.entry.js +16 -3
  29. package/dist/cjs/snk-filter-number.cjs.entry.js +34 -3
  30. package/dist/cjs/snk-filter-period.cjs.entry.js +59 -14
  31. package/dist/cjs/snk-filter-search.cjs.entry.js +14 -3
  32. package/dist/cjs/snk-filter-text.cjs.entry.js +18 -1
  33. package/dist/cjs/snk-form_2.cjs.entry.js +4 -4
  34. package/dist/cjs/snk-grid.cjs.entry.js +38 -21
  35. package/dist/cjs/{snk-guides-viewer-73d40f42.js → snk-guides-viewer-e7c08c71.js} +5 -5
  36. package/dist/cjs/snk-guides-viewer.cjs.entry.js +7 -7
  37. package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
  38. package/dist/cjs/snk-pesquisa.cjs.entry.js +4 -4
  39. package/dist/cjs/snk-simple-crud.cjs.entry.js +13 -13
  40. package/dist/collection/components/snk-entity-list/snk-entity-list.js +28 -4
  41. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.js +72 -2
  42. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-checkbox-list.js +73 -2
  43. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.js +51 -5
  44. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js +83 -3
  45. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js +118 -27
  46. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-search.js +49 -5
  47. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js +71 -1
  48. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +62 -11
  49. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +70 -8
  50. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.css +0 -4
  51. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +112 -16
  52. package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js +8 -16
  53. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +106 -52
  54. package/dist/collection/components/snk-filter-bar/utils/SnkFilterModalFactory.js +3 -1
  55. package/dist/collection/components/snk-filter-bar/utils/filter-validate.js +24 -0
  56. package/dist/collection/components/snk-grid/snk-grid.js +89 -11
  57. package/dist/collection/lib/message/resources/en-us/snk-filter-bar.msg.js +1 -0
  58. package/dist/collection/lib/message/resources/en-us/snk-grid.msg.js +4 -0
  59. package/dist/collection/lib/message/resources/es-es/snk-filter-bar.msg.js +1 -0
  60. package/dist/collection/lib/message/resources/es-es/snk-grid.msg.js +4 -0
  61. package/dist/collection/lib/message/resources/pt-br/snk-filter-bar.msg.js +1 -0
  62. package/dist/collection/lib/message/resources/pt-br/snk-grid.msg.js +4 -0
  63. package/dist/components/DataFetcher.js +15 -0
  64. package/dist/components/snk-crud.js +62 -44
  65. package/dist/components/snk-detail-view2.js +89 -56
  66. package/dist/components/snk-entity-list.js +11 -3
  67. package/dist/components/snk-filter-bar2.js +77 -93
  68. package/dist/components/snk-filter-binary-select.js +27 -3
  69. package/dist/components/snk-filter-checkbox-list.js +24 -3
  70. package/dist/components/snk-filter-detail2.js +28 -9
  71. package/dist/components/snk-filter-item2.js +70 -8
  72. package/dist/components/snk-filter-modal-item2.js +7 -12
  73. package/dist/components/snk-filter-modal.js +1 -325
  74. package/dist/components/snk-filter-modal2.js +391 -0
  75. package/dist/components/snk-filter-multi-select.js +19 -4
  76. package/dist/components/snk-filter-number.js +38 -4
  77. package/dist/components/snk-filter-period.js +64 -16
  78. package/dist/components/snk-filter-search.js +17 -4
  79. package/dist/components/snk-filter-text.js +22 -2
  80. package/dist/components/snk-grid2.js +65 -29
  81. package/dist/esm/{ConfigStorage-fc4e3a42.js → ConfigStorage-1e758486.js} +2 -2
  82. package/dist/esm/{DataFetcher-01ce1a4f.js → DataFetcher-2f7ba7ae.js} +15 -0
  83. package/dist/esm/{ISave-d36bade4.js → ISave-4c9742c1.js} +1 -1
  84. package/dist/esm/{SnkFormConfigManager-71dae34e.js → SnkFormConfigManager-d7031fcb.js} +2 -2
  85. package/dist/esm/{ClientSideExporterProvider-21a99af1.js → SnkMultiSelectionListDataSource-eace25fd.js} +83 -83
  86. package/dist/esm/{auth-fetcher-2e565c35.js → auth-fetcher-d8169b9c.js} +1 -1
  87. package/dist/esm/{dataunit-fetcher-14ba162b.js → dataunit-fetcher-1f7a73df.js} +1 -1
  88. package/dist/esm/filter-validate-d765d450.js +27 -0
  89. package/dist/esm/{form-config-fetcher-a1ccc944.js → form-config-fetcher-eb03ac08.js} +1 -1
  90. package/dist/esm/index-479e1293.js +8 -8
  91. package/dist/esm/loader.js +1 -1
  92. package/dist/esm/pesquisa-grid_2.entry.js +4 -4
  93. package/dist/esm/sankhyablocks.js +1 -1
  94. package/dist/esm/snk-actions-button_8.entry.js +5 -5
  95. package/dist/esm/snk-application.entry.js +6 -6
  96. package/dist/esm/snk-attach.entry.js +5 -5
  97. package/dist/esm/snk-crud.entry.js +5 -5
  98. package/dist/esm/snk-data-exporter.entry.js +5 -5
  99. package/dist/esm/{snk-data-unit-3977725e.js → snk-data-unit-a94dd52a.js} +2 -2
  100. package/dist/esm/snk-data-unit.entry.js +3 -3
  101. package/dist/esm/snk-detail-view.entry.js +7 -7
  102. package/dist/esm/snk-entity-list.entry.js +10 -3
  103. package/dist/esm/snk-filter-bar_4.entry.js +165 -101
  104. package/dist/esm/snk-filter-binary-select.entry.js +23 -2
  105. package/dist/esm/snk-filter-checkbox-list.entry.js +20 -2
  106. package/dist/esm/snk-filter-detail.entry.js +25 -8
  107. package/dist/esm/snk-filter-modal-item.entry.js +9 -14
  108. package/dist/esm/snk-filter-multi-select.entry.js +16 -3
  109. package/dist/esm/snk-filter-number.entry.js +34 -3
  110. package/dist/esm/snk-filter-period.entry.js +59 -14
  111. package/dist/esm/snk-filter-search.entry.js +14 -3
  112. package/dist/esm/snk-filter-text.entry.js +18 -1
  113. package/dist/esm/snk-form_2.entry.js +4 -4
  114. package/dist/esm/snk-grid.entry.js +31 -14
  115. package/dist/esm/{snk-guides-viewer-f800c9aa.js → snk-guides-viewer-e716659f.js} +5 -5
  116. package/dist/esm/snk-guides-viewer.entry.js +7 -7
  117. package/dist/esm/snk-personalized-filter.entry.js +3 -3
  118. package/dist/esm/snk-pesquisa.entry.js +4 -4
  119. package/dist/esm/snk-simple-crud.entry.js +8 -8
  120. package/dist/sankhyablocks/p-093f58fa.entry.js +1 -0
  121. package/dist/sankhyablocks/{p-e63cc25f.js → p-0dc071de.js} +1 -1
  122. package/dist/sankhyablocks/{p-f4bf0517.entry.js → p-0f6f2a84.entry.js} +1 -1
  123. package/dist/sankhyablocks/{p-2b2c2718.js → p-1129ded7.js} +1 -1
  124. package/dist/sankhyablocks/p-12cba660.entry.js +1 -0
  125. package/dist/sankhyablocks/{p-51209229.js → p-12db5588.js} +1 -1
  126. package/dist/sankhyablocks/{p-65517fcf.js → p-3d4a3965.js} +1 -1
  127. package/dist/sankhyablocks/p-3ed04f0d.entry.js +1 -0
  128. package/dist/sankhyablocks/{p-b6b42620.entry.js → p-4033a6e3.entry.js} +1 -1
  129. package/dist/sankhyablocks/p-49ddc27a.entry.js +1 -0
  130. package/dist/sankhyablocks/{p-c3eea705.entry.js → p-4a42d004.entry.js} +1 -1
  131. package/dist/sankhyablocks/p-4c763b10.entry.js +1 -0
  132. package/dist/sankhyablocks/p-4eeb06fc.js +1 -0
  133. package/dist/sankhyablocks/{p-dc8bb41f.js → p-552bdfdc.js} +1 -1
  134. package/dist/sankhyablocks/{p-3cdfd7fb.js → p-66e6569e.js} +1 -1
  135. package/dist/sankhyablocks/p-6909c146.entry.js +1 -0
  136. package/dist/sankhyablocks/p-69d0afa4.js +1 -0
  137. package/dist/sankhyablocks/{p-c3bab5f4.js → p-75b80a92.js} +1 -1
  138. package/dist/sankhyablocks/p-7f7fe6c4.entry.js +1 -0
  139. package/dist/sankhyablocks/{p-e5571279.entry.js → p-86009ea5.entry.js} +1 -1
  140. package/dist/sankhyablocks/{p-7b97f9af.entry.js → p-864066bb.entry.js} +1 -1
  141. package/dist/sankhyablocks/p-96d45943.entry.js +1 -0
  142. package/dist/sankhyablocks/{p-34222890.entry.js → p-a0b4c940.entry.js} +1 -1
  143. package/dist/sankhyablocks/{p-a60028f1.entry.js → p-a4be272f.entry.js} +1 -1
  144. package/dist/sankhyablocks/p-ab2ba522.entry.js +1 -0
  145. package/dist/sankhyablocks/p-ac9488fd.entry.js +1 -0
  146. package/dist/sankhyablocks/{p-7a1d3cb6.entry.js → p-b1d8cbf7.entry.js} +1 -1
  147. package/dist/sankhyablocks/{p-7535d592.js → p-b393f1df.js} +1 -1
  148. package/dist/sankhyablocks/{p-dfbe4d7f.entry.js → p-c5d281ad.entry.js} +1 -1
  149. package/dist/sankhyablocks/{p-41e5a485.entry.js → p-c6d8c86b.entry.js} +1 -1
  150. package/dist/sankhyablocks/p-cb4343c4.entry.js +1 -0
  151. package/dist/sankhyablocks/p-d235314c.entry.js +1 -0
  152. package/dist/sankhyablocks/{p-dde9da7a.entry.js → p-d76f1aa5.entry.js} +1 -1
  153. package/dist/sankhyablocks/{p-aba06047.entry.js → p-de58a26f.entry.js} +1 -1
  154. package/dist/sankhyablocks/p-e258de96.entry.js +1 -0
  155. package/dist/sankhyablocks/p-fd8047b8.js +1 -0
  156. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  157. package/dist/types/components/snk-entity-list/snk-entity-list.d.ts +8 -4
  158. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.d.ts +12 -0
  159. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-checkbox-list.d.ts +12 -0
  160. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.d.ts +12 -4
  161. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-number.d.ts +16 -4
  162. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-period.d.ts +17 -3
  163. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-search.d.ts +10 -2
  164. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-text.d.ts +12 -0
  165. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +8 -3
  166. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +27 -4
  167. package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +17 -3
  168. package/dist/types/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.d.ts +2 -3
  169. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +15 -2
  170. package/dist/types/components/snk-filter-bar/utils/SnkFilterModalFactory.d.ts +4 -2
  171. package/dist/types/components/snk-filter-bar/utils/filter-validate.d.ts +11 -0
  172. package/dist/types/components/snk-grid/snk-grid.d.ts +21 -8
  173. package/dist/types/components.d.ts +202 -17
  174. package/package.json +1 -1
  175. package/dist/sankhyablocks/p-07b14811.entry.js +0 -1
  176. package/dist/sankhyablocks/p-082e7ba8.entry.js +0 -1
  177. package/dist/sankhyablocks/p-25209340.entry.js +0 -1
  178. package/dist/sankhyablocks/p-295b83ae.entry.js +0 -1
  179. package/dist/sankhyablocks/p-3143bb44.entry.js +0 -1
  180. package/dist/sankhyablocks/p-353b4a74.js +0 -1
  181. package/dist/sankhyablocks/p-398cdd67.entry.js +0 -1
  182. package/dist/sankhyablocks/p-5bab470d.entry.js +0 -1
  183. package/dist/sankhyablocks/p-9fd87bfd.entry.js +0 -1
  184. package/dist/sankhyablocks/p-a76e6d51.entry.js +0 -1
  185. package/dist/sankhyablocks/p-ae2ebab7.js +0 -1
  186. package/dist/sankhyablocks/p-b21aa190.entry.js +0 -1
  187. package/dist/sankhyablocks/p-c6a8a8bc.entry.js +0 -1
  188. package/dist/sankhyablocks/p-c8932b14.entry.js +0 -1
  189. package/dist/sankhyablocks/p-dff65083.entry.js +0 -1
@@ -5,18 +5,19 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index$1 = require('./index-1cf293c1.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
  const EzScrollDirection = require('@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection');
8
- const ConfigStorage = require('./ConfigStorage-0ebc800f.js');
8
+ const ConfigStorage = require('./ConfigStorage-52c38bb9.js');
9
+ const PersonalizedFilterUtils = require('./PersonalizedFilterUtils-7259cf65.js');
9
10
  const DataType = require('@sankhyalabs/core/dist/dataunit/metadata/DataType');
10
11
  const filterItemType_enum = require('./filter-item-type.enum-a7ffdaa6.js');
11
12
  const index = require('./index-62760a9c.js');
12
13
  const filterNumberVariation = require('./filterNumberVariation-d65332da.js');
13
- const utils = require('@sankhyalabs/ezui/dist/collection/utils');
14
- const PersonalizedFilterUtils = require('./PersonalizedFilterUtils-7259cf65.js');
15
14
  const ezModalContainer = require('@sankhyalabs/ezui/dist/collection/components/ez-modal-container');
16
- const filterType_enum = require('./filter-type.enum-2bb46d2a.js');
15
+ const utils = require('@sankhyalabs/ezui/dist/collection/utils');
17
16
  const defaultFilters = require('./default-filters-a09bf82b.js');
18
- require('./form-config-fetcher-05d210e7.js');
19
- require('./DataFetcher-602cdc72.js');
17
+ const filterType_enum = require('./filter-type.enum-2bb46d2a.js');
18
+ const filterValidate = require('./filter-validate-6993f6f2.js');
19
+ require('./form-config-fetcher-d7bb4f41.js');
20
+ require('./DataFetcher-9af55840.js');
20
21
  require('./PrintUtils-bcaeb82f.js');
21
22
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
22
23
 
@@ -210,51 +211,6 @@ function buildPersonalized(item) {
210
211
  return { name: id, expression, params };
211
212
  }
212
213
 
213
- class SnkFilterModalFactory {
214
- constructor({ filterConfig, configName, onComplete, getMessage, disablePersonalizedFilter, onAddPersonalizedFilter, onEditPersonalizedFilter, onDeletePersonalizedFilter }) {
215
- this._filterConfig = filterConfig;
216
- this._configName = configName;
217
- this._onComplete = onComplete;
218
- this._getMessage = getMessage;
219
- this._disablePersonalizedFilter = disablePersonalizedFilter;
220
- this._addPersonalizedFilterFn = onAddPersonalizedFilter;
221
- this._editPersonalizedFilterFn = onEditPersonalizedFilter;
222
- this._onDeletePersonalizedFilter = onDeletePersonalizedFilter;
223
- }
224
- applyFilters(newFilterConfig) {
225
- this._onComplete(newFilterConfig);
226
- this._closeModal();
227
- }
228
- buildFilterModal() {
229
- const filterModal = document.createElement("snk-filter-modal");
230
- filterModal.className = "ez-size-height--full";
231
- filterModal.filters = this._filterConfig;
232
- filterModal.configName = this._configName;
233
- filterModal.disablePersonalizedFilter = this._disablePersonalizedFilter;
234
- filterModal.getMessage = this._getMessage.bind(this);
235
- filterModal.applyFilters = this.applyFilters.bind(this);
236
- filterModal.closeModal = () => this._closeModal();
237
- filterModal.addPersonalizedFilter = (isDefault) => this._addPersonalizedFilterFn(isDefault);
238
- filterModal.editPersonalizedFilter = (id, isDefault) => this._editPersonalizedFilterFn(id, isDefault);
239
- filterModal.deletePersonalizedFilter = (filter, configName, isDefault) => this._onDeletePersonalizedFilter(filter, configName, isDefault);
240
- return filterModal;
241
- }
242
- async showModal() {
243
- const filterModal = this.buildFilterModal();
244
- const modalProps = {
245
- content: filterModal,
246
- position: 'right',
247
- heightMode: 'full',
248
- closeOutsideClick: false,
249
- useScrimLight: true
250
- };
251
- this._closeModal = await utils.ApplicationUtils.showModal(modalProps);
252
- }
253
- async closeModal() {
254
- this._closeModal();
255
- }
256
- }
257
-
258
214
  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;margin:var(--space--2, 2px) 0}.snk-filter-bar__scroller.sc-snk-filter-bar .sc-snk-filter-bar:first-child{margin-left:var(--space-extra-small, 3px)}.snk-filter-bar__filter-list-items-container.sc-snk-filter-bar{overflow-y:auto;max-height:360px;margin-top:var(--space--small, 6px)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar{cursor:pointer;border-radius:var(--border--radius-small, 6px);border:none;background-color:transparent}.snk-filter-bar__filter-list-item__label.sc-snk-filter-bar{color:var(--title--primary)}.snk-filter-bar__filter-list-item__label--secondary.sc-snk-filter-bar{color:var(--text--primary)}.snk-filter-bar__filter-list-item__icon.sc-snk-filter-bar{--ez-icon--color:var(--title--primary)}.snk-filter-bar__filter-list-item__icon--secondary.sc-snk-filter-bar{--ez-icon--color:var(--text--secondary)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar:focus-visible{outline:none;background-color:var(--background--medium)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar:hover{background-color:var(--background--medium)}.snk-filter-bar__filter-list-items-container--empty.sc-snk-filter-bar{width:100%;height:100px;display:flex;justify-content:center;align-self:center;align-items:center}.snk-filter-bar__filter-list-items-button--active.sc-snk-filter-bar{position:relative}.snk-filter-bar__filter-list-items-button--active.sc-snk-filter-bar::after{display:flex;position:absolute;content:\"\";width:8px;height:8px;top:7px;left:17px;background-color:var(--icon--alert--color, #008561);border-radius:50%}.snk-filter-bar__filter-modal-item.sc-snk-filter-bar{--modal-item-border-width:2px;display:flex;flex-direction:row;margin-left:var(--modal-item-border-width);border-radius:var(--border--radius-medium, 12px);background-color:var(--background--medium, #f0f3f7);border:none;width:100%}.snk-filter-bar__filter-modal-item.sc-snk-filter-bar:focus-visible{outline:var(--color--primary) solid var(--modal-item-border-width)}.snk-filter-bar__filter-modal-item__check.sc-snk-filter-bar{width:auto}.snk-filter-bar__filter-modal-item__label.sc-snk-filter-bar{font-weight:var(--text-weight--medium)}.snk-filter-bar__filter-modal-content.sc-snk-filter-bar{display:grid;grid-template-rows:auto auto 1fr auto;width:99%;height:100%}";
259
215
 
260
216
  const SnkFilterBar = class {
@@ -295,10 +251,13 @@ const SnkFilterBar = class {
295
251
  this.filterBarLegacyConfigName = undefined;
296
252
  this.autoLoad = undefined;
297
253
  this.afterApplyConfig = undefined;
254
+ this.filterCustomConfig = undefined;
255
+ this.filterCustomConfigInterceptor = undefined;
298
256
  this.allowDefault = undefined;
299
257
  this.scrollerLocked = false;
300
258
  this.showPersonalizedFilter = false;
301
259
  this.personalizedFilterId = undefined;
260
+ this.isFilterModalOpen = false;
302
261
  }
303
262
  hasValidValue(item) {
304
263
  if (item.value === undefined || item.value === null)
@@ -446,7 +405,7 @@ const SnkFilterBar = class {
446
405
  return;
447
406
  }
448
407
  this._loadingPending = false;
449
- this.doLoadData(this.dataUnit.getLastLoadRequest() != undefined);
408
+ this.doLoadData();
450
409
  }
451
410
  if (this._configUpdated) {
452
411
  this._configUpdated = false;
@@ -545,11 +504,11 @@ const SnkFilterBar = class {
545
504
  const unpinnedItems = [];
546
505
  this.filterConfig.sort((a, b) => this._filtersComparator(a, b))
547
506
  .filter(this.filterActiveFilter)
548
- .forEach((item, index) => {
507
+ .forEach((item) => {
549
508
  item = core.ObjectUtils.copy(item);
550
509
  const itemId = `filter-${item.id}`;
551
- const filterItem = (index$1.h("snk-filter-item", { onVisibleChanged: (evt) => this.scrollerLocked = evt.detail, onFilterChange: (event) => this.updateFilter(event.detail), onFocusin: () => this.itemFocused(itemId), id: itemId, config: item, class: index > 0 ? "ez-padding-left--medium" : "", getMessage: (key, props) => this.getMessage(key, props), key: item.id }));
552
- if (item.fixed || item.hardFixed) {
510
+ const filterItem = (index$1.h("snk-filter-item", { onVisibleChanged: (evt) => this.scrollerLocked = evt.detail, onFilterChange: (event) => this.updateFilter(event.detail), onFocusin: () => this.itemFocused(itemId), id: itemId, config: item, class: "ez-margin-horizontal--extra-small", getMessage: (key, props) => this.getMessage(key, props), key: item.id }));
511
+ if (item.fixed || item.hardFixed || item.required) {
553
512
  pinnedItems.push(filterItem);
554
513
  }
555
514
  else {
@@ -558,9 +517,9 @@ const SnkFilterBar = class {
558
517
  return filterItem;
559
518
  });
560
519
  const elements = [];
561
- elements.push(...pinnedItems);
520
+ elements.push(...pinnedItems.reverse());
562
521
  if (pinnedItems.length > 0 && unpinnedItems.length > 0) {
563
- elements.push(index$1.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-filter-bar__divider" }));
522
+ elements.push(index$1.h("hr", { class: "ez-margin-horizontal--small ez-margin-vertical--auto ez-divider-vertical ez-divider--dark snk-filter-bar__divider" }));
564
523
  }
565
524
  elements.push(...unpinnedItems);
566
525
  return elements;
@@ -585,7 +544,7 @@ const SnkFilterBar = class {
585
544
  return normalized;
586
545
  }
587
546
  updateFilter(newItem) {
588
- this.filterConfig = this.filterConfig.map(item => {
547
+ let config = this.filterConfig.map(item => {
589
548
  newItem = this.normalizeItem(newItem);
590
549
  if (item.id === newItem.id) {
591
550
  if (core.ObjectUtils.objectToString(item) != core.ObjectUtils.objectToString(newItem)) {
@@ -595,6 +554,10 @@ const SnkFilterBar = class {
595
554
  }
596
555
  return item;
597
556
  }).sort((a, b) => this._filtersComparator(a, b));
557
+ if (this.filterCustomConfigInterceptor) {
558
+ config = this.filterCustomConfigInterceptor(config);
559
+ }
560
+ this.filterConfig = config;
598
561
  }
599
562
  loadPermitions() {
600
563
  this._application.isUserSup().then(value => this.allowDefault = value);
@@ -616,6 +579,12 @@ const SnkFilterBar = class {
616
579
  else {
617
580
  config = await ConfigStorage.ConfigStorage.loadFilterBarConfig(this.configName, this.resourceID, { contextURI: this.dataUnit.name });
618
581
  }
582
+ if (this.filterCustomConfig) {
583
+ config = [...this.filterCustomConfig, ...config];
584
+ }
585
+ if (this.filterCustomConfigInterceptor) {
586
+ config = this.filterCustomConfigInterceptor(config);
587
+ }
619
588
  this.filterConfig = config.map(item => this.normalizeItem(item));
620
589
  this.filterConfig.sort((a, b) => this._filtersComparator(a, b));
621
590
  }
@@ -659,30 +628,13 @@ const SnkFilterBar = class {
659
628
  * @async
660
629
  */
661
630
  async showFilterModal() {
662
- const callbackOnApplyFilter = (filters) => {
663
- var _a;
664
- this.filterConfig = filters.map(this.normalizeItem).sort((a, b) => this._filtersComparator(a, b));
665
- (_a = this.afterApplyConfig) === null || _a === void 0 ? void 0 : _a.call(this);
666
- };
667
- let filtersConfigCopy = core.ObjectUtils.copy(this.filterConfig);
668
- filtersConfigCopy = filtersConfigCopy.sort((itemA, itemB) => {
669
- return itemA.originOrder - itemB.originOrder;
670
- });
671
- const factoryParams = {
672
- filterConfig: filtersConfigCopy,
673
- configName: this.configName,
674
- onComplete: callbackOnApplyFilter,
675
- disablePersonalizedFilter: this.disablePersonalizedFilter,
676
- getMessage: (key, props) => this.getMessage(key, props),
677
- onAddPersonalizedFilter: (isDefault) => this.addPersonalizedFilter(isDefault),
678
- onEditPersonalizedFilter: (id, isDefault) => this.editPersonalizedFilter(id, isDefault),
679
- onDeletePersonalizedFilter: (filter, configName, isDefault) => this.deletePersonalizedFilter(filter, filterItemType_enum.FilterItemType.PERSONALIZED, configName, isDefault),
680
- };
681
- this._filterModalFactory = new SnkFilterModalFactory(factoryParams);
682
- await this._filterModalFactory.showModal();
631
+ if (this.isFilterModalOpen) {
632
+ return; // Evita abrir múltiplos modais
633
+ }
634
+ this.isFilterModalOpen = true;
683
635
  }
684
636
  addPersonalizedFilter(isDefault = false) {
685
- this._filterModalFactory.closeModal();
637
+ this.isFilterModalOpen = false;
686
638
  this._isDefaultFilter = isDefault;
687
639
  this.personalizedFilterId = undefined;
688
640
  this.showPersonalizedFilter = true;
@@ -691,7 +643,7 @@ const SnkFilterBar = class {
691
643
  });
692
644
  }
693
645
  editPersonalizedFilter(id, isDefault = false) {
694
- this._filterModalFactory.closeModal();
646
+ this.isFilterModalOpen = false;
695
647
  this._isDefaultFilter = isDefault;
696
648
  this.showPersonalizedFilter = true;
697
649
  this.personalizedFilterId = id;
@@ -706,6 +658,15 @@ const SnkFilterBar = class {
706
658
  ConfigStorage.ConfigStorage.removePersonalizedFilter(filter, this.resourceID, configName);
707
659
  }
708
660
  }
661
+ closeFilterModal() {
662
+ this.isFilterModalOpen = false;
663
+ }
664
+ applyFiltersFromModal(filters) {
665
+ var _a;
666
+ this.filterConfig = filters.map(this.normalizeItem).sort((a, b) => this._filtersComparator(a, b));
667
+ (_a = this.afterApplyConfig) === null || _a === void 0 ? void 0 : _a.call(this);
668
+ this.isFilterModalOpen = false;
669
+ }
709
670
  handleHidePersonalizedFilter(reloadFilterBar) {
710
671
  if (reloadFilterBar) {
711
672
  this.loadConfigFromStorage().then(() => {
@@ -752,10 +713,14 @@ const SnkFilterBar = class {
752
713
  if (this.showPersonalizedFilter) {
753
714
  return index$1.h("snk-personalized-filter", { class: "filter-bar__personalized-filter", filterId: this.personalizedFilterId, ref: (el) => this._elPersonalizedFilter = el, isDefaultFilter: this._isDefaultFilter, onEzCancel: () => this.handleHidePersonalizedFilter(false), onEzAfterSave: () => this.handleHidePersonalizedFilter(true), entityUri: this.dataUnit.name, configName: this.configName, resourceID: this.resourceID });
754
715
  }
716
+ let filtersConfigCopy = core.ObjectUtils.copy(this.filterConfig);
717
+ filtersConfigCopy = filtersConfigCopy.sort((itemA, itemB) => {
718
+ return itemA.originOrder - itemB.originOrder;
719
+ });
755
720
  if (this.mode !== "regular") {
756
- return (index$1.h(index$1.Host, { "data-mode": this.mode }, this.getPersonalizedFilterVariableItems(), this.mode === 'button' && (index$1.h("ez-button", { class: "ez-margin-left--medium", size: "small", label: this.getMessage('snkFilterBar.filters', undefined, this.getMessage("snkFilterBar.filters")), onClick: this.showFilterModal.bind(this) }))));
721
+ return (index$1.h(index$1.Host, { "data-mode": this.mode }, this.getPersonalizedFilterVariableItems(), this.mode === 'button' && (index$1.h("ez-button", { class: "ez-margin-left--medium", size: "small", label: this.getMessage('snkFilterBar.filters', undefined, this.getMessage("snkFilterBar.filters")), onClick: this.showFilterModal.bind(this) })), index$1.h("snk-filter-modal", { opened: this.isFilterModalOpen, filterConfig: this.filterConfig, configName: this.configName, disablePersonalizedFilter: this.disablePersonalizedFilter, getMessage: (key, props) => this.getMessage(key, props), applyFilters: (filters) => this.applyFiltersFromModal(filters), closeModal: () => this.closeFilterModal(), addPersonalizedFilter: (isDefault) => this.addPersonalizedFilter(isDefault), editPersonalizedFilter: (id, isDefault) => this.editPersonalizedFilter(id, isDefault), deletePersonalizedFilter: (filter, configName, isDefault) => this.deletePersonalizedFilter(filter, filterItemType_enum.FilterItemType.PERSONALIZED, configName, isDefault), filterCustomConfigInterceptor: this.filterCustomConfigInterceptor })));
757
722
  }
758
- return (index$1.h(index$1.Host, null, index$1.h("div", null, index$1.h("span", { class: "snk-filter-bar__title", title: this.title, "data-tooltip": this.title, "data-flow": "bottom" }, this.title)), index$1.h("ez-scroller", { class: "snk-filter-bar__scroller", direction: EzScrollDirection.EzScrollDirection.HORIZONTAL, activeShadow: true, locked: this.scrollerLocked }, index$1.h("section", { class: "snk-filter-bar__filter-item-container" }, this.getFilterItems())), index$1.h("ez-button", { class: "ez-padding-left--medium ez-margin-top--extra-small", size: "small", label: this.getMessage('snkFilterBar.filters', undefined, this.getMessage("snkFilterBar.filters")), onClick: this.showFilterModal.bind(this) }, index$1.h("ez-icon", { slot: "leftIcon", iconName: "plus", class: "ez-padding-right--small" }))));
723
+ return (index$1.h(index$1.Host, null, index$1.h("div", null, index$1.h("span", { class: "snk-filter-bar__title", title: this.title, "data-tooltip": this.title, "data-flow": "bottom" }, this.title)), index$1.h("ez-scroller", { class: "snk-filter-bar__scroller", direction: EzScrollDirection.EzScrollDirection.HORIZONTAL, activeShadow: true, locked: this.scrollerLocked }, index$1.h("section", { class: "snk-filter-bar__filter-item-container" }, this.getFilterItems())), index$1.h("ez-button", { class: "ez-padding-left--medium ez-margin-top--extra-small", size: "small", label: this.getMessage('snkFilterBar.filters', undefined, this.getMessage("snkFilterBar.filters")), onClick: this.showFilterModal.bind(this) }, index$1.h("ez-icon", { slot: "leftIcon", iconName: "plus", class: "ez-padding-right--small" })), index$1.h("snk-filter-modal", { opened: this.isFilterModalOpen, filterConfig: this.filterConfig, configName: this.configName, disablePersonalizedFilter: this.disablePersonalizedFilter, getMessage: (key, props) => this.getMessage(key, props), applyFilters: (filters) => this.applyFiltersFromModal(filters), closeModal: () => this.closeFilterModal(), addPersonalizedFilter: (isDefault) => this.addPersonalizedFilter(isDefault), editPersonalizedFilter: (id, isDefault) => this.editPersonalizedFilter(id, isDefault), deletePersonalizedFilter: (filter, configName, isDefault) => this.deletePersonalizedFilter(filter, filterItemType_enum.FilterItemType.PERSONALIZED, configName, isDefault), filterCustomConfigInterceptor: this.filterCustomConfigInterceptor })));
759
724
  }
760
725
  get _element() { return index$1.getElement(this); }
761
726
  static get watchers() { return {
@@ -771,6 +736,7 @@ const SnkFilterItem = class {
771
736
  index$1.registerInstance(this, hostRef);
772
737
  this.visibleChanged = index$1.createEvent(this, "visibleChanged", 7);
773
738
  this.filterChange = index$1.createEvent(this, "filterChange", 3);
739
+ this._keyboardManager = undefined;
774
740
  this.detailIsVisible = undefined;
775
741
  this.config = undefined;
776
742
  this.getMessage = undefined;
@@ -794,13 +760,15 @@ const SnkFilterItem = class {
794
760
  if (open) {
795
761
  await ((_a = this._chipElement) === null || _a === void 0 ? void 0 : _a.setBlur());
796
762
  await this._popover.showUnder(this._chipElement);
763
+ await this._filterDetail.setFocusField();
797
764
  }
798
765
  }
799
766
  /**
800
767
  * Oculta os detalhes de um item da lista.
801
768
  */
802
769
  async hideDetail() {
803
- await this._popover.hide();
770
+ var _a;
771
+ await ((_a = this._popover) === null || _a === void 0 ? void 0 : _a.hide());
804
772
  }
805
773
  getConfigChanges() {
806
774
  var _a;
@@ -820,12 +788,15 @@ const SnkFilterItem = class {
820
788
  this.filterChange.emit(configChanged);
821
789
  }
822
790
  else {
823
- this.togglePopover();
791
+ this.togglePopover(event);
824
792
  }
825
793
  }
826
794
  async togglePopover(event) {
827
795
  event === null || event === void 0 ? void 0 : event.preventDefault();
828
796
  event === null || event === void 0 ? void 0 : event.stopPropagation();
797
+ if (this.config.enabled === false) {
798
+ return;
799
+ }
829
800
  if (this.detailIsVisible) {
830
801
  await this.hideDetail();
831
802
  }
@@ -974,8 +945,9 @@ const SnkFilterItem = class {
974
945
  return undefined;
975
946
  }
976
947
  hasActiveElements(value) {
977
- var _a, _b, _c;
978
- 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;
948
+ var _a;
949
+ const list = Array.isArray(value) ? value : value === null || value === void 0 ? void 0 : value.elements;
950
+ return ((_a = list === null || list === void 0 ? void 0 : list.filter((val) => val === null || val === void 0 ? void 0 : val.check)) === null || _a === void 0 ? void 0 : _a.length) > 0;
979
951
  }
980
952
  hasActiveValue(config) {
981
953
  return (config.type !== filterItemType_enum.FilterItemType.MULTI_LIST && config.value !== undefined) || this.hasActiveElements(config.value);
@@ -990,12 +962,67 @@ const SnkFilterItem = class {
990
962
  }
991
963
  return this.hasActiveValue(this.config);
992
964
  }
993
- handleVisibilityPopover(event) {
965
+ async handleVisibilityPopover(event) {
994
966
  this.detailIsVisible = event.detail;
967
+ if (!this.detailIsVisible) {
968
+ await this._filterDetail.clearValue();
969
+ }
970
+ }
971
+ getCustomMessage(key, params) {
972
+ var _a;
973
+ return (_a = this.getMessage) === null || _a === void 0 ? void 0 : _a.call(this, `snkFilterBar.filterModal.${key}`, params);
974
+ }
975
+ hasValue() {
976
+ if (this.config.type === filterItemType_enum.FilterItemType.MULTI_LIST) {
977
+ return this.hasActiveElements(this.config.value);
978
+ }
979
+ return this.config.value !== undefined && this.config.value !== null;
980
+ }
981
+ getTooltipMessage() {
982
+ var _a, _b;
983
+ if (this.config.required && !this.hasValue()) {
984
+ return {
985
+ message: (_a = this.config.requiredMessage) !== null && _a !== void 0 ? _a : this.getCustomMessage('validations.requiredFilter'),
986
+ type: 'error'
987
+ };
988
+ }
989
+ if (this.config.enabled === false && this.config.disabledMessage) {
990
+ return { message: this.config.disabledMessage, type: 'warning' };
991
+ }
992
+ return {
993
+ message: (_b = this.config.defaultMessage) !== null && _b !== void 0 ? _b : this.getLabel(true),
994
+ type: 'default'
995
+ };
996
+ }
997
+ getTypeChip(type) {
998
+ switch (type) {
999
+ case 'default':
1000
+ return 'secondary';
1001
+ case 'warning':
1002
+ return 'warning-light';
1003
+ case 'error':
1004
+ return 'error-light';
1005
+ case 'success':
1006
+ return 'success-light';
1007
+ default:
1008
+ return type;
1009
+ }
1010
+ }
1011
+ initKeyboardManager() {
1012
+ this._keyboardManager = new core.KeyboardManager({ element: this._filterItemElement, propagate: true });
1013
+ this._keyboardManager
1014
+ .bind("Escape", () => this.hideDetail());
1015
+ }
1016
+ connectedCallback() {
1017
+ this.initKeyboardManager();
1018
+ }
1019
+ disconnectedCallback() {
1020
+ this._keyboardManager.unbindAllShortcutKeys();
995
1021
  }
996
1022
  render() {
997
1023
  const leftIcon = this.getLeftIconName();
998
- return (index$1.h(index$1.Host, null, this.showChips && (index$1.h("ez-chip", { id: this.config.id, ref: ref => this._chipElement = ref, label: this.getLabel(), value: this.getEnabledChip(), onClick: (event) => this.togglePopover(event), disableAutoUpdateValue: true, type: "secondary" }, leftIcon && (index$1.h("ez-icon", { ref: ref => this._leftIconElement = ref, iconName: leftIcon, slot: "leftIcon" })), index$1.h("ez-icon", { ref: ref => this._rightIconElement = ref, iconName: this.getRightIconName(), slot: "rightIcon", id: "removeFilter", onClick: (event) => this.clearFilter(event) }))), index$1.h("ez-popover-core", { ref: elem => this._popover = elem, onEzVisibilityChange: (event) => this.handleVisibilityPopover(event) }, index$1.h("snk-filter-detail", { key: this.config.id, config: this.config, getMessage: this.getMessage, class: "sc-snk-filter-bar snk-filter__popover ez-padding--small ez-elevation--16", "data-element-id": this._idSnkFilterDetail, showHardFixed: this.showChips }))));
1024
+ const { type, message } = this.getTooltipMessage();
1025
+ return (index$1.h(index$1.Host, null, this.showChips && (index$1.h("ez-tooltip", { id: this.config.id, message: message, type: type, active: !this.detailIsVisible, strategy: "fixed" }, index$1.h("ez-chip", { id: this.config.id, ref: ref => this._chipElement = ref, label: this.getLabel(), value: this.getEnabledChip(), onClick: (event) => this.togglePopover(event), disableAutoUpdateValue: true, type: this.getTypeChip(type), enabled: this.config.enabled }, leftIcon && (index$1.h("ez-icon", { ref: ref => this._leftIconElement = ref, iconName: leftIcon, slot: "leftIcon" })), index$1.h("ez-icon", { ref: ref => this._rightIconElement = ref, iconName: this.getRightIconName(), slot: "rightIcon", id: "removeFilter", onClick: (event) => this.clearFilter(event) })))), index$1.h("ez-popover-core", { ref: elem => this._popover = elem, onEzVisibilityChange: (event) => this.handleVisibilityPopover(event) }, index$1.h("snk-filter-detail", { ref: ref => this._filterDetail = ref, key: this.config.id, config: this.config, getMessage: this.getMessage, class: "sc-snk-filter-bar snk-filter__popover ez-padding--small ez-elevation--16", "data-element-id": this._idSnkFilterDetail, showHardFixed: this.showChips && !this.config.required, removalBlocked: this.config.required }))));
999
1026
  }
1000
1027
  get _filterItemElement() { return index$1.getElement(this); }
1001
1028
  static get watchers() { return {
@@ -1148,14 +1175,17 @@ const SnkFilterList = class {
1148
1175
  get _element() { return index$1.getElement(this); }
1149
1176
  };
1150
1177
 
1151
- 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)}";
1178
+ const snkFilterModalCss = "ez-modal{--ez-modal-content-padding:24px 12px}.snk-filter-modal__container{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}.snk-filter-modal__rendered-items::-webkit-scrollbar{width:var(--space--small);min-width:var(--space--small);max-width:var(--space--small)}";
1152
1179
 
1153
1180
  const SnkFilterModal = class {
1154
1181
  constructor(hostRef) {
1155
1182
  index$1.registerInstance(this, hostRef);
1183
+ this.filters = [];
1184
+ this.filtersWithError = [];
1156
1185
  this.getMessage = undefined;
1157
1186
  this.configName = undefined;
1158
- this.filters = undefined;
1187
+ this.filterConfig = undefined;
1188
+ this.opened = false;
1159
1189
  this.applyFilters = undefined;
1160
1190
  this.closeModal = undefined;
1161
1191
  this.addPersonalizedFilter = undefined;
@@ -1164,6 +1194,11 @@ const SnkFilterModal = class {
1164
1194
  this.filtersToDelete = [];
1165
1195
  this.filterDefaultToDelete = undefined;
1166
1196
  this.disablePersonalizedFilter = undefined;
1197
+ this.filterCustomConfigInterceptor = undefined;
1198
+ }
1199
+ filterConfigChangeHandler(newValue) {
1200
+ this.filters = core.ObjectUtils.copy(newValue);
1201
+ this.validateFilters();
1167
1202
  }
1168
1203
  /**
1169
1204
  * Emitido quando um filtro personalizado é deletado.
@@ -1222,7 +1257,7 @@ const SnkFilterModal = class {
1222
1257
  });
1223
1258
  }
1224
1259
  hasChangeToSave() {
1225
- const hasChangesPersonalizedFilters = core.ObjectUtils.objectToString(this.filters) !== core.ObjectUtils.objectToString(this._originalFilterConfig);
1260
+ const hasChangesPersonalizedFilters = core.ObjectUtils.objectToString(this.filters) !== core.ObjectUtils.objectToString(this.filters);
1226
1261
  return hasChangesPersonalizedFilters;
1227
1262
  }
1228
1263
  handleClose() {
@@ -1237,6 +1272,9 @@ const SnkFilterModal = class {
1237
1272
  });
1238
1273
  }
1239
1274
  handleApplyFilters() {
1275
+ if (!this.validateFilters()) {
1276
+ return;
1277
+ }
1240
1278
  const filterPersonalized = this.filters.find(filter => filter.filterType === filterType_enum.FilterType.CUSTOM_FILTER || filter.filterType === filterType_enum.FilterType.DEFAULT_FILTER);
1241
1279
  if (this.isValidCustomFilter(filterPersonalized)) {
1242
1280
  this.applyFilters(this.filters);
@@ -1275,8 +1313,14 @@ const SnkFilterModal = class {
1275
1313
  break;
1276
1314
  }
1277
1315
  }
1278
- handleFilterChange(filterConfig) {
1279
- this.filters = this.filters.map(filter => filter.id === filterConfig.id ? filterConfig : filter);
1316
+ handleFilterChange(event) {
1317
+ event.stopPropagation();
1318
+ const filterConfig = event.detail;
1319
+ let config = this.filters.map(filter => filter.id === filterConfig.id ? filterConfig : filter);
1320
+ if (this.filterCustomConfigInterceptor) {
1321
+ config = this.filterCustomConfigInterceptor(config);
1322
+ }
1323
+ this.filters = core.ObjectUtils.copy(config);
1280
1324
  }
1281
1325
  handleClearFilterList(filterList) {
1282
1326
  this.filters = this.filters.map(filter => filterList.includes(filter) ? (Object.assign(Object.assign({}, filter), { value: undefined })) : filter);
@@ -1309,8 +1353,22 @@ const SnkFilterModal = class {
1309
1353
  });
1310
1354
  return valueList;
1311
1355
  }
1356
+ validateFilters() {
1357
+ const notValidFilters = filterValidate.getInvalidFilters(this.filters);
1358
+ this.filtersWithError = notValidFilters.map(item => item.id);
1359
+ if (notValidFilters.length === 0) {
1360
+ return true;
1361
+ }
1362
+ notValidFilters.forEach(item => {
1363
+ const filterItem = this._element.querySelector(`#filter-item-${item.id}`);
1364
+ if (filterItem) {
1365
+ filterItem["errorMessage"] = item.requiredMessage || this.getCustomMessage('validations.requiredFilter');
1366
+ }
1367
+ });
1368
+ return false;
1369
+ }
1312
1370
  renderFilterItem(filterItem, fullRow) {
1313
- return (index$1.h("snk-filter-modal-item", { class: fullRow ? 'ez-col ez-col--sd-12' : 'ez-col ez-col--sd-6 ez-padding--small', filterItem: filterItem, configName: this.configName, onFilterChange: (event) => this.handleFilterChange(event.detail), onEditPersonalizedFilter: evt => this.editPersonalizedFilter(evt.detail), onAddPersonalizedFilter: () => this.addPersonalizedFilter() }));
1371
+ return (index$1.h("snk-filter-modal-item", { key: `modal-item-${filterItem.id}`, 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), onEditPersonalizedFilter: evt => this.editPersonalizedFilter(evt.detail), onAddPersonalizedFilter: () => this.addPersonalizedFilter() }));
1314
1372
  }
1315
1373
  isDefaultFilterNumberVariation(filter) {
1316
1374
  var _a;
@@ -1347,8 +1405,9 @@ const SnkFilterModal = class {
1347
1405
  }
1348
1406
  getIformedFiltersCount(listItems) {
1349
1407
  let countInformedItens = 0;
1350
- listItems.forEach(item => {
1408
+ listItems.forEach(localItem => {
1351
1409
  var _a, _b, _c, _d, _e, _f;
1410
+ const item = this.filterConfig.find(filter => filter.id === localItem.id);
1352
1411
  if (filterItemType_enum.FilterItemType.MULTI_LIST === item.type) {
1353
1412
  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;
1354
1413
  return;
@@ -1374,7 +1433,8 @@ const SnkFilterModal = class {
1374
1433
  return null;
1375
1434
  const appliedFilters = this.getIformedFiltersCount(listItems);
1376
1435
  const lines = this.mountFiltersLines(listItems);
1377
- return (index$1.h("ez-collapsible-box", { class: "snk-filter-modal__collapsible-box", headerSize: "medium", value: true, label: label }, !!appliedFilters && (index$1.h("ez-badge", { class: "ez-badge--primary-subtle", slot: "rightSlot", label: appliedFilters === null || appliedFilters === void 0 ? void 0 : appliedFilters.toString() })), index$1.h("div", { class: "ez-row snk-filter-modal__rendered-items" }, lines.map(this.renderFilterLine.bind(this))), shouldRenderFooter && (index$1.h("div", { class: "ez-flex ez-flex--justify-end grow" }, index$1.h("ez-button", { class: "ez-button--tertiary", size: "medium", label: this.getCustomMessage("clearModal"), onClick: () => isSingleItem ? this.handleClearSigleFilter(listItems[0]) : this.handleClearFilterList(listItems) })))));
1436
+ const countFiltersWithError = this.filtersWithError.filter(item => listItems.some(filter => filter.id === item)).length;
1437
+ return (index$1.h("ez-collapsible-box", { class: "snk-filter-modal__collapsible-box", headerSize: "medium", value: true, label: label }, index$1.h("div", { class: "ez-flex ez-flex--justify-end grow", slot: "rightSlot" }, !!appliedFilters && (index$1.h("ez-badge", { class: "ez-badge--primary-subtle", label: appliedFilters === null || appliedFilters === void 0 ? void 0 : appliedFilters.toString() })), !!countFiltersWithError && (index$1.h("ez-badge", { class: "ez-badge--error-subtle", label: countFiltersWithError === null || countFiltersWithError === void 0 ? void 0 : countFiltersWithError.toString() }))), index$1.h("div", { class: "ez-row snk-filter-modal__rendered-items" }, lines.map(this.renderFilterLine.bind(this))), shouldRenderFooter && (index$1.h("div", { class: "ez-flex ez-flex--justify-end grow" }, index$1.h("ez-button", { class: "ez-button--tertiary", size: "medium", label: this.getCustomMessage("clearModal"), onClick: () => isSingleItem ? this.handleClearSigleFilter(listItems[0]) : this.handleClearFilterList(listItems) })))));
1378
1438
  }
1379
1439
  handleDeleteFilter() {
1380
1440
  this._application.confirm(this.getMessage('snkPersonalizedFilter.deleteConfirm.title'), this.getMessage('snkPersonalizedFilter.info.deleteDefaultFilterConfirm'), "alert-circle-inverted", "critical").then((actionConfirmed) => {
@@ -1408,6 +1468,7 @@ const SnkFilterModal = class {
1408
1468
  }
1409
1469
  componentWillLoad() {
1410
1470
  this._application = core.ApplicationContext.getContextValue('__SNK__APPLICATION__');
1471
+ this.filters = core.ObjectUtils.copy(this.filterConfig);
1411
1472
  }
1412
1473
  componentWillRender() {
1413
1474
  this._modalTitle = this.getCustomMessage('title');
@@ -1415,16 +1476,19 @@ const SnkFilterModal = class {
1415
1476
  this._cancelButtonLabel = this.getCustomMessage('cancelButtonLabel');
1416
1477
  }
1417
1478
  componentDidLoad() {
1418
- if (!this._originalFilterConfig)
1419
- this._originalFilterConfig = this.filters;
1479
+ this.validateFilters();
1420
1480
  }
1421
1481
  render() {
1422
1482
  this._defaultFilter = this.getDefaultFilter(this.filters);
1423
1483
  const customFilters = this.getCustomFilter(this.filters);
1424
1484
  const quickFilters = this.filters.filter(filter => filter.filterType === filterType_enum.FilterType.QUICK_FILTER);
1425
1485
  const otherFilters = this.filters.filter(filter => filter.filterType === filterType_enum.FilterType.OTHER_FILTERS);
1426
- return (index$1.h("ez-modal-container", { class: "snk-filter-modal__container", modalTitle: this._modalTitle, cancelButtonLabel: this._cancelButtonLabel, okButtonLabel: this._okButtonLabel, onEzModalAction: this.modalActionListener.bind(this) }, index$1.h("div", { class: "snk-filter-modal__content ez-col--sd-12" }, index$1.h("snk-default-filter", { getMessage: this.getCustomMessage.bind(this), hasDefaultFilter: !!this._defaultFilter, onActionSelected: this.handleActionSelectedDefaultFilter.bind(this) }), !this.disablePersonalizedFilter && this.renderCollapsibleFilterBox(this.getCustomMessage('customFilters'), customFilters, false, false), this.renderCollapsibleFilterBox(this.getCustomMessage('quickFilters'), quickFilters, false), otherFilters.map(filter => this.renderCollapsibleFilterBox(filter.label, [filter], true)))));
1486
+ return (index$1.h("ez-modal", { opened: this.opened, modalSize: "col--sd-3", align: "right", heightMode: "full", closeEsc: true }, index$1.h("ez-modal-container", { class: "snk-filter-modal__container", modalTitle: this._modalTitle, cancelButtonLabel: this._cancelButtonLabel, okButtonLabel: this._okButtonLabel, onEzModalAction: this.modalActionListener.bind(this) }, index$1.h("div", { class: "snk-filter-modal__content ez-col--sd-12" }, index$1.h("snk-default-filter", { getMessage: this.getCustomMessage.bind(this), hasDefaultFilter: !!this._defaultFilter, onActionSelected: this.handleActionSelectedDefaultFilter.bind(this) }), !this.disablePersonalizedFilter && this.renderCollapsibleFilterBox(this.getCustomMessage('customFilters'), customFilters, false, false), this.renderCollapsibleFilterBox(this.getCustomMessage('quickFilters'), quickFilters, false), otherFilters.map(filter => this.renderCollapsibleFilterBox(filter.label, [filter], true))))));
1427
1487
  }
1488
+ get _element() { return index$1.getElement(this); }
1489
+ static get watchers() { return {
1490
+ "filterConfig": ["filterConfigChangeHandler"]
1491
+ }; }
1428
1492
  };
1429
1493
  SnkFilterModal.style = snkFilterModalCss;
1430
1494
 
@@ -16,6 +16,7 @@ const SnkFilterBinarySelect = class {
16
16
  this.value = undefined;
17
17
  this.config = undefined;
18
18
  this.presentationMode = presentationMode.EPresentationMode.CHIP;
19
+ this.errorMessage = undefined;
19
20
  }
20
21
  isSelected(option) {
21
22
  return this.value == undefined || this.value === option;
@@ -24,6 +25,7 @@ const SnkFilterBinarySelect = class {
24
25
  * Emitido quando acontece a alteração de valor do componente snk-filter-binary-select
25
26
  */
26
27
  ezChangeListener(evt) {
28
+ this.errorMessage = undefined;
27
29
  if (this.presentationMode === presentationMode.EPresentationMode.MODAL) {
28
30
  if (!evt.detail) {
29
31
  this.assertCheckedOption(evt.target);
@@ -40,6 +42,23 @@ const SnkFilterBinarySelect = class {
40
42
  async resetValues() {
41
43
  this.ezChangeListener({ detail: this._noOptionValue });
42
44
  }
45
+ /**
46
+ * Limpa o valor do componente restaurando o valor original da configuração.
47
+ */
48
+ async clearValue() {
49
+ this.value = this.config.value;
50
+ this._radioButtonValue = this.value || this._noOptionValue;
51
+ }
52
+ /**
53
+ * Define o foco no componente snk-filter-binary-select.
54
+ */
55
+ async setFocus() {
56
+ if (this.presentationMode === presentationMode.EPresentationMode.MODAL) {
57
+ this._checkOne.setFocus();
58
+ return;
59
+ }
60
+ this._element.querySelector('ez-radio-button').focus();
61
+ }
43
62
  assertCheckedOption(updatingCheck) {
44
63
  if (updatingCheck === this._checkOne) {
45
64
  this._checkTwo.value = true;
@@ -81,9 +100,11 @@ const SnkFilterBinarySelect = class {
81
100
  }
82
101
  const [optOne, optTwo] = this.config.props.options;
83
102
  if (this.presentationMode === presentationMode.EPresentationMode.MODAL) {
84
- return (index.h(index.Host, null, index.h("div", { class: "ez-row ez-size-height--full" }, index.h("label", { class: "ez-text ez-title--small ez-title--primary ez-size-height--full ez-flex ez-flex--row ez-flex--align-items-center ez-col ez-col--sd-4" }, this.config.detailModal), index.h("div", { class: "ez-col ez-col--sd-4" }, index.h("ez-check", { ref: (ref) => this._checkOne = ref, id: `${this.config.id}_${optOne.name || "option1"}`, class: "sc-snk-filter-bar editor__ez-check", label: optOne.label, value: this.isSelected(optOne.name) })), index.h("div", { class: "ez-col ez-col--sd-4" }, index.h("ez-check", { ref: (ref) => this._checkTwo = ref, id: `${this.config.id}_${optTwo.name || "option2"}`, class: "sc-snk-filter-bar editor__ez-check", label: optTwo.label, value: this.isSelected(optTwo.name) })))));
103
+ return (index.h(index.Host, null, index.h("div", { class: "ez-row ez-size-height--full" }, index.h("label", { class: "ez-text ez-title--small ez-title--primary ez-size-height--full ez-flex ez-flex--row ez-flex--align-items-center ez-col ez-col--sd-4" }, this.config.detailModal), index.h("div", { class: "ez-col ez-col--sd-4" }, index.h("ez-check", { ref: (ref) => this._checkOne = ref, id: `${this.config.id}_${optOne.name || "option1"}`, class: "sc-snk-filter-bar editor__ez-check", label: optOne.label, enabled: this.config.enabled, value: this.isSelected(optOne.name) })), index.h("div", { class: "ez-col ez-col--sd-4" }, index.h("ez-check", { ref: (ref) => this._checkTwo = ref, id: `${this.config.id}_${optTwo.name || "option2"}`, class: "sc-snk-filter-bar editor__ez-check", label: optTwo.label, enabled: this.config.enabled, value: this.isSelected(optTwo.name) })), this.errorMessage &&
104
+ index.h("span", { class: 'ez-text ez-text--small ez-text--error ez-margin--small' }, this.errorMessage))));
85
105
  }
86
- return (index.h(index.Host, null, index.h("ez-radio-button", { value: this._radioButtonValue }, index.h("ez-radio-button-option", { id: `${this.config.id}_${optOne.name || "option1"}`, class: "sc-snk-filter-bar editor__ez-check", label: optOne.label, value: optOne.name }), index.h("ez-radio-button-option", { id: `${this.config.id}_${optTwo.name || "option2"}`, class: "sc-snk-filter-bar editor__ez-check", label: optTwo.label, value: optTwo.name }), index.h("ez-radio-button-option", { id: `${this.config.id}_option3`, class: "sc-snk-filter-bar editor__ez-check", label: `${optOne.label} + ${optTwo.label}`, value: this._noOptionValue }))));
106
+ return (index.h(index.Host, null, index.h("ez-tooltip", { active: this.config.enabled === false, message: this.config.disabledMessage, type: 'warning' }, index.h("ez-radio-button", { value: this._radioButtonValue }, index.h("ez-radio-button-option", { id: `${this.config.id}_${optOne.name || "option1"}`, class: "sc-snk-filter-bar editor__ez-check", label: optOne.label, value: optOne.name }), index.h("ez-radio-button-option", { id: `${this.config.id}_${optTwo.name || "option2"}`, class: "sc-snk-filter-bar editor__ez-check", label: optTwo.label, value: optTwo.name }), index.h("ez-radio-button-option", { id: `${this.config.id}_option3`, class: "sc-snk-filter-bar editor__ez-check", label: `${optOne.label} + ${optTwo.label}`, value: this._noOptionValue })), this.errorMessage &&
107
+ index.h("span", { class: 'ez-text ez-text--small ez-text--error ez-margin--small' }, this.errorMessage))));
87
108
  }
88
109
  get _element() { return index.getElement(this); }
89
110
  };
@@ -11,8 +11,24 @@ const SnkFilterCheckboxList = class {
11
11
  index.registerInstance(this, hostRef);
12
12
  this.valueChanged = index.createEvent(this, "valueChanged", 7);
13
13
  this.config = undefined;
14
+ this.errorMessage = undefined;
14
15
  this.optionsList = [];
15
16
  }
17
+ /**
18
+ * Define o foco no componente snk-filter-checkbox-list.
19
+ */
20
+ async setFocus() {
21
+ var _a, _b;
22
+ (_b = (_a = this._element) === null || _a === void 0 ? void 0 : _a.querySelector('ez-check')) === null || _b === void 0 ? void 0 : _b.setFocus();
23
+ }
24
+ /**
25
+ * Limpa o valor do componente restaurando o valor original da configuração.
26
+ */
27
+ async clearValue() {
28
+ var _a;
29
+ this.config = Object.assign(Object.assign({}, this.config), { value: this.config.value });
30
+ this.valueChanged.emit((_a = this.config) === null || _a === void 0 ? void 0 : _a.value);
31
+ }
16
32
  componentDidLoad() {
17
33
  if (this._element) {
18
34
  core.ElementIDUtils.addIDInfo(this._element, 'filterContentEditor');
@@ -20,13 +36,14 @@ const SnkFilterCheckboxList = class {
20
36
  }
21
37
  handleToggleCheck(itemChanged, checked) {
22
38
  var _a, _b;
39
+ this.errorMessage = undefined;
23
40
  let configValueMap = (_a = this.config.value) !== null && _a !== void 0 ? _a : {};
24
41
  configValueMap[itemChanged.name] = checked;
25
42
  this.config = Object.assign(Object.assign({}, this.config), { value: configValueMap });
26
43
  this.valueChanged.emit((_b = this.config) === null || _b === void 0 ? void 0 : _b.value);
27
44
  }
28
45
  renderOptions() {
29
- return this.optionsList.map(option => (index.h("ez-check", { label: option.label, onEzChange: (event) => this.handleToggleCheck(option, event.detail), value: !!this.isChecked(option.name) })));
46
+ return this.optionsList.map(option => (index.h("ez-check", { label: option.label, onEzChange: (event) => this.handleToggleCheck(option, event.detail), value: !!this.isChecked(option.name), enabled: this.config.enabled })));
30
47
  }
31
48
  isChecked(itemName) {
32
49
  var _a;
@@ -44,7 +61,8 @@ const SnkFilterCheckboxList = class {
44
61
  if (!this.config || this.config.type !== filterItemType_enum.FilterItemType.CHECK_BOX_LIST) {
45
62
  return undefined;
46
63
  }
47
- return (index.h("div", { class: 'ez-flex ez-flex--column' }, this.renderOptions()));
64
+ return (index.h("ez-tooltip", { active: this.config.enabled === false, message: this.config.disabledMessage, type: 'warning' }, index.h("div", { class: 'ez-flex ez-flex--column' }, this.renderOptions(), this.errorMessage &&
65
+ index.h("span", { class: 'ez-text ez-text--small ez-text--error ez-margin--small' }, this.errorMessage))));
48
66
  }
49
67
  get _element() { return index.getElement(this); }
50
68
  };