@sankhyalabs/sankhyablocks 8.2.0 → 8.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{ConfigStorage-e9d7fa82.js → ConfigStorage-c9ca6658.js} +4 -4
- package/dist/cjs/{DataFetcher-39b63a1e.js → DataFetcher-7694daf2.js} +58 -10
- package/dist/cjs/{SnkFormConfigManager-2f8eccd9.js → SnkFormConfigManager-fb684c0e.js} +2 -2
- package/dist/cjs/auth-fetcher-80818a0f.js +34 -0
- package/dist/cjs/{dataunit-fetcher-15a7cc88.js → dataunit-fetcher-1acab20d.js} +1 -1
- package/dist/cjs/{filter-bar-config-fetcher-24548cec.js → filter-bar-config-fetcher-f13a1aff.js} +1 -1
- package/dist/cjs/{form-config-fetcher-ab3ce222.js → form-config-fetcher-f10017bf.js} +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{pesquisa-fetcher-96c042aa.js → pesquisa-fetcher-c9d99342.js} +1 -1
- package/dist/cjs/{resource-fetcher-64102551.js → resource-fetcher-a6e6c5fd.js} +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button.cjs.entry.js +2 -2
- package/dist/cjs/snk-application.cjs.entry.js +10 -37
- package/dist/cjs/snk-attach.cjs.entry.js +2 -2
- package/dist/cjs/snk-crud.cjs.entry.js +9 -5
- package/dist/cjs/snk-data-exporter.cjs.entry.js +2 -2
- package/dist/cjs/{snk-data-unit-d5109a08.js → snk-data-unit-e89e07bd.js} +4 -3
- package/dist/cjs/snk-data-unit.cjs.entry.js +1 -1
- package/dist/cjs/snk-detail-view.cjs.entry.js +13 -22
- package/dist/cjs/snk-filter-bar.cjs.entry.js +5 -5
- package/dist/cjs/snk-filter-detail.cjs.entry.js +3 -3
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +5 -5
- package/dist/cjs/snk-form-config.cjs.entry.js +3 -3
- package/dist/cjs/snk-form.cjs.entry.js +6 -6
- package/dist/cjs/snk-grid-config.cjs.entry.js +5 -5
- package/dist/cjs/snk-grid.cjs.entry.js +9 -6
- package/dist/cjs/{snk-guides-viewer-8c9693aa.js → snk-guides-viewer-5da253af.js} +5 -6
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +8 -8
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +5 -5
- package/dist/cjs/snk-print-selector.cjs.entry.js +1 -1
- package/dist/cjs/snk-simple-crud.cjs.entry.js +5 -11
- package/dist/collection/components/snk-crud/snk-crud.js +26 -5
- package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +24 -14
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +20 -3
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +21 -3
- package/dist/collection/components/snk-grid/snk-grid.js +60 -2
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +21 -9
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +71 -10
- package/dist/components/DataFetcher.js +58 -10
- package/dist/components/auth-fetcher.js +32 -0
- package/dist/components/snk-application2.js +1 -29
- package/dist/components/snk-crud.js +8 -3
- package/dist/components/snk-data-unit2.js +5 -3
- package/dist/components/snk-detail-view2.js +10 -17
- package/dist/components/snk-grid2.js +7 -1
- package/dist/components/snk-simple-crud2.js +4 -9
- package/dist/esm/{ConfigStorage-1090289a.js → ConfigStorage-6887ede4.js} +4 -4
- package/dist/esm/{DataFetcher-a4ed43e7.js → DataFetcher-731430d9.js} +58 -10
- package/dist/esm/{SnkFormConfigManager-de537eca.js → SnkFormConfigManager-6acecf9f.js} +2 -2
- package/dist/esm/auth-fetcher-82d89fe6.js +32 -0
- package/dist/esm/{dataunit-fetcher-8d0bfa4a.js → dataunit-fetcher-ad7a1a3e.js} +1 -1
- package/dist/esm/{filter-bar-config-fetcher-2417b8cf.js → filter-bar-config-fetcher-553c5463.js} +1 -1
- package/dist/esm/{form-config-fetcher-4065db9a.js → form-config-fetcher-9560730a.js} +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{pesquisa-fetcher-7460b876.js → pesquisa-fetcher-27dc20ed.js} +1 -1
- package/dist/esm/{resource-fetcher-45a70066.js → resource-fetcher-0586b1fc.js} +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button.entry.js +2 -2
- package/dist/esm/snk-application.entry.js +8 -35
- package/dist/esm/snk-attach.entry.js +2 -2
- package/dist/esm/snk-crud.entry.js +9 -5
- package/dist/esm/snk-data-exporter.entry.js +2 -2
- package/dist/esm/{snk-data-unit-3a0bbfcb.js → snk-data-unit-8c4d944d.js} +4 -3
- package/dist/esm/snk-data-unit.entry.js +1 -1
- package/dist/esm/snk-detail-view.entry.js +13 -22
- package/dist/esm/snk-filter-bar.entry.js +5 -5
- package/dist/esm/snk-filter-detail.entry.js +3 -3
- package/dist/esm/snk-filter-modal-item.entry.js +5 -5
- package/dist/esm/snk-form-config.entry.js +3 -3
- package/dist/esm/snk-form.entry.js +6 -6
- package/dist/esm/snk-grid-config.entry.js +5 -5
- package/dist/esm/snk-grid.entry.js +9 -6
- package/dist/esm/{snk-guides-viewer-a6d39c18.js → snk-guides-viewer-d3623a1f.js} +5 -6
- package/dist/esm/snk-guides-viewer.entry.js +8 -8
- package/dist/esm/snk-personalized-filter.entry.js +5 -5
- package/dist/esm/snk-print-selector.entry.js +1 -1
- package/dist/esm/snk-simple-crud.entry.js +5 -11
- package/dist/sankhyablocks/{p-c6feb995.entry.js → p-000d073b.entry.js} +1 -1
- package/dist/sankhyablocks/{p-4514fc6a.entry.js → p-162f5d21.entry.js} +1 -1
- package/dist/sankhyablocks/{p-b978da60.js → p-1bed2c42.js} +1 -1
- package/dist/sankhyablocks/p-1dc76c50.js +1 -0
- package/dist/sankhyablocks/p-24b18442.entry.js +1 -0
- package/dist/sankhyablocks/{p-0fb83448.js → p-301d4e34.js} +1 -1
- package/dist/sankhyablocks/{p-9471cbc9.entry.js → p-4374bc89.entry.js} +1 -1
- package/dist/sankhyablocks/p-564efc43.js +1 -0
- package/dist/sankhyablocks/{p-d7c7a289.entry.js → p-5fe223c9.entry.js} +1 -1
- package/dist/sankhyablocks/p-61651a40.entry.js +1 -0
- package/dist/sankhyablocks/p-70d4a90a.entry.js +1 -0
- package/dist/sankhyablocks/{p-f7eded3a.entry.js → p-7bd353de.entry.js} +1 -1
- package/dist/sankhyablocks/{p-5994af77.js → p-837831c2.js} +2 -2
- package/dist/sankhyablocks/p-85ec10c9.entry.js +1 -0
- package/dist/sankhyablocks/{p-50c13cc8.entry.js → p-89d46727.entry.js} +1 -1
- package/dist/sankhyablocks/{p-52c6b2e7.js → p-8e8b5fc7.js} +1 -1
- package/dist/sankhyablocks/{p-847e6c20.js → p-8e96581f.js} +2 -2
- package/dist/sankhyablocks/p-9b2af526.entry.js +1 -0
- package/dist/sankhyablocks/{p-f3b7b69e.js → p-9db7e50a.js} +1 -1
- package/dist/sankhyablocks/{p-a42dd503.entry.js → p-a2f32d4e.entry.js} +1 -1
- package/dist/sankhyablocks/{p-7588f006.entry.js → p-a7eaea51.entry.js} +1 -1
- package/dist/sankhyablocks/{p-3d6f91c2.entry.js → p-a84b1ca2.entry.js} +1 -1
- package/dist/sankhyablocks/p-c32b9d7c.entry.js +1 -0
- package/dist/sankhyablocks/p-c3943e7e.entry.js +11 -0
- package/dist/sankhyablocks/p-c7d1e26a.js +1 -0
- package/dist/sankhyablocks/{p-6bb904bb.entry.js → p-cd40ab53.entry.js} +1 -1
- package/dist/sankhyablocks/{p-44e66c8d.js → p-d41198ff.js} +1 -1
- package/dist/sankhyablocks/{p-9d18017a.js → p-f6b98398.js} +1 -1
- package/dist/sankhyablocks/{p-6f0795c8.entry.js → p-f9f385eb.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-crud/snk-crud.d.ts +5 -0
- package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +5 -0
- package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +4 -0
- package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +4 -0
- package/dist/types/components/snk-grid/snk-grid.d.ts +13 -0
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +4 -0
- package/dist/types/components.d.ts +64 -0
- package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +1 -1
- package/package.json +1 -1
- package/dist/sankhyablocks/p-15aba6fb.entry.js +0 -11
- package/dist/sankhyablocks/p-21e7c08e.entry.js +0 -1
- package/dist/sankhyablocks/p-2861d44f.entry.js +0 -1
- package/dist/sankhyablocks/p-2d883fe9.entry.js +0 -1
- package/dist/sankhyablocks/p-4f4cd005.entry.js +0 -1
- package/dist/sankhyablocks/p-5df17074.js +0 -1
- package/dist/sankhyablocks/p-9edad923.js +0 -1
- package/dist/sankhyablocks/p-c945318c.entry.js +0 -1
- package/dist/sankhyablocks/p-ccbfb1cf.entry.js +0 -1
@@ -21,6 +21,7 @@ export class SnkGuidesViewer {
|
|
21
21
|
this.selectedGuide = undefined;
|
22
22
|
this.taskbarManager = undefined;
|
23
23
|
this.messagesBuilder = undefined;
|
24
|
+
this.canEdit = true;
|
24
25
|
this.presentationMode = undefined;
|
25
26
|
this._breadcrumbItems = [];
|
26
27
|
this._guides = undefined;
|
@@ -223,9 +224,7 @@ export class SnkGuidesViewer {
|
|
223
224
|
else {
|
224
225
|
detailBranch = this.selectedGuide;
|
225
226
|
}
|
226
|
-
content = this.wrapDetail(levels, h("snk-detail-view", { ref: (ref) => this._currentDetail = ref, dataUnitName: this.getDataUnitName(levels, childEntityName), onSnkDetailGuidesChange: (evt) => this.updateGuide(evt.detail), entityName: childEntityName, selectedForm: formName, branchGuide: detailBranch, guideItemPath: this._breadcrumbItems, key: `detail${detailId}`,
|
227
|
-
// canEdit={this.canEdit}
|
228
|
-
onSnkSwitchGuide: evt => this._guideNavigator.selectGuide(evt.detail) }));
|
227
|
+
content = this.wrapDetail(levels, h("snk-detail-view", { ref: (ref) => this._currentDetail = ref, dataUnitName: this.getDataUnitName(levels, childEntityName), onSnkDetailGuidesChange: (evt) => this.updateGuide(evt.detail), entityName: childEntityName, selectedForm: formName, branchGuide: detailBranch, guideItemPath: this._breadcrumbItems, key: `detail${detailId}`, canEdit: this.canEdit, onSnkSwitchGuide: evt => this._guideNavigator.selectGuide(evt.detail) }));
|
229
228
|
}
|
230
229
|
else {
|
231
230
|
const cardId = this.selectedGuide.id;
|
@@ -549,6 +548,24 @@ export class SnkGuidesViewer {
|
|
549
548
|
"text": "Respons\u00E1vel por flexibilizar e padronizar o uso de mensagens nos blocos de constru\u00E7\u00E3o."
|
550
549
|
}
|
551
550
|
},
|
551
|
+
"canEdit": {
|
552
|
+
"type": "boolean",
|
553
|
+
"mutable": false,
|
554
|
+
"complexType": {
|
555
|
+
"original": "boolean",
|
556
|
+
"resolved": "boolean",
|
557
|
+
"references": {}
|
558
|
+
},
|
559
|
+
"required": false,
|
560
|
+
"optional": false,
|
561
|
+
"docs": {
|
562
|
+
"tags": [],
|
563
|
+
"text": "Define se a edi\u00E7\u00E3o est\u00E1 habilitada na grid."
|
564
|
+
},
|
565
|
+
"attribute": "can-edit",
|
566
|
+
"reflect": false,
|
567
|
+
"defaultValue": "true"
|
568
|
+
},
|
552
569
|
"presentationMode": {
|
553
570
|
"type": "string",
|
554
571
|
"mutable": false,
|
@@ -11,9 +11,9 @@ export class SnkDataUnit {
|
|
11
11
|
const duState = this.buildDataState();
|
12
12
|
this.dataState = duState;
|
13
13
|
if (action.type === Action.DATA_SAVED) {
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
if (this.ignoreSaveMessage) {
|
15
|
+
return;
|
16
|
+
}
|
17
17
|
const msg = this.getMessage("snkDataUnit.saveInfo", action.payload.records[0]);
|
18
18
|
if (msg != undefined) {
|
19
19
|
this.showSuccessMessage(msg);
|
@@ -59,6 +59,7 @@ export class SnkDataUnit {
|
|
59
59
|
this.beforeSave = undefined;
|
60
60
|
this.afterSave = undefined;
|
61
61
|
this.useCancelConfirm = true;
|
62
|
+
this.ignoreSaveMessage = undefined;
|
62
63
|
this.configName = undefined;
|
63
64
|
}
|
64
65
|
observePageSize() {
|
@@ -590,6 +591,23 @@ export class SnkDataUnit {
|
|
590
591
|
"reflect": false,
|
591
592
|
"defaultValue": "true"
|
592
593
|
},
|
594
|
+
"ignoreSaveMessage": {
|
595
|
+
"type": "boolean",
|
596
|
+
"mutable": false,
|
597
|
+
"complexType": {
|
598
|
+
"original": "boolean",
|
599
|
+
"resolved": "boolean",
|
600
|
+
"references": {}
|
601
|
+
},
|
602
|
+
"required": false,
|
603
|
+
"optional": false,
|
604
|
+
"docs": {
|
605
|
+
"tags": [],
|
606
|
+
"text": "Respons\u00E1vel por evitar a mensagem de sucesso ao salvar."
|
607
|
+
},
|
608
|
+
"attribute": "ignore-save-message",
|
609
|
+
"reflect": false
|
610
|
+
},
|
593
611
|
"configName": {
|
594
612
|
"type": "string",
|
595
613
|
"mutable": false,
|
@@ -8,7 +8,6 @@ import TaskbarProcessor from '../snk-taskbar/processor/taskbar-processor';
|
|
8
8
|
import store from "../../lib/store";
|
9
9
|
import SnkMultiSelectionListDataSource from './filtercolumn/SnkMultiSelectionListDataSource';
|
10
10
|
import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
|
11
|
-
// import { IRecordValidator } from '@sankhyalabs/ezui/dist/types/utils/form/interfaces';
|
12
11
|
export class SnkGrid {
|
13
12
|
constructor() {
|
14
13
|
this._multiSelectionListDataSource = new SnkMultiSelectionListDataSource();
|
@@ -37,6 +36,9 @@ export class SnkGrid {
|
|
37
36
|
this.multipleSelection = undefined;
|
38
37
|
this.presentationMode = PresentationMode.PRIMARY;
|
39
38
|
this.messagesBuilder = undefined;
|
39
|
+
this.useEnterLikeTab = false;
|
40
|
+
this.recordsValidator = undefined;
|
41
|
+
this.canEdit = true;
|
40
42
|
}
|
41
43
|
/**
|
42
44
|
* Exibe a janela de configurações da grade.
|
@@ -305,7 +307,7 @@ export class SnkGrid {
|
|
305
307
|
return undefined;
|
306
308
|
}
|
307
309
|
return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, h("div", { class: "snk-grid__header ez-margin-bottom--medium" }, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder }), ((_b = (_a = this._snkFilterBar) === null || _a === void 0 ? void 0 : _a.filterConfig) === null || _b === void 0 ? void 0 : _b.length) > 0 &&
|
308
|
-
h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" }), h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton() })), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: () => this.gridDoubleClick.emit(), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, onComponentReady: () => this.onEzGridReady(), columnfilterDataSource: this._multiSelectionListDataSource, selectionToastConfig: this.selectionToastConfig }, h("snk-taskbar", { dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.actionsList })), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" })), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), application: this._application, selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig() }))));
|
310
|
+
h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" }), h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton() })), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: () => this.gridDoubleClick.emit(), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, onComponentReady: () => this.onEzGridReady(), columnfilterDataSource: this._multiSelectionListDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit }, h("snk-taskbar", { dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.actionsList })), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" })), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), application: this._application, selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig() }))));
|
309
311
|
}
|
310
312
|
static get is() { return "snk-grid"; }
|
311
313
|
static get encapsulation() { return "scoped"; }
|
@@ -501,6 +503,62 @@ export class SnkGrid {
|
|
501
503
|
"tags": [],
|
502
504
|
"text": "Respons\u00E1vel por flexibilizar e padronizar o uso de mensagens nos blocos de constru\u00E7\u00E3o."
|
503
505
|
}
|
506
|
+
},
|
507
|
+
"useEnterLikeTab": {
|
508
|
+
"type": "boolean",
|
509
|
+
"mutable": false,
|
510
|
+
"complexType": {
|
511
|
+
"original": "boolean",
|
512
|
+
"resolved": "boolean",
|
513
|
+
"references": {}
|
514
|
+
},
|
515
|
+
"required": false,
|
516
|
+
"optional": false,
|
517
|
+
"docs": {
|
518
|
+
"tags": [],
|
519
|
+
"text": "Quando verdadeiro, o ENTER far\u00E1 a navega\u00E7\u00E3o como se fosse a tecla TAB na grade."
|
520
|
+
},
|
521
|
+
"attribute": "use-enter-like-tab",
|
522
|
+
"reflect": false,
|
523
|
+
"defaultValue": "false"
|
524
|
+
},
|
525
|
+
"recordsValidator": {
|
526
|
+
"type": "unknown",
|
527
|
+
"mutable": false,
|
528
|
+
"complexType": {
|
529
|
+
"original": "IRecordValidator",
|
530
|
+
"resolved": "IRecordValidator",
|
531
|
+
"references": {
|
532
|
+
"IRecordValidator": {
|
533
|
+
"location": "import",
|
534
|
+
"path": "@sankhyalabs/ezui/dist/types/utils/form/interfaces"
|
535
|
+
}
|
536
|
+
}
|
537
|
+
},
|
538
|
+
"required": false,
|
539
|
+
"optional": false,
|
540
|
+
"docs": {
|
541
|
+
"tags": [],
|
542
|
+
"text": "Validador respons\u00E1vel por checar a integridade das informa\u00E7\u00F5es do registro."
|
543
|
+
}
|
544
|
+
},
|
545
|
+
"canEdit": {
|
546
|
+
"type": "boolean",
|
547
|
+
"mutable": false,
|
548
|
+
"complexType": {
|
549
|
+
"original": "boolean",
|
550
|
+
"resolved": "boolean",
|
551
|
+
"references": {}
|
552
|
+
},
|
553
|
+
"required": false,
|
554
|
+
"optional": false,
|
555
|
+
"docs": {
|
556
|
+
"tags": [],
|
557
|
+
"text": "Define se a edi\u00E7\u00E3o est\u00E1 habilitada na grid."
|
558
|
+
},
|
559
|
+
"attribute": "can-edit",
|
560
|
+
"reflect": false,
|
561
|
+
"defaultValue": "true"
|
504
562
|
}
|
505
563
|
};
|
506
564
|
}
|
@@ -11,11 +11,6 @@ export class SnkSimpleCrud {
|
|
11
11
|
this.REGULAR_DEFAULT_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER"];
|
12
12
|
this.REGULAR_SELECTED_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "DIVIDER"];
|
13
13
|
this._multiSelectionListDataSource = new SnkMultiSelectionListDataSource();
|
14
|
-
// /**
|
15
|
-
// * Quando verdadeiro, o ENTER fará a navegação como se fosse a tecla TAB na grade.
|
16
|
-
// */
|
17
|
-
// @Prop()
|
18
|
-
// useEnterLikeTab: boolean = false;
|
19
14
|
this._taskbarProcessor = new TaskbarProcessor({
|
20
15
|
"snkSimpleCrudTaskbar.form_regular": this.resolveInMemoryBtns(this.REGULAR_DEFAULT_BTNS).concat(TaskbarElement.GRID_MODE),
|
21
16
|
"snkSimpleCrudTaskbar.grid_regular": this.resolveInMemoryBtns(this.REGULAR_DEFAULT_BTNS).concat(TaskbarElement.FORM_MODE),
|
@@ -34,6 +29,7 @@ export class SnkSimpleCrud {
|
|
34
29
|
this.useCancelConfirm = true;
|
35
30
|
this.taskbarManager = undefined;
|
36
31
|
this.messagesBuilder = undefined;
|
32
|
+
this.useEnterLikeTab = false;
|
37
33
|
}
|
38
34
|
resolveInMemoryBtns(taskbarButtons) {
|
39
35
|
const newTaskBarConfig = [...taskbarButtons];
|
@@ -178,11 +174,9 @@ export class SnkSimpleCrud {
|
|
178
174
|
}
|
179
175
|
render() {
|
180
176
|
var _a;
|
181
|
-
return (h("snk-data-unit", { class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), onInsertionMode: () => this.goToView(VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail),
|
182
|
-
// ignoreSaveMessage={this._currentViewMode === VIEW_MODE.GRID}
|
183
|
-
onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail }, h("header", null, h("slot", { name: "snkSimpleCrudHeader" })), h("section", { class: "ez-flex ez-box ez-box--shadow" }, h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium ez-margin-bottom--large", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, slot: "leftButtons", presentationMode: PresentationMode.SECONDARY }), h("ez-view-stack", { class: "ez-flex ez-flex--column", ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, h("stack-item", null, h("ez-grid", { dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(VIEW_MODE.FORM), columnfilterDataSource: this.dataUnit.name.includes(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
|
177
|
+
return (h("snk-data-unit", { class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), onInsertionMode: () => this.goToView(VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail }, h("header", null, h("slot", { name: "snkSimpleCrudHeader" })), h("section", { class: "ez-flex ez-box ez-box--shadow" }, h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium ez-margin-bottom--large", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, slot: "leftButtons", presentationMode: PresentationMode.SECONDARY }), h("ez-view-stack", { class: "ez-flex ez-flex--column", ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, h("stack-item", null, h("ez-grid", { dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(VIEW_MODE.FORM), columnfilterDataSource: this.dataUnit.name.includes(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
|
184
178
|
? undefined
|
185
|
-
: this._multiSelectionListDataSource }, h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, h("ez-form", { dataUnit: this.dataUnit, config: this.formConfig }))))));
|
179
|
+
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab }, h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, h("ez-form", { dataUnit: this.dataUnit, config: this.formConfig }))))));
|
186
180
|
}
|
187
181
|
static get is() { return "snk-simple-crud"; }
|
188
182
|
static get encapsulation() { return "scoped"; }
|
@@ -375,6 +369,24 @@ export class SnkSimpleCrud {
|
|
375
369
|
"tags": [],
|
376
370
|
"text": "Respons\u00E1vel por flexibilizar e padronizar o uso de mensagens nos blocos de constru\u00E7\u00E3o."
|
377
371
|
}
|
372
|
+
},
|
373
|
+
"useEnterLikeTab": {
|
374
|
+
"type": "boolean",
|
375
|
+
"mutable": false,
|
376
|
+
"complexType": {
|
377
|
+
"original": "boolean",
|
378
|
+
"resolved": "boolean",
|
379
|
+
"references": {}
|
380
|
+
},
|
381
|
+
"required": false,
|
382
|
+
"optional": false,
|
383
|
+
"docs": {
|
384
|
+
"tags": [],
|
385
|
+
"text": "Quando verdadeiro, o ENTER far\u00E1 a navega\u00E7\u00E3o como se fosse a tecla TAB na grade."
|
386
|
+
},
|
387
|
+
"attribute": "use-enter-like-tab",
|
388
|
+
"reflect": false,
|
389
|
+
"defaultValue": "false"
|
378
390
|
}
|
379
391
|
};
|
380
392
|
}
|
@@ -1,3 +1,11 @@
|
|
1
|
+
var __asyncValues = (this && this.__asyncValues) || function (o) {
|
2
|
+
if (!Symbol.asyncIterator)
|
3
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
4
|
+
var m = o[Symbol.asyncIterator], i;
|
5
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
6
|
+
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
7
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
8
|
+
};
|
1
9
|
import { ApplicationContext, ErrorException, ObjectUtils, WarningException } from '@sankhyalabs/core';
|
2
10
|
import { batchRequests } from 'graphql-request';
|
3
11
|
import UrlUtils from "../../../lib/utils/urlutils";
|
@@ -134,18 +142,71 @@ export class DataFetcher {
|
|
134
142
|
}
|
135
143
|
return false;
|
136
144
|
}
|
137
|
-
|
145
|
+
async processServiceBrokerClientEvents(processParams) {
|
146
|
+
var _a, e_1, _b, _c, _d, e_2, _e, _f;
|
147
|
+
const { clientEvents, serviceName, payloadJson, accept, reject } = processParams;
|
138
148
|
if (!(clientEvents === null || clientEvents === void 0 ? void 0 : clientEvents.length)) {
|
139
149
|
return;
|
140
150
|
}
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
151
|
+
const recaller = new ServiceBrokerRecaller(serviceName, payloadJson, accept, reject);
|
152
|
+
try {
|
153
|
+
for (var _g = true, clientEvents_1 = __asyncValues(clientEvents), clientEvents_1_1; clientEvents_1_1 = await clientEvents_1.next(), _a = clientEvents_1_1.done, !_a;) {
|
154
|
+
_c = clientEvents_1_1.value;
|
155
|
+
_g = false;
|
156
|
+
try {
|
157
|
+
const clientEvent = _c;
|
158
|
+
if (DataFetcher.hasClientEvent(clientEvent.id)) {
|
159
|
+
const handlers = DataFetcher.clientEventsByID.get(clientEvent.id);
|
160
|
+
const handlerClientEvent = {
|
161
|
+
id: clientEvent.id,
|
162
|
+
content: clientEvent
|
163
|
+
};
|
164
|
+
try {
|
165
|
+
for (var _h = true, handlers_1 = (e_2 = void 0, __asyncValues(handlers)), handlers_1_1; handlers_1_1 = await handlers_1.next(), _d = handlers_1_1.done, !_d;) {
|
166
|
+
_f = handlers_1_1.value;
|
167
|
+
_h = false;
|
168
|
+
try {
|
169
|
+
const handler = _f;
|
170
|
+
await handler(handlerClientEvent, recaller);
|
171
|
+
}
|
172
|
+
finally {
|
173
|
+
_h = true;
|
174
|
+
}
|
175
|
+
}
|
176
|
+
}
|
177
|
+
catch (e_2_1) {
|
178
|
+
e_2 = { error: e_2_1 };
|
179
|
+
}
|
180
|
+
finally {
|
181
|
+
try {
|
182
|
+
if (!_h && !_d && (_e = handlers_1.return))
|
183
|
+
await _e.call(handlers_1);
|
184
|
+
}
|
185
|
+
finally {
|
186
|
+
if (e_2)
|
187
|
+
throw e_2.error;
|
188
|
+
}
|
189
|
+
}
|
190
|
+
}
|
191
|
+
}
|
192
|
+
finally {
|
193
|
+
_g = true;
|
194
|
+
}
|
147
195
|
}
|
148
|
-
}
|
196
|
+
}
|
197
|
+
catch (e_1_1) {
|
198
|
+
e_1 = { error: e_1_1 };
|
199
|
+
}
|
200
|
+
finally {
|
201
|
+
try {
|
202
|
+
if (!_g && !_a && (_b = clientEvents_1.return))
|
203
|
+
await _b.call(clientEvents_1);
|
204
|
+
}
|
205
|
+
finally {
|
206
|
+
if (e_1)
|
207
|
+
throw e_1.error;
|
208
|
+
}
|
209
|
+
}
|
149
210
|
}
|
150
211
|
processPrinting(payload) {
|
151
212
|
if ((payload === null || payload === void 0 ? void 0 : payload.pendingPrinting) === 'true') {
|
@@ -197,11 +258,12 @@ export class DataFetcher {
|
|
197
258
|
http.open("POST", url, true);
|
198
259
|
http.withCredentials = true;
|
199
260
|
http.send(ObjectUtils.objectToString(payloadJson));
|
200
|
-
http.onreadystatechange = () => {
|
261
|
+
http.onreadystatechange = async () => {
|
201
262
|
var _a;
|
202
263
|
if (http.readyState == 4 && http.status == 200) {
|
203
264
|
try {
|
204
265
|
const jsonResp = JSON.parse(http.responseText);
|
266
|
+
await this.processServiceBrokerClientEvents({ clientEvents: jsonResp === null || jsonResp === void 0 ? void 0 : jsonResp.clientEvents, serviceName, payloadJson, accept, reject });
|
205
267
|
if (this.isServiceBrokerError(jsonResp)) {
|
206
268
|
reject(this.processServiceBrokerErrorInfo(jsonResp));
|
207
269
|
}
|
@@ -214,7 +276,6 @@ export class DataFetcher {
|
|
214
276
|
(_a = this.application) === null || _a === void 0 ? void 0 : _a.info(jsonResp.statusMessage);
|
215
277
|
}
|
216
278
|
}
|
217
|
-
this.proccessServiceBorkerClientEvents(jsonResp === null || jsonResp === void 0 ? void 0 : jsonResp.clientEvents, serviceName, payloadJson, accept, reject);
|
218
279
|
this.processPrinting(jsonResp);
|
219
280
|
}
|
220
281
|
catch (err) {
|
@@ -6677,6 +6677,13 @@ class AppletImpressao {
|
|
6677
6677
|
}
|
6678
6678
|
}
|
6679
6679
|
|
6680
|
+
var __asyncValues = (undefined && undefined.__asyncValues) || function (o) {
|
6681
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
6682
|
+
var m = o[Symbol.asyncIterator], i;
|
6683
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
6684
|
+
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
6685
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
6686
|
+
};
|
6680
6687
|
class DataFetcher {
|
6681
6688
|
constructor() {
|
6682
6689
|
this.GRAPHQL_PATH = `/${window.MGE_MODULE_NAME || 'mgefin-bff'}/graphql`;
|
@@ -6806,18 +6813,59 @@ class DataFetcher {
|
|
6806
6813
|
}
|
6807
6814
|
return false;
|
6808
6815
|
}
|
6809
|
-
|
6816
|
+
async processServiceBrokerClientEvents(processParams) {
|
6817
|
+
var _a, e_1, _b, _c, _d, e_2, _e, _f;
|
6818
|
+
const { clientEvents, serviceName, payloadJson, accept, reject } = processParams;
|
6810
6819
|
if (!(clientEvents === null || clientEvents === void 0 ? void 0 : clientEvents.length)) {
|
6811
6820
|
return;
|
6812
6821
|
}
|
6813
|
-
|
6814
|
-
|
6815
|
-
|
6816
|
-
|
6817
|
-
|
6818
|
-
|
6822
|
+
const recaller = new ServiceBrokerRecaller(serviceName, payloadJson, accept, reject);
|
6823
|
+
try {
|
6824
|
+
for (var _g = true, clientEvents_1 = __asyncValues(clientEvents), clientEvents_1_1; clientEvents_1_1 = await clientEvents_1.next(), _a = clientEvents_1_1.done, !_a;) {
|
6825
|
+
_c = clientEvents_1_1.value;
|
6826
|
+
_g = false;
|
6827
|
+
try {
|
6828
|
+
const clientEvent = _c;
|
6829
|
+
if (DataFetcher.hasClientEvent(clientEvent.id)) {
|
6830
|
+
const handlers = DataFetcher.clientEventsByID.get(clientEvent.id);
|
6831
|
+
const handlerClientEvent = {
|
6832
|
+
id: clientEvent.id,
|
6833
|
+
content: clientEvent
|
6834
|
+
};
|
6835
|
+
try {
|
6836
|
+
for (var _h = true, handlers_1 = (e_2 = void 0, __asyncValues(handlers)), handlers_1_1; handlers_1_1 = await handlers_1.next(), _d = handlers_1_1.done, !_d;) {
|
6837
|
+
_f = handlers_1_1.value;
|
6838
|
+
_h = false;
|
6839
|
+
try {
|
6840
|
+
const handler = _f;
|
6841
|
+
await handler(handlerClientEvent, recaller);
|
6842
|
+
}
|
6843
|
+
finally {
|
6844
|
+
_h = true;
|
6845
|
+
}
|
6846
|
+
}
|
6847
|
+
}
|
6848
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
6849
|
+
finally {
|
6850
|
+
try {
|
6851
|
+
if (!_h && !_d && (_e = handlers_1.return)) await _e.call(handlers_1);
|
6852
|
+
}
|
6853
|
+
finally { if (e_2) throw e_2.error; }
|
6854
|
+
}
|
6855
|
+
}
|
6856
|
+
}
|
6857
|
+
finally {
|
6858
|
+
_g = true;
|
6859
|
+
}
|
6819
6860
|
}
|
6820
|
-
}
|
6861
|
+
}
|
6862
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
6863
|
+
finally {
|
6864
|
+
try {
|
6865
|
+
if (!_g && !_a && (_b = clientEvents_1.return)) await _b.call(clientEvents_1);
|
6866
|
+
}
|
6867
|
+
finally { if (e_1) throw e_1.error; }
|
6868
|
+
}
|
6821
6869
|
}
|
6822
6870
|
processPrinting(payload) {
|
6823
6871
|
if ((payload === null || payload === void 0 ? void 0 : payload.pendingPrinting) === 'true') {
|
@@ -6869,11 +6917,12 @@ class DataFetcher {
|
|
6869
6917
|
http.open("POST", url, true);
|
6870
6918
|
http.withCredentials = true;
|
6871
6919
|
http.send(ObjectUtils.objectToString(payloadJson));
|
6872
|
-
http.onreadystatechange = () => {
|
6920
|
+
http.onreadystatechange = async () => {
|
6873
6921
|
var _a;
|
6874
6922
|
if (http.readyState == 4 && http.status == 200) {
|
6875
6923
|
try {
|
6876
6924
|
const jsonResp = JSON.parse(http.responseText);
|
6925
|
+
await this.processServiceBrokerClientEvents({ clientEvents: jsonResp === null || jsonResp === void 0 ? void 0 : jsonResp.clientEvents, serviceName, payloadJson, accept, reject });
|
6877
6926
|
if (this.isServiceBrokerError(jsonResp)) {
|
6878
6927
|
reject(this.processServiceBrokerErrorInfo(jsonResp));
|
6879
6928
|
}
|
@@ -6886,7 +6935,6 @@ class DataFetcher {
|
|
6886
6935
|
(_a = this.application) === null || _a === void 0 ? void 0 : _a.info(jsonResp.statusMessage);
|
6887
6936
|
}
|
6888
6937
|
}
|
6889
|
-
this.proccessServiceBorkerClientEvents(jsonResp === null || jsonResp === void 0 ? void 0 : jsonResp.clientEvents, serviceName, payloadJson, accept, reject);
|
6890
6938
|
this.processPrinting(jsonResp);
|
6891
6939
|
}
|
6892
6940
|
catch (err) {
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import { ObjectUtils } from '@sankhyalabs/core';
|
2
|
+
import { R as ResourceFetcher } from './resource-fetcher.js';
|
3
|
+
|
4
|
+
class AuthFetcher extends ResourceFetcher {
|
5
|
+
getData(resourceID) {
|
6
|
+
const completePath = `cfg://auth/${resourceID}`;
|
7
|
+
return new Promise((resolve, reject) => {
|
8
|
+
this.loadResource(completePath)
|
9
|
+
.then((loadedResource) => {
|
10
|
+
let auth = ObjectUtils.stringToObject(loadedResource);
|
11
|
+
if (auth && typeof (auth) === 'object') {
|
12
|
+
resolve(auth);
|
13
|
+
}
|
14
|
+
}).catch((error) => {
|
15
|
+
reject(error);
|
16
|
+
});
|
17
|
+
});
|
18
|
+
}
|
19
|
+
}
|
20
|
+
var AutorizationType;
|
21
|
+
(function (AutorizationType) {
|
22
|
+
AutorizationType["INSERT"] = "I";
|
23
|
+
AutorizationType["UPDATE"] = "A";
|
24
|
+
AutorizationType["REMOVE"] = "E";
|
25
|
+
AutorizationType["SHOW"] = "C";
|
26
|
+
AutorizationType["CONFIG"] = "F";
|
27
|
+
AutorizationType["CONFIG_NUMBER"] = "N";
|
28
|
+
AutorizationType["CLONE"] = "D";
|
29
|
+
AutorizationType["CONFIG_GRID"] = "G";
|
30
|
+
})(AutorizationType || (AutorizationType = {}));
|
31
|
+
|
32
|
+
export { AutorizationType as A, AuthFetcher as a };
|
@@ -5,7 +5,7 @@ import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
5
5
|
import { P as PesquisaFetcher } from './pesquisa-fetcher.js';
|
6
6
|
import { G as GridConfigFetcher, C as ConfigStorage } from './ConfigStorage.js';
|
7
7
|
import { D as DataUnitFetcher } from './dataunit-fetcher.js';
|
8
|
-
import {
|
8
|
+
import { A as AutorizationType, a as AuthFetcher } from './auth-fetcher.js';
|
9
9
|
import { S as SnkMessageBuilder } from './SnkMessageBuilder.js';
|
10
10
|
import { d as defineCustomElement$1 } from './snk-pesquisa2.js';
|
11
11
|
|
@@ -226,34 +226,6 @@ class ParametersFetcher {
|
|
226
226
|
|
227
227
|
const _0x5b7870=_0x2202;(function(_0x42e134,_0x5d9727){const _0x185c97=_0x2202,_0x5854c7=_0x42e134();while(!![]){try{const _0x129d35=parseInt(_0x185c97(0x18f))/0x1*(-parseInt(_0x185c97(0x183))/0x2)+-parseInt(_0x185c97(0x191))/0x3+parseInt(_0x185c97(0x17d))/0x4*(-parseInt(_0x185c97(0x185))/0x5)+parseInt(_0x185c97(0x184))/0x6*(-parseInt(_0x185c97(0x182))/0x7)+parseInt(_0x185c97(0x17b))/0x8+parseInt(_0x185c97(0x18c))/0x9+parseInt(_0x185c97(0x17f))/0xa;if(_0x129d35===_0x5d9727)break;else _0x5854c7['push'](_0x5854c7['shift']());}catch(_0x4becb4){_0x5854c7['push'](_0x5854c7['shift']());}}}(_0xdfb1,0x44ac7));function _0x2202(_0x2eac1f,_0x170d27){const _0xdfb1b4=_0xdfb1();return _0x2202=function(_0x2202d7,_0x224df5){_0x2202d7=_0x2202d7-0x17a;let _0x4d54a9=_0xdfb1b4[_0x2202d7];return _0x4d54a9;},_0x2202(_0x2eac1f,_0x170d27);}function _0xdfb1(){const _0x2b9dc4=['true','863GKWjmo','parse','56355fjjjAm','isSup','putAccess','4324480sjuCdS','hasOwnProperty','239748okvJLB','name','6055770tXeRaU','actions','forEach','7RPRvzn','1042CHxkUw','2988126NIwRMm','20MTNzmH','authorizationSf','item','string','hasAccess','isArray','Objeto\x20não\x20pode\x20ser\x20indefinido.','3071943fWslZp','parseFromJSON'];_0xdfb1=function(){return _0x2b9dc4;};return _0xdfb1();}class MGEAuthorization{[_0x5b7870(0x18d)](_0x37e96b){const _0x580407=_0x5b7870;_0x37e96b=utxt(_0x37e96b[_0x580407(0x186)]);typeof _0x37e96b==_0x580407(0x188)&&(_0x37e96b=JSON[_0x580407(0x190)](_0x37e96b));if(_0x37e96b==undefined)throw Error(_0x580407(0x18b));const _0x291d34=new MGEAuthorizationData(_0x37e96b[_0x580407(0x192)]==='S'||_0x37e96b[_0x580407(0x192)]===!![]);return Array[_0x580407(0x18a)](_0x37e96b[_0x580407(0x187)])&&_0x37e96b[_0x580407(0x187)][_0x580407(0x181)](_0x58a748=>_0x291d34['putAccess'](_0x58a748[_0x580407(0x17e)],String(_0x58a748['status'])==_0x580407(0x18e))),_0x291d34;}}class MGEAuthorizationData{constructor(_0x51ec5d){const _0x2c8472=_0x5b7870;this['isSup']=_0x51ec5d,this[_0x2c8472(0x180)]={};}[_0x5b7870(0x17a)](_0x5bd0f2,_0x2ef465){const _0x40d701=_0x5b7870;this[_0x40d701(0x180)][_0x5bd0f2]=_0x2ef465;}[_0x5b7870(0x189)](_0x4fd772){const _0x3707c1=_0x5b7870;if(this[_0x3707c1(0x192)])return !![];let _0x25e60a=!![];return this[_0x3707c1(0x180)][_0x3707c1(0x17c)](_0x4fd772)&&(_0x25e60a=this['actions'][_0x4fd772]),_0x25e60a;}['isUserSup'](){return this['isSup'];}}
|
228
228
|
|
229
|
-
class AuthFetcher extends ResourceFetcher {
|
230
|
-
getData(resourceID) {
|
231
|
-
const completePath = `cfg://auth/${resourceID}`;
|
232
|
-
return new Promise((resolve, reject) => {
|
233
|
-
this.loadResource(completePath)
|
234
|
-
.then((loadedResource) => {
|
235
|
-
let auth = ObjectUtils.stringToObject(loadedResource);
|
236
|
-
if (auth && typeof (auth) === 'object') {
|
237
|
-
resolve(auth);
|
238
|
-
}
|
239
|
-
}).catch((error) => {
|
240
|
-
reject(error);
|
241
|
-
});
|
242
|
-
});
|
243
|
-
}
|
244
|
-
}
|
245
|
-
var AutorizationType;
|
246
|
-
(function (AutorizationType) {
|
247
|
-
AutorizationType["INSERT"] = "I";
|
248
|
-
AutorizationType["UPDATE"] = "A";
|
249
|
-
AutorizationType["REMOVE"] = "E";
|
250
|
-
AutorizationType["SHOW"] = "C";
|
251
|
-
AutorizationType["CONFIG"] = "F";
|
252
|
-
AutorizationType["CONFIG_NUMBER"] = "N";
|
253
|
-
AutorizationType["CLONE"] = "D";
|
254
|
-
AutorizationType["CONFIG_GRID"] = "G";
|
255
|
-
})(AutorizationType || (AutorizationType = {}));
|
256
|
-
|
257
229
|
const snkApplicationCss = ".sc-snk-application-h{display:flex;flex-direction:column;height:100%}";
|
258
230
|
|
259
231
|
const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
@@ -5,6 +5,7 @@ import './DataFetcher.js';
|
|
5
5
|
import './pesquisa-fetcher.js';
|
6
6
|
import { P as PresentationMode } from './index2.js';
|
7
7
|
import { V as VIEW_MODE } from './constants.js';
|
8
|
+
import { A as AutorizationType } from './auth-fetcher.js';
|
8
9
|
import { d as defineCustomElement$v } from './snk-actions-button2.js';
|
9
10
|
import { d as defineCustomElement$u } from './snk-attach2.js';
|
10
11
|
import { d as defineCustomElement$t } from './snk-config-options2.js';
|
@@ -48,6 +49,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
48
49
|
this._dataState = undefined;
|
49
50
|
this.attachmentRegisterKey = undefined;
|
50
51
|
this._currentViewMode = VIEW_MODE.GRID;
|
52
|
+
this._canEdit = undefined;
|
51
53
|
this.configName = undefined;
|
52
54
|
this.selectionToastConfig = undefined;
|
53
55
|
this.showActionButtons = false;
|
@@ -58,6 +60,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
58
60
|
this.multipleSelection = true;
|
59
61
|
this.presentationMode = PresentationMode.PRIMARY;
|
60
62
|
this.messagesBuilder = undefined;
|
63
|
+
this.useEnterLikeTab = false;
|
61
64
|
}
|
62
65
|
/**
|
63
66
|
* Usado para alternar a visão entre GRID e FORM externamente.
|
@@ -141,7 +144,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
141
144
|
}
|
142
145
|
componentWillLoad() {
|
143
146
|
const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
144
|
-
|
147
|
+
application.hasAccess(AutorizationType.UPDATE).then(canEdit => this._canEdit = canEdit);
|
145
148
|
let parent = this._element.parentElement;
|
146
149
|
while (parent) {
|
147
150
|
if (parent.tagName.toUpperCase() === "SNK-DATA-UNIT") {
|
@@ -188,8 +191,8 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
188
191
|
this.configuratorCancel.emit();
|
189
192
|
}
|
190
193
|
render() {
|
191
|
-
|
192
|
-
return (h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", null, h("snk-grid", { ref: (ref) => this._snkGrid = ref, "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, selectionToastConfig: this.selectionToastConfig }, 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" }, 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') }, h("div", { slot: "SnkConfigContainerSlot" }, h("slot", { name: "SnkConfigContainerSlot" })))));
|
194
|
+
this._snkDataUnit.ignoreSaveMessage = this._currentViewMode === VIEW_MODE.GRID;
|
195
|
+
return (h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", null, h("snk-grid", { ref: (ref) => this._snkGrid = ref, "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, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit }, 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 }, 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') }, h("div", { slot: "SnkConfigContainerSlot" }, h("slot", { name: "SnkConfigContainerSlot" })))));
|
193
196
|
}
|
194
197
|
get _element() { return this; }
|
195
198
|
static get watchers() { return {
|
@@ -207,10 +210,12 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
207
210
|
"multipleSelection": [4, "multiple-selection"],
|
208
211
|
"presentationMode": [1, "presentation-mode"],
|
209
212
|
"messagesBuilder": [1040],
|
213
|
+
"useEnterLikeTab": [4, "use-enter-like-tab"],
|
210
214
|
"_dataUnit": [32],
|
211
215
|
"_dataState": [32],
|
212
216
|
"attachmentRegisterKey": [32],
|
213
217
|
"_currentViewMode": [32],
|
218
|
+
"_canEdit": [32],
|
214
219
|
"goToView": [64],
|
215
220
|
"openConfigurator": [64],
|
216
221
|
"closeConfigurator": [64],
|
@@ -21,9 +21,9 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
21
21
|
const duState = this.buildDataState();
|
22
22
|
this.dataState = duState;
|
23
23
|
if (action.type === Action.DATA_SAVED) {
|
24
|
-
|
25
|
-
|
26
|
-
|
24
|
+
if (this.ignoreSaveMessage) {
|
25
|
+
return;
|
26
|
+
}
|
27
27
|
const msg = this.getMessage("snkDataUnit.saveInfo", action.payload.records[0]);
|
28
28
|
if (msg != undefined) {
|
29
29
|
this.showSuccessMessage(msg);
|
@@ -69,6 +69,7 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
69
69
|
this.beforeSave = undefined;
|
70
70
|
this.afterSave = undefined;
|
71
71
|
this.useCancelConfirm = true;
|
72
|
+
this.ignoreSaveMessage = undefined;
|
72
73
|
this.configName = undefined;
|
73
74
|
}
|
74
75
|
observePageSize() {
|
@@ -433,6 +434,7 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
433
434
|
"beforeSave": [16],
|
434
435
|
"afterSave": [16],
|
435
436
|
"useCancelConfirm": [4, "use-cancel-confirm"],
|
437
|
+
"ignoreSaveMessage": [4, "ignore-save-message"],
|
436
438
|
"configName": [1, "config-name"],
|
437
439
|
"getDataUnit": [64],
|
438
440
|
"getSelectedRecordsIDsInfo": [64]
|