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

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 (168) hide show
  1. package/dist/cjs/{ConfigStorage-e32e1391.js → ConfigStorage-d688c739.js} +160 -47
  2. package/dist/cjs/ResourceIDUtils-5ff86aa7.js +12 -0
  3. package/dist/cjs/{SnkFormConfigManager-5e61b0a9.js → SnkFormConfigManager-29b73c81.js} +18 -20
  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.cjs.entry.js +11 -8
  7. package/dist/cjs/snk-application.cjs.entry.js +42 -38
  8. package/dist/cjs/snk-configurator.cjs.entry.js +2 -1
  9. package/dist/cjs/snk-crud.cjs.entry.js +16 -5
  10. package/dist/cjs/snk-data-exporter.cjs.entry.js +1 -1
  11. package/dist/cjs/{snk-data-unit-e89e07bd.js → snk-data-unit-80a00ae4.js} +4 -3
  12. package/dist/cjs/snk-data-unit.cjs.entry.js +1 -1
  13. package/dist/cjs/snk-detail-view.cjs.entry.js +6 -6
  14. package/dist/cjs/snk-entity-list.cjs.entry.js +0 -4
  15. package/dist/cjs/snk-filter-bar.cjs.entry.js +11 -13
  16. package/dist/cjs/snk-filter-detail.cjs.entry.js +1 -15
  17. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -16
  18. package/dist/cjs/snk-form-config.cjs.entry.js +4 -14
  19. package/dist/cjs/snk-form.cjs.entry.js +9 -5
  20. package/dist/cjs/snk-grid-config.cjs.entry.js +3 -3
  21. package/dist/cjs/snk-grid.cjs.entry.js +11 -14
  22. package/dist/cjs/{snk-guides-viewer-eb0a79a4.js → snk-guides-viewer-f67f9cea.js} +9 -5
  23. package/dist/cjs/snk-guides-viewer.cjs.entry.js +3 -4
  24. package/dist/cjs/snk-personalized-filter.cjs.entry.js +11 -13
  25. package/dist/cjs/snk-taskbar.cjs.entry.js +2 -1
  26. package/dist/collection/components/snk-actions-button/actions/index.js +3 -4
  27. package/dist/collection/components/snk-actions-button/snk-actions-button.js +8 -4
  28. package/dist/collection/components/snk-application/snk-application.js +58 -65
  29. package/dist/collection/components/snk-configurator/snk-configurator.js +19 -1
  30. package/dist/collection/components/snk-crud/snk-crud.js +18 -6
  31. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +20 -2
  32. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +25 -28
  33. package/dist/collection/components/snk-data-unit/snk-data-unit.js +21 -4
  34. package/dist/collection/components/snk-entity-list/snk-entity-list.js +0 -23
  35. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +2 -12
  36. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +1 -1
  37. package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js +21 -16
  38. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +27 -11
  39. package/dist/collection/components/snk-form/SnkFormConfigManager.js +17 -19
  40. package/dist/collection/components/snk-form/snk-form.js +24 -2
  41. package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.js +5 -15
  42. package/dist/collection/components/snk-grid/snk-grid.js +27 -12
  43. package/dist/collection/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.js +19 -1
  44. package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js +28 -12
  45. package/dist/collection/components/snk-taskbar/snk-taskbar.js +19 -1
  46. package/dist/collection/lib/configs/ConfigStorage.js +33 -44
  47. package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +0 -24
  48. package/dist/collection/lib/resourceid/ResourceIDUtils.js +7 -0
  49. package/dist/components/ConfigStorage.js +161 -48
  50. package/dist/components/ResourceIDUtils.js +10 -0
  51. package/dist/components/SnkFormConfigManager.js +17 -19
  52. package/dist/components/auth-fetcher.js +1 -1
  53. package/dist/components/form-config-fetcher.js +64 -2
  54. package/dist/components/snk-actions-button2.js +11 -8
  55. package/dist/components/snk-application2.js +42 -38
  56. package/dist/components/snk-configurator2.js +3 -1
  57. package/dist/components/snk-crud.js +17 -5
  58. package/dist/components/snk-data-unit2.js +5 -3
  59. package/dist/components/snk-detail-view2.js +13 -7
  60. package/dist/components/snk-entity-list.js +0 -4
  61. package/dist/components/snk-filter-bar2.js +11 -11
  62. package/dist/components/snk-filter-detail2.js +2 -12
  63. package/dist/components/snk-filter-modal-item2.js +5 -16
  64. package/dist/components/snk-form-config2.js +5 -15
  65. package/dist/components/snk-form.js +8 -2
  66. package/dist/components/snk-grid-config2.js +4 -2
  67. package/dist/components/snk-grid2.js +11 -12
  68. package/dist/components/snk-personalized-filter2.js +11 -11
  69. package/dist/components/snk-taskbar2.js +3 -1
  70. package/dist/esm/{ConfigStorage-b6aefe42.js → ConfigStorage-cfe03e99.js} +160 -46
  71. package/dist/esm/ResourceIDUtils-a114189a.js +10 -0
  72. package/dist/esm/{SnkFormConfigManager-80901f2d.js → SnkFormConfigManager-bfd8eabd.js} +18 -20
  73. package/dist/esm/loader.js +1 -1
  74. package/dist/esm/sankhyablocks.js +1 -1
  75. package/dist/esm/snk-actions-button.entry.js +11 -8
  76. package/dist/esm/snk-application.entry.js +42 -38
  77. package/dist/esm/snk-configurator.entry.js +2 -1
  78. package/dist/esm/snk-crud.entry.js +16 -5
  79. package/dist/esm/snk-data-exporter.entry.js +1 -1
  80. package/dist/esm/{snk-data-unit-8c4d944d.js → snk-data-unit-3ab57d1a.js} +4 -3
  81. package/dist/esm/snk-data-unit.entry.js +1 -1
  82. package/dist/esm/snk-detail-view.entry.js +6 -6
  83. package/dist/esm/snk-entity-list.entry.js +0 -4
  84. package/dist/esm/snk-filter-bar.entry.js +11 -13
  85. package/dist/esm/snk-filter-detail.entry.js +2 -16
  86. package/dist/esm/snk-filter-modal-item.entry.js +4 -17
  87. package/dist/esm/snk-form-config.entry.js +5 -15
  88. package/dist/esm/snk-form.entry.js +9 -5
  89. package/dist/esm/snk-grid-config.entry.js +3 -3
  90. package/dist/esm/snk-grid.entry.js +11 -14
  91. package/dist/esm/{snk-guides-viewer-ee42eb53.js → snk-guides-viewer-3ea14ab4.js} +9 -5
  92. package/dist/esm/snk-guides-viewer.entry.js +3 -4
  93. package/dist/esm/snk-personalized-filter.entry.js +11 -13
  94. package/dist/esm/snk-taskbar.entry.js +2 -1
  95. package/dist/sankhyablocks/p-0ae5b923.entry.js +1 -0
  96. package/dist/sankhyablocks/p-15230263.js +1 -0
  97. package/dist/sankhyablocks/p-18fa618e.entry.js +1 -0
  98. package/dist/sankhyablocks/p-48a40939.js +1 -0
  99. package/dist/sankhyablocks/p-4c33a77c.entry.js +1 -0
  100. package/dist/sankhyablocks/p-53884b5f.entry.js +1 -0
  101. package/dist/sankhyablocks/p-688dcb4c.js +1 -0
  102. package/dist/sankhyablocks/p-70e785db.entry.js +1 -0
  103. package/dist/sankhyablocks/p-861a3495.entry.js +1 -0
  104. package/dist/sankhyablocks/p-878b0dd3.entry.js +1 -0
  105. package/dist/sankhyablocks/p-97d2fbd9.entry.js +1 -0
  106. package/dist/sankhyablocks/p-9a270401.entry.js +1 -0
  107. package/dist/sankhyablocks/p-9d591463.js +1 -0
  108. package/dist/sankhyablocks/p-9d93da18.js +56 -0
  109. package/dist/sankhyablocks/{p-77ecc583.entry.js → p-9f387187.entry.js} +1 -1
  110. package/dist/sankhyablocks/p-aa4c112f.entry.js +11 -0
  111. package/dist/sankhyablocks/p-bae87498.entry.js +1 -0
  112. package/dist/sankhyablocks/p-cc67bd06.entry.js +1 -0
  113. package/dist/sankhyablocks/p-d4f9ee17.entry.js +1 -0
  114. package/dist/sankhyablocks/p-e070d7a3.entry.js +1 -0
  115. package/dist/sankhyablocks/p-e086cc2a.entry.js +1 -0
  116. package/dist/sankhyablocks/p-ed705cbb.entry.js +1 -0
  117. package/dist/sankhyablocks/p-fa523d6b.entry.js +1 -0
  118. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  119. package/dist/types/components/snk-actions-button/actions/index.d.ts +2 -1
  120. package/dist/types/components/snk-application/snk-application.d.ts +8 -13
  121. package/dist/types/components/snk-configurator/snk-configurator.d.ts +4 -0
  122. package/dist/types/components/snk-crud/snk-crud.d.ts +1 -0
  123. package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +4 -0
  124. package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +5 -2
  125. package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +4 -0
  126. package/dist/types/components/snk-entity-list/snk-entity-list.d.ts +0 -4
  127. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +0 -3
  128. package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +1 -1
  129. package/dist/types/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.d.ts +5 -4
  130. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +4 -0
  131. package/dist/types/components/snk-form/SnkFormConfigManager.d.ts +5 -4
  132. package/dist/types/components/snk-form/snk-form.d.ts +5 -1
  133. package/dist/types/components/snk-form/subcomponents/snk-form-config/snk-form-config.d.ts +0 -2
  134. package/dist/types/components/snk-grid/snk-grid.d.ts +4 -0
  135. package/dist/types/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.d.ts +4 -0
  136. package/dist/types/components/snk-personalized-filter/snk-personalized-filter.d.ts +5 -1
  137. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +4 -0
  138. package/dist/types/components.d.ts +99 -21
  139. package/dist/types/lib/configs/ConfigStorage.d.ts +11 -13
  140. package/dist/types/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.d.ts +0 -1
  141. package/dist/types/lib/resourceid/ResourceIDUtils.d.ts +3 -0
  142. package/package.json +1 -1
  143. package/dist/cjs/filter-bar-config-fetcher-80b033ce.js +0 -155
  144. package/dist/components/filter-bar-config-fetcher.js +0 -153
  145. package/dist/components/resource-fetcher.js +0 -66
  146. package/dist/esm/filter-bar-config-fetcher-317cb6bf.js +0 -153
  147. package/dist/sankhyablocks/p-0b64f036.entry.js +0 -1
  148. package/dist/sankhyablocks/p-0e97ec46.entry.js +0 -1
  149. package/dist/sankhyablocks/p-35ecafcb.entry.js +0 -1
  150. package/dist/sankhyablocks/p-42843f0e.js +0 -1
  151. package/dist/sankhyablocks/p-459d4267.entry.js +0 -1
  152. package/dist/sankhyablocks/p-557affc8.entry.js +0 -1
  153. package/dist/sankhyablocks/p-564efc43.js +0 -1
  154. package/dist/sankhyablocks/p-6295424d.entry.js +0 -1
  155. package/dist/sankhyablocks/p-803b79d6.js +0 -1
  156. package/dist/sankhyablocks/p-80729c9b.entry.js +0 -11
  157. package/dist/sankhyablocks/p-95fa8af6.entry.js +0 -1
  158. package/dist/sankhyablocks/p-96c1ae78.entry.js +0 -1
  159. package/dist/sankhyablocks/p-b556fadc.entry.js +0 -1
  160. package/dist/sankhyablocks/p-befbc9ee.entry.js +0 -1
  161. package/dist/sankhyablocks/p-bf3bd954.entry.js +0 -1
  162. package/dist/sankhyablocks/p-c32b9d7c.entry.js +0 -1
  163. package/dist/sankhyablocks/p-c6380ea2.entry.js +0 -1
  164. package/dist/sankhyablocks/p-dd1fa35d.js +0 -56
  165. package/dist/sankhyablocks/p-de69b4b0.entry.js +0 -1
  166. package/dist/sankhyablocks/p-e42f1f2a.js +0 -1
  167. package/dist/sankhyablocks/p-f24c4bc7.entry.js +0 -1
  168. package/dist/sankhyablocks/p-fd69eab9.entry.js +0 -1
@@ -70,6 +70,7 @@ const SnkDataUnit = class {
70
70
  this.useCancelConfirm = true;
71
71
  this.ignoreSaveMessage = undefined;
72
72
  this.configName = undefined;
73
+ this.resourceID = undefined;
73
74
  }
74
75
  observePageSize() {
75
76
  if (this.dataUnit) {
@@ -333,10 +334,10 @@ const SnkDataUnit = class {
333
334
  const cacheName = this.dataUnitName ? this.dataUnitName : this.entityName;
334
335
  if (this._parentSnkDataUnit) {
335
336
  this._parentDataUnit = await ((_a = this._parentSnkDataUnit) === null || _a === void 0 ? void 0 : _a.getDataUnit());
336
- return await this._application.getDataUnit(this.entityName, cacheName, this._parentDataUnit, this.configName);
337
+ return await this._application.getDataUnit(this.entityName, cacheName, this._parentDataUnit, this.configName, this.resourceID);
337
338
  }
338
339
  else {
339
- return await this._application.getDataUnit(this.entityName, cacheName, null, this.configName);
340
+ return await this._application.getDataUnit(this.entityName, cacheName, null, this.configName, this.resourceID);
340
341
  }
341
342
  }
342
343
  async loadDataUnit() {
@@ -395,7 +396,7 @@ const SnkDataUnit = class {
395
396
  //---------------------------------------------
396
397
  componentWillLoad() {
397
398
  this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
398
- this._application.getAllAccess().then(access => this._permissions = access);
399
+ this._application.getAllAccess(this.resourceID).then(access => this._permissions = access);
399
400
  this._parentSnkDataUnit = this.getParentSnkDataUnit();
400
401
  if (this.messagesBuilder == undefined) {
401
402
  this.messagesBuilder = new SnkMessageBuilder(this.entityName);
@@ -1,4 +1,4 @@
1
- export { S as snk_data_unit } from './snk-data-unit-8c4d944d.js';
1
+ export { S as snk_data_unit } from './snk-data-unit-3ab57d1a.js';
2
2
  import './index-a7d3d3f1.js';
3
3
  import '@sankhyalabs/core';
4
4
  import '@sankhyalabs/ezui/dist/collection/utils';
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host } from './index-a7d3d3f1.js';
2
- import { S as SnkFormConfigManager } from './SnkFormConfigManager-80901f2d.js';
2
+ import { S as SnkFormConfigManager } from './SnkFormConfigManager-bfd8eabd.js';
3
3
  import { FormMetadata, buildFormMetadata } from '@sankhyalabs/ezui/dist/collection/utils/form';
4
4
  import './DataFetcher-aaaff866.js';
5
5
  import './pesquisa-fetcher-01d058e6.js';
@@ -7,12 +7,11 @@ import '@sankhyalabs/core';
7
7
  import { P as PresentationMode } from './index-1564817d.js';
8
8
  import { T as TaskbarElement } from './taskbar-elements-2c761819.js';
9
9
  import { c as VIEW_MODE } from './constants-3644f1b6.js';
10
- import { S as SnkGuidesViewer } from './snk-guides-viewer-ee42eb53.js';
10
+ import { S as SnkGuidesViewer } from './snk-guides-viewer-3ea14ab4.js';
11
11
  import { S as SnkMessageBuilder } from './SnkMessageBuilder-68c1c25a.js';
12
- import './ConfigStorage-b6aefe42.js';
12
+ import './ConfigStorage-cfe03e99.js';
13
13
  import './form-config-fetcher-4a34b86a.js';
14
14
  import './resource-fetcher-b36ac145.js';
15
- import './filter-bar-config-fetcher-317cb6bf.js';
16
15
  import './filter-item-type.enum-5028ed3f.js';
17
16
  import './_commonjsHelpers-9943807e.js';
18
17
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
@@ -76,6 +75,7 @@ const SnkDetailView = class {
76
75
  this.attachmentRegisterKey = undefined;
77
76
  this.formConfigManager = undefined;
78
77
  this.dataUnitName = undefined;
78
+ this.resourceID = undefined;
79
79
  this.guideItemPath = undefined;
80
80
  this.entityName = undefined;
81
81
  this.label = undefined;
@@ -245,7 +245,7 @@ const SnkDetailView = class {
245
245
  }
246
246
  componentWillLoad() {
247
247
  this._configName = `dynaform.${this.entityName}`;
248
- this.formConfigManager = new SnkFormConfigManager(this._configName, () => this.loadMetadata());
248
+ this.formConfigManager = new SnkFormConfigManager(this._configName, this.resourceID, () => this.loadMetadata());
249
249
  this.formConfigManager.loadConfig();
250
250
  if (this.messagesBuilder == undefined) {
251
251
  this.messagesBuilder = new SnkMessageBuilder(this.entityName);
@@ -254,7 +254,7 @@ const SnkDetailView = class {
254
254
  render() {
255
255
  this.updateLabel();
256
256
  //const cardConfig: IFormCardConfig = this._cardsState?.get(this.selectedForm);
257
- return (h(Host, null, h("snk-data-unit", { ref: (el) => this._snkDataUnit = el, dataUnitName: `${this.dataUnitName}`, onDataUnitReady: evt => this.dataUnitReadyHandler(evt), entityName: this.entityName, onDataStateChange: this.handleDataStateChange.bind(this), ignoreSaveMessage: this._currentView === VIEW_MODE.GRID, messagesBuilder: this.messagesBuilder, configName: this._configName }, h("ez-view-stack", { ref: (ref) => this.updateViewStack(ref) }, h("stack-item", null, h("div", { class: "ez-box ez-box--shadow grid-container" }, h("div", { class: "ez-flex ez-title--primary ez-size-width--full ez-padding--large detail-header" }, h("div", { class: "ez-flex ez-text ez-text--bold ez-flex--justify-start ez-flex--align-items-center" }, this._levelPath ? h("span", { class: "level-path" }, this._levelPath + " /") : undefined, this.label)), h("snk-grid", { class: "ez-size-width--full ez-size-height--full", ref: (ref) => this._snkGrid = ref, configName: this._configName, messagesBuilder: this.messagesBuilder, onGridDoubleClick: () => this.emitSwitchEvent(VIEW_MODE.FORM), onActionClick: (evt) => this.executeActionHandler(evt), presentationMode: PresentationMode.SECONDARY, canEdit: this.canEdit, isDetail: true }))), h("stack-item", null, h("snk-form-view", { ref: (ref) => this._snkFormView = ref, canExpand: false, canFix: false, name: this.selectedForm, formMetadata: this._formMetadata, dataUnit: this.dataUnit, fields: this.getFormFields(), label: this.label, levelPath: this._levelPath, onFormItemsReady: ({ detail: formItems }) => this.formItemsReady.emit(formItems) }, h("snk-taskbar", { key: "guideViewerTaskbar", class: "form-taskbar", "data-element-id": "guideViewer", configName: this._configName, messagesBuilder: this.messagesBuilder, disabledButtons: this._disabledButtons, buttons: "INSERT,PREVIOUS,NEXT,DIVIDER,CLONE,REMOVE,MORE_OPTIONS,DIVIDER,GRID_MODE,CONFIGURATOR", primaryButton: "INSERT", presentationMode: PresentationMode.SECONDARY, onActionClick: evt => this.executeActionHandler(evt), dataUnit: this.dataUnit }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this.entityName, onBack: this.handleAttachBack.bind(this) }))))));
257
+ return (h(Host, null, h("snk-data-unit", { ref: (el) => this._snkDataUnit = el, dataUnitName: `${this.dataUnitName}`, onDataUnitReady: evt => this.dataUnitReadyHandler(evt), entityName: this.entityName, onDataStateChange: this.handleDataStateChange.bind(this), ignoreSaveMessage: this._currentView === VIEW_MODE.GRID, messagesBuilder: this.messagesBuilder, configName: this._configName }, h("ez-view-stack", { ref: (ref) => this.updateViewStack(ref) }, h("stack-item", null, h("div", { class: "ez-box ez-box--shadow grid-container" }, h("div", { class: "ez-flex ez-title--primary ez-size-width--full ez-padding--large detail-header" }, h("div", { class: "ez-flex ez-text ez-text--bold ez-flex--justify-start ez-flex--align-items-center" }, this._levelPath ? h("span", { class: "level-path" }, this._levelPath + " /") : undefined, this.label)), h("snk-grid", { class: "ez-size-width--full ez-size-height--full", ref: (ref) => this._snkGrid = ref, configName: this._configName, messagesBuilder: this.messagesBuilder, onGridDoubleClick: () => this.emitSwitchEvent(VIEW_MODE.FORM), onActionClick: (evt) => this.executeActionHandler(evt), presentationMode: PresentationMode.SECONDARY, canEdit: this.canEdit, isDetail: true }))), h("stack-item", null, h("snk-form-view", { ref: (ref) => this._snkFormView = ref, canExpand: false, canFix: false, name: this.selectedForm, formMetadata: this._formMetadata, dataUnit: this.dataUnit, fields: this.getFormFields(), label: this.label, levelPath: this._levelPath, onFormItemsReady: ({ detail: formItems }) => this.formItemsReady.emit(formItems) }, h("snk-taskbar", { key: "guideViewerTaskbar", class: "form-taskbar", "data-element-id": "guideViewer", configName: this._configName, messagesBuilder: this.messagesBuilder, disabledButtons: this._disabledButtons, buttons: "INSERT,PREVIOUS,NEXT,DIVIDER,CLONE,REMOVE,MORE_OPTIONS,DIVIDER,GRID_MODE,CONFIGURATOR", primaryButton: "INSERT", presentationMode: PresentationMode.SECONDARY, onActionClick: evt => this.executeActionHandler(evt), dataUnit: this.dataUnit, resourceID: this.resourceID }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this.entityName, onBack: this.handleAttachBack.bind(this) }))))));
258
258
  }
259
259
  static get watchers() { return {
260
260
  "dataState": ["observerDataState"]
@@ -7,7 +7,6 @@ const SnkEntityList = class {
7
7
  constructor(hostRef) {
8
8
  registerInstance(this, hostRef);
9
9
  this.valueChanged = createEvent(this, "valueChanged", 7);
10
- this.saveConfig = createEvent(this, "saveConfig", 7);
11
10
  this._searchValue = undefined;
12
11
  this._ezListSource = [];
13
12
  this.config = undefined;
@@ -16,7 +15,6 @@ const SnkEntityList = class {
16
15
  }
17
16
  async reloadList() {
18
17
  this.loadListSource();
19
- this.saveConfig.emit(this.config);
20
18
  }
21
19
  observeConfig() {
22
20
  var _a, _b;
@@ -32,7 +30,6 @@ const SnkEntityList = class {
32
30
  }
33
31
  });
34
32
  this.config = ObjectUtils.copy(configCopy);
35
- this.saveConfig.emit(this.config);
36
33
  this.valueChanged.emit((_b = this.config) === null || _b === void 0 ? void 0 : _b.value);
37
34
  }
38
35
  loadListSource() {
@@ -89,7 +86,6 @@ const SnkEntityList = class {
89
86
  }
90
87
  ] });
91
88
  this.loadListSource();
92
- this.saveConfig.emit(this.config);
93
89
  this.valueChanged.emit((_d = this.config) === null || _d === void 0 ? void 0 : _d.value);
94
90
  }
95
91
  }
@@ -1,7 +1,7 @@
1
1
  import { r as registerInstance, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
2
2
  import { DataType, ObjectUtils, ElementIDUtils, ErrorException, ApplicationContext } from '@sankhyalabs/core';
3
3
  import { EzScrollDirection } from '@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection';
4
- import { C as ConfigStorage } from './ConfigStorage-b6aefe42.js';
4
+ import { C as ConfigStorage } from './ConfigStorage-cfe03e99.js';
5
5
  import { toString } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
6
6
  import { F as FilterItemType } from './filter-item-type.enum-5028ed3f.js';
7
7
  import { F as FilterOperand } from './index-ae591a44.js';
@@ -12,7 +12,6 @@ import './DataFetcher-aaaff866.js';
12
12
  import './_commonjsHelpers-9943807e.js';
13
13
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
14
14
  import './resource-fetcher-b36ac145.js';
15
- import './filter-bar-config-fetcher-317cb6bf.js';
16
15
 
17
16
  const buildFilter = (item) => {
18
17
  switch (item.type) {
@@ -204,6 +203,7 @@ const SnkFilterBar = class {
204
203
  };
205
204
  this.dataUnit = undefined;
206
205
  this.configName = undefined;
206
+ this.resourceID = undefined;
207
207
  this.filterConfig = undefined;
208
208
  this.messagesBuilder = undefined;
209
209
  this.allowDefault = undefined;
@@ -283,7 +283,7 @@ const SnkFilterBar = class {
283
283
  }
284
284
  if (this._configUpdated) {
285
285
  this._configUpdated = false;
286
- ConfigStorage.saveFilterBarConfig(this.filterConfig, this.configName);
286
+ ConfigStorage.saveFilterBarConfig(this.filterConfig, this.configName, this.resourceID);
287
287
  }
288
288
  }
289
289
  /**
@@ -399,15 +399,13 @@ const SnkFilterBar = class {
399
399
  }
400
400
  loadConfigFromStorage() {
401
401
  return new Promise(accept => {
402
- ConfigStorage.get().then(instance => {
403
- instance.loadFilterBarConfig(this.configName, { contextURI: this.dataUnit.name })
404
- .then((filters) => {
405
- accept();
406
- this.filterConfig = filters.map(item => this.normalizeItem(item));
407
- })
408
- .catch(reason => {
409
- throw new ErrorException(this.getMessage("snkFilterBar.failToLoadConfig"), reason);
410
- });
402
+ ConfigStorage.loadFilterBarConfig(this.configName, this.resourceID, { contextURI: this.dataUnit.name })
403
+ .then((filters) => {
404
+ accept();
405
+ this.filterConfig = filters.map(item => this.normalizeItem(item));
406
+ })
407
+ .catch(reason => {
408
+ throw new ErrorException(this.getMessage("snkFilterBar.failToLoadConfig"), reason);
411
409
  });
412
410
  });
413
411
  }
@@ -492,7 +490,7 @@ const SnkFilterBar = class {
492
490
  return undefined;
493
491
  }
494
492
  if (this.showPersonalizedFilter) {
495
- 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 });
493
+ 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 });
496
494
  }
497
495
  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" }))));
498
496
  }
@@ -1,14 +1,9 @@
1
1
  import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host, g as getElement } from './index-a7d3d3f1.js';
2
2
  import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
3
3
  import { F as FilterItemType } from './filter-item-type.enum-5028ed3f.js';
4
- import { ApplicationContext, ElementIDUtils, ObjectUtils } from '@sankhyalabs/core';
5
- import { F as FilterBarConfigFetcher } from './filter-bar-config-fetcher-317cb6bf.js';
4
+ import { ElementIDUtils, ObjectUtils } from '@sankhyalabs/core';
6
5
  import { E as EPresentationMode } from './presentationMode-783bbf9d.js';
7
6
  import { P as PersonalizedFilterUtils } from './PersonalizedFilterUtils-75fb0106.js';
8
- import './resource-fetcher-b36ac145.js';
9
- import './DataFetcher-aaaff866.js';
10
- import './_commonjsHelpers-9943807e.js';
11
- import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
12
7
  import './index-ae591a44.js';
13
8
 
14
9
  const SnkFilterDetail = class {
@@ -32,7 +27,6 @@ const SnkFilterDetail = class {
32
27
  }
33
28
  componentDidLoad() {
34
29
  if (this._element) {
35
- this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
36
30
  ElementIDUtils.addIDInfo(this._element);
37
31
  const dataElementIdDoFilterItem = this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME);
38
32
  this._idContentEditor = `${dataElementIdDoFilterItem}_${this.config.id}`;
@@ -150,20 +144,12 @@ const SnkFilterDetail = class {
150
144
  this.config = ObjectUtils.copy(configCopy);
151
145
  }
152
146
  }
153
- saveConfig(newConfig) {
154
- var _a;
155
- (_a = this._application) === null || _a === void 0 ? void 0 : _a.getResourceID().then(resourceId => {
156
- const fetcher = new FilterBarConfigFetcher();
157
- fetcher.saveEntityListConfig(newConfig, resourceId, this._application.configName);
158
- this.config = newConfig;
159
- });
160
- }
161
147
  componentWillLoad() {
162
148
  this.originalConfig = ObjectUtils.copy(this.config);
163
149
  }
164
150
  render() {
165
151
  const { tag: CustomElement, props } = this.getContentEditor();
166
- 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" }))));
152
+ 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" }))));
167
153
  }
168
154
  get _element() { return getElement(this); }
169
155
  static get watchers() { return {
@@ -1,15 +1,14 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
2
- import { ElementIDUtils, ApplicationContext, ObjectUtils } from '@sankhyalabs/core';
2
+ import { ElementIDUtils, ObjectUtils } from '@sankhyalabs/core';
3
3
  import { F as FilterItemType } from './filter-item-type.enum-5028ed3f.js';
4
4
  import { E as EPresentationMode } from './presentationMode-783bbf9d.js';
5
- import { C as ConfigStorage } from './ConfigStorage-b6aefe42.js';
5
+ import { C as ConfigStorage } from './ConfigStorage-cfe03e99.js';
6
6
  import { F as FilterType } from './filter-type.enum-a80c1b6b.js';
7
7
  import './form-config-fetcher-4a34b86a.js';
8
8
  import './DataFetcher-aaaff866.js';
9
9
  import './_commonjsHelpers-9943807e.js';
10
10
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
11
11
  import './resource-fetcher-b36ac145.js';
12
- import './filter-bar-config-fetcher-317cb6bf.js';
13
12
 
14
13
  const snkFilterModalItemCss = ".grow{flex-grow:1}.gap{gap:4px}";
15
14
 
@@ -21,14 +20,13 @@ const SnkFilterModalItem = class {
21
20
  this.addPersonalizedFilter = createEvent(this, "addPersonalizedFilter", 7);
22
21
  this.filterItem = undefined;
23
22
  this.configName = undefined;
23
+ this.resourceID = undefined;
24
24
  }
25
25
  observeFilterItem(newValue) {
26
26
  var _a, _b;
27
27
  this._editor && (this._editor["config"] = newValue);
28
28
  (_b = (_a = this._editor) === null || _a === void 0 ? void 0 : _a['reloadList']) === null || _b === void 0 ? void 0 : _b.call(_a);
29
29
  this.filterChange.emit(newValue);
30
- //isso faz o filtro salvar o estado precocemente. Caso: Botão limpar filtro dispara dezenas de vezes
31
- //this.saveConfig();
32
30
  }
33
31
  getContentEditorConfig() {
34
32
  const props = { presentationMode: EPresentationMode.MODAL };
@@ -70,11 +68,10 @@ const SnkFilterModalItem = class {
70
68
  else {
71
69
  this.filterItem = Object.assign(Object.assign({}, this.filterItem), { value: this.filterItem.type === FilterItemType.SEARCH ? data : newValue, visible: this.isVisible(newValue) });
72
70
  }
73
- this.saveConfig();
74
71
  }
75
72
  handleDeleteFilter(filter, filterItemType) {
76
73
  if (filterItemType === FilterItemType.PERSONALIZED) {
77
- ConfigStorage.removePersonalizedFilter(filter, this.configName);
74
+ ConfigStorage.removePersonalizedFilter(filter, this.resourceID, this.configName);
78
75
  }
79
76
  }
80
77
  componentDidLoad() {
@@ -82,7 +79,6 @@ const SnkFilterModalItem = class {
82
79
  ElementIDUtils.addIDInfo(this._element);
83
80
  const dataElementIdDoFilterItem = this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME);
84
81
  this._idContentEditor = `${dataElementIdDoFilterItem}_${this.filterItem.id}`;
85
- this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
86
82
  }
87
83
  }
88
84
  buildRightSlot(item) {
@@ -99,15 +95,6 @@ const SnkFilterModalItem = class {
99
95
  const { CUSTOM_FILTER, OTHER_FILTERS } = FilterType;
100
96
  return ![CUSTOM_FILTER, OTHER_FILTERS].includes(this.filterItem.filterType) && this.filterItem.type !== FilterItemType.BINARY_SELECT;
101
97
  }
102
- saveConfig() {
103
- //Precisa ser rediscutido... não podemos salvar configuração por conta própria. Não temos autonomia pra isso.
104
- /*if(FilterItemType.MULTI_LIST !== this.filterItem.type) return;
105
-
106
- this._application?.getResourceID().then(resourceId => {
107
- const fetcher = new FilterBarConfigFetcher();
108
- fetcher.saveEntityListConfig(this.filterItem, resourceId, this._application.configName);
109
- });*/
110
- }
111
98
  render() {
112
99
  const { tag: ContentEditor, props } = this.getContentEditorConfig();
113
100
  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)))));
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
2
2
  import { d as draggable_bundle } from './draggable.bundle-41d56f06.js';
3
- import { ObjectUtils, ElementIDUtils, ArrayUtils, ApplicationContext } from '@sankhyalabs/core';
3
+ import { ObjectUtils, ElementIDUtils, ArrayUtils } from '@sankhyalabs/core';
4
4
  import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
5
5
  import { C as CONFIG_EVENTS, T as TAB_NAMES, A as ACTION_CONFIG, D as DEFAULT_TYPE } from './constants-3644f1b6.js';
6
6
  import { U as UserConfigType } from './form-config-fetcher-4a34b86a.js';
@@ -453,13 +453,10 @@ const SnkFormConfig = class {
453
453
  this._sortableGroup.on(CONFIG_EVENTS.dragStop, (evt) => this.controlStopDraggingGroup(evt));
454
454
  }
455
455
  loadUserConfig() {
456
- if (this._applicationResourceID == undefined) {
457
- return;
458
- }
459
456
  if (this.configManager == undefined) {
460
457
  return;
461
458
  }
462
- this.configManager.fetchUserAvailableConfigs(this._applicationResourceID)
459
+ this.configManager.fetchUserAvailableConfigs()
463
460
  .then((userConfig) => {
464
461
  this._formConfigOptions = userConfig;
465
462
  if (this._formConfigOptions == undefined) {
@@ -513,9 +510,6 @@ const SnkFormConfig = class {
513
510
  }
514
511
  }
515
512
  async loadConfigByUser() {
516
- if (this._applicationResourceID == undefined) {
517
- return;
518
- }
519
513
  if (this.configManager == undefined) {
520
514
  return;
521
515
  }
@@ -525,10 +519,10 @@ const SnkFormConfig = class {
525
519
  let config;
526
520
  switch (this._optionFormConfigSelected.origin) {
527
521
  case UserConfigType.DEFAULT:
528
- config = await this.configManager.fetchDefaultConfig(this._applicationResourceID);
522
+ config = await this.configManager.fetchDefaultConfig();
529
523
  break;
530
524
  case UserConfigType.DEFAULT:
531
- config = await this.configManager.fetchDefaultConfig(this._applicationResourceID);
525
+ config = await this.configManager.fetchDefaultConfig();
532
526
  break;
533
527
  }
534
528
  if (config != undefined) {
@@ -944,11 +938,7 @@ const SnkFormConfig = class {
944
938
  this.controlSortableGroup();
945
939
  }
946
940
  componentWillLoad() {
947
- this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
948
- this._application.getResourceID().then(resourceID => {
949
- this._applicationResourceID = resourceID;
950
- this.loadConfig();
951
- });
941
+ this.loadConfig();
952
942
  }
953
943
  componentDidLoad() {
954
944
  const dataInfo = { dataUnit: this.dataUnit };
@@ -1,13 +1,13 @@
1
1
  import { r as registerInstance, c as createEvent, h, g as getElement } from './index-a7d3d3f1.js';
2
2
  import { ElementIDUtils } from '@sankhyalabs/core';
3
- import { S as SnkFormConfigManager } from './SnkFormConfigManager-80901f2d.js';
4
- import './ConfigStorage-b6aefe42.js';
3
+ import { S as SnkFormConfigManager } from './SnkFormConfigManager-bfd8eabd.js';
4
+ import { R as ResourceIDUtils } from './ResourceIDUtils-a114189a.js';
5
+ import './ConfigStorage-cfe03e99.js';
5
6
  import './form-config-fetcher-4a34b86a.js';
6
7
  import './DataFetcher-aaaff866.js';
7
8
  import './_commonjsHelpers-9943807e.js';
8
9
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
9
10
  import './resource-fetcher-b36ac145.js';
10
- import './filter-bar-config-fetcher-317cb6bf.js';
11
11
  import './filter-item-type.enum-5028ed3f.js';
12
12
 
13
13
  const snkFormCss = ".sc-snk-form-h{--snk-form__header--min-height:94px;display:block}.snk-form__form--hidden.sc-snk-form{display:none}";
@@ -25,6 +25,7 @@ const SnkForm = class {
25
25
  this.configName = undefined;
26
26
  this.recordsValidator = undefined;
27
27
  this.messagesBuilder = undefined;
28
+ this.resourceID = undefined;
28
29
  }
29
30
  /**
30
31
  * Exibe a janela de configurações do formulário.
@@ -45,7 +46,7 @@ const SnkForm = class {
45
46
  const dataInfo = { dataUnit: this._dataUnit };
46
47
  ElementIDUtils.addIDInfo(this._element, null, dataInfo);
47
48
  }
48
- componentWillLoad() {
49
+ async componentWillLoad() {
49
50
  let parent = this._element.parentElement;
50
51
  while (parent) {
51
52
  if (parent.tagName.toUpperCase() === "SNK-DATA-UNIT") {
@@ -67,7 +68,10 @@ const SnkForm = class {
67
68
  }
68
69
  parent = parent.parentElement;
69
70
  }
70
- this._configManager = new SnkFormConfigManager(this.configName);
71
+ if (this.resourceID == undefined) {
72
+ this.resourceID = await ResourceIDUtils.getResourceID();
73
+ }
74
+ this._configManager = new SnkFormConfigManager(this.configName, this.resourceID);
71
75
  this._configManager.loadConfig();
72
76
  }
73
77
  render() {
@@ -2,14 +2,13 @@ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement
2
2
  import { StringUtils, ElementIDUtils } from '@sankhyalabs/core';
3
3
  import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
4
4
  import { CheckMode } from '@sankhyalabs/ezui/dist/collection/components/ez-check/CheckMode';
5
- import { C as ConfigStorage } from './ConfigStorage-b6aefe42.js';
5
+ import { C as ConfigStorage } from './ConfigStorage-cfe03e99.js';
6
6
  import { O as ORDER_VALUES } from './constants-3644f1b6.js';
7
7
  import './form-config-fetcher-4a34b86a.js';
8
8
  import './DataFetcher-aaaff866.js';
9
9
  import './_commonjsHelpers-9943807e.js';
10
10
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
11
11
  import './resource-fetcher-b36ac145.js';
12
- import './filter-bar-config-fetcher-317cb6bf.js';
13
12
  import './filter-item-type.enum-5028ed3f.js';
14
13
 
15
14
  const snkGridConfigCss = ".sc-snk-grid-config-h{--snk-grid-config__footer--padding-top:var(--space--medium, 12px);--snk-grid-config__main--padding-right:var(--space--medium, 12px);--snk-grid-config__tabselector-container--padding:var(--space--medium, 12px);--snk-grid-config__button-close--padding-left:var(--space--medium, 12px);--snk-grid-config__title--color:var(--title--primary, #2B3A54);--snk-grid-config__title--font-family:var(--font-pattern, \"Roboto\");--snk-grid-config__title--font-size:var(--title--large, 20px);--snk-grid-config__title--font-weight:var(--text-weight--extra-large, 700);--snk-grid-config__subtitle--font-family:var(--font-pattern, \"Roboto\");--snk-grid-config__subtitle--font-size:var(--text--medium, 14px);--snk-grid-config__group--font-family:var(--font-pattern, \"Roboto\");--snk-grid-config__group--font-size:var(--text--medium, 14px);--snk-grid-config__group--font-weight:var(--text-weight--large, 600);--snk-grid-config__group--padding-bottom:var(--space-small, 6px);--snk-grid-config__scrollbar--color-default:var(--scrollbar--default, #626e82);--snk-grid-config__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--snk-grid-config__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--snk-grid-config__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--snk-grid-config__scrollbar--border-radius:var(--border--radius-small, 6px);--snk-grid-config__scrollbar--width:var(--space--medium, 12px);display:grid;grid-template-rows:auto 1fr auto;max-height:100%;width:100%}@media screen and (min-width: 480px){.sc-snk-grid-config-h{width:359px;max-width:359px}}.padding-right--medium.sc-snk-grid-config{padding-right:var(--space--medium)}ez-list.sc-snk-grid-config{height:100%}.height-calc.sc-snk-grid-config{max-height:calc(100% - 24px)}.grid-config__footer.sc-snk-grid-config{display:flex;justify-content:flex-end;width:100%;padding-top:var(--snk-grid-config__footer--padding-top)}.hidden.sc-snk-grid-config{display:none}.tabselector-container.sc-snk-grid-config{padding:var(--snk-grid-config__tabselector-container--padding) 0}.button-close.sc-snk-grid-config{padding-left:var(--snk-grid-config__button-close--padding-left)}.title-container.sc-snk-grid-config{display:flex;justify-content:space-between;align-items:center;width:100%}.title.sc-snk-grid-config{display:flex;margin:0;line-height:normal;letter-spacing:0em;text-align:left;color:var(--snk-grid-config__title--color);font-size:var(--snk-grid-config__title--font-size);font-family:var(--snk-grid-config__title--font-family);font-weight:var(--snk-grid-config__title--font-weight)}.subtitle.sc-snk-grid-config{color:var(--text--primary);font-size:var(--snk-grid-config__subtitle--font-size);font-family:var(--snk-grid-config__subtitle--font-family)}.grid-config__main.sc-snk-grid-config{overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--snk-grid-config__scrollbar--color-clicked) var(--snk-grid-config__scrollbar--color-background);padding-right:var(--snk-grid-config__main--padding-right)}.grid-config__main.sc-snk-grid-config::-webkit-scrollbar{width:var(--snk-grid-config__scrollbar--width);max-width:var(--snk-grid-config__scrollbar--width);min-width:var(--snk-grid-config__scrollbar--width);background-color:var(--snk-grid-config__scrollbar--color-background)}.grid-config__main.sc-snk-grid-config::-webkit-scrollbar-track{background-color:var(--snk-grid-config__scrollbar--color-background);border-radius:var(--snk-grid-config__scrollbar--border-radius)}.grid-config__main.sc-snk-grid-config::-webkit-scrollbar-thumb{background-color:var(--snk-grid-config__scrollbar--color-default);border-radius:var(--snk-grid-config__scrollbar--border-radius)}.grid-config__main.sc-snk-grid-config::-webkit-scrollbar-thumb:vertical:hover,.grid-config__main.sc-snk-grid-config::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--snk-grid-config__scrollbar--color-hover)}.grid-config__main.sc-snk-grid-config::-webkit-scrollbar-thumb:vertical:active,.grid-config__main.sc-snk-grid-config::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--snk-grid-config__scrollbar--color-clicked)}.group-name.sc-snk-grid-config{font-family:var(--snk-grid-config__group--font-family);font-size:var(--snk-grid-config__group--font-size);font-weight:var(--snk-grid-config__group--font-weight);padding-bottom:var(--snk-grid-config__group--padding-bottom)}";
@@ -30,6 +29,7 @@ const SnkGridConfig = class {
30
29
  this.columns = undefined;
31
30
  this.config = undefined;
32
31
  this.configName = undefined;
32
+ this.resourceID = undefined;
33
33
  }
34
34
  /* Creation Methods */
35
35
  /**
@@ -253,7 +253,7 @@ const SnkGridConfig = class {
253
253
  }
254
254
  }
255
255
  _newConfig.columns = _newColumnConfigList;
256
- ConfigStorage.saveGridConfig(_newConfig, this.configName)
256
+ ConfigStorage.saveGridConfig(_newConfig, this.configName, this.resourceID)
257
257
  .then((savedConfig) => {
258
258
  this.configChange.emit(savedConfig);
259
259
  this._orderList.clearHistory();
@@ -2,7 +2,7 @@ import { r as registerInstance, c as createEvent, h, g as getElement } from './i
2
2
  import { ElementIDUtils, ApplicationContext, DataType } from '@sankhyalabs/core';
3
3
  import { UserInterface } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
4
4
  import { T as TaskbarElement } from './taskbar-elements-2c761819.js';
5
- import { C as ConfigStorage } from './ConfigStorage-b6aefe42.js';
5
+ import { C as ConfigStorage } from './ConfigStorage-cfe03e99.js';
6
6
  import { P as PresentationMode } from './index-1564817d.js';
7
7
  import { T as TaskbarProcessor } from './taskbar-processor-94402e6e.js';
8
8
  import { s as store } from './index-bdf75557.js';
@@ -12,7 +12,6 @@ import './form-config-fetcher-4a34b86a.js';
12
12
  import './DataFetcher-aaaff866.js';
13
13
  import './_commonjsHelpers-9943807e.js';
14
14
  import './resource-fetcher-b36ac145.js';
15
- import './filter-bar-config-fetcher-317cb6bf.js';
16
15
  import './filter-item-type.enum-5028ed3f.js';
17
16
 
18
17
  const snkGridCss = ".snk-grid__container.sc-snk-grid{display:flex;height:100%;width:100%}.snk-grid__header.sc-snk-grid{display:flex;flex-wrap:nowrap;width:100%}.snk-grid__filter-bar.sc-snk-grid{width:100%}.snk-grid__header-divider.sc-snk-grid{margin-bottom:var(--space--medium)}.snk-grid__table.sc-snk-grid{min-height:300px}.snk-grid-container__without-shadow.sc-snk-grid{--ezgrid__container--shadow:unset}";
@@ -40,6 +39,7 @@ const SnkGrid = class {
40
39
  this._popUpGridConfig = false;
41
40
  this.columnFilterDataSource = new SnkMultiSelectionListDataSource();
42
41
  this.configName = undefined;
42
+ this.resourceID = undefined;
43
43
  this.selectionToastConfig = undefined;
44
44
  this.actionsList = undefined;
45
45
  this.isDetail = undefined;
@@ -98,20 +98,17 @@ const SnkGrid = class {
98
98
  this._gridConfig = config;
99
99
  }
100
100
  loadConfig() {
101
- ConfigStorage.get()
102
- .then((instance) => {
103
- instance.loadGridConfig(this.configName)
104
- .then((config) => {
105
- this.setGridConfig(config);
106
- })
107
- .catch((error) => {
108
- console.warn(error);
109
- });
101
+ ConfigStorage.loadGridConfig(this.configName, this.resourceID)
102
+ .then((config) => {
103
+ this.setGridConfig(config);
104
+ })
105
+ .catch((error) => {
106
+ console.warn(error);
110
107
  });
111
108
  }
112
109
  gridConfigChangeHandler(evt) {
113
110
  const config = evt.detail;
114
- ConfigStorage.saveGridConfig(config, this.configName);
111
+ ConfigStorage.saveGridConfig(config, this.configName, this.resourceID);
115
112
  evt.stopPropagation();
116
113
  }
117
114
  modalConfigChangeHandler(evt) {
@@ -319,8 +316,8 @@ const SnkGrid = class {
319
316
  if (!this._dataUnit) {
320
317
  return undefined;
321
318
  }
322
- 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 &&
323
- 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() }))));
319
+ 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 &&
320
+ 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 }))));
324
321
  }
325
322
  get _element() { return getElement(this); }
326
323
  };
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, c as createEvent, h, F as Fragment } from './index-a7d3d3f1.js';
2
2
  import { ElementIDUtils } from '@sankhyalabs/core';
3
- import { S as SnkFormConfigManager } from './SnkFormConfigManager-80901f2d.js';
3
+ import { S as SnkFormConfigManager } from './SnkFormConfigManager-bfd8eabd.js';
4
4
  import { buildFormMetadata, FormMetadata } from '@sankhyalabs/ezui/dist/collection/utils/form';
5
5
  import { T as TaskbarProcessor } from './taskbar-processor-94402e6e.js';
6
6
  import { T as TaskbarElement } from './taskbar-elements-2c761819.js';
@@ -32,6 +32,7 @@ const SnkGuidesViewer = class {
32
32
  this.messagesBuilder = undefined;
33
33
  this.canEdit = true;
34
34
  this.presentationMode = undefined;
35
+ this.resourceID = undefined;
35
36
  this._breadcrumbItems = [];
36
37
  this._guides = undefined;
37
38
  this._formEditorConfigManager = undefined;
@@ -233,7 +234,7 @@ const SnkGuidesViewer = class {
233
234
  else {
234
235
  detailBranch = this.selectedGuide;
235
236
  }
236
- content = this.wrapDetail(levels, h("snk-detail-view", { ref: (ref) => this._currentDetail = ref, dataUnitName: this.getDataUnitName(levels, childEntityName), onSnkDetailGuidesChange: (evt) => this.updateGuide(evt.detail), entityName: childEntityName, selectedForm: formName, branchGuide: detailBranch, guideItemPath: this._breadcrumbItems, key: `detail${detailId}`, canEdit: this.canEdit, onSnkSwitchGuide: evt => this._guideNavigator.selectGuide(evt.detail) }));
237
+ content = this.wrapDetail(levels, h("snk-detail-view", { ref: (ref) => this._currentDetail = ref, dataUnitName: this.getDataUnitName(levels, childEntityName), onSnkDetailGuidesChange: (evt) => this.updateGuide(evt.detail), entityName: childEntityName, selectedForm: formName, branchGuide: detailBranch, guideItemPath: this._breadcrumbItems, key: `detail${detailId}`, canEdit: this.canEdit, onSnkSwitchGuide: evt => this._guideNavigator.selectGuide(evt.detail), resourceID: this.resourceID }));
237
238
  }
238
239
  else {
239
240
  const cardId = this.selectedGuide.id;
@@ -282,7 +283,10 @@ const SnkGuidesViewer = class {
282
283
  return this.selectedGuide === undefined || '__main' === ((_a = this.selectedGuide) === null || _a === void 0 ? void 0 : _a.id);
283
284
  }
284
285
  componentWillLoad() {
285
- this._configManager = new SnkFormConfigManager(this.configName, config => this.masterFormConfig = config);
286
+ if (this.resourceID == undefined) {
287
+ throw new Error("Erro interno: resourceID não informado");
288
+ }
289
+ this._configManager = new SnkFormConfigManager(this.configName, this.resourceID, config => this.masterFormConfig = config);
286
290
  this._configManager.loadConfig();
287
291
  }
288
292
  componentDidRender() {
@@ -301,7 +305,7 @@ const SnkGuidesViewer = class {
301
305
  }
302
306
  buildTaskBar() {
303
307
  var _a;
304
- return h("div", { class: `ez-col ez-flex-item--align-center ez-col--sd-6 ez-col--tb-6 ${this.presentationMode != PresentationMode.SECONDARY ? 'ez-align--right' : 'ez-padding-bottom--medium'}` }, h("snk-taskbar", { key: "guideViewerTaskbar", "data-element-id": "guideViewer", configName: this.configName, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, actionsList: this.actionsList, messagesBuilder: this.messagesBuilder, presentationMode: this.presentationMode, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-taskbar-owner": "master", dataUnit: this.dataUnit }));
308
+ return h("div", { class: `ez-col ez-flex-item--align-center ez-col--sd-6 ez-col--tb-6 ${this.presentationMode != PresentationMode.SECONDARY ? 'ez-align--right' : 'ez-padding-bottom--medium'}` }, h("snk-taskbar", { key: "guideViewerTaskbar", "data-element-id": "guideViewer", configName: this.configName, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, actionsList: this.actionsList, messagesBuilder: this.messagesBuilder, presentationMode: this.presentationMode, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-taskbar-owner": "master", dataUnit: this.dataUnit, resourceID: this.resourceID }));
305
309
  }
306
310
  render() {
307
311
  var _a, _b;
@@ -320,7 +324,7 @@ const SnkGuidesViewer = class {
320
324
  h("div", { class: "ez-margin-top--extra-small" }, h("ez-breadcrumb", Object.assign({ items: this._breadcrumbItems, onSelectedItem: (evt) => this.onBreadcrumbClickHandler(evt === null || evt === void 0 ? void 0 : evt.detail) }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("breadcrumb")}` }))))), this.presentationMode != PresentationMode.SECONDARY && this.buildTaskBar()), h("div", { class: "snk-guides-viewer__container" }, showGuides ?
321
325
  h("ez-guide-navigator", { ref: (ref) => this._guideNavigator = ref, class: "snk-guides-viewer__guide-navigator", items: this._guides, selectedId: this.selectedGuide ? this.selectedGuide.id : undefined, onEzSelectionChange: evt => this.updateSelectedGuideHandler(evt.detail) })
322
326
  :
323
- h("div", null), h("div", { class: "snk-guides-viewer__detail-container" }, SnkGuidesViewer.buildFixedForms(this.masterFormConfig, this._masterFormMetadata, (_b = this.selectedGuide) === null || _b === void 0 ? void 0 : _b.id, this.dataUnit, this.recordsValidator), this.getContent())), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this.getConfigViewMode(), onConfigSelected: (evt) => this.changeConfigViewMode(evt.detail), messagesBuilder: this.messagesBuilder, onOpenConfig: (evt) => this.openConfig(evt.detail) })));
327
+ h("div", null), h("div", { class: "snk-guides-viewer__detail-container" }, SnkGuidesViewer.buildFixedForms(this.masterFormConfig, this._masterFormMetadata, (_b = this.selectedGuide) === null || _b === void 0 ? void 0 : _b.id, this.dataUnit, this.recordsValidator), this.getContent())), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this.getConfigViewMode(), onConfigSelected: (evt) => this.changeConfigViewMode(evt.detail), messagesBuilder: this.messagesBuilder, onOpenConfig: (evt) => this.openConfig(evt.detail), resourceID: this.resourceID })));
324
328
  }
325
329
  static get watchers() { return {
326
330
  "dataUnit": ["observeDataUnit"],
@@ -1,14 +1,13 @@
1
- export { S as snk_guides_viewer } from './snk-guides-viewer-ee42eb53.js';
1
+ export { S as snk_guides_viewer } from './snk-guides-viewer-3ea14ab4.js';
2
2
  import './index-a7d3d3f1.js';
3
3
  import '@sankhyalabs/core';
4
- import './SnkFormConfigManager-80901f2d.js';
5
- import './ConfigStorage-b6aefe42.js';
4
+ import './SnkFormConfigManager-bfd8eabd.js';
5
+ import './ConfigStorage-cfe03e99.js';
6
6
  import './form-config-fetcher-4a34b86a.js';
7
7
  import './DataFetcher-aaaff866.js';
8
8
  import './_commonjsHelpers-9943807e.js';
9
9
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
10
10
  import './resource-fetcher-b36ac145.js';
11
- import './filter-bar-config-fetcher-317cb6bf.js';
12
11
  import './filter-item-type.enum-5028ed3f.js';
13
12
  import '@sankhyalabs/ezui/dist/collection/utils/form';
14
13
  import './taskbar-processor-94402e6e.js';