@sankhyalabs/sankhyablocks 9.2.0-dev.2 → 9.2.0-dev.21

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 (236) hide show
  1. package/dist/cjs/{ConfigStorage-1931defc.js → ConfigStorage-8b6def32.js} +2 -2
  2. package/dist/cjs/{DataFetcher-ad9fb3bb.js → DataFetcher-2c37b6a1.js} +52 -1
  3. package/dist/cjs/{ISave-18ffb73e.js → ISave-b22b3cf0.js} +1 -1
  4. package/dist/cjs/{SnkFormConfigManager-65e5288e.js → SnkFormConfigManager-477a27de.js} +2 -2
  5. package/dist/cjs/{ClientSideExporterProvider-994f6e26.js → SnkMultiSelectionListDataSource-b7ab26ba.js} +82 -79
  6. package/dist/cjs/{auth-fetcher-afbe69ab.js → auth-fetcher-78a90b36.js} +1 -1
  7. package/dist/cjs/{dataunit-fetcher-c7253b02.js → dataunit-fetcher-877944a9.js} +1 -1
  8. package/dist/cjs/filter-validate-6993f6f2.js +30 -0
  9. package/dist/cjs/{form-config-fetcher-f6e66d64.js → form-config-fetcher-dee08eb4.js} +1 -1
  10. package/dist/cjs/{index-0ad2baeb.js → index-13d05f03.js} +21 -5
  11. package/dist/cjs/index-1cf293c1.js +8 -8
  12. package/dist/cjs/loader.cjs.js +1 -1
  13. package/dist/cjs/pesquisa-grid_2.cjs.entry.js +4 -4
  14. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  15. package/dist/cjs/snk-actions-button_8.cjs.entry.js +5 -5
  16. package/dist/cjs/snk-application.cjs.entry.js +6 -9
  17. package/dist/cjs/snk-attach.cjs.entry.js +7 -7
  18. package/dist/cjs/snk-crud.cjs.entry.js +7 -7
  19. package/dist/cjs/snk-data-exporter.cjs.entry.js +5 -5
  20. package/dist/cjs/{snk-data-unit-448fce74.js → snk-data-unit-0cfa7622.js} +14 -4
  21. package/dist/cjs/snk-data-unit.cjs.entry.js +3 -3
  22. package/dist/cjs/snk-detail-view.cjs.entry.js +9 -9
  23. package/dist/cjs/snk-entity-list.cjs.entry.js +10 -3
  24. package/dist/cjs/snk-expression-group_2.cjs.entry.js +1 -1
  25. package/dist/cjs/snk-filter-bar_4.cjs.entry.js +189 -115
  26. package/dist/cjs/snk-filter-binary-select.cjs.entry.js +23 -2
  27. package/dist/cjs/snk-filter-checkbox-list.cjs.entry.js +20 -2
  28. package/dist/cjs/snk-filter-detail.cjs.entry.js +25 -8
  29. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +9 -14
  30. package/dist/cjs/snk-filter-multi-select.cjs.entry.js +16 -3
  31. package/dist/cjs/snk-filter-number.cjs.entry.js +34 -3
  32. package/dist/cjs/snk-filter-period.cjs.entry.js +59 -14
  33. package/dist/cjs/snk-filter-search.cjs.entry.js +14 -3
  34. package/dist/cjs/snk-filter-text.cjs.entry.js +18 -1
  35. package/dist/cjs/snk-form_2.cjs.entry.js +31 -5
  36. package/dist/cjs/snk-grid.cjs.entry.js +158 -66
  37. package/dist/cjs/{snk-guides-viewer-c23ed218.js → snk-guides-viewer-38277265.js} +6 -6
  38. package/dist/cjs/snk-guides-viewer.cjs.entry.js +9 -9
  39. package/dist/cjs/snk-personalized-filter.cjs.entry.js +14 -6
  40. package/dist/cjs/snk-pesquisa.cjs.entry.js +4 -4
  41. package/dist/cjs/snk-simple-bar.cjs.entry.js +5 -5
  42. package/dist/cjs/snk-simple-crud.cjs.entry.js +60 -23
  43. package/dist/cjs/snk-taskbar.cjs.entry.js +2 -2
  44. package/dist/cjs/{taskbar-elements-3b74cd21.js → taskbar-elements-fb5d1e08.js} +1 -1
  45. package/dist/collection/components/snk-application/snk-application.js +0 -2
  46. package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js +4 -1
  47. package/dist/collection/components/snk-data-unit/snk-data-unit.js +174 -29
  48. package/dist/collection/components/snk-entity-list/snk-entity-list.js +28 -4
  49. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.js +72 -2
  50. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-checkbox-list.js +73 -2
  51. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.js +51 -5
  52. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js +83 -3
  53. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js +118 -27
  54. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-search.js +49 -5
  55. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js +71 -1
  56. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +62 -11
  57. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +70 -8
  58. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.css +0 -4
  59. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +112 -16
  60. package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js +8 -16
  61. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +315 -114
  62. package/dist/collection/components/snk-filter-bar/utils/SnkFilterModalFactory.js +3 -1
  63. package/dist/collection/components/snk-filter-bar/utils/filter-validate.js +24 -0
  64. package/dist/collection/components/snk-form/snk-form.js +133 -22
  65. package/dist/collection/components/snk-grid/snk-grid.js +488 -133
  66. package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js +83 -21
  67. package/dist/collection/components/snk-pesquisa/snk-pesquisa.js +80 -14
  68. package/dist/collection/components/snk-simple-bar/snk-simple-bar.js +9 -9
  69. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +414 -119
  70. package/dist/collection/components/snk-taskbar/snk-taskbar.js +102 -36
  71. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +1 -0
  72. package/dist/collection/lib/http/data-fetcher/custom-xhr-override.js +39 -0
  73. package/dist/collection/lib/message/resources/en-us/snk-filter-bar.msg.js +1 -0
  74. package/dist/collection/lib/message/resources/en-us/snk-grid.msg.js +4 -0
  75. package/dist/collection/lib/message/resources/es-es/snk-filter-bar.msg.js +1 -0
  76. package/dist/collection/lib/message/resources/es-es/snk-grid.msg.js +4 -0
  77. package/dist/collection/lib/message/resources/pt-br/snk-filter-bar.msg.js +1 -0
  78. package/dist/collection/lib/message/resources/pt-br/snk-grid.msg.js +4 -0
  79. package/dist/components/ContinuousInsertUtils.js +4 -1
  80. package/dist/components/DataFetcher.js +52 -1
  81. package/dist/components/index2.js +21 -5
  82. package/dist/components/snk-application2.js +0 -3
  83. package/dist/components/snk-crud.js +62 -44
  84. package/dist/components/snk-data-unit2.js +12 -2
  85. package/dist/components/snk-detail-view2.js +89 -56
  86. package/dist/components/snk-entity-list.js +11 -3
  87. package/dist/components/snk-filter-bar2.js +103 -108
  88. package/dist/components/snk-filter-binary-select.js +27 -3
  89. package/dist/components/snk-filter-checkbox-list.js +24 -3
  90. package/dist/components/snk-filter-detail2.js +28 -9
  91. package/dist/components/snk-filter-item2.js +70 -8
  92. package/dist/components/snk-filter-modal-item2.js +7 -12
  93. package/dist/components/snk-filter-modal.js +1 -325
  94. package/dist/components/snk-filter-modal2.js +391 -0
  95. package/dist/components/snk-filter-multi-select.js +19 -4
  96. package/dist/components/snk-filter-number.js +38 -4
  97. package/dist/components/snk-filter-period.js +64 -16
  98. package/dist/components/snk-filter-search.js +17 -4
  99. package/dist/components/snk-filter-text.js +22 -2
  100. package/dist/components/snk-form.js +29 -2
  101. package/dist/components/snk-grid2.js +188 -75
  102. package/dist/components/snk-personalized-filter2.js +10 -2
  103. package/dist/components/snk-simple-bar2.js +5 -5
  104. package/dist/components/snk-simple-crud2.js +45 -8
  105. package/dist/esm/{ConfigStorage-b5a1dba3.js → ConfigStorage-22eace3a.js} +2 -2
  106. package/dist/esm/{DataFetcher-6f6de657.js → DataFetcher-f6b2961a.js} +52 -1
  107. package/dist/esm/{ISave-7ecdca20.js → ISave-6b7b0423.js} +1 -1
  108. package/dist/esm/{SnkFormConfigManager-34fc1dc7.js → SnkFormConfigManager-968b97e7.js} +2 -2
  109. package/dist/esm/{ClientSideExporterProvider-7c2781f4.js → SnkMultiSelectionListDataSource-1136c4e7.js} +87 -84
  110. package/dist/esm/{auth-fetcher-7332a9a9.js → auth-fetcher-cf39e42b.js} +1 -1
  111. package/dist/esm/{dataunit-fetcher-f21cbad0.js → dataunit-fetcher-6314b19d.js} +1 -1
  112. package/dist/esm/filter-validate-d765d450.js +27 -0
  113. package/dist/esm/{form-config-fetcher-6ab4e805.js → form-config-fetcher-bc6f0f1f.js} +1 -1
  114. package/dist/esm/{index-b72af127.js → index-446f9341.js} +21 -5
  115. package/dist/esm/index-479e1293.js +8 -8
  116. package/dist/esm/loader.js +1 -1
  117. package/dist/esm/pesquisa-grid_2.entry.js +4 -4
  118. package/dist/esm/sankhyablocks.js +1 -1
  119. package/dist/esm/snk-actions-button_8.entry.js +5 -5
  120. package/dist/esm/snk-application.entry.js +6 -9
  121. package/dist/esm/snk-attach.entry.js +7 -7
  122. package/dist/esm/snk-crud.entry.js +7 -7
  123. package/dist/esm/snk-data-exporter.entry.js +5 -5
  124. package/dist/esm/{snk-data-unit-b7e6e7a6.js → snk-data-unit-4acf4781.js} +14 -4
  125. package/dist/esm/snk-data-unit.entry.js +3 -3
  126. package/dist/esm/snk-detail-view.entry.js +9 -9
  127. package/dist/esm/snk-entity-list.entry.js +10 -3
  128. package/dist/esm/snk-expression-group_2.entry.js +1 -1
  129. package/dist/esm/snk-filter-bar_4.entry.js +190 -116
  130. package/dist/esm/snk-filter-binary-select.entry.js +23 -2
  131. package/dist/esm/snk-filter-checkbox-list.entry.js +20 -2
  132. package/dist/esm/snk-filter-detail.entry.js +25 -8
  133. package/dist/esm/snk-filter-modal-item.entry.js +9 -14
  134. package/dist/esm/snk-filter-multi-select.entry.js +16 -3
  135. package/dist/esm/snk-filter-number.entry.js +34 -3
  136. package/dist/esm/snk-filter-period.entry.js +59 -14
  137. package/dist/esm/snk-filter-search.entry.js +14 -3
  138. package/dist/esm/snk-filter-text.entry.js +18 -1
  139. package/dist/esm/snk-form_2.entry.js +31 -5
  140. package/dist/esm/snk-grid.entry.js +152 -60
  141. package/dist/esm/{snk-guides-viewer-fbfece85.js → snk-guides-viewer-19cb7f1f.js} +6 -6
  142. package/dist/esm/snk-guides-viewer.entry.js +9 -9
  143. package/dist/esm/snk-personalized-filter.entry.js +14 -6
  144. package/dist/esm/snk-pesquisa.entry.js +4 -4
  145. package/dist/esm/snk-simple-bar.entry.js +5 -5
  146. package/dist/esm/snk-simple-crud.entry.js +55 -18
  147. package/dist/esm/snk-taskbar.entry.js +2 -2
  148. package/dist/esm/{taskbar-elements-171476d4.js → taskbar-elements-faaf5d8f.js} +1 -1
  149. package/dist/sankhyablocks/p-093f58fa.entry.js +1 -0
  150. package/dist/sankhyablocks/{p-0e495575.js → p-0a317e81.js} +1 -1
  151. package/dist/sankhyablocks/{p-ad2ae575.entry.js → p-0e1f0344.entry.js} +1 -1
  152. package/dist/sankhyablocks/{p-8d1508aa.entry.js → p-16c1c209.entry.js} +1 -1
  153. package/dist/sankhyablocks/p-29cacaf3.entry.js +1 -0
  154. package/dist/sankhyablocks/{p-eb0616d3.entry.js → p-32450ea2.entry.js} +1 -1
  155. package/dist/sankhyablocks/{p-b49281be.entry.js → p-3c29939c.entry.js} +1 -1
  156. package/dist/sankhyablocks/p-3ed04f0d.entry.js +1 -0
  157. package/dist/sankhyablocks/{p-4872dc3a.entry.js → p-44c5ec49.entry.js} +1 -1
  158. package/dist/sankhyablocks/p-49ddc27a.entry.js +1 -0
  159. package/dist/sankhyablocks/p-4c763b10.entry.js +1 -0
  160. package/dist/sankhyablocks/p-4eeb06fc.js +1 -0
  161. package/dist/sankhyablocks/p-505172c8.entry.js +1 -0
  162. package/dist/sankhyablocks/p-55798617.js +1 -0
  163. package/dist/sankhyablocks/p-658f67a5.js +1 -0
  164. package/dist/sankhyablocks/{p-158adf33.entry.js → p-701b024c.entry.js} +1 -1
  165. package/dist/sankhyablocks/p-72a9285d.entry.js +1 -0
  166. package/dist/sankhyablocks/p-7f7fe6c4.entry.js +1 -0
  167. package/dist/sankhyablocks/p-88b7bc09.js +1 -0
  168. package/dist/sankhyablocks/{p-c6331595.js → p-8d256def.js} +1 -1
  169. package/dist/sankhyablocks/p-8f37b75b.entry.js +1 -0
  170. package/dist/sankhyablocks/{p-b35574b5.js → p-9062d640.js} +1 -1
  171. package/dist/sankhyablocks/{p-72c8c847.entry.js → p-95c71f5e.entry.js} +1 -1
  172. package/dist/sankhyablocks/p-96d45943.entry.js +1 -0
  173. package/dist/sankhyablocks/{p-eacff4b7.entry.js → p-b2d7f4cd.entry.js} +1 -1
  174. package/dist/sankhyablocks/{p-6a015ba2.js → p-b7f5caf6.js} +1 -1
  175. package/dist/sankhyablocks/p-b9200e77.entry.js +11 -0
  176. package/dist/sankhyablocks/{p-7de79adf.js → p-b987e15d.js} +1 -1
  177. package/dist/sankhyablocks/{p-ba4979b4.js → p-bf017a1f.js} +1 -1
  178. package/dist/sankhyablocks/{p-735a1175.entry.js → p-c3dbf441.entry.js} +1 -1
  179. package/dist/sankhyablocks/{p-3dba3468.js → p-c71dcb2d.js} +1 -1
  180. package/dist/sankhyablocks/{p-5e282b33.entry.js → p-c95f20d9.entry.js} +1 -1
  181. package/dist/sankhyablocks/p-c98e2085.js +1 -0
  182. package/dist/sankhyablocks/p-cb4343c4.entry.js +1 -0
  183. package/dist/sankhyablocks/p-d03ae54e.entry.js +1 -0
  184. package/dist/sankhyablocks/p-d235314c.entry.js +1 -0
  185. package/dist/sankhyablocks/p-d75a732c.js +1 -0
  186. package/dist/sankhyablocks/{p-f39b0ebe.entry.js → p-df7979fd.entry.js} +1 -1
  187. package/dist/sankhyablocks/p-e258de96.entry.js +1 -0
  188. package/dist/sankhyablocks/{p-d377aa7a.entry.js → p-f8e87cf1.entry.js} +1 -1
  189. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  190. package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +46 -3
  191. package/dist/types/components/snk-entity-list/snk-entity-list.d.ts +8 -4
  192. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.d.ts +12 -0
  193. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-checkbox-list.d.ts +12 -0
  194. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.d.ts +12 -4
  195. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-number.d.ts +16 -4
  196. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-period.d.ts +17 -3
  197. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-search.d.ts +10 -2
  198. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-text.d.ts +12 -0
  199. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +8 -3
  200. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +27 -4
  201. package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +17 -3
  202. package/dist/types/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.d.ts +2 -3
  203. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +60 -30
  204. package/dist/types/components/snk-filter-bar/utils/SnkFilterModalFactory.d.ts +4 -2
  205. package/dist/types/components/snk-filter-bar/utils/filter-validate.d.ts +11 -0
  206. package/dist/types/components/snk-form/snk-form.d.ts +29 -4
  207. package/dist/types/components/snk-grid/snk-grid.d.ts +132 -58
  208. package/dist/types/components/snk-personalized-filter/snk-personalized-filter.d.ts +53 -5
  209. package/dist/types/components/snk-pesquisa/snk-pesquisa.d.ts +44 -6
  210. package/dist/types/components/snk-simple-bar/snk-simple-bar.d.ts +15 -15
  211. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +100 -43
  212. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +23 -21
  213. package/dist/types/components.d.ts +771 -255
  214. package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +1 -0
  215. package/package.json +4 -3
  216. package/dist/collection/lib/licenses/sankhyalicense.module.js +0 -1
  217. package/dist/sankhyablocks/p-012208e0.entry.js +0 -1
  218. package/dist/sankhyablocks/p-07b14811.entry.js +0 -1
  219. package/dist/sankhyablocks/p-0dac8fef.js +0 -1
  220. package/dist/sankhyablocks/p-1210500e.js +0 -1
  221. package/dist/sankhyablocks/p-16fc4acd.js +0 -1
  222. package/dist/sankhyablocks/p-25209340.entry.js +0 -1
  223. package/dist/sankhyablocks/p-295b83ae.entry.js +0 -1
  224. package/dist/sankhyablocks/p-398cdd67.entry.js +0 -1
  225. package/dist/sankhyablocks/p-4e63ffed.entry.js +0 -1
  226. package/dist/sankhyablocks/p-5bab470d.entry.js +0 -1
  227. package/dist/sankhyablocks/p-5c7af8a9.entry.js +0 -1
  228. package/dist/sankhyablocks/p-81769310.entry.js +0 -11
  229. package/dist/sankhyablocks/p-9fd87bfd.entry.js +0 -1
  230. package/dist/sankhyablocks/p-a349689a.js +0 -1
  231. package/dist/sankhyablocks/p-a76e6d51.entry.js +0 -1
  232. package/dist/sankhyablocks/p-a86eee47.entry.js +0 -1
  233. package/dist/sankhyablocks/p-c6a8a8bc.entry.js +0 -1
  234. package/dist/sankhyablocks/p-c9e6d720.js +0 -1
  235. package/dist/sankhyablocks/p-dff65083.entry.js +0 -1
  236. package/dist/sankhyablocks/p-fa18530e.entry.js +0 -1
@@ -12,6 +12,7 @@ const SnkFilterBinarySelect = class {
12
12
  this.value = undefined;
13
13
  this.config = undefined;
14
14
  this.presentationMode = EPresentationMode.CHIP;
15
+ this.errorMessage = undefined;
15
16
  }
16
17
  isSelected(option) {
17
18
  return this.value == undefined || this.value === option;
@@ -20,6 +21,7 @@ const SnkFilterBinarySelect = class {
20
21
  * Emitido quando acontece a alteração de valor do componente snk-filter-binary-select
21
22
  */
22
23
  ezChangeListener(evt) {
24
+ this.errorMessage = undefined;
23
25
  if (this.presentationMode === EPresentationMode.MODAL) {
24
26
  if (!evt.detail) {
25
27
  this.assertCheckedOption(evt.target);
@@ -36,6 +38,23 @@ const SnkFilterBinarySelect = class {
36
38
  async resetValues() {
37
39
  this.ezChangeListener({ detail: this._noOptionValue });
38
40
  }
41
+ /**
42
+ * Limpa o valor do componente restaurando o valor original da configuração.
43
+ */
44
+ async clearValue() {
45
+ this.value = this.config.value;
46
+ this._radioButtonValue = this.value || this._noOptionValue;
47
+ }
48
+ /**
49
+ * Define o foco no componente snk-filter-binary-select.
50
+ */
51
+ async setFocus() {
52
+ if (this.presentationMode === EPresentationMode.MODAL) {
53
+ this._checkOne.setFocus();
54
+ return;
55
+ }
56
+ this._element.querySelector('ez-radio-button').focus();
57
+ }
39
58
  assertCheckedOption(updatingCheck) {
40
59
  if (updatingCheck === this._checkOne) {
41
60
  this._checkTwo.value = true;
@@ -77,9 +96,11 @@ const SnkFilterBinarySelect = class {
77
96
  }
78
97
  const [optOne, optTwo] = this.config.props.options;
79
98
  if (this.presentationMode === EPresentationMode.MODAL) {
80
- return (h(Host, null, h("div", { class: "ez-row ez-size-height--full" }, 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), h("div", { class: "ez-col ez-col--sd-4" }, 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) })), h("div", { class: "ez-col ez-col--sd-4" }, 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) })))));
99
+ return (h(Host, null, h("div", { class: "ez-row ez-size-height--full" }, 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), h("div", { class: "ez-col ez-col--sd-4" }, 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) })), h("div", { class: "ez-col ez-col--sd-4" }, 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 &&
100
+ h("span", { class: 'ez-text ez-text--small ez-text--error ez-margin--small' }, this.errorMessage))));
81
101
  }
82
- return (h(Host, null, h("ez-radio-button", { value: this._radioButtonValue }, 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 }), 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 }), 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 }))));
102
+ return (h(Host, null, h("ez-tooltip", { active: this.config.enabled === false, message: this.config.disabledMessage, type: 'warning' }, h("ez-radio-button", { value: this._radioButtonValue }, 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 }), 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 }), 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 &&
103
+ h("span", { class: 'ez-text ez-text--small ez-text--error ez-margin--small' }, this.errorMessage))));
83
104
  }
84
105
  get _element() { return getElement(this); }
85
106
  };
@@ -7,8 +7,24 @@ const SnkFilterCheckboxList = class {
7
7
  registerInstance(this, hostRef);
8
8
  this.valueChanged = createEvent(this, "valueChanged", 7);
9
9
  this.config = undefined;
10
+ this.errorMessage = undefined;
10
11
  this.optionsList = [];
11
12
  }
13
+ /**
14
+ * Define o foco no componente snk-filter-checkbox-list.
15
+ */
16
+ async setFocus() {
17
+ var _a, _b;
18
+ (_b = (_a = this._element) === null || _a === void 0 ? void 0 : _a.querySelector('ez-check')) === null || _b === void 0 ? void 0 : _b.setFocus();
19
+ }
20
+ /**
21
+ * Limpa o valor do componente restaurando o valor original da configuração.
22
+ */
23
+ async clearValue() {
24
+ var _a;
25
+ this.config = Object.assign(Object.assign({}, this.config), { value: this.config.value });
26
+ this.valueChanged.emit((_a = this.config) === null || _a === void 0 ? void 0 : _a.value);
27
+ }
12
28
  componentDidLoad() {
13
29
  if (this._element) {
14
30
  ElementIDUtils.addIDInfo(this._element, 'filterContentEditor');
@@ -16,13 +32,14 @@ const SnkFilterCheckboxList = class {
16
32
  }
17
33
  handleToggleCheck(itemChanged, checked) {
18
34
  var _a, _b;
35
+ this.errorMessage = undefined;
19
36
  let configValueMap = (_a = this.config.value) !== null && _a !== void 0 ? _a : {};
20
37
  configValueMap[itemChanged.name] = checked;
21
38
  this.config = Object.assign(Object.assign({}, this.config), { value: configValueMap });
22
39
  this.valueChanged.emit((_b = this.config) === null || _b === void 0 ? void 0 : _b.value);
23
40
  }
24
41
  renderOptions() {
25
- return this.optionsList.map(option => (h("ez-check", { label: option.label, onEzChange: (event) => this.handleToggleCheck(option, event.detail), value: !!this.isChecked(option.name) })));
42
+ return this.optionsList.map(option => (h("ez-check", { label: option.label, onEzChange: (event) => this.handleToggleCheck(option, event.detail), value: !!this.isChecked(option.name), enabled: this.config.enabled })));
26
43
  }
27
44
  isChecked(itemName) {
28
45
  var _a;
@@ -40,7 +57,8 @@ const SnkFilterCheckboxList = class {
40
57
  if (!this.config || this.config.type !== FilterItemType.CHECK_BOX_LIST) {
41
58
  return undefined;
42
59
  }
43
- return (h("div", { class: 'ez-flex ez-flex--column' }, this.renderOptions()));
60
+ return (h("ez-tooltip", { active: this.config.enabled === false, message: this.config.disabledMessage, type: 'warning' }, h("div", { class: 'ez-flex ez-flex--column' }, this.renderOptions(), this.errorMessage &&
61
+ h("span", { class: 'ez-text ez-text--small ez-text--error ez-margin--small' }, this.errorMessage))));
44
62
  }
45
63
  get _element() { return getElement(this); }
46
64
  };
@@ -1,9 +1,9 @@
1
1
  import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host, g as getElement } from './index-479e1293.js';
2
- import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
3
- import { F as FilterItemType } from './filter-item-type.enum-d45e026f.js';
4
2
  import { ElementIDUtils, ObjectUtils } from '@sankhyalabs/core';
5
- import { E as EPresentationMode } from './presentationMode-783bbf9d.js';
3
+ import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
6
4
  import { P as PersonalizedFilterUtils } from './PersonalizedFilterUtils-2db38ff2.js';
5
+ import { E as EPresentationMode } from './presentationMode-783bbf9d.js';
6
+ import { F as FilterItemType } from './filter-item-type.enum-d45e026f.js';
7
7
  import './index-8acbae97.js';
8
8
 
9
9
  const SnkFilterDetail = class {
@@ -13,13 +13,30 @@ const SnkFilterDetail = class {
13
13
  this.config = undefined;
14
14
  this.getMessage = undefined;
15
15
  this.showHardFixed = true;
16
+ this.removalBlocked = false;
16
17
  }
17
18
  /**
18
- * Exibe o componente snk-filter-detail.
19
+ * Define o foco no campo do editor.
19
20
  */
20
- async show() {
21
- var _a, _b;
22
- (_b = (_a = this._editor) === null || _a === void 0 ? void 0 : _a["show"]) === null || _b === void 0 ? void 0 : _b.call(_a);
21
+ async setFocusField() {
22
+ var _a, _b, _c, _d;
23
+ if (!this._editor) {
24
+ return;
25
+ }
26
+ if (this._editor["setFocus"]) {
27
+ (_b = (_a = this._editor) === null || _a === void 0 ? void 0 : _a["setFocus"]) === null || _b === void 0 ? void 0 : _b.call(_a);
28
+ }
29
+ else if (this._editor["focus"]) {
30
+ (_d = (_c = this._editor) === null || _c === void 0 ? void 0 : _c["focus"]) === null || _d === void 0 ? void 0 : _d.call(_c);
31
+ }
32
+ }
33
+ async clearValue() {
34
+ if (!this._editor) {
35
+ return;
36
+ }
37
+ if (this._editor["clearValue"]) {
38
+ await this._editor["clearValue"]();
39
+ }
23
40
  }
24
41
  observeConfig(newValue) {
25
42
  var _a, _b;
@@ -91,7 +108,7 @@ const SnkFilterDetail = class {
91
108
  return Object.assign(Object.assign({}, item), { visible: false, fixed: false, value: undefined });
92
109
  }
93
110
  getPopUpHeaderButtons() {
94
- return (h(Fragment, null, !this.config.removalBlocked &&
111
+ return (h(Fragment, null, !this.removalBlocked && !this.config.removalBlocked &&
95
112
  this.buildIcon(this.getMessage("snkFilterBar.removeFilter"), "delete", () => this.removeItem()), this.showHardFixed && !this.config.hardFixed &&
96
113
  this.buildIcon(this.getMessage(this.config.fixed ? "snkFilterBar.unpinFilter" : "snkFilterBar.pinFilter"), this.config.fixed ? "un-pin" : "push-pin", () => this.changeConfig(Object.assign(Object.assign({}, this.config), { fixed: !this.config.fixed })))));
97
114
  }
@@ -1,11 +1,11 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-479e1293.js';
2
2
  import { ElementIDUtils, ObjectUtils } from '@sankhyalabs/core';
3
- import { F as FilterItemType } from './filter-item-type.enum-d45e026f.js';
3
+ import { C as ConfigStorage } from './ConfigStorage-22eace3a.js';
4
4
  import { E as EPresentationMode } from './presentationMode-783bbf9d.js';
5
- import { C as ConfigStorage } from './ConfigStorage-b5a1dba3.js';
5
+ import { F as FilterItemType } from './filter-item-type.enum-d45e026f.js';
6
6
  import { F as FilterType } from './filter-type.enum-f6a8fe23.js';
7
- import './form-config-fetcher-6ab4e805.js';
8
- import './DataFetcher-6f6de657.js';
7
+ import './form-config-fetcher-bc6f0f1f.js';
8
+ import './DataFetcher-f6b2961a.js';
9
9
  import './PrintUtils-3e4ff0f5.js';
10
10
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
11
11
 
@@ -21,12 +21,6 @@ const SnkFilterModalItem = class {
21
21
  this.configName = undefined;
22
22
  this.resourceID = undefined;
23
23
  }
24
- observeFilterItem(newValue) {
25
- var _a, _b;
26
- this._editor && (this._editor["config"] = newValue);
27
- (_b = (_a = this._editor) === null || _a === void 0 ? void 0 : _a['reloadList']) === null || _b === void 0 ? void 0 : _b.call(_a);
28
- this.filterChange.emit(newValue);
29
- }
30
24
  getContentEditorConfig() {
31
25
  const props = { presentationMode: EPresentationMode.MODAL };
32
26
  switch (this.filterItem.type) {
@@ -61,6 +55,7 @@ const SnkFilterModalItem = class {
61
55
  return !this.filterItem.visible ? newValue !== undefined : true;
62
56
  }
63
57
  updateFilterValue(data) {
58
+ var _a, _b;
64
59
  const newValue = (data === null || data === void 0 ? void 0 : data.value) !== undefined ? data.value : data;
65
60
  if (this.filterItem.groupedItems != undefined) {
66
61
  this.filterItem = Object.assign(Object.assign({}, this.filterItem), { visible: newValue > 0, value: newValue, groupedItems: data.items });
@@ -68,6 +63,9 @@ const SnkFilterModalItem = class {
68
63
  else {
69
64
  this.filterItem = Object.assign(Object.assign({}, this.filterItem), { value: this.filterItem.type === (FilterItemType.SEARCH || FilterItemType.CHECK_BOX_LIST) ? data : newValue, visible: this.isVisible(newValue) });
70
65
  }
66
+ this._editor && (this._editor["config"] = this.filterItem);
67
+ (_b = (_a = this._editor) === null || _a === void 0 ? void 0 : _a['reloadList']) === null || _b === void 0 ? void 0 : _b.call(_a);
68
+ this.filterChange.emit(this.filterItem);
71
69
  }
72
70
  handleDeleteFilter(filter, filterItemType) {
73
71
  if (filterItemType === FilterItemType.PERSONALIZED) {
@@ -97,12 +95,9 @@ const SnkFilterModalItem = class {
97
95
  }
98
96
  render() {
99
97
  const { tag: ContentEditor, props } = this.getContentEditorConfig();
100
- return (h(Host, null, h("div", { class: "ez-flex ez-flex--column grow" }, this.canShowDetailModal() && (h("div", { class: "col ez-col--sd-12 ez-align--right ez-padding-medium ez-flex--align-items-center" }, h("div", { class: "ez-title ez-title--small ez-title--primary grow" }, this.filterItem.detailModal))), h(ContentEditor, Object.assign({ ref: ref => this._editor = ref, config: this.filterItem, value: this.filterItem.value, onValueChanged: (event) => this.updateFilterValue(event.detail), "data-element-id": this._idContentEditor }, props)))));
98
+ return (h(Host, null, h("div", { class: "ez-flex ez-flex--column grow" }, this.canShowDetailModal() && (h("label", { class: "ez-text ez-text--medium ez-text--primary ez-margin-bottom--extra-small", htmlFor: `filter-item-${this.filterItem.id}` }, this.filterItem.detailModal)), h(ContentEditor, Object.assign({ ref: ref => this._editor = ref, id: `filter-item-${this.filterItem.id}`, config: this.filterItem, value: this.filterItem.value, onValueChanged: (event) => this.updateFilterValue(event.detail), "data-element-id": this._idContentEditor }, props)))));
101
99
  }
102
100
  get _element() { return getElement(this); }
103
- static get watchers() { return {
104
- "filterItem": ["observeFilterItem"]
105
- }; }
106
101
  };
107
102
  SnkFilterModalItem.style = snkFilterModalItemCss;
108
103
 
@@ -8,21 +8,32 @@ const SnkFilterMultiSelect = class {
8
8
  this.valueChanged = createEvent(this, "valueChanged", 7);
9
9
  this.value = undefined;
10
10
  this.config = undefined;
11
+ this.errorMessage = undefined;
11
12
  }
12
13
  /**
13
14
  * Emitido quando acontece a alteração de valor do componente snk-filter-multi-select
14
15
  */
15
16
  ezChangeListener(evt) {
16
17
  var _a;
18
+ this.errorMessage = undefined;
17
19
  this.value = (_a = evt.detail) === null || _a === void 0 ? void 0 : _a.value;
18
20
  this.valueChanged.emit(this.value);
19
21
  }
20
22
  /**
21
- * Exibe o componente snk-filter-multi-select
23
+ * Define o foco no componente snk-filter-multi-select.
22
24
  */
23
- async show() {
25
+ async setFocus() {
24
26
  this._comboElement.setFocus();
25
27
  }
28
+ /**
29
+ * Limpa o valor do componente restaurando o valor original da configuração.
30
+ */
31
+ async clearValue() {
32
+ this.value = this.config.value;
33
+ if (this._comboElement) {
34
+ this._comboElement.value = this.config.value;
35
+ }
36
+ }
26
37
  componentDidLoad() {
27
38
  if (this._element) {
28
39
  ElementIDUtils.addIDInfo(this._element, 'filterContentEditor');
@@ -32,7 +43,9 @@ const SnkFilterMultiSelect = class {
32
43
  if (!this.config || this.config.type !== FilterItemType.MULTI_SELECT) {
33
44
  return undefined;
34
45
  }
35
- return (h("ez-combo-box", { id: this.config.id, ref: ref => this._comboElement = ref, label: this.config.label, value: this.config.value, options: this.config.props.options }));
46
+ return (h("ez-tooltip", { active: this.config.enabled === false, message: this.config.disabledMessage, type: 'warning' }, h("ez-combo-box", { id: this.config.id, ref: ref => this._comboElement = ref, label: this.config.label, value: this.config.value, options: this.config.props.options, enabled: this.config.enabled, errorMessage: this.errorMessage, onEzVisibilityChange: (event) => {
47
+ event.stopPropagation();
48
+ } })));
36
49
  }
37
50
  get _element() { return getElement(this); }
38
51
  };
@@ -1,8 +1,8 @@
1
1
  import { r as registerInstance, c as createEvent, h, g as getElement } from './index-479e1293.js';
2
2
  import { ElementIDUtils } from '@sankhyalabs/core';
3
3
  import { F as FilterItemType } from './filter-item-type.enum-d45e026f.js';
4
- import { E as EPresentationMode } from './presentationMode-783bbf9d.js';
5
4
  import { F as FilterNumberVariation } from './filterNumberVariation-8cee02ea.js';
5
+ import { E as EPresentationMode } from './presentationMode-783bbf9d.js';
6
6
 
7
7
  const SnkFilterPeriod = class {
8
8
  constructor(hostRef) {
@@ -15,11 +15,13 @@ const SnkFilterPeriod = class {
15
15
  this.getMessage = undefined;
16
16
  this.value = undefined;
17
17
  this.presentationMode = EPresentationMode.CHIP;
18
+ this.errorMessage = undefined;
18
19
  }
19
20
  /**
20
21
  * Emitido quando acontece a alteração de valor do componente snk-filter-number
21
22
  */
22
23
  ezChangeListener(evt) {
24
+ this.errorMessage = undefined;
23
25
  if (this.getVariation() === FilterNumberVariation.INTERVAL) {
24
26
  const start = this._startInterval.value;
25
27
  const end = this._endInterval.value;
@@ -40,6 +42,35 @@ const SnkFilterPeriod = class {
40
42
  }
41
43
  this._numberElement.setFocus();
42
44
  }
45
+ /**
46
+ * Define o foco no componente snk-filter-number
47
+ */
48
+ async setFocus() {
49
+ if (this.getVariation() === FilterNumberVariation.INTERVAL) {
50
+ await this._startInterval.setFocus();
51
+ return;
52
+ }
53
+ await this._numberElement.setFocus();
54
+ }
55
+ /**
56
+ * Limpa o valor do componente restaurando o valor original da configuração.
57
+ */
58
+ async clearValue() {
59
+ var _a, _b;
60
+ this.value = this.config.value;
61
+ if (this.getVariation() === FilterNumberVariation.INTERVAL) {
62
+ const intervalValue = this.config.value;
63
+ if (this._startInterval) {
64
+ this._startInterval.value = (_a = intervalValue === null || intervalValue === void 0 ? void 0 : intervalValue.start) !== null && _a !== void 0 ? _a : null;
65
+ }
66
+ if (this._endInterval) {
67
+ this._endInterval.value = (_b = intervalValue === null || intervalValue === void 0 ? void 0 : intervalValue.end) !== null && _b !== void 0 ? _b : null;
68
+ }
69
+ }
70
+ else if (this._numberElement) {
71
+ this._numberElement.value = this.config.value;
72
+ }
73
+ }
43
74
  getIntervalValue(prop) {
44
75
  const objValue = this.value ? this.value[prop] : null;
45
76
  return objValue !== null && objValue !== void 0 ? objValue : null;
@@ -71,9 +102,9 @@ const SnkFilterPeriod = class {
71
102
  return undefined;
72
103
  }
73
104
  if (this.getVariation() === FilterNumberVariation.INTERVAL) {
74
- return (h("div", { class: "ez-col ez-col--nowrap" }, h("ez-number-input", { id: `${this.config.id}_start`, class: this.presentationMode === EPresentationMode.MODAL ? 'ez-padding--small' : '', label: this._startIntervalLabel, ref: ref => this._startInterval = ref, value: this.getIntervalValue("start"), precision: (_a = this.config.props) === null || _a === void 0 ? void 0 : _a.precision }), this.buildLabel(), h("ez-number-input", { id: `${this.config.id}_end`, class: this.presentationMode === EPresentationMode.MODAL ? 'ez-padding--small' : '', label: this._endIntervalLabel, ref: ref => this._endInterval = ref, value: this.getIntervalValue("end"), precision: (_b = this.config.props) === null || _b === void 0 ? void 0 : _b.precision })));
105
+ return (h("ez-tooltip", { active: this.config.enabled === false, message: this.config.disabledMessage, type: 'warning' }, h("div", { class: "ez-col ez-col--nowrap" }, h("ez-number-input", { id: `${this.config.id}_start`, class: this.presentationMode === EPresentationMode.MODAL ? 'ez-padding-right--medium' : '', label: this._startIntervalLabel, ref: ref => this._startInterval = ref, value: this.getIntervalValue("start"), enabled: this.config.enabled, precision: (_a = this.config.props) === null || _a === void 0 ? void 0 : _a.precision, errorMessage: this.errorMessage }), this.buildLabel(), h("ez-number-input", { id: `${this.config.id}_end`, label: this._endIntervalLabel, ref: ref => this._endInterval = ref, value: this.getIntervalValue("end"), enabled: this.config.enabled, precision: (_b = this.config.props) === null || _b === void 0 ? void 0 : _b.precision, errorMessage: this.errorMessage }))));
75
106
  }
76
- return (h("ez-number-input", { id: this.config.id, ref: ref => this._numberElement = ref, label: this.config.label, value: this.config.value, precision: (_c = this.config.props) === null || _c === void 0 ? void 0 : _c.precision }));
107
+ return (h("ez-tooltip", { active: this.config.enabled === false, message: this.config.disabledMessage, type: 'warning' }, h("ez-number-input", { id: this.config.id, ref: ref => this._numberElement = ref, value: this.config.value, precision: (_c = this.config.props) === null || _c === void 0 ? void 0 : _c.precision, enabled: this.config.enabled, errorMessage: this.errorMessage })));
77
108
  }
78
109
  get _element() { return getElement(this); }
79
110
  };
@@ -10,37 +10,77 @@ const SnkFilterPeriod = class {
10
10
  this._startDateLabel = 'Inicial';
11
11
  this._endDateLabel = 'Final';
12
12
  this._toLabel = 'até';
13
+ this.internalChange = {
14
+ start: false,
15
+ end: false
16
+ };
13
17
  this.config = undefined;
14
18
  this.getMessage = undefined;
15
- this.value = undefined;
19
+ this.value = {
20
+ start: null,
21
+ end: null
22
+ };
16
23
  this.presentationMode = EPresentationMode.CHIP;
24
+ this.errorMessage = undefined;
25
+ }
26
+ configChanged(newValue, oldValue) {
27
+ if (this.internalChange.end) {
28
+ this.internalChange.end = false;
29
+ return;
30
+ }
31
+ if (this.internalChange.start) {
32
+ this.internalChange.start = false;
33
+ return;
34
+ }
35
+ if (newValue && (newValue.start !== (oldValue === null || oldValue === void 0 ? void 0 : oldValue.start) || newValue.end !== (oldValue === null || oldValue === void 0 ? void 0 : oldValue.end))) {
36
+ this.valueStart = this.parseDate(newValue.start);
37
+ this.valueEnd = this.parseDate(newValue.end);
38
+ }
39
+ }
40
+ ezChangeListener(event, field) {
41
+ this.errorMessage = undefined;
42
+ this.internalChange[field] = true;
43
+ this.value = Object.assign(Object.assign({}, (this.value || {})), { [field]: event.detail ? this.parseDate(event.detail) : null });
44
+ this.valueChanged.emit(this.value);
17
45
  }
18
46
  /**
19
- * Emitido quando acontece a alteração de valor do componente snk-filter-period
47
+ * Define o foco no componente snk-filter-period.
20
48
  */
21
- ezChangeListener() {
22
- const start = this._startDate.value;
23
- const end = this._endDate.value;
24
- this.value = (start || end ? { start, end } : undefined);
25
- this.valueChanged.emit(this.value);
49
+ async setFocus() {
50
+ this._startDate.setFocus();
51
+ }
52
+ /**
53
+ * Limpa o valor do componente restaurando o valor original da configuração.
54
+ */
55
+ async clearValue() {
56
+ this.value = this.config.value;
57
+ this.valueStart = this.getDate("start");
58
+ this.valueEnd = this.getDate("end");
26
59
  }
27
60
  componentDidLoad() {
28
61
  if (this._element) {
29
62
  ElementIDUtils.addIDInfo(this._element, 'filterContentEditor');
63
+ this._element.querySelectorAll('ez-date-input').forEach(input => {
64
+ const textInput = input.shadowRoot.querySelector('ez-text-input');
65
+ textInput.style.setProperty('--ez-text-input__min-width', '120px');
66
+ });
30
67
  }
31
68
  }
32
- getDate(prop) {
33
- const objValue = this.value ? this.value[prop] : null;
34
- if (objValue instanceof Date) {
35
- return objValue;
69
+ parseDate(date) {
70
+ if (date instanceof Date) {
71
+ return date;
36
72
  }
37
- if (typeof objValue === "string") {
38
- let date = new Date(objValue);
73
+ if (typeof date === "string") {
74
+ date = new Date(date);
39
75
  date.setMinutes(date.getMinutes() + date.getTimezoneOffset());
40
76
  return date;
41
77
  }
42
78
  return null;
43
79
  }
80
+ getDate(prop) {
81
+ const objValue = this.value ? this.value[prop] : null;
82
+ return this.parseDate(objValue);
83
+ }
44
84
  /**
45
85
  * Exibe o componente snk-filter-period
46
86
  */
@@ -58,14 +98,19 @@ const SnkFilterPeriod = class {
58
98
  this._endDateLabel = this.getMessage('snkFilterBar.labelEnd');
59
99
  this._toLabel = this.getMessage('snkFilterBar.labelTo');
60
100
  }
101
+ this.valueStart = this.getDate("start");
102
+ this.valueEnd = this.getDate("end");
61
103
  }
62
104
  render() {
63
105
  if (!this.config || this.config.type !== FilterItemType.PERIOD) {
64
106
  return undefined;
65
107
  }
66
- return (h("div", { class: "ez-col ez-col--nowrap" }, h("ez-date-input", { id: `${this.config.id}_start`, class: this.presentationMode === EPresentationMode.MODAL ? 'ez-padding--small' : '', label: this._startDateLabel, ref: ref => this._startDate = ref, value: this.getDate("start") }), this.buildLabel(), h("ez-date-input", { id: `${this.config.id}_end`, class: this.presentationMode === EPresentationMode.MODAL ? 'ez-padding--small' : '', label: this._endDateLabel, ref: ref => this._endDate = ref, value: this.getDate("end") })));
108
+ return (h("ez-tooltip", { active: this.config.enabled === false, message: this.config.disabledMessage, type: 'warning' }, h("div", { class: "ez-col ez-col--nowrap" }, h("ez-date-input", { id: `${this.config.id}_start`, class: this.presentationMode === EPresentationMode.MODAL ? 'ez-padding-right--medium' : '', label: this._startDateLabel, ref: ref => this._startDate = ref, enabled: this.config.enabled, value: this.valueStart, errorMessage: this.errorMessage, onEzChange: (event) => this.ezChangeListener(event, 'start') }), this.buildLabel(), h("ez-date-input", { id: `${this.config.id}_end`, label: this._endDateLabel, ref: ref => this._endDate = ref, enabled: this.config.enabled, value: this.valueEnd, errorMessage: this.errorMessage, onEzChange: (event) => this.ezChangeListener(event, 'end') }))));
67
109
  }
68
110
  get _element() { return getElement(this); }
111
+ static get watchers() { return {
112
+ "value": ["configChanged"]
113
+ }; }
69
114
  };
70
115
 
71
116
  export { SnkFilterPeriod as snk_filter_period };
@@ -9,11 +9,13 @@ const SnkFilterSearch = class {
9
9
  this._isSearchPlus = false;
10
10
  this.config = undefined;
11
11
  this.value = undefined;
12
+ this.errorMessage = undefined;
12
13
  }
13
14
  /**
14
15
  * Emitido quando acontece a alteração de valor do componente snk-filter-search
15
16
  */
16
17
  async ezChangeListener(_evt) {
18
+ this.errorMessage = undefined;
17
19
  if (this._isSearchPlus) {
18
20
  this.value = await this._searchInput.getValueAsync();
19
21
  }
@@ -40,16 +42,25 @@ const SnkFilterSearch = class {
40
42
  });
41
43
  }
42
44
  /**
43
- * Exibe o componente snk-filter-search
45
+ * Define o foco no componente snk-filter-search.
44
46
  */
45
- async show() {
47
+ async setFocus() {
46
48
  this._searchInput.setFocus();
47
49
  }
50
+ /**
51
+ * Limpa o valor do componente restaurando o valor original da configuração.
52
+ */
53
+ async clearValue() {
54
+ this.value = this.config.value;
55
+ if (this._searchInput) {
56
+ this._searchInput.value = this.config.value;
57
+ }
58
+ }
48
59
  getInputItem() {
49
60
  var _a;
50
61
  this._isSearchPlus = ((_a = this.config.props) === null || _a === void 0 ? void 0 : _a["useSearchPlus"]) == true;
51
62
  const TagName = this._isSearchPlus ? "ez-search-plus" : "ez-search";
52
- return (h(TagName, { id: this.config.id, suppressEmptyOption: true, value: this.config.value, label: this.config.label, ref: ref => this._searchInput = ref, optionLoader: ({ mode, argument }) => this.doSearch(mode, argument, this._isSearchPlus) }));
63
+ return (h("ez-tooltip", { active: this.config.enabled === false, message: this.config.disabledMessage, type: 'warning' }, h(TagName, { id: this.config.id, suppressEmptyOption: true, value: this.config.value, label: this.config.label, enabled: this.config.enabled, ref: ref => this._searchInput = ref, optionLoader: ({ mode, argument }) => this.doSearch(mode, argument, this._isSearchPlus), errorMessage: this.errorMessage })));
53
64
  }
54
65
  render() {
55
66
  if (!this.config || this.config.type !== FilterItemType.SEARCH) {
@@ -7,14 +7,31 @@ const SnkFilterText = class {
7
7
  this.valueChanged = createEvent(this, "valueChanged", 7);
8
8
  this.config = undefined;
9
9
  this.value = undefined;
10
+ this.errorMessage = undefined;
10
11
  }
11
12
  /**
12
13
  * Emitido quando acontece a alteração de valor do componente snk-filter-text.
13
14
  */
14
15
  ezChangeListener(evt) {
16
+ this.errorMessage = undefined;
15
17
  this.value = evt.detail;
16
18
  this.valueChanged.emit(this.value);
17
19
  }
20
+ /**
21
+ * Define o foco no componente snk-filter-text.
22
+ */
23
+ async setFocus() {
24
+ this._textInputElement.setFocus();
25
+ }
26
+ /**
27
+ * Limpa o valor do componente restaurando o valor original da configuração.
28
+ */
29
+ async clearValue() {
30
+ this.value = this.config.value;
31
+ if (this._textInputElement) {
32
+ this._textInputElement.value = this.config.value;
33
+ }
34
+ }
18
35
  componentDidLoad() {
19
36
  if (this._element) {
20
37
  ElementIDUtils.addIDInfo(this._element, 'filterContentEditor');
@@ -25,7 +42,7 @@ const SnkFilterText = class {
25
42
  if (!this.config) {
26
43
  return undefined;
27
44
  }
28
- return (h("ez-text-input", { id: this.config.id, ref: ref => this._textInputElement = ref, label: this.config.label, value: this.config.value, mask: (_a = this.config) === null || _a === void 0 ? void 0 : _a.mask, cleanValueMask: true }));
45
+ return (h("ez-tooltip", { active: this.config.enabled === false, message: this.config.disabledMessage, type: 'warning' }, h("ez-text-input", { id: this.config.id, ref: ref => this._textInputElement = ref, value: this.config.value, mask: (_a = this.config) === null || _a === void 0 ? void 0 : _a.mask, enabled: this.config.enabled, cleanValueMask: true, errorMessage: this.errorMessage })));
29
46
  }
30
47
  get _element() { return getElement(this); }
31
48
  };
@@ -1,14 +1,14 @@
1
1
  import { r as registerInstance, c as createEvent, h, g as getElement, H as Host } from './index-479e1293.js';
2
2
  import { ElementIDUtils, ObjectUtils, ApplicationContext } from '@sankhyalabs/core';
3
- import { S as SnkFormConfigManager } from './SnkFormConfigManager-34fc1dc7.js';
3
+ import { S as SnkFormConfigManager } from './SnkFormConfigManager-968b97e7.js';
4
4
  import { R as ResourceIDUtils } from './ResourceIDUtils-a114189a.js';
5
5
  import { buildFormConfigFromDataUnit } from '@sankhyalabs/ezui/dist/collection/utils/form';
6
6
  import { b as buildGuides, a as buildGuidesMap, g as getFieldsToSave, u as updateTabInFieldsFromGroupList, c as buildNewGuideName } from './FormConfigHelper-4e42f0b6.js';
7
7
  import { a as TAB_NAMES, G as GROUP_NAMES } from './constants-7b422de0.js';
8
8
  import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
9
- import { U as UserConfigType } from './form-config-fetcher-6ab4e805.js';
10
- import './ConfigStorage-b5a1dba3.js';
11
- import './DataFetcher-6f6de657.js';
9
+ import { U as UserConfigType } from './form-config-fetcher-bc6f0f1f.js';
10
+ import './ConfigStorage-22eace3a.js';
11
+ import './DataFetcher-f6b2961a.js';
12
12
  import './PrintUtils-3e4ff0f5.js';
13
13
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
14
14
  import './filter-item-type.enum-d45e026f.js';
@@ -34,18 +34,26 @@ const SnkForm = class {
34
34
  }
35
35
  /**
36
36
  * Exibe a janela de configurações do formulário.
37
+ * @async
38
+ * @returns {Promise<void>}
37
39
  */
38
40
  async showConfig() {
39
41
  this._showFormConfig = true;
40
42
  }
41
43
  /**
42
44
  * Fecha a janela de configurações do formulário.
45
+ * @async
46
+ * @returns {Promise<void>}
43
47
  */
44
48
  async hideConfig() {
45
49
  this._showFormConfig = false;
46
50
  }
47
51
  /**
48
- * Registra um editor customizado para campos da grade e formulário.
52
+ * Registra um editor customizado para campos do formulário.
53
+ * @async
54
+ * @param {string} fieldName - Nome do campo.
55
+ * @param {ICustomEditor} customEditor - Editor customizado.
56
+ * @returns {Promise<void>}
49
57
  */
50
58
  async addCustomEditor(fieldName, customEditor) {
51
59
  if (this._form) {
@@ -58,10 +66,28 @@ const SnkForm = class {
58
66
  }
59
67
  /**
60
68
  * Altera/adiciona uma propriedade nos metadados do campo.
69
+ * @async
70
+ * @param {string} fieldName - Nome do campo.
71
+ * @param {string} propName - Nome da propriedade.
72
+ * @param {any} value - Valor da propriedade.
73
+ * @returns {Promise<void>}
61
74
  */
62
75
  async setFieldProp(fieldName, propName, value) {
63
76
  await this._form.setFieldProp(fieldName, propName, value);
64
77
  }
78
+ /**
79
+ * Valida o formulário.
80
+ * @async
81
+ * @returns {Promise<void>}
82
+ * @description
83
+ * Este método executa a validação do formulário, verificando se todos os campos estão
84
+ * preenchidos corretamente de acordo com as regras definidas.
85
+ * Se a validação falhar, uma exceção será lançada com os detalhes dos erros encontrados.
86
+ * Caso contrário, o método será resolvido sem erros.
87
+ */
88
+ async validate() {
89
+ await this._form.validate();
90
+ }
65
91
  closeConfig() {
66
92
  this.hideConfig();
67
93
  }