@sankhyalabs/sankhyablocks 6.0.6 → 6.0.7

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 (184) hide show
  1. package/dist/cjs/{index-59a3e2de.js → index-102ba62d.js} +1 -1
  2. package/dist/cjs/{index-aaaa2af5.js → index-f9e81701.js} +5 -0
  3. package/dist/cjs/loader.cjs.js +2 -2
  4. package/dist/cjs/sankhyablocks.cjs.js +2 -2
  5. package/dist/cjs/snk-actions-button.cjs.entry.js +1 -1
  6. package/dist/cjs/snk-actions-form.cjs.entry.js +1 -1
  7. package/dist/cjs/snk-application.cjs.entry.js +1 -1
  8. package/dist/cjs/snk-attach.cjs.entry.js +3 -3
  9. package/dist/cjs/snk-client-confirm.cjs.entry.js +1 -1
  10. package/dist/cjs/snk-config-options.cjs.entry.js +1 -1
  11. package/dist/cjs/snk-configurator.cjs.entry.js +1 -1
  12. package/dist/cjs/snk-crud.cjs.entry.js +3 -3
  13. package/dist/cjs/snk-data-exporter.cjs.entry.js +2 -2
  14. package/dist/cjs/{snk-data-unit-53fc9200.js → snk-data-unit-ee7f37a4.js} +1 -1
  15. package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
  16. package/dist/cjs/snk-detail-view.cjs.entry.js +5 -5
  17. package/dist/cjs/snk-entity-list.cjs.entry.js +1 -1
  18. package/dist/cjs/snk-exporter-email-sender.cjs.entry.js +1 -1
  19. package/dist/cjs/snk-expression-group.cjs.entry.js +1 -1
  20. package/dist/cjs/snk-expression-item_3.cjs.entry.js +2 -2
  21. package/dist/cjs/snk-field-config.cjs.entry.js +1 -1
  22. package/dist/cjs/snk-filter-bar.cjs.entry.js +11 -5
  23. package/dist/cjs/snk-filter-binary-select.cjs.entry.js +17 -2
  24. package/dist/cjs/snk-filter-detail.cjs.entry.js +21 -6
  25. package/dist/cjs/snk-filter-item.cjs.entry.js +21 -6
  26. package/dist/cjs/snk-filter-list.cjs.entry.js +1 -1
  27. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +2 -2
  28. package/dist/cjs/snk-filter-modal.cjs.entry.js +25 -5
  29. package/dist/cjs/snk-filter-multi-select.cjs.entry.js +1 -1
  30. package/dist/cjs/snk-filter-number.cjs.entry.js +1 -1
  31. package/dist/cjs/snk-filter-period.cjs.entry.js +1 -1
  32. package/dist/cjs/snk-filter-personalized.cjs.entry.js +1 -1
  33. package/dist/cjs/snk-filter-search.cjs.entry.js +1 -1
  34. package/dist/cjs/snk-filter-text.cjs.entry.js +1 -1
  35. package/dist/cjs/snk-form-config.cjs.entry.js +1 -1
  36. package/dist/cjs/snk-form-summary.cjs.entry.js +1 -1
  37. package/dist/cjs/snk-form-view.cjs.entry.js +1 -1
  38. package/dist/cjs/snk-form.cjs.entry.js +1 -1
  39. package/dist/cjs/snk-grid-config.cjs.entry.js +1 -1
  40. package/dist/cjs/snk-grid.cjs.entry.js +4 -4
  41. package/dist/cjs/{snk-guides-viewer-42bc7dcc.js → snk-guides-viewer-597756fe.js} +3 -3
  42. package/dist/cjs/snk-guides-viewer.cjs.entry.js +5 -5
  43. package/dist/cjs/snk-personalized-filter.cjs.entry.js +2 -2
  44. package/dist/cjs/snk-pesquisa.cjs.entry.js +1 -1
  45. package/dist/cjs/snk-select-box.cjs.entry.js +1 -1
  46. package/dist/cjs/snk-simple-bar.cjs.entry.js +1 -1
  47. package/dist/cjs/snk-simple-crud.cjs.entry.js +4 -4
  48. package/dist/cjs/snk-tab-config.cjs.entry.js +1 -1
  49. package/dist/cjs/snk-taskbar.cjs.entry.js +3 -3
  50. package/dist/cjs/{taskbar-elements-068aa945.js → taskbar-elements-7f91f4cd.js} +2 -2
  51. package/dist/cjs/{taskbar-processor-6442c585.js → taskbar-processor-8f075fa1.js} +1 -1
  52. package/dist/cjs/teste-pesquisa.cjs.entry.js +1 -1
  53. package/dist/collection/components/snk-filter-bar/filter-item/dataunitfilter/data-unit-filter-builder.js +6 -0
  54. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.js +39 -1
  55. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +20 -5
  56. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +20 -5
  57. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +24 -4
  58. package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js +2 -2
  59. package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +14 -0
  60. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +3 -3
  61. package/dist/components/snk-filter-bar2.js +10 -4
  62. package/dist/components/snk-filter-binary-select.js +18 -2
  63. package/dist/components/snk-filter-detail2.js +20 -5
  64. package/dist/components/snk-filter-item2.js +20 -5
  65. package/dist/components/snk-filter-modal-item2.js +1 -1
  66. package/dist/components/snk-filter-modal.js +24 -4
  67. package/dist/esm/{index-8c3d76a6.js → index-a7d3d3f1.js} +5 -0
  68. package/dist/esm/{index-d60ca0ac.js → index-bdf75557.js} +1 -1
  69. package/dist/esm/loader.js +3 -3
  70. package/dist/esm/sankhyablocks.js +3 -3
  71. package/dist/esm/snk-actions-button.entry.js +1 -1
  72. package/dist/esm/snk-actions-form.entry.js +1 -1
  73. package/dist/esm/snk-application.entry.js +1 -1
  74. package/dist/esm/snk-attach.entry.js +3 -3
  75. package/dist/esm/snk-client-confirm.entry.js +1 -1
  76. package/dist/esm/snk-config-options.entry.js +1 -1
  77. package/dist/esm/snk-configurator.entry.js +1 -1
  78. package/dist/esm/snk-crud.entry.js +3 -3
  79. package/dist/esm/snk-data-exporter.entry.js +2 -2
  80. package/dist/esm/{snk-data-unit-97824457.js → snk-data-unit-0cee56d5.js} +1 -1
  81. package/dist/esm/snk-data-unit.entry.js +2 -2
  82. package/dist/esm/snk-detail-view.entry.js +5 -5
  83. package/dist/esm/snk-entity-list.entry.js +1 -1
  84. package/dist/esm/snk-exporter-email-sender.entry.js +1 -1
  85. package/dist/esm/snk-expression-group.entry.js +1 -1
  86. package/dist/esm/snk-expression-item_3.entry.js +2 -2
  87. package/dist/esm/snk-field-config.entry.js +1 -1
  88. package/dist/esm/snk-filter-bar.entry.js +11 -5
  89. package/dist/esm/snk-filter-binary-select.entry.js +17 -2
  90. package/dist/esm/snk-filter-detail.entry.js +21 -6
  91. package/dist/esm/snk-filter-item.entry.js +21 -6
  92. package/dist/esm/snk-filter-list.entry.js +1 -1
  93. package/dist/esm/snk-filter-modal-item.entry.js +2 -2
  94. package/dist/esm/snk-filter-modal.entry.js +25 -5
  95. package/dist/esm/snk-filter-multi-select.entry.js +1 -1
  96. package/dist/esm/snk-filter-number.entry.js +1 -1
  97. package/dist/esm/snk-filter-period.entry.js +1 -1
  98. package/dist/esm/snk-filter-personalized.entry.js +1 -1
  99. package/dist/esm/snk-filter-search.entry.js +1 -1
  100. package/dist/esm/snk-filter-text.entry.js +1 -1
  101. package/dist/esm/snk-form-config.entry.js +1 -1
  102. package/dist/esm/snk-form-summary.entry.js +1 -1
  103. package/dist/esm/snk-form-view.entry.js +1 -1
  104. package/dist/esm/snk-form.entry.js +1 -1
  105. package/dist/esm/snk-grid-config.entry.js +1 -1
  106. package/dist/esm/snk-grid.entry.js +4 -4
  107. package/dist/esm/{snk-guides-viewer-cc812f72.js → snk-guides-viewer-79b916a2.js} +3 -3
  108. package/dist/esm/snk-guides-viewer.entry.js +5 -5
  109. package/dist/esm/snk-personalized-filter.entry.js +2 -2
  110. package/dist/esm/snk-pesquisa.entry.js +1 -1
  111. package/dist/esm/snk-select-box.entry.js +1 -1
  112. package/dist/esm/snk-simple-bar.entry.js +1 -1
  113. package/dist/esm/snk-simple-crud.entry.js +4 -4
  114. package/dist/esm/snk-tab-config.entry.js +1 -1
  115. package/dist/esm/snk-taskbar.entry.js +3 -3
  116. package/dist/esm/{taskbar-elements-26d0fba3.js → taskbar-elements-139b1058.js} +2 -2
  117. package/dist/esm/{taskbar-processor-dfef41a8.js → taskbar-processor-db6d14c2.js} +1 -1
  118. package/dist/esm/teste-pesquisa.entry.js +1 -1
  119. package/dist/sankhyablocks/{p-fc512cbe.entry.js → p-01c94bf0.entry.js} +1 -1
  120. package/dist/sankhyablocks/p-0364abc8.entry.js +1 -0
  121. package/dist/sankhyablocks/{p-00d1cac4.entry.js → p-0d670404.entry.js} +1 -1
  122. package/dist/sankhyablocks/{p-b940798f.entry.js → p-118e769b.entry.js} +1 -1
  123. package/dist/sankhyablocks/{p-01cd58b6.entry.js → p-12ddc836.entry.js} +1 -1
  124. package/dist/sankhyablocks/p-18e3a2b7.entry.js +1 -0
  125. package/dist/sankhyablocks/{p-e824aef2.entry.js → p-219f888d.entry.js} +1 -1
  126. package/dist/sankhyablocks/{p-49d628d1.entry.js → p-247a8b36.entry.js} +1 -1
  127. package/dist/sankhyablocks/{p-8ccb7b05.entry.js → p-257e3eaf.entry.js} +1 -1
  128. package/dist/sankhyablocks/{p-7a5e1be7.entry.js → p-26b0ce3e.entry.js} +1 -1
  129. package/dist/sankhyablocks/{p-c17e19a2.entry.js → p-2adb4481.entry.js} +1 -1
  130. package/dist/sankhyablocks/{p-50db4bc4.entry.js → p-33fa83b0.entry.js} +1 -1
  131. package/dist/sankhyablocks/{p-b7efc49a.entry.js → p-4374cc15.entry.js} +1 -1
  132. package/dist/sankhyablocks/{p-d5145c3f.entry.js → p-50c3700f.entry.js} +1 -1
  133. package/dist/sankhyablocks/{p-93935de5.entry.js → p-5cc17d75.entry.js} +1 -1
  134. package/dist/sankhyablocks/{p-590d8900.js → p-6dc031de.js} +1 -1
  135. package/dist/sankhyablocks/{p-87b1e966.js → p-7750112a.js} +1 -1
  136. package/dist/sankhyablocks/p-7abb948f.entry.js +1 -0
  137. package/dist/sankhyablocks/{p-6bfa008e.entry.js → p-838f8234.entry.js} +1 -1
  138. package/dist/sankhyablocks/{p-cf90a195.entry.js → p-88aa931b.entry.js} +1 -1
  139. package/dist/sankhyablocks/{p-a8b06801.entry.js → p-9531fd46.entry.js} +1 -1
  140. package/dist/sankhyablocks/{p-847b9506.entry.js → p-959e0835.entry.js} +1 -1
  141. package/dist/sankhyablocks/{p-718cc24b.entry.js → p-96a89d58.entry.js} +1 -1
  142. package/dist/sankhyablocks/{p-9f844aa6.entry.js → p-9c853418.entry.js} +1 -1
  143. package/dist/sankhyablocks/{p-ebb8de34.entry.js → p-a149ccee.entry.js} +1 -1
  144. package/dist/sankhyablocks/{p-5427566a.entry.js → p-a1e1b305.entry.js} +1 -1
  145. package/dist/sankhyablocks/p-abc4ae66.entry.js +1 -0
  146. package/dist/sankhyablocks/{p-a655ea15.entry.js → p-ac8d1cd6.entry.js} +1 -1
  147. package/dist/sankhyablocks/{p-c6b9a617.entry.js → p-ad69e220.entry.js} +1 -1
  148. package/dist/sankhyablocks/{p-c0c4a305.entry.js → p-befbc9ee.entry.js} +1 -1
  149. package/dist/sankhyablocks/p-c0cded7d.entry.js +1 -0
  150. package/dist/sankhyablocks/p-c651abc7.js +1 -0
  151. package/dist/sankhyablocks/{p-fced1d89.entry.js → p-cb37982f.entry.js} +1 -1
  152. package/dist/sankhyablocks/{p-708ee8ee.js → p-cd0e4f0d.js} +1 -1
  153. package/dist/sankhyablocks/{p-5a612ab1.entry.js → p-cdbaf62d.entry.js} +1 -1
  154. package/dist/sankhyablocks/{p-04611c09.entry.js → p-cea58f8b.entry.js} +1 -1
  155. package/dist/sankhyablocks/{p-066ee142.js → p-d2d301a6.js} +1 -1
  156. package/dist/sankhyablocks/{p-1a5d1f61.entry.js → p-d2f7dbd8.entry.js} +1 -1
  157. package/dist/sankhyablocks/{p-c772178d.entry.js → p-d3ec3586.entry.js} +1 -1
  158. package/dist/sankhyablocks/{p-6d4169fc.entry.js → p-de69b4b0.entry.js} +1 -1
  159. package/dist/sankhyablocks/{p-253a0498.entry.js → p-e20bf314.entry.js} +1 -1
  160. package/dist/sankhyablocks/{p-67a19b48.entry.js → p-e3a82e1c.entry.js} +1 -1
  161. package/dist/sankhyablocks/p-e962ce72.entry.js +1 -0
  162. package/dist/sankhyablocks/p-eb636e15.entry.js +1 -0
  163. package/dist/sankhyablocks/{p-a49af638.entry.js → p-f07f2c6f.entry.js} +1 -1
  164. package/dist/sankhyablocks/{p-69770075.js → p-f1edaec0.js} +1 -1
  165. package/dist/sankhyablocks/{p-10e0346a.entry.js → p-f30526a7.entry.js} +1 -1
  166. package/dist/sankhyablocks/{p-8d541539.entry.js → p-f827514f.entry.js} +1 -1
  167. package/dist/sankhyablocks/{p-4e5d1ae3.entry.js → p-f8c2efc5.entry.js} +1 -1
  168. package/dist/sankhyablocks/{p-eb24c092.entry.js → p-fe49067d.entry.js} +1 -1
  169. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  170. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.d.ts +7 -0
  171. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +3 -0
  172. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +2 -0
  173. package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +1 -0
  174. package/dist/types/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.d.ts +1 -1
  175. package/dist/types/components.d.ts +4 -0
  176. package/package.json +3 -3
  177. package/dist/sankhyablocks/p-09a058ba.entry.js +0 -1
  178. package/dist/sankhyablocks/p-18b34bb4.js +0 -1
  179. package/dist/sankhyablocks/p-34cd4b39.entry.js +0 -1
  180. package/dist/sankhyablocks/p-372e0185.entry.js +0 -1
  181. package/dist/sankhyablocks/p-6c6e936c.entry.js +0 -1
  182. package/dist/sankhyablocks/p-710d9b6f.entry.js +0 -1
  183. package/dist/sankhyablocks/p-bdd61fa8.entry.js +0 -1
  184. package/dist/sankhyablocks/p-fb22ed2d.entry.js +0 -1
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-8c3d76a6.js';
1
+ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
2
2
  import { FloatingManager, DateUtils, ElementIDUtils } from '@sankhyalabs/core';
3
3
  import { F as FilterItemType } from './filter-item-type.enum-5028ed3f.js';
4
4
 
@@ -68,6 +68,17 @@ const SnkFilterItem = class {
68
68
  window.removeEventListener("scroll", this.updatePosition.bind(this));
69
69
  window.addEventListener("scroll", this.updatePosition.bind(this));
70
70
  }
71
+ getConfigChanges() {
72
+ var _a;
73
+ const configToBeCleared = this.config;
74
+ if (!!((_a = configToBeCleared.groupedItems) === null || _a === void 0 ? void 0 : _a.length)) {
75
+ configToBeCleared.visible = false;
76
+ configToBeCleared.groupedItems = configToBeCleared.groupedItems.map(item => (Object.assign(Object.assign({}, item), { visible: false })));
77
+ }
78
+ const hasMultiValues = configToBeCleared.type === FilterItemType.MULTI_LIST && Array.isArray(configToBeCleared.value);
79
+ const newValue = hasMultiValues ? configToBeCleared.value.map((valueItem) => (Object.assign(Object.assign({}, valueItem), { check: false }))) : undefined;
80
+ return Object.assign(Object.assign({}, configToBeCleared), { value: newValue });
81
+ }
71
82
  /**
72
83
  * Oculta os detalhes de um item da lista.
73
84
  */
@@ -91,8 +102,9 @@ const SnkFilterItem = class {
91
102
  //---------------------------------------------
92
103
  clickListener(evt) {
93
104
  if ([this._chipElement, this._leftIconElement, this._rightIconElement].includes(evt.target)) {
94
- if (evt.target === this._rightIconElement && this.config.value != undefined) {
95
- this.filterChange.emit(Object.assign(Object.assign({}, this.config), { value: undefined }));
105
+ if (evt.target === this._rightIconElement && this.canClearFilter()) {
106
+ const configChanged = this.getConfigChanges();
107
+ this.filterChange.emit(configChanged);
96
108
  }
97
109
  else {
98
110
  if (this.detailIsVisible) {
@@ -227,10 +239,13 @@ const SnkFilterItem = class {
227
239
  filterChangeListener() {
228
240
  this.hideDetail();
229
241
  }
242
+ canClearFilter() {
243
+ const { value, groupedItems = [] } = this.config;
244
+ return value !== undefined || groupedItems.some(item => item.visible);
245
+ }
230
246
  getRightIconName() {
231
- if (this.config.value != undefined) {
247
+ if (this.canClearFilter())
232
248
  return "close";
233
- }
234
249
  return this.detailIsVisible ? "chevron-up" : "chevron-down";
235
250
  }
236
251
  getLeftIconName() {
@@ -252,7 +267,7 @@ const SnkFilterItem = class {
252
267
  }
253
268
  render() {
254
269
  const leftIcon = this.getLeftIconName();
255
- return (h(Host, Object.assign({}, this.applyTooltip()), h("ez-chip", { id: this.config.id, ref: ref => this._chipElement = ref, label: this.getLabel(), value: this.getEnabledChip() }, leftIcon ? h("ez-icon", { ref: ref => this._leftIconElement = ref, iconName: leftIcon, class: "ez-padding-right--small", slot: "leftIcon" }) : undefined, h("ez-icon", { ref: ref => this._rightIconElement = ref, iconName: this.getRightIconName(), class: "ez-padding-left--small", slot: "rightIcon", id: "removeFilter" })), h("section", { class: "ez-margin-top--small sc-snk-filter-bar snk-filter__popover-container", ref: elem => this._popoverContainer = elem }, h("snk-filter-detail", { config: this.config, getMessage: this.getMessage, class: "sc-snk-filter-bar snk-filter__popover ez-padding--small", ref: elem => this._popover = elem, key: this.config.id, "data-element-id": this._idSnkFilterDetail }))));
270
+ return (h(Host, null, h("ez-chip", Object.assign({ id: this.config.id, ref: ref => this._chipElement = ref, label: this.getLabel(), value: this.getEnabledChip(), showNativeTooltip: false }, this.applyTooltip()), leftIcon ? h("ez-icon", { ref: ref => this._leftIconElement = ref, iconName: leftIcon, class: "ez-padding-right--small", slot: "leftIcon" }) : undefined, h("ez-icon", { ref: ref => this._rightIconElement = ref, iconName: this.getRightIconName(), class: "ez-padding-left--small", slot: "rightIcon", id: "removeFilter" })), h("section", { class: "ez-margin-top--small sc-snk-filter-bar snk-filter__popover-container", ref: elem => this._popoverContainer = elem }, h("snk-filter-detail", { config: this.config, getMessage: this.getMessage, class: "sc-snk-filter-bar snk-filter__popover ez-padding--small", ref: elem => this._popover = elem, key: this.config.id, "data-element-id": this._idSnkFilterDetail }))));
256
271
  }
257
272
  get _filterItemElement() { return getElement(this); }
258
273
  static get watchers() { return {
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-8c3d76a6.js';
1
+ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
2
2
  import { FloatingManager, ElementIDUtils, ArrayUtils } from '@sankhyalabs/core';
3
3
 
4
4
  const SHOW_MORE_ITEM_NAME = "__SHOWMORE__";
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-8c3d76a6.js';
1
+ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
2
2
  import { ElementIDUtils, ApplicationContext, ObjectUtils } from '@sankhyalabs/core';
3
3
  import { F as FilterItemType } from './filter-item-type.enum-5028ed3f.js';
4
4
  import { E as EPresentationMode } from './presentationMode-783bbf9d.js';
@@ -65,7 +65,7 @@ const SnkFilterModalItem = class {
65
65
  this.filterItem = Object.assign(Object.assign({}, this.filterItem), { visible: newValue > 0, value: newValue, groupedItems: data.items });
66
66
  }
67
67
  else {
68
- this.filterItem = Object.assign(Object.assign({}, this.filterItem), { value: newValue, visible: this.isVisible(newValue) });
68
+ this.filterItem = Object.assign(Object.assign({}, this.filterItem), { value: this.filterItem.type === FilterItemType.SEARCH ? data : newValue, visible: this.isVisible(newValue) });
69
69
  }
70
70
  this.saveConfig();
71
71
  }
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h } from './index-8c3d76a6.js';
1
+ import { r as registerInstance, h } from './index-a7d3d3f1.js';
2
2
  import { ModalAction } from '@sankhyalabs/ezui/dist/collection/components/ez-modal-container';
3
3
  import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
4
4
  import { F as FilterType } from './filter-type.enum-a80c1b6b.js';
@@ -26,12 +26,32 @@ const SnkFilterModal = class {
26
26
  }
27
27
  //TODO: tratar clear all dos filtros personalizados
28
28
  handleClearAll() {
29
- const quickFilters = this.filters.filter(filter => filter.filterType === FilterType.QUICK_FILTER);
30
- const customFilters = this.filters.filter(filter => filter.filterType === FilterType.CUSTOM_FILTER);
31
- const otherFilters = this.filters.filter(filter => filter.filterType === FilterType.OTHER_FILTERS);
29
+ const { customFilters, quickFilters, otherFilters, multiListFilters } = this.filters.reduce((acc, filter) => {
30
+ if (filter.type === FilterItemType.MULTI_LIST) {
31
+ acc.multiListFilters.push(filter);
32
+ return acc;
33
+ }
34
+ if (filter.filterType === FilterType.QUICK_FILTER) {
35
+ acc.quickFilters.push(filter);
36
+ return acc;
37
+ }
38
+ if (filter.filterType === FilterType.CUSTOM_FILTER) {
39
+ acc.customFilters.push(filter);
40
+ return acc;
41
+ }
42
+ if (filter.filterType === FilterType.OTHER_FILTERS) {
43
+ acc.otherFilters.push(filter);
44
+ return acc;
45
+ }
46
+ return acc;
47
+ }, { quickFilters: [], customFilters: [], otherFilters: [], multiListFilters: [] });
32
48
  this.handleClearFilterList(quickFilters);
33
49
  this.handleClearCustomFilters(customFilters);
34
- otherFilters.forEach(this.handleClearSigleFilter.bind(this));
50
+ this.handleClearOthersFilters(otherFilters);
51
+ multiListFilters.forEach(multiListFilter => this.handleClearSigleFilter(multiListFilter));
52
+ }
53
+ handleClearOthersFilters(otherFilters) {
54
+ this.filters = this.filters.map(filter => otherFilters.includes(filter) ? (Object.assign(Object.assign({}, filter), { value: undefined })) : filter);
35
55
  }
36
56
  handleClearCustomFilters(customFilters) {
37
57
  this.filters.forEach((filter, index) => {
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h, g as getElement } from './index-8c3d76a6.js';
1
+ import { r as registerInstance, c as createEvent, h, g as getElement } from './index-a7d3d3f1.js';
2
2
  import { ElementIDUtils } from '@sankhyalabs/core';
3
3
  import { F as FilterItemType } from './filter-item-type.enum-5028ed3f.js';
4
4
 
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h, g as getElement } from './index-8c3d76a6.js';
1
+ import { r as registerInstance, c as createEvent, h, g as getElement } from './index-a7d3d3f1.js';
2
2
  import { ElementIDUtils } from '@sankhyalabs/core';
3
3
  import { F as FilterItemType } from './filter-item-type.enum-5028ed3f.js';
4
4
 
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h, g as getElement } from './index-8c3d76a6.js';
1
+ import { r as registerInstance, c as createEvent, h, g as getElement } from './index-a7d3d3f1.js';
2
2
  import { ElementIDUtils } from '@sankhyalabs/core';
3
3
  import { F as FilterItemType } from './filter-item-type.enum-5028ed3f.js';
4
4
  import { E as EPresentationMode } from './presentationMode-783bbf9d.js';
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host, g as getElement } from './index-8c3d76a6.js';
1
+ import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host, g as getElement } from './index-a7d3d3f1.js';
2
2
  import { ElementIDUtils, UserInterface, ApplicationContext } from '@sankhyalabs/core';
3
3
  import { F as FilterItemType } from './filter-item-type.enum-5028ed3f.js';
4
4
  import { E as EPresentationMode } from './presentationMode-783bbf9d.js';
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h, g as getElement } from './index-8c3d76a6.js';
1
+ import { r as registerInstance, c as createEvent, h, g as getElement } from './index-a7d3d3f1.js';
2
2
  import { ElementIDUtils, ApplicationContext } from '@sankhyalabs/core';
3
3
  import { F as FilterItemType } from './filter-item-type.enum-5028ed3f.js';
4
4
 
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h, g as getElement } from './index-8c3d76a6.js';
1
+ import { r as registerInstance, c as createEvent, h, g as getElement } from './index-a7d3d3f1.js';
2
2
  import { ElementIDUtils } from '@sankhyalabs/core';
3
3
 
4
4
  const SnkFilterText = class {
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-8c3d76a6.js';
1
+ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
2
2
  import { d as draggable_bundle } from './draggable.bundle-41d56f06.js';
3
3
  import { ObjectUtils, ElementIDUtils, ArrayUtils, ApplicationContext } from '@sankhyalabs/core';
4
4
  import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h, H as Host, g as getElement } from './index-8c3d76a6.js';
1
+ import { r as registerInstance, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
2
2
  import { ElementIDUtils } from '@sankhyalabs/core';
3
3
 
4
4
  const BOUNDARY_FALSE_POSITIVE_VALUE = 14;
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host } from './index-8c3d76a6.js';
1
+ import { r as registerInstance, c as createEvent, h, H as Host } from './index-a7d3d3f1.js';
2
2
  import { ElementIDUtils } from '@sankhyalabs/core';
3
3
  import { DataBinder } from '@sankhyalabs/ezui/dist/collection/utils/form';
4
4
 
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h, g as getElement } from './index-8c3d76a6.js';
1
+ import { r as registerInstance, c as createEvent, h, g as getElement } from './index-a7d3d3f1.js';
2
2
  import { ElementIDUtils } from '@sankhyalabs/core';
3
3
  import { S as SnkFormConfigManager } from './SnkFormConfigManager-def999fe.js';
4
4
  import './ConfigStorage-9f4d2e67.js';
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-8c3d76a6.js';
1
+ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
2
2
  import { StringUtils, ElementIDUtils } from '@sankhyalabs/core';
3
3
  import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
4
4
  import { CheckMode } from '@sankhyalabs/ezui/dist/collection/components/ez-check/CheckMode';
@@ -1,11 +1,11 @@
1
- import { r as registerInstance, c as createEvent, h, g as getElement } from './index-8c3d76a6.js';
1
+ import { r as registerInstance, c as createEvent, h, g as getElement } from './index-a7d3d3f1.js';
2
2
  import { UserInterface, DateUtils, ElementIDUtils, ApplicationContext, DataType } from '@sankhyalabs/core';
3
3
  import { UserInterface as UserInterface$1 } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
4
- import { T as TaskbarElement } from './taskbar-elements-26d0fba3.js';
4
+ import { T as TaskbarElement } from './taskbar-elements-139b1058.js';
5
5
  import { C as ConfigStorage } from './ConfigStorage-9f4d2e67.js';
6
6
  import { P as PresentationMode } from './index-a255b326.js';
7
- import { T as TaskbarProcessor } from './taskbar-processor-dfef41a8.js';
8
- import { s as store } from './index-d60ca0ac.js';
7
+ import { T as TaskbarProcessor } from './taskbar-processor-db6d14c2.js';
8
+ import { s as store } from './index-bdf75557.js';
9
9
  import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
10
10
  import './form-config-fetcher-cac8cd96.js';
11
11
  import './DataFetcher-b3d8b2d5.js';
@@ -1,9 +1,9 @@
1
- import { r as registerInstance, c as createEvent, h, F as Fragment } from './index-8c3d76a6.js';
1
+ import { r as registerInstance, c as createEvent, h, F as Fragment } from './index-a7d3d3f1.js';
2
2
  import { ElementIDUtils } from '@sankhyalabs/core';
3
3
  import { S as SnkFormConfigManager } from './SnkFormConfigManager-def999fe.js';
4
4
  import { buildFormMetadata, FormMetadata } from '@sankhyalabs/ezui/dist/collection/utils/form';
5
- import { T as TaskbarProcessor } from './taskbar-processor-dfef41a8.js';
6
- import { T as TaskbarElement } from './taskbar-elements-26d0fba3.js';
5
+ import { T as TaskbarProcessor } from './taskbar-processor-db6d14c2.js';
6
+ import { T as TaskbarElement } from './taskbar-elements-139b1058.js';
7
7
  import { c as VIEW_MODE } from './constants-3644f1b6.js';
8
8
  import './DataFetcher-b3d8b2d5.js';
9
9
  import './pesquisa-fetcher-bd6af0e3.js';
@@ -1,5 +1,5 @@
1
- export { S as snk_guides_viewer } from './snk-guides-viewer-cc812f72.js';
2
- import './index-8c3d76a6.js';
1
+ export { S as snk_guides_viewer } from './snk-guides-viewer-79b916a2.js';
2
+ import './index-a7d3d3f1.js';
3
3
  import '@sankhyalabs/core';
4
4
  import './SnkFormConfigManager-def999fe.js';
5
5
  import './ConfigStorage-9f4d2e67.js';
@@ -10,9 +10,9 @@ import './resource-fetcher-02642924.js';
10
10
  import './filter-bar-config-fetcher-bd2070a3.js';
11
11
  import './filter-item-type.enum-5028ed3f.js';
12
12
  import '@sankhyalabs/ezui/dist/collection/utils/form';
13
- import './taskbar-processor-dfef41a8.js';
14
- import './taskbar-elements-26d0fba3.js';
13
+ import './taskbar-processor-db6d14c2.js';
14
+ import './taskbar-elements-139b1058.js';
15
15
  import './index-a255b326.js';
16
- import './index-d60ca0ac.js';
16
+ import './index-bdf75557.js';
17
17
  import './constants-3644f1b6.js';
18
18
  import './pesquisa-fetcher-bd6af0e3.js';
@@ -1,10 +1,10 @@
1
- import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host } from './index-8c3d76a6.js';
1
+ import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host } from './index-a7d3d3f1.js';
2
2
  import { StringUtils, ObjectUtils, ApplicationContext } from '@sankhyalabs/core';
3
3
  import { P as PersonalizedFilterUtils } from './PersonalizedFilterUtils-202cd721.js';
4
4
  import { P as PersonalizedFilterFetcher, C as ConfigStorage } from './ConfigStorage-9f4d2e67.js';
5
5
  import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
6
6
  import { F as FilterGroupCondition } from './IExpressionItem-2e922b2c.js';
7
- import { s as store } from './index-d60ca0ac.js';
7
+ import { s as store } from './index-bdf75557.js';
8
8
  import './index-a255b326.js';
9
9
  import './filter-item-type.enum-5028ed3f.js';
10
10
  import './form-config-fetcher-cac8cd96.js';
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h, H as Host, g as getElement } from './index-8c3d76a6.js';
1
+ import { r as registerInstance, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
2
2
  import { ObjectUtils, StringUtils, ElementIDUtils } from '@sankhyalabs/core';
3
3
 
4
4
  const snkPesquisaCss = ".sc-snk-pesquisa-h{--snk-pesquisa--font-size:var(--text--medium, 14px);--snk-pesquisa--font-family:var(--font-pattern, Arial);--snk-pesquisa--font-weight:var(--text-weight--medium, 400);--snk-pesquisa__records--color:var(--text--primary, #626e82);--snk-pesquisa__records--padding-vertical:var(--space--medium, 12px);--snk-pesquisa__content--padding-right:var(--space--small, 6px);--snk-pesquisa__btn--color:var(--title--primary, #2B3A54);--snk-pesquisa__btn-disabled--color:var(--text--disable, #AFB6C0);--snk-pesquisa__btn-hover--color:var(--color--primary, #4e4e4e);--snk-pesquisa__scrollbar--color-default:var(--scrollbar--default, #626e82);--snk-pesquisa__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--snk-pesquisa__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--snk-pesquisa__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--snk-pesquisa__scrollbar--border-radius:var(--border--radius-small, 6px);--snk-pesquisa__scrollbar--width:var(--space--medium, 12px);max-height:100%;height:100%;display:flex;flex-direction:column;overflow-y:auto}.snk-pesquisa.sc-snk-pesquisa{display:flex;flex-direction:column;height:100%}.snk-pesquisa__input.sc-snk-pesquisa{display:flex;width:100%;box-sizing:border-box;padding-top:4px;padding-right:4px}.snk-pesquisa__input.sc-snk-pesquisa ez-icon.sc-snk-pesquisa{--ez-icon--color:inherit;font-weight:var(--text-weight--large, 600)}.snk-pesquisa__content.sc-snk-pesquisa{display:flex;flex-direction:column;height:100%;overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--snk-pesquisa__scrollbar--color-clicked) var(--snk-pesquisa__scrollbar--color-background);padding-right:var(--snk-pesquisa__content--padding-right)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar{background-color:var(--snk-pesquisa__scrollbar--color-background);width:var(--snk-pesquisa__scrollbar--width);max-width:var(--snk-pesquisa__scrollbar--width);min-width:var(--snk-pesquisa__scrollbar--width)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-track{background-color:var(--snk-pesquisa__scrollbar--color-background);border-radius:var(--snk-pesquisa__scrollbar--border-radius)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb{background-color:var(--snk-pesquisa__scrollbar--color-default);border-radius:var(--snk-pesquisa__scrollbar--border-radius)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:vertical:hover,.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--snk-pesquisa__scrollbar--color-hover)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:vertical:active,.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--snk-pesquisa__scrollbar--color-clicked)}.snk-pesquisa__records.sc-snk-pesquisa{font-family:var(--snk-pesquisa--font-family);font-weight:var(--snk-pesquisa--font-weight);font-size:var(--snk-pesquisa--font-size);color:var(--snk-pesquisa__records--color);padding-bottom:var(--snk-pesquisa__records--padding-vertical);padding-top:var(--snk-pesquisa__records--padding-vertical)}.snk-pesquisa__btn.sc-snk-pesquisa{outline:none;border:none;background:none;cursor:pointer;color:var(--snk-pesquisa__btn--color)}.snk-pesquisa__btn.sc-snk-pesquisa:disabled{cursor:unset;color:var(--snk-pesquisa__btn-disabled--color)}.snk-pesquisa__btn.sc-snk-pesquisa:disabled:hover{cursor:unset;color:var(--snk-pesquisa__btn-disabled--color)}.snk-pesquisa__btn.sc-snk-pesquisa:hover{color:var(--snk-pesquisa__btn-hover--color)}";
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h } from './index-8c3d76a6.js';
1
+ import { r as registerInstance, c as createEvent, h } from './index-a7d3d3f1.js';
2
2
  import { O as ORDER_VALUES } from './constants-3644f1b6.js';
3
3
 
4
4
  const snkSelectBoxCss = "ez-combo-box{width:100px}.grid-config-combo{--ez-text-input--height:28px;--ez-text-input__input--background-color:#fff;--ez-text-input__input--border-color:#dce0e8}";
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h, g as getElement } from './index-8c3d76a6.js';
1
+ import { r as registerInstance, c as createEvent, h, g as getElement } from './index-a7d3d3f1.js';
2
2
  import { ElementIDUtils, ApplicationContext } from '@sankhyalabs/core';
3
3
 
4
4
  const snkSimpleBarCss = ".sc-snk-simple-bar-h{display:flex;height:100%;width:100%}.simple-bar__container.sc-snk-simple-bar{flex:1;display:flex;align-items:stretch;gap:var(--space--small)}.simple-bar__left-slot.sc-snk-simple-bar{min-width:280px;flex:1;display:flex;align-items:center}.simple-bar__right-slot.sc-snk-simple-bar{flex:1;display:flex;align-items:center;justify-content:flex-end}.simple-bar__column.sc-snk-simple-bar{flex:1;display:flex;flex-direction:column}";
@@ -1,12 +1,12 @@
1
- import { r as registerInstance, c as createEvent, h, g as getElement } from './index-8c3d76a6.js';
1
+ import { r as registerInstance, c as createEvent, h, g as getElement } from './index-a7d3d3f1.js';
2
2
  import { DataUnit, StringUtils, SortMode, DataType, ChangeOperation, ObjectUtils, UserInterface } from '@sankhyalabs/core';
3
3
  import { c as VIEW_MODE, S as SIMPLE_CRUD_MODE } from './constants-3644f1b6.js';
4
- import { T as TaskbarElement } from './taskbar-elements-26d0fba3.js';
4
+ import { T as TaskbarElement } from './taskbar-elements-139b1058.js';
5
5
  import './DataFetcher-b3d8b2d5.js';
6
6
  import './pesquisa-fetcher-bd6af0e3.js';
7
7
  import { P as PresentationMode } from './index-a255b326.js';
8
- import { T as TaskbarProcessor } from './taskbar-processor-dfef41a8.js';
9
- import './index-d60ca0ac.js';
8
+ import { T as TaskbarProcessor } from './taskbar-processor-db6d14c2.js';
9
+ import './index-bdf75557.js';
10
10
  import './_commonjsHelpers-9943807e.js';
11
11
 
12
12
  class InMemoryLoader {
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host, g as getElement } from './index-8c3d76a6.js';
1
+ import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host, g as getElement } from './index-a7d3d3f1.js';
2
2
  import { d as draggable_bundle } from './draggable.bundle-41d56f06.js';
3
3
  import { ApplicationContext, ElementIDUtils } from '@sankhyalabs/core';
4
4
  import { C as CONFIG_EVENTS, K as KEY_EVENTS, b as TYPE_ACTIONS, T as TAB_NAMES } from './constants-3644f1b6.js';
@@ -1,9 +1,9 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-8c3d76a6.js';
1
+ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
2
2
  import { StringUtils, ApplicationContext, ElementIDUtils } from '@sankhyalabs/core';
3
3
  import { A as AuthorizationConfig } from './AuthorizationConfig-dcbd207a.js';
4
- import { T as TaskbarElement, V as VisibleWhenForbidden, A as AuthorizationElements, b as buildElem, a as buildCustomButton } from './taskbar-elements-26d0fba3.js';
4
+ import { T as TaskbarElement, V as VisibleWhenForbidden, A as AuthorizationElements, b as buildElem, a as buildCustomButton } from './taskbar-elements-139b1058.js';
5
5
  import { P as PresentationMode } from './index-a255b326.js';
6
- import './index-d60ca0ac.js';
6
+ import './index-bdf75557.js';
7
7
 
8
8
  const snkTaskbarCss = ".sc-snk-taskbar-h{display:flex}";
9
9
 
@@ -1,6 +1,6 @@
1
- import { h } from './index-8c3d76a6.js';
1
+ import { h } from './index-a7d3d3f1.js';
2
2
  import { P as PresentationMode } from './index-a255b326.js';
3
- import { s as store } from './index-d60ca0ac.js';
3
+ import { s as store } from './index-bdf75557.js';
4
4
 
5
5
  var TaskbarElement;
6
6
  (function (TaskbarElement) {
@@ -1,4 +1,4 @@
1
- import { T as TaskbarElement } from './taskbar-elements-26d0fba3.js';
1
+ import { T as TaskbarElement } from './taskbar-elements-139b1058.js';
2
2
  import { VersionUtils } from '@sankhyalabs/core';
3
3
 
4
4
  const MINIMUM_SK_VERSION_TO_ATTACHMENT = "4.22";
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h } from './index-8c3d76a6.js';
1
+ import { r as registerInstance, h } from './index-a7d3d3f1.js';
2
2
  import { DataUnit, DataType, UserInterface } from '@sankhyalabs/core';
3
3
 
4
4
  const testePesquisaCss = ":host{display:block}";
@@ -1,4 +1,4 @@
1
- import{r as t,c as s,h as e,g as i}from"./p-066ee142.js";import{WaitingChangeException as n,WarningException as r,ErrorException as a,ObjectUtils as o,DateUtils as c,StringUtils as h,OnboardingUtils as u,DependencyType as l,ElementIDUtils as p,ApplicationContext as d,ErrorTracking as m,DataType as f}from"@sankhyalabs/core";import{d as w,D as y,U as g}from"./p-41d92871.js";import{ApplicationUtils as P}from"@sankhyalabs/ezui/dist/collection/utils";import{P as I}from"./p-11028eba.js";import{G as v,C as _}from"./p-801b8858.js";import{D as A}from"./p-553f5dcf.js";import{R as E}from"./p-79f78e10.js";import{S}from"./p-2d5108b3.js";import"./p-112455b1.js";import"./p-2ea933b2.js";import"./p-3d45107f.js";import"./p-584d7212.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";class C{constructor(t){this._app=t,window.addEventListener("error",(t=>this.errorHandler(t))),window.addEventListener("unhandledrejection",(t=>this.rejectionHandler(t)))}rejectionHandler(t){const s=t.reason;s instanceof n||(s?this.processException(s):this._app.isDebugMode().then((t=>{t&&this._app.error("Promise rejeitada","Erro interno: Uma promise foi rejeitada sem razão determinada.")})))}errorHandler(t){this.processException(t.error)}buildErrorCodeHTML(t){return'<br><a href="#" onclick="try{window.workspace.openHelp(\'_tbcode:'+t+"')} catch(e){alert('Não é possível abrir a ajuda fora do workspace Sankhya');}\">Código: "+t+"</a>"}processException(t){t.errorCode&&(t.message+=this.buildErrorCodeHTML(t.errorCode)),t instanceof n||t instanceof r?this._app.alert(t.title,t.message):t instanceof a?this._app.error(t.title,t.message):this._app.isDebugMode().then((s=>{if(s)if(t instanceof Error)this._app.error(t.name,t.message);else{const s=(null==t?void 0:t.title)||"Erro detectado",e="string"==typeof t?t:t.message||`Erro interno "${o.objectToString(t)}"`;this._app.error(s,e)}}))}}function D(){const t=["2909523kXwted","CompanyName=Sankhya Jiva Tecnologia e Inovao Ltda,LicensedApplication=Sankhya Gestao,LicenseType=SingleApplication,LicensedConcurrentDeveloperCount=2,LicensedProductionInstancesCount=0,AssetReference=AG-019460,ExpiryDate=9_November_2022_[v2]_MTY2Nzk1MjAwMDAwMA==10487151e296ee4360f80961ca960869","1131048CARoeW","502909mLEPmu","447255iQEXuN","428UHbJwW","270AFTxAV","194369jhGqTI","1540nWuTrj","2044062GicUQI","30CkXPWg"];return(D=function(){return t})()}const T=b;function b(t,s){const e=D();return(b=function(t){return e[t-=392]})(t,s)}!function(){const t=b,s=D();for(;;)try{if(951926==-parseInt(t(398))/1+-parseInt(t(393))/2+parseInt(t(395))/3+-parseInt(t(400))/4*(parseInt(t(392))/5)+-parseInt(t(401))/6*(-parseInt(t(402))/7)+parseInt(t(397))/8+-parseInt(t(399))/9*(-parseInt(t(394))/10))break;s.push(s.shift())}catch(t){s.push(s.shift())}}();const N=T(396);class j{constructor(){this.templateByQuery=new Map,this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchTotals",w.gql`query($filters: [InputFilter!] $name: String!) {
1
+ import{r as t,c as s,h as e,g as i}from"./p-d2d301a6.js";import{WaitingChangeException as n,WarningException as r,ErrorException as a,ObjectUtils as o,DateUtils as c,StringUtils as h,OnboardingUtils as u,DependencyType as l,ElementIDUtils as p,ApplicationContext as d,ErrorTracking as m,DataType as f}from"@sankhyalabs/core";import{d as w,D as y,U as g}from"./p-41d92871.js";import{ApplicationUtils as P}from"@sankhyalabs/ezui/dist/collection/utils";import{P as I}from"./p-11028eba.js";import{G as v,C as _}from"./p-801b8858.js";import{D as A}from"./p-553f5dcf.js";import{R as E}from"./p-79f78e10.js";import{S}from"./p-2d5108b3.js";import"./p-112455b1.js";import"./p-2ea933b2.js";import"./p-3d45107f.js";import"./p-584d7212.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";class C{constructor(t){this._app=t,window.addEventListener("error",(t=>this.errorHandler(t))),window.addEventListener("unhandledrejection",(t=>this.rejectionHandler(t)))}rejectionHandler(t){const s=t.reason;s instanceof n||(s?this.processException(s):this._app.isDebugMode().then((t=>{t&&this._app.error("Promise rejeitada","Erro interno: Uma promise foi rejeitada sem razão determinada.")})))}errorHandler(t){this.processException(t.error)}buildErrorCodeHTML(t){return'<br><a href="#" onclick="try{window.workspace.openHelp(\'_tbcode:'+t+"')} catch(e){alert('Não é possível abrir a ajuda fora do workspace Sankhya');}\">Código: "+t+"</a>"}processException(t){t.errorCode&&(t.message+=this.buildErrorCodeHTML(t.errorCode)),t instanceof n||t instanceof r?this._app.alert(t.title,t.message):t instanceof a?this._app.error(t.title,t.message):this._app.isDebugMode().then((s=>{if(s)if(t instanceof Error)this._app.error(t.name,t.message);else{const s=(null==t?void 0:t.title)||"Erro detectado",e="string"==typeof t?t:t.message||`Erro interno "${o.objectToString(t)}"`;this._app.error(s,e)}}))}}function D(){const t=["2909523kXwted","CompanyName=Sankhya Jiva Tecnologia e Inovao Ltda,LicensedApplication=Sankhya Gestao,LicenseType=SingleApplication,LicensedConcurrentDeveloperCount=2,LicensedProductionInstancesCount=0,AssetReference=AG-019460,ExpiryDate=9_November_2022_[v2]_MTY2Nzk1MjAwMDAwMA==10487151e296ee4360f80961ca960869","1131048CARoeW","502909mLEPmu","447255iQEXuN","428UHbJwW","270AFTxAV","194369jhGqTI","1540nWuTrj","2044062GicUQI","30CkXPWg"];return(D=function(){return t})()}const T=b;function b(t,s){const e=D();return(b=function(t){return e[t-=392]})(t,s)}!function(){const t=b,s=D();for(;;)try{if(951926==-parseInt(t(398))/1+-parseInt(t(393))/2+parseInt(t(395))/3+-parseInt(t(400))/4*(parseInt(t(392))/5)+-parseInt(t(401))/6*(-parseInt(t(402))/7)+parseInt(t(397))/8+-parseInt(t(399))/9*(-parseInt(t(394))/10))break;s.push(s.shift())}catch(t){s.push(s.shift())}}();const N=T(396);class j{constructor(){this.templateByQuery=new Map,this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchTotals",w.gql`query($filters: [InputFilter!] $name: String!) {
2
2
  $queryAlias$: fetchTotals(name: $name, filters: $filters ){
3
3
  name
4
4
  value
@@ -0,0 +1 @@
1
+ import{r as t,h as i}from"./p-d2d301a6.js";import{ModalAction as e}from"@sankhyalabs/ezui/dist/collection/components/ez-modal-container";import{ApplicationUtils as s}from"@sankhyalabs/ezui/dist/collection/utils";import{F as l}from"./p-d9804798.js";import{F as o}from"./p-584d7212.js";import{ObjectUtils as r}from"@sankhyalabs/core";import{P as a}from"./p-36ecb6ab.js";import"./p-eb90de43.js";const n=class{constructor(i){t(this,i),this.getMessage=void 0,this.configName=void 0,this.filters=void 0,this.applyFilters=void 0,this.closeModal=void 0,this.addPersonalizedFilter=void 0,this.editPersonalizedFilter=void 0}getCustomMessage(t,i){var e;return null===(e=this.getMessage)||void 0===e?void 0:e.call(this,`snkFilterBar.filterModal.${t}`,i)}handleClearAll(){const{customFilters:t,quickFilters:i,otherFilters:e,multiListFilters:s}=this.filters.reduce(((t,i)=>i.type===o.MULTI_LIST?(t.multiListFilters.push(i),t):i.filterType===l.QUICK_FILTER?(t.quickFilters.push(i),t):i.filterType===l.CUSTOM_FILTER?(t.customFilters.push(i),t):i.filterType===l.OTHER_FILTERS?(t.otherFilters.push(i),t):t),{quickFilters:[],customFilters:[],otherFilters:[],multiListFilters:[]});this.handleClearFilterList(i),this.handleClearCustomFilters(t),this.handleClearOthersFilters(e),s.forEach((t=>this.handleClearSigleFilter(t)))}handleClearOthersFilters(t){this.filters=this.filters.map((i=>t.includes(i)?Object.assign(Object.assign({},i),{value:void 0}):i))}handleClearCustomFilters(t){this.filters.forEach(((i,e)=>{i.filterType===l.CUSTOM_FILTER&&(this.filters[e]=this.clearAllCustomFilter(t).shift())}))}clearAllCustomFilter(t){return t.map((t=>{const i=Object.assign({},t);return delete i.value,i.visible=!1,i.groupedItems&&(i.groupedItems=this.clearAllCustomFilter(i.groupedItems)),i}))}handleClose(){if(JSON.stringify(this.filters)!==JSON.stringify(this._originalFilterConfig))return s.confirm(this.getCustomMessage("validations.notSaved.title"),this.getCustomMessage("validations.notSaved.message")).then((t=>{t&&this.closeModal()}));this.closeModal()}validatePersonalizedFilter(){const t=this.filters.find((t=>t.filterType===l.CUSTOM_FILTER));if(!a.validateVariableValues(t))return s.alert(this.getCustomMessage("validations.notFullFilled.title"),this.getCustomMessage("validations.notFullFilled.message"));this.applyFilters(this.filters)}modalActionListener(t){switch(t.detail){case e.CANCEL:this.handleClearAll();break;case e.OK:this.validatePersonalizedFilter();break;case e.CLOSE:this.handleClose()}}handleFilterChange(t){this.filters=this.filters.map((i=>i.id===t.id?t:i))}handleClearFilterList(t){this.filters=this.filters.map((i=>t.includes(i)?Object.assign(Object.assign({},i),{value:void 0}):i))}handleClearSigleFilter(t){if(o.MULTI_LIST===t.type){let i=r.copy(t);this.uncheckFilterValues(i.value);const e=r.copy(this.filters),s=e.findIndex((i=>i.id===t.id));e.splice(s,1,i),this.filters=r.copy(e)}else this.filters.find((i=>i.id===t.id)).value=void 0}uncheckFilterValues(t){return t.forEach((t=>{t&&(t.check=!1)})),t}renderFilterItem(t,e){return i("snk-filter-modal-item",{class:e?"ez-col ez-col--sd-12":"ez-col ez-col--sd-6 ez-padding--small",filterItem:t,configName:this.configName,onFilterChange:t=>this.handleFilterChange(t.detail),onEditPersonalizedFilter:t=>this.editPersonalizedFilter(t.detail),onAddPersonalizedFilter:()=>this.addPersonalizedFilter()})}mountFiltersLines(t){let i=0,e=!1;const s={};for(let l=0;l<t.length;l++){s[i]=s[i]||[];const r=t[l],a=l===t.length-1,n=[o.TEXT,o.NUMBER].includes(r.type),d=!a&&[o.TEXT,o.NUMBER].includes(t[l+1].type);n&&d||e?(s[i].push(r),e=s[i].length<2,2===s[i].length&&++i):(s[i]=s[i]||[],s[i].push(r),++i)}return Object.values(s)}renderFilterLine(t){const i=1===t.length;return t.map((t=>this.renderFilterItem(t,i)))}getIformedFiltersCount(t){let i=0;return t.forEach((t=>{var e,s,l,r,a;o.MULTI_LIST!==t.type?null==t.groupedItems?t.value&&i++:i=t.groupedItems.filter((t=>t.visible)).length:i+=null!==(a=null===(r=null===(l=null!==(s=null===(e=t.value)||void 0===e?void 0:e.elements)&&void 0!==s?s:t.value)||void 0===l?void 0:l.filter((t=>null==t?void 0:t.check)))||void 0===r?void 0:r.length)&&void 0!==a?a:0})),i}renderCollapsibleFilterBox(t,e,s,l=!0){if(!e.length)return null;const o=this.getIformedFiltersCount(e),r=this.mountFiltersLines(e);return i("ez-collapsible-box",{class:"snk-filter-modal__collapsible-box",headerSize:"medium",value:!0,label:t},!!o&&i("ez-badge",{class:"ez-badge--primary-subtle",slot:"rightSlot",label:null==o?void 0:o.toString()}),i("div",{class:"ez-row snk-filter-modal__rendered-items"},r.map(this.renderFilterLine.bind(this))),l&&i("div",{class:"ez-flex ez-flex--justify-end grow"},i("ez-button",{class:"ez-button--tertiary",size:"medium",label:"Limpar",onClick:()=>s?this.handleClearSigleFilter(e[0]):this.handleClearFilterList(e)})))}componentWillRender(){this._modalTitle=this.getCustomMessage("title"),this._okButtonLabel=this.getCustomMessage("okButtonLabel"),this._cancelButtonLabel=this.getCustomMessage("cancelButtonLabel")}componentDidLoad(){this._originalFilterConfig||(this._originalFilterConfig=this.filters)}render(){const t=this.filters.filter((t=>t.filterType===l.CUSTOM_FILTER)),e=this.filters.filter((t=>t.filterType===l.QUICK_FILTER)),s=this.filters.filter((t=>t.filterType===l.OTHER_FILTERS));return i("ez-modal-container",{class:"snk-filter-modal__container",modalTitle:this._modalTitle,cancelButtonLabel:this._cancelButtonLabel,okButtonLabel:this._okButtonLabel,onEzModalAction:this.modalActionListener.bind(this)},i("div",{class:"snk-filter-modal__content ez-col--sd-12"},this.renderCollapsibleFilterBox(this.getCustomMessage("customFilters"),t,!1,!1),this.renderCollapsibleFilterBox(this.getCustomMessage("quickFilters"),e,!1),s.map((t=>this.renderCollapsibleFilterBox(t.label,[t],!0)))))}};n.style="ez-modal{--ez-modal-content-padding:24px 12px}.snk-filter-modal__container{width:344px;max-width:344px;min-width:344px;overflow:hidden}.snk-filter-modal__content{display:flex;flex-direction:column;gap:var(--space--medium, 12px);padding-right:var(--space--3xs, 4px)}.snk-filter-modal__collapsible-box{border:var(--border--small, 1px solid) var(--color--strokes, #DCE0E8);border-radius:var(--border--radius-medium);padding:var(--space--medium, 12px) var(--space--small, 6px)}.snk-filter-modal__rendered-items{max-height:760px;overflow-x:clip;overflow-y:auto}.snk-filter-modal__rendered-items::-webkit-scrollbar{width:var(--space--small);min-width:var(--space--small);max-width:var(--space--small)}";export{n as snk_filter_modal}
@@ -1 +1 @@
1
- import{r as t,h as s,H as e,g as i}from"./p-066ee142.js";import{ApplicationContext as n,StringUtils as o,ErrorException as a,WarningException as c,ObjectUtils as r,DateUtils as l,ArrayUtils as h,ElementIDUtils as u}from"@sankhyalabs/core";import{D as d}from"./p-41d92871.js";import{P as p}from"./p-eaad0aa8.js";import"./p-11028eba.js";import"./p-eb90de43.js";import"./p-112455b1.js";class m{execute(t){var s;const e={actionID:t.actionID,refreshType:null===(s=t.actionConfig.javaCall)||void 0===s?void 0:s.refreshType};return new Promise((t=>{t({execSource:e,callback:this.callExecJava})}))}callExecJava(t){const s={requestBody:{javaCall:t}};d.get().callServiceBroker("ActionButtonsSP.executeJava",JSON.stringify(s))}}class v{execute(t){var s;const e={actionID:t.actionID,refreshType:null===(s=t.actionConfig.runScript)||void 0===s?void 0:s.refreshType};return new Promise((t=>{t({execSource:e,callback:this.callExecScript})}))}callExecScript(t){const s={runScript:t};d.get().callServiceBroker("ActionButtonsSP.executeScript",s)}}class b{constructor(){this._application=n.getContextValue("__SNK__APPLICATION__")}async execute(t,s){const e=t.resourceID;if(!e)return;let i=await this.buildLaunchObject(t,s);return this._application.openApp(e,i),null}buildLaunchObject(t,s){return new Promise((e=>{let i=t.actionConfig.params.param;if(i&&i.length>0){let n={},c=[];i.forEach((e=>{const i=e.localField;let r=s.getFieldValue(i);if(!r){let e=s.getField(i).label;throw e=o.isEmpty(s.getField(i).label)?i:e,new a(this._application.messagesBuilder.getMessage("snkActionsButton.title.error",void 0),this._application.messagesBuilder.getMessage("snkActionsButton.launchScreen.emptyField",{description:t.description,localFieldLabel:e}))}r=o.isEmpty(r.toString())?void 0:r.toString(),n[e.targetField]=r,c.push({fieldName:e.targetField,value:r})})),n.ACTION_PARAMETERS=c,n.call_time=Date.now(),e(n)}e(null)}))}}class w{execute(t){var s,e,i;const n=null===(s=t.actionConfig.dbCall)||void 0===s?void 0:s.name,o=null===(e=t.actionConfig.dbCall)||void 0===e?void 0:e.rootEntity,a={actionID:t.actionID,refreshType:null===(i=t.actionConfig.dbCall)||void 0===i?void 0:i.refreshType,procName:n,rootEntity:o};return new Promise((t=>{t({execSource:a,callback:this.callExecProcedure})}))}callExecProcedure(t){const s={requestBody:{stpCall:t}};d.get().callServiceBroker("ActionButtonsSP.executeSTP",JSON.stringify(s))}}var k,_;!function(t){t.LAUNCH_SCREEN="LC",t.JAVASCRIPT="SC",t.JAVA="RJ",t.PROCEDURE="SP",t.EMBEDDED="EB"}(k||(k={}));class f{constructor(t){this.actionType=t,this._application=n.getContextValue("__SNK__APPLICATION__")}get executor(){switch(this.actionType){case k.LAUNCH_SCREEN:return new b;case k.JAVASCRIPT:return new v;case k.JAVA:return new m;case k.PROCEDURE:return new w;default:throw new a(this._application.messagesBuilder.getMessage("snkActionsButton.title.error",void 0),this._application.messagesBuilder.getMessage("snkActionsButton.action.nonExistentType",{actionType:this.actionType}))}}}!function(t){t.NONE="NONE",t.PARENT="PARENT",t.MASTER="MASTER",t.ALL="ALL"}(_||(_={}));const S="__MASTER_ROW__";class y{constructor(t,s){var e;this._lastValuesCache={},this._actionsExecuteInterface=t,this._dataUnit=s,this._selectedRows=(null===(e=null==s?void 0:s.getSelectionInfo())||void 0===e?void 0:e.isAllRecords())?[]:null==s?void 0:s.getSelectionInfo().records,this._application=n.getContextValue("__SNK__APPLICATION__")}apply(t,s){this._application.closePopUp(),this._actionsExecuteInterface.execute(t,this._dataUnit).then((({execSource:e,callback:i})=>{this.resolvePromptParams(t,e,s).then((()=>{this.actionExecute(e,i)}))}))}async execute(t){var s;if(!t.actionConfig)throw new c(this._application.messagesBuilder.getMessage("snkActionsButton.title.warning",void 0),this._application.messagesBuilder.getMessage("snkActionsButton.action.incorrectAction",{description:t.description}));if(null===(s=t.actionConfig.params)||void 0===s?void 0:s.promptParam){const s=t.actionConfig.params.promptParam;let e=!1;for(let t=0;t<s.length;t++)if(!e&&"true"===s[t].saveLast){e=!0;break}e&&(t.actionConfig.params.promptParam=await this.loadSavedValuesIntoParams(t));const i=document.createElement("snk-actions-form");window.document.body.appendChild(i),i.action=r.copy(t),i.applyParameters=t=>{this.apply(t,e)},i.openPopup()}else t.type!=k.LAUNCH_SCREEN?this._actionsExecuteInterface.execute(t,this._dataUnit).then((({execSource:t,callback:s})=>{this.actionExecute(t,s)})):this._actionsExecuteInterface.execute(t,this._dataUnit)}loadSavedValuesIntoParams(t){return this.loadLastValues(t).then((s=>{let e=t.actionConfig.params.promptParam;return s&&s.param.forEach((t=>{e=e.map((s=>s.name!==t.paramName?s:Object.assign(Object.assign({},s),"B"===s.paramType?{value:"S"===t.$}:{value:t.$})))})),e}))}actionExecute(t,s){t.virtualPage=this.buildVirtualPage(),this.prepareAndExecute(t,s),this.recordsReloader(t.refreshType)}resolvePromptParams(t,s,e){return new Promise((i=>{let n=[];t.actionConfig.params.promptParam.forEach((t=>{n.push(this.buildPromptParam(t))})),this.putParamsOnExecSource(n,s),e&&this.saveLastValues(t,n),i()}))}buildPromptParam(t){let s,e,i=t.paramType,n=!1,o=t.value;switch(i){case p.DATE:i="D";break;case p.DATETIME:i="H";break;case p.DECIMAL:i="F",s={"sk-precision":Number(t.precision)};break;case p.BOOLEAN:i="S",n=!0,o=t.value?"S":"N";break;case p.ENTITY:s={"sk-entity-name":t.entityName,"sk-allow-show-hierarchical-mode":t.hierarchyEntity,"sk-data-type":"S"},t.hierarchyEntity&&t.entityPK&&(e=t.entityPK),o=t.value?Number(t.value):null;break;case p.OPTIONS:i="O";let a=t.options.split(";").map((function(t,s){let e,i;if(t.indexOf("=")>-1){let s=t.split("=");e=s[0],i=s[1]}else e=s+1,i=t;return{data:e,value:i}}));s={"sk-options":a}}return{description:t.label,required:"true"==t.required,fieldName:t.name,fieldNameOri:t.name,entityPK:e,paramType:t.paramType,type:i,isCheckbox:n,saveLast:t.saveLast,fieldProp:s,value:o,isGeneratedName:t.isGeneratedName}}putParamsOnExecSource(t,s){s.params={param:[]},t.forEach((t=>{if(t.isGeneratedName&&t.value)throw new a(this._application.messagesBuilder.getMessage("snkActionsButton.title.error",void 0),this._application.messagesBuilder.getMessage("snkActionsButton.action.emptyParamName",void 0));o.isEmpty(t.value)||s.params.param.push({type:this.getParamDataType(t.paramType),paramName:t.fieldName,$:this.getParamValue(t)})}))}getParamDataType(t){let s;switch(t){case"D":s="F";break;case"DT":case"DH":s="D";break;case"B":case"ENTITY":case"SO":s="S";break;default:s=t}return s}getParamValue(t){let s=t.value;return s?("DT"==t.paramType?s=l.formatDate(s):"DH"==t.paramType&&(s=l.formatDateTime(s)),s):s}async loadLastValues(t){const s=await this.buildResourceId(t.actionID);return new Promise(((t,e)=>{if(this._lastValuesCache[s])t(this._lastValuesCache[s]);else{const i={config:{chave:s,tipo:"T"}};d.get().callServiceBroker("SystemUtilsSP.getConf",i).then((e=>{var i,n;let o;(null===(n=null===(i=e.config)||void 0===i?void 0:i.data)||void 0===n?void 0:n.params)&&(o=e.config.data.params,Array.isArray(o.param)||(o.param=[o.param])),this._lastValuesCache[s]=o,t(o)})).catch((t=>{e(t)}))}}))}async saveLastValues(t,s){if(this._application){let e={params:{param:[]}};s.forEach((t=>{"true"==t.saveLast&&e.params.param.push({paramName:t.fieldName,$:t.value})}));const i=await this.buildResourceId(t.actionID);this._lastValuesCache[i]=e.params,this._application.saveConfig(i,e)}}async buildResourceId(t){let s="";return s=await this._application.getResourceID(),s+".actionconfig."+t}prepareAndExecute(t,s){this.addRows(t),s(t)}addRows(t){const s={row:[]},e=this._selectedRows;for(const t in e){const i=e[t],n={};i.hasOwnProperty(S)&&(n.master="S",n.entityName=i.__ENTITY_NAME__,delete i[S],delete i.__ENTITY_NAME__);for(const t in i)"NUFIN"===t&&(n.field||(n.field=[]),n.field.push({fieldName:t,$:i[t]}));s.row.push(n)}s.row.length>0&&(t.rows=s)}recordsReloader(t){switch(t){case _.NONE:break;case _.PARENT:case _.MASTER:case _.ALL:this._dataUnit.loadData();break;default:this._dataUnit.reloadCurrentRecord()}}buildVirtualPage(){var t,s,e,i;if(null===(s=null===(t=this._dataUnit)||void 0===t?void 0:t.getSelectionInfo())||void 0===s?void 0:s.isAllRecords())return{filters:{filters:null===(e=this._dataUnit)||void 0===e?void 0:e.getAppliedFilters()},orders:{orders:null===(i=this._dataUnit)||void 0===i?void 0:i.getSort()}}}}class P{clientConfirm(t,s){const e=n.getContextValue("__SNK__APPLICATION__");let i="";t.content.event.hasOwnProperty("stpCall")?(s.requestBody=t.content.event.stpCall,i=k.PROCEDURE):t.content.event.hasOwnProperty("runScript")?(s.requestBody=t.content.event.runScript,i=k.JAVASCRIPT):t.content.event.hasOwnProperty("javaCall")&&(s.requestBody=t.content.event.javaCall,i=k.JAVA);let o={type:"S",sequence:t.content.event.sequence};s.requestBody.params?Array.isArray(s.requestBody.params.param)||(s.requestBody.params.param=[s.requestBody.params.param]):s.requestBody.params={param:[]},s.requestBody.params.param.push(o);const a=t.content.event.title.$,c=t.content.event.message.$;let r;switch(i){case k.JAVASCRIPT:r={runScript:s.requestBody};break;case k.PROCEDURE:r={requestBody:{stpCall:s.requestBody}};break;case k.JAVA:r={requestBody:{javaCall:s.requestBody}}}if("S"==t.content.event.showNoOption){o.paramName="__ESCOLHA_SIMNAO__";const t=document.createElement("snk-client-confirm");window.document.body.appendChild(t),t.titleMessage=a,t.message=c,t.accept=()=>{o.$="S",s.reCall(r)},t.cancel=()=>{o.$="N",s.reCall(r)},t.openPopup()}else e.confirm(a,c,null,"warn",{labelCancel:"Cancelar",labelConfirm:"Sim"}).then((t=>{t&&(o.paramName="__CONFIRMACAO__",o.$="S",s.reCall(r))}))}}const A=class{constructor(s){t(this,s),this.CLIENT_EVENT_CONFIRM_NAME="br.com.sankhya.actionbutton.clientconfirm",this.handleClick=t=>{const s=this._actions.find((s=>s.actionID==t.detail.id)),e=new f(s.type).executor;new y(e,this._dataUnit).execute(Object.assign({},s)),this._showDropdown=!1},this._items=[],this._showDropdown=!1,this._actions=[],this._isOrderActions=!1}async getActions(){let t={param:{entityName:this._entityName,resourceID:this._resourceID}};return d.get().callServiceBroker("ActionButtonsSP.getActions",t).then((t=>{var s;(null===(s=t.actions)||void 0===s?void 0:s.action)&&(this._actions=this._isOrderActions?h.sortAlphabetically(t.actions.action,"description"):t.actions.action)}))}controlDropdown(){this._showDropdown=!this._showDropdown}canShowDropdown(){var t;return this._showDropdown&&(null===(t=this._items)||void 0===t?void 0:t.length)>0}positionDropdown(){var t;const s=null===(t=this._ezButton)||void 0===t?void 0:t.getBoundingClientRect();s&&this._dropdownParent&&(this._dropdownParent.style.top=s.y+s.height+5+"px",this._dropdownParent.style.left=s.x+"px")}closeDropdown(t){const s=null==t?void 0:t.target;s&&(s.closest(".snk-actions-button")||(this._showDropdown=!1))}setEvents(){document.removeEventListener("click",this.closeDropdown.bind(this)),document.addEventListener("click",this.closeDropdown.bind(this)),document.removeEventListener("scroll",this.positionDropdown.bind(this)),document.addEventListener("scroll",this.positionDropdown.bind(this))}async componentWillLoad(){var t;this._application=n.getContextValue("__SNK__APPLICATION__"),this._resourceID=await this._application.getResourceID(),this._isOrderActions=await this._application.getBooleanParam("global.ordenar.acoes.personalizadas"),this._dataUnit=null===(t=this._element.parentElement)||void 0===t?void 0:t.dataUnit,this._entityName=this._dataUnit.name.split("/")[2],this.setEvents(),this.getActions().then((()=>{this.loadItems()}))}async componentDidLoad(){if(this._element&&(u.addIDInfo(this._element),this.positionDropdown(),!await this._application.hasClientEvent(this.CLIENT_EVENT_CONFIRM_NAME))){const t=new P;this._application.addClientEvent(this.CLIENT_EVENT_CONFIRM_NAME,t.clientConfirm)}}componentDidUpdate(){this.positionDropdown()}loadItems(){this._actions&&0!=this._actions.length&&this._actions.forEach((t=>{this._items.push({id:t.actionID,label:t.description})}))}getElementID(t){return{[u.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:u.getInternalIDInfo(t)}}render(){return s(e,null,this._actions&&this._actions.length>0&&s("div",{class:`ez-padding-left--medium snk-actions-button \n ${this.canShowDropdown()?" snk-actions-button--overlap":""}\n `},s("ez-button",Object.assign({ref:t=>this._ezButton=t,iconName:"acao",size:"small",mode:"icon",title:this._application.messagesBuilder.getMessage("snkActionsButton.title.actions",void 0),onClick:()=>this.controlDropdown()},this.getElementID("button"))),s("div",Object.assign({ref:t=>this._dropdownParent=t,class:(this.canShowDropdown()?"snk-actions-button__dropdown--show":"snk-actions-button__dropdown")+"\n "},this.getElementID("dropdown")),this.canShowDropdown()&&s("ez-dropdown",Object.assign({items:this._items,onEzClick:t=>this.handleClick(t)},this.getElementID("dropdown"))))),this.canShowDropdown()&&s("div",Object.assign({class:"ez-scrim ez-scrim--light"},this.getElementID("ezScrim"))))}get _element(){return i(this)}};A.style=".sc-snk-actions-button-h{--snk-actions-button--z-index:var(--most-visible, 3);display:flex;width:fit-content;height:fit-content}.snk-actions-button.sc-snk-actions-button{display:flex;width:fit-content;height:fit-content}.snk-actions-button__dropdown--show.sc-snk-actions-button{display:flex;flex-direction:column;position:fixed}.snk-actions-button__dropdown.sc-snk-actions-button>ez-dropdown.sc-snk-actions-button{position:relative}.snk-actions-button--overlap.sc-snk-actions-button{z-index:var(--snk-actions-button--z-index)}.snk-actions-button__dropdown.sc-snk-actions-button{display:none}";export{A as snk_actions_button}
1
+ import{r as t,h as s,H as i,g as e}from"./p-d2d301a6.js";import{ApplicationContext as n,StringUtils as o,ErrorException as a,WarningException as c,ObjectUtils as r,DateUtils as l,ArrayUtils as h,ElementIDUtils as u}from"@sankhyalabs/core";import{D as d}from"./p-41d92871.js";import{P as p}from"./p-eaad0aa8.js";import"./p-11028eba.js";import"./p-eb90de43.js";import"./p-112455b1.js";class m{execute(t){var s;const i={actionID:t.actionID,refreshType:null===(s=t.actionConfig.javaCall)||void 0===s?void 0:s.refreshType};return new Promise((t=>{t({execSource:i,callback:this.callExecJava})}))}callExecJava(t){const s={requestBody:{javaCall:t}};d.get().callServiceBroker("ActionButtonsSP.executeJava",JSON.stringify(s))}}class v{execute(t){var s;const i={actionID:t.actionID,refreshType:null===(s=t.actionConfig.runScript)||void 0===s?void 0:s.refreshType};return new Promise((t=>{t({execSource:i,callback:this.callExecScript})}))}callExecScript(t){const s={runScript:t};d.get().callServiceBroker("ActionButtonsSP.executeScript",s)}}class b{constructor(){this._application=n.getContextValue("__SNK__APPLICATION__")}async execute(t,s){const i=t.resourceID;if(!i)return;let e=await this.buildLaunchObject(t,s);return this._application.openApp(i,e),null}buildLaunchObject(t,s){return new Promise((i=>{let e=t.actionConfig.params.param;if(e&&e.length>0){let n={},c=[];e.forEach((i=>{const e=i.localField;let r=s.getFieldValue(e);if(!r){let i=s.getField(e).label;throw i=o.isEmpty(s.getField(e).label)?e:i,new a(this._application.messagesBuilder.getMessage("snkActionsButton.title.error",void 0),this._application.messagesBuilder.getMessage("snkActionsButton.launchScreen.emptyField",{description:t.description,localFieldLabel:i}))}r=o.isEmpty(r.toString())?void 0:r.toString(),n[i.targetField]=r,c.push({fieldName:i.targetField,value:r})})),n.ACTION_PARAMETERS=c,n.call_time=Date.now(),i(n)}i(null)}))}}class w{execute(t){var s,i,e;const n=null===(s=t.actionConfig.dbCall)||void 0===s?void 0:s.name,o=null===(i=t.actionConfig.dbCall)||void 0===i?void 0:i.rootEntity,a={actionID:t.actionID,refreshType:null===(e=t.actionConfig.dbCall)||void 0===e?void 0:e.refreshType,procName:n,rootEntity:o};return new Promise((t=>{t({execSource:a,callback:this.callExecProcedure})}))}callExecProcedure(t){const s={requestBody:{stpCall:t}};d.get().callServiceBroker("ActionButtonsSP.executeSTP",JSON.stringify(s))}}var k,_;!function(t){t.LAUNCH_SCREEN="LC",t.JAVASCRIPT="SC",t.JAVA="RJ",t.PROCEDURE="SP",t.EMBEDDED="EB"}(k||(k={}));class f{constructor(t){this.actionType=t,this._application=n.getContextValue("__SNK__APPLICATION__")}get executor(){switch(this.actionType){case k.LAUNCH_SCREEN:return new b;case k.JAVASCRIPT:return new v;case k.JAVA:return new m;case k.PROCEDURE:return new w;default:throw new a(this._application.messagesBuilder.getMessage("snkActionsButton.title.error",void 0),this._application.messagesBuilder.getMessage("snkActionsButton.action.nonExistentType",{actionType:this.actionType}))}}}!function(t){t.NONE="NONE",t.PARENT="PARENT",t.MASTER="MASTER",t.ALL="ALL"}(_||(_={}));const S="__MASTER_ROW__";class y{constructor(t,s){var i;this._lastValuesCache={},this._actionsExecuteInterface=t,this._dataUnit=s,this._selectedRows=(null===(i=null==s?void 0:s.getSelectionInfo())||void 0===i?void 0:i.isAllRecords())?[]:null==s?void 0:s.getSelectionInfo().records,this._application=n.getContextValue("__SNK__APPLICATION__")}apply(t,s){this._application.closePopUp(),this._actionsExecuteInterface.execute(t,this._dataUnit).then((({execSource:i,callback:e})=>{this.resolvePromptParams(t,i,s).then((()=>{this.actionExecute(i,e)}))}))}async execute(t){var s;if(!t.actionConfig)throw new c(this._application.messagesBuilder.getMessage("snkActionsButton.title.warning",void 0),this._application.messagesBuilder.getMessage("snkActionsButton.action.incorrectAction",{description:t.description}));if(null===(s=t.actionConfig.params)||void 0===s?void 0:s.promptParam){const s=t.actionConfig.params.promptParam;let i=!1;for(let t=0;t<s.length;t++)if(!i&&"true"===s[t].saveLast){i=!0;break}i&&(t.actionConfig.params.promptParam=await this.loadSavedValuesIntoParams(t));const e=document.createElement("snk-actions-form");window.document.body.appendChild(e),e.action=r.copy(t),e.applyParameters=t=>{this.apply(t,i)},e.openPopup()}else t.type!=k.LAUNCH_SCREEN?this._actionsExecuteInterface.execute(t,this._dataUnit).then((({execSource:t,callback:s})=>{this.actionExecute(t,s)})):this._actionsExecuteInterface.execute(t,this._dataUnit)}loadSavedValuesIntoParams(t){return this.loadLastValues(t).then((s=>{let i=t.actionConfig.params.promptParam;return s&&s.param.forEach((t=>{i=i.map((s=>s.name!==t.paramName?s:Object.assign(Object.assign({},s),"B"===s.paramType?{value:"S"===t.$}:{value:t.$})))})),i}))}actionExecute(t,s){t.virtualPage=this.buildVirtualPage(),this.prepareAndExecute(t,s),this.recordsReloader(t.refreshType)}resolvePromptParams(t,s,i){return new Promise((e=>{let n=[];t.actionConfig.params.promptParam.forEach((t=>{n.push(this.buildPromptParam(t))})),this.putParamsOnExecSource(n,s),i&&this.saveLastValues(t,n),e()}))}buildPromptParam(t){let s,i,e=t.paramType,n=!1,o=t.value;switch(e){case p.DATE:e="D";break;case p.DATETIME:e="H";break;case p.DECIMAL:e="F",s={"sk-precision":Number(t.precision)};break;case p.BOOLEAN:e="S",n=!0,o=t.value?"S":"N";break;case p.ENTITY:s={"sk-entity-name":t.entityName,"sk-allow-show-hierarchical-mode":t.hierarchyEntity,"sk-data-type":"S"},t.hierarchyEntity&&t.entityPK&&(i=t.entityPK),o=t.value?Number(t.value):null;break;case p.OPTIONS:e="O";let a=t.options.split(";").map((function(t,s){let i,e;if(t.indexOf("=")>-1){let s=t.split("=");i=s[0],e=s[1]}else i=s+1,e=t;return{data:i,value:e}}));s={"sk-options":a}}return{description:t.label,required:"true"==t.required,fieldName:t.name,fieldNameOri:t.name,entityPK:i,paramType:t.paramType,type:e,isCheckbox:n,saveLast:t.saveLast,fieldProp:s,value:o,isGeneratedName:t.isGeneratedName}}putParamsOnExecSource(t,s){s.params={param:[]},t.forEach((t=>{if(t.isGeneratedName&&t.value)throw new a(this._application.messagesBuilder.getMessage("snkActionsButton.title.error",void 0),this._application.messagesBuilder.getMessage("snkActionsButton.action.emptyParamName",void 0));o.isEmpty(t.value)||s.params.param.push({type:this.getParamDataType(t.paramType),paramName:t.fieldName,$:this.getParamValue(t)})}))}getParamDataType(t){let s;switch(t){case"D":s="F";break;case"DT":case"DH":s="D";break;case"B":case"ENTITY":case"SO":s="S";break;default:s=t}return s}getParamValue(t){let s=t.value;return s?("DT"==t.paramType?s=l.formatDate(s):"DH"==t.paramType&&(s=l.formatDateTime(s)),s):s}async loadLastValues(t){const s=await this.buildResourceId(t.actionID);return new Promise(((t,i)=>{if(this._lastValuesCache[s])t(this._lastValuesCache[s]);else{const e={config:{chave:s,tipo:"T"}};d.get().callServiceBroker("SystemUtilsSP.getConf",e).then((i=>{var e,n;let o;(null===(n=null===(e=i.config)||void 0===e?void 0:e.data)||void 0===n?void 0:n.params)&&(o=i.config.data.params,Array.isArray(o.param)||(o.param=[o.param])),this._lastValuesCache[s]=o,t(o)})).catch((t=>{i(t)}))}}))}async saveLastValues(t,s){if(this._application){let i={params:{param:[]}};s.forEach((t=>{"true"==t.saveLast&&i.params.param.push({paramName:t.fieldName,$:t.value})}));const e=await this.buildResourceId(t.actionID);this._lastValuesCache[e]=i.params,this._application.saveConfig(e,i)}}async buildResourceId(t){let s="";return s=await this._application.getResourceID(),s+".actionconfig."+t}prepareAndExecute(t,s){this.addRows(t),s(t)}addRows(t){const s={row:[]},i=this._selectedRows;for(const t in i){const e=i[t],n={};e.hasOwnProperty(S)&&(n.master="S",n.entityName=e.__ENTITY_NAME__,delete e[S],delete e.__ENTITY_NAME__);for(const t in e)"NUFIN"===t&&(n.field||(n.field=[]),n.field.push({fieldName:t,$:e[t]}));s.row.push(n)}s.row.length>0&&(t.rows=s)}recordsReloader(t){switch(t){case _.NONE:break;case _.PARENT:case _.MASTER:case _.ALL:this._dataUnit.loadData();break;default:this._dataUnit.reloadCurrentRecord()}}buildVirtualPage(){var t,s,i,e;if(null===(s=null===(t=this._dataUnit)||void 0===t?void 0:t.getSelectionInfo())||void 0===s?void 0:s.isAllRecords())return{filters:{filters:null===(i=this._dataUnit)||void 0===i?void 0:i.getAppliedFilters()},orders:{orders:null===(e=this._dataUnit)||void 0===e?void 0:e.getSort()}}}}class P{clientConfirm(t,s){const i=n.getContextValue("__SNK__APPLICATION__");let e="";t.content.event.hasOwnProperty("stpCall")?(s.requestBody=t.content.event.stpCall,e=k.PROCEDURE):t.content.event.hasOwnProperty("runScript")?(s.requestBody=t.content.event.runScript,e=k.JAVASCRIPT):t.content.event.hasOwnProperty("javaCall")&&(s.requestBody=t.content.event.javaCall,e=k.JAVA);let o={type:"S",sequence:t.content.event.sequence};s.requestBody.params?Array.isArray(s.requestBody.params.param)||(s.requestBody.params.param=[s.requestBody.params.param]):s.requestBody.params={param:[]},s.requestBody.params.param.push(o);const a=t.content.event.title.$,c=t.content.event.message.$;let r;switch(e){case k.JAVASCRIPT:r={runScript:s.requestBody};break;case k.PROCEDURE:r={requestBody:{stpCall:s.requestBody}};break;case k.JAVA:r={requestBody:{javaCall:s.requestBody}}}if("S"==t.content.event.showNoOption){o.paramName="__ESCOLHA_SIMNAO__";const t=document.createElement("snk-client-confirm");window.document.body.appendChild(t),t.titleMessage=a,t.message=c,t.accept=()=>{o.$="S",s.reCall(r)},t.cancel=()=>{o.$="N",s.reCall(r)},t.openPopup()}else i.confirm(a,c,null,"warn",{labelCancel:"Cancelar",labelConfirm:"Sim"}).then((t=>{t&&(o.paramName="__CONFIRMACAO__",o.$="S",s.reCall(r))}))}}const A=class{constructor(s){t(this,s),this.CLIENT_EVENT_CONFIRM_NAME="br.com.sankhya.actionbutton.clientconfirm",this.handleClick=t=>{const s=this._actions.find((s=>s.actionID==t.detail.id)),i=new f(s.type).executor;new y(i,this._dataUnit).execute(Object.assign({},s)),this._showDropdown=!1},this._items=[],this._showDropdown=!1,this._actions=[],this._isOrderActions=!1}async getActions(){let t={param:{entityName:this._entityName,resourceID:this._resourceID}};return d.get().callServiceBroker("ActionButtonsSP.getActions",t).then((t=>{var s;(null===(s=t.actions)||void 0===s?void 0:s.action)&&(this._actions=this._isOrderActions?h.sortAlphabetically(t.actions.action,"description"):t.actions.action)}))}controlDropdown(){this._showDropdown=!this._showDropdown}canShowDropdown(){var t;return this._showDropdown&&(null===(t=this._items)||void 0===t?void 0:t.length)>0}positionDropdown(){var t;const s=null===(t=this._ezButton)||void 0===t?void 0:t.getBoundingClientRect();s&&this._dropdownParent&&(this._dropdownParent.style.top=s.y+s.height+5+"px",this._dropdownParent.style.left=s.x+"px")}closeDropdown(t){const s=null==t?void 0:t.target;s&&(s.closest(".snk-actions-button")||(this._showDropdown=!1))}setEvents(){document.removeEventListener("click",this.closeDropdown.bind(this)),document.addEventListener("click",this.closeDropdown.bind(this)),document.removeEventListener("scroll",this.positionDropdown.bind(this)),document.addEventListener("scroll",this.positionDropdown.bind(this))}async componentWillLoad(){var t;this._application=n.getContextValue("__SNK__APPLICATION__"),this._resourceID=await this._application.getResourceID(),this._isOrderActions=await this._application.getBooleanParam("global.ordenar.acoes.personalizadas"),this._dataUnit=null===(t=this._element.parentElement)||void 0===t?void 0:t.dataUnit,this._entityName=this._dataUnit.name.split("/")[2],this.setEvents(),this.getActions().then((()=>{this.loadItems()}))}async componentDidLoad(){if(this._element&&(u.addIDInfo(this._element),this.positionDropdown(),!await this._application.hasClientEvent(this.CLIENT_EVENT_CONFIRM_NAME))){const t=new P;this._application.addClientEvent(this.CLIENT_EVENT_CONFIRM_NAME,t.clientConfirm)}}componentDidUpdate(){this.positionDropdown()}loadItems(){this._actions&&0!=this._actions.length&&this._actions.forEach((t=>{this._items.push({id:t.actionID,label:t.description})}))}getElementID(t){return{[u.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:u.getInternalIDInfo(t)}}render(){return s(i,null,this._actions&&this._actions.length>0&&s("div",{class:`ez-padding-left--medium snk-actions-button \n ${this.canShowDropdown()?" snk-actions-button--overlap":""}\n `},s("ez-button",Object.assign({ref:t=>this._ezButton=t,iconName:"acao",size:"small",mode:"icon",title:this._application.messagesBuilder.getMessage("snkActionsButton.title.actions",void 0),onClick:()=>this.controlDropdown()},this.getElementID("button"))),s("div",Object.assign({ref:t=>this._dropdownParent=t,class:(this.canShowDropdown()?"snk-actions-button__dropdown--show":"snk-actions-button__dropdown")+"\n "},this.getElementID("dropdown")),this.canShowDropdown()&&s("ez-dropdown",Object.assign({items:this._items,onEzClick:t=>this.handleClick(t)},this.getElementID("dropdown"))))),this.canShowDropdown()&&s("div",Object.assign({class:"ez-scrim ez-scrim--light"},this.getElementID("ezScrim"))))}get _element(){return e(this)}};A.style=".sc-snk-actions-button-h{--snk-actions-button--z-index:var(--most-visible, 3);display:flex;width:fit-content;height:fit-content}.snk-actions-button.sc-snk-actions-button{display:flex;width:fit-content;height:fit-content}.snk-actions-button__dropdown--show.sc-snk-actions-button{display:flex;flex-direction:column;position:fixed}.snk-actions-button__dropdown.sc-snk-actions-button>ez-dropdown.sc-snk-actions-button{position:relative}.snk-actions-button--overlap.sc-snk-actions-button{z-index:var(--snk-actions-button--z-index)}.snk-actions-button__dropdown.sc-snk-actions-button{display:none}";export{A as snk_actions_button}
@@ -1 +1 @@
1
- import{r as e,h as a}from"./p-066ee142.js";import{DataUnit as r,DataType as o,UserInterface as i}from"@sankhyalabs/core";const s=class{constructor(a){e(this,a)}componentWillLoad(){this.dataUnit=new r("testes_com_formulario"),this.dataUnit.metadata={name:"dd://br.com.sankhya.fin.cad.movimentacaoFinanceira/Financeiro",label:"Parceiro",fields:[{name:"CODPARC",label:"Parceiro",dataType:o.NUMBER,userInterface:i.SEARCH,required:!0,properties:{ENTITYNAME:"Parceiro"}}]}}render(){return a("snk-application",null,a("ez-form",{dataUnit:this.dataUnit}))}};s.style=":host{display:block}";export{s as teste_pesquisa}
1
+ import{r as a,h as e}from"./p-d2d301a6.js";import{DataUnit as r,DataType as o,UserInterface as i}from"@sankhyalabs/core";const s=class{constructor(e){a(this,e)}componentWillLoad(){this.dataUnit=new r("testes_com_formulario"),this.dataUnit.metadata={name:"dd://br.com.sankhya.fin.cad.movimentacaoFinanceira/Financeiro",label:"Parceiro",fields:[{name:"CODPARC",label:"Parceiro",dataType:o.NUMBER,userInterface:i.SEARCH,required:!0,properties:{ENTITYNAME:"Parceiro"}}]}}render(){return e("snk-application",null,e("ez-form",{dataUnit:this.dataUnit}))}};s.style=":host{display:block}";export{s as teste_pesquisa}