@sankhyalabs/sankhyablocks 8.16.0-dev.62 → 8.16.0-dev.64

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. package/dist/cjs/{ContinuousInsertUtils-42636ac1.js → ContinuousInsertUtils-414b772c.js} +1 -1
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  4. package/dist/cjs/snk-application.cjs.entry.js +117 -9
  5. package/dist/cjs/snk-crud.cjs.entry.js +3 -2
  6. package/dist/cjs/snk-data-exporter.cjs.entry.js +20 -7
  7. package/dist/cjs/snk-filter-bar_4.cjs.entry.js +21 -7
  8. package/dist/cjs/snk-grid.cjs.entry.js +4 -3
  9. package/dist/cjs/snk-simple-crud.cjs.entry.js +4 -3
  10. package/dist/collection/components/snk-application/request-listener/DebouncedRequestListener.js +4 -3
  11. package/dist/collection/components/snk-application/snk-application.css +34 -0
  12. package/dist/collection/components/snk-application/snk-application.js +172 -7
  13. package/dist/collection/components/snk-crud/snk-crud.js +39 -20
  14. package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js +8 -2
  15. package/dist/collection/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.js +11 -4
  16. package/dist/collection/components/snk-data-exporter/interfaces/IExporterProvider.js +1 -1
  17. package/dist/collection/components/snk-data-exporter/utils/ParserExport.js +1 -1
  18. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +40 -8
  19. package/dist/collection/components/snk-grid/snk-grid.js +39 -20
  20. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +39 -20
  21. package/dist/components/ContinuousInsertUtils.js +1 -1
  22. package/dist/components/snk-application2.js +124 -12
  23. package/dist/components/snk-crud.js +5 -3
  24. package/dist/components/snk-data-exporter2.js +20 -7
  25. package/dist/components/snk-filter-bar2.js +23 -8
  26. package/dist/components/snk-grid2.js +5 -3
  27. package/dist/components/snk-simple-crud2.js +5 -3
  28. package/dist/esm/{ContinuousInsertUtils-071e0b6a.js → ContinuousInsertUtils-bab45060.js} +1 -1
  29. package/dist/esm/loader.js +1 -1
  30. package/dist/esm/sankhyablocks.js +1 -1
  31. package/dist/esm/snk-application.entry.js +119 -11
  32. package/dist/esm/snk-crud.entry.js +3 -2
  33. package/dist/esm/snk-data-exporter.entry.js +20 -7
  34. package/dist/esm/snk-filter-bar_4.entry.js +22 -8
  35. package/dist/esm/snk-grid.entry.js +4 -3
  36. package/dist/esm/snk-simple-crud.entry.js +4 -3
  37. package/dist/sankhyablocks/p-098f8cfa.entry.js +1 -0
  38. package/dist/sankhyablocks/p-22d04eac.entry.js +1 -0
  39. package/dist/sankhyablocks/p-2b7432e8.entry.js +1 -0
  40. package/dist/sankhyablocks/p-442367ab.entry.js +11 -0
  41. package/dist/sankhyablocks/p-50306605.entry.js +1 -0
  42. package/dist/sankhyablocks/p-9a9681d1.entry.js +1 -0
  43. package/dist/sankhyablocks/{p-c271fbf1.js → p-b619ee23.js} +1 -1
  44. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  45. package/dist/types/components/snk-application/snk-application.d.ts +21 -3
  46. package/dist/types/components/snk-crud/snk-crud.d.ts +8 -4
  47. package/dist/types/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.d.ts +1 -0
  48. package/dist/types/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.d.ts +1 -0
  49. package/dist/types/components/snk-data-exporter/utils/ParserExport.d.ts +1 -1
  50. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +6 -1
  51. package/dist/types/components/snk-grid/snk-grid.d.ts +8 -4
  52. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +8 -1
  53. package/dist/types/components.d.ts +58 -10
  54. package/package.json +1 -1
  55. package/dist/sankhyablocks/p-365d8ed4.entry.js +0 -1
  56. package/dist/sankhyablocks/p-399e1b74.entry.js +0 -1
  57. package/dist/sankhyablocks/p-65650e05.entry.js +0 -1
  58. package/dist/sankhyablocks/p-8cf0a9fe.entry.js +0 -1
  59. package/dist/sankhyablocks/p-cd8fa07b.entry.js +0 -1
  60. package/dist/sankhyablocks/p-eda55eef.entry.js +0 -11
@@ -266,6 +266,7 @@ const SnkFilterBar = class {
266
266
  this._firstLoad = true;
267
267
  this._pendingVariables = false;
268
268
  this._customfiltersToBeUpdated = [];
269
+ this._resolveLoading = undefined;
269
270
  this._calculateSortIndex = (item) => {
270
271
  if (!item.visible)
271
272
  return 0;
@@ -279,6 +280,7 @@ const SnkFilterBar = class {
279
280
  this._filtersComparator = (a, b) => {
280
281
  return this._calculateSortIndex(b) - this._calculateSortIndex(a);
281
282
  };
283
+ this.enableLockManagerLoadingComp = false;
282
284
  this.customFilterBarConfig = undefined;
283
285
  this.dataUnit = undefined;
284
286
  this.title = undefined;
@@ -699,14 +701,26 @@ const SnkFilterBar = class {
699
701
  this.personalizedFilterId = undefined;
700
702
  this.showPersonalizedFilter = false;
701
703
  }
702
- componentWillLoad() {
703
- this._application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
704
- if (this._application) {
705
- this.loadPermitions();
706
- this.addFilterBarLegacyConfigName();
707
- this.loadConfigFromStorage();
704
+ async componentWillLoad() {
705
+ var _a;
706
+ try {
707
+ this._application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
708
+ await this.attachDataUnit();
709
+ if (this._application) {
710
+ if (this._application.enableLockManagerLoadingApp && this.enableLockManagerLoadingComp) {
711
+ const appLoadLockerID = core.LockManager.addLockManagerCtxId(this._element);
712
+ this._resolveLoading = core.LockManager.lock(appLoadLockerID, core.LockManagerOperation.APP_LOADING);
713
+ }
714
+ await Promise.all([
715
+ this.loadPermitions(),
716
+ this.addFilterBarLegacyConfigName(),
717
+ this.loadConfigFromStorage(),
718
+ ]);
719
+ }
720
+ }
721
+ finally {
722
+ (_a = this._resolveLoading) === null || _a === void 0 ? void 0 : _a.call(this);
708
723
  }
709
- this.attachDataUnit();
710
724
  }
711
725
  componentDidRender() {
712
726
  this.processPendingFilter();
@@ -9,7 +9,7 @@ const ConfigStorage = require('./ConfigStorage-9b965af9.js');
9
9
  const index$1 = require('./index-1dfc7a6e.js');
10
10
  const fieldSearch = require('./field-search-68e34bf4.js');
11
11
  const index$2 = require('./index-102ba62d.js');
12
- const ContinuousInsertUtils = require('./ContinuousInsertUtils-42636ac1.js');
12
+ const ContinuousInsertUtils = require('./ContinuousInsertUtils-414b772c.js');
13
13
  const DataUnit = require('@sankhyalabs/core/dist/dataunit/DataUnit');
14
14
  require('./DataFetcher-e059eb72.js');
15
15
  require('./pesquisa-fetcher-2ec4811b.js');
@@ -123,6 +123,8 @@ const SnkGrid = class {
123
123
  this._showSnkFilterBar = true;
124
124
  this._enableContinuousInsert = false;
125
125
  this.columnFilterDataSource = new ContinuousInsertUtils.SnkMultiSelectionListDataSource();
126
+ this.enableLockManagerLoadingComp = false;
127
+ this.enableLockManagerTaskbarClick = false;
126
128
  this.configName = undefined;
127
129
  this.filterBarTitle = undefined;
128
130
  this.resourceID = undefined;
@@ -146,7 +148,6 @@ const SnkGrid = class {
146
148
  this.autoLoad = undefined;
147
149
  this.autoFocus = true;
148
150
  this.enableGridInsert = false;
149
- this.enableLockManger = false;
150
151
  this.outlineMode = false;
151
152
  }
152
153
  /**
@@ -536,7 +537,7 @@ const SnkGrid = class {
536
537
  return undefined;
537
538
  }
538
539
  return (index.h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, index.h("div", { class: "snk-grid__header ez-margin-bottom--extra-small" }, this._showSnkFilterBar &&
539
- index.h(index.Fragment, null, index.h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad }), index.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), index.h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId, overflowStrategy: 'none' }, index.h("slot", { name: this.topTaskbarCustomSlotId }))), index.h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === index$1.PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: (evt) => this.gridDoubleClick.emit(evt.detail), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this._enableContinuousInsert, enableLockManger: this.enableLockManger, outlineMode: this.outlineMode }, index.h("snk-taskbar", { id: 'teste', dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this.getGridHeaderButtons(), presentationMode: this.presentationMode, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.getActionsList(), primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.gridHeaderCustomSlotId }, index.h("slot", { name: this.gridHeaderCustomSlotId }))), index.h("div", { class: "ez-col ez-col--sd-12" }, index.h("slot", { name: "SnkGridFooter" })), index.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
540
+ index.h(index.Fragment, null, index.h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp }), index.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), index.h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId, overflowStrategy: 'none' }, index.h("slot", { name: this.topTaskbarCustomSlotId }))), index.h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === index$1.PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: (evt) => this.gridDoubleClick.emit(evt.detail), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this._enableContinuousInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, outlineMode: this.outlineMode }, index.h("snk-taskbar", { id: 'teste', dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this.getGridHeaderButtons(), presentationMode: this.presentationMode, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.getActionsList(), primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.gridHeaderCustomSlotId }, index.h("slot", { name: this.gridHeaderCustomSlotId }))), index.h("div", { class: "ez-col ez-col--sd-12" }, index.h("slot", { name: "SnkGridFooter" })), index.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
540
541
  }
541
542
  get _element() { return index.getElement(this); }
542
543
  static get watchers() { return {
@@ -9,7 +9,7 @@ const constants = require('./constants-35ddd366.js');
9
9
  const taskbarElements = require('./taskbar-elements-9ad1f9c0.js');
10
10
  require('./DataFetcher-e059eb72.js');
11
11
  require('./pesquisa-fetcher-2ec4811b.js');
12
- const ContinuousInsertUtils = require('./ContinuousInsertUtils-42636ac1.js');
12
+ const ContinuousInsertUtils = require('./ContinuousInsertUtils-414b772c.js');
13
13
  const index = require('./index-1dfc7a6e.js');
14
14
  require('./ISave-e91b70a7.js');
15
15
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
@@ -114,13 +114,14 @@ const SnkSimpleCrud = class {
114
114
  this._config = undefined;
115
115
  this._fieldToGetFocus = undefined;
116
116
  this._customContainerId = `SNK-SIMPLE-CRUD-CUSTOM-CONTAINER-${core.StringUtils.generateUUID()}`;
117
+ this.enableLockManagerLoadingComp = false;
118
+ this.enableLockManagerTaskbarClick = false;
117
119
  this.dataState = undefined;
118
120
  this.dataUnit = undefined;
119
121
  this.entityName = undefined;
120
122
  this.mode = constants.SIMPLE_CRUD_MODE.SERVER;
121
123
  this.gridConfig = undefined;
122
124
  this.formConfig = undefined;
123
- this.enableLockManger = false;
124
125
  this._formFields = [];
125
126
  this._fieldsProps = new Map();
126
127
  this._enableContinuousInsert = true;
@@ -832,7 +833,7 @@ const SnkSimpleCrud = class {
832
833
  }
833
834
  return (index$1.h("snk-data-unit", { ref: ref => this._snkDataUnit = ref, class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), pageSize: this.getPageSize(), onInsertionMode: this.handleDataUnitOnInsertionMode.bind(this), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === constants.VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail, onDataUnitFieldsHidded: this.updateFormConfig.bind(this), domainMessagesBuilder: this.domainMessagesBuilder }, index$1.h("header", null, index$1.h("slot", { name: "snkSimpleCrudHeader" })), index$1.h("section", { class: `ez-box ${this.outlineMode ? 'ez-box--outline' : 'ez-box--shadow'} simple-crud__container-section` }, index$1.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, index$1.h("stack-item", null, index$1.h("ez-grid", { class: "ez-margin-bottom--large", ref: ref => this._grid = ref, dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(constants.VIEW_MODE.FORM), onConfigChange: evt => this.gridConfigChangeHandler(evt), columnfilterDataSource: this.dataUnit.name && this.dataUnit.name.includes(dataunitFetcher.InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
834
835
  ? undefined
835
- : this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this._enableContinuousInsert, enableLockManger: this.enableLockManger, outlineMode: this.outlineMode }, this.renderTaskbarContent(), index$1.h("div", { slot: "footer" }, index$1.h("slot", { name: "snkSimpleCrudFooter" })))), index$1.h("stack-item", null, this.renderTaskbarContent(), index$1.h("ez-form", { ref: (ref) => this._form = ref, class: `ez-margin-top--large`, dataUnit: this.dataUnit, config: this.getFormConfig(), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), index$1.h("snk-simple-form-config", { ref: (ref) => this._snkSimpleFormConfig = ref, dataUnit: this.dataUnit, onSnkConfigSaved: this.handleFormConfigSaved.bind(this), configName: (_a = this.formLegacyConfigName) !== null && _a !== void 0 ? _a : this.configName })), this.messagesBuilder && index$1.h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.goToView(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showConfiguratorButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this.resolveResourceID(), customContainerId: this._customContainerId })), index$1.h("div", { id: `${this._customContainerId}` }, index$1.h("slot", { name: "SnkConfigContainerSlot" }))), index$1.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index$1.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this.gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resolveResourceID() }))));
836
+ : this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this._enableContinuousInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, outlineMode: this.outlineMode }, this.renderTaskbarContent(), index$1.h("div", { slot: "footer" }, index$1.h("slot", { name: "snkSimpleCrudFooter" })))), index$1.h("stack-item", null, this.renderTaskbarContent(), index$1.h("ez-form", { ref: (ref) => this._form = ref, class: `ez-margin-top--large`, dataUnit: this.dataUnit, config: this.getFormConfig(), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), index$1.h("snk-simple-form-config", { ref: (ref) => this._snkSimpleFormConfig = ref, dataUnit: this.dataUnit, onSnkConfigSaved: this.handleFormConfigSaved.bind(this), configName: (_a = this.formLegacyConfigName) !== null && _a !== void 0 ? _a : this.configName })), this.messagesBuilder && index$1.h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.goToView(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showConfiguratorButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this.resolveResourceID(), customContainerId: this._customContainerId })), index$1.h("div", { id: `${this._customContainerId}` }, index$1.h("slot", { name: "SnkConfigContainerSlot" }))), index$1.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index$1.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this.gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resolveResourceID() }))));
836
837
  }
837
838
  get _element() { return index$1.getElement(this); }
838
839
  static get watchers() { return {
@@ -16,11 +16,12 @@ class DebouncedRequestListener {
16
16
  }
17
17
  ;
18
18
  onRequestEnd(param) {
19
+ var _a, _b, _c;
19
20
  const timeoutId = this.requests.get(param.requestId);
20
21
  clearTimeout(timeoutId);
21
- if (this.requestsLoadingBar.includes(param.requestId)) {
22
- this.requestsLoadingBar = this.requestsLoadingBar.filter(id => id !== param.requestId);
23
- !this.requestsLoadingBar.length && this.ezLoadingBar.hide();
22
+ if ((_a = this.requestsLoadingBar) === null || _a === void 0 ? void 0 : _a.includes(param.requestId)) {
23
+ this.requestsLoadingBar = (_b = this.requestsLoadingBar) === null || _b === void 0 ? void 0 : _b.filter(id => id !== param.requestId);
24
+ !this.requestsLoadingBar.length && ((_c = this.ezLoadingBar) === null || _c === void 0 ? void 0 : _c.hide());
24
25
  }
25
26
  }
26
27
  ;
@@ -3,3 +3,37 @@
3
3
  flex-direction: column;
4
4
  height: 100%;
5
5
  }
6
+
7
+ :host > .loading-hidden {
8
+ display: none;
9
+ pointer-events: none;
10
+ }
11
+
12
+ .skeleton-content-left {
13
+ width: 300px;
14
+ padding-right: 5px;
15
+ }
16
+
17
+ .skeleton-content {
18
+ height: calc(100vh - 310px);
19
+ }
20
+
21
+ .spinner {
22
+ height: 100vh;
23
+ gap: 10px;
24
+ }
25
+ .spinner > .spin {
26
+ animation-name: spin;
27
+ animation-duration: 5000ms;
28
+ animation-iteration-count: infinite;
29
+ animation-timing-function: linear;
30
+ }
31
+
32
+ @keyframes spin {
33
+ from {
34
+ transform:rotate(0deg);
35
+ }
36
+ to {
37
+ transform:rotate(360deg);
38
+ }
39
+ }
@@ -1,6 +1,6 @@
1
- import { ApplicationContext, DataType, DependencyType, ElementIDUtils, ErrorTracking, OnboardingUtils, StringUtils, KeyboardManager, ObjectUtils, ArrayUtils, SearchUtils } from "@sankhyalabs/core";
1
+ import { LockManager, ApplicationContext, DataType, DependencyType, ElementIDUtils, ErrorTracking, OnboardingUtils, StringUtils, KeyboardManager, ObjectUtils, ArrayUtils, SearchUtils, LockManagerOperation, UserAgentUtils } from "@sankhyalabs/core";
2
2
  import { ApplicationUtils } from "@sankhyalabs/ezui/dist/collection/utils";
3
- import { h } from "@stencil/core";
3
+ import { Host, h } from "@stencil/core";
4
4
  import AppletCaller from "../../lib/applet-caller/applet-caller";
5
5
  import MGEAuthorization from '../../lib/auth/mgeauthorization.module';
6
6
  import { ConfigStorage } from '../../lib/configs/ConfigStorage';
@@ -31,9 +31,13 @@ export class SnkApplication {
31
31
  this._duCache = new Map();
32
32
  this._duPromises = new Map();
33
33
  this._requestListener = RequestListenerFactory.create({ strategy: 'request_time' });
34
+ this._maxTimeLockAppLoading = 10000;
35
+ this._isBrowserTypeElectron = false;
34
36
  this._pendingActions = new Map;
35
37
  this._loadPkParameter = null;
36
38
  this._isLoadedByPk = false;
39
+ this._applicationReady = false;
40
+ this.enableLockManagerLoadingApp = undefined;
37
41
  this.messagesBuilder = undefined;
38
42
  this.configName = undefined;
39
43
  this.gridLegacyConfigName = undefined;
@@ -519,15 +523,21 @@ export class SnkApplication {
519
523
  return Promise.resolve(this._isLoadedByPk);
520
524
  }
521
525
  /**
522
- * Remove registro do cache do PreLoader do dataunit.
523
- * Deve ser usado quando existe um dataunit usando loader do application, mas o removeLoader está sendo sobrescrito.
524
- */
526
+ * Remove registro do cache do PreLoader do dataunit.
527
+ * Deve ser usado quando existe um dataunit usando loader do application, mas o removeLoader está sendo sobrescrito.
528
+ */
525
529
  async preloadMangerRemoveRecord(dataUnit, recordsIDs) {
526
530
  const records = recordsIDs.map(id => {
527
531
  return { "__record__id__": id };
528
532
  });
529
533
  PreloadManager.removeRecords(dataUnit, records);
530
534
  }
535
+ getCountSkeleton(className, skeletonHeight, spacingSkeleton) {
536
+ let containerHeight = window.innerHeight - 350;
537
+ spacingSkeleton = !spacingSkeleton ? 20 : spacingSkeleton;
538
+ let skeletonCount = Math.floor(containerHeight / (skeletonHeight + spacingSkeleton));
539
+ return skeletonCount || 1;
540
+ }
531
541
  async getAuthList(auth) {
532
542
  return await (new MGEAuthorization()).parseFromJSON(auth);
533
543
  }
@@ -985,12 +995,15 @@ export class SnkApplication {
985
995
  this._waitingAppReady.forEach(resolve => resolve());
986
996
  }
987
997
  connectedCallback() {
998
+ this._isBrowserTypeElectron = UserAgentUtils.isElectron();
988
999
  ApplicationContext.setContextValue("__SNK__APPLICATION__", this);
989
1000
  DataFetcher.addRequestListener(this._requestListener);
990
1001
  }
991
1002
  disconnectedCallback() {
992
- DataFetcher.removeRequestListener(this._requestListener);
1003
+ DataFetcher === null || DataFetcher === void 0 ? void 0 : DataFetcher.removeRequestListener(this._requestListener);
993
1004
  this.removeShortcuts();
1005
+ if (this._lockManagerTimer)
1006
+ clearTimeout(this._lockManagerTimer);
994
1007
  }
995
1008
  async componentDidLoad() {
996
1009
  this.applicationLoading.emit(true);
@@ -1002,6 +1015,64 @@ export class SnkApplication {
1002
1015
  ElementIDUtils.addIDInfo(this._element, `resource_${this.applicationResourceID}`);
1003
1016
  await this.handleShowNewVersionPopup();
1004
1017
  this.initKeyboardManager();
1018
+ if (this.enableLockManagerLoadingApp) {
1019
+ LockManager.addLockManagerCtxId(this._element);
1020
+ this.resolveApplicationReady();
1021
+ }
1022
+ else {
1023
+ this._applicationReady = true;
1024
+ }
1025
+ }
1026
+ async markToReload() {
1027
+ if (!this.enableLockManagerLoadingApp)
1028
+ return;
1029
+ this._applicationReady = false;
1030
+ await LockManager.resetLocks(this._element, LockManagerOperation.APP_LOADING);
1031
+ this.resolveApplicationReady();
1032
+ }
1033
+ async addLoadingLock(forceReady = false) {
1034
+ if (!this.enableLockManagerLoadingApp)
1035
+ return;
1036
+ if (forceReady) {
1037
+ this._applicationReady = false;
1038
+ await LockManager.resetLocks(this._element, LockManagerOperation.APP_LOADING);
1039
+ }
1040
+ this.resolveApplicationReady();
1041
+ return await LockManager.lock(this._element, LockManagerOperation.APP_LOADING);
1042
+ }
1043
+ async resolveApplicationReady() {
1044
+ if (this._applicationReady) {
1045
+ return;
1046
+ }
1047
+ ;
1048
+ try {
1049
+ await this.checkTimeoutLimitLockManager();
1050
+ await LockManager.whenHasLock(this._element, LockManagerOperation.APP_LOADING);
1051
+ await LockManager.whenResolve(this._element, LockManagerOperation.APP_LOADING, 1200);
1052
+ await LockManager.resetLocks(this._element, LockManagerOperation.APP_LOADING);
1053
+ this._applicationReady = true;
1054
+ }
1055
+ catch (error) {
1056
+ console.warn(error);
1057
+ this._applicationReady = true;
1058
+ }
1059
+ }
1060
+ stopTimeoutLockManager() {
1061
+ if (this._lockManagerTimer) {
1062
+ clearTimeout(this._lockManagerTimer);
1063
+ }
1064
+ }
1065
+ async checkTimeoutLimitLockManager() {
1066
+ this.stopTimeoutLockManager();
1067
+ if (this._applicationReady)
1068
+ return;
1069
+ this._lockManagerTimer = setTimeout(async () => {
1070
+ if (!this._applicationReady) {
1071
+ await LockManager.resetLocks(this._element, LockManagerOperation.APP_LOADING);
1072
+ this.stopTimeoutLockManager();
1073
+ this._applicationReady = true;
1074
+ }
1075
+ }, this._maxTimeLockAppLoading);
1005
1076
  }
1006
1077
  initKeyboardManager() {
1007
1078
  this._keyboardManager
@@ -1015,8 +1086,40 @@ export class SnkApplication {
1015
1086
  .unbind("ctrl + d")
1016
1087
  .unbind("F1");
1017
1088
  }
1089
+ // TODO: Etapa 2 - implementar template de loading
1090
+ renderLoadingSkeleton(template) {
1091
+ if (this.enableLockManagerLoadingApp) {
1092
+ if (!this._isBrowserTypeElectron) {
1093
+ switch (template) {
1094
+ case TEMPLATES_LOADING_SKELETON.APPLICATION:
1095
+ case TEMPLATES_LOADING_SKELETON.GRID:
1096
+ return this.getSkeletonTemplateApplication();
1097
+ default:
1098
+ return this.getSkeletonTemplateApplication();
1099
+ }
1100
+ }
1101
+ else {
1102
+ return this.getSpinnerLoadingDefault();
1103
+ }
1104
+ }
1105
+ }
1106
+ getLoadingVisibilityStyle() {
1107
+ return {
1108
+ visibility: this._applicationReady ? "hidden" : "initial",
1109
+ display: this._applicationReady ? "none" : "unset"
1110
+ };
1111
+ }
1112
+ getSkeletonTemplateApplication() {
1113
+ return (h("div", { class: "loading-hidden", style: this.getLoadingVisibilityStyle() }, h("div", { class: "ez-margin--medium ez-margin-top--extra-small" }, h("ez-skeleton", { count: 1, variant: "rect", width: "100%", height: "150px", animation: "progress" })), h("div", { class: "ez-flex ez-flex--align-items-stretch skeleton-content" }, h("div", { class: "skeleton-content-left ez-margin--medium" }, h("ez-skeleton", { count: 1, variant: "rect", width: "100%", height: "calc(100% - 15px)", animation: "progress", marginBottom: "20px" })), h("div", { class: "ez-flex-item--auto skeleton-content-right ez-margin--medium" }, h("ez-skeleton", { count: this.getCountSkeleton("skeleton-content-right", 50, 20), variant: "rect", width: "100%", height: "49px", animation: "progress", marginBottom: "20px" }))), h("div", { class: "skeleton-content-footer ez-margin--medium ez-margin-top--extra-small" }, h("ez-skeleton", { count: 1, variant: "rect", width: "100%", height: "100px", animation: "progress" }))));
1114
+ }
1115
+ getSpinnerLoadingDefault() {
1116
+ return (h("div", { class: "loading-hidden", style: this.getLoadingVisibilityStyle() }, h("div", { class: "ez-flex ez-size-height--full ez-size-width--full ez-flex--justify-center ez-flex--align-items-center spinner" }, h("ez-icon", { iconName: "sync", size: "x-large", class: "spin" }), h("span", { class: "ez-title ez-title--secondary ez-title--extra-large" }, "Carregando..."))));
1117
+ }
1018
1118
  render() {
1019
- 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 })));
1119
+ return (h(Host, { style: {
1120
+ visibility: (!this.enableLockManagerLoadingApp || this._applicationReady) ? "unset" : "hidden",
1121
+ overflow: (!this.enableLockManagerLoadingApp || this._applicationReady) ? "unset" : "hidden"
1122
+ } }, 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 }), this.renderLoadingSkeleton())));
1020
1123
  }
1021
1124
  static get is() { return "snk-application"; }
1022
1125
  static get encapsulation() { return "scoped"; }
@@ -1032,6 +1135,23 @@ export class SnkApplication {
1032
1135
  }
1033
1136
  static get properties() {
1034
1137
  return {
1138
+ "enableLockManagerLoadingApp": {
1139
+ "type": "boolean",
1140
+ "mutable": false,
1141
+ "complexType": {
1142
+ "original": "boolean",
1143
+ "resolved": "boolean",
1144
+ "references": {}
1145
+ },
1146
+ "required": false,
1147
+ "optional": false,
1148
+ "docs": {
1149
+ "tags": [],
1150
+ "text": "Define se o componente deve usar o LockManager para controle de carregamento da aplica\u00E7\u00E3o"
1151
+ },
1152
+ "attribute": "enable-lock-manager-loading-app",
1153
+ "reflect": false
1154
+ },
1035
1155
  "messagesBuilder": {
1036
1156
  "type": "unknown",
1037
1157
  "mutable": true,
@@ -1124,6 +1244,11 @@ export class SnkApplication {
1124
1244
  }
1125
1245
  };
1126
1246
  }
1247
+ static get states() {
1248
+ return {
1249
+ "_applicationReady": {}
1250
+ };
1251
+ }
1127
1252
  static get events() {
1128
1253
  return [{
1129
1254
  "method": "applicationLoaded",
@@ -2543,6 +2668,41 @@ export class SnkApplication {
2543
2668
  "text": "value - String convers\u00EDvel de acordo com o tipo do par\u00E2metro"
2544
2669
  }]
2545
2670
  }
2671
+ },
2672
+ "markToReload": {
2673
+ "complexType": {
2674
+ "signature": "() => Promise<void>",
2675
+ "parameters": [],
2676
+ "references": {
2677
+ "Promise": {
2678
+ "location": "global"
2679
+ }
2680
+ },
2681
+ "return": "Promise<void>"
2682
+ },
2683
+ "docs": {
2684
+ "text": "",
2685
+ "tags": []
2686
+ }
2687
+ },
2688
+ "addLoadingLock": {
2689
+ "complexType": {
2690
+ "signature": "(forceReady?: boolean) => Promise<() => void>",
2691
+ "parameters": [{
2692
+ "tags": [],
2693
+ "text": ""
2694
+ }],
2695
+ "references": {
2696
+ "Promise": {
2697
+ "location": "global"
2698
+ }
2699
+ },
2700
+ "return": "Promise<() => void>"
2701
+ },
2702
+ "docs": {
2703
+ "text": "",
2704
+ "tags": []
2705
+ }
2546
2706
  }
2547
2707
  };
2548
2708
  }
@@ -2560,3 +2720,8 @@ class PendingPromise {
2560
2720
  this.reject = reject;
2561
2721
  }
2562
2722
  }
2723
+ var TEMPLATES_LOADING_SKELETON;
2724
+ (function (TEMPLATES_LOADING_SKELETON) {
2725
+ TEMPLATES_LOADING_SKELETON[TEMPLATES_LOADING_SKELETON["APPLICATION"] = 1] = "APPLICATION";
2726
+ TEMPLATES_LOADING_SKELETON[TEMPLATES_LOADING_SKELETON["GRID"] = 2] = "GRID";
2727
+ })(TEMPLATES_LOADING_SKELETON || (TEMPLATES_LOADING_SKELETON = {}));
@@ -21,6 +21,8 @@ export class SnkCrud {
21
21
  this._currentViewMode = VIEW_MODE.GRID;
22
22
  this._canEdit = undefined;
23
23
  this._resourceID = undefined;
24
+ this.enableLockManagerLoadingComp = false;
25
+ this.enableLockManagerTaskbarClick = false;
24
26
  this.configName = undefined;
25
27
  this.filterBarTitle = undefined;
26
28
  this.selectionToastConfig = undefined;
@@ -42,7 +44,6 @@ export class SnkCrud {
42
44
  this.enableGridInsert = false;
43
45
  this.domainMessagesBuilder = undefined;
44
46
  this.ignoreReadOnlyFormFields = undefined;
45
- this.enableLockManger = false;
46
47
  this.setCustomFormTitle = undefined;
47
48
  this.customContainerId = `SNK-CRUD-CUSTOM-CONTAINER-${StringUtils.generateUUID()}`;
48
49
  }
@@ -390,7 +391,7 @@ export class SnkCrud {
390
391
  return;
391
392
  }
392
393
  this._snkDataUnit.ignoreSaveMessage = (this._currentViewMode === VIEW_MODE.GRID && !this.enableGridInsert);
393
- return (h(Host, null, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", { class: 'ez-flex ez-flex--column ez-size-height--full ez-size-width--full ez-padding--medium' }, h("snk-grid", { ref: (ref) => this._snkGrid = ref, class: 'ez-flex ez-flex--column ez-size-height--full ez-size-width--full', filterBarTitle: this.filterBarTitle, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID, disablePersonalizedFilter: this.disablePersonalizedFilter, gridLegacyConfigName: this.gridLegacyConfigName, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableLockManger: this.enableLockManger }, h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId, formLegacyConfigName: this.formLegacyConfigName, enableGridInsert: this.enableGridInsert, getCustomTitle: this.setCustomFormTitle, ignoreReadOnlyFormFields: this.ignoreReadOnlyFormFields }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId })), h("div", { id: `${this.customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }), h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
394
+ return (h(Host, null, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", { class: 'ez-flex ez-flex--column ez-size-height--full ez-size-width--full ez-padding--medium' }, h("snk-grid", { ref: (ref) => this._snkGrid = ref, class: 'ez-flex ez-flex--column ez-size-height--full ez-size-width--full', filterBarTitle: this.filterBarTitle, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID, disablePersonalizedFilter: this.disablePersonalizedFilter, gridLegacyConfigName: this.gridLegacyConfigName, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp }, h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId, formLegacyConfigName: this.formLegacyConfigName, enableGridInsert: this.enableGridInsert, getCustomTitle: this.setCustomFormTitle, ignoreReadOnlyFormFields: this.ignoreReadOnlyFormFields }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId })), h("div", { id: `${this.customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }), h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
394
395
  }
395
396
  static get is() { return "snk-crud"; }
396
397
  static get encapsulation() { return "scoped"; }
@@ -406,6 +407,42 @@ export class SnkCrud {
406
407
  }
407
408
  static get properties() {
408
409
  return {
410
+ "enableLockManagerLoadingComp": {
411
+ "type": "boolean",
412
+ "mutable": false,
413
+ "complexType": {
414
+ "original": "boolean",
415
+ "resolved": "boolean",
416
+ "references": {}
417
+ },
418
+ "required": false,
419
+ "optional": true,
420
+ "docs": {
421
+ "tags": [],
422
+ "text": "Define se o componente deve usar o LockManager para controle de carregamento da aplica\u00E7\u00E3o"
423
+ },
424
+ "attribute": "enable-lock-manager-loading-comp",
425
+ "reflect": false,
426
+ "defaultValue": "false"
427
+ },
428
+ "enableLockManagerTaskbarClick": {
429
+ "type": "boolean",
430
+ "mutable": false,
431
+ "complexType": {
432
+ "original": "boolean",
433
+ "resolved": "boolean",
434
+ "references": {}
435
+ },
436
+ "required": false,
437
+ "optional": true,
438
+ "docs": {
439
+ "tags": [],
440
+ "text": "Ativa o gerenciamento de locks na grade pela Taskbar."
441
+ },
442
+ "attribute": "enable-lock-manager-taskbar-click",
443
+ "reflect": false,
444
+ "defaultValue": "false"
445
+ },
409
446
  "configName": {
410
447
  "type": "string",
411
448
  "mutable": true,
@@ -799,24 +836,6 @@ export class SnkCrud {
799
836
  "attribute": "ignore-read-only-form-fields",
800
837
  "reflect": false
801
838
  },
802
- "enableLockManger": {
803
- "type": "boolean",
804
- "mutable": false,
805
- "complexType": {
806
- "original": "boolean",
807
- "resolved": "boolean",
808
- "references": {}
809
- },
810
- "required": false,
811
- "optional": true,
812
- "docs": {
813
- "tags": [],
814
- "text": "Ativa o gerenciamento de locks na grade."
815
- },
816
- "attribute": "enable-lock-manger",
817
- "reflect": false,
818
- "defaultValue": "false"
819
- },
820
839
  "setCustomFormTitle": {
821
840
  "type": "unknown",
822
841
  "mutable": false,
@@ -10,11 +10,17 @@ export default class ClientSideExporterStrategy {
10
10
  const visibleColumns = getVisibleColumns(columns);
11
11
  return visibleColumns;
12
12
  }
13
- async executeExport(resolveProps) {
13
+ async getColumns(resolveProps) {
14
14
  var _a;
15
+ if ((_a = getOptionKey(resolveProps === null || resolveProps === void 0 ? void 0 : resolveProps.exportOption)) === null || _a === void 0 ? void 0 : _a.includes("PDF")) {
16
+ return await this.getParsedColumns();
17
+ }
18
+ return await this._provider.getColumnsMetadata();
19
+ }
20
+ async executeExport(resolveProps) {
15
21
  const { methodName, gridTitle } = resolveProps;
16
22
  const records = await this._provider.getRecords();
17
- const columns = ((_a = getOptionKey(resolveProps === null || resolveProps === void 0 ? void 0 : resolveProps.exportOption)) === null || _a === void 0 ? void 0 : _a.includes("PDF")) ? await this.getParsedColumns() : await this._provider.getColumnsMetadata();
23
+ const columns = await this.getColumns(resolveProps);
18
24
  const [serviceName, processor] = this.getExecutor(methodName);
19
25
  const payload = {
20
26
  serviceName,
@@ -23,12 +23,19 @@ export default class ServerSideExporterStrategy {
23
23
  const visibleColumns = getVisibleColumns(columns);
24
24
  return visibleColumns;
25
25
  }
26
+ async getColumns(resolveProps) {
27
+ var _a;
28
+ if ((_a = getOptionKey(resolveProps === null || resolveProps === void 0 ? void 0 : resolveProps.exportOption)) === null || _a === void 0 ? void 0 : _a.includes("PDF")) {
29
+ return await this.getParsedColumns();
30
+ }
31
+ return await this._provider.getColumnsMetadata();
32
+ }
26
33
  async getParams(resolveProps) {
27
- var _a, _b, _c, _d, _e, _f, _g;
34
+ var _a, _b, _c, _d, _e, _f;
28
35
  const filters = (_b = (_a = this._provider).getFilters) === null || _b === void 0 ? void 0 : _b.call(_a);
29
- const columns = ((_c = getOptionKey(resolveProps === null || resolveProps === void 0 ? void 0 : resolveProps.exportOption)) === null || _c === void 0 ? void 0 : _c.includes("PDF")) ? await this.getParsedColumns() : await this._provider.getColumnsMetadata();
30
- const sort = (_e = (_d = this._provider).getOrders) === null || _e === void 0 ? void 0 : _e.call(_d);
31
- const resourceURI = (_g = (_f = this._provider).getResourceURI) === null || _g === void 0 ? void 0 : _g.call(_f);
36
+ const columns = await this.getColumns(resolveProps);
37
+ const sort = (_d = (_c = this._provider).getOrders) === null || _d === void 0 ? void 0 : _d.call(_c);
38
+ const resourceURI = (_f = (_e = this._provider).getResourceURI) === null || _f === void 0 ? void 0 : _f.call(_e);
32
39
  const selectedIDs = this._provider.getSelectedIDs();
33
40
  const option = resolveProps.exportOption;
34
41
  const currentPageOptions = [
@@ -28,7 +28,7 @@ export class CommonsExporter {
28
28
  const columnData = {
29
29
  label: column.label,
30
30
  id: column.name,
31
- width: column.width,
31
+ width: (fieldData === null || fieldData === void 0 ? void 0 : fieldData.userInterface) === UserInterface.SEARCH ? 60 : column.width,
32
32
  type: fieldData === null || fieldData === void 0 ? void 0 : fieldData.dataType,
33
33
  userInterface: fieldData === null || fieldData === void 0 ? void 0 : fieldData.userInterface,
34
34
  customFormatter
@@ -1,5 +1,5 @@
1
1
  import { DataExporterOption } from "../../../lib/@types";
2
- const DOC_MAX_WIDTH = 800;
2
+ const DOC_MAX_WIDTH = 760;
3
3
  export function getVisibleColumns(columns) {
4
4
  const visibleColumns = [];
5
5
  let totalWidth = 0;