@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.
- package/dist/cjs/{ContinuousInsertUtils-42636ac1.js → ContinuousInsertUtils-414b772c.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-application.cjs.entry.js +117 -9
- package/dist/cjs/snk-crud.cjs.entry.js +3 -2
- package/dist/cjs/snk-data-exporter.cjs.entry.js +20 -7
- package/dist/cjs/snk-filter-bar_4.cjs.entry.js +21 -7
- package/dist/cjs/snk-grid.cjs.entry.js +4 -3
- package/dist/cjs/snk-simple-crud.cjs.entry.js +4 -3
- package/dist/collection/components/snk-application/request-listener/DebouncedRequestListener.js +4 -3
- package/dist/collection/components/snk-application/snk-application.css +34 -0
- package/dist/collection/components/snk-application/snk-application.js +172 -7
- package/dist/collection/components/snk-crud/snk-crud.js +39 -20
- package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js +8 -2
- package/dist/collection/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.js +11 -4
- package/dist/collection/components/snk-data-exporter/interfaces/IExporterProvider.js +1 -1
- package/dist/collection/components/snk-data-exporter/utils/ParserExport.js +1 -1
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +40 -8
- package/dist/collection/components/snk-grid/snk-grid.js +39 -20
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +39 -20
- package/dist/components/ContinuousInsertUtils.js +1 -1
- package/dist/components/snk-application2.js +124 -12
- package/dist/components/snk-crud.js +5 -3
- package/dist/components/snk-data-exporter2.js +20 -7
- package/dist/components/snk-filter-bar2.js +23 -8
- package/dist/components/snk-grid2.js +5 -3
- package/dist/components/snk-simple-crud2.js +5 -3
- package/dist/esm/{ContinuousInsertUtils-071e0b6a.js → ContinuousInsertUtils-bab45060.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-application.entry.js +119 -11
- package/dist/esm/snk-crud.entry.js +3 -2
- package/dist/esm/snk-data-exporter.entry.js +20 -7
- package/dist/esm/snk-filter-bar_4.entry.js +22 -8
- package/dist/esm/snk-grid.entry.js +4 -3
- package/dist/esm/snk-simple-crud.entry.js +4 -3
- package/dist/sankhyablocks/p-098f8cfa.entry.js +1 -0
- package/dist/sankhyablocks/p-22d04eac.entry.js +1 -0
- package/dist/sankhyablocks/p-2b7432e8.entry.js +1 -0
- package/dist/sankhyablocks/p-442367ab.entry.js +11 -0
- package/dist/sankhyablocks/p-50306605.entry.js +1 -0
- package/dist/sankhyablocks/p-9a9681d1.entry.js +1 -0
- package/dist/sankhyablocks/{p-c271fbf1.js → p-b619ee23.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/snk-application.d.ts +21 -3
- package/dist/types/components/snk-crud/snk-crud.d.ts +8 -4
- package/dist/types/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.d.ts +1 -0
- package/dist/types/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.d.ts +1 -0
- package/dist/types/components/snk-data-exporter/utils/ParserExport.d.ts +1 -1
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +6 -1
- package/dist/types/components/snk-grid/snk-grid.d.ts +8 -4
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +8 -1
- package/dist/types/components.d.ts +58 -10
- package/package.json +1 -1
- package/dist/sankhyablocks/p-365d8ed4.entry.js +0 -1
- package/dist/sankhyablocks/p-399e1b74.entry.js +0 -1
- package/dist/sankhyablocks/p-65650e05.entry.js +0 -1
- package/dist/sankhyablocks/p-8cf0a9fe.entry.js +0 -1
- package/dist/sankhyablocks/p-cd8fa07b.entry.js +0 -1
- package/dist/sankhyablocks/p-eda55eef.entry.js +0 -11
@@ -1,4 +1,4 @@
|
|
1
|
-
import { ApplicationContext, ElementIDUtils, ObjectUtils, ErrorException } from '@sankhyalabs/core';
|
1
|
+
import { ApplicationContext, ElementIDUtils, ObjectUtils, ErrorException, LockManager, LockManagerOperation } from '@sankhyalabs/core';
|
2
2
|
import { EzScrollDirection } from '@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection';
|
3
3
|
import { h, Host } from '@stencil/core';
|
4
4
|
import { ConfigStorage } from '../../lib/configs/ConfigStorage';
|
@@ -14,6 +14,7 @@ export class SnkFilterBar {
|
|
14
14
|
this._firstLoad = true;
|
15
15
|
this._pendingVariables = false;
|
16
16
|
this._customfiltersToBeUpdated = [];
|
17
|
+
this._resolveLoading = undefined;
|
17
18
|
this._calculateSortIndex = (item) => {
|
18
19
|
if (!item.visible)
|
19
20
|
return 0;
|
@@ -27,6 +28,7 @@ export class SnkFilterBar {
|
|
27
28
|
this._filtersComparator = (a, b) => {
|
28
29
|
return this._calculateSortIndex(b) - this._calculateSortIndex(a);
|
29
30
|
};
|
31
|
+
this.enableLockManagerLoadingComp = false;
|
30
32
|
this.customFilterBarConfig = undefined;
|
31
33
|
this.dataUnit = undefined;
|
32
34
|
this.title = undefined;
|
@@ -448,14 +450,26 @@ export class SnkFilterBar {
|
|
448
450
|
this.personalizedFilterId = undefined;
|
449
451
|
this.showPersonalizedFilter = false;
|
450
452
|
}
|
451
|
-
componentWillLoad() {
|
452
|
-
|
453
|
-
|
454
|
-
this.
|
455
|
-
this.
|
456
|
-
this.
|
453
|
+
async componentWillLoad() {
|
454
|
+
var _a;
|
455
|
+
try {
|
456
|
+
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
457
|
+
await this.attachDataUnit();
|
458
|
+
if (this._application) {
|
459
|
+
if (this._application.enableLockManagerLoadingApp && this.enableLockManagerLoadingComp) {
|
460
|
+
const appLoadLockerID = LockManager.addLockManagerCtxId(this._element);
|
461
|
+
this._resolveLoading = LockManager.lock(appLoadLockerID, LockManagerOperation.APP_LOADING);
|
462
|
+
}
|
463
|
+
await Promise.all([
|
464
|
+
this.loadPermitions(),
|
465
|
+
this.addFilterBarLegacyConfigName(),
|
466
|
+
this.loadConfigFromStorage(),
|
467
|
+
]);
|
468
|
+
}
|
469
|
+
}
|
470
|
+
finally {
|
471
|
+
(_a = this._resolveLoading) === null || _a === void 0 ? void 0 : _a.call(this);
|
457
472
|
}
|
458
|
-
this.attachDataUnit();
|
459
473
|
}
|
460
474
|
componentDidRender() {
|
461
475
|
this.processPendingFilter();
|
@@ -486,6 +500,24 @@ export class SnkFilterBar {
|
|
486
500
|
}
|
487
501
|
static get properties() {
|
488
502
|
return {
|
503
|
+
"enableLockManagerLoadingComp": {
|
504
|
+
"type": "boolean",
|
505
|
+
"mutable": false,
|
506
|
+
"complexType": {
|
507
|
+
"original": "boolean",
|
508
|
+
"resolved": "boolean",
|
509
|
+
"references": {}
|
510
|
+
},
|
511
|
+
"required": false,
|
512
|
+
"optional": true,
|
513
|
+
"docs": {
|
514
|
+
"tags": [],
|
515
|
+
"text": "Define se o componente deve usar o LockManager para controle de carregamento"
|
516
|
+
},
|
517
|
+
"attribute": "enable-lock-manager-loading-comp",
|
518
|
+
"reflect": false,
|
519
|
+
"defaultValue": "false"
|
520
|
+
},
|
489
521
|
"customFilterBarConfig": {
|
490
522
|
"type": "unknown",
|
491
523
|
"mutable": false,
|
@@ -50,6 +50,8 @@ export class SnkGrid {
|
|
50
50
|
this._showSnkFilterBar = true;
|
51
51
|
this._enableContinuousInsert = false;
|
52
52
|
this.columnFilterDataSource = new SnkMultiSelectionListDataSource();
|
53
|
+
this.enableLockManagerLoadingComp = false;
|
54
|
+
this.enableLockManagerTaskbarClick = false;
|
53
55
|
this.configName = undefined;
|
54
56
|
this.filterBarTitle = undefined;
|
55
57
|
this.resourceID = undefined;
|
@@ -73,7 +75,6 @@ export class SnkGrid {
|
|
73
75
|
this.autoLoad = undefined;
|
74
76
|
this.autoFocus = true;
|
75
77
|
this.enableGridInsert = false;
|
76
|
-
this.enableLockManger = false;
|
77
78
|
this.outlineMode = false;
|
78
79
|
}
|
79
80
|
/**
|
@@ -463,7 +464,7 @@ export class SnkGrid {
|
|
463
464
|
return undefined;
|
464
465
|
}
|
465
466
|
return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, h("div", { class: "snk-grid__header ez-margin-bottom--extra-small" }, this._showSnkFilterBar &&
|
466
|
-
h(Fragment, null, 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 }), h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId, overflowStrategy: 'none' }, h("slot", { name: this.topTaskbarCustomSlotId }))), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: (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,
|
467
|
+
h(Fragment, null, 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 }), h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId, overflowStrategy: 'none' }, h("slot", { name: this.topTaskbarCustomSlotId }))), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: (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 }, 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 }, h("slot", { name: this.gridHeaderCustomSlotId }))), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" })), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
|
467
468
|
}
|
468
469
|
static get is() { return "snk-grid"; }
|
469
470
|
static get encapsulation() { return "scoped"; }
|
@@ -500,6 +501,42 @@ export class SnkGrid {
|
|
500
501
|
},
|
501
502
|
"defaultValue": "new SnkMultiSelectionListDataSource()"
|
502
503
|
},
|
504
|
+
"enableLockManagerLoadingComp": {
|
505
|
+
"type": "boolean",
|
506
|
+
"mutable": false,
|
507
|
+
"complexType": {
|
508
|
+
"original": "boolean",
|
509
|
+
"resolved": "boolean",
|
510
|
+
"references": {}
|
511
|
+
},
|
512
|
+
"required": false,
|
513
|
+
"optional": true,
|
514
|
+
"docs": {
|
515
|
+
"tags": [],
|
516
|
+
"text": "Define se o componente deve usar o LockManager para controle de carregamento da aplica\u00E7\u00E3o"
|
517
|
+
},
|
518
|
+
"attribute": "enable-lock-manager-loading-comp",
|
519
|
+
"reflect": false,
|
520
|
+
"defaultValue": "false"
|
521
|
+
},
|
522
|
+
"enableLockManagerTaskbarClick": {
|
523
|
+
"type": "boolean",
|
524
|
+
"mutable": false,
|
525
|
+
"complexType": {
|
526
|
+
"original": "boolean",
|
527
|
+
"resolved": "boolean",
|
528
|
+
"references": {}
|
529
|
+
},
|
530
|
+
"required": false,
|
531
|
+
"optional": true,
|
532
|
+
"docs": {
|
533
|
+
"tags": [],
|
534
|
+
"text": "Ativa o gerenciamento de locks na grade pela Taskbar."
|
535
|
+
},
|
536
|
+
"attribute": "enable-lock-manager-taskbar-click",
|
537
|
+
"reflect": false,
|
538
|
+
"defaultValue": "false"
|
539
|
+
},
|
503
540
|
"configName": {
|
504
541
|
"type": "string",
|
505
542
|
"mutable": false,
|
@@ -928,24 +965,6 @@ export class SnkGrid {
|
|
928
965
|
"reflect": false,
|
929
966
|
"defaultValue": "false"
|
930
967
|
},
|
931
|
-
"enableLockManger": {
|
932
|
-
"type": "boolean",
|
933
|
-
"mutable": false,
|
934
|
-
"complexType": {
|
935
|
-
"original": "boolean",
|
936
|
-
"resolved": "boolean",
|
937
|
-
"references": {}
|
938
|
-
},
|
939
|
-
"required": false,
|
940
|
-
"optional": true,
|
941
|
-
"docs": {
|
942
|
-
"tags": [],
|
943
|
-
"text": "Ativa o gerenciamento de locks na grade."
|
944
|
-
},
|
945
|
-
"attribute": "enable-lock-manger",
|
946
|
-
"reflect": false,
|
947
|
-
"defaultValue": "false"
|
948
|
-
},
|
949
968
|
"outlineMode": {
|
950
969
|
"type": "boolean",
|
951
970
|
"mutable": false,
|
@@ -34,13 +34,14 @@ export class SnkSimpleCrud {
|
|
34
34
|
this._config = undefined;
|
35
35
|
this._fieldToGetFocus = undefined;
|
36
36
|
this._customContainerId = `SNK-SIMPLE-CRUD-CUSTOM-CONTAINER-${StringUtils.generateUUID()}`;
|
37
|
+
this.enableLockManagerLoadingComp = false;
|
38
|
+
this.enableLockManagerTaskbarClick = false;
|
37
39
|
this.dataState = undefined;
|
38
40
|
this.dataUnit = undefined;
|
39
41
|
this.entityName = undefined;
|
40
42
|
this.mode = SIMPLE_CRUD_MODE.SERVER;
|
41
43
|
this.gridConfig = undefined;
|
42
44
|
this.formConfig = undefined;
|
43
|
-
this.enableLockManger = false;
|
44
45
|
this._formFields = [];
|
45
46
|
this._fieldsProps = new Map();
|
46
47
|
this._enableContinuousInsert = true;
|
@@ -752,7 +753,7 @@ export class SnkSimpleCrud {
|
|
752
753
|
}
|
753
754
|
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, 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 ${this.outlineMode ? 'ez-box--outline' : '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)
|
754
755
|
? undefined
|
755
|
-
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this._enableContinuousInsert,
|
756
|
+
: 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(), 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`, dataUnit: this.dataUnit, config: this.getFormConfig(), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), 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 && 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() }))));
|
756
757
|
}
|
757
758
|
static get is() { return "snk-simple-crud"; }
|
758
759
|
static get encapsulation() { return "scoped"; }
|
@@ -768,6 +769,42 @@ export class SnkSimpleCrud {
|
|
768
769
|
}
|
769
770
|
static get properties() {
|
770
771
|
return {
|
772
|
+
"enableLockManagerLoadingComp": {
|
773
|
+
"type": "boolean",
|
774
|
+
"mutable": false,
|
775
|
+
"complexType": {
|
776
|
+
"original": "boolean",
|
777
|
+
"resolved": "boolean",
|
778
|
+
"references": {}
|
779
|
+
},
|
780
|
+
"required": false,
|
781
|
+
"optional": true,
|
782
|
+
"docs": {
|
783
|
+
"tags": [],
|
784
|
+
"text": "Define se o componente deve usar o LockManager para controle de carregamento da aplica\u00E7\u00E3o"
|
785
|
+
},
|
786
|
+
"attribute": "enable-lock-manager-loading-comp",
|
787
|
+
"reflect": false,
|
788
|
+
"defaultValue": "false"
|
789
|
+
},
|
790
|
+
"enableLockManagerTaskbarClick": {
|
791
|
+
"type": "boolean",
|
792
|
+
"mutable": false,
|
793
|
+
"complexType": {
|
794
|
+
"original": "boolean",
|
795
|
+
"resolved": "boolean",
|
796
|
+
"references": {}
|
797
|
+
},
|
798
|
+
"required": false,
|
799
|
+
"optional": true,
|
800
|
+
"docs": {
|
801
|
+
"tags": [],
|
802
|
+
"text": "Ativa o gerenciamento de locks na grade pela Taskbar."
|
803
|
+
},
|
804
|
+
"attribute": "enable-lock-manager-taskbar-click",
|
805
|
+
"reflect": false,
|
806
|
+
"defaultValue": "false"
|
807
|
+
},
|
771
808
|
"dataState": {
|
772
809
|
"type": "unknown",
|
773
810
|
"mutable": false,
|
@@ -888,24 +925,6 @@ export class SnkSimpleCrud {
|
|
888
925
|
"text": ""
|
889
926
|
}
|
890
927
|
},
|
891
|
-
"enableLockManger": {
|
892
|
-
"type": "boolean",
|
893
|
-
"mutable": false,
|
894
|
-
"complexType": {
|
895
|
-
"original": "boolean",
|
896
|
-
"resolved": "boolean",
|
897
|
-
"references": {}
|
898
|
-
},
|
899
|
-
"required": false,
|
900
|
-
"optional": true,
|
901
|
-
"docs": {
|
902
|
-
"tags": [],
|
903
|
-
"text": ""
|
904
|
-
},
|
905
|
-
"attribute": "enable-lock-manger",
|
906
|
-
"reflect": false,
|
907
|
-
"defaultValue": "false"
|
908
|
-
},
|
909
928
|
"multipleSelection": {
|
910
929
|
"type": "boolean",
|
911
930
|
"mutable": false,
|
@@ -284,7 +284,7 @@ class CommonsExporter {
|
|
284
284
|
const columnData = {
|
285
285
|
label: column.label,
|
286
286
|
id: column.name,
|
287
|
-
width: column.width,
|
287
|
+
width: (fieldData === null || fieldData === void 0 ? void 0 : fieldData.userInterface) === UserInterface$1.SEARCH ? 60 : column.width,
|
288
288
|
type: fieldData === null || fieldData === void 0 ? void 0 : fieldData.dataType,
|
289
289
|
userInterface: fieldData === null || fieldData === void 0 ? void 0 : fieldData.userInterface,
|
290
290
|
customFormatter
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
2
|
-
import { DateUtils, StringUtils, ObjectUtils, WaitingChangeException, WarningException, ErrorException, KeyboardManager, OnboardingUtils, DependencyType, ArrayUtils, SearchUtils, ElementIDUtils, ApplicationContext, DataType, ErrorTracking } from '@sankhyalabs/core';
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
2
|
+
import { DateUtils, StringUtils, ObjectUtils, WaitingChangeException, WarningException, ErrorException, KeyboardManager, OnboardingUtils, DependencyType, ArrayUtils, SearchUtils, ElementIDUtils, ApplicationContext, DataType, ErrorTracking, UserAgentUtils, LockManager, LockManagerOperation } from '@sankhyalabs/core';
|
3
3
|
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
4
4
|
import { C as ConfigStorage } from './ConfigStorage.js';
|
5
5
|
import { d as dist, D as DataFetcher, U as UrlUtils } from './DataFetcher.js';
|
@@ -298,11 +298,12 @@ class DebouncedRequestListener {
|
|
298
298
|
}
|
299
299
|
;
|
300
300
|
onRequestEnd(param) {
|
301
|
+
var _a, _b, _c;
|
301
302
|
const timeoutId = this.requests.get(param.requestId);
|
302
303
|
clearTimeout(timeoutId);
|
303
|
-
if (this.requestsLoadingBar.includes(param.requestId)) {
|
304
|
-
this.requestsLoadingBar = this.requestsLoadingBar.filter(id => id !== param.requestId);
|
305
|
-
!this.requestsLoadingBar.length && this.ezLoadingBar.hide();
|
304
|
+
if ((_a = this.requestsLoadingBar) === null || _a === void 0 ? void 0 : _a.includes(param.requestId)) {
|
305
|
+
this.requestsLoadingBar = (_b = this.requestsLoadingBar) === null || _b === void 0 ? void 0 : _b.filter(id => id !== param.requestId);
|
306
|
+
!this.requestsLoadingBar.length && ((_c = this.ezLoadingBar) === null || _c === void 0 ? void 0 : _c.hide());
|
306
307
|
}
|
307
308
|
}
|
308
309
|
;
|
@@ -373,7 +374,7 @@ class RequestListenerFactory {
|
|
373
374
|
}
|
374
375
|
}
|
375
376
|
|
376
|
-
const snkApplicationCss = ".sc-snk-application-h{display:flex;flex-direction:column;height:100%}";
|
377
|
+
const snkApplicationCss = ".sc-snk-application-h{display:flex;flex-direction:column;height:100%}.sc-snk-application-h>.loading-hidden.sc-snk-application{display:none;pointer-events:none}.skeleton-content-left.sc-snk-application{width:300px;padding-right:5px}.skeleton-content.sc-snk-application{height:calc(100vh - 310px)}.spinner.sc-snk-application{height:100vh;gap:10px}.spinner.sc-snk-application>.spin.sc-snk-application{animation-name:spin;animation-duration:5000ms;animation-iteration-count:infinite;animation-timing-function:linear}@keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}";
|
377
378
|
|
378
379
|
const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
379
380
|
constructor() {
|
@@ -388,9 +389,13 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
388
389
|
this._duCache = new Map();
|
389
390
|
this._duPromises = new Map();
|
390
391
|
this._requestListener = RequestListenerFactory.create({ strategy: 'request_time' });
|
392
|
+
this._maxTimeLockAppLoading = 10000;
|
393
|
+
this._isBrowserTypeElectron = false;
|
391
394
|
this._pendingActions = new Map;
|
392
395
|
this._loadPkParameter = null;
|
393
396
|
this._isLoadedByPk = false;
|
397
|
+
this._applicationReady = false;
|
398
|
+
this.enableLockManagerLoadingApp = undefined;
|
394
399
|
this.messagesBuilder = undefined;
|
395
400
|
this.configName = undefined;
|
396
401
|
this.gridLegacyConfigName = undefined;
|
@@ -876,15 +881,21 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
876
881
|
return Promise.resolve(this._isLoadedByPk);
|
877
882
|
}
|
878
883
|
/**
|
879
|
-
|
880
|
-
|
881
|
-
|
884
|
+
* Remove registro do cache do PreLoader do dataunit.
|
885
|
+
* Deve ser usado quando existe um dataunit usando loader do application, mas o removeLoader está sendo sobrescrito.
|
886
|
+
*/
|
882
887
|
async preloadMangerRemoveRecord(dataUnit, recordsIDs) {
|
883
888
|
const records = recordsIDs.map(id => {
|
884
889
|
return { "__record__id__": id };
|
885
890
|
});
|
886
891
|
PreloadManager.removeRecords(dataUnit, records);
|
887
892
|
}
|
893
|
+
getCountSkeleton(className, skeletonHeight, spacingSkeleton) {
|
894
|
+
let containerHeight = window.innerHeight - 350;
|
895
|
+
spacingSkeleton = !spacingSkeleton ? 20 : spacingSkeleton;
|
896
|
+
let skeletonCount = Math.floor(containerHeight / (skeletonHeight + spacingSkeleton));
|
897
|
+
return skeletonCount || 1;
|
898
|
+
}
|
888
899
|
async getAuthList(auth) {
|
889
900
|
return await (new MGEAuthorization()).parseFromJSON(auth);
|
890
901
|
}
|
@@ -1340,12 +1351,15 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
1340
1351
|
this._waitingAppReady.forEach(resolve => resolve());
|
1341
1352
|
}
|
1342
1353
|
connectedCallback() {
|
1354
|
+
this._isBrowserTypeElectron = UserAgentUtils.isElectron();
|
1343
1355
|
ApplicationContext.setContextValue("__SNK__APPLICATION__", this);
|
1344
1356
|
DataFetcher.addRequestListener(this._requestListener);
|
1345
1357
|
}
|
1346
1358
|
disconnectedCallback() {
|
1347
|
-
DataFetcher.removeRequestListener(this._requestListener);
|
1359
|
+
DataFetcher === null || DataFetcher === void 0 ? void 0 : DataFetcher.removeRequestListener(this._requestListener);
|
1348
1360
|
this.removeShortcuts();
|
1361
|
+
if (this._lockManagerTimer)
|
1362
|
+
clearTimeout(this._lockManagerTimer);
|
1349
1363
|
}
|
1350
1364
|
async componentDidLoad() {
|
1351
1365
|
this.applicationLoading.emit(true);
|
@@ -1357,6 +1371,63 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
1357
1371
|
ElementIDUtils.addIDInfo(this._element, `resource_${this.applicationResourceID}`);
|
1358
1372
|
await this.handleShowNewVersionPopup();
|
1359
1373
|
this.initKeyboardManager();
|
1374
|
+
if (this.enableLockManagerLoadingApp) {
|
1375
|
+
LockManager.addLockManagerCtxId(this._element);
|
1376
|
+
this.resolveApplicationReady();
|
1377
|
+
}
|
1378
|
+
else {
|
1379
|
+
this._applicationReady = true;
|
1380
|
+
}
|
1381
|
+
}
|
1382
|
+
async markToReload() {
|
1383
|
+
if (!this.enableLockManagerLoadingApp)
|
1384
|
+
return;
|
1385
|
+
this._applicationReady = false;
|
1386
|
+
await LockManager.resetLocks(this._element, LockManagerOperation.APP_LOADING);
|
1387
|
+
this.resolveApplicationReady();
|
1388
|
+
}
|
1389
|
+
async addLoadingLock(forceReady = false) {
|
1390
|
+
if (!this.enableLockManagerLoadingApp)
|
1391
|
+
return;
|
1392
|
+
if (forceReady) {
|
1393
|
+
this._applicationReady = false;
|
1394
|
+
await LockManager.resetLocks(this._element, LockManagerOperation.APP_LOADING);
|
1395
|
+
}
|
1396
|
+
this.resolveApplicationReady();
|
1397
|
+
return await LockManager.lock(this._element, LockManagerOperation.APP_LOADING);
|
1398
|
+
}
|
1399
|
+
async resolveApplicationReady() {
|
1400
|
+
if (this._applicationReady) {
|
1401
|
+
return;
|
1402
|
+
}
|
1403
|
+
try {
|
1404
|
+
await this.checkTimeoutLimitLockManager();
|
1405
|
+
await LockManager.whenHasLock(this._element, LockManagerOperation.APP_LOADING);
|
1406
|
+
await LockManager.whenResolve(this._element, LockManagerOperation.APP_LOADING, 1200);
|
1407
|
+
await LockManager.resetLocks(this._element, LockManagerOperation.APP_LOADING);
|
1408
|
+
this._applicationReady = true;
|
1409
|
+
}
|
1410
|
+
catch (error) {
|
1411
|
+
console.warn(error);
|
1412
|
+
this._applicationReady = true;
|
1413
|
+
}
|
1414
|
+
}
|
1415
|
+
stopTimeoutLockManager() {
|
1416
|
+
if (this._lockManagerTimer) {
|
1417
|
+
clearTimeout(this._lockManagerTimer);
|
1418
|
+
}
|
1419
|
+
}
|
1420
|
+
async checkTimeoutLimitLockManager() {
|
1421
|
+
this.stopTimeoutLockManager();
|
1422
|
+
if (this._applicationReady)
|
1423
|
+
return;
|
1424
|
+
this._lockManagerTimer = setTimeout(async () => {
|
1425
|
+
if (!this._applicationReady) {
|
1426
|
+
await LockManager.resetLocks(this._element, LockManagerOperation.APP_LOADING);
|
1427
|
+
this.stopTimeoutLockManager();
|
1428
|
+
this._applicationReady = true;
|
1429
|
+
}
|
1430
|
+
}, this._maxTimeLockAppLoading);
|
1360
1431
|
}
|
1361
1432
|
initKeyboardManager() {
|
1362
1433
|
this._keyboardManager
|
@@ -1370,8 +1441,40 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
1370
1441
|
.unbind("ctrl + d")
|
1371
1442
|
.unbind("F1");
|
1372
1443
|
}
|
1444
|
+
// TODO: Etapa 2 - implementar template de loading
|
1445
|
+
renderLoadingSkeleton(template) {
|
1446
|
+
if (this.enableLockManagerLoadingApp) {
|
1447
|
+
if (!this._isBrowserTypeElectron) {
|
1448
|
+
switch (template) {
|
1449
|
+
case TEMPLATES_LOADING_SKELETON.APPLICATION:
|
1450
|
+
case TEMPLATES_LOADING_SKELETON.GRID:
|
1451
|
+
return this.getSkeletonTemplateApplication();
|
1452
|
+
default:
|
1453
|
+
return this.getSkeletonTemplateApplication();
|
1454
|
+
}
|
1455
|
+
}
|
1456
|
+
else {
|
1457
|
+
return this.getSpinnerLoadingDefault();
|
1458
|
+
}
|
1459
|
+
}
|
1460
|
+
}
|
1461
|
+
getLoadingVisibilityStyle() {
|
1462
|
+
return {
|
1463
|
+
visibility: this._applicationReady ? "hidden" : "initial",
|
1464
|
+
display: this._applicationReady ? "none" : "unset"
|
1465
|
+
};
|
1466
|
+
}
|
1467
|
+
getSkeletonTemplateApplication() {
|
1468
|
+
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" }))));
|
1469
|
+
}
|
1470
|
+
getSpinnerLoadingDefault() {
|
1471
|
+
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..."))));
|
1472
|
+
}
|
1373
1473
|
render() {
|
1374
|
-
return (h(
|
1474
|
+
return (h(Host, { style: {
|
1475
|
+
visibility: (!this.enableLockManagerLoadingApp || this._applicationReady) ? "unset" : "hidden",
|
1476
|
+
overflow: (!this.enableLockManagerLoadingApp || this._applicationReady) ? "unset" : "hidden"
|
1477
|
+
} }, 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())));
|
1375
1478
|
}
|
1376
1479
|
get _element() { return this; }
|
1377
1480
|
static get watchers() { return {
|
@@ -1379,11 +1482,13 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
1379
1482
|
}; }
|
1380
1483
|
static get style() { return snkApplicationCss; }
|
1381
1484
|
}, [2, "snk-application", {
|
1485
|
+
"enableLockManagerLoadingApp": [4, "enable-lock-manager-loading-app"],
|
1382
1486
|
"messagesBuilder": [1040],
|
1383
1487
|
"configName": [1, "config-name"],
|
1384
1488
|
"gridLegacyConfigName": [1, "grid-legacy-config-name"],
|
1385
1489
|
"formLegacyConfigName": [1, "form-legacy-config-name"],
|
1386
1490
|
"loadByPK": [16],
|
1491
|
+
"_applicationReady": [32],
|
1387
1492
|
"getKeyboardManager": [64],
|
1388
1493
|
"isUserSup": [64],
|
1389
1494
|
"addPendingAction": [64],
|
@@ -1434,7 +1539,9 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
1434
1539
|
"executeSelectDistinct": [64],
|
1435
1540
|
"getDataFetcher": [64],
|
1436
1541
|
"whenApplicationReady": [64],
|
1437
|
-
"setSearchFilterContext": [64]
|
1542
|
+
"setSearchFilterContext": [64],
|
1543
|
+
"markToReload": [64],
|
1544
|
+
"addLoadingLock": [64]
|
1438
1545
|
}]);
|
1439
1546
|
class PendingPromise {
|
1440
1547
|
constructor(resolve, reject) {
|
@@ -1442,6 +1549,11 @@ class PendingPromise {
|
|
1442
1549
|
this.reject = reject;
|
1443
1550
|
}
|
1444
1551
|
}
|
1552
|
+
var TEMPLATES_LOADING_SKELETON;
|
1553
|
+
(function (TEMPLATES_LOADING_SKELETON) {
|
1554
|
+
TEMPLATES_LOADING_SKELETON[TEMPLATES_LOADING_SKELETON["APPLICATION"] = 1] = "APPLICATION";
|
1555
|
+
TEMPLATES_LOADING_SKELETON[TEMPLATES_LOADING_SKELETON["GRID"] = 2] = "GRID";
|
1556
|
+
})(TEMPLATES_LOADING_SKELETON || (TEMPLATES_LOADING_SKELETON = {}));
|
1445
1557
|
function defineCustomElement() {
|
1446
1558
|
if (typeof customElements === "undefined") {
|
1447
1559
|
return;
|
@@ -63,6 +63,8 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
63
63
|
this._currentViewMode = VIEW_MODE.GRID;
|
64
64
|
this._canEdit = undefined;
|
65
65
|
this._resourceID = undefined;
|
66
|
+
this.enableLockManagerLoadingComp = false;
|
67
|
+
this.enableLockManagerTaskbarClick = false;
|
66
68
|
this.configName = undefined;
|
67
69
|
this.filterBarTitle = undefined;
|
68
70
|
this.selectionToastConfig = undefined;
|
@@ -84,7 +86,6 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
84
86
|
this.enableGridInsert = false;
|
85
87
|
this.domainMessagesBuilder = undefined;
|
86
88
|
this.ignoreReadOnlyFormFields = undefined;
|
87
|
-
this.enableLockManger = false;
|
88
89
|
this.setCustomFormTitle = undefined;
|
89
90
|
this.customContainerId = `SNK-CRUD-CUSTOM-CONTAINER-${StringUtils.generateUUID()}`;
|
90
91
|
}
|
@@ -431,7 +432,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
431
432
|
return;
|
432
433
|
}
|
433
434
|
this._snkDataUnit.ignoreSaveMessage = (this._currentViewMode === VIEW_MODE.GRID && !this.enableGridInsert);
|
434
|
-
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,
|
435
|
+
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" }))));
|
435
436
|
}
|
436
437
|
get _element() { return this; }
|
437
438
|
static get watchers() { return {
|
@@ -439,6 +440,8 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
439
440
|
}; }
|
440
441
|
static get style() { return snkCrudCss; }
|
441
442
|
}, [6, "snk-crud", {
|
443
|
+
"enableLockManagerLoadingComp": [4, "enable-lock-manager-loading-comp"],
|
444
|
+
"enableLockManagerTaskbarClick": [4, "enable-lock-manager-taskbar-click"],
|
442
445
|
"configName": [1025, "config-name"],
|
443
446
|
"filterBarTitle": [1, "filter-bar-title"],
|
444
447
|
"selectionToastConfig": [16],
|
@@ -460,7 +463,6 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
460
463
|
"enableGridInsert": [4, "enable-grid-insert"],
|
461
464
|
"domainMessagesBuilder": [1, "domain-messages-builder"],
|
462
465
|
"ignoreReadOnlyFormFields": [4, "ignore-read-only-form-fields"],
|
463
|
-
"enableLockManger": [4, "enable-lock-manger"],
|
464
466
|
"setCustomFormTitle": [16],
|
465
467
|
"_dataUnit": [32],
|
466
468
|
"_dataState": [32],
|
@@ -243,7 +243,7 @@ function getFormatResponse(result) {
|
|
243
243
|
return ObjectUtils.stringToObject(response);
|
244
244
|
}
|
245
245
|
|
246
|
-
const DOC_MAX_WIDTH =
|
246
|
+
const DOC_MAX_WIDTH = 760;
|
247
247
|
function getVisibleColumns(columns) {
|
248
248
|
const visibleColumns = [];
|
249
249
|
let totalWidth = 0;
|
@@ -283,12 +283,19 @@ class ServerSideExporterStrategy {
|
|
283
283
|
const visibleColumns = getVisibleColumns(columns);
|
284
284
|
return visibleColumns;
|
285
285
|
}
|
286
|
+
async getColumns(resolveProps) {
|
287
|
+
var _a;
|
288
|
+
if ((_a = getOptionKey(resolveProps === null || resolveProps === void 0 ? void 0 : resolveProps.exportOption)) === null || _a === void 0 ? void 0 : _a.includes("PDF")) {
|
289
|
+
return await this.getParsedColumns();
|
290
|
+
}
|
291
|
+
return await this._provider.getColumnsMetadata();
|
292
|
+
}
|
286
293
|
async getParams(resolveProps) {
|
287
|
-
var _a, _b, _c, _d, _e, _f
|
294
|
+
var _a, _b, _c, _d, _e, _f;
|
288
295
|
const filters = (_b = (_a = this._provider).getFilters) === null || _b === void 0 ? void 0 : _b.call(_a);
|
289
|
-
const columns =
|
290
|
-
const sort = (
|
291
|
-
const resourceURI = (
|
296
|
+
const columns = await this.getColumns(resolveProps);
|
297
|
+
const sort = (_d = (_c = this._provider).getOrders) === null || _d === void 0 ? void 0 : _d.call(_c);
|
298
|
+
const resourceURI = (_f = (_e = this._provider).getResourceURI) === null || _f === void 0 ? void 0 : _f.call(_e);
|
292
299
|
const selectedIDs = this._provider.getSelectedIDs();
|
293
300
|
const option = resolveProps.exportOption;
|
294
301
|
const currentPageOptions = [
|
@@ -342,11 +349,17 @@ class ClientSideExporterStrategy {
|
|
342
349
|
const visibleColumns = getVisibleColumns(columns);
|
343
350
|
return visibleColumns;
|
344
351
|
}
|
345
|
-
async
|
352
|
+
async getColumns(resolveProps) {
|
346
353
|
var _a;
|
354
|
+
if ((_a = getOptionKey(resolveProps === null || resolveProps === void 0 ? void 0 : resolveProps.exportOption)) === null || _a === void 0 ? void 0 : _a.includes("PDF")) {
|
355
|
+
return await this.getParsedColumns();
|
356
|
+
}
|
357
|
+
return await this._provider.getColumnsMetadata();
|
358
|
+
}
|
359
|
+
async executeExport(resolveProps) {
|
347
360
|
const { methodName, gridTitle } = resolveProps;
|
348
361
|
const records = await this._provider.getRecords();
|
349
|
-
const columns =
|
362
|
+
const columns = await this.getColumns(resolveProps);
|
350
363
|
const [serviceName, processor] = this.getExecutor(methodName);
|
351
364
|
const payload = {
|
352
365
|
serviceName,
|