@sankhyalabs/sankhyablocks 9.2.0-ms.17 → 9.2.0-ms.18

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 (197) hide show
  1. package/dist/cjs/{ConfigStorage-0ebc800f.js → ConfigStorage-8b6def32.js} +2 -2
  2. package/dist/cjs/{DataFetcher-602cdc72.js → DataFetcher-2c37b6a1.js} +51 -0
  3. package/dist/cjs/{ISave-18205d86.js → ISave-b22b3cf0.js} +1 -1
  4. package/dist/cjs/{SnkFormConfigManager-4b651537.js → SnkFormConfigManager-477a27de.js} +2 -2
  5. package/dist/cjs/{ClientSideExporterProvider-bb0b2273.js → SnkMultiSelectionListDataSource-b7ab26ba.js} +78 -78
  6. package/dist/cjs/{auth-fetcher-82317d4d.js → auth-fetcher-78a90b36.js} +1 -1
  7. package/dist/cjs/{dataunit-fetcher-93077a2f.js → dataunit-fetcher-877944a9.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-dee08eb4.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 +8 -7
  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-7cb76490.js → snk-data-unit-0cfa7622.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 +5 -2
  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-38277265.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-application/snk-application.js +3 -2
  41. package/dist/collection/components/snk-entity-list/snk-entity-list.js +23 -3
  42. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.js +72 -2
  43. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-checkbox-list.js +73 -2
  44. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.js +51 -5
  45. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js +83 -3
  46. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js +118 -27
  47. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-search.js +49 -5
  48. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js +71 -1
  49. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +62 -11
  50. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +70 -8
  51. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.css +0 -4
  52. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +112 -16
  53. package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js +8 -16
  54. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +106 -52
  55. package/dist/collection/components/snk-filter-bar/utils/SnkFilterModalFactory.js +3 -1
  56. package/dist/collection/components/snk-filter-bar/utils/filter-validate.js +24 -0
  57. package/dist/collection/components/snk-grid/snk-grid.js +91 -16
  58. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +1 -0
  59. package/dist/collection/lib/http/data-fetcher/custom-xhr-override.js +39 -0
  60. package/dist/collection/lib/message/resources/en-us/snk-filter-bar.msg.js +1 -0
  61. package/dist/collection/lib/message/resources/en-us/snk-grid.msg.js +4 -0
  62. package/dist/collection/lib/message/resources/es-es/snk-filter-bar.msg.js +1 -0
  63. package/dist/collection/lib/message/resources/es-es/snk-grid.msg.js +4 -0
  64. package/dist/collection/lib/message/resources/pt-br/snk-filter-bar.msg.js +1 -0
  65. package/dist/collection/lib/message/resources/pt-br/snk-grid.msg.js +4 -0
  66. package/dist/components/DataFetcher.js +51 -0
  67. package/dist/components/snk-application2.js +3 -2
  68. package/dist/components/snk-crud.js +62 -44
  69. package/dist/components/snk-detail-view2.js +89 -56
  70. package/dist/components/snk-entity-list.js +6 -2
  71. package/dist/components/snk-filter-bar2.js +77 -93
  72. package/dist/components/snk-filter-binary-select.js +27 -3
  73. package/dist/components/snk-filter-checkbox-list.js +24 -3
  74. package/dist/components/snk-filter-detail2.js +28 -9
  75. package/dist/components/snk-filter-item2.js +70 -8
  76. package/dist/components/snk-filter-modal-item2.js +7 -12
  77. package/dist/components/snk-filter-modal.js +1 -325
  78. package/dist/components/snk-filter-modal2.js +391 -0
  79. package/dist/components/snk-filter-multi-select.js +19 -4
  80. package/dist/components/snk-filter-number.js +38 -4
  81. package/dist/components/snk-filter-period.js +64 -16
  82. package/dist/components/snk-filter-search.js +17 -4
  83. package/dist/components/snk-filter-text.js +22 -2
  84. package/dist/components/snk-grid2.js +65 -29
  85. package/dist/esm/{ConfigStorage-fc4e3a42.js → ConfigStorage-22eace3a.js} +2 -2
  86. package/dist/esm/{DataFetcher-01ce1a4f.js → DataFetcher-f6b2961a.js} +51 -0
  87. package/dist/esm/{ISave-d36bade4.js → ISave-6b7b0423.js} +1 -1
  88. package/dist/esm/{SnkFormConfigManager-71dae34e.js → SnkFormConfigManager-968b97e7.js} +2 -2
  89. package/dist/esm/{ClientSideExporterProvider-21a99af1.js → SnkMultiSelectionListDataSource-1136c4e7.js} +83 -83
  90. package/dist/esm/{auth-fetcher-2e565c35.js → auth-fetcher-cf39e42b.js} +1 -1
  91. package/dist/esm/{dataunit-fetcher-14ba162b.js → dataunit-fetcher-6314b19d.js} +1 -1
  92. package/dist/esm/filter-validate-d765d450.js +27 -0
  93. package/dist/esm/{form-config-fetcher-a1ccc944.js → form-config-fetcher-bc6f0f1f.js} +1 -1
  94. package/dist/esm/index-479e1293.js +8 -8
  95. package/dist/esm/loader.js +1 -1
  96. package/dist/esm/pesquisa-grid_2.entry.js +4 -4
  97. package/dist/esm/sankhyablocks.js +1 -1
  98. package/dist/esm/snk-actions-button_8.entry.js +5 -5
  99. package/dist/esm/snk-application.entry.js +9 -8
  100. package/dist/esm/snk-attach.entry.js +5 -5
  101. package/dist/esm/snk-crud.entry.js +5 -5
  102. package/dist/esm/snk-data-exporter.entry.js +5 -5
  103. package/dist/esm/{snk-data-unit-b5e1c491.js → snk-data-unit-4acf4781.js} +2 -2
  104. package/dist/esm/snk-data-unit.entry.js +3 -3
  105. package/dist/esm/snk-detail-view.entry.js +7 -7
  106. package/dist/esm/snk-entity-list.entry.js +5 -2
  107. package/dist/esm/snk-filter-bar_4.entry.js +165 -101
  108. package/dist/esm/snk-filter-binary-select.entry.js +23 -2
  109. package/dist/esm/snk-filter-checkbox-list.entry.js +20 -2
  110. package/dist/esm/snk-filter-detail.entry.js +25 -8
  111. package/dist/esm/snk-filter-modal-item.entry.js +9 -14
  112. package/dist/esm/snk-filter-multi-select.entry.js +16 -3
  113. package/dist/esm/snk-filter-number.entry.js +34 -3
  114. package/dist/esm/snk-filter-period.entry.js +59 -14
  115. package/dist/esm/snk-filter-search.entry.js +14 -3
  116. package/dist/esm/snk-filter-text.entry.js +18 -1
  117. package/dist/esm/snk-form_2.entry.js +4 -4
  118. package/dist/esm/snk-grid.entry.js +31 -14
  119. package/dist/esm/{snk-guides-viewer-f800c9aa.js → snk-guides-viewer-19cb7f1f.js} +5 -5
  120. package/dist/esm/snk-guides-viewer.entry.js +7 -7
  121. package/dist/esm/snk-personalized-filter.entry.js +3 -3
  122. package/dist/esm/snk-pesquisa.entry.js +4 -4
  123. package/dist/esm/snk-simple-crud.entry.js +8 -8
  124. package/dist/sankhyablocks/p-093f58fa.entry.js +1 -0
  125. package/dist/sankhyablocks/{p-87399df6.js → p-0a317e81.js} +1 -1
  126. package/dist/sankhyablocks/{p-aba06047.entry.js → p-0e1f0344.entry.js} +1 -1
  127. package/dist/sankhyablocks/{p-7085fc67.entry.js → p-16c1c209.entry.js} +1 -1
  128. package/dist/sankhyablocks/p-29cacaf3.entry.js +1 -0
  129. package/dist/sankhyablocks/{p-34222890.entry.js → p-32450ea2.entry.js} +1 -1
  130. package/dist/sankhyablocks/{p-41e5a485.entry.js → p-3c29939c.entry.js} +1 -1
  131. package/dist/sankhyablocks/p-3ed04f0d.entry.js +1 -0
  132. package/dist/sankhyablocks/{p-e5571279.entry.js → p-44c5ec49.entry.js} +1 -1
  133. package/dist/sankhyablocks/p-49ddc27a.entry.js +1 -0
  134. package/dist/sankhyablocks/p-4c763b10.entry.js +1 -0
  135. package/dist/sankhyablocks/p-4eeb06fc.js +1 -0
  136. package/dist/sankhyablocks/p-505172c8.entry.js +1 -0
  137. package/dist/sankhyablocks/p-519f74be.entry.js +11 -0
  138. package/dist/sankhyablocks/p-658f67a5.js +1 -0
  139. package/dist/sankhyablocks/{p-0607d7a7.entry.js → p-701b024c.entry.js} +1 -1
  140. package/dist/sankhyablocks/p-72a9285d.entry.js +1 -0
  141. package/dist/sankhyablocks/p-7f7fe6c4.entry.js +1 -0
  142. package/dist/sankhyablocks/p-88b7bc09.js +1 -0
  143. package/dist/sankhyablocks/{p-51209229.js → p-8d256def.js} +1 -1
  144. package/dist/sankhyablocks/p-8f37b75b.entry.js +1 -0
  145. package/dist/sankhyablocks/{p-e63cc25f.js → p-9062d640.js} +1 -1
  146. package/dist/sankhyablocks/p-96d45943.entry.js +1 -0
  147. package/dist/sankhyablocks/{p-7b97f9af.entry.js → p-b2d7f4cd.entry.js} +1 -1
  148. package/dist/sankhyablocks/{p-c3bab5f4.js → p-b7f5caf6.js} +1 -1
  149. package/dist/sankhyablocks/{p-7535d592.js → p-bf017a1f.js} +1 -1
  150. package/dist/sankhyablocks/{p-3cdfd7fb.js → p-c71dcb2d.js} +1 -1
  151. package/dist/sankhyablocks/{p-dde9da7a.entry.js → p-c95f20d9.entry.js} +1 -1
  152. package/dist/sankhyablocks/p-c98e2085.js +1 -0
  153. package/dist/sankhyablocks/p-cb4343c4.entry.js +1 -0
  154. package/dist/sankhyablocks/{p-dfbe4d7f.entry.js → p-d03ae54e.entry.js} +1 -1
  155. package/dist/sankhyablocks/p-d235314c.entry.js +1 -0
  156. package/dist/sankhyablocks/p-d75a732c.js +1 -0
  157. package/dist/sankhyablocks/{p-7a1d3cb6.entry.js → p-df7979fd.entry.js} +1 -1
  158. package/dist/sankhyablocks/p-e258de96.entry.js +1 -0
  159. package/dist/sankhyablocks/{p-b6b42620.entry.js → p-f8e87cf1.entry.js} +1 -1
  160. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  161. package/dist/types/components/snk-entity-list/snk-entity-list.d.ts +8 -4
  162. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.d.ts +12 -0
  163. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-checkbox-list.d.ts +12 -0
  164. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.d.ts +12 -4
  165. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-number.d.ts +16 -4
  166. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-period.d.ts +17 -3
  167. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-search.d.ts +10 -2
  168. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-text.d.ts +12 -0
  169. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +8 -3
  170. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +27 -4
  171. package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +17 -3
  172. package/dist/types/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.d.ts +2 -3
  173. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +15 -2
  174. package/dist/types/components/snk-filter-bar/utils/SnkFilterModalFactory.d.ts +4 -2
  175. package/dist/types/components/snk-filter-bar/utils/filter-validate.d.ts +11 -0
  176. package/dist/types/components/snk-grid/snk-grid.d.ts +22 -9
  177. package/dist/types/components.d.ts +203 -18
  178. package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +1 -0
  179. package/package.json +1 -1
  180. package/dist/sankhyablocks/p-07b14811.entry.js +0 -1
  181. package/dist/sankhyablocks/p-082e7ba8.entry.js +0 -1
  182. package/dist/sankhyablocks/p-25209340.entry.js +0 -1
  183. package/dist/sankhyablocks/p-3143bb44.entry.js +0 -1
  184. package/dist/sankhyablocks/p-353b4a74.js +0 -1
  185. package/dist/sankhyablocks/p-398cdd67.entry.js +0 -1
  186. package/dist/sankhyablocks/p-3a10f9ea.entry.js +0 -1
  187. package/dist/sankhyablocks/p-5bab470d.entry.js +0 -1
  188. package/dist/sankhyablocks/p-65517fcf.js +0 -1
  189. package/dist/sankhyablocks/p-9fd87bfd.entry.js +0 -1
  190. package/dist/sankhyablocks/p-a76e6d51.entry.js +0 -1
  191. package/dist/sankhyablocks/p-ae2ebab7.js +0 -1
  192. package/dist/sankhyablocks/p-b21aa190.entry.js +0 -1
  193. package/dist/sankhyablocks/p-c6a8a8bc.entry.js +0 -1
  194. package/dist/sankhyablocks/p-c8932b14.entry.js +0 -1
  195. package/dist/sankhyablocks/p-dc8bb41f.js +0 -1
  196. package/dist/sankhyablocks/p-dff65083.entry.js +0 -1
  197. package/dist/sankhyablocks/p-f4bf0517.entry.js +0 -11
@@ -10,11 +10,13 @@ const SnkFilterSearch$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
10
10
  this._isSearchPlus = false;
11
11
  this.config = undefined;
12
12
  this.value = undefined;
13
+ this.errorMessage = undefined;
13
14
  }
14
15
  /**
15
16
  * Emitido quando acontece a alteração de valor do componente snk-filter-search
16
17
  */
17
18
  async ezChangeListener(_evt) {
19
+ this.errorMessage = undefined;
18
20
  if (this._isSearchPlus) {
19
21
  this.value = await this._searchInput.getValueAsync();
20
22
  }
@@ -41,16 +43,25 @@ const SnkFilterSearch$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
41
43
  });
42
44
  }
43
45
  /**
44
- * Exibe o componente snk-filter-search
46
+ * Define o foco no componente snk-filter-search.
45
47
  */
46
- async show() {
48
+ async setFocus() {
47
49
  this._searchInput.setFocus();
48
50
  }
51
+ /**
52
+ * Limpa o valor do componente restaurando o valor original da configuração.
53
+ */
54
+ async clearValue() {
55
+ this.value = this.config.value;
56
+ if (this._searchInput) {
57
+ this._searchInput.value = this.config.value;
58
+ }
59
+ }
49
60
  getInputItem() {
50
61
  var _a;
51
62
  this._isSearchPlus = ((_a = this.config.props) === null || _a === void 0 ? void 0 : _a["useSearchPlus"]) == true;
52
63
  const TagName = this._isSearchPlus ? "ez-search-plus" : "ez-search";
53
- 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) }));
64
+ 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 })));
54
65
  }
55
66
  render() {
56
67
  if (!this.config || this.config.type !== FilterItemType.SEARCH) {
@@ -62,7 +73,9 @@ const SnkFilterSearch$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
62
73
  }, [0, "snk-filter-search", {
63
74
  "config": [16],
64
75
  "value": [16],
65
- "show": [64]
76
+ "errorMessage": [1537, "error-message"],
77
+ "setFocus": [64],
78
+ "clearValue": [64]
66
79
  }, [[0, "ezChange", "ezChangeListener"]]]);
67
80
  function defineCustomElement$1() {
68
81
  if (typeof customElements === "undefined") {
@@ -8,14 +8,31 @@ const SnkFilterText$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
8
8
  this.valueChanged = createEvent(this, "valueChanged", 7);
9
9
  this.config = undefined;
10
10
  this.value = undefined;
11
+ this.errorMessage = undefined;
11
12
  }
12
13
  /**
13
14
  * Emitido quando acontece a alteração de valor do componente snk-filter-text.
14
15
  */
15
16
  ezChangeListener(evt) {
17
+ this.errorMessage = undefined;
16
18
  this.value = evt.detail;
17
19
  this.valueChanged.emit(this.value);
18
20
  }
21
+ /**
22
+ * Define o foco no componente snk-filter-text.
23
+ */
24
+ async setFocus() {
25
+ this._textInputElement.setFocus();
26
+ }
27
+ /**
28
+ * Limpa o valor do componente restaurando o valor original da configuração.
29
+ */
30
+ async clearValue() {
31
+ this.value = this.config.value;
32
+ if (this._textInputElement) {
33
+ this._textInputElement.value = this.config.value;
34
+ }
35
+ }
19
36
  componentDidLoad() {
20
37
  if (this._element) {
21
38
  ElementIDUtils.addIDInfo(this._element, 'filterContentEditor');
@@ -26,12 +43,15 @@ const SnkFilterText$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
26
43
  if (!this.config) {
27
44
  return undefined;
28
45
  }
29
- 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 }));
46
+ 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 })));
30
47
  }
31
48
  get _element() { return this; }
32
49
  }, [0, "snk-filter-text", {
33
50
  "config": [16],
34
- "value": [1]
51
+ "value": [1],
52
+ "errorMessage": [1537, "error-message"],
53
+ "setFocus": [64],
54
+ "clearValue": [64]
35
55
  }, [[0, "ezChange", "ezChangeListener"]]]);
36
56
  function defineCustomElement$1() {
37
57
  if (typeof customElements === "undefined") {
@@ -1,31 +1,34 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h, Fragment } from '@stencil/core/internal/client';
2
2
  import { KeyboardManager, Action, ElementIDUtils, ApplicationContext, StringUtils } from '@sankhyalabs/core';
3
- import { T as TaskbarElement, d as defineCustomElement$3 } from './snk-taskbar2.js';
4
- import { C as ConfigStorage } from './ConfigStorage.js';
5
- import { P as PresentationMode, E as ExporterStrategy } from './ISave.js';
6
- import { C as CommonsExporter, T as TaskbarProcessor, S as SnkMultiSelectionListDataSource, a as CrudUtils, R as RmPrecisionCustomValueFormatter, b as ContinuousInsertUtils, c as ClientSideExporterProvider } from './ContinuousInsertUtils.js';
7
- import { s as store } from './index2.js';
8
3
  import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
4
+ import { buildFieldSearch } from '@sankhyalabs/ezui/dist/collection/utils';
9
5
  import './DataFetcher.js';
6
+ import { P as PresentationMode, E as ExporterStrategy } from './ISave.js';
7
+ import { C as CommonsExporter, T as TaskbarProcessor, S as SnkMultiSelectionListDataSource, a as CrudUtils, R as RmPrecisionCustomValueFormatter, b as ContinuousInsertUtils, c as ClientSideExporterProvider } from './ContinuousInsertUtils.js';
10
8
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
11
9
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
12
10
  import './dataunit-fetcher.js';
13
11
  import './filter-item-type.enum.js';
14
12
  import './form-config-fetcher.js';
15
13
  import './constants.js';
14
+ import { C as ConfigStorage } from './ConfigStorage.js';
15
+ import { s as store } from './index2.js';
16
16
  import { g as getSelectedRecordsIDsInfo } from './GetSelectedRecordsIDsInfo.js';
17
- import { buildFieldSearch } from '@sankhyalabs/ezui/dist/collection/utils';
18
- import { d as defineCustomElement$j } from './snk-actions-button2.js';
19
- import { d as defineCustomElement$i } from './snk-data-exporter2.js';
20
- import { d as defineCustomElement$h } from './snk-exporter-email-sender2.js';
21
- import { d as defineCustomElement$g } from './snk-expression-group2.js';
22
- import { d as defineCustomElement$f } from './snk-expression-item2.js';
23
- import { d as defineCustomElement$e } from './snk-filter-advanced-mode2.js';
24
- import { d as defineCustomElement$d } from './snk-filter-assistent-mode2.js';
25
- import { d as defineCustomElement$c } from './snk-filter-bar2.js';
26
- import { d as defineCustomElement$b } from './snk-filter-detail2.js';
27
- import { d as defineCustomElement$a } from './snk-filter-field-search2.js';
28
- import { d as defineCustomElement$9 } from './snk-filter-item2.js';
17
+ import { v as validateFilters, d as defineCustomElement$a } from './snk-filter-modal2.js';
18
+ import { T as TaskbarElement, d as defineCustomElement$3 } from './snk-taskbar2.js';
19
+ import { d as defineCustomElement$m } from './snk-actions-button2.js';
20
+ import { d as defineCustomElement$l } from './snk-data-exporter2.js';
21
+ import { d as defineCustomElement$k } from './snk-default-filter2.js';
22
+ import { d as defineCustomElement$j } from './snk-exporter-email-sender2.js';
23
+ import { d as defineCustomElement$i } from './snk-expression-group2.js';
24
+ import { d as defineCustomElement$h } from './snk-expression-item2.js';
25
+ import { d as defineCustomElement$g } from './snk-filter-advanced-mode2.js';
26
+ import { d as defineCustomElement$f } from './snk-filter-assistent-mode2.js';
27
+ import { d as defineCustomElement$e } from './snk-filter-bar2.js';
28
+ import { d as defineCustomElement$d } from './snk-filter-detail2.js';
29
+ import { d as defineCustomElement$c } from './snk-filter-field-search2.js';
30
+ import { d as defineCustomElement$b } from './snk-filter-item2.js';
31
+ import { d as defineCustomElement$9 } from './snk-filter-modal-item2.js';
29
32
  import { d as defineCustomElement$8 } from './snk-filter-param-config2.js';
30
33
  import { d as defineCustomElement$7 } from './snk-grid-config2.js';
31
34
  import { d as defineCustomElement$6 } from './snk-personalized-filter2.js';
@@ -124,6 +127,9 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
124
127
  if (action.type === Action.METADATA_LOADED) {
125
128
  return await this.interceptMetadataLoaded(action);
126
129
  }
130
+ if (action.type === Action.LOADING_DATA) {
131
+ return await this.interceptLoadData(action);
132
+ }
127
133
  return action;
128
134
  },
129
135
  };
@@ -168,6 +174,8 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
168
174
  this.suppressCheckboxColumn = undefined;
169
175
  this.suppressFilterColumn = false;
170
176
  this.compact = undefined;
177
+ this.filterCustomConfig = undefined;
178
+ this.filterCustomConfigInterceptor = undefined;
171
179
  }
172
180
  getGridHeaderSelectedBtns() {
173
181
  const btns = [
@@ -446,6 +454,17 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
446
454
  this.loadGridCustomFormatters(action.payload.fields);
447
455
  return action;
448
456
  }
457
+ async interceptLoadData(action) {
458
+ var _a;
459
+ const hasInvalidFilters = !validateFilters((_a = this._snkFilterBar) === null || _a === void 0 ? void 0 : _a.filterConfig);
460
+ if (hasInvalidFilters) {
461
+ const errorTitle = this.messagesBuilder.getMessage("snkGrid.requiredFiltersNotFilled.title", {});
462
+ const errorMessage = this.messagesBuilder.getMessage("snkGrid.requiredFiltersNotFilled.message", {});
463
+ await this._application.error(errorTitle, errorMessage);
464
+ return;
465
+ }
466
+ return action;
467
+ }
449
468
  finishLoading() {
450
469
  this._dataUnit.addInterceptor(this.dataUnitInterceptor);
451
470
  CrudUtils.assertDefaultSorting(this._gridConfig, this._dataUnit);
@@ -655,7 +674,7 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
655
674
  return undefined;
656
675
  }
657
676
  return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large ez-box--no-outline", tabindex: "0" }, h("div", { class: "snk-grid__header ez-margin-bottom--extra-small" }, this._showSnkFilterBar &&
658
- h(Fragment, null, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp }), h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), h("snk-taskbar", { class: "ez-padding-left--medium ez-padding-top--extra-small", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId, overflowStrategy: 'none', actionsSettingsList: this.getActionsSettingsList() }, h("slot", { name: this.topTaskbarCustomSlotId }))), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? 'snk-grid-container__without-shadow ' : '') + 'snk-grid__table', "data-element-id": "embedded", dataUnit: this._dataUnit, key: 'grid-' + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => {
677
+ h(Fragment, null, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, filterCustomConfig: this.filterCustomConfig, filterCustomConfigInterceptor: this.filterCustomConfigInterceptor }), h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), h("snk-taskbar", { class: "ez-padding-left--medium ez-padding-top--extra-small", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId, overflowStrategy: 'none', actionsSettingsList: this.getActionsSettingsList() }, h("slot", { name: this.topTaskbarCustomSlotId }))), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? 'snk-grid-container__without-shadow ' : '') + 'snk-grid__table', "data-element-id": "embedded", dataUnit: this._dataUnit, key: 'grid-' + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => {
659
678
  this.gridConfigChangeHandler(evt);
660
679
  }, onEzColumnFilterChanged: async () => await this.dataExporterProviderStore(), onEzDoubleClick: (evt) => this.gridDoubleClick.emit(evt.detail), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this._enableContinuousInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, outlineMode: this.outlineMode, useSearchColumn: this.useSearchColumn, suppressHorizontalScroll: this.suppressHorizontalScroll, paginationCounterMode: this.paginationCounterMode, suppressCheckboxColumn: this.suppressCheckboxColumn, suppressFilterColumn: this.suppressFilterColumn, compact: this.compact }, h("snk-taskbar", { id: 'teste', dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this.getGridHeaderButtons(), presentationMode: this.presentationMode, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.getActionsList(), primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.gridHeaderCustomSlotId, actionsSettingsList: this.getActionsSettingsList() }, h("slot", { name: this.gridHeaderCustomSlotId }))), h("div", { class: "ez-col ez-col--sd-12 snk-grid-container__footer" }, h("slot", { name: "SnkGridFooter" })), h("ez-popup", { size: "medium", heightMode: "auto", useHeader: false, opened: this._popUpGridConfig, onEzClosePopup: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
661
680
  }
@@ -700,6 +719,8 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
700
719
  "suppressCheckboxColumn": [4, "suppress-checkbox-column"],
701
720
  "suppressFilterColumn": [1028, "suppress-filter-column"],
702
721
  "compact": [4],
722
+ "filterCustomConfig": [16],
723
+ "filterCustomConfigInterceptor": [16],
703
724
  "_dataUnit": [32],
704
725
  "_dataState": [32],
705
726
  "_gridConfig": [32],
@@ -723,7 +744,7 @@ function defineCustomElement() {
723
744
  if (typeof customElements === "undefined") {
724
745
  return;
725
746
  }
726
- const components = ["snk-grid", "snk-actions-button", "snk-data-exporter", "snk-exporter-email-sender", "snk-expression-group", "snk-expression-item", "snk-filter-advanced-mode", "snk-filter-assistent-mode", "snk-filter-bar", "snk-filter-detail", "snk-filter-field-search", "snk-filter-item", "snk-filter-param-config", "snk-grid-config", "snk-personalized-filter", "snk-select-box", "snk-simple-bar", "snk-taskbar", "taskbar-actions-button", "taskbar-split-button"];
747
+ const components = ["snk-grid", "snk-actions-button", "snk-data-exporter", "snk-default-filter", "snk-exporter-email-sender", "snk-expression-group", "snk-expression-item", "snk-filter-advanced-mode", "snk-filter-assistent-mode", "snk-filter-bar", "snk-filter-detail", "snk-filter-field-search", "snk-filter-item", "snk-filter-modal", "snk-filter-modal-item", "snk-filter-param-config", "snk-grid-config", "snk-personalized-filter", "snk-select-box", "snk-simple-bar", "snk-taskbar", "taskbar-actions-button", "taskbar-split-button"];
727
748
  components.forEach(tagName => { switch (tagName) {
728
749
  case "snk-grid":
729
750
  if (!customElements.get(tagName)) {
@@ -732,55 +753,70 @@ function defineCustomElement() {
732
753
  break;
733
754
  case "snk-actions-button":
734
755
  if (!customElements.get(tagName)) {
735
- defineCustomElement$j();
756
+ defineCustomElement$m();
736
757
  }
737
758
  break;
738
759
  case "snk-data-exporter":
739
760
  if (!customElements.get(tagName)) {
740
- defineCustomElement$i();
761
+ defineCustomElement$l();
762
+ }
763
+ break;
764
+ case "snk-default-filter":
765
+ if (!customElements.get(tagName)) {
766
+ defineCustomElement$k();
741
767
  }
742
768
  break;
743
769
  case "snk-exporter-email-sender":
744
770
  if (!customElements.get(tagName)) {
745
- defineCustomElement$h();
771
+ defineCustomElement$j();
746
772
  }
747
773
  break;
748
774
  case "snk-expression-group":
749
775
  if (!customElements.get(tagName)) {
750
- defineCustomElement$g();
776
+ defineCustomElement$i();
751
777
  }
752
778
  break;
753
779
  case "snk-expression-item":
754
780
  if (!customElements.get(tagName)) {
755
- defineCustomElement$f();
781
+ defineCustomElement$h();
756
782
  }
757
783
  break;
758
784
  case "snk-filter-advanced-mode":
759
785
  if (!customElements.get(tagName)) {
760
- defineCustomElement$e();
786
+ defineCustomElement$g();
761
787
  }
762
788
  break;
763
789
  case "snk-filter-assistent-mode":
764
790
  if (!customElements.get(tagName)) {
765
- defineCustomElement$d();
791
+ defineCustomElement$f();
766
792
  }
767
793
  break;
768
794
  case "snk-filter-bar":
769
795
  if (!customElements.get(tagName)) {
770
- defineCustomElement$c();
796
+ defineCustomElement$e();
771
797
  }
772
798
  break;
773
799
  case "snk-filter-detail":
774
800
  if (!customElements.get(tagName)) {
775
- defineCustomElement$b();
801
+ defineCustomElement$d();
776
802
  }
777
803
  break;
778
804
  case "snk-filter-field-search":
779
805
  if (!customElements.get(tagName)) {
780
- defineCustomElement$a();
806
+ defineCustomElement$c();
781
807
  }
782
808
  break;
783
809
  case "snk-filter-item":
810
+ if (!customElements.get(tagName)) {
811
+ defineCustomElement$b();
812
+ }
813
+ break;
814
+ case "snk-filter-modal":
815
+ if (!customElements.get(tagName)) {
816
+ defineCustomElement$a();
817
+ }
818
+ break;
819
+ case "snk-filter-modal-item":
784
820
  if (!customElements.get(tagName)) {
785
821
  defineCustomElement$9();
786
822
  }
@@ -1,5 +1,5 @@
1
- import { R as ResourceFetcher, F as FormConfigFetcher } from './form-config-fetcher-a1ccc944.js';
2
- import { D as DataFetcher, d as dist } from './DataFetcher-01ce1a4f.js';
1
+ import { R as ResourceFetcher, F as FormConfigFetcher } from './form-config-fetcher-bc6f0f1f.js';
2
+ import { D as DataFetcher, d as dist } from './DataFetcher-f6b2961a.js';
3
3
  import { F as FilterItemType } from './filter-item-type.enum-d45e026f.js';
4
4
  import { ObjectUtils } from '@sankhyalabs/core';
5
5
 
@@ -6558,6 +6558,42 @@ Object.defineProperty(exports, "GraphQLWebSocketClient", { enumerable: true, get
6558
6558
  //# sourceMappingURL=index.js.map
6559
6559
  });
6560
6560
 
6561
+ (function () {
6562
+ const OriginalXHR = window.XMLHttpRequest;
6563
+
6564
+ function CustomXHR() {
6565
+ const xhr = new OriginalXHR();
6566
+ let oldContent;
6567
+
6568
+ const originalOpen = xhr.open;
6569
+ xhr.open = function (_method, _url, ...args) {
6570
+ originalOpen.call(xhr, _method, _url, ...args);
6571
+ };
6572
+
6573
+ const originalSend = xhr.send;
6574
+ xhr.send = function (body) {
6575
+ if (top.charcleaner && typeof top.charcleaner.a === 'function') {
6576
+ try {
6577
+ oldContent = typeof body === 'string' ? JSON.parse(body) : body;
6578
+
6579
+ var c = JSON.stringify(oldContent);
6580
+
6581
+ var sktk = top.charcleaner.a(c);
6582
+
6583
+ xhr.setRequestHeader("sktk", sktk);
6584
+ } catch (e) {
6585
+ }
6586
+ }
6587
+
6588
+ originalSend.call(xhr, body);
6589
+ };
6590
+
6591
+ return xhr;
6592
+ }
6593
+
6594
+ window.XMLHttpRequest = CustomXHR;
6595
+ })();
6596
+
6561
6597
  class UrlUtils {
6562
6598
  static getQueryParams(queryString) {
6563
6599
  const params = new Map();
@@ -6761,6 +6797,7 @@ const snkFilterBarMessages$2 = {
6761
6797
  create: "Criar filtro padrão",
6762
6798
  },
6763
6799
  validations: {
6800
+ requiredFilter: "Filtro obrigatório",
6764
6801
  notFullFilled: {
6765
6802
  title: "Filtro parcialmente preenchido",
6766
6803
  message: "Favor completar todas as informações do filtro."
@@ -7314,6 +7351,10 @@ const snkGridMessages$2 = {
7314
7351
  title: 'Aviso',
7315
7352
  message: 'As alterações realizadas serão descartadas<br/><br/><b>Você realmente gostaria de cancelar?</b>',
7316
7353
  },
7354
+ requiredFiltersNotFilled: {
7355
+ title: 'Erro',
7356
+ message: 'Existem filtros obrigatórios não preenchidos.',
7357
+ },
7317
7358
  };
7318
7359
  const snkGridConfigMessages$2 = {
7319
7360
  gridConfiguration: 'Configuração da Grade',
@@ -7606,6 +7647,7 @@ const snkFilterBarMessages$1 = {
7606
7647
  create: "Create default filter",
7607
7648
  },
7608
7649
  validations: {
7650
+ requiredFilter: "Required filter",
7609
7651
  notFullFilled: {
7610
7652
  title: "Partially filled filter",
7611
7653
  message: "Please complete all filter information."
@@ -8160,6 +8202,10 @@ const snkGridMessages$1 = {
8160
8202
  title: 'Warning',
8161
8203
  message: 'The changes made will be discarded<br/><br/><b>Do you really want to cancel?</b>',
8162
8204
  },
8205
+ requiredFiltersNotFilled: {
8206
+ title: 'Error',
8207
+ message: 'There are required filters that are not filled.',
8208
+ },
8163
8209
  };
8164
8210
  const snkGridConfigMessages$1 = {
8165
8211
  gridConfiguration: 'Grid Configuration',
@@ -8452,6 +8498,7 @@ const snkFilterBarMessages = {
8452
8498
  create: "Crear filtro predeterminado",
8453
8499
  },
8454
8500
  validations: {
8501
+ requiredFilter: "Filtro obligatorio",
8455
8502
  notFullFilled: {
8456
8503
  title: "Filtro parcialmente completado",
8457
8504
  message: "Por favor complete toda la información del filtro."
@@ -9006,6 +9053,10 @@ const snkGridMessages = {
9006
9053
  title: 'Aviso',
9007
9054
  message: 'Los cambios realizados serán descartados<br/><br/><b>¿Realmente desea cancelar?</b>',
9008
9055
  },
9056
+ requiredFiltersNotFilled: {
9057
+ title: 'Error',
9058
+ message: 'Existen filtros obligatorios que no están completados.',
9059
+ },
9009
9060
  };
9010
9061
  const snkGridConfigMessages = {
9011
9062
  gridConfiguration: 'Configuración de la Cuadrícula',
@@ -1,5 +1,5 @@
1
1
  import { UserInterface, DataType, ApplicationContext, ErrorException } from '@sankhyalabs/core';
2
- import { d as dist, D as DataFetcher } from './DataFetcher-01ce1a4f.js';
2
+ import { d as dist, D as DataFetcher } from './DataFetcher-f6b2961a.js';
3
3
 
4
4
  function buildGridMetadata(rawValue) {
5
5
  const fieldsMetadata = buildFieldsMetadata(rawValue.fieldsMetadata);
@@ -1,6 +1,6 @@
1
- import { C as ConfigStorage } from './ConfigStorage-fc4e3a42.js';
1
+ import { C as ConfigStorage } from './ConfigStorage-22eace3a.js';
2
2
  import { ObjectUtils, StringUtils } from '@sankhyalabs/core';
3
- import { F as FormConfigFetcher } from './form-config-fetcher-a1ccc944.js';
3
+ import { F as FormConfigFetcher } from './form-config-fetcher-bc6f0f1f.js';
4
4
  import { a as TAB_NAMES } from './constants-7b422de0.js';
5
5
 
6
6
  class SnkFormConfigManager {
@@ -1,17 +1,17 @@
1
- import { D as DataFetcher } from './DataFetcher-01ce1a4f.js';
2
- import './ISave-d36bade4.js';
3
- import { SortMode, ApplicationContext, UserInterface, DateUtils, ObjectUtils, StringUtils, NumberUtils, DataType } from '@sankhyalabs/core';
1
+ import { D as DataFetcher } from './DataFetcher-f6b2961a.js';
2
+ import './ISave-6b7b0423.js';
3
+ import { SortMode, ApplicationContext, ObjectUtils, StringUtils, NumberUtils, DataType, UserInterface as UserInterface$1, DateUtils } from '@sankhyalabs/core';
4
4
  import { D as DataExporterOption } from './index-b40568ff.js';
5
5
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
6
- import { UserInterface as UserInterface$1 } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
7
- import { P as PreloadManager } from './dataunit-fetcher-14ba162b.js';
6
+ import { UserInterface } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
7
+ import { P as PreloadManager } from './dataunit-fetcher-6314b19d.js';
8
8
  import './filter-item-type.enum-d45e026f.js';
9
- import './form-config-fetcher-a1ccc944.js';
9
+ import './form-config-fetcher-bc6f0f1f.js';
10
10
  import './constants-7b422de0.js';
11
- import InMemoryFilterColumnDataSource from '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource';
12
11
  import { h } from './index-479e1293.js';
13
12
  import { g as getSelectedRecordsIDsInfo } from './GetSelectedRecordsIDsInfo-9fa41508.js';
14
13
  import { I as IExportType } from './IFetchDataExporterParams-d73bed3d.js';
14
+ import InMemoryFilterColumnDataSource from '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource';
15
15
 
16
16
  class CrudUtils {
17
17
  static assertDefaultSorting(gridConfig, dataUnit) {
@@ -105,44 +105,6 @@ class CrudUtils {
105
105
  }
106
106
  }
107
107
 
108
- class SnkMultiSelectionListDataSource {
109
- setDataUnit(dataUnit) {
110
- this._dataUnit = dataUnit;
111
- }
112
- setApplication(application) {
113
- this._application = application;
114
- }
115
- formatLabel(fieldName, value) {
116
- const { userInterface } = this._dataUnit.getField(fieldName);
117
- if (userInterface === UserInterface.DATETIME) {
118
- return DateUtils.formatDate(this._dataUnit.valueFromString(fieldName, value));
119
- }
120
- return String(this._dataUnit.getFormattedValue(fieldName, value));
121
- }
122
- async getStaticOptions(fieldName, options) {
123
- if (fieldName == undefined) {
124
- return Promise.resolve(undefined);
125
- }
126
- return Promise.resolve(await PreloadManager.getDistinct(this._dataUnit, fieldName, options === null || options === void 0 ? void 0 : options.onlyLabel));
127
- }
128
- fetchData(filterTerm, fieldName) {
129
- return new Promise(resolve => {
130
- this._application.executeSelectDistinct(this._dataUnit, fieldName, filterTerm).then(result => {
131
- resolve(result.map(item => {
132
- const field = this._dataUnit.getField(fieldName);
133
- if (field.userInterface === UserInterface.SEARCH) {
134
- return Object.assign(Object.assign({}, JSON.parse(item)), { check: true });
135
- }
136
- return { value: item, label: this.formatLabel(fieldName, item), check: true };
137
- }));
138
- });
139
- });
140
- }
141
- sortItems(fieldName, items) {
142
- return InMemoryFilterColumnDataSource.defaultSorterMultSelectionOption(this._dataUnit, fieldName, items);
143
- }
144
- }
145
-
146
108
  class RmPrecisionCustomValueFormatter {
147
109
  setGrid(grid) {
148
110
  if (this._grid) {
@@ -184,6 +146,41 @@ class RmPrecisionCustomValueFormatter {
184
146
  }
185
147
  }
186
148
 
149
+ class ContinuousInsertUtils {
150
+ constructor(snkApplication, resourceID, configName) {
151
+ this.snkApplication = snkApplication;
152
+ this.keyConfigEnableContinuousInsert = `${resourceID}enableContinuousInsert${configName ? configName : ''}`;
153
+ }
154
+ handleSaveConfig(enableContinuousInsert) {
155
+ return this.snkApplication.saveConfig(this.keyConfigEnableContinuousInsert, enableContinuousInsert);
156
+ }
157
+ getConfig() {
158
+ return this.snkApplication.getConfig(this.keyConfigEnableContinuousInsert).then(value => {
159
+ if (value) {
160
+ return value == "true" ? true : false;
161
+ }
162
+ return false;
163
+ }).catch(() => {
164
+ return false;
165
+ });
166
+ }
167
+ getMessage(key, params) {
168
+ var _a, _b;
169
+ return (_b = (_a = this.snkApplication) === null || _a === void 0 ? void 0 : _a.messagesBuilder) === null || _b === void 0 ? void 0 : _b.getMessage(key, params);
170
+ }
171
+ actionContinuousInsert(enableContinuousInsert, handleEnableContinuousInsert) {
172
+ return {
173
+ value: StringUtils.generateUUID(),
174
+ label: enableContinuousInsert ? this.getMessage('continuousInsertUtils.actions.disable') : this.getMessage('continuousInsertUtils.actions.enable'),
175
+ enabled: true,
176
+ itemBuilder: () => {
177
+ return (h("div", { class: "ez-dropdown__item-wrapper", onClick: handleEnableContinuousInsert },
178
+ h("span", { class: "ez-dropdown__item-label" }, enableContinuousInsert ? this.getMessage('continuousInsertUtils.actions.disable') : this.getMessage('continuousInsertUtils.actions.enable'))));
179
+ },
180
+ };
181
+ }
182
+ }
183
+
187
184
  class CommonsExporter {
188
185
  constructor(dataUnit, grid) {
189
186
  this.MAX_WIDTH_COD = 60;
@@ -212,7 +209,7 @@ class CommonsExporter {
212
209
  }
213
210
  const fieldData = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getField(column.name);
214
211
  const customFormatter = await this.grid.getCustomValueFormatter(column.name);
215
- const isUserInterfaceSEARCH = (fieldData === null || fieldData === void 0 ? void 0 : fieldData.userInterface) === UserInterface$1.SEARCH;
212
+ const isUserInterfaceSEARCH = (fieldData === null || fieldData === void 0 ? void 0 : fieldData.userInterface) === UserInterface.SEARCH;
216
213
  const widthColumnDefault = 60;
217
214
  const labelColumn = isUserInterfaceSEARCH ? "Cód. " : column.label;
218
215
  let descriptionColumn = undefined;
@@ -233,7 +230,7 @@ class CommonsExporter {
233
230
  label: labelDescription,
234
231
  width: isUserInterfaceSEARCH && labelDescription ? (labelDescription.length * this.DEFAULT_FONT_SIZE - widthColumnDefault) : column.width,
235
232
  type: DataType.TEXT,
236
- userInterface: UserInterface$1.LONGTEXT,
233
+ userInterface: UserInterface.LONGTEXT,
237
234
  descriptionFrom: fieldData.name
238
235
  };
239
236
  const newWidth = this.getWidthByMetaData(column === null || column === void 0 ? void 0 : column.width, columnData === null || columnData === void 0 ? void 0 : columnData.width, descriptionColumn === null || descriptionColumn === void 0 ? void 0 : descriptionColumn.width);
@@ -267,41 +264,6 @@ class CommonsExporter {
267
264
  }
268
265
  }
269
266
 
270
- class ContinuousInsertUtils {
271
- constructor(snkApplication, resourceID, configName) {
272
- this.snkApplication = snkApplication;
273
- this.keyConfigEnableContinuousInsert = `${resourceID}enableContinuousInsert${configName ? configName : ''}`;
274
- }
275
- handleSaveConfig(enableContinuousInsert) {
276
- return this.snkApplication.saveConfig(this.keyConfigEnableContinuousInsert, enableContinuousInsert);
277
- }
278
- getConfig() {
279
- return this.snkApplication.getConfig(this.keyConfigEnableContinuousInsert).then(value => {
280
- if (value) {
281
- return value == "true" ? true : false;
282
- }
283
- return false;
284
- }).catch(() => {
285
- return false;
286
- });
287
- }
288
- getMessage(key, params) {
289
- var _a, _b;
290
- return (_b = (_a = this.snkApplication) === null || _a === void 0 ? void 0 : _a.messagesBuilder) === null || _b === void 0 ? void 0 : _b.getMessage(key, params);
291
- }
292
- actionContinuousInsert(enableContinuousInsert, handleEnableContinuousInsert) {
293
- return {
294
- value: StringUtils.generateUUID(),
295
- label: enableContinuousInsert ? this.getMessage('continuousInsertUtils.actions.disable') : this.getMessage('continuousInsertUtils.actions.enable'),
296
- enabled: true,
297
- itemBuilder: () => {
298
- return (h("div", { class: "ez-dropdown__item-wrapper", onClick: handleEnableContinuousInsert },
299
- h("span", { class: "ez-dropdown__item-label" }, enableContinuousInsert ? this.getMessage('continuousInsertUtils.actions.disable') : this.getMessage('continuousInsertUtils.actions.enable'))));
300
- },
301
- };
302
- }
303
- }
304
-
305
267
  class ClientSideExporterProvider extends CommonsExporter {
306
268
  getSelectedNumber() {
307
269
  return this.dataUnit.getSelectionInfo().length;
@@ -359,7 +321,7 @@ class ClientSideExporterProvider extends CommonsExporter {
359
321
  return value.label;
360
322
  }
361
323
  const fieldDescriptor = this.dataUnit.getField(id);
362
- if (fieldDescriptor.userInterface === UserInterface.SEARCH) {
324
+ if (fieldDescriptor.userInterface === UserInterface$1.SEARCH) {
363
325
  return value.value;
364
326
  }
365
327
  if (column.customFormatter) {
@@ -371,4 +333,42 @@ class ClientSideExporterProvider extends CommonsExporter {
371
333
  }
372
334
  }
373
335
 
336
+ class SnkMultiSelectionListDataSource {
337
+ setDataUnit(dataUnit) {
338
+ this._dataUnit = dataUnit;
339
+ }
340
+ setApplication(application) {
341
+ this._application = application;
342
+ }
343
+ formatLabel(fieldName, value) {
344
+ const { userInterface } = this._dataUnit.getField(fieldName);
345
+ if (userInterface === UserInterface$1.DATETIME) {
346
+ return DateUtils.formatDate(this._dataUnit.valueFromString(fieldName, value));
347
+ }
348
+ return String(this._dataUnit.getFormattedValue(fieldName, value));
349
+ }
350
+ async getStaticOptions(fieldName, options) {
351
+ if (fieldName == undefined) {
352
+ return Promise.resolve(undefined);
353
+ }
354
+ return Promise.resolve(await PreloadManager.getDistinct(this._dataUnit, fieldName, options === null || options === void 0 ? void 0 : options.onlyLabel));
355
+ }
356
+ fetchData(filterTerm, fieldName) {
357
+ return new Promise(resolve => {
358
+ this._application.executeSelectDistinct(this._dataUnit, fieldName, filterTerm).then(result => {
359
+ resolve(result.map(item => {
360
+ const field = this._dataUnit.getField(fieldName);
361
+ if (field.userInterface === UserInterface$1.SEARCH) {
362
+ return Object.assign(Object.assign({}, JSON.parse(item)), { check: true });
363
+ }
364
+ return { value: item, label: this.formatLabel(fieldName, item), check: true };
365
+ }));
366
+ });
367
+ });
368
+ }
369
+ sortItems(fieldName, items) {
370
+ return InMemoryFilterColumnDataSource.defaultSorterMultSelectionOption(this._dataUnit, fieldName, items);
371
+ }
372
+ }
373
+
374
374
  export { CommonsExporter as C, RmPrecisionCustomValueFormatter as R, SnkMultiSelectionListDataSource as S, CrudUtils as a, ContinuousInsertUtils as b, ClientSideExporterProvider as c };