@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-74246.1 → 0.0.0-bugfix-dev-KB-74224.0

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 (145) hide show
  1. package/dist/cjs/{ConfigStorage-f079f5fd.js → ConfigStorage-ecc0ed20.js} +2 -2
  2. package/dist/cjs/{ContinuousInsertUtils-64e47516.js → ContinuousInsertUtils-29b65619.js} +20 -29
  3. package/dist/cjs/{DataFetcher-e059eb72.js → DataFetcher-cadeef8e.js} +5 -7
  4. package/dist/cjs/{SnkFormConfigManager-bff848f1.js → SnkFormConfigManager-f1c92f79.js} +5 -5
  5. package/dist/cjs/{auth-fetcher-4f853233.js → auth-fetcher-d68841bc.js} +1 -1
  6. package/dist/cjs/{dataunit-fetcher-228016f4.js → dataunit-fetcher-f89461c1.js} +3 -3
  7. package/dist/cjs/{form-config-fetcher-39397ac5.js → form-config-fetcher-ed497282.js} +1 -1
  8. package/dist/cjs/index-f9e81701.js +28 -8
  9. package/dist/cjs/loader.cjs.js +1 -1
  10. package/dist/cjs/{pesquisa-fetcher-a9bfeb22.js → pesquisa-fetcher-ca89181c.js} +2 -7
  11. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  12. package/dist/cjs/snk-actions-button_4.cjs.entry.js +30 -27
  13. package/dist/cjs/snk-application.cjs.entry.js +59 -101
  14. package/dist/cjs/snk-attach.cjs.entry.js +5 -5
  15. package/dist/cjs/snk-config-options.cjs.entry.js +239 -0
  16. package/dist/cjs/snk-crud.cjs.entry.js +5 -5
  17. package/dist/cjs/snk-data-exporter.cjs.entry.js +5 -5
  18. package/dist/cjs/{snk-data-unit-3d4d0e2a.js → snk-data-unit-668dc5e8.js} +1 -1
  19. package/dist/cjs/snk-data-unit.cjs.entry.js +3 -3
  20. package/dist/cjs/snk-detail-view.cjs.entry.js +7 -7
  21. package/dist/cjs/{snk-filter-bar_4.cjs.entry.js → snk-filter-bar.cjs.entry.js} +3 -688
  22. package/dist/cjs/snk-filter-item.cjs.entry.js +312 -0
  23. package/dist/cjs/snk-filter-list.cjs.entry.js +152 -0
  24. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
  25. package/dist/cjs/snk-filter-modal.cjs.entry.js +249 -0
  26. package/dist/cjs/{snk-config-options_3.cjs.entry.js → snk-form-config.cjs.entry.js} +3 -365
  27. package/dist/cjs/snk-form.cjs.entry.js +144 -0
  28. package/dist/cjs/snk-grid.cjs.entry.js +6 -6
  29. package/dist/cjs/{snk-guides-viewer-2b44c804.js → snk-guides-viewer-4236cb9d.js} +5 -8
  30. package/dist/cjs/snk-guides-viewer.cjs.entry.js +7 -7
  31. package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
  32. package/dist/cjs/snk-simple-crud.cjs.entry.js +14 -14
  33. package/dist/collection/collection-manifest.json +31 -11
  34. package/dist/collection/components/snk-actions-button/interfaces/index.js +1 -0
  35. package/dist/collection/components/snk-actions-button/snk-actions-button.js +27 -26
  36. package/dist/collection/components/snk-application/snk-application.js +53 -3
  37. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +0 -3
  38. package/dist/collection/components/snk-form-config/SnkFormConfigManager.js +3 -3
  39. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +7 -7
  40. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +6 -8
  41. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.js +2 -2
  42. package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +1 -6
  43. package/dist/collection/lib/utils/CrudUtils.js +16 -25
  44. package/dist/components/ContinuousInsertUtils.js +16 -25
  45. package/dist/components/DataFetcher.js +5 -7
  46. package/dist/components/SnkFormConfigManager.js +3 -3
  47. package/dist/components/dataunit-fetcher.js +2 -2
  48. package/dist/components/pesquisa-fetcher.js +1 -6
  49. package/dist/components/snk-actions-button2.js +27 -26
  50. package/dist/components/snk-application2.js +53 -95
  51. package/dist/components/snk-detail-view2.js +0 -3
  52. package/dist/components/snk-simple-crud2.js +7 -7
  53. package/dist/esm/{ConfigStorage-6514d66e.js → ConfigStorage-7b36d041.js} +2 -2
  54. package/dist/esm/{ContinuousInsertUtils-b62906f9.js → ContinuousInsertUtils-30caa626.js} +20 -29
  55. package/dist/esm/{DataFetcher-5034df59.js → DataFetcher-a9c598f2.js} +5 -7
  56. package/dist/esm/{SnkFormConfigManager-f0532f7d.js → SnkFormConfigManager-139f09fa.js} +6 -6
  57. package/dist/esm/{auth-fetcher-ca5d3a49.js → auth-fetcher-749d880f.js} +1 -1
  58. package/dist/esm/{constants-7302ee87.js → constants-8457af36.js} +1 -1
  59. package/dist/esm/{dataunit-fetcher-56cb648b.js → dataunit-fetcher-c24c76c6.js} +3 -3
  60. package/dist/esm/{form-config-fetcher-a7d3e277.js → form-config-fetcher-adbe5d34.js} +1 -1
  61. package/dist/esm/index-a7d3d3f1.js +28 -8
  62. package/dist/esm/loader.js +1 -1
  63. package/dist/esm/{pesquisa-fetcher-6bc2e41a.js → pesquisa-fetcher-8edaa8cd.js} +2 -7
  64. package/dist/esm/sankhyablocks.js +1 -1
  65. package/dist/esm/snk-actions-button_4.entry.js +32 -29
  66. package/dist/esm/snk-application.entry.js +59 -101
  67. package/dist/esm/snk-attach.entry.js +6 -6
  68. package/dist/esm/snk-config-options.entry.js +235 -0
  69. package/dist/esm/snk-configurator.entry.js +1 -1
  70. package/dist/esm/snk-crud.entry.js +6 -6
  71. package/dist/esm/snk-data-exporter.entry.js +6 -6
  72. package/dist/esm/{snk-data-unit-618e0b80.js → snk-data-unit-0fdfb6c2.js} +1 -1
  73. package/dist/esm/snk-data-unit.entry.js +3 -3
  74. package/dist/esm/snk-detail-view.entry.js +8 -8
  75. package/dist/esm/snk-field-config.entry.js +1 -1
  76. package/dist/esm/{snk-filter-bar_4.entry.js → snk-filter-bar.entry.js} +5 -687
  77. package/dist/esm/snk-filter-item.entry.js +308 -0
  78. package/dist/esm/snk-filter-list.entry.js +148 -0
  79. package/dist/esm/snk-filter-modal-item.entry.js +3 -3
  80. package/dist/esm/snk-filter-modal.entry.js +245 -0
  81. package/dist/esm/{snk-config-options_3.entry.js → snk-form-config.entry.js} +6 -366
  82. package/dist/esm/snk-form.entry.js +140 -0
  83. package/dist/esm/snk-grid.entry.js +6 -6
  84. package/dist/esm/{snk-guides-viewer-15c916a3.js → snk-guides-viewer-8934c537.js} +6 -9
  85. package/dist/esm/snk-guides-viewer.entry.js +8 -8
  86. package/dist/esm/snk-personalized-filter.entry.js +3 -3
  87. package/dist/esm/snk-simple-crud.entry.js +15 -15
  88. package/dist/esm/snk-tab-config.entry.js +1 -1
  89. package/dist/sankhyablocks/p-01086ff7.entry.js +1 -0
  90. package/dist/sankhyablocks/{p-126c58ea.js → p-06421fdb.js} +1 -1
  91. package/dist/sankhyablocks/{p-ae50d69f.js → p-16869f77.js} +1 -1
  92. package/dist/sankhyablocks/{p-341465ce.js → p-1bf06cd3.js} +2 -2
  93. package/dist/sankhyablocks/{p-aa003d4e.entry.js → p-212213d9.entry.js} +1 -1
  94. package/dist/sankhyablocks/p-2923c1b5.js +1 -0
  95. package/dist/sankhyablocks/p-3b60db06.entry.js +1 -0
  96. package/dist/sankhyablocks/{p-9c3138f5.entry.js → p-430e4d3c.entry.js} +1 -1
  97. package/dist/sankhyablocks/{p-9ffd9fc7.js → p-4d9549cf.js} +1 -1
  98. package/dist/sankhyablocks/p-4f35399c.entry.js +1 -0
  99. package/dist/sankhyablocks/{p-a75e9dcc.js → p-5dd8cf4f.js} +1 -1
  100. package/dist/sankhyablocks/p-60b29483.entry.js +1 -0
  101. package/dist/sankhyablocks/p-70a4af56.entry.js +1 -0
  102. package/dist/sankhyablocks/{p-41793e17.entry.js → p-7663f597.entry.js} +1 -1
  103. package/dist/sankhyablocks/{p-47d24ac8.js → p-7ac7932c.js} +2 -2
  104. package/dist/sankhyablocks/{p-2d3f9482.entry.js → p-8eb67fa4.entry.js} +1 -1
  105. package/dist/sankhyablocks/{p-f0aaad2b.entry.js → p-92eadb1c.entry.js} +1 -1
  106. package/dist/sankhyablocks/{p-8b4fc28f.entry.js → p-95df461f.entry.js} +1 -1
  107. package/dist/sankhyablocks/p-a42e7a1e.entry.js +11 -0
  108. package/dist/sankhyablocks/p-a724e798.entry.js +1 -0
  109. package/dist/sankhyablocks/{p-1dbd5c18.entry.js → p-a75d242d.entry.js} +1 -1
  110. package/dist/sankhyablocks/p-afbb070d.js +1 -0
  111. package/dist/sankhyablocks/{p-95ce311a.js → p-b0ef4383.js} +1 -1
  112. package/dist/sankhyablocks/p-b9679243.entry.js +1 -0
  113. package/dist/sankhyablocks/{p-c1adf0dd.entry.js → p-b9c67e45.entry.js} +1 -1
  114. package/dist/sankhyablocks/{p-e41bd8ee.entry.js → p-be5d8fcb.entry.js} +1 -1
  115. package/dist/sankhyablocks/p-ca5ec380.js +1 -0
  116. package/dist/sankhyablocks/p-d3f53df2.entry.js +1 -0
  117. package/dist/sankhyablocks/{p-a2c790ac.entry.js → p-dcead955.entry.js} +1 -1
  118. package/dist/sankhyablocks/p-e8763234.entry.js +1 -0
  119. package/dist/sankhyablocks/{p-00278e07.js → p-f3434fc4.js} +1 -1
  120. package/dist/sankhyablocks/{p-fca0e5cc.entry.js → p-fb34e0cf.entry.js} +1 -1
  121. package/dist/sankhyablocks/p-feba9d4b.entry.js +1 -0
  122. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  123. package/dist/types/components/snk-actions-button/interfaces/index.d.ts +3 -0
  124. package/dist/types/components/snk-actions-button/snk-actions-button.d.ts +3 -2
  125. package/dist/types/components/snk-application/snk-application.d.ts +12 -3
  126. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +1 -0
  127. package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +0 -1
  128. package/dist/types/lib/utils/CrudUtils.d.ts +0 -1
  129. package/package.json +2 -3
  130. package/dist/collection/components/snk-application/request-listener/DebouncedRequestListener.js +0 -28
  131. package/dist/collection/components/snk-application/request-listener/RequestListenerFactory.js +0 -16
  132. package/dist/collection/components/snk-application/request-listener/RequestListenerLoadingBar.js +0 -52
  133. package/dist/collection/sw.js +0 -46
  134. package/dist/sankhyablocks/p-3858a2e4.entry.js +0 -1
  135. package/dist/sankhyablocks/p-563b7c28.entry.js +0 -1
  136. package/dist/sankhyablocks/p-a0ebd886.js +0 -1
  137. package/dist/sankhyablocks/p-aaf94476.js +0 -1
  138. package/dist/sankhyablocks/p-bab79110.entry.js +0 -1
  139. package/dist/sankhyablocks/p-c88ad28e.entry.js +0 -1
  140. package/dist/sankhyablocks/p-d1da52e1.entry.js +0 -1
  141. package/dist/sankhyablocks/p-da87e42c.entry.js +0 -11
  142. package/dist/sankhyablocks/p-e4391e16.js +0 -1
  143. package/dist/types/components/snk-application/request-listener/DebouncedRequestListener.d.ts +0 -11
  144. package/dist/types/components/snk-application/request-listener/RequestListenerFactory.d.ts +0 -12
  145. package/dist/types/components/snk-application/request-listener/RequestListenerLoadingBar.d.ts +0 -13
@@ -644,11 +644,9 @@ export class SnkSimpleCrud {
644
644
  window.removeEventListener("keydown", this._keyDownHandler);
645
645
  }
646
646
  gridConfigChangeHandler(evt) {
647
- evt.stopPropagation();
648
- if (!this.configName)
649
- return;
650
647
  const config = evt.detail;
651
648
  ConfigStorage.saveGridConfig(config, this.configName, this.resolveResourceID());
649
+ evt.stopPropagation();
652
650
  }
653
651
  modalConfigChangeHandler(evt) {
654
652
  const config = evt.detail;
@@ -725,16 +723,18 @@ export class SnkSimpleCrud {
725
723
  return;
726
724
  this.goToView(VIEW_MODE.FORM);
727
725
  }
726
+ renderTaskbarContent() {
727
+ var _a;
728
+ return (h("snk-taskbar", { class: this._currentViewMode === VIEW_MODE.FORM && "ez-box ez-box--shadow ez-padding--small", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, actionsList: this.getActionsList(), disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, "data-exporter-store-key": this.getDataExporterStoreKey(), slot: "leftButtons", presentationMode: PresentationMode.SECONDARY }, h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })));
729
+ }
728
730
  /* istanbul ignore next */
729
731
  render() {
730
- var _a;
731
732
  if (this.dataUnit == undefined) {
732
733
  return;
733
734
  }
734
- const taskbarContent = (h("snk-taskbar", { class: this._currentViewMode === VIEW_MODE.FORM && "ez-box ez-box--shadow ez-padding--small", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, actionsList: this.getActionsList(), disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, "data-exporter-store-key": this.getDataExporterStoreKey(), slot: "leftButtons", presentationMode: PresentationMode.SECONDARY }, h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })));
735
- return (h("snk-data-unit", { ref: ref => this._snkDataUnit = ref, class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), pageSize: this.getPageSize(), onInsertionMode: this.handleDataUnitOnInsertionMode.bind(this), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === VIEW_MODE.GRID && !this.enableGridInsert, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail, onDataUnitFieldsHidded: this.updateFormConfig.bind(this), domainMessagesBuilder: this.domainMessagesBuilder }, h("header", null, h("slot", { name: "snkSimpleCrudHeader" })), h("section", { class: "ez-box ez-box--shadow simple-crud__container-section" }, this._currentViewMode === VIEW_MODE.FORM && taskbarContent, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, h("stack-item", null, h("ez-grid", { class: "ez-margin-bottom--large", ref: ref => this._grid = ref, dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(VIEW_MODE.FORM), onConfigChange: evt => this.gridConfigChangeHandler(evt), columnfilterDataSource: this.dataUnit.name && this.dataUnit.name.includes(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
735
+ return (h("snk-data-unit", { ref: ref => this._snkDataUnit = ref, class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), pageSize: this.getPageSize(), onInsertionMode: this.handleDataUnitOnInsertionMode.bind(this), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === VIEW_MODE.GRID && !this.enableGridInsert, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail, onDataUnitFieldsHidded: this.updateFormConfig.bind(this), domainMessagesBuilder: this.domainMessagesBuilder }, h("header", null, h("slot", { name: "snkSimpleCrudHeader" })), h("section", { class: "ez-box ez-box--shadow simple-crud__container-section" }, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, h("stack-item", null, h("ez-grid", { class: "ez-margin-bottom--large", ref: ref => this._grid = ref, dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(VIEW_MODE.FORM), onConfigChange: evt => this.gridConfigChangeHandler(evt), columnfilterDataSource: this.dataUnit.name && this.dataUnit.name.includes(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
736
736
  ? undefined
737
- : this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this._enableContinuousInsert }, this._currentViewMode === VIEW_MODE.GRID && taskbarContent, h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, h("ez-form", { ref: (ref) => this._form = ref, class: `ez-margin-top--large ${this.handleShowFormConfig() ? "simple-crud__form--hidden" : ""}`, dataUnit: this.dataUnit, config: this.getFormConfig(), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), this.handleShowFormConfig() && h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this.dataUnit, configManager: this._formConfigManager, onConfigClose: () => this.closeFormConfig() })), this.messagesBuilder && h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.goToView(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showConfiguratorButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this.resolveResourceID(), customContainerId: this._customContainerId })), h("div", { id: `${this._customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }))), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, 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), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resolveResourceID() }))));
737
+ : this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this._enableContinuousInsert }, this.renderTaskbarContent(), h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, this.renderTaskbarContent(), h("ez-form", { ref: (ref) => this._form = ref, class: `ez-margin-top--large ${this.handleShowFormConfig() ? "simple-crud__form--hidden" : ""}`, dataUnit: this.dataUnit, config: this.getFormConfig(), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), this.handleShowFormConfig() && h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this.dataUnit, configManager: this._formConfigManager, onConfigClose: () => this.closeFormConfig() })), this.messagesBuilder && h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.goToView(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showConfiguratorButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this.resolveResourceID(), customContainerId: this._customContainerId })), h("div", { id: `${this._customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }))), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, 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), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resolveResourceID() }))));
738
738
  }
739
739
  static get is() { return "snk-simple-crud"; }
740
740
  static get encapsulation() { return "scoped"; }
@@ -6,7 +6,7 @@ var __asyncValues = (this && this.__asyncValues) || function (o) {
6
6
  function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
7
7
  function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
8
8
  };
9
- import { ApplicationContext, ErrorException, ObjectUtils, ServiceCanceledException, StringUtils, WarningException } from '@sankhyalabs/core';
9
+ import { ApplicationContext, ErrorException, ServiceCanceledException, ObjectUtils, StringUtils, WarningException } from '@sankhyalabs/core';
10
10
  import { batchRequests } from 'graphql-request';
11
11
  import UrlUtils from "../../../lib/utils/urlutils";
12
12
  import { PrintUtils } from '../../utils/PrintUtils';
@@ -266,8 +266,7 @@ export class DataFetcher {
266
266
  }
267
267
  payloadJson['requestBody']['clientEventList'].clientEvent.push({ $: key });
268
268
  }
269
- const requestId = StringUtils.generateUUID();
270
- DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url: url, requestBody: payload, requestId }));
269
+ DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url: url, requestBody: payload }));
271
270
  http.open("POST", url, true);
272
271
  http.withCredentials = true;
273
272
  http.send(ObjectUtils.objectToString(payloadJson));
@@ -307,7 +306,7 @@ export class DataFetcher {
307
306
  else if (http.readyState == 4 && http.status != 200) {
308
307
  reject(new ErrorException(`Erro ao executar serviço: ${serviceName}`, http.responseText));
309
308
  }
310
- DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url: url, requestBody: payload, requestId }));
309
+ DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url: url, requestBody: payload }));
311
310
  };
312
311
  });
313
312
  }
@@ -412,8 +411,7 @@ export class DataFetcher {
412
411
  const errorsResponse = [];
413
412
  const responseExtensions = [];
414
413
  const url = this.buildGraphQlURL(quietMode);
415
- const requestId = StringUtils.generateUUID();
416
- DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url, requestBody: request, requestId }));
414
+ DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url, requestBody: request }));
417
415
  try {
418
416
  const response = await batchRequests(url, request, { 'Content-Type': `application/json; charset=${window['SERVER_ENCODING'] || 'UTF-8'}` });
419
417
  response.forEach((resItem, index) => {
@@ -447,11 +445,11 @@ export class DataFetcher {
447
445
  });
448
446
  }
449
447
  else {
450
- DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url, requestBody: request, requestId }));
448
+ DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url, requestBody: request }));
451
449
  throw new ErrorException("Falha de comunicação", err.message);
452
450
  }
453
451
  }
454
- DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url, requestBody: request, requestId }));
452
+ DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url, requestBody: request }));
455
453
  return { data: dataResponse, errors: errorsResponse, extensions: responseExtensions };
456
454
  }
457
455
  isHttpError(err) {
@@ -73,7 +73,7 @@ export default class DataUnitDataLoader {
73
73
  }
74
74
  const count = loadingInfo.count;
75
75
  if (loadingInfo.loadingInProgress) {
76
- dataUnit.updatePagination(Object.assign(Object.assign({}, dataUnitPagination), { count, loadingInProgress: true }));
76
+ dataUnit.updatePagination(Object.assign(Object.assign({}, dataUnitPagination), { count }));
77
77
  return;
78
78
  }
79
79
  if (loadingInfo.needReload) {
@@ -81,7 +81,7 @@ export default class DataUnitDataLoader {
81
81
  dataUnit.gotoPage(0);
82
82
  return;
83
83
  }
84
- dataUnit.updatePagination(Object.assign(Object.assign({}, dataUnitPagination), { total: count, count, loadingInProgress: false }));
84
+ dataUnit.updatePagination(Object.assign(Object.assign({}, dataUnitPagination), { total: count, count }));
85
85
  }
86
86
  static registryLoading(dataUnit, loadingInfo) {
87
87
  if (loadingInfo == undefined) {
@@ -96,14 +96,9 @@ export class PesquisaFetcher {
96
96
  }
97
97
  }
98
98
  };
99
- const urlOptions = {
100
- urlParams: {
101
- "quietMode": true
102
- }
103
- };
104
99
  return new Promise((resolve, reject) => {
105
100
  DataFetcher.get()
106
- .callServiceBroker("PesquisaSP.getSuggestion", JSON.stringify(reqBody), urlOptions)
101
+ .callServiceBroker("PesquisaSP.getSuggestion", JSON.stringify(reqBody))
107
102
  .then(result => resolve(result))
108
103
  .catch(error => reject(error));
109
104
  });
@@ -13,28 +13,6 @@ export class CrudUtils {
13
13
  });
14
14
  }
15
15
  }
16
- static parseCrudResults(entities, onlyFirst) {
17
- if (!Array.isArray(entities)) {
18
- entities = [entities];
19
- }
20
- const crudFindResults = [];
21
- for (const entity of entities) {
22
- let crudFindResult = {
23
- fields: new Map()
24
- };
25
- for (let key in entity) {
26
- let fieldValue = entity[key];
27
- if (fieldValue.hasOwnProperty('$')) {
28
- crudFindResult.fields.set(key, fieldValue.$);
29
- }
30
- if (onlyFirst) {
31
- break;
32
- }
33
- }
34
- crudFindResults.push(crudFindResult);
35
- }
36
- return crudFindResults.length > 1 ? crudFindResults : crudFindResults[0];
37
- }
38
16
  static find(entityName, fields, criteria, onlyFirst = true, criteriaExpression, orderBy) {
39
17
  const SERVICE_CRUD_FIND = "mge@crud.find";
40
18
  let parsedFields = [];
@@ -83,11 +61,24 @@ export class CrudUtils {
83
61
  DataFetcher.get().callServiceBroker(SERVICE_CRUD_FIND, JSON.stringify(request)).then((result) => {
84
62
  var _a;
85
63
  let entities = (_a = result.entidades) === null || _a === void 0 ? void 0 : _a.entidade;
86
- if (!entities) {
64
+ if (entities != undefined) {
65
+ let crudFindResult = {
66
+ fields: new Map()
67
+ };
68
+ for (let key in entities) {
69
+ let fieldValue = entities[key];
70
+ if (fieldValue.hasOwnProperty('$')) {
71
+ crudFindResult.fields.set(key, fieldValue.$);
72
+ }
73
+ if (onlyFirst) {
74
+ break;
75
+ }
76
+ }
77
+ resolve(crudFindResult);
78
+ }
79
+ else {
87
80
  resolve(null);
88
81
  }
89
- const crudFindResults = this.parseCrudResults(entities, onlyFirst);
90
- resolve(crudFindResults);
91
82
  });
92
83
  });
93
84
  }
@@ -23,28 +23,6 @@ class CrudUtils {
23
23
  });
24
24
  }
25
25
  }
26
- static parseCrudResults(entities, onlyFirst) {
27
- if (!Array.isArray(entities)) {
28
- entities = [entities];
29
- }
30
- const crudFindResults = [];
31
- for (const entity of entities) {
32
- let crudFindResult = {
33
- fields: new Map()
34
- };
35
- for (let key in entity) {
36
- let fieldValue = entity[key];
37
- if (fieldValue.hasOwnProperty('$')) {
38
- crudFindResult.fields.set(key, fieldValue.$);
39
- }
40
- if (onlyFirst) {
41
- break;
42
- }
43
- }
44
- crudFindResults.push(crudFindResult);
45
- }
46
- return crudFindResults.length > 1 ? crudFindResults : crudFindResults[0];
47
- }
48
26
  static find(entityName, fields, criteria, onlyFirst = true, criteriaExpression, orderBy) {
49
27
  const SERVICE_CRUD_FIND = "mge@crud.find";
50
28
  let parsedFields = [];
@@ -92,11 +70,24 @@ class CrudUtils {
92
70
  DataFetcher.get().callServiceBroker(SERVICE_CRUD_FIND, JSON.stringify(request)).then((result) => {
93
71
  var _a;
94
72
  let entities = (_a = result.entidades) === null || _a === void 0 ? void 0 : _a.entidade;
95
- if (!entities) {
73
+ if (entities != undefined) {
74
+ let crudFindResult = {
75
+ fields: new Map()
76
+ };
77
+ for (let key in entities) {
78
+ let fieldValue = entities[key];
79
+ if (fieldValue.hasOwnProperty('$')) {
80
+ crudFindResult.fields.set(key, fieldValue.$);
81
+ }
82
+ if (onlyFirst) {
83
+ break;
84
+ }
85
+ }
86
+ resolve(crudFindResult);
87
+ }
88
+ else {
96
89
  resolve(null);
97
90
  }
98
- const crudFindResults = this.parseCrudResults(entities, onlyFirst);
99
- resolve(crudFindResults);
100
91
  });
101
92
  });
102
93
  }
@@ -6777,8 +6777,7 @@ class DataFetcher {
6777
6777
  }
6778
6778
  payloadJson['requestBody']['clientEventList'].clientEvent.push({ $: key });
6779
6779
  }
6780
- const requestId = StringUtils.generateUUID();
6781
- DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url: url, requestBody: payload, requestId }));
6780
+ DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url: url, requestBody: payload }));
6782
6781
  http.open("POST", url, true);
6783
6782
  http.withCredentials = true;
6784
6783
  http.send(ObjectUtils.objectToString(payloadJson));
@@ -6818,7 +6817,7 @@ class DataFetcher {
6818
6817
  else if (http.readyState == 4 && http.status != 200) {
6819
6818
  reject(new ErrorException(`Erro ao executar serviço: ${serviceName}`, http.responseText));
6820
6819
  }
6821
- DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url: url, requestBody: payload, requestId }));
6820
+ DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url: url, requestBody: payload }));
6822
6821
  };
6823
6822
  });
6824
6823
  }
@@ -6923,8 +6922,7 @@ class DataFetcher {
6923
6922
  const errorsResponse = [];
6924
6923
  const responseExtensions = [];
6925
6924
  const url = this.buildGraphQlURL(quietMode);
6926
- const requestId = StringUtils.generateUUID();
6927
- DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url, requestBody: request, requestId }));
6925
+ DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url, requestBody: request }));
6928
6926
  try {
6929
6927
  const response = await dist.batchRequests(url, request, { 'Content-Type': `application/json; charset=${window['SERVER_ENCODING'] || 'UTF-8'}` });
6930
6928
  response.forEach((resItem, index) => {
@@ -6958,11 +6956,11 @@ class DataFetcher {
6958
6956
  });
6959
6957
  }
6960
6958
  else {
6961
- DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url, requestBody: request, requestId }));
6959
+ DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url, requestBody: request }));
6962
6960
  throw new ErrorException("Falha de comunicação", err.message);
6963
6961
  }
6964
6962
  }
6965
- DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url, requestBody: request, requestId }));
6963
+ DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url, requestBody: request }));
6966
6964
  return { data: dataResponse, errors: errorsResponse, extensions: responseExtensions };
6967
6965
  }
6968
6966
  isHttpError(err) {
@@ -88,13 +88,13 @@ class SnkFormConfigManager {
88
88
  const fields = (_a = this._config) === null || _a === void 0 ? void 0 : _a.fields;
89
89
  const hasConfig = this.hasConfig();
90
90
  if (hasConfig && !forceEmptyConfig) {
91
- return fields.map(({ label, name, readOnly, visible, required, tab, group }) => {
91
+ return fields.map(({ label, name, readOnly, visible, required, tab }) => {
92
92
  var _a;
93
93
  if (label == undefined) {
94
94
  const currentField = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getField(name);
95
- return Object.assign(Object.assign({}, currentField), { name: name !== null && name !== void 0 ? name : currentField.name, readOnly: readOnly !== null && readOnly !== void 0 ? readOnly : currentField.readOnly, visible: visible !== null && visible !== void 0 ? visible : currentField.visible, required: required !== null && required !== void 0 ? required : currentField.required, tab: tab, group: group });
95
+ return Object.assign(Object.assign({}, currentField), { name: name !== null && name !== void 0 ? name : currentField.name, readOnly: readOnly !== null && readOnly !== void 0 ? readOnly : currentField.readOnly, visible: visible !== null && visible !== void 0 ? visible : currentField.visible, required: required !== null && required !== void 0 ? required : currentField.required, tab: tab });
96
96
  }
97
- return { name, label, readOnly, visible, required, tab, group };
97
+ return { name, label, readOnly, visible, required, tab };
98
98
  })
99
99
  .filter(field => this.isFieldVisible(field, descriptionFilter));
100
100
  }
@@ -712,7 +712,7 @@ class DataUnitDataLoader {
712
712
  }
713
713
  const count = loadingInfo.count;
714
714
  if (loadingInfo.loadingInProgress) {
715
- dataUnit.updatePagination(Object.assign(Object.assign({}, dataUnitPagination), { count, loadingInProgress: true }));
715
+ dataUnit.updatePagination(Object.assign(Object.assign({}, dataUnitPagination), { count }));
716
716
  return;
717
717
  }
718
718
  if (loadingInfo.needReload) {
@@ -720,7 +720,7 @@ class DataUnitDataLoader {
720
720
  dataUnit.gotoPage(0);
721
721
  return;
722
722
  }
723
- dataUnit.updatePagination(Object.assign(Object.assign({}, dataUnitPagination), { total: count, count, loadingInProgress: false }));
723
+ dataUnit.updatePagination(Object.assign(Object.assign({}, dataUnitPagination), { total: count, count }));
724
724
  }
725
725
  static registryLoading(dataUnit, loadingInfo) {
726
726
  if (loadingInfo == undefined) {
@@ -96,14 +96,9 @@ class PesquisaFetcher {
96
96
  }
97
97
  }
98
98
  };
99
- const urlOptions = {
100
- urlParams: {
101
- "quietMode": true
102
- }
103
- };
104
99
  return new Promise((resolve, reject) => {
105
100
  DataFetcher.get()
106
- .callServiceBroker("PesquisaSP.getSuggestion", JSON.stringify(reqBody), urlOptions)
101
+ .callServiceBroker("PesquisaSP.getSuggestion", JSON.stringify(reqBody))
107
102
  .then(result => resolve(result))
108
103
  .catch(error => reject(error));
109
104
  });
@@ -1,5 +1,5 @@
1
1
  import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
- import { ApplicationContext, StringUtils, ErrorException, WarningException, ObjectUtils, DateUtils, ArrayUtils, ElementIDUtils } from '@sankhyalabs/core';
2
+ import { ApplicationContext, StringUtils, ErrorException, WarningException, ObjectUtils, DateUtils, ServiceUtils, StorageType, ArrayUtils, ElementIDUtils } from '@sankhyalabs/core';
3
3
  import { D as DataFetcher } from './DataFetcher.js';
4
4
  import { P as ParamType } from './ParamType.js';
5
5
  import './pesquisa-fetcher.js';
@@ -598,6 +598,7 @@ const SnkActionsButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
598
598
  super();
599
599
  this.__registerHost();
600
600
  this.CLIENT_EVENT_CONFIRM_NAME = "br.com.sankhya.actionbutton.clientconfirm";
601
+ this._actions = [];
601
602
  this.handleClick = (evt) => {
602
603
  const selectedAction = this._actions.find((action) => action.actionID == evt.detail.id);
603
604
  const executor = new ExecutorFactory(selectedAction.type).executor;
@@ -607,27 +608,22 @@ const SnkActionsButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
607
608
  };
608
609
  this._items = [];
609
610
  this._showDropdown = false;
610
- this._actions = [];
611
- this._isOrderActions = false;
612
611
  }
613
612
  async getActions() {
614
- let param = {
615
- param: {
616
- entityName: this._entityName,
617
- resourceID: this._resourceID
618
- }
619
- };
620
- return DataFetcher.get().callServiceBroker('ActionButtonsSP.getActions', param).then((result) => {
613
+ const actions = await ServiceUtils.useCacheWithService(`SnkActionsButton_${this._entityName}-${this._resourceID}`, async () => {
621
614
  var _a;
622
- if (!((_a = result.actions) === null || _a === void 0 ? void 0 : _a.action))
623
- return;
624
- if (this._isOrderActions) {
625
- this._actions = ArrayUtils.sortAlphabetically(result.actions.action, 'description');
626
- }
627
- else {
628
- this._actions = result.actions.action;
629
- }
630
- });
615
+ const param = {
616
+ param: {
617
+ entityName: this._entityName,
618
+ resourceID: this._resourceID,
619
+ },
620
+ };
621
+ const result = await DataFetcher.get().callServiceBroker('ActionButtonsSP.getActions', param);
622
+ return ((_a = result.actions) === null || _a === void 0 ? void 0 : _a.action) || [];
623
+ }, StorageType.SESSION_STORAGE);
624
+ this._actions = SnkActionsButton.parameters.isOrderActions
625
+ ? ArrayUtils.sortAlphabetically(actions, 'description')
626
+ : actions;
631
627
  }
632
628
  controlDropdown() {
633
629
  this._showDropdown = !this._showDropdown;
@@ -660,7 +656,7 @@ const SnkActionsButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
660
656
  }
661
657
  async componentWillLoad() {
662
658
  this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
663
- this._isOrderActions = await this._application.getBooleanParam('global.ordenar.acoes.personalizadas');
659
+ await this.loadParameters();
664
660
  const snkDataUnit = this._element.parentElement;
665
661
  this._dataUnit = snkDataUnit === null || snkDataUnit === void 0 ? void 0 : snkDataUnit.dataUnit;
666
662
  this._resourceID = snkDataUnit === null || snkDataUnit === void 0 ? void 0 : snkDataUnit.resourceID;
@@ -669,9 +665,8 @@ const SnkActionsButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
669
665
  this._resourceID = await ResourceIDUtils.getResourceID();
670
666
  }
671
667
  this.setEvents();
672
- this.getActions().then(() => {
673
- this.loadItems();
674
- });
668
+ await this.getActions();
669
+ this.loadItems();
675
670
  }
676
671
  async componentDidLoad() {
677
672
  if (!this._element)
@@ -698,6 +693,11 @@ const SnkActionsButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
698
693
  [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: ElementIDUtils.getInternalIDInfo(sufix)
699
694
  };
700
695
  }
696
+ async loadParameters() {
697
+ if (SnkActionsButton.parameters.isOrderActions != null)
698
+ return;
699
+ SnkActionsButton.parameters.isOrderActions = await this._application.getBooleanParam('global.ordenar.acoes.personalizadas');
700
+ }
701
701
  render() {
702
702
  return (h(Host, null, (this._actions && this._actions.length > 0) &&
703
703
  (h("div", { class: `ez-padding-left--medium snk-actions-button
@@ -713,10 +713,11 @@ const SnkActionsButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
713
713
  static get style() { return snkActionsButtonCss; }
714
714
  }, [2, "snk-actions-button", {
715
715
  "_items": [32],
716
- "_showDropdown": [32],
717
- "_actions": [32],
718
- "_isOrderActions": [32]
716
+ "_showDropdown": [32]
719
717
  }]);
718
+ SnkActionsButton.parameters = {
719
+ isOrderActions: null
720
+ };
720
721
  function defineCustomElement() {
721
722
  if (typeof customElements === "undefined") {
722
723
  return;
@@ -274,99 +274,6 @@ class SnkErrorHandler {
274
274
  }
275
275
  }
276
276
 
277
- class DebouncedRequestListener {
278
- constructor() {
279
- this._debounceTime = 1500;
280
- this.requests = new Map();
281
- this.requestsLoadingBar = [];
282
- }
283
- onRequestStart(param) {
284
- if (param.url.includes("quietMode=true")) {
285
- return;
286
- }
287
- this.requestsLoadingBar.push(param.requestId);
288
- const timeout = setTimeout(() => {
289
- this.ezLoadingBar.show();
290
- }, this._debounceTime);
291
- this.requests.set(param.requestId, timeout);
292
- }
293
- ;
294
- onRequestEnd(param) {
295
- const timeoutId = this.requests.get(param.requestId);
296
- clearTimeout(timeoutId);
297
- if (this.requestsLoadingBar.includes(param.requestId)) {
298
- this.requestsLoadingBar = this.requestsLoadingBar.filter(id => id !== param.requestId);
299
- !this.requestsLoadingBar.length && this.ezLoadingBar.hide();
300
- }
301
- }
302
- ;
303
- }
304
-
305
- class RequestListenerLoadingBar {
306
- constructor() {
307
- this._debounceTime = 1000;
308
- this._ignoredNameTypes = ["totals"];
309
- this._countRequest = 0;
310
- }
311
- onRequestStart(param) {
312
- if (this.isIgnoreLoadingOnRequest(param)) {
313
- return;
314
- }
315
- this._countRequest++;
316
- this.ezLoadingBar.show();
317
- if (this._timerLoading) {
318
- clearTimeout(this._timerLoading);
319
- }
320
- }
321
- ;
322
- onRequestEnd(param) {
323
- if (this.isIgnoreLoadingOnRequest(param)) {
324
- return;
325
- }
326
- this._countRequest--;
327
- this._timerLoading = setTimeout(() => {
328
- if (this._countRequest <= 0) {
329
- this.ezLoadingBar.hide();
330
- }
331
- }, this._debounceTime);
332
- }
333
- ;
334
- isIgnoreLoadingOnRequest(param) {
335
- if (param == undefined) {
336
- return false;
337
- }
338
- if (param.url.includes("quietMode=true")) {
339
- return true;
340
- }
341
- if (param.requestBody == undefined) {
342
- return false;
343
- }
344
- if (param.requestBody.length == 1) {
345
- const { name } = param.requestBody[0].variables;
346
- if (name) {
347
- const nameParts = name.split(":");
348
- const nameType = nameParts[0];
349
- return this._ignoredNameTypes.indexOf(nameType) >= 0;
350
- }
351
- }
352
- return false;
353
- }
354
- ;
355
- }
356
-
357
- class RequestListenerFactory {
358
- static create({ strategy }) {
359
- switch (strategy) {
360
- case 'request_name':
361
- return new RequestListenerLoadingBar();
362
- case 'request_time':
363
- return new DebouncedRequestListener();
364
- default:
365
- throw new Error('Strategy not found');
366
- }
367
- }
368
- }
369
-
370
277
  const snkApplicationCss = ".sc-snk-application-h{display:flex;flex-direction:column;height:100%}";
371
278
 
372
279
  const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
@@ -381,7 +288,7 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
381
288
  this._waitingAppReady = new Array();
382
289
  this._duCache = new Map();
383
290
  this._duPromises = new Map();
384
- this._requestListener = RequestListenerFactory.create({ strategy: 'request_time' });
291
+ this._requestListener = new RequestListenerLoadingBar();
385
292
  this._pendingActions = new Map;
386
293
  this._loadPkParameter = null;
387
294
  this._isLoadedByPk = false;
@@ -1355,7 +1262,7 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
1355
1262
  .unbind("F1");
1356
1263
  }
1357
1264
  render() {
1358
- return (h("div", null, h("ez-loading-bar", { ref: (ref) => this._requestListener.ezLoadingBar = ref }), h("ez-popup", { opened: false, ref: (ref) => this._popUp = ref, onEzClosePopup: () => this.closePopUp() }), h("ez-modal", { opened: false, ref: (ref) => this._rightModal = ref, "modal-size": "small", closeOutsideClick: true, closeEsc: true })));
1265
+ return (h("div", null, h("ez-loading-bar", { ref: (ref) => this._requestListener.loadingBar = ref }), h("ez-popup", { opened: false, ref: (ref) => this._popUp = ref, onEzClosePopup: () => this.closePopUp() }), h("ez-modal", { opened: false, ref: (ref) => this._rightModal = ref, "modal-size": "small", closeOutsideClick: true, closeEsc: true })));
1359
1266
  }
1360
1267
  get _element() { return this; }
1361
1268
  static get watchers() { return {
@@ -1419,6 +1326,57 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
1419
1326
  "whenApplicationReady": [64],
1420
1327
  "setSearchFilterContext": [64]
1421
1328
  }]);
1329
+ class RequestListenerLoadingBar {
1330
+ constructor() {
1331
+ this._debounceTime = 1000;
1332
+ this._ignoredNameTypes = ["totals"];
1333
+ this._countRequest = 0;
1334
+ }
1335
+ onRequestStart(param) {
1336
+ if (this.isIgnoreLoadingOnRequest(param)) {
1337
+ return;
1338
+ }
1339
+ this._countRequest++;
1340
+ this.loadingBar.show();
1341
+ if (this._timerLoading) {
1342
+ clearTimeout(this._timerLoading);
1343
+ }
1344
+ }
1345
+ ;
1346
+ onRequestEnd(param) {
1347
+ if (this.isIgnoreLoadingOnRequest(param)) {
1348
+ return;
1349
+ }
1350
+ this._countRequest--;
1351
+ this._timerLoading = setTimeout(() => {
1352
+ if (this._countRequest <= 0) {
1353
+ this.loadingBar.hide();
1354
+ }
1355
+ }, this._debounceTime);
1356
+ }
1357
+ ;
1358
+ isIgnoreLoadingOnRequest(param) {
1359
+ if (param == undefined) {
1360
+ return false;
1361
+ }
1362
+ if (param.url.includes("quietMode=true")) {
1363
+ return true;
1364
+ }
1365
+ if (param.requestBody == undefined) {
1366
+ return false;
1367
+ }
1368
+ if (param.requestBody.length == 1) {
1369
+ const { name } = param.requestBody[0].variables;
1370
+ if (name) {
1371
+ const nameParts = name.split(":");
1372
+ const nameType = nameParts[0];
1373
+ return this._ignoredNameTypes.indexOf(nameType) >= 0;
1374
+ }
1375
+ }
1376
+ return false;
1377
+ }
1378
+ ;
1379
+ }
1422
1380
  class PendingPromise {
1423
1381
  constructor(resolve, reject) {
1424
1382
  this.resolve = resolve;
@@ -482,9 +482,6 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
482
482
  await this.addErrorBadgeToGuide(guideName);
483
483
  await this.openGuideNavigator(guideName);
484
484
  }
485
- if (action.type === Action.METADATA_LOADED) {
486
- this.loadGuides(false);
487
- }
488
485
  }
489
486
  async addErrorBadgeToGuide(guideName) {
490
487
  var _a;