@sankhyalabs/sankhyablocks 8.1.0-dev.10 → 8.1.0-dev.12

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 (209) hide show
  1. package/dist/cjs/{ConfigStorage-e32e1391.js → ConfigStorage-42601579.js} +163 -51
  2. package/dist/cjs/{DataFetcher-d2c6ae38.js → DataFetcher-370cc8f2.js} +38 -29
  3. package/dist/cjs/ISave-d68ce3cd.js +8 -0
  4. package/dist/cjs/ResourceIDUtils-5ff86aa7.js +12 -0
  5. package/dist/cjs/{SnkFormConfigManager-5e61b0a9.js → SnkFormConfigManager-e5a28b2e.js} +19 -21
  6. package/dist/cjs/{auth-fetcher-da975ac5.js → auth-fetcher-c42326e9.js} +2 -2
  7. package/dist/cjs/{dataunit-fetcher-58ad78a7.js → dataunit-fetcher-eab8050e.js} +1 -1
  8. package/dist/cjs/{form-config-fetcher-761994b9.js → form-config-fetcher-6704319c.js} +66 -3
  9. package/dist/cjs/loader.cjs.js +1 -1
  10. package/dist/cjs/{pesquisa-fetcher-bb0bb679.js → pesquisa-fetcher-84d392c7.js} +1 -1
  11. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  12. package/dist/cjs/snk-actions-button.cjs.entry.js +18 -11
  13. package/dist/cjs/snk-application.cjs.entry.js +49 -44
  14. package/dist/cjs/snk-attach.cjs.entry.js +7 -13
  15. package/dist/cjs/snk-configurator.cjs.entry.js +2 -1
  16. package/dist/cjs/snk-crud.cjs.entry.js +24 -10
  17. package/dist/cjs/snk-data-exporter.cjs.entry.js +2 -2
  18. package/dist/cjs/{snk-data-unit-e89e07bd.js → snk-data-unit-80a00ae4.js} +4 -3
  19. package/dist/cjs/snk-data-unit.cjs.entry.js +1 -1
  20. package/dist/cjs/snk-detail-view.cjs.entry.js +13 -12
  21. package/dist/cjs/snk-entity-list.cjs.entry.js +0 -4
  22. package/dist/cjs/snk-filter-bar.cjs.entry.js +13 -16
  23. package/dist/cjs/snk-filter-detail.cjs.entry.js +1 -15
  24. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +5 -19
  25. package/dist/cjs/snk-form-config.cjs.entry.js +6 -17
  26. package/dist/cjs/snk-form.cjs.entry.js +11 -8
  27. package/dist/cjs/snk-grid-config.cjs.entry.js +5 -6
  28. package/dist/cjs/snk-grid.cjs.entry.js +13 -17
  29. package/dist/cjs/{snk-guides-viewer-eb0a79a4.js → snk-guides-viewer-fd785f55.js} +16 -7
  30. package/dist/cjs/snk-guides-viewer.cjs.entry.js +8 -8
  31. package/dist/cjs/snk-personalized-filter.cjs.entry.js +13 -16
  32. package/dist/cjs/snk-print-selector.cjs.entry.js +1 -1
  33. package/dist/cjs/snk-simple-crud.cjs.entry.js +7 -3
  34. package/dist/cjs/snk-taskbar.cjs.entry.js +2 -1
  35. package/dist/collection/components/snk-actions-button/actions/index.js +3 -4
  36. package/dist/collection/components/snk-actions-button/snk-actions-button.js +8 -4
  37. package/dist/collection/components/snk-application/snk-application.js +60 -65
  38. package/dist/collection/components/snk-configurator/snk-configurator.js +19 -1
  39. package/dist/collection/components/snk-crud/snk-crud.js +18 -6
  40. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +20 -2
  41. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +25 -28
  42. package/dist/collection/components/snk-data-unit/snk-data-unit.js +21 -4
  43. package/dist/collection/components/snk-entity-list/snk-entity-list.js +0 -23
  44. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +2 -12
  45. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +1 -1
  46. package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js +21 -16
  47. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +27 -11
  48. package/dist/collection/components/snk-form/SnkFormConfigManager.js +17 -19
  49. package/dist/collection/components/snk-form/snk-form.js +24 -2
  50. package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.js +5 -15
  51. package/dist/collection/components/snk-grid/snk-grid.js +27 -12
  52. package/dist/collection/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.js +19 -1
  53. package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js +28 -12
  54. package/dist/collection/components/snk-taskbar/snk-taskbar.js +19 -1
  55. package/dist/collection/lib/configs/ConfigStorage.js +33 -44
  56. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +38 -29
  57. package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +0 -24
  58. package/dist/collection/lib/index.js +10 -0
  59. package/dist/collection/lib/resourceid/ResourceIDUtils.js +7 -0
  60. package/dist/components/ConfigStorage.js +161 -48
  61. package/dist/components/DataFetcher.js +38 -29
  62. package/dist/components/ResourceIDUtils.js +10 -0
  63. package/dist/components/SnkFormConfigManager.js +17 -19
  64. package/dist/components/auth-fetcher.js +1 -1
  65. package/dist/components/form-config-fetcher.js +64 -2
  66. package/dist/components/snk-actions-button2.js +23 -9
  67. package/dist/components/snk-application2.js +134 -128
  68. package/dist/components/snk-attach2.js +1 -8
  69. package/dist/components/snk-configurator2.js +3 -1
  70. package/dist/components/snk-crud.js +22 -6
  71. package/dist/components/snk-data-unit2.js +5 -3
  72. package/dist/components/snk-detail-view2.js +18 -8
  73. package/dist/components/snk-entity-list.js +0 -4
  74. package/dist/components/snk-filter-bar2.js +11 -11
  75. package/dist/components/snk-filter-detail2.js +2 -12
  76. package/dist/components/snk-filter-modal-item2.js +5 -16
  77. package/dist/components/snk-form-config2.js +5 -15
  78. package/dist/components/snk-form.js +8 -2
  79. package/dist/components/snk-grid-config2.js +4 -2
  80. package/dist/components/snk-grid2.js +11 -12
  81. package/dist/components/snk-personalized-filter2.js +11 -11
  82. package/dist/components/snk-simple-crud2.js +5 -1
  83. package/dist/components/snk-taskbar2.js +3 -1
  84. package/dist/esm/{ConfigStorage-b6aefe42.js → ConfigStorage-2915a841.js} +162 -49
  85. package/dist/esm/{DataFetcher-aaaff866.js → DataFetcher-0b121ffb.js} +38 -29
  86. package/dist/esm/ISave-4412b20c.js +8 -0
  87. package/dist/esm/ResourceIDUtils-a114189a.js +10 -0
  88. package/dist/esm/{SnkFormConfigManager-80901f2d.js → SnkFormConfigManager-8005340f.js} +19 -21
  89. package/dist/esm/{auth-fetcher-7860d777.js → auth-fetcher-643f240e.js} +1 -1
  90. package/dist/esm/{dataunit-fetcher-9dfcdb1d.js → dataunit-fetcher-6423d6eb.js} +1 -1
  91. package/dist/esm/{form-config-fetcher-4a34b86a.js → form-config-fetcher-77cdb26c.js} +65 -3
  92. package/dist/esm/loader.js +1 -1
  93. package/dist/esm/{pesquisa-fetcher-01d058e6.js → pesquisa-fetcher-c5a3c564.js} +1 -1
  94. package/dist/esm/sankhyablocks.js +1 -1
  95. package/dist/esm/snk-actions-button.entry.js +18 -11
  96. package/dist/esm/snk-application.entry.js +49 -44
  97. package/dist/esm/snk-attach.entry.js +3 -9
  98. package/dist/esm/snk-configurator.entry.js +2 -1
  99. package/dist/esm/snk-crud.entry.js +24 -10
  100. package/dist/esm/snk-data-exporter.entry.js +2 -2
  101. package/dist/esm/{snk-data-unit-8c4d944d.js → snk-data-unit-3ab57d1a.js} +4 -3
  102. package/dist/esm/snk-data-unit.entry.js +1 -1
  103. package/dist/esm/snk-detail-view.entry.js +13 -12
  104. package/dist/esm/snk-entity-list.entry.js +0 -4
  105. package/dist/esm/snk-filter-bar.entry.js +13 -16
  106. package/dist/esm/snk-filter-detail.entry.js +2 -16
  107. package/dist/esm/snk-filter-modal-item.entry.js +6 -20
  108. package/dist/esm/snk-form-config.entry.js +7 -18
  109. package/dist/esm/snk-form.entry.js +11 -8
  110. package/dist/esm/snk-grid-config.entry.js +5 -6
  111. package/dist/esm/snk-grid.entry.js +13 -17
  112. package/dist/esm/{snk-guides-viewer-ee42eb53.js → snk-guides-viewer-43b550a2.js} +16 -7
  113. package/dist/esm/snk-guides-viewer.entry.js +8 -8
  114. package/dist/esm/snk-personalized-filter.entry.js +13 -16
  115. package/dist/esm/snk-print-selector.entry.js +1 -1
  116. package/dist/esm/snk-simple-crud.entry.js +7 -3
  117. package/dist/esm/snk-taskbar.entry.js +2 -1
  118. package/dist/sankhyablocks/p-1108ed0e.entry.js +1 -0
  119. package/dist/sankhyablocks/p-18ead46b.entry.js +1 -0
  120. package/dist/sankhyablocks/p-1986cfa4.js +26 -0
  121. package/dist/sankhyablocks/p-1c7b4bad.entry.js +1 -0
  122. package/dist/sankhyablocks/p-48a40939.js +1 -0
  123. package/dist/sankhyablocks/p-508822c3.entry.js +1 -0
  124. package/dist/sankhyablocks/{p-85affa29.js → p-53a7ab6c.js} +1 -1
  125. package/dist/sankhyablocks/{p-77ecc583.entry.js → p-58b84e45.entry.js} +1 -1
  126. package/dist/sankhyablocks/p-688dcb4c.js +1 -0
  127. package/dist/sankhyablocks/{p-05bcad8a.entry.js → p-774afde8.entry.js} +1 -1
  128. package/dist/sankhyablocks/p-84b9208d.entry.js +1 -0
  129. package/dist/sankhyablocks/p-85dfb90b.entry.js +1 -0
  130. package/dist/sankhyablocks/p-86dda34d.js +1 -0
  131. package/dist/sankhyablocks/p-9a270401.entry.js +1 -0
  132. package/dist/sankhyablocks/{p-bee6b5d7.js → p-9bfc7124.js} +1 -1
  133. package/dist/sankhyablocks/p-9d81ad53.entry.js +1 -0
  134. package/dist/sankhyablocks/p-9e7d65a4.js +1 -0
  135. package/dist/sankhyablocks/p-a107474c.js +56 -0
  136. package/dist/sankhyablocks/p-a28470ae.entry.js +1 -0
  137. package/dist/sankhyablocks/p-b9376677.entry.js +1 -0
  138. package/dist/sankhyablocks/p-c7c035eb.js +1 -0
  139. package/dist/sankhyablocks/p-caaef934.js +1 -0
  140. package/dist/sankhyablocks/p-cf65dbb2.entry.js +1 -0
  141. package/dist/sankhyablocks/p-d4f9ee17.entry.js +1 -0
  142. package/dist/sankhyablocks/p-da2422ef.entry.js +11 -0
  143. package/dist/sankhyablocks/p-e086cc2a.entry.js +1 -0
  144. package/dist/sankhyablocks/p-ed705cbb.entry.js +1 -0
  145. package/dist/sankhyablocks/p-f1f5232d.entry.js +1 -0
  146. package/dist/sankhyablocks/{p-60791bb6.js → p-f88bdc84.js} +1 -1
  147. package/dist/sankhyablocks/p-fa523d6b.entry.js +1 -0
  148. package/dist/sankhyablocks/p-fcdd5761.entry.js +1 -0
  149. package/dist/sankhyablocks/p-fdf6b377.entry.js +1 -0
  150. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  151. package/dist/types/components/snk-actions-button/actions/index.d.ts +2 -1
  152. package/dist/types/components/snk-application/snk-application.d.ts +8 -13
  153. package/dist/types/components/snk-configurator/snk-configurator.d.ts +4 -0
  154. package/dist/types/components/snk-crud/snk-crud.d.ts +1 -0
  155. package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +4 -0
  156. package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +5 -2
  157. package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +4 -0
  158. package/dist/types/components/snk-entity-list/snk-entity-list.d.ts +0 -4
  159. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +0 -3
  160. package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +1 -1
  161. package/dist/types/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.d.ts +5 -4
  162. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +4 -0
  163. package/dist/types/components/snk-form/SnkFormConfigManager.d.ts +5 -4
  164. package/dist/types/components/snk-form/snk-form.d.ts +5 -1
  165. package/dist/types/components/snk-form/subcomponents/snk-form-config/snk-form-config.d.ts +0 -2
  166. package/dist/types/components/snk-grid/snk-grid.d.ts +4 -0
  167. package/dist/types/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.d.ts +4 -0
  168. package/dist/types/components/snk-personalized-filter/snk-personalized-filter.d.ts +5 -1
  169. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +4 -0
  170. package/dist/types/components.d.ts +99 -21
  171. package/dist/types/lib/configs/ConfigStorage.d.ts +11 -13
  172. package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +1 -1
  173. package/dist/types/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.d.ts +0 -1
  174. package/dist/types/lib/index.d.ts +11 -0
  175. package/dist/types/lib/resourceid/ResourceIDUtils.d.ts +3 -0
  176. package/package.json +1 -1
  177. package/dist/cjs/filter-bar-config-fetcher-80b033ce.js +0 -155
  178. package/dist/cjs/resource-fetcher-95d24dff.js +0 -68
  179. package/dist/components/filter-bar-config-fetcher.js +0 -153
  180. package/dist/components/resource-fetcher.js +0 -66
  181. package/dist/esm/filter-bar-config-fetcher-317cb6bf.js +0 -153
  182. package/dist/esm/resource-fetcher-b36ac145.js +0 -66
  183. package/dist/sankhyablocks/p-0b64f036.entry.js +0 -1
  184. package/dist/sankhyablocks/p-0e97ec46.entry.js +0 -1
  185. package/dist/sankhyablocks/p-1b81c379.entry.js +0 -1
  186. package/dist/sankhyablocks/p-2dd0f891.js +0 -17
  187. package/dist/sankhyablocks/p-330f584a.entry.js +0 -1
  188. package/dist/sankhyablocks/p-35ecafcb.entry.js +0 -1
  189. package/dist/sankhyablocks/p-42843f0e.js +0 -1
  190. package/dist/sankhyablocks/p-459d4267.entry.js +0 -1
  191. package/dist/sankhyablocks/p-557affc8.entry.js +0 -1
  192. package/dist/sankhyablocks/p-564efc43.js +0 -1
  193. package/dist/sankhyablocks/p-6295424d.entry.js +0 -1
  194. package/dist/sankhyablocks/p-64c2cec3.js +0 -1
  195. package/dist/sankhyablocks/p-803b79d6.js +0 -1
  196. package/dist/sankhyablocks/p-80729c9b.entry.js +0 -11
  197. package/dist/sankhyablocks/p-95fa8af6.entry.js +0 -1
  198. package/dist/sankhyablocks/p-96c1ae78.entry.js +0 -1
  199. package/dist/sankhyablocks/p-b556fadc.entry.js +0 -1
  200. package/dist/sankhyablocks/p-befbc9ee.entry.js +0 -1
  201. package/dist/sankhyablocks/p-bf3bd954.entry.js +0 -1
  202. package/dist/sankhyablocks/p-c32b9d7c.entry.js +0 -1
  203. package/dist/sankhyablocks/p-c6380ea2.entry.js +0 -1
  204. package/dist/sankhyablocks/p-dd1fa35d.js +0 -56
  205. package/dist/sankhyablocks/p-de69b4b0.entry.js +0 -1
  206. package/dist/sankhyablocks/p-e42f1f2a.js +0 -1
  207. package/dist/sankhyablocks/p-f24c4bc7.entry.js +0 -1
  208. package/dist/sankhyablocks/p-f737f7e1.js +0 -10
  209. package/dist/sankhyablocks/p-fd69eab9.entry.js +0 -1
@@ -10,7 +10,6 @@ export class SnkEntityList {
10
10
  }
11
11
  async reloadList() {
12
12
  this.loadListSource();
13
- this.saveConfig.emit(this.config);
14
13
  }
15
14
  observeConfig() {
16
15
  var _a, _b;
@@ -26,7 +25,6 @@ export class SnkEntityList {
26
25
  }
27
26
  });
28
27
  this.config = ObjectUtils.copy(configCopy);
29
- this.saveConfig.emit(this.config);
30
28
  this.valueChanged.emit((_b = this.config) === null || _b === void 0 ? void 0 : _b.value);
31
29
  }
32
30
  loadListSource() {
@@ -83,7 +81,6 @@ export class SnkEntityList {
83
81
  }
84
82
  ] });
85
83
  this.loadListSource();
86
- this.saveConfig.emit(this.config);
87
84
  this.valueChanged.emit((_d = this.config) === null || _d === void 0 ? void 0 : _d.value);
88
85
  }
89
86
  }
@@ -206,26 +203,6 @@ export class SnkEntityList {
206
203
  }
207
204
  }
208
205
  }
209
- }, {
210
- "method": "saveConfig",
211
- "name": "saveConfig",
212
- "bubbles": true,
213
- "cancelable": true,
214
- "composed": true,
215
- "docs": {
216
- "tags": [],
217
- "text": "Evento emitido ao realizar alguma a\u00E7\u00E3o que altera os dados do config.value permitindo salvar estas informa\u00E7\u00F5es"
218
- },
219
- "complexType": {
220
- "original": "SnkFilterItemConfig",
221
- "resolved": "SnkFilterItemConfig",
222
- "references": {
223
- "SnkFilterItemConfig": {
224
- "location": "import",
225
- "path": "../snk-filter-bar/filter-item/snk-filter-item"
226
- }
227
- }
228
- }
229
206
  }];
230
207
  }
231
208
  static get methods() {
@@ -1,8 +1,7 @@
1
1
  import { h, Host, Fragment } from '@stencil/core';
2
2
  import { ApplicationUtils } from "@sankhyalabs/ezui/dist/collection/utils";
3
3
  import FilterItemType from './filter-item-type.enum';
4
- import { ElementIDUtils, ApplicationContext, ObjectUtils } from '@sankhyalabs/core';
5
- import FilterBarConfigFetcher from '../../../lib/http/data-fetcher/fetchers/filter-bar-config-fetcher';
4
+ import { ElementIDUtils, ObjectUtils } from '@sankhyalabs/core';
6
5
  import { EPresentationMode } from './editors/enum/presentationMode';
7
6
  import { PersonalizedFilterUtils } from '../../snk-personalized-filter/subcomponents/snk-filter-param-config/utils/PersonalizedFilterUtils';
8
7
  export class SnkFilterDetail {
@@ -24,7 +23,6 @@ export class SnkFilterDetail {
24
23
  }
25
24
  componentDidLoad() {
26
25
  if (this._element) {
27
- this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
28
26
  ElementIDUtils.addIDInfo(this._element);
29
27
  const dataElementIdDoFilterItem = this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME);
30
28
  this._idContentEditor = `${dataElementIdDoFilterItem}_${this.config.id}`;
@@ -142,20 +140,12 @@ export class SnkFilterDetail {
142
140
  this.config = ObjectUtils.copy(configCopy);
143
141
  }
144
142
  }
145
- saveConfig(newConfig) {
146
- var _a;
147
- (_a = this._application) === null || _a === void 0 ? void 0 : _a.getResourceID().then(resourceId => {
148
- const fetcher = new FilterBarConfigFetcher();
149
- fetcher.saveEntityListConfig(newConfig, resourceId, this._application.configName);
150
- this.config = newConfig;
151
- });
152
- }
153
143
  componentWillLoad() {
154
144
  this.originalConfig = ObjectUtils.copy(this.config);
155
145
  }
156
146
  render() {
157
147
  const { tag: CustomElement, props } = this.getContentEditor();
158
- return (h(Host, null, h("div", { class: "col ez-col--sd-12 ez-align--right ez-padding-medium ez-flex--align-items-center" }, h("div", { class: "ez-text ez-title ez-title--small ez-padding--small sc-snk-filter-bar snk-filter-item__editor-header" }, this.config.detailTitle), this.getPopUpHeaderButtons()), h(CustomElement, Object.assign({ maxHeightList: '240px', ref: ref => this._editor = ref, value: this.config.value, config: this.config, onKeyDown: evt => this.onKeyDonwListener(evt), "data-element-id": this._idContentEditor, getMessage: this.getMessage, onSaveConfig: evt => this.saveConfig(evt.detail), rightListSlotBuilder: item => this.buildRightSlot(item) }, props)), h("hr", { class: "sc-snk-filter-bar snk-filter__popover-rule" }), h("div", { class: "ez-col ez-col--sd-12 ez-align--right" }, this.filterCanBeCleared() && (h("ez-button", { label: this.getMessage("snkFilterBar.cleanFilter"), onClick: () => this.clear(), size: "small" })), h("ez-button", { ref: ref => this._applyButton = ref, label: this.getMessage("snkFilterBar.applyFilter"), onClick: () => this.apply(), size: "small", class: "ez-button--primary ez-padding-left--medium" }))));
148
+ return (h(Host, null, h("div", { class: "col ez-col--sd-12 ez-align--right ez-padding-medium ez-flex--align-items-center" }, h("div", { class: "ez-text ez-title ez-title--small ez-padding--small sc-snk-filter-bar snk-filter-item__editor-header" }, this.config.detailTitle), this.getPopUpHeaderButtons()), h(CustomElement, Object.assign({ maxHeightList: '240px', ref: ref => this._editor = ref, value: this.config.value, config: this.config, onKeyDown: evt => this.onKeyDonwListener(evt), "data-element-id": this._idContentEditor, getMessage: this.getMessage, rightListSlotBuilder: item => this.buildRightSlot(item) }, props)), h("hr", { class: "sc-snk-filter-bar snk-filter__popover-rule" }), h("div", { class: "ez-col ez-col--sd-12 ez-align--right" }, this.filterCanBeCleared() && (h("ez-button", { label: this.getMessage("snkFilterBar.cleanFilter"), onClick: () => this.clear(), size: "small" })), h("ez-button", { ref: ref => this._applyButton = ref, label: this.getMessage("snkFilterBar.applyFilter"), onClick: () => this.apply(), size: "small", class: "ez-button--primary ez-padding-left--medium" }))));
159
149
  }
160
150
  static get is() { return "snk-filter-detail"; }
161
151
  static get properties() {
@@ -244,7 +244,7 @@ export class SnkFilterModal {
244
244
  "optional": false,
245
245
  "docs": {
246
246
  "tags": [],
247
- "text": "Nome da config para buscar no resourceId"
247
+ "text": "Nome da configura\u00E7\u00E3o. Serve para distinguir v\u00E1rias inst\u00E2ncias do componente."
248
248
  },
249
249
  "attribute": "config-name",
250
250
  "reflect": false
@@ -1,5 +1,5 @@
1
1
  import { h, Host } from '@stencil/core';
2
- import { ApplicationContext, ElementIDUtils, ObjectUtils } from '@sankhyalabs/core';
2
+ import { ElementIDUtils, ObjectUtils } from '@sankhyalabs/core';
3
3
  import FilterItemType from '../../filter-item/filter-item-type.enum';
4
4
  import { EPresentationMode } from '../../filter-item/editors/enum/presentationMode';
5
5
  import { ConfigStorage } from '../../../../lib/configs/ConfigStorage';
@@ -8,14 +8,13 @@ export class SnkFilterModalItem {
8
8
  constructor() {
9
9
  this.filterItem = undefined;
10
10
  this.configName = undefined;
11
+ this.resourceID = undefined;
11
12
  }
12
13
  observeFilterItem(newValue) {
13
14
  var _a, _b;
14
15
  this._editor && (this._editor["config"] = newValue);
15
16
  (_b = (_a = this._editor) === null || _a === void 0 ? void 0 : _a['reloadList']) === null || _b === void 0 ? void 0 : _b.call(_a);
16
17
  this.filterChange.emit(newValue);
17
- //isso faz o filtro salvar o estado precocemente. Caso: Botão limpar filtro dispara dezenas de vezes
18
- //this.saveConfig();
19
18
  }
20
19
  getContentEditorConfig() {
21
20
  const props = { presentationMode: EPresentationMode.MODAL };
@@ -57,11 +56,10 @@ export class SnkFilterModalItem {
57
56
  else {
58
57
  this.filterItem = Object.assign(Object.assign({}, this.filterItem), { value: this.filterItem.type === FilterItemType.SEARCH ? data : newValue, visible: this.isVisible(newValue) });
59
58
  }
60
- this.saveConfig();
61
59
  }
62
60
  handleDeleteFilter(filter, filterItemType) {
63
61
  if (filterItemType === FilterItemType.PERSONALIZED) {
64
- ConfigStorage.removePersonalizedFilter(filter, this.configName);
62
+ ConfigStorage.removePersonalizedFilter(filter, this.resourceID, this.configName);
65
63
  }
66
64
  }
67
65
  componentDidLoad() {
@@ -69,7 +67,6 @@ export class SnkFilterModalItem {
69
67
  ElementIDUtils.addIDInfo(this._element);
70
68
  const dataElementIdDoFilterItem = this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME);
71
69
  this._idContentEditor = `${dataElementIdDoFilterItem}_${this.filterItem.id}`;
72
- this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
73
70
  }
74
71
  }
75
72
  buildRightSlot(item) {
@@ -86,15 +83,6 @@ export class SnkFilterModalItem {
86
83
  const { CUSTOM_FILTER, OTHER_FILTERS } = FilterType;
87
84
  return ![CUSTOM_FILTER, OTHER_FILTERS].includes(this.filterItem.filterType) && this.filterItem.type !== FilterItemType.BINARY_SELECT;
88
85
  }
89
- saveConfig() {
90
- //Precisa ser rediscutido... não podemos salvar configuração por conta própria. Não temos autonomia pra isso.
91
- /*if(FilterItemType.MULTI_LIST !== this.filterItem.type) return;
92
-
93
- this._application?.getResourceID().then(resourceId => {
94
- const fetcher = new FilterBarConfigFetcher();
95
- fetcher.saveEntityListConfig(this.filterItem, resourceId, this._application.configName);
96
- });*/
97
- }
98
86
  render() {
99
87
  const { tag: ContentEditor, props } = this.getContentEditorConfig();
100
88
  return (h(Host, null, h("div", { class: "ez-flex ez-flex--column grow" }, this.canShowDetailModal() && (h("div", { class: "col ez-col--sd-12 ez-align--right ez-padding-medium ez-flex--align-items-center" }, h("div", { class: "ez-title ez-title--small ez-title--primary grow" }, this.filterItem.detailModal))), h(ContentEditor, Object.assign({ ref: ref => this._editor = ref, config: this.filterItem, value: this.filterItem.value, onValueChanged: (event) => this.updateFilterValue(event.detail), "data-element-id": this._idContentEditor }, props)))));
@@ -144,10 +132,27 @@ export class SnkFilterModalItem {
144
132
  "optional": false,
145
133
  "docs": {
146
134
  "tags": [],
147
- "text": "Nome da config para buscar no resourceId"
135
+ "text": "Nome da configura\u00E7\u00E3o. Serve para distinguir v\u00E1rias inst\u00E2ncias do componente."
148
136
  },
149
137
  "attribute": "config-name",
150
138
  "reflect": false
139
+ },
140
+ "resourceID": {
141
+ "type": "string",
142
+ "mutable": false,
143
+ "complexType": {
144
+ "original": "string",
145
+ "resolved": "string",
146
+ "references": {}
147
+ },
148
+ "required": false,
149
+ "optional": false,
150
+ "docs": {
151
+ "tags": [],
152
+ "text": "Identificador de recursos como configura\u00E7\u00F5es e acesso."
153
+ },
154
+ "attribute": "resource-i-d",
155
+ "reflect": false
151
156
  }
152
157
  };
153
158
  }
@@ -28,6 +28,7 @@ export class SnkFilterBar {
28
28
  };
29
29
  this.dataUnit = undefined;
30
30
  this.configName = undefined;
31
+ this.resourceID = undefined;
31
32
  this.filterConfig = undefined;
32
33
  this.messagesBuilder = undefined;
33
34
  this.allowDefault = undefined;
@@ -107,7 +108,7 @@ export class SnkFilterBar {
107
108
  }
108
109
  if (this._configUpdated) {
109
110
  this._configUpdated = false;
110
- ConfigStorage.saveFilterBarConfig(this.filterConfig, this.configName);
111
+ ConfigStorage.saveFilterBarConfig(this.filterConfig, this.configName, this.resourceID);
111
112
  }
112
113
  }
113
114
  /**
@@ -223,15 +224,13 @@ export class SnkFilterBar {
223
224
  }
224
225
  loadConfigFromStorage() {
225
226
  return new Promise(accept => {
226
- ConfigStorage.get().then(instance => {
227
- instance.loadFilterBarConfig(this.configName, { contextURI: this.dataUnit.name })
228
- .then((filters) => {
229
- accept();
230
- this.filterConfig = filters.map(item => this.normalizeItem(item));
231
- })
232
- .catch(reason => {
233
- throw new ErrorException(this.getMessage("snkFilterBar.failToLoadConfig"), reason);
234
- });
227
+ ConfigStorage.loadFilterBarConfig(this.configName, this.resourceID, { contextURI: this.dataUnit.name })
228
+ .then((filters) => {
229
+ accept();
230
+ this.filterConfig = filters.map(item => this.normalizeItem(item));
231
+ })
232
+ .catch(reason => {
233
+ throw new ErrorException(this.getMessage("snkFilterBar.failToLoadConfig"), reason);
235
234
  });
236
235
  });
237
236
  }
@@ -316,7 +315,7 @@ export class SnkFilterBar {
316
315
  return undefined;
317
316
  }
318
317
  if (this.showPersonalizedFilter) {
319
- return h("snk-personalized-filter", { class: "filter-bar__personalized-filter", filterId: this.personalizedFilterId, ref: (el) => this._elPersonalizedFilter = el, onEzCancel: () => this.hidePersonalizedFilter(), entityUri: this.dataUnit.name, configName: this.configName });
318
+ return h("snk-personalized-filter", { class: "filter-bar__personalized-filter", filterId: this.personalizedFilterId, ref: (el) => this._elPersonalizedFilter = el, onEzCancel: () => this.hidePersonalizedFilter(), entityUri: this.dataUnit.name, configName: this.configName, resourceID: this.resourceID });
320
319
  }
321
320
  return (h(Host, null, h("ez-scroller", { class: "snk-filter-bar__scroller", direction: EzScrollDirection.HORIZONTAL, activeShadow: true, locked: this.scrollerLocked }, h("section", { class: "snk-filter-bar__filter-item-container" }, this.getFilterItems())), h("ez-button", { class: "ez-padding-left--medium", size: "small", label: this.getMessage('snkFilterBar.filters', undefined, 'Filtros'), onClick: this.showFilterModal.bind(this) }, h("ez-icon", { slot: "leftIcon", iconName: "plus", class: "ez-padding-right--small" }))));
322
321
  }
@@ -371,6 +370,23 @@ export class SnkFilterBar {
371
370
  "attribute": "config-name",
372
371
  "reflect": false
373
372
  },
373
+ "resourceID": {
374
+ "type": "string",
375
+ "mutable": false,
376
+ "complexType": {
377
+ "original": "string",
378
+ "resolved": "string",
379
+ "references": {}
380
+ },
381
+ "required": false,
382
+ "optional": false,
383
+ "docs": {
384
+ "tags": [],
385
+ "text": "Identificador de recursos como configura\u00E7\u00F5es e acesso."
386
+ },
387
+ "attribute": "resource-i-d",
388
+ "reflect": false
389
+ },
374
390
  "filterConfig": {
375
391
  "type": "unknown",
376
392
  "mutable": true,
@@ -2,29 +2,27 @@ import { ConfigStorage } from "../../lib/configs/ConfigStorage";
2
2
  import { ObjectUtils } from "@sankhyalabs/core";
3
3
  import { FormConfigFetcher } from "../../lib/http/data-fetcher/fetchers/form-config-fetcher";
4
4
  export class SnkFormConfigManager {
5
- constructor(configName, onConfigChange) {
5
+ constructor(configName, resourceID, onConfigChange) {
6
+ this._resourceID = resourceID;
6
7
  this._configName = configName;
7
8
  this._onConfigChange = onConfigChange;
8
9
  }
9
10
  async loadConfig() {
10
11
  return new Promise(resolve => {
11
- ConfigStorage.get()
12
- .then((configStorage) => {
13
- configStorage.loadFormConfig(this._configName)
14
- .then((config) => {
15
- this.setConfig(config);
16
- resolve(config);
17
- })
18
- .catch((error) => {
19
- console.warn(error);
20
- });
12
+ ConfigStorage.loadFormConfig(this._configName, this._resourceID)
13
+ .then((config) => {
14
+ this.setConfig(config);
15
+ resolve(config);
16
+ })
17
+ .catch((error) => {
18
+ console.warn(error);
21
19
  });
22
20
  });
23
21
  }
24
22
  saveConfig(config) {
25
23
  const configToSave = ObjectUtils.copy(config);
26
24
  return new Promise(accept => {
27
- ConfigStorage.saveFormConfig(config, this._configName)
25
+ ConfigStorage.saveFormConfig(config, this._configName, this._resourceID)
28
26
  .then((response) => {
29
27
  this.setConfig(Object.assign(Object.assign({}, configToSave), response));
30
28
  accept(Object.assign(Object.assign({}, configToSave), response));
@@ -39,7 +37,7 @@ export class SnkFormConfigManager {
39
37
  cardsState.set(cardId, propertyChanged === "fixed" ?
40
38
  this.updateFixSequence(Object.assign(Object.assign({}, currentConfig), { fixed: cardConfig.fixed }), cardsState)
41
39
  : Object.assign(Object.assign({}, currentConfig), { [propertyChanged]: cardConfig[propertyChanged] }));
42
- ConfigStorage.saveCardState(cardsState, this._configName)
40
+ ConfigStorage.saveCardState(cardsState, this._configName, this._resourceID)
43
41
  .then(savedCardConfig => {
44
42
  this._config = Object.assign(Object.assign({}, this._config), { cardsState });
45
43
  resolve(savedCardConfig);
@@ -115,17 +113,17 @@ export class SnkFormConfigManager {
115
113
  }
116
114
  return this._formConfigFetcher;
117
115
  }
118
- async fetchUserAvailableConfigs(resourceID) {
116
+ async fetchUserAvailableConfigs() {
119
117
  if (this._configName != undefined) {
120
118
  //FIXME: Precisamos preparar o backend para retornar as configurações disponíveis para details;
121
119
  return Promise.resolve(undefined);
122
120
  }
123
- return this.getFormConfigFetcher().fetchUserAvailableConfigs(this._configName, resourceID);
121
+ return this.getFormConfigFetcher().fetchUserAvailableConfigs(this._configName, this._resourceID);
124
122
  }
125
- async fetchLegacyConfig(resourceID) {
126
- return this.getFormConfigFetcher().fetchLegacyConfig(this._configName, resourceID);
123
+ async fetchLegacyConfig() {
124
+ return this.getFormConfigFetcher().fetchLegacyConfig(this._configName, this._resourceID);
127
125
  }
128
- async fetchDefaultConfig(resourceID) {
129
- return this.getFormConfigFetcher().fetchDefaultConfig(this._configName, resourceID);
126
+ async fetchDefaultConfig() {
127
+ return this.getFormConfigFetcher().fetchDefaultConfig(this._configName, this._resourceID);
130
128
  }
131
129
  }
@@ -1,6 +1,7 @@
1
1
  import { ElementIDUtils } from '@sankhyalabs/core';
2
2
  import { h } from '@stencil/core';
3
3
  import { SnkFormConfigManager } from './SnkFormConfigManager';
4
+ import ResourceIDUtils from '../../lib/resourceid/ResourceIDUtils';
4
5
  export class SnkForm {
5
6
  constructor() {
6
7
  this._dataUnit = undefined;
@@ -10,6 +11,7 @@ export class SnkForm {
10
11
  this.configName = undefined;
11
12
  this.recordsValidator = undefined;
12
13
  this.messagesBuilder = undefined;
14
+ this.resourceID = undefined;
13
15
  }
14
16
  /**
15
17
  * Exibe a janela de configurações do formulário.
@@ -30,7 +32,7 @@ export class SnkForm {
30
32
  const dataInfo = { dataUnit: this._dataUnit };
31
33
  ElementIDUtils.addIDInfo(this._element, null, dataInfo);
32
34
  }
33
- componentWillLoad() {
35
+ async componentWillLoad() {
34
36
  let parent = this._element.parentElement;
35
37
  while (parent) {
36
38
  if (parent.tagName.toUpperCase() === "SNK-DATA-UNIT") {
@@ -52,7 +54,10 @@ export class SnkForm {
52
54
  }
53
55
  parent = parent.parentElement;
54
56
  }
55
- this._configManager = new SnkFormConfigManager(this.configName);
57
+ if (this.resourceID == undefined) {
58
+ this.resourceID = await ResourceIDUtils.getResourceID();
59
+ }
60
+ this._configManager = new SnkFormConfigManager(this.configName, this.resourceID);
56
61
  this._configManager.loadConfig();
57
62
  }
58
63
  render() {
@@ -132,6 +137,23 @@ export class SnkForm {
132
137
  "tags": [],
133
138
  "text": "Respons\u00E1vel por flexibilizar e padronizar o uso de mensagens nos blocos de constru\u00E7\u00E3o."
134
139
  }
140
+ },
141
+ "resourceID": {
142
+ "type": "string",
143
+ "mutable": false,
144
+ "complexType": {
145
+ "original": "string",
146
+ "resolved": "string",
147
+ "references": {}
148
+ },
149
+ "required": false,
150
+ "optional": false,
151
+ "docs": {
152
+ "tags": [],
153
+ "text": "Identificador de recursos como configura\u00E7\u00F5es e acesso."
154
+ },
155
+ "attribute": "resource-i-d",
156
+ "reflect": false
135
157
  }
136
158
  };
137
159
  }
@@ -1,6 +1,6 @@
1
1
  import { h, Host } from "@stencil/core";
2
2
  import { Sortable } from '@shopify/draggable';
3
- import { ApplicationContext, ObjectUtils, ArrayUtils, ElementIDUtils } from '@sankhyalabs/core';
3
+ import { ObjectUtils, ArrayUtils, ElementIDUtils } from '@sankhyalabs/core';
4
4
  import { ApplicationUtils, DialogType } from "@sankhyalabs/ezui/dist/collection/utils";
5
5
  import { ACTION_CONFIG, CONFIG_EVENTS, DEFAULT_TYPE, TAB_NAMES } from "../../../../lib/utils/constants";
6
6
  import { UserConfigType } from "../../../../lib/http/data-fetcher/fetchers/form-config-fetcher";
@@ -446,13 +446,10 @@ export class SnkFormConfig {
446
446
  this._sortableGroup.on(CONFIG_EVENTS.dragStop, (evt) => this.controlStopDraggingGroup(evt));
447
447
  }
448
448
  loadUserConfig() {
449
- if (this._applicationResourceID == undefined) {
450
- return;
451
- }
452
449
  if (this.configManager == undefined) {
453
450
  return;
454
451
  }
455
- this.configManager.fetchUserAvailableConfigs(this._applicationResourceID)
452
+ this.configManager.fetchUserAvailableConfigs()
456
453
  .then((userConfig) => {
457
454
  this._formConfigOptions = userConfig;
458
455
  if (this._formConfigOptions == undefined) {
@@ -506,9 +503,6 @@ export class SnkFormConfig {
506
503
  }
507
504
  }
508
505
  async loadConfigByUser() {
509
- if (this._applicationResourceID == undefined) {
510
- return;
511
- }
512
506
  if (this.configManager == undefined) {
513
507
  return;
514
508
  }
@@ -518,10 +512,10 @@ export class SnkFormConfig {
518
512
  let config;
519
513
  switch (this._optionFormConfigSelected.origin) {
520
514
  case UserConfigType.DEFAULT:
521
- config = await this.configManager.fetchDefaultConfig(this._applicationResourceID);
515
+ config = await this.configManager.fetchDefaultConfig();
522
516
  break;
523
517
  case UserConfigType.DEFAULT:
524
- config = await this.configManager.fetchDefaultConfig(this._applicationResourceID);
518
+ config = await this.configManager.fetchDefaultConfig();
525
519
  break;
526
520
  }
527
521
  if (config != undefined) {
@@ -937,11 +931,7 @@ export class SnkFormConfig {
937
931
  this.controlSortableGroup();
938
932
  }
939
933
  componentWillLoad() {
940
- this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
941
- this._application.getResourceID().then(resourceID => {
942
- this._applicationResourceID = resourceID;
943
- this.loadConfig();
944
- });
934
+ this.loadConfig();
945
935
  }
946
936
  componentDidLoad() {
947
937
  const dataInfo = { dataUnit: this.dataUnit };
@@ -28,6 +28,7 @@ export class SnkGrid {
28
28
  this._popUpGridConfig = false;
29
29
  this.columnFilterDataSource = new SnkMultiSelectionListDataSource();
30
30
  this.configName = undefined;
31
+ this.resourceID = undefined;
31
32
  this.selectionToastConfig = undefined;
32
33
  this.actionsList = undefined;
33
34
  this.isDetail = undefined;
@@ -86,20 +87,17 @@ export class SnkGrid {
86
87
  this._gridConfig = config;
87
88
  }
88
89
  loadConfig() {
89
- ConfigStorage.get()
90
- .then((instance) => {
91
- instance.loadGridConfig(this.configName)
92
- .then((config) => {
93
- this.setGridConfig(config);
94
- })
95
- .catch((error) => {
96
- console.warn(error);
97
- });
90
+ ConfigStorage.loadGridConfig(this.configName, this.resourceID)
91
+ .then((config) => {
92
+ this.setGridConfig(config);
93
+ })
94
+ .catch((error) => {
95
+ console.warn(error);
98
96
  });
99
97
  }
100
98
  gridConfigChangeHandler(evt) {
101
99
  const config = evt.detail;
102
- ConfigStorage.saveGridConfig(config, this.configName);
100
+ ConfigStorage.saveGridConfig(config, this.configName, this.resourceID);
103
101
  evt.stopPropagation();
104
102
  }
105
103
  modalConfigChangeHandler(evt) {
@@ -307,8 +305,8 @@ export class SnkGrid {
307
305
  if (!this._dataUnit) {
308
306
  return undefined;
309
307
  }
310
- return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, h("div", { class: "snk-grid__header ez-margin-bottom--medium" }, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder }), ((_b = (_a = this._snkFilterBar) === null || _a === void 0 ? void 0 : _a.filterConfig) === null || _b === void 0 ? void 0 : _b.length) > 0 &&
311
- h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" }), h("snk-taskbar", { class: "ez-padding-left--medium", "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() })), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: () => this.gridDoubleClick.emit(), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, onComponentReady: () => this.onEzGridReady(), columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit }, h("snk-taskbar", { dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.actionsList })), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" })), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), application: this._application, selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig() }))));
308
+ return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, h("div", { class: "snk-grid__header ez-margin-bottom--medium" }, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID }), ((_b = (_a = this._snkFilterBar) === null || _a === void 0 ? void 0 : _a.filterConfig) === null || _b === void 0 ? void 0 : _b.length) > 0 &&
309
+ h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" }), h("snk-taskbar", { class: "ez-padding-left--medium", "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 })), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: () => this.gridDoubleClick.emit(), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, onComponentReady: () => this.onEzGridReady(), columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit }, h("snk-taskbar", { dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.actionsList, resourceID: this.resourceID })), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" })), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), application: this._application, selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
312
310
  }
313
311
  static get is() { return "snk-grid"; }
314
312
  static get encapsulation() { return "scoped"; }
@@ -361,6 +359,23 @@ export class SnkGrid {
361
359
  "attribute": "config-name",
362
360
  "reflect": false
363
361
  },
362
+ "resourceID": {
363
+ "type": "string",
364
+ "mutable": false,
365
+ "complexType": {
366
+ "original": "string",
367
+ "resolved": "string",
368
+ "references": {}
369
+ },
370
+ "required": false,
371
+ "optional": false,
372
+ "docs": {
373
+ "tags": [],
374
+ "text": "Identificador de recursos como configura\u00E7\u00F5es e acesso."
375
+ },
376
+ "attribute": "resource-i-d",
377
+ "reflect": false
378
+ },
364
379
  "selectionToastConfig": {
365
380
  "type": "unknown",
366
381
  "mutable": false,
@@ -17,6 +17,7 @@ export class SnkGridConfig {
17
17
  this.columns = undefined;
18
18
  this.config = undefined;
19
19
  this.configName = undefined;
20
+ this.resourceID = undefined;
20
21
  }
21
22
  /* Creation Methods */
22
23
  /**
@@ -240,7 +241,7 @@ export class SnkGridConfig {
240
241
  }
241
242
  }
242
243
  _newConfig.columns = _newColumnConfigList;
243
- ConfigStorage.saveGridConfig(_newConfig, this.configName)
244
+ ConfigStorage.saveGridConfig(_newConfig, this.configName, this.resourceID)
244
245
  .then((savedConfig) => {
245
246
  this.configChange.emit(savedConfig);
246
247
  this._orderList.clearHistory();
@@ -571,6 +572,23 @@ export class SnkGridConfig {
571
572
  },
572
573
  "attribute": "config-name",
573
574
  "reflect": false
575
+ },
576
+ "resourceID": {
577
+ "type": "string",
578
+ "mutable": false,
579
+ "complexType": {
580
+ "original": "string",
581
+ "resolved": "string",
582
+ "references": {}
583
+ },
584
+ "required": false,
585
+ "optional": false,
586
+ "docs": {
587
+ "tags": [],
588
+ "text": "Nome usado para salvar/recuperar a configura\u00E7\u00E3o."
589
+ },
590
+ "attribute": "resource-i-d",
591
+ "reflect": false
574
592
  }
575
593
  };
576
594
  }
@@ -30,6 +30,7 @@ export class SnkPersonalizedFilter {
30
30
  this.entityUri = undefined;
31
31
  this.filterId = undefined;
32
32
  this.configName = undefined;
33
+ this.resourceID = undefined;
33
34
  }
34
35
  /*
35
36
  * Cria um novo filtro se não houver nenhum filtro existente
@@ -66,17 +67,15 @@ export class SnkPersonalizedFilter {
66
67
  this._filterAssistent = ObjectUtils.copy(newPersonalizedFilter);
67
68
  }
68
69
  loadFilter(newValue, oldValue) {
69
- if (newValue == null || oldValue == newValue) {
70
+ if (newValue == null || oldValue == newValue || this.resourceID == undefined) {
70
71
  return;
71
72
  }
72
- ConfigStorage.get().then((_instance) => {
73
- ConfigStorage.loadPersonalizedFilter(newValue, this.configName)
74
- .then((resp) => {
75
- const personalizedFilter = this.addLabelToItems(resp);
76
- this._filterAssistent = personalizedFilter;
77
- this._originalFilterAssistent = ObjectUtils.copy(personalizedFilter);
78
- this._filterAssistentMode = this._filterAssistent.hasOwnProperty("assistent") && this._filterAssistent.assistent != undefined;
79
- });
73
+ ConfigStorage.loadPersonalizedFilter(newValue, this.resourceID, this.configName)
74
+ .then((resp) => {
75
+ const personalizedFilter = this.addLabelToItems(resp);
76
+ this._filterAssistent = personalizedFilter;
77
+ this._originalFilterAssistent = ObjectUtils.copy(personalizedFilter);
78
+ this._filterAssistentMode = this._filterAssistent.hasOwnProperty("assistent") && this._filterAssistent.assistent != undefined;
80
79
  });
81
80
  }
82
81
  componentWillLoad() {
@@ -101,7 +100,7 @@ export class SnkPersonalizedFilter {
101
100
  return this._application.messagesBuilder.getMessage(key, params);
102
101
  }
103
102
  saveFilter() {
104
- ConfigStorage.savePersonalizedFilter(this._filterAssistent, this.configName).then((personalizedFilter) => {
103
+ ConfigStorage.savePersonalizedFilter(this._filterAssistent, this.resourceID, this.configName).then((personalizedFilter) => {
105
104
  this._elButtonSave.enabled = false;
106
105
  const messageToken = !!this._filterAssistent.id ? 'confirmEdit' : 'confirmSave';
107
106
  ApplicationUtils.info(this.getMessage(`snkPersonalizedFilter.${messageToken}.title`), { iconName: "check" });
@@ -112,7 +111,7 @@ export class SnkPersonalizedFilter {
112
111
  });
113
112
  }
114
113
  removeFilter() {
115
- ConfigStorage.removePersonalizedFilter(this._filterAssistent, this.configName);
114
+ ConfigStorage.removePersonalizedFilter(this._filterAssistent, this.resourceID, this.configName);
116
115
  }
117
116
  hasChangesToSave() {
118
117
  return JSON.stringify(this._filterAssistent) === JSON.stringify(this._originalFilterAssistent);
@@ -361,10 +360,27 @@ export class SnkPersonalizedFilter {
361
360
  "optional": false,
362
361
  "docs": {
363
362
  "tags": [],
364
- "text": "Nome da config para buscar no resourceId"
363
+ "text": "Nome da configura\u00E7\u00E3o. Serve para distinguir v\u00E1rias inst\u00E2ncias do componente."
365
364
  },
366
365
  "attribute": "config-name",
367
366
  "reflect": false
367
+ },
368
+ "resourceID": {
369
+ "type": "string",
370
+ "mutable": false,
371
+ "complexType": {
372
+ "original": "string",
373
+ "resolved": "string",
374
+ "references": {}
375
+ },
376
+ "required": false,
377
+ "optional": false,
378
+ "docs": {
379
+ "tags": [],
380
+ "text": "Nome da configura\u00E7\u00E3o. Serve para distinguir v\u00E1rias inst\u00E2ncias do componente."
381
+ },
382
+ "attribute": "resource-i-d",
383
+ "reflect": false
368
384
  }
369
385
  };
370
386
  }