@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-71072.0 → 0.0.0-bugfix-dev-KB-76362.1

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 (146) hide show
  1. package/dist/cjs/{SnkMessageBuilder-bae64d0d.js → SnkMessageBuilder-7691a2c1.js} +10 -0
  2. package/dist/cjs/index-f9e81701.js +8 -0
  3. package/dist/cjs/input-distinct-search_2.cjs.entry.js +471 -0
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  6. package/dist/cjs/snk-actions-button_4.cjs.entry.js +22 -25
  7. package/dist/cjs/snk-application.cjs.entry.js +2 -18
  8. package/dist/cjs/snk-config-options_3.cjs.entry.js +5 -17
  9. package/dist/cjs/snk-crud.cjs.entry.js +2 -8
  10. package/dist/cjs/snk-data-exporter.cjs.entry.js +5 -5
  11. package/dist/cjs/{snk-data-unit-3d9b6ed4.js → snk-data-unit-7dbdad0e.js} +14 -26
  12. package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
  13. package/dist/cjs/snk-detail-view.cjs.entry.js +2 -2
  14. package/dist/cjs/snk-distinct-search.cjs.entry.js +123 -0
  15. package/dist/cjs/snk-filter-bar_4.cjs.entry.js +0 -9
  16. package/dist/cjs/snk-filter-text.cjs.entry.js +1 -2
  17. package/dist/cjs/snk-grid.cjs.entry.js +2 -10
  18. package/dist/cjs/{snk-guides-viewer-2139481c.js → snk-guides-viewer-eee43c8b.js} +1 -1
  19. package/dist/cjs/snk-guides-viewer.cjs.entry.js +1 -1
  20. package/dist/cjs/snk-simple-crud.cjs.entry.js +4 -7
  21. package/dist/cjs/snk-taskbar.cjs.entry.js +37 -40
  22. package/dist/collection/collection-manifest.json +3 -0
  23. package/dist/collection/components/snk-actions-button/snk-actions-button.js +26 -27
  24. package/dist/collection/components/snk-application/snk-application.js +1 -41
  25. package/dist/collection/components/snk-crud/snk-crud.js +2 -26
  26. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +1 -1
  27. package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js +3 -3
  28. package/dist/collection/components/snk-data-unit/snk-data-unit.js +13 -25
  29. package/dist/collection/components/snk-distinct-search/snk-distinct-search.css +4 -0
  30. package/dist/collection/components/snk-distinct-search/snk-distinct-search.js +372 -0
  31. package/dist/collection/components/snk-distinct-search/subcomponents/input-distinct-search/input-distinct-search.css +110 -0
  32. package/dist/collection/components/snk-distinct-search/subcomponents/input-distinct-search/input-distinct-search.js +544 -0
  33. package/dist/collection/components/snk-distinct-search/subcomponents/search-modal/search-modal.css +28 -0
  34. package/dist/collection/components/snk-distinct-search/subcomponents/search-modal/search-modal.js +593 -0
  35. package/dist/collection/components/snk-distinct-search/utils/filter-distinct-search.js +15 -0
  36. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js +1 -2
  37. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +1 -5
  38. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +0 -20
  39. package/dist/collection/components/snk-form-config/snk-form-config.js +5 -17
  40. package/dist/collection/components/snk-grid/snk-grid.js +2 -28
  41. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +4 -25
  42. package/dist/collection/components/snk-taskbar/snk-taskbar.js +38 -41
  43. package/dist/collection/lib/http/data-fetcher/fetchers/distinct-search-fetcher.js +25 -0
  44. package/dist/collection/lib/http/data-fetcher/fetchers/parameters-fecher.js +1 -7
  45. package/dist/collection/lib/message/SnkMessageBuilder.js +2 -0
  46. package/dist/collection/lib/message/resources/snk-distinct-search.msg.js +9 -0
  47. package/dist/components/SnkMessageBuilder.js +10 -0
  48. package/dist/components/filter-distinct-search.js +17 -0
  49. package/dist/components/index.d.ts +3 -0
  50. package/dist/components/index.js +3 -0
  51. package/dist/components/input-distinct-search.d.ts +11 -0
  52. package/dist/components/input-distinct-search.js +6 -0
  53. package/dist/components/input-distinct-search2.js +264 -0
  54. package/dist/components/search-modal.d.ts +11 -0
  55. package/dist/components/search-modal.js +6 -0
  56. package/dist/components/search-modal2.js +264 -0
  57. package/dist/components/snk-actions-button2.js +26 -27
  58. package/dist/components/snk-application2.js +2 -19
  59. package/dist/components/snk-crud.js +2 -9
  60. package/dist/components/snk-data-exporter2.js +3 -3
  61. package/dist/components/snk-data-unit2.js +13 -25
  62. package/dist/components/snk-detail-view2.js +1 -1
  63. package/dist/components/snk-distinct-search.d.ts +11 -0
  64. package/dist/components/snk-distinct-search.js +163 -0
  65. package/dist/components/snk-filter-bar2.js +0 -6
  66. package/dist/components/snk-filter-item2.js +1 -5
  67. package/dist/components/snk-filter-text.js +1 -2
  68. package/dist/components/snk-form-config2.js +5 -17
  69. package/dist/components/snk-grid2.js +2 -11
  70. package/dist/components/snk-simple-crud2.js +4 -8
  71. package/dist/components/snk-taskbar2.js +38 -41
  72. package/dist/esm/{SnkMessageBuilder-6fff4a4c.js → SnkMessageBuilder-7ace6803.js} +10 -0
  73. package/dist/esm/index-a7d3d3f1.js +8 -0
  74. package/dist/esm/input-distinct-search_2.entry.js +466 -0
  75. package/dist/esm/loader.js +1 -1
  76. package/dist/esm/sankhyablocks.js +1 -1
  77. package/dist/esm/snk-actions-button_4.entry.js +23 -26
  78. package/dist/esm/snk-application.entry.js +3 -19
  79. package/dist/esm/snk-config-options_3.entry.js +5 -17
  80. package/dist/esm/snk-crud.entry.js +2 -8
  81. package/dist/esm/snk-data-exporter.entry.js +5 -5
  82. package/dist/esm/{snk-data-unit-9fa7d2b9.js → snk-data-unit-7a579dbd.js} +14 -26
  83. package/dist/esm/snk-data-unit.entry.js +2 -2
  84. package/dist/esm/snk-detail-view.entry.js +2 -2
  85. package/dist/esm/snk-distinct-search.entry.js +119 -0
  86. package/dist/esm/snk-filter-bar_4.entry.js +1 -10
  87. package/dist/esm/snk-filter-text.entry.js +1 -2
  88. package/dist/esm/snk-grid.entry.js +2 -10
  89. package/dist/esm/{snk-guides-viewer-b7ed39eb.js → snk-guides-viewer-e8ca764a.js} +1 -1
  90. package/dist/esm/snk-guides-viewer.entry.js +1 -1
  91. package/dist/esm/snk-simple-crud.entry.js +4 -7
  92. package/dist/esm/snk-taskbar.entry.js +38 -41
  93. package/dist/sankhyablocks/{p-483ef1fa.entry.js → p-00f9fe5c.entry.js} +1 -1
  94. package/dist/sankhyablocks/p-0e250436.entry.js +1 -0
  95. package/dist/sankhyablocks/p-154aa2a6.entry.js +11 -0
  96. package/dist/sankhyablocks/p-18cb1acb.entry.js +1 -0
  97. package/dist/sankhyablocks/p-1dbd5c18.entry.js +1 -0
  98. package/dist/sankhyablocks/p-2aae03a1.entry.js +1 -0
  99. package/dist/sankhyablocks/p-30ebcbe0.entry.js +1 -0
  100. package/dist/sankhyablocks/p-3858a2e4.entry.js +1 -0
  101. package/dist/sankhyablocks/{p-4138da61.entry.js → p-42130213.entry.js} +1 -1
  102. package/dist/sankhyablocks/p-563b7c28.entry.js +1 -0
  103. package/dist/sankhyablocks/p-96a89d58.entry.js +1 -0
  104. package/dist/sankhyablocks/p-987c7328.entry.js +1 -0
  105. package/dist/sankhyablocks/{p-e390641b.entry.js → p-b389ed49.entry.js} +1 -1
  106. package/dist/sankhyablocks/p-c75fae8e.js +1 -0
  107. package/dist/sankhyablocks/p-d8665750.js +1 -0
  108. package/dist/sankhyablocks/{p-e97be1c8.js → p-e3a285a2.js} +1 -1
  109. package/dist/sankhyablocks/p-f0aaad2b.entry.js +1 -0
  110. package/dist/sankhyablocks/{p-0d2a2e9e.entry.js → p-f4e221b2.entry.js} +1 -1
  111. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  112. package/dist/types/components/snk-actions-button/snk-actions-button.d.ts +2 -3
  113. package/dist/types/components/snk-application/snk-application.d.ts +1 -6
  114. package/dist/types/components/snk-crud/snk-crud.d.ts +0 -4
  115. package/dist/types/components/snk-distinct-search/snk-distinct-search.d.ts +83 -0
  116. package/dist/types/components/snk-distinct-search/subcomponents/input-distinct-search/input-distinct-search.d.ts +105 -0
  117. package/dist/types/components/snk-distinct-search/subcomponents/search-modal/search-modal.d.ts +127 -0
  118. package/dist/types/components/snk-distinct-search/types/index.d.ts +12 -0
  119. package/dist/types/components/snk-distinct-search/utils/filter-distinct-search.d.ts +4 -0
  120. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +0 -2
  121. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +0 -4
  122. package/dist/types/components/snk-grid/snk-grid.d.ts +0 -4
  123. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +0 -2
  124. package/dist/types/components.d.ts +393 -31
  125. package/dist/types/lib/http/data-fetcher/fetchers/distinct-search-fetcher.d.ts +6 -0
  126. package/dist/types/lib/http/data-fetcher/fetchers/parameters-fecher.d.ts +0 -1
  127. package/dist/types/lib/message/resources/snk-distinct-search.msg.d.ts +2 -0
  128. package/package.json +1 -1
  129. package/react/components.d.ts +3 -0
  130. package/react/components.js +3 -0
  131. package/react/components.js.map +1 -1
  132. package/dist/collection/components/snk-filter-bar/filter-item/filter-item-type-mask.enum.js +0 -8
  133. package/dist/sankhyablocks/p-0387d9d7.entry.js +0 -1
  134. package/dist/sankhyablocks/p-17425c72.js +0 -1
  135. package/dist/sankhyablocks/p-1d3ce0d9.entry.js +0 -1
  136. package/dist/sankhyablocks/p-342eeb3b.js +0 -1
  137. package/dist/sankhyablocks/p-3728d2aa.entry.js +0 -11
  138. package/dist/sankhyablocks/p-4e1f992e.entry.js +0 -1
  139. package/dist/sankhyablocks/p-619aeac8.entry.js +0 -1
  140. package/dist/sankhyablocks/p-89c92727.entry.js +0 -1
  141. package/dist/sankhyablocks/p-a3fadd0b.entry.js +0 -1
  142. package/dist/sankhyablocks/p-af7f7b3e.entry.js +0 -1
  143. package/dist/sankhyablocks/p-ec43fcc8.entry.js +0 -1
  144. package/dist/types/components/snk-actions-button/interfaces/index.d.ts +0 -3
  145. package/dist/types/components/snk-filter-bar/filter-item/filter-item-type-mask.enum.d.ts +0 -7
  146. /package/dist/collection/components/{snk-actions-button/interfaces → snk-distinct-search/types}/index.js +0 -0
@@ -0,0 +1,123 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-f9e81701.js');
6
+ const DataFetcher = require('./DataFetcher-e059eb72.js');
7
+ const core = require('@sankhyalabs/core');
8
+ require('./PrintUtils-bcaeb82f.js');
9
+ require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
10
+
11
+ class DistinctSearchFetcher {
12
+ constructor() {
13
+ this.SERVICE = 'mge@Pesquisa.getSelectDistinct';
14
+ }
15
+ buildRequestBody(coluna, instancia) {
16
+ return {
17
+ selectDistinct: {
18
+ instancia,
19
+ coluna,
20
+ }
21
+ };
22
+ }
23
+ parseResponseBody(response) {
24
+ var _a, _b, _c;
25
+ const ocorrencias = (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.ocorrencias) === null || _a === void 0 ? void 0 : _a.ocorrencia) === null || _b === void 0 ? void 0 : _b.map(({ $ }) => $)) !== null && _c !== void 0 ? _c : [];
26
+ return ocorrencias;
27
+ }
28
+ async fetchItens(coluna, instancia) {
29
+ const requestBody = this.buildRequestBody(coluna, instancia);
30
+ const response = await DataFetcher.DataFetcher.get().callServiceBroker(this.SERVICE, requestBody);
31
+ const parsedResponse = this.parseResponseBody(response);
32
+ return parsedResponse;
33
+ }
34
+ }
35
+
36
+ const snkDistinctSearchCss = ".sc-snk-distinct-search-h{display:block;width:100%}";
37
+
38
+ const SnkDistinctSearch = class {
39
+ constructor(hostRef) {
40
+ index.registerInstance(this, hostRef);
41
+ this.changeValue = index.createEvent(this, "changeValue", 7);
42
+ this.onIconClick = () => {
43
+ this._searchModalElement.value = this.value || "";
44
+ this._searchModalElement.openModal();
45
+ };
46
+ this.distinctItems = undefined;
47
+ this.value = "";
48
+ this.label = "";
49
+ this.configSearch = undefined;
50
+ this.maxItems = 100;
51
+ this.debounceTime = 300;
52
+ this.canShowError = false;
53
+ this.mode = 'regular';
54
+ this.restrict = undefined;
55
+ this.errorMessage = undefined;
56
+ }
57
+ /**
58
+ * Método para limpa o campo de entrada de pesquisa
59
+ */
60
+ clearInput() {
61
+ this._inputDistinctSearch.clearInput();
62
+ }
63
+ /**
64
+ * Retorna se o conteúdo é inválido.
65
+ */
66
+ isInvalid() {
67
+ return this._inputDistinctSearch.isInvalid();
68
+ }
69
+ /**
70
+ * Remove o foco do campo
71
+ */
72
+ setBlur() {
73
+ this._inputDistinctSearch.setBlur();
74
+ }
75
+ /**
76
+ * Aplica o foco do campo
77
+ */
78
+ setFocus() {
79
+ this._inputDistinctSearch.setFocus();
80
+ }
81
+ /**
82
+ * Método para fechar o modal
83
+ */
84
+ closeModal() {
85
+ this._searchModalElement.closeModal();
86
+ }
87
+ /**
88
+ * Método para abrir o modal
89
+ */
90
+ openModal() {
91
+ this._searchModalElement.openModal();
92
+ }
93
+ async componentWillLoad() {
94
+ await this.fetchDistinctItems();
95
+ this._application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
96
+ }
97
+ async fetchDistinctItems() {
98
+ const distinctFetcher = new DistinctSearchFetcher();
99
+ const response = await distinctFetcher.fetchItens(this.configSearch.column, this.configSearch.instance);
100
+ this.distinctItems = [...response];
101
+ }
102
+ onChange(event) {
103
+ event.stopPropagation();
104
+ this.value = event.detail.value;
105
+ this._inputDistinctSearch.selectValue(event.detail.value, event.detail.isNewItem);
106
+ this.changeValue.emit(event.detail);
107
+ }
108
+ onPopupClose() {
109
+ this._inputDistinctSearch.setFocus();
110
+ }
111
+ getMessage(key) {
112
+ return this._application.messagesBuilder.getMessage(key, null);
113
+ }
114
+ renderEmptyMessage() {
115
+ return (index.h("span", { innerHTML: this.getMessage("snkDistinctSearch.emptyResult") }));
116
+ }
117
+ render() {
118
+ return (index.h(index.Host, null, index.h("input-distinct-search", { ref: (ref) => this._inputDistinctSearch = ref, application: this._application, label: this.label, distinctItems: this.distinctItems, onChangeValue: this.onChange.bind(this), debounceTime: this.debounceTime, value: this.value, onIconClick: this.onIconClick, maxItems: this.maxItems, canShowError: this.canShowError, mode: this.mode, restrict: this.restrict, errorMessage: this.errorMessage }), index.h("search-modal", { ref: (ref) => this._searchModalElement = ref, application: this._application, listItens: this.distinctItems, onChangeValue: this.onChange.bind(this), restrict: this.restrict, value: this.value, label: this.label, emptyMessage: this.renderEmptyMessage(), maxItens: this.maxItems, debounceTime: this.debounceTime, canShowError: this.canShowError, mode: this.mode, errorMessage: this.errorMessage, onPopupClose: this.onPopupClose.bind(this) })));
119
+ }
120
+ };
121
+ SnkDistinctSearch.style = snkDistinctSearchCss;
122
+
123
+ exports.snk_distinct_search = SnkDistinctSearch;
@@ -290,7 +290,6 @@ const SnkFilterBar = class {
290
290
  this.disablePersonalizedFilter = undefined;
291
291
  this.filterBarLegacyConfigName = undefined;
292
292
  this.autoLoad = undefined;
293
- this.afterApplyConfig = undefined;
294
293
  this.allowDefault = undefined;
295
294
  this.scrollerLocked = false;
296
295
  this.showPersonalizedFilter = false;
@@ -426,7 +425,6 @@ const SnkFilterBar = class {
426
425
  return this.filterConfig.find(item => item.type === filterItemType_enum.FilterItemType.PERSONALIZED);
427
426
  }
428
427
  async processAfterUpdateConfig() {
429
- var _a;
430
428
  if (this._loadingPending) {
431
429
  if (await this._application.isLoadedByPk() && !this._configUpdated)
432
430
  return;
@@ -441,7 +439,6 @@ const SnkFilterBar = class {
441
439
  if (this._configUpdated) {
442
440
  this._configUpdated = false;
443
441
  ConfigStorage.ConfigStorage.saveFilterBarConfig(this.filterConfig, this.configName, this.resourceID);
444
- (_a = this.afterApplyConfig) === null || _a === void 0 ? void 0 : _a.call(this);
445
442
  }
446
443
  }
447
444
  async doLoadData(forceReload = false) {
@@ -646,9 +643,7 @@ const SnkFilterBar = class {
646
643
  */
647
644
  async showFilterModal() {
648
645
  const callbackOnApplyFilter = (filters) => {
649
- var _a;
650
646
  this.filterConfig = filters.map(this.normalizeItem).sort((a, b) => this._filtersComparator(a, b));
651
- (_a = this.afterApplyConfig) === null || _a === void 0 ? void 0 : _a.call(this);
652
647
  };
653
648
  let filtersConfigCopy = core.ObjectUtils.copy(this.filterConfig);
654
649
  filtersConfigCopy = filtersConfigCopy.sort((itemA, itemB) => {
@@ -942,10 +937,6 @@ const SnkFilterItem = class {
942
937
  return `${label}: ${this.getMessage('snkFilterBar.onlyEndToltip')} ${Number(end)}`;
943
938
  }
944
939
  }
945
- if (this.config.mask) {
946
- const _maskFormatter = new core.MaskFormatter(this.config.mask);
947
- return `${label}: ${_maskFormatter.format(value)}`;
948
- }
949
940
  return `${label}: ${value}`;
950
941
  }
951
942
  return label;
@@ -25,11 +25,10 @@ const SnkFilterText = class {
25
25
  }
26
26
  }
27
27
  render() {
28
- var _a;
29
28
  if (!this.config) {
30
29
  return undefined;
31
30
  }
32
- return (index.h("ez-text-input", { id: this.config.id, ref: ref => this._textInputElement = ref, label: this.config.label, value: this.config.value, mask: (_a = this.config) === null || _a === void 0 ? void 0 : _a.mask, cleanValueMask: true }));
31
+ return (index.h("ez-text-input", { id: this.config.id, ref: ref => this._textInputElement = ref, label: this.config.label, value: this.config.value }));
33
32
  }
34
33
  get _element() { return index.getElement(this); }
35
34
  };
@@ -146,7 +146,6 @@ const SnkGrid = class {
146
146
  this.autoLoad = undefined;
147
147
  this.autoFocus = true;
148
148
  this.enableGridInsert = false;
149
- this.enableLockManger = false;
150
149
  }
151
150
  /**
152
151
  * Exibe a janela de configurações da grade.
@@ -234,17 +233,10 @@ const SnkGrid = class {
234
233
  this._grid.setFocus();
235
234
  }
236
235
  async handleClick(event) {
237
- var _a;
238
236
  if (this.hasToBlockEvent(event)) {
239
237
  event.preventDefault();
240
238
  event.stopPropagation();
241
- if (!await this._dataUnit.cancelEdition())
242
- return;
243
- const newEvent = new event.constructor(event.type, event);
244
- (_a = event.target) === null || _a === void 0 ? void 0 : _a.dispatchEvent(newEvent);
245
- }
246
- if (this._grid && !this._grid.contains(event.target)) {
247
- this._grid.stopEdit();
239
+ await this._dataUnit.cancelEdition();
248
240
  }
249
241
  }
250
242
  hasToBlockEvent(event) {
@@ -535,7 +527,7 @@ const SnkGrid = class {
535
527
  return undefined;
536
528
  }
537
529
  return (index.h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, index.h("div", { class: "snk-grid__header ez-margin-bottom--extra-small" }, this._showSnkFilterBar &&
538
- index.h(index.Fragment, null, index.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 }), index.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), index.h("snk-taskbar", { class: "ez-padding-left--medium", "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' }, index.h("slot", { name: this.topTaskbarCustomSlotId }))), index.h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === index$1.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) => { this.gridConfigChangeHandler(evt); }, 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, enableLockManger: this.enableLockManger }, index.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 }, index.h("slot", { name: this.gridHeaderCustomSlotId }))), index.h("div", { class: "ez-col ez-col--sd-12" }, index.h("slot", { name: "SnkGridFooter" })), index.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
530
+ index.h(index.Fragment, null, index.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 }), index.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), index.h("snk-taskbar", { class: "ez-padding-left--medium", "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' }, index.h("slot", { name: this.topTaskbarCustomSlotId }))), index.h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === index$1.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) => { this.gridConfigChangeHandler(evt); }, 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 }, index.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 }, index.h("slot", { name: this.gridHeaderCustomSlotId }))), index.h("div", { class: "ez-col ez-col--sd-12" }, index.h("slot", { name: "SnkGridFooter" })), index.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
539
531
  }
540
532
  get _element() { return index.getElement(this); }
541
533
  static get watchers() { return {
@@ -456,7 +456,7 @@ const SnkGuidesViewer = class {
456
456
  await this.openGuideNavigator(guideName);
457
457
  }
458
458
  if (action.type === core.Action.METADATA_LOADED) {
459
- this.loadGuides(this.noGuideSelected());
459
+ this.loadGuides(false);
460
460
  }
461
461
  }
462
462
  async addErrorBadgeToGuide(guideName) {
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const snkGuidesViewer = require('./snk-guides-viewer-2139481c.js');
5
+ const snkGuidesViewer = require('./snk-guides-viewer-eee43c8b.js');
6
6
  require('./index-f9e81701.js');
7
7
  require('@sankhyalabs/core');
8
8
  require('./SnkFormConfigManager-63369164.js');
@@ -121,7 +121,6 @@ const SnkSimpleCrud = class {
121
121
  this.mode = constants.SIMPLE_CRUD_MODE.SERVER;
122
122
  this.gridConfig = undefined;
123
123
  this.formConfig = undefined;
124
- this.enableLockManger = false;
125
124
  this._formFields = [];
126
125
  this._fieldsProps = new Map();
127
126
  this._enableContinuousInsert = true;
@@ -806,18 +805,16 @@ const SnkSimpleCrud = class {
806
805
  return;
807
806
  this.goToView(constants.VIEW_MODE.FORM);
808
807
  }
809
- renderTaskbarContent() {
810
- var _a;
811
- return (index$1.h("snk-taskbar", { class: this._currentViewMode === constants.VIEW_MODE.FORM && "ez-box ez-box--shadow ez-padding--small", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, actionsList: this.getActionsList(), disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, "data-exporter-store-key": this.getDataExporterStoreKey(), slot: "leftButtons", presentationMode: index.PresentationMode.SECONDARY }, index$1.h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })));
812
- }
813
808
  /* istanbul ignore next */
814
809
  render() {
810
+ var _a;
815
811
  if (this.dataUnit == undefined) {
816
812
  return;
817
813
  }
818
- return (index$1.h("snk-data-unit", { ref: ref => this._snkDataUnit = ref, class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), pageSize: this.getPageSize(), onInsertionMode: this.handleDataUnitOnInsertionMode.bind(this), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === constants.VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail, onDataUnitFieldsHidded: this.updateFormConfig.bind(this), domainMessagesBuilder: this.domainMessagesBuilder }, index$1.h("header", null, index$1.h("slot", { name: "snkSimpleCrudHeader" })), index$1.h("section", { class: "ez-box ez-box--shadow simple-crud__container-section" }, index$1.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, index$1.h("stack-item", null, index$1.h("ez-grid", { class: "ez-margin-bottom--large", ref: ref => this._grid = ref, dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(constants.VIEW_MODE.FORM), onConfigChange: evt => this.gridConfigChangeHandler(evt), columnfilterDataSource: this.dataUnit.name && this.dataUnit.name.includes(dataunitFetcher.InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
814
+ const taskbarContent = (index$1.h("snk-taskbar", { class: this._currentViewMode === constants.VIEW_MODE.FORM && "ez-box ez-box--shadow ez-padding--small", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, actionsList: this.getActionsList(), disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, "data-exporter-store-key": this.getDataExporterStoreKey(), slot: "leftButtons", presentationMode: index.PresentationMode.SECONDARY }, index$1.h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })));
815
+ return (index$1.h("snk-data-unit", { ref: ref => this._snkDataUnit = ref, class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), pageSize: this.getPageSize(), onInsertionMode: this.handleDataUnitOnInsertionMode.bind(this), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === constants.VIEW_MODE.GRID && !this.enableGridInsert, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail, onDataUnitFieldsHidded: this.updateFormConfig.bind(this), domainMessagesBuilder: this.domainMessagesBuilder }, index$1.h("header", null, index$1.h("slot", { name: "snkSimpleCrudHeader" })), index$1.h("section", { class: "ez-box ez-box--shadow simple-crud__container-section" }, this._currentViewMode === constants.VIEW_MODE.FORM && taskbarContent, index$1.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, index$1.h("stack-item", null, index$1.h("ez-grid", { class: "ez-margin-bottom--large", ref: ref => this._grid = ref, dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(constants.VIEW_MODE.FORM), onConfigChange: evt => this.gridConfigChangeHandler(evt), columnfilterDataSource: this.dataUnit.name && this.dataUnit.name.includes(dataunitFetcher.InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
819
816
  ? undefined
820
- : this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this._enableContinuousInsert, enableLockManger: this.enableLockManger }, this.renderTaskbarContent(), index$1.h("div", { slot: "footer" }, index$1.h("slot", { name: "snkSimpleCrudFooter" })))), index$1.h("stack-item", null, this.renderTaskbarContent(), index$1.h("ez-form", { ref: (ref) => this._form = ref, class: `ez-margin-top--large ${this.handleShowFormConfig() ? "simple-crud__form--hidden" : ""}`, dataUnit: this.dataUnit, config: this.getFormConfig(), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), this.handleShowFormConfig() && index$1.h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this.dataUnit, configManager: this._formConfigManager, onConfigClose: () => this.closeFormConfig() })), this.messagesBuilder && index$1.h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.goToView(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showConfiguratorButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this.resolveResourceID(), customContainerId: this._customContainerId })), index$1.h("div", { id: `${this._customContainerId}` }, index$1.h("slot", { name: "SnkConfigContainerSlot" }))), index$1.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index$1.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this.gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resolveResourceID() }))));
817
+ : this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this._enableContinuousInsert }, this._currentViewMode === constants.VIEW_MODE.GRID && taskbarContent, index$1.h("div", { slot: "footer" }, index$1.h("slot", { name: "snkSimpleCrudFooter" })))), index$1.h("stack-item", null, index$1.h("ez-form", { ref: (ref) => this._form = ref, class: `ez-margin-top--large ${this.handleShowFormConfig() ? "simple-crud__form--hidden" : ""}`, dataUnit: this.dataUnit, config: this.getFormConfig(), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), this.handleShowFormConfig() && index$1.h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this.dataUnit, configManager: this._formConfigManager, onConfigClose: () => this.closeFormConfig() })), this.messagesBuilder && index$1.h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.goToView(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showConfiguratorButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this.resolveResourceID(), customContainerId: this._customContainerId })), index$1.h("div", { id: `${this._customContainerId}` }, index$1.h("slot", { name: "SnkConfigContainerSlot" }))), index$1.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index$1.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this.gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resolveResourceID() }))));
821
818
  }
822
819
  get _element() { return index$1.getElement(this); }
823
820
  static get watchers() { return {
@@ -160,44 +160,42 @@ const SnkTaskbar = class {
160
160
  return key ? (_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage(key, {}) : "";
161
161
  }
162
162
  elementClick(elem) {
163
- core.LockManager.whenResolve(this._element, core.LockManagerOperation.TASKBAR_CLICK).then(() => {
164
- if (this.dataUnit) {
165
- switch (elem) {
166
- case taskbarElements.TaskbarElement.PREVIOUS:
167
- this.dataUnit.previousRecord();
168
- break;
169
- case taskbarElements.TaskbarElement.NEXT:
170
- this.dataUnit.nextRecord();
171
- break;
172
- case taskbarElements.TaskbarElement.REFRESH:
173
- this.dataUnit.loadData();
174
- break;
175
- case taskbarElements.TaskbarElement.CLONE:
176
- this.dataUnit.copySelected();
177
- break;
178
- case taskbarElements.TaskbarElement.REMOVE:
179
- this.dataUnit.removeSelectedRecords();
180
- break;
181
- case taskbarElements.TaskbarElement.INSERT:
182
- this.dataUnit.addRecord();
183
- break;
184
- case taskbarElements.TaskbarElement.CANCEL:
185
- this.dataUnit.cancelEdition();
186
- break;
187
- case taskbarElements.TaskbarElement.SAVE:
188
- if (!this._isWaitingForSave) {
189
- this._isWaitingForSave = true;
190
- this.dataUnit.saveData()
191
- .finally(() => {
192
- this._isWaitingForSave = false;
193
- });
194
- }
195
- break;
196
- }
163
+ if (this.dataUnit) {
164
+ switch (elem) {
165
+ case taskbarElements.TaskbarElement.PREVIOUS:
166
+ this.dataUnit.previousRecord();
167
+ break;
168
+ case taskbarElements.TaskbarElement.NEXT:
169
+ this.dataUnit.nextRecord();
170
+ break;
171
+ case taskbarElements.TaskbarElement.REFRESH:
172
+ this.dataUnit.loadData();
173
+ break;
174
+ case taskbarElements.TaskbarElement.CLONE:
175
+ this.dataUnit.copySelected();
176
+ break;
177
+ case taskbarElements.TaskbarElement.REMOVE:
178
+ this.dataUnit.removeSelectedRecords();
179
+ break;
180
+ case taskbarElements.TaskbarElement.INSERT:
181
+ this.dataUnit.addRecord();
182
+ break;
183
+ case taskbarElements.TaskbarElement.CANCEL:
184
+ this.dataUnit.cancelEdition();
185
+ break;
186
+ case taskbarElements.TaskbarElement.SAVE:
187
+ if (!this._isWaitingForSave) {
188
+ this._isWaitingForSave = true;
189
+ this.dataUnit.saveData()
190
+ .finally(() => {
191
+ this._isWaitingForSave = false;
192
+ });
193
+ }
194
+ break;
197
195
  }
198
- if (this.isEnabled(elem))
199
- this.actionClick.emit(elem);
200
- });
196
+ }
197
+ if (this.isEnabled(elem))
198
+ this.actionClick.emit(elem);
201
199
  }
202
200
  isEnabled(elem) {
203
201
  if (!this.isAllowed(elem)) {
@@ -401,10 +399,9 @@ const SnkTaskbar = class {
401
399
  this._lastWidth = this._element.getBoundingClientRect().width;
402
400
  }
403
401
  disconnectedCallback() {
404
- var _a, _b;
405
- (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.unsubscribe(this.onSaveEvent);
402
+ var _a;
406
403
  this.unlinkAllCustomElements();
407
- (_b = this._overFlowWatcher) === null || _b === void 0 ? void 0 : _b.destroy();
404
+ (_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.destroy();
408
405
  }
409
406
  unlinkAllCustomElements() {
410
407
  var _a;
@@ -19,6 +19,9 @@
19
19
  "./components/snk-custom-slot-elements/snk-custom-slot-elements.js",
20
20
  "./components/snk-data-exporter/snk-data-exporter.js",
21
21
  "./components/snk-data-exporter/exporter-email-sender/snk-exporter-email-sender.js",
22
+ "./components/snk-distinct-search/snk-distinct-search.js",
23
+ "./components/snk-distinct-search/subcomponents/input-distinct-search/input-distinct-search.js",
24
+ "./components/snk-distinct-search/subcomponents/search-modal/search-modal.js",
22
25
  "./components/snk-entity-list/snk-entity-list.js",
23
26
  "./components/snk-filter-bar/snk-filter-bar.js",
24
27
  "./components/snk-filter-bar/filter-item/editors/snk-personalized-filter-editor/snk-personalized-filter-editor.js",
@@ -1,5 +1,5 @@
1
1
  import { h, Host } from '@stencil/core';
2
- import { ApplicationContext, ArrayUtils, ElementIDUtils, ServiceUtils, StorageType } from '@sankhyalabs/core';
2
+ import { ApplicationContext, ArrayUtils, ElementIDUtils } from '@sankhyalabs/core';
3
3
  import { DataFetcher } from '../../lib/http/data-fetcher/DataFetcher';
4
4
  import ExecutorFactory from './actions/factory/executor.factory';
5
5
  import Actions from './actions';
@@ -8,7 +8,6 @@ import ResourceIDUtils from '../../lib/resourceid/ResourceIDUtils';
8
8
  export class SnkActionsButton {
9
9
  constructor() {
10
10
  this.CLIENT_EVENT_CONFIRM_NAME = "br.com.sankhya.actionbutton.clientconfirm";
11
- this._actions = [];
12
11
  this.handleClick = (evt) => {
13
12
  const selectedAction = this._actions.find((action) => action.actionID == evt.detail.id);
14
13
  const executor = new ExecutorFactory(selectedAction.type).executor;
@@ -18,22 +17,27 @@ export class SnkActionsButton {
18
17
  };
19
18
  this._items = [];
20
19
  this._showDropdown = false;
20
+ this._actions = [];
21
+ this._isOrderActions = false;
21
22
  }
22
23
  async getActions() {
23
- const actions = await ServiceUtils.useCacheWithService(`SnkActionsButton_${this._entityName}-${this._resourceID}`, async () => {
24
+ let param = {
25
+ param: {
26
+ entityName: this._entityName,
27
+ resourceID: this._resourceID
28
+ }
29
+ };
30
+ return DataFetcher.get().callServiceBroker('ActionButtonsSP.getActions', param).then((result) => {
24
31
  var _a;
25
- const param = {
26
- param: {
27
- entityName: this._entityName,
28
- resourceID: this._resourceID,
29
- },
30
- };
31
- const result = await DataFetcher.get().callServiceBroker('ActionButtonsSP.getActions', param);
32
- return ((_a = result.actions) === null || _a === void 0 ? void 0 : _a.action) || [];
33
- }, StorageType.IN_MEMORY_CACHE);
34
- this._actions = SnkActionsButton.parameters.isOrderActions
35
- ? ArrayUtils.sortAlphabetically(actions, 'description')
36
- : actions;
32
+ if (!((_a = result.actions) === null || _a === void 0 ? void 0 : _a.action))
33
+ return;
34
+ if (this._isOrderActions) {
35
+ this._actions = ArrayUtils.sortAlphabetically(result.actions.action, 'description');
36
+ }
37
+ else {
38
+ this._actions = result.actions.action;
39
+ }
40
+ });
37
41
  }
38
42
  controlDropdown() {
39
43
  this._showDropdown = !this._showDropdown;
@@ -66,7 +70,7 @@ export class SnkActionsButton {
66
70
  }
67
71
  async componentWillLoad() {
68
72
  this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
69
- await this.loadParameters();
73
+ this._isOrderActions = await this._application.getBooleanParam('global.ordenar.acoes.personalizadas');
70
74
  const snkDataUnit = this._element.parentElement;
71
75
  this._dataUnit = snkDataUnit === null || snkDataUnit === void 0 ? void 0 : snkDataUnit.dataUnit;
72
76
  this._resourceID = snkDataUnit === null || snkDataUnit === void 0 ? void 0 : snkDataUnit.resourceID;
@@ -75,8 +79,9 @@ export class SnkActionsButton {
75
79
  this._resourceID = await ResourceIDUtils.getResourceID();
76
80
  }
77
81
  this.setEvents();
78
- await this.getActions();
79
- this.loadItems();
82
+ this.getActions().then(() => {
83
+ this.loadItems();
84
+ });
80
85
  }
81
86
  async componentDidLoad() {
82
87
  if (!this._element)
@@ -103,11 +108,6 @@ export class SnkActionsButton {
103
108
  [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: ElementIDUtils.getInternalIDInfo(sufix)
104
109
  };
105
110
  }
106
- async loadParameters() {
107
- if (SnkActionsButton.parameters.isOrderActions != null)
108
- return;
109
- SnkActionsButton.parameters.isOrderActions = await this._application.getBooleanParam('global.ordenar.acoes.personalizadas');
110
- }
111
111
  render() {
112
112
  return (h(Host, null, (this._actions && this._actions.length > 0) &&
113
113
  (h("div", { class: `ez-padding-left--medium snk-actions-button
@@ -134,11 +134,10 @@ export class SnkActionsButton {
134
134
  static get states() {
135
135
  return {
136
136
  "_items": {},
137
- "_showDropdown": {}
137
+ "_showDropdown": {},
138
+ "_actions": {},
139
+ "_isOrderActions": {}
138
140
  };
139
141
  }
140
142
  static get elementRef() { return "_element"; }
141
143
  }
142
- SnkActionsButton.parameters = {
143
- isOrderActions: null
144
- };
@@ -16,7 +16,6 @@ import UrlUtils from "../../lib/utils/urlutils";
16
16
  import Workspace from "../../lib/workspace/workspace";
17
17
  import { SnkErrorHandler } from "./errorhandler/snk-error-handler";
18
18
  import RequestListenerFactory from "./request-listener/RequestListenerFactory";
19
- import PreloadManager from "../../lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager";
20
19
  /**
21
20
  * É possível customizar as mensagens dos blocos de construção através de um pequeno modulo na estrutura da aplicação:
22
21
  * - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
@@ -518,16 +517,6 @@ export class SnkApplication {
518
517
  async isLoadedByPk() {
519
518
  return Promise.resolve(this._isLoadedByPk);
520
519
  }
521
- /**
522
- * Remove registro do cache do PreLoader do dataunit.
523
- * Deve ser usado quando existe um dataunit usando loader do application, mas o removeLoader está sendo sobrescrito.
524
- */
525
- async preloadMangerRemoveRecord(dataUnit, recordsIDs) {
526
- const records = recordsIDs.map(id => {
527
- return { "__record__id__": id };
528
- });
529
- PreloadManager.removeRecords(dataUnit, records);
530
- }
531
520
  async getAuthList(auth) {
532
521
  return await (new MGEAuthorization()).parseFromJSON(auth);
533
522
  }
@@ -1108,7 +1097,7 @@ export class SnkApplication {
1108
1097
  "mutable": false,
1109
1098
  "complexType": {
1110
1099
  "original": "LoadByPkHandler",
1111
- "resolved": "(objPK: { pk: any; }, redirectFrom?: string) => void",
1100
+ "resolved": "(objPK: { pk: Record<string, any>; }, redirectFrom?: string) => void",
1112
1101
  "references": {
1113
1102
  "LoadByPkHandler": {
1114
1103
  "location": "global"
@@ -2212,35 +2201,6 @@ export class SnkApplication {
2212
2201
  }]
2213
2202
  }
2214
2203
  },
2215
- "preloadMangerRemoveRecord": {
2216
- "complexType": {
2217
- "signature": "(dataUnit: DataUnit, recordsIDs: Array<string>) => Promise<void>",
2218
- "parameters": [{
2219
- "tags": [],
2220
- "text": ""
2221
- }, {
2222
- "tags": [],
2223
- "text": ""
2224
- }],
2225
- "references": {
2226
- "Promise": {
2227
- "location": "global"
2228
- },
2229
- "DataUnit": {
2230
- "location": "import",
2231
- "path": "@sankhyalabs/core"
2232
- },
2233
- "Array": {
2234
- "location": "global"
2235
- }
2236
- },
2237
- "return": "Promise<void>"
2238
- },
2239
- "docs": {
2240
- "text": "Remove registro do cache do PreLoader do dataunit.\nDeve ser usado quando existe um dataunit usando loader do application, mas o removeLoader est\u00E1 sendo sobrescrito.",
2241
- "tags": []
2242
- }
2243
- },
2244
2204
  "executeSearch": {
2245
2205
  "complexType": {
2246
2206
  "signature": "(searchArgument: ISearchArgument, fieldName: string, dataUnit: DataUnit) => Promise<Array<IOption> | IOption>",