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

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-6b0101fe.js} +13 -3
  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 +173 -28
  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 +11 -1
  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-d4a42b59.js} +13 -3
  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-0e495575.js → p-0237c565.js} +1 -1
  150. package/dist/sankhyablocks/p-093f58fa.entry.js +1 -0
  151. package/dist/sankhyablocks/{p-8d1508aa.entry.js → p-0affc07a.entry.js} +1 -1
  152. package/dist/sankhyablocks/{p-ad2ae575.entry.js → p-0e1f0344.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-158adf33.entry.js → p-605ef7b2.entry.js} +1 -1
  164. package/dist/sankhyablocks/p-658f67a5.js +1 -0
  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
@@ -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
  };
@@ -3,11 +3,11 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-1cf293c1.js');
6
- const utils = require('@sankhyalabs/ezui/dist/collection/utils');
7
- const filterItemType_enum = require('./filter-item-type.enum-a7ffdaa6.js');
8
6
  const core = require('@sankhyalabs/core');
9
- const presentationMode = require('./presentationMode-52ec3bdd.js');
7
+ const utils = require('@sankhyalabs/ezui/dist/collection/utils');
10
8
  const PersonalizedFilterUtils = require('./PersonalizedFilterUtils-7259cf65.js');
9
+ const presentationMode = require('./presentationMode-52ec3bdd.js');
10
+ const filterItemType_enum = require('./filter-item-type.enum-a7ffdaa6.js');
11
11
  require('./index-62760a9c.js');
12
12
 
13
13
  const SnkFilterDetail = class {
@@ -17,13 +17,30 @@ const SnkFilterDetail = class {
17
17
  this.config = undefined;
18
18
  this.getMessage = undefined;
19
19
  this.showHardFixed = true;
20
+ this.removalBlocked = false;
20
21
  }
21
22
  /**
22
- * Exibe o componente snk-filter-detail.
23
+ * Define o foco no campo do editor.
23
24
  */
24
- async show() {
25
- var _a, _b;
26
- (_b = (_a = this._editor) === null || _a === void 0 ? void 0 : _a["show"]) === null || _b === void 0 ? void 0 : _b.call(_a);
25
+ async setFocusField() {
26
+ var _a, _b, _c, _d;
27
+ if (!this._editor) {
28
+ return;
29
+ }
30
+ if (this._editor["setFocus"]) {
31
+ (_b = (_a = this._editor) === null || _a === void 0 ? void 0 : _a["setFocus"]) === null || _b === void 0 ? void 0 : _b.call(_a);
32
+ }
33
+ else if (this._editor["focus"]) {
34
+ (_d = (_c = this._editor) === null || _c === void 0 ? void 0 : _c["focus"]) === null || _d === void 0 ? void 0 : _d.call(_c);
35
+ }
36
+ }
37
+ async clearValue() {
38
+ if (!this._editor) {
39
+ return;
40
+ }
41
+ if (this._editor["clearValue"]) {
42
+ await this._editor["clearValue"]();
43
+ }
27
44
  }
28
45
  observeConfig(newValue) {
29
46
  var _a, _b;
@@ -95,7 +112,7 @@ const SnkFilterDetail = class {
95
112
  return Object.assign(Object.assign({}, item), { visible: false, fixed: false, value: undefined });
96
113
  }
97
114
  getPopUpHeaderButtons() {
98
- return (index.h(index.Fragment, null, !this.config.removalBlocked &&
115
+ return (index.h(index.Fragment, null, !this.removalBlocked && !this.config.removalBlocked &&
99
116
  this.buildIcon(this.getMessage("snkFilterBar.removeFilter"), "delete", () => this.removeItem()), this.showHardFixed && !this.config.hardFixed &&
100
117
  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 })))));
101
118
  }
@@ -4,12 +4,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-1cf293c1.js');
6
6
  const core = require('@sankhyalabs/core');
7
- const filterItemType_enum = require('./filter-item-type.enum-a7ffdaa6.js');
7
+ const ConfigStorage = require('./ConfigStorage-8b6def32.js');
8
8
  const presentationMode = require('./presentationMode-52ec3bdd.js');
9
- const ConfigStorage = require('./ConfigStorage-1931defc.js');
9
+ const filterItemType_enum = require('./filter-item-type.enum-a7ffdaa6.js');
10
10
  const filterType_enum = require('./filter-type.enum-2bb46d2a.js');
11
- require('./form-config-fetcher-f6e66d64.js');
12
- require('./DataFetcher-ad9fb3bb.js');
11
+ require('./form-config-fetcher-dee08eb4.js');
12
+ require('./DataFetcher-2c37b6a1.js');
13
13
  require('./PrintUtils-bcaeb82f.js');
14
14
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
15
15
 
@@ -25,12 +25,6 @@ const SnkFilterModalItem = class {
25
25
  this.configName = undefined;
26
26
  this.resourceID = undefined;
27
27
  }
28
- observeFilterItem(newValue) {
29
- var _a, _b;
30
- this._editor && (this._editor["config"] = newValue);
31
- (_b = (_a = this._editor) === null || _a === void 0 ? void 0 : _a['reloadList']) === null || _b === void 0 ? void 0 : _b.call(_a);
32
- this.filterChange.emit(newValue);
33
- }
34
28
  getContentEditorConfig() {
35
29
  const props = { presentationMode: presentationMode.EPresentationMode.MODAL };
36
30
  switch (this.filterItem.type) {
@@ -65,6 +59,7 @@ const SnkFilterModalItem = class {
65
59
  return !this.filterItem.visible ? newValue !== undefined : true;
66
60
  }
67
61
  updateFilterValue(data) {
62
+ var _a, _b;
68
63
  const newValue = (data === null || data === void 0 ? void 0 : data.value) !== undefined ? data.value : data;
69
64
  if (this.filterItem.groupedItems != undefined) {
70
65
  this.filterItem = Object.assign(Object.assign({}, this.filterItem), { visible: newValue > 0, value: newValue, groupedItems: data.items });
@@ -72,6 +67,9 @@ const SnkFilterModalItem = class {
72
67
  else {
73
68
  this.filterItem = Object.assign(Object.assign({}, this.filterItem), { value: this.filterItem.type === (filterItemType_enum.FilterItemType.SEARCH || filterItemType_enum.FilterItemType.CHECK_BOX_LIST) ? data : newValue, visible: this.isVisible(newValue) });
74
69
  }
70
+ this._editor && (this._editor["config"] = this.filterItem);
71
+ (_b = (_a = this._editor) === null || _a === void 0 ? void 0 : _a['reloadList']) === null || _b === void 0 ? void 0 : _b.call(_a);
72
+ this.filterChange.emit(this.filterItem);
75
73
  }
76
74
  handleDeleteFilter(filter, filterItemType) {
77
75
  if (filterItemType === filterItemType_enum.FilterItemType.PERSONALIZED) {
@@ -101,12 +99,9 @@ const SnkFilterModalItem = class {
101
99
  }
102
100
  render() {
103
101
  const { tag: ContentEditor, props } = this.getContentEditorConfig();
104
- return (index.h(index.Host, null, index.h("div", { class: "ez-flex ez-flex--column grow" }, this.canShowDetailModal() && (index.h("div", { class: "col ez-col--sd-12 ez-align--right ez-padding-medium ez-flex--align-items-center" }, index.h("div", { class: "ez-title ez-title--small ez-title--primary grow" }, this.filterItem.detailModal))), index.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)))));
102
+ return (index.h(index.Host, null, index.h("div", { class: "ez-flex ez-flex--column grow" }, this.canShowDetailModal() && (index.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)), index.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)))));
105
103
  }
106
104
  get _element() { return index.getElement(this); }
107
- static get watchers() { return {
108
- "filterItem": ["observeFilterItem"]
109
- }; }
110
105
  };
111
106
  SnkFilterModalItem.style = snkFilterModalItemCss;
112
107
 
@@ -12,21 +12,32 @@ const SnkFilterMultiSelect = class {
12
12
  this.valueChanged = index.createEvent(this, "valueChanged", 7);
13
13
  this.value = undefined;
14
14
  this.config = undefined;
15
+ this.errorMessage = undefined;
15
16
  }
16
17
  /**
17
18
  * Emitido quando acontece a alteração de valor do componente snk-filter-multi-select
18
19
  */
19
20
  ezChangeListener(evt) {
20
21
  var _a;
22
+ this.errorMessage = undefined;
21
23
  this.value = (_a = evt.detail) === null || _a === void 0 ? void 0 : _a.value;
22
24
  this.valueChanged.emit(this.value);
23
25
  }
24
26
  /**
25
- * Exibe o componente snk-filter-multi-select
27
+ * Define o foco no componente snk-filter-multi-select.
26
28
  */
27
- async show() {
29
+ async setFocus() {
28
30
  this._comboElement.setFocus();
29
31
  }
32
+ /**
33
+ * Limpa o valor do componente restaurando o valor original da configuração.
34
+ */
35
+ async clearValue() {
36
+ this.value = this.config.value;
37
+ if (this._comboElement) {
38
+ this._comboElement.value = this.config.value;
39
+ }
40
+ }
30
41
  componentDidLoad() {
31
42
  if (this._element) {
32
43
  core.ElementIDUtils.addIDInfo(this._element, 'filterContentEditor');
@@ -36,7 +47,9 @@ const SnkFilterMultiSelect = class {
36
47
  if (!this.config || this.config.type !== filterItemType_enum.FilterItemType.MULTI_SELECT) {
37
48
  return undefined;
38
49
  }
39
- return (index.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 }));
50
+ return (index.h("ez-tooltip", { active: this.config.enabled === false, message: this.config.disabledMessage, type: 'warning' }, index.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) => {
51
+ event.stopPropagation();
52
+ } })));
40
53
  }
41
54
  get _element() { return index.getElement(this); }
42
55
  };
@@ -5,8 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-1cf293c1.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
  const filterItemType_enum = require('./filter-item-type.enum-a7ffdaa6.js');
8
- const presentationMode = require('./presentationMode-52ec3bdd.js');
9
8
  const filterNumberVariation = require('./filterNumberVariation-d65332da.js');
9
+ const presentationMode = require('./presentationMode-52ec3bdd.js');
10
10
 
11
11
  const SnkFilterPeriod = class {
12
12
  constructor(hostRef) {
@@ -19,11 +19,13 @@ const SnkFilterPeriod = class {
19
19
  this.getMessage = undefined;
20
20
  this.value = undefined;
21
21
  this.presentationMode = presentationMode.EPresentationMode.CHIP;
22
+ this.errorMessage = undefined;
22
23
  }
23
24
  /**
24
25
  * Emitido quando acontece a alteração de valor do componente snk-filter-number
25
26
  */
26
27
  ezChangeListener(evt) {
28
+ this.errorMessage = undefined;
27
29
  if (this.getVariation() === filterNumberVariation.FilterNumberVariation.INTERVAL) {
28
30
  const start = this._startInterval.value;
29
31
  const end = this._endInterval.value;
@@ -44,6 +46,35 @@ const SnkFilterPeriod = class {
44
46
  }
45
47
  this._numberElement.setFocus();
46
48
  }
49
+ /**
50
+ * Define o foco no componente snk-filter-number
51
+ */
52
+ async setFocus() {
53
+ if (this.getVariation() === filterNumberVariation.FilterNumberVariation.INTERVAL) {
54
+ await this._startInterval.setFocus();
55
+ return;
56
+ }
57
+ await this._numberElement.setFocus();
58
+ }
59
+ /**
60
+ * Limpa o valor do componente restaurando o valor original da configuração.
61
+ */
62
+ async clearValue() {
63
+ var _a, _b;
64
+ this.value = this.config.value;
65
+ if (this.getVariation() === filterNumberVariation.FilterNumberVariation.INTERVAL) {
66
+ const intervalValue = this.config.value;
67
+ if (this._startInterval) {
68
+ this._startInterval.value = (_a = intervalValue === null || intervalValue === void 0 ? void 0 : intervalValue.start) !== null && _a !== void 0 ? _a : null;
69
+ }
70
+ if (this._endInterval) {
71
+ this._endInterval.value = (_b = intervalValue === null || intervalValue === void 0 ? void 0 : intervalValue.end) !== null && _b !== void 0 ? _b : null;
72
+ }
73
+ }
74
+ else if (this._numberElement) {
75
+ this._numberElement.value = this.config.value;
76
+ }
77
+ }
47
78
  getIntervalValue(prop) {
48
79
  const objValue = this.value ? this.value[prop] : null;
49
80
  return objValue !== null && objValue !== void 0 ? objValue : null;
@@ -75,9 +106,9 @@ const SnkFilterPeriod = class {
75
106
  return undefined;
76
107
  }
77
108
  if (this.getVariation() === filterNumberVariation.FilterNumberVariation.INTERVAL) {
78
- return (index.h("div", { class: "ez-col ez-col--nowrap" }, index.h("ez-number-input", { id: `${this.config.id}_start`, class: this.presentationMode === 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(), index.h("ez-number-input", { id: `${this.config.id}_end`, class: this.presentationMode === 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 })));
109
+ return (index.h("ez-tooltip", { active: this.config.enabled === false, message: this.config.disabledMessage, type: 'warning' }, index.h("div", { class: "ez-col ez-col--nowrap" }, index.h("ez-number-input", { id: `${this.config.id}_start`, class: this.presentationMode === 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(), index.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 }))));
79
110
  }
80
- return (index.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 }));
111
+ return (index.h("ez-tooltip", { active: this.config.enabled === false, message: this.config.disabledMessage, type: 'warning' }, index.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 })));
81
112
  }
82
113
  get _element() { return index.getElement(this); }
83
114
  };
@@ -14,37 +14,77 @@ const SnkFilterPeriod = class {
14
14
  this._startDateLabel = 'Inicial';
15
15
  this._endDateLabel = 'Final';
16
16
  this._toLabel = 'até';
17
+ this.internalChange = {
18
+ start: false,
19
+ end: false
20
+ };
17
21
  this.config = undefined;
18
22
  this.getMessage = undefined;
19
- this.value = undefined;
23
+ this.value = {
24
+ start: null,
25
+ end: null
26
+ };
20
27
  this.presentationMode = presentationMode.EPresentationMode.CHIP;
28
+ this.errorMessage = undefined;
29
+ }
30
+ configChanged(newValue, oldValue) {
31
+ if (this.internalChange.end) {
32
+ this.internalChange.end = false;
33
+ return;
34
+ }
35
+ if (this.internalChange.start) {
36
+ this.internalChange.start = false;
37
+ return;
38
+ }
39
+ if (newValue && (newValue.start !== (oldValue === null || oldValue === void 0 ? void 0 : oldValue.start) || newValue.end !== (oldValue === null || oldValue === void 0 ? void 0 : oldValue.end))) {
40
+ this.valueStart = this.parseDate(newValue.start);
41
+ this.valueEnd = this.parseDate(newValue.end);
42
+ }
43
+ }
44
+ ezChangeListener(event, field) {
45
+ this.errorMessage = undefined;
46
+ this.internalChange[field] = true;
47
+ this.value = Object.assign(Object.assign({}, (this.value || {})), { [field]: event.detail ? this.parseDate(event.detail) : null });
48
+ this.valueChanged.emit(this.value);
21
49
  }
22
50
  /**
23
- * Emitido quando acontece a alteração de valor do componente snk-filter-period
51
+ * Define o foco no componente snk-filter-period.
24
52
  */
25
- ezChangeListener() {
26
- const start = this._startDate.value;
27
- const end = this._endDate.value;
28
- this.value = (start || end ? { start, end } : undefined);
29
- this.valueChanged.emit(this.value);
53
+ async setFocus() {
54
+ this._startDate.setFocus();
55
+ }
56
+ /**
57
+ * Limpa o valor do componente restaurando o valor original da configuração.
58
+ */
59
+ async clearValue() {
60
+ this.value = this.config.value;
61
+ this.valueStart = this.getDate("start");
62
+ this.valueEnd = this.getDate("end");
30
63
  }
31
64
  componentDidLoad() {
32
65
  if (this._element) {
33
66
  core.ElementIDUtils.addIDInfo(this._element, 'filterContentEditor');
67
+ this._element.querySelectorAll('ez-date-input').forEach(input => {
68
+ const textInput = input.shadowRoot.querySelector('ez-text-input');
69
+ textInput.style.setProperty('--ez-text-input__min-width', '120px');
70
+ });
34
71
  }
35
72
  }
36
- getDate(prop) {
37
- const objValue = this.value ? this.value[prop] : null;
38
- if (objValue instanceof Date) {
39
- return objValue;
73
+ parseDate(date) {
74
+ if (date instanceof Date) {
75
+ return date;
40
76
  }
41
- if (typeof objValue === "string") {
42
- let date = new Date(objValue);
77
+ if (typeof date === "string") {
78
+ date = new Date(date);
43
79
  date.setMinutes(date.getMinutes() + date.getTimezoneOffset());
44
80
  return date;
45
81
  }
46
82
  return null;
47
83
  }
84
+ getDate(prop) {
85
+ const objValue = this.value ? this.value[prop] : null;
86
+ return this.parseDate(objValue);
87
+ }
48
88
  /**
49
89
  * Exibe o componente snk-filter-period
50
90
  */
@@ -62,14 +102,19 @@ const SnkFilterPeriod = class {
62
102
  this._endDateLabel = this.getMessage('snkFilterBar.labelEnd');
63
103
  this._toLabel = this.getMessage('snkFilterBar.labelTo');
64
104
  }
105
+ this.valueStart = this.getDate("start");
106
+ this.valueEnd = this.getDate("end");
65
107
  }
66
108
  render() {
67
109
  if (!this.config || this.config.type !== filterItemType_enum.FilterItemType.PERIOD) {
68
110
  return undefined;
69
111
  }
70
- return (index.h("div", { class: "ez-col ez-col--nowrap" }, index.h("ez-date-input", { id: `${this.config.id}_start`, class: this.presentationMode === presentationMode.EPresentationMode.MODAL ? 'ez-padding--small' : '', label: this._startDateLabel, ref: ref => this._startDate = ref, value: this.getDate("start") }), this.buildLabel(), index.h("ez-date-input", { id: `${this.config.id}_end`, class: this.presentationMode === presentationMode.EPresentationMode.MODAL ? 'ez-padding--small' : '', label: this._endDateLabel, ref: ref => this._endDate = ref, value: this.getDate("end") })));
112
+ return (index.h("ez-tooltip", { active: this.config.enabled === false, message: this.config.disabledMessage, type: 'warning' }, index.h("div", { class: "ez-col ez-col--nowrap" }, index.h("ez-date-input", { id: `${this.config.id}_start`, class: this.presentationMode === 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(), index.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') }))));
71
113
  }
72
114
  get _element() { return index.getElement(this); }
115
+ static get watchers() { return {
116
+ "value": ["configChanged"]
117
+ }; }
73
118
  };
74
119
 
75
120
  exports.snk_filter_period = SnkFilterPeriod;
@@ -13,11 +13,13 @@ const SnkFilterSearch = class {
13
13
  this._isSearchPlus = false;
14
14
  this.config = undefined;
15
15
  this.value = undefined;
16
+ this.errorMessage = undefined;
16
17
  }
17
18
  /**
18
19
  * Emitido quando acontece a alteração de valor do componente snk-filter-search
19
20
  */
20
21
  async ezChangeListener(_evt) {
22
+ this.errorMessage = undefined;
21
23
  if (this._isSearchPlus) {
22
24
  this.value = await this._searchInput.getValueAsync();
23
25
  }
@@ -44,16 +46,25 @@ const SnkFilterSearch = class {
44
46
  });
45
47
  }
46
48
  /**
47
- * Exibe o componente snk-filter-search
49
+ * Define o foco no componente snk-filter-search.
48
50
  */
49
- async show() {
51
+ async setFocus() {
50
52
  this._searchInput.setFocus();
51
53
  }
54
+ /**
55
+ * Limpa o valor do componente restaurando o valor original da configuração.
56
+ */
57
+ async clearValue() {
58
+ this.value = this.config.value;
59
+ if (this._searchInput) {
60
+ this._searchInput.value = this.config.value;
61
+ }
62
+ }
52
63
  getInputItem() {
53
64
  var _a;
54
65
  this._isSearchPlus = ((_a = this.config.props) === null || _a === void 0 ? void 0 : _a["useSearchPlus"]) == true;
55
66
  const TagName = this._isSearchPlus ? "ez-search-plus" : "ez-search";
56
- return (index.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) }));
67
+ return (index.h("ez-tooltip", { active: this.config.enabled === false, message: this.config.disabledMessage, type: 'warning' }, index.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 })));
57
68
  }
58
69
  render() {
59
70
  if (!this.config || this.config.type !== filterItemType_enum.FilterItemType.SEARCH) {
@@ -11,14 +11,31 @@ const SnkFilterText = class {
11
11
  this.valueChanged = index.createEvent(this, "valueChanged", 7);
12
12
  this.config = undefined;
13
13
  this.value = undefined;
14
+ this.errorMessage = undefined;
14
15
  }
15
16
  /**
16
17
  * Emitido quando acontece a alteração de valor do componente snk-filter-text.
17
18
  */
18
19
  ezChangeListener(evt) {
20
+ this.errorMessage = undefined;
19
21
  this.value = evt.detail;
20
22
  this.valueChanged.emit(this.value);
21
23
  }
24
+ /**
25
+ * Define o foco no componente snk-filter-text.
26
+ */
27
+ async setFocus() {
28
+ this._textInputElement.setFocus();
29
+ }
30
+ /**
31
+ * Limpa o valor do componente restaurando o valor original da configuração.
32
+ */
33
+ async clearValue() {
34
+ this.value = this.config.value;
35
+ if (this._textInputElement) {
36
+ this._textInputElement.value = this.config.value;
37
+ }
38
+ }
22
39
  componentDidLoad() {
23
40
  if (this._element) {
24
41
  core.ElementIDUtils.addIDInfo(this._element, 'filterContentEditor');
@@ -29,7 +46,7 @@ const SnkFilterText = class {
29
46
  if (!this.config) {
30
47
  return undefined;
31
48
  }
32
- return (index.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 }));
49
+ return (index.h("ez-tooltip", { active: this.config.enabled === false, message: this.config.disabledMessage, type: 'warning' }, index.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 })));
33
50
  }
34
51
  get _element() { return index.getElement(this); }
35
52
  };
@@ -4,15 +4,15 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-1cf293c1.js');
6
6
  const core = require('@sankhyalabs/core');
7
- const SnkFormConfigManager = require('./SnkFormConfigManager-65e5288e.js');
7
+ const SnkFormConfigManager = require('./SnkFormConfigManager-477a27de.js');
8
8
  const ResourceIDUtils = require('./ResourceIDUtils-5ff86aa7.js');
9
9
  const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
10
10
  const FormConfigHelper = require('./FormConfigHelper-ebb77625.js');
11
11
  const constants = require('./constants-6d82e405.js');
12
12
  const utils = require('@sankhyalabs/ezui/dist/collection/utils');
13
- const formConfigFetcher = require('./form-config-fetcher-f6e66d64.js');
14
- require('./ConfigStorage-1931defc.js');
15
- require('./DataFetcher-ad9fb3bb.js');
13
+ const formConfigFetcher = require('./form-config-fetcher-dee08eb4.js');
14
+ require('./ConfigStorage-8b6def32.js');
15
+ require('./DataFetcher-2c37b6a1.js');
16
16
  require('./PrintUtils-bcaeb82f.js');
17
17
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
18
18
  require('./filter-item-type.enum-a7ffdaa6.js');
@@ -38,18 +38,26 @@ const SnkForm = class {
38
38
  }
39
39
  /**
40
40
  * Exibe a janela de configurações do formulário.
41
+ * @async
42
+ * @returns {Promise<void>}
41
43
  */
42
44
  async showConfig() {
43
45
  this._showFormConfig = true;
44
46
  }
45
47
  /**
46
48
  * Fecha a janela de configurações do formulário.
49
+ * @async
50
+ * @returns {Promise<void>}
47
51
  */
48
52
  async hideConfig() {
49
53
  this._showFormConfig = false;
50
54
  }
51
55
  /**
52
- * Registra um editor customizado para campos da grade e formulário.
56
+ * Registra um editor customizado para campos do formulário.
57
+ * @async
58
+ * @param {string} fieldName - Nome do campo.
59
+ * @param {ICustomEditor} customEditor - Editor customizado.
60
+ * @returns {Promise<void>}
53
61
  */
54
62
  async addCustomEditor(fieldName, customEditor) {
55
63
  if (this._form) {
@@ -62,10 +70,28 @@ const SnkForm = class {
62
70
  }
63
71
  /**
64
72
  * Altera/adiciona uma propriedade nos metadados do campo.
73
+ * @async
74
+ * @param {string} fieldName - Nome do campo.
75
+ * @param {string} propName - Nome da propriedade.
76
+ * @param {any} value - Valor da propriedade.
77
+ * @returns {Promise<void>}
65
78
  */
66
79
  async setFieldProp(fieldName, propName, value) {
67
80
  await this._form.setFieldProp(fieldName, propName, value);
68
81
  }
82
+ /**
83
+ * Valida o formulário.
84
+ * @async
85
+ * @returns {Promise<void>}
86
+ * @description
87
+ * Este método executa a validação do formulário, verificando se todos os campos estão
88
+ * preenchidos corretamente de acordo com as regras definidas.
89
+ * Se a validação falhar, uma exceção será lançada com os detalhes dos erros encontrados.
90
+ * Caso contrário, o método será resolvido sem erros.
91
+ */
92
+ async validate() {
93
+ await this._form.validate();
94
+ }
69
95
  closeConfig() {
70
96
  this.hideConfig();
71
97
  }