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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (189) hide show
  1. package/dist/cjs/{ConfigStorage-0ebc800f.js → ConfigStorage-52c38bb9.js} +2 -2
  2. package/dist/cjs/{DataFetcher-602cdc72.js → DataFetcher-9af55840.js} +15 -0
  3. package/dist/cjs/{ISave-18205d86.js → ISave-c4918000.js} +1 -1
  4. package/dist/cjs/{SnkFormConfigManager-4b651537.js → SnkFormConfigManager-cef663d1.js} +2 -2
  5. package/dist/cjs/{ClientSideExporterProvider-bb0b2273.js → SnkMultiSelectionListDataSource-58ded10c.js} +78 -78
  6. package/dist/cjs/{auth-fetcher-82317d4d.js → auth-fetcher-a3a3bb16.js} +1 -1
  7. package/dist/cjs/{dataunit-fetcher-93077a2f.js → dataunit-fetcher-ae454648.js} +1 -1
  8. package/dist/cjs/filter-validate-6993f6f2.js +30 -0
  9. package/dist/cjs/{form-config-fetcher-05d210e7.js → form-config-fetcher-d7bb4f41.js} +1 -1
  10. package/dist/cjs/index-1cf293c1.js +8 -8
  11. package/dist/cjs/loader.cjs.js +1 -1
  12. package/dist/cjs/pesquisa-grid_2.cjs.entry.js +4 -4
  13. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  14. package/dist/cjs/snk-actions-button_8.cjs.entry.js +5 -5
  15. package/dist/cjs/snk-application.cjs.entry.js +6 -6
  16. package/dist/cjs/snk-attach.cjs.entry.js +5 -5
  17. package/dist/cjs/snk-crud.cjs.entry.js +5 -5
  18. package/dist/cjs/snk-data-exporter.cjs.entry.js +5 -5
  19. package/dist/cjs/{snk-data-unit-28d629e4.js → snk-data-unit-a59a7ade.js} +2 -2
  20. package/dist/cjs/snk-data-unit.cjs.entry.js +3 -3
  21. package/dist/cjs/snk-detail-view.cjs.entry.js +7 -7
  22. package/dist/cjs/snk-entity-list.cjs.entry.js +10 -3
  23. package/dist/cjs/snk-filter-bar_4.cjs.entry.js +164 -100
  24. package/dist/cjs/snk-filter-binary-select.cjs.entry.js +23 -2
  25. package/dist/cjs/snk-filter-checkbox-list.cjs.entry.js +20 -2
  26. package/dist/cjs/snk-filter-detail.cjs.entry.js +25 -8
  27. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +9 -14
  28. package/dist/cjs/snk-filter-multi-select.cjs.entry.js +16 -3
  29. package/dist/cjs/snk-filter-number.cjs.entry.js +34 -3
  30. package/dist/cjs/snk-filter-period.cjs.entry.js +59 -14
  31. package/dist/cjs/snk-filter-search.cjs.entry.js +14 -3
  32. package/dist/cjs/snk-filter-text.cjs.entry.js +18 -1
  33. package/dist/cjs/snk-form_2.cjs.entry.js +4 -4
  34. package/dist/cjs/snk-grid.cjs.entry.js +38 -21
  35. package/dist/cjs/{snk-guides-viewer-73d40f42.js → snk-guides-viewer-e7c08c71.js} +5 -5
  36. package/dist/cjs/snk-guides-viewer.cjs.entry.js +7 -7
  37. package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
  38. package/dist/cjs/snk-pesquisa.cjs.entry.js +4 -4
  39. package/dist/cjs/snk-simple-crud.cjs.entry.js +13 -13
  40. package/dist/collection/components/snk-entity-list/snk-entity-list.js +28 -4
  41. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.js +72 -2
  42. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-checkbox-list.js +73 -2
  43. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.js +51 -5
  44. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js +83 -3
  45. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js +118 -27
  46. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-search.js +49 -5
  47. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js +71 -1
  48. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +62 -11
  49. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +70 -8
  50. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.css +0 -4
  51. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +112 -16
  52. package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js +8 -16
  53. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +106 -52
  54. package/dist/collection/components/snk-filter-bar/utils/SnkFilterModalFactory.js +3 -1
  55. package/dist/collection/components/snk-filter-bar/utils/filter-validate.js +24 -0
  56. package/dist/collection/components/snk-grid/snk-grid.js +89 -11
  57. package/dist/collection/lib/message/resources/en-us/snk-filter-bar.msg.js +1 -0
  58. package/dist/collection/lib/message/resources/en-us/snk-grid.msg.js +4 -0
  59. package/dist/collection/lib/message/resources/es-es/snk-filter-bar.msg.js +1 -0
  60. package/dist/collection/lib/message/resources/es-es/snk-grid.msg.js +4 -0
  61. package/dist/collection/lib/message/resources/pt-br/snk-filter-bar.msg.js +1 -0
  62. package/dist/collection/lib/message/resources/pt-br/snk-grid.msg.js +4 -0
  63. package/dist/components/DataFetcher.js +15 -0
  64. package/dist/components/snk-crud.js +62 -44
  65. package/dist/components/snk-detail-view2.js +89 -56
  66. package/dist/components/snk-entity-list.js +11 -3
  67. package/dist/components/snk-filter-bar2.js +77 -93
  68. package/dist/components/snk-filter-binary-select.js +27 -3
  69. package/dist/components/snk-filter-checkbox-list.js +24 -3
  70. package/dist/components/snk-filter-detail2.js +28 -9
  71. package/dist/components/snk-filter-item2.js +70 -8
  72. package/dist/components/snk-filter-modal-item2.js +7 -12
  73. package/dist/components/snk-filter-modal.js +1 -325
  74. package/dist/components/snk-filter-modal2.js +391 -0
  75. package/dist/components/snk-filter-multi-select.js +19 -4
  76. package/dist/components/snk-filter-number.js +38 -4
  77. package/dist/components/snk-filter-period.js +64 -16
  78. package/dist/components/snk-filter-search.js +17 -4
  79. package/dist/components/snk-filter-text.js +22 -2
  80. package/dist/components/snk-grid2.js +65 -29
  81. package/dist/esm/{ConfigStorage-fc4e3a42.js → ConfigStorage-1e758486.js} +2 -2
  82. package/dist/esm/{DataFetcher-01ce1a4f.js → DataFetcher-2f7ba7ae.js} +15 -0
  83. package/dist/esm/{ISave-d36bade4.js → ISave-4c9742c1.js} +1 -1
  84. package/dist/esm/{SnkFormConfigManager-71dae34e.js → SnkFormConfigManager-d7031fcb.js} +2 -2
  85. package/dist/esm/{ClientSideExporterProvider-21a99af1.js → SnkMultiSelectionListDataSource-eace25fd.js} +83 -83
  86. package/dist/esm/{auth-fetcher-2e565c35.js → auth-fetcher-d8169b9c.js} +1 -1
  87. package/dist/esm/{dataunit-fetcher-14ba162b.js → dataunit-fetcher-1f7a73df.js} +1 -1
  88. package/dist/esm/filter-validate-d765d450.js +27 -0
  89. package/dist/esm/{form-config-fetcher-a1ccc944.js → form-config-fetcher-eb03ac08.js} +1 -1
  90. package/dist/esm/index-479e1293.js +8 -8
  91. package/dist/esm/loader.js +1 -1
  92. package/dist/esm/pesquisa-grid_2.entry.js +4 -4
  93. package/dist/esm/sankhyablocks.js +1 -1
  94. package/dist/esm/snk-actions-button_8.entry.js +5 -5
  95. package/dist/esm/snk-application.entry.js +6 -6
  96. package/dist/esm/snk-attach.entry.js +5 -5
  97. package/dist/esm/snk-crud.entry.js +5 -5
  98. package/dist/esm/snk-data-exporter.entry.js +5 -5
  99. package/dist/esm/{snk-data-unit-3977725e.js → snk-data-unit-a94dd52a.js} +2 -2
  100. package/dist/esm/snk-data-unit.entry.js +3 -3
  101. package/dist/esm/snk-detail-view.entry.js +7 -7
  102. package/dist/esm/snk-entity-list.entry.js +10 -3
  103. package/dist/esm/snk-filter-bar_4.entry.js +165 -101
  104. package/dist/esm/snk-filter-binary-select.entry.js +23 -2
  105. package/dist/esm/snk-filter-checkbox-list.entry.js +20 -2
  106. package/dist/esm/snk-filter-detail.entry.js +25 -8
  107. package/dist/esm/snk-filter-modal-item.entry.js +9 -14
  108. package/dist/esm/snk-filter-multi-select.entry.js +16 -3
  109. package/dist/esm/snk-filter-number.entry.js +34 -3
  110. package/dist/esm/snk-filter-period.entry.js +59 -14
  111. package/dist/esm/snk-filter-search.entry.js +14 -3
  112. package/dist/esm/snk-filter-text.entry.js +18 -1
  113. package/dist/esm/snk-form_2.entry.js +4 -4
  114. package/dist/esm/snk-grid.entry.js +31 -14
  115. package/dist/esm/{snk-guides-viewer-f800c9aa.js → snk-guides-viewer-e716659f.js} +5 -5
  116. package/dist/esm/snk-guides-viewer.entry.js +7 -7
  117. package/dist/esm/snk-personalized-filter.entry.js +3 -3
  118. package/dist/esm/snk-pesquisa.entry.js +4 -4
  119. package/dist/esm/snk-simple-crud.entry.js +8 -8
  120. package/dist/sankhyablocks/p-093f58fa.entry.js +1 -0
  121. package/dist/sankhyablocks/{p-e63cc25f.js → p-0dc071de.js} +1 -1
  122. package/dist/sankhyablocks/{p-f4bf0517.entry.js → p-0f6f2a84.entry.js} +1 -1
  123. package/dist/sankhyablocks/{p-2b2c2718.js → p-1129ded7.js} +1 -1
  124. package/dist/sankhyablocks/p-12cba660.entry.js +1 -0
  125. package/dist/sankhyablocks/{p-51209229.js → p-12db5588.js} +1 -1
  126. package/dist/sankhyablocks/{p-65517fcf.js → p-3d4a3965.js} +1 -1
  127. package/dist/sankhyablocks/p-3ed04f0d.entry.js +1 -0
  128. package/dist/sankhyablocks/{p-b6b42620.entry.js → p-4033a6e3.entry.js} +1 -1
  129. package/dist/sankhyablocks/p-49ddc27a.entry.js +1 -0
  130. package/dist/sankhyablocks/{p-c3eea705.entry.js → p-4a42d004.entry.js} +1 -1
  131. package/dist/sankhyablocks/p-4c763b10.entry.js +1 -0
  132. package/dist/sankhyablocks/p-4eeb06fc.js +1 -0
  133. package/dist/sankhyablocks/{p-dc8bb41f.js → p-552bdfdc.js} +1 -1
  134. package/dist/sankhyablocks/{p-3cdfd7fb.js → p-66e6569e.js} +1 -1
  135. package/dist/sankhyablocks/p-6909c146.entry.js +1 -0
  136. package/dist/sankhyablocks/p-69d0afa4.js +1 -0
  137. package/dist/sankhyablocks/{p-c3bab5f4.js → p-75b80a92.js} +1 -1
  138. package/dist/sankhyablocks/p-7f7fe6c4.entry.js +1 -0
  139. package/dist/sankhyablocks/{p-e5571279.entry.js → p-86009ea5.entry.js} +1 -1
  140. package/dist/sankhyablocks/{p-7b97f9af.entry.js → p-864066bb.entry.js} +1 -1
  141. package/dist/sankhyablocks/p-96d45943.entry.js +1 -0
  142. package/dist/sankhyablocks/{p-34222890.entry.js → p-a0b4c940.entry.js} +1 -1
  143. package/dist/sankhyablocks/{p-a60028f1.entry.js → p-a4be272f.entry.js} +1 -1
  144. package/dist/sankhyablocks/p-ab2ba522.entry.js +1 -0
  145. package/dist/sankhyablocks/p-ac9488fd.entry.js +1 -0
  146. package/dist/sankhyablocks/{p-7a1d3cb6.entry.js → p-b1d8cbf7.entry.js} +1 -1
  147. package/dist/sankhyablocks/{p-7535d592.js → p-b393f1df.js} +1 -1
  148. package/dist/sankhyablocks/{p-dfbe4d7f.entry.js → p-c5d281ad.entry.js} +1 -1
  149. package/dist/sankhyablocks/{p-41e5a485.entry.js → p-c6d8c86b.entry.js} +1 -1
  150. package/dist/sankhyablocks/p-cb4343c4.entry.js +1 -0
  151. package/dist/sankhyablocks/p-d235314c.entry.js +1 -0
  152. package/dist/sankhyablocks/{p-dde9da7a.entry.js → p-d76f1aa5.entry.js} +1 -1
  153. package/dist/sankhyablocks/{p-aba06047.entry.js → p-de58a26f.entry.js} +1 -1
  154. package/dist/sankhyablocks/p-e258de96.entry.js +1 -0
  155. package/dist/sankhyablocks/p-fd8047b8.js +1 -0
  156. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  157. package/dist/types/components/snk-entity-list/snk-entity-list.d.ts +8 -4
  158. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.d.ts +12 -0
  159. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-checkbox-list.d.ts +12 -0
  160. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.d.ts +12 -4
  161. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-number.d.ts +16 -4
  162. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-period.d.ts +17 -3
  163. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-search.d.ts +10 -2
  164. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-text.d.ts +12 -0
  165. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +8 -3
  166. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +27 -4
  167. package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +17 -3
  168. package/dist/types/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.d.ts +2 -3
  169. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +15 -2
  170. package/dist/types/components/snk-filter-bar/utils/SnkFilterModalFactory.d.ts +4 -2
  171. package/dist/types/components/snk-filter-bar/utils/filter-validate.d.ts +11 -0
  172. package/dist/types/components/snk-grid/snk-grid.d.ts +21 -8
  173. package/dist/types/components.d.ts +202 -17
  174. package/package.json +1 -1
  175. package/dist/sankhyablocks/p-07b14811.entry.js +0 -1
  176. package/dist/sankhyablocks/p-082e7ba8.entry.js +0 -1
  177. package/dist/sankhyablocks/p-25209340.entry.js +0 -1
  178. package/dist/sankhyablocks/p-295b83ae.entry.js +0 -1
  179. package/dist/sankhyablocks/p-3143bb44.entry.js +0 -1
  180. package/dist/sankhyablocks/p-353b4a74.js +0 -1
  181. package/dist/sankhyablocks/p-398cdd67.entry.js +0 -1
  182. package/dist/sankhyablocks/p-5bab470d.entry.js +0 -1
  183. package/dist/sankhyablocks/p-9fd87bfd.entry.js +0 -1
  184. package/dist/sankhyablocks/p-a76e6d51.entry.js +0 -1
  185. package/dist/sankhyablocks/p-ae2ebab7.js +0 -1
  186. package/dist/sankhyablocks/p-b21aa190.entry.js +0 -1
  187. package/dist/sankhyablocks/p-c6a8a8bc.entry.js +0 -1
  188. package/dist/sankhyablocks/p-c8932b14.entry.js +0 -1
  189. package/dist/sankhyablocks/p-dff65083.entry.js +0 -1
@@ -1,8 +1,8 @@
1
1
  import { ElementIDUtils } from '@sankhyalabs/core';
2
2
  import { h } from '@stencil/core';
3
3
  import FilterItemType from '../filter-item-type.enum';
4
- import { EPresentationMode } from './enum/presentationMode';
5
4
  import { FilterNumberVariation } from './enum/filterNumberVariation';
5
+ import { EPresentationMode } from './enum/presentationMode';
6
6
  export class SnkFilterPeriod {
7
7
  constructor() {
8
8
  this._startIntervalLabel = 'Inicial';
@@ -12,11 +12,13 @@ export class SnkFilterPeriod {
12
12
  this.getMessage = undefined;
13
13
  this.value = undefined;
14
14
  this.presentationMode = EPresentationMode.CHIP;
15
+ this.errorMessage = undefined;
15
16
  }
16
17
  /**
17
18
  * Emitido quando acontece a alteração de valor do componente snk-filter-number
18
19
  */
19
20
  ezChangeListener(evt) {
21
+ this.errorMessage = undefined;
20
22
  if (this.getVariation() === FilterNumberVariation.INTERVAL) {
21
23
  const start = this._startInterval.value;
22
24
  const end = this._endInterval.value;
@@ -37,6 +39,35 @@ export class SnkFilterPeriod {
37
39
  }
38
40
  this._numberElement.setFocus();
39
41
  }
42
+ /**
43
+ * Define o foco no componente snk-filter-number
44
+ */
45
+ async setFocus() {
46
+ if (this.getVariation() === FilterNumberVariation.INTERVAL) {
47
+ await this._startInterval.setFocus();
48
+ return;
49
+ }
50
+ await this._numberElement.setFocus();
51
+ }
52
+ /**
53
+ * Limpa o valor do componente restaurando o valor original da configuração.
54
+ */
55
+ async clearValue() {
56
+ var _a, _b;
57
+ this.value = this.config.value;
58
+ if (this.getVariation() === FilterNumberVariation.INTERVAL) {
59
+ const intervalValue = this.config.value;
60
+ if (this._startInterval) {
61
+ this._startInterval.value = (_a = intervalValue === null || intervalValue === void 0 ? void 0 : intervalValue.start) !== null && _a !== void 0 ? _a : null;
62
+ }
63
+ if (this._endInterval) {
64
+ this._endInterval.value = (_b = intervalValue === null || intervalValue === void 0 ? void 0 : intervalValue.end) !== null && _b !== void 0 ? _b : null;
65
+ }
66
+ }
67
+ else if (this._numberElement) {
68
+ this._numberElement.value = this.config.value;
69
+ }
70
+ }
40
71
  getIntervalValue(prop) {
41
72
  const objValue = this.value ? this.value[prop] : null;
42
73
  return objValue !== null && objValue !== void 0 ? objValue : null;
@@ -68,9 +99,9 @@ export class SnkFilterPeriod {
68
99
  return undefined;
69
100
  }
70
101
  if (this.getVariation() === FilterNumberVariation.INTERVAL) {
71
- 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 })));
102
+ 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 }))));
72
103
  }
73
- 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 }));
104
+ 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 })));
74
105
  }
75
106
  static get is() { return "snk-filter-number"; }
76
107
  static get properties() {
@@ -153,6 +184,23 @@ export class SnkFilterPeriod {
153
184
  "attribute": "presentation-mode",
154
185
  "reflect": false,
155
186
  "defaultValue": "EPresentationMode.CHIP"
187
+ },
188
+ "errorMessage": {
189
+ "type": "string",
190
+ "mutable": true,
191
+ "complexType": {
192
+ "original": "string",
193
+ "resolved": "string",
194
+ "references": {}
195
+ },
196
+ "required": false,
197
+ "optional": false,
198
+ "docs": {
199
+ "tags": [],
200
+ "text": "Usado para exibir mensagens de erro."
201
+ },
202
+ "attribute": "error-message",
203
+ "reflect": true
156
204
  }
157
205
  };
158
206
  }
@@ -195,6 +243,38 @@ export class SnkFilterPeriod {
195
243
  "text": "Exibe o componente snk-filter-number",
196
244
  "tags": []
197
245
  }
246
+ },
247
+ "setFocus": {
248
+ "complexType": {
249
+ "signature": "() => Promise<void>",
250
+ "parameters": [],
251
+ "references": {
252
+ "Promise": {
253
+ "location": "global"
254
+ }
255
+ },
256
+ "return": "Promise<void>"
257
+ },
258
+ "docs": {
259
+ "text": "Define o foco no componente snk-filter-number",
260
+ "tags": []
261
+ }
262
+ },
263
+ "clearValue": {
264
+ "complexType": {
265
+ "signature": "() => Promise<void>",
266
+ "parameters": [],
267
+ "references": {
268
+ "Promise": {
269
+ "location": "global"
270
+ }
271
+ },
272
+ "return": "Promise<void>"
273
+ },
274
+ "docs": {
275
+ "text": "Limpa o valor do componente restaurando o valor original da configura\u00E7\u00E3o.",
276
+ "tags": []
277
+ }
198
278
  }
199
279
  };
200
280
  }
@@ -7,37 +7,77 @@ export class SnkFilterPeriod {
7
7
  this._startDateLabel = 'Inicial';
8
8
  this._endDateLabel = 'Final';
9
9
  this._toLabel = 'até';
10
+ this.internalChange = {
11
+ start: false,
12
+ end: false
13
+ };
10
14
  this.config = undefined;
11
15
  this.getMessage = undefined;
12
- this.value = undefined;
16
+ this.value = {
17
+ start: null,
18
+ end: null
19
+ };
13
20
  this.presentationMode = EPresentationMode.CHIP;
21
+ this.errorMessage = undefined;
22
+ }
23
+ configChanged(newValue, oldValue) {
24
+ if (this.internalChange.end) {
25
+ this.internalChange.end = false;
26
+ return;
27
+ }
28
+ if (this.internalChange.start) {
29
+ this.internalChange.start = false;
30
+ return;
31
+ }
32
+ if (newValue && (newValue.start !== (oldValue === null || oldValue === void 0 ? void 0 : oldValue.start) || newValue.end !== (oldValue === null || oldValue === void 0 ? void 0 : oldValue.end))) {
33
+ this.valueStart = this.parseDate(newValue.start);
34
+ this.valueEnd = this.parseDate(newValue.end);
35
+ }
36
+ }
37
+ ezChangeListener(event, field) {
38
+ this.errorMessage = undefined;
39
+ this.internalChange[field] = true;
40
+ this.value = Object.assign(Object.assign({}, (this.value || {})), { [field]: event.detail ? this.parseDate(event.detail) : null });
41
+ this.valueChanged.emit(this.value);
14
42
  }
15
43
  /**
16
- * Emitido quando acontece a alteração de valor do componente snk-filter-period
44
+ * Define o foco no componente snk-filter-period.
17
45
  */
18
- ezChangeListener() {
19
- const start = this._startDate.value;
20
- const end = this._endDate.value;
21
- this.value = (start || end ? { start, end } : undefined);
22
- this.valueChanged.emit(this.value);
46
+ async setFocus() {
47
+ this._startDate.setFocus();
48
+ }
49
+ /**
50
+ * Limpa o valor do componente restaurando o valor original da configuração.
51
+ */
52
+ async clearValue() {
53
+ this.value = this.config.value;
54
+ this.valueStart = this.getDate("start");
55
+ this.valueEnd = this.getDate("end");
23
56
  }
24
57
  componentDidLoad() {
25
58
  if (this._element) {
26
59
  ElementIDUtils.addIDInfo(this._element, 'filterContentEditor');
60
+ this._element.querySelectorAll('ez-date-input').forEach(input => {
61
+ const textInput = input.shadowRoot.querySelector('ez-text-input');
62
+ textInput.style.setProperty('--ez-text-input__min-width', '120px');
63
+ });
27
64
  }
28
65
  }
29
- getDate(prop) {
30
- const objValue = this.value ? this.value[prop] : null;
31
- if (objValue instanceof Date) {
32
- return objValue;
66
+ parseDate(date) {
67
+ if (date instanceof Date) {
68
+ return date;
33
69
  }
34
- if (typeof objValue === "string") {
35
- let date = new Date(objValue);
70
+ if (typeof date === "string") {
71
+ date = new Date(date);
36
72
  date.setMinutes(date.getMinutes() + date.getTimezoneOffset());
37
73
  return date;
38
74
  }
39
75
  return null;
40
76
  }
77
+ getDate(prop) {
78
+ const objValue = this.value ? this.value[prop] : null;
79
+ return this.parseDate(objValue);
80
+ }
41
81
  /**
42
82
  * Exibe o componente snk-filter-period
43
83
  */
@@ -55,12 +95,14 @@ export class SnkFilterPeriod {
55
95
  this._endDateLabel = this.getMessage('snkFilterBar.labelEnd');
56
96
  this._toLabel = this.getMessage('snkFilterBar.labelTo');
57
97
  }
98
+ this.valueStart = this.getDate("start");
99
+ this.valueEnd = this.getDate("end");
58
100
  }
59
101
  render() {
60
102
  if (!this.config || this.config.type !== FilterItemType.PERIOD) {
61
103
  return undefined;
62
104
  }
63
- 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") })));
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-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') }))));
64
106
  }
65
107
  static get is() { return "snk-filter-period"; }
66
108
  static get properties() {
@@ -101,12 +143,16 @@ export class SnkFilterPeriod {
101
143
  }
102
144
  },
103
145
  "value": {
104
- "type": "any",
105
- "mutable": false,
146
+ "type": "unknown",
147
+ "mutable": true,
106
148
  "complexType": {
107
- "original": "any",
108
- "resolved": "any",
109
- "references": {}
149
+ "original": "Period",
150
+ "resolved": "Period",
151
+ "references": {
152
+ "Period": {
153
+ "location": "local"
154
+ }
155
+ }
110
156
  },
111
157
  "required": false,
112
158
  "optional": false,
@@ -114,8 +160,7 @@ export class SnkFilterPeriod {
114
160
  "tags": [],
115
161
  "text": "Define o valor do componente snk-filter-period"
116
162
  },
117
- "attribute": "value",
118
- "reflect": false
163
+ "defaultValue": "{\n start: null,\n end: null\n }"
119
164
  },
120
165
  "presentationMode": {
121
166
  "type": "number",
@@ -139,6 +184,23 @@ export class SnkFilterPeriod {
139
184
  "attribute": "presentation-mode",
140
185
  "reflect": false,
141
186
  "defaultValue": "EPresentationMode.CHIP"
187
+ },
188
+ "errorMessage": {
189
+ "type": "string",
190
+ "mutable": true,
191
+ "complexType": {
192
+ "original": "string",
193
+ "resolved": "string",
194
+ "references": {}
195
+ },
196
+ "required": false,
197
+ "optional": false,
198
+ "docs": {
199
+ "tags": [],
200
+ "text": "Usado para exibir mensagens de erro."
201
+ },
202
+ "attribute": "error-message",
203
+ "reflect": true
142
204
  }
143
205
  };
144
206
  }
@@ -162,6 +224,38 @@ export class SnkFilterPeriod {
162
224
  }
163
225
  static get methods() {
164
226
  return {
227
+ "setFocus": {
228
+ "complexType": {
229
+ "signature": "() => Promise<void>",
230
+ "parameters": [],
231
+ "references": {
232
+ "Promise": {
233
+ "location": "global"
234
+ }
235
+ },
236
+ "return": "Promise<void>"
237
+ },
238
+ "docs": {
239
+ "text": "Define o foco no componente snk-filter-period.",
240
+ "tags": []
241
+ }
242
+ },
243
+ "clearValue": {
244
+ "complexType": {
245
+ "signature": "() => Promise<void>",
246
+ "parameters": [],
247
+ "references": {
248
+ "Promise": {
249
+ "location": "global"
250
+ }
251
+ },
252
+ "return": "Promise<void>"
253
+ },
254
+ "docs": {
255
+ "text": "Limpa o valor do componente restaurando o valor original da configura\u00E7\u00E3o.",
256
+ "tags": []
257
+ }
258
+ },
165
259
  "show": {
166
260
  "complexType": {
167
261
  "signature": "() => Promise<void>",
@@ -181,13 +275,10 @@ export class SnkFilterPeriod {
181
275
  };
182
276
  }
183
277
  static get elementRef() { return "_element"; }
184
- static get listeners() {
278
+ static get watchers() {
185
279
  return [{
186
- "name": "ezChange",
187
- "method": "ezChangeListener",
188
- "target": undefined,
189
- "capture": false,
190
- "passive": false
280
+ "propName": "value",
281
+ "methodName": "configChanged"
191
282
  }];
192
283
  }
193
284
  }
@@ -6,11 +6,13 @@ export class SnkFilterSearch {
6
6
  this._isSearchPlus = false;
7
7
  this.config = undefined;
8
8
  this.value = undefined;
9
+ this.errorMessage = undefined;
9
10
  }
10
11
  /**
11
12
  * Emitido quando acontece a alteração de valor do componente snk-filter-search
12
13
  */
13
14
  async ezChangeListener(_evt) {
15
+ this.errorMessage = undefined;
14
16
  if (this._isSearchPlus) {
15
17
  this.value = await this._searchInput.getValueAsync();
16
18
  }
@@ -37,16 +39,25 @@ export class SnkFilterSearch {
37
39
  });
38
40
  }
39
41
  /**
40
- * Exibe o componente snk-filter-search
42
+ * Define o foco no componente snk-filter-search.
41
43
  */
42
- async show() {
44
+ async setFocus() {
43
45
  this._searchInput.setFocus();
44
46
  }
47
+ /**
48
+ * Limpa o valor do componente restaurando o valor original da configuração.
49
+ */
50
+ async clearValue() {
51
+ this.value = this.config.value;
52
+ if (this._searchInput) {
53
+ this._searchInput.value = this.config.value;
54
+ }
55
+ }
45
56
  getInputItem() {
46
57
  var _a;
47
58
  this._isSearchPlus = ((_a = this.config.props) === null || _a === void 0 ? void 0 : _a["useSearchPlus"]) == true;
48
59
  const TagName = this._isSearchPlus ? "ez-search-plus" : "ez-search";
49
- 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) }));
60
+ 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 })));
50
61
  }
51
62
  render() {
52
63
  if (!this.config || this.config.type !== FilterItemType.SEARCH) {
@@ -96,6 +107,23 @@ export class SnkFilterSearch {
96
107
  "tags": [],
97
108
  "text": "Define o valor do componente snk-filter-search"
98
109
  }
110
+ },
111
+ "errorMessage": {
112
+ "type": "string",
113
+ "mutable": true,
114
+ "complexType": {
115
+ "original": "string",
116
+ "resolved": "string",
117
+ "references": {}
118
+ },
119
+ "required": false,
120
+ "optional": false,
121
+ "docs": {
122
+ "tags": [],
123
+ "text": "Usado para exibir mensagens de erro."
124
+ },
125
+ "attribute": "error-message",
126
+ "reflect": true
99
127
  }
100
128
  };
101
129
  }
@@ -119,7 +147,23 @@ export class SnkFilterSearch {
119
147
  }
120
148
  static get methods() {
121
149
  return {
122
- "show": {
150
+ "setFocus": {
151
+ "complexType": {
152
+ "signature": "() => Promise<void>",
153
+ "parameters": [],
154
+ "references": {
155
+ "Promise": {
156
+ "location": "global"
157
+ }
158
+ },
159
+ "return": "Promise<void>"
160
+ },
161
+ "docs": {
162
+ "text": "Define o foco no componente snk-filter-search.",
163
+ "tags": []
164
+ }
165
+ },
166
+ "clearValue": {
123
167
  "complexType": {
124
168
  "signature": "() => Promise<void>",
125
169
  "parameters": [],
@@ -131,7 +175,7 @@ export class SnkFilterSearch {
131
175
  "return": "Promise<void>"
132
176
  },
133
177
  "docs": {
134
- "text": "Exibe o componente snk-filter-search",
178
+ "text": "Limpa o valor do componente restaurando o valor original da configura\u00E7\u00E3o.",
135
179
  "tags": []
136
180
  }
137
181
  }
@@ -4,14 +4,31 @@ export class SnkFilterText {
4
4
  constructor() {
5
5
  this.config = undefined;
6
6
  this.value = undefined;
7
+ this.errorMessage = undefined;
7
8
  }
8
9
  /**
9
10
  * Emitido quando acontece a alteração de valor do componente snk-filter-text.
10
11
  */
11
12
  ezChangeListener(evt) {
13
+ this.errorMessage = undefined;
12
14
  this.value = evt.detail;
13
15
  this.valueChanged.emit(this.value);
14
16
  }
17
+ /**
18
+ * Define o foco no componente snk-filter-text.
19
+ */
20
+ async setFocus() {
21
+ this._textInputElement.setFocus();
22
+ }
23
+ /**
24
+ * Limpa o valor do componente restaurando o valor original da configuração.
25
+ */
26
+ async clearValue() {
27
+ this.value = this.config.value;
28
+ if (this._textInputElement) {
29
+ this._textInputElement.value = this.config.value;
30
+ }
31
+ }
15
32
  componentDidLoad() {
16
33
  if (this._element) {
17
34
  ElementIDUtils.addIDInfo(this._element, 'filterContentEditor');
@@ -22,7 +39,7 @@ export class SnkFilterText {
22
39
  if (!this.config) {
23
40
  return undefined;
24
41
  }
25
- 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 }));
42
+ 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 })));
26
43
  }
27
44
  static get is() { return "snk-filter-text"; }
28
45
  static get properties() {
@@ -63,6 +80,23 @@ export class SnkFilterText {
63
80
  },
64
81
  "attribute": "value",
65
82
  "reflect": false
83
+ },
84
+ "errorMessage": {
85
+ "type": "string",
86
+ "mutable": true,
87
+ "complexType": {
88
+ "original": "string",
89
+ "resolved": "string",
90
+ "references": {}
91
+ },
92
+ "required": false,
93
+ "optional": false,
94
+ "docs": {
95
+ "tags": [],
96
+ "text": "Usado para exibir mensagens de erro."
97
+ },
98
+ "attribute": "error-message",
99
+ "reflect": true
66
100
  }
67
101
  };
68
102
  }
@@ -84,6 +118,42 @@ export class SnkFilterText {
84
118
  }
85
119
  }];
86
120
  }
121
+ static get methods() {
122
+ return {
123
+ "setFocus": {
124
+ "complexType": {
125
+ "signature": "() => Promise<void>",
126
+ "parameters": [],
127
+ "references": {
128
+ "Promise": {
129
+ "location": "global"
130
+ }
131
+ },
132
+ "return": "Promise<void>"
133
+ },
134
+ "docs": {
135
+ "text": "Define o foco no componente snk-filter-text.",
136
+ "tags": []
137
+ }
138
+ },
139
+ "clearValue": {
140
+ "complexType": {
141
+ "signature": "() => Promise<void>",
142
+ "parameters": [],
143
+ "references": {
144
+ "Promise": {
145
+ "location": "global"
146
+ }
147
+ },
148
+ "return": "Promise<void>"
149
+ },
150
+ "docs": {
151
+ "text": "Limpa o valor do componente restaurando o valor original da configura\u00E7\u00E3o.",
152
+ "tags": []
153
+ }
154
+ }
155
+ };
156
+ }
87
157
  static get elementRef() { return "_element"; }
88
158
  static get listeners() {
89
159
  return [{
@@ -1,21 +1,38 @@
1
- import { h, Host, Fragment } from '@stencil/core';
2
- import { ApplicationUtils } from "@sankhyalabs/ezui/dist/collection/utils";
3
- import FilterItemType from './filter-item-type.enum';
4
1
  import { ElementIDUtils, ObjectUtils } from '@sankhyalabs/core';
5
- import { EPresentationMode } from './editors/enum/presentationMode';
2
+ import { ApplicationUtils } from "@sankhyalabs/ezui/dist/collection/utils";
3
+ import { Fragment, h, Host } from '@stencil/core';
6
4
  import { PersonalizedFilterUtils } from '../../snk-personalized-filter/subcomponents/snk-filter-param-config/utils/PersonalizedFilterUtils';
5
+ import { EPresentationMode } from './editors/enum/presentationMode';
6
+ import FilterItemType from './filter-item-type.enum';
7
7
  export class SnkFilterDetail {
8
8
  constructor() {
9
9
  this.config = undefined;
10
10
  this.getMessage = undefined;
11
11
  this.showHardFixed = true;
12
+ this.removalBlocked = false;
12
13
  }
13
14
  /**
14
- * Exibe o componente snk-filter-detail.
15
+ * Define o foco no campo do editor.
15
16
  */
16
- async show() {
17
- var _a, _b;
18
- (_b = (_a = this._editor) === null || _a === void 0 ? void 0 : _a["show"]) === null || _b === void 0 ? void 0 : _b.call(_a);
17
+ async setFocusField() {
18
+ var _a, _b, _c, _d;
19
+ if (!this._editor) {
20
+ return;
21
+ }
22
+ if (this._editor["setFocus"]) {
23
+ (_b = (_a = this._editor) === null || _a === void 0 ? void 0 : _a["setFocus"]) === null || _b === void 0 ? void 0 : _b.call(_a);
24
+ }
25
+ else if (this._editor["focus"]) {
26
+ (_d = (_c = this._editor) === null || _c === void 0 ? void 0 : _c["focus"]) === null || _d === void 0 ? void 0 : _d.call(_c);
27
+ }
28
+ }
29
+ async clearValue() {
30
+ if (!this._editor) {
31
+ return;
32
+ }
33
+ if (this._editor["clearValue"]) {
34
+ await this._editor["clearValue"]();
35
+ }
19
36
  }
20
37
  observeConfig(newValue) {
21
38
  var _a, _b;
@@ -87,7 +104,7 @@ export class SnkFilterDetail {
87
104
  return Object.assign(Object.assign({}, item), { visible: false, fixed: false, value: undefined });
88
105
  }
89
106
  getPopUpHeaderButtons() {
90
- return (h(Fragment, null, !this.config.removalBlocked &&
107
+ return (h(Fragment, null, !this.removalBlocked && !this.config.removalBlocked &&
91
108
  this.buildIcon(this.getMessage("snkFilterBar.removeFilter"), "delete", () => this.removeItem()), this.showHardFixed && !this.config.hardFixed &&
92
109
  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 })))));
93
110
  }
@@ -219,6 +236,24 @@ export class SnkFilterDetail {
219
236
  "attribute": "show-hard-fixed",
220
237
  "reflect": false,
221
238
  "defaultValue": "true"
239
+ },
240
+ "removalBlocked": {
241
+ "type": "boolean",
242
+ "mutable": false,
243
+ "complexType": {
244
+ "original": "boolean",
245
+ "resolved": "boolean",
246
+ "references": {}
247
+ },
248
+ "required": false,
249
+ "optional": false,
250
+ "docs": {
251
+ "tags": [],
252
+ "text": "Define se o filtro pode ser removido."
253
+ },
254
+ "attribute": "removal-blocked",
255
+ "reflect": false,
256
+ "defaultValue": "false"
222
257
  }
223
258
  };
224
259
  }
@@ -247,7 +282,23 @@ export class SnkFilterDetail {
247
282
  }
248
283
  static get methods() {
249
284
  return {
250
- "show": {
285
+ "setFocusField": {
286
+ "complexType": {
287
+ "signature": "() => Promise<void>",
288
+ "parameters": [],
289
+ "references": {
290
+ "Promise": {
291
+ "location": "global"
292
+ }
293
+ },
294
+ "return": "Promise<void>"
295
+ },
296
+ "docs": {
297
+ "text": "Define o foco no campo do editor.",
298
+ "tags": []
299
+ }
300
+ },
301
+ "clearValue": {
251
302
  "complexType": {
252
303
  "signature": "() => Promise<void>",
253
304
  "parameters": [],
@@ -259,7 +310,7 @@ export class SnkFilterDetail {
259
310
  "return": "Promise<void>"
260
311
  },
261
312
  "docs": {
262
- "text": "Exibe o componente snk-filter-detail.",
313
+ "text": "",
263
314
  "tags": []
264
315
  }
265
316
  }