@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-38445.1 → 0.0.0-bugfix-dev-KB-65214.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{ConfigStorage-942ce74b.js → ConfigStorage-e49214c6.js} +3 -2
- package/dist/cjs/{DataFetcher-313debd8.js → DataFetcher-77729a93.js} +7 -2
- package/dist/cjs/{IExporterProvider-597949f9.js → IExporterProvider-10b7fed5.js} +4 -4
- package/dist/cjs/{SnkFormConfigManager-1b13bacd.js → SnkFormConfigManager-beebf47a.js} +7 -9
- package/dist/cjs/{SnkMessageBuilder-722b104e.js → SnkMessageBuilder-cceebbae.js} +2 -2
- package/dist/cjs/{auth-fetcher-54f5ff9d.js → auth-fetcher-29bb791c.js} +1 -1
- package/dist/cjs/{dataunit-fetcher-688d3f05.js → dataunit-fetcher-d4873076.js} +1 -1
- package/dist/cjs/{form-config-fetcher-2dd00e5b.js → form-config-fetcher-feb08214.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{pesquisa-fetcher-680e198f.js → pesquisa-fetcher-a1d0353f.js} +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button_4.cjs.entry.js +5 -5
- package/dist/cjs/snk-application.cjs.entry.js +7 -7
- package/dist/cjs/snk-attach.cjs.entry.js +5 -5
- package/dist/cjs/snk-crud.cjs.entry.js +11 -6
- package/dist/cjs/snk-data-exporter.cjs.entry.js +8 -8
- package/dist/cjs/{snk-data-unit-685272e7.js → snk-data-unit-f0221097.js} +21 -10
- package/dist/cjs/snk-data-unit.cjs.entry.js +4 -4
- package/dist/cjs/snk-detail-view.cjs.entry.js +9 -10
- package/dist/cjs/snk-exporter-email-sender.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-bar.cjs.entry.js +3 -3
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
- package/dist/cjs/snk-form-config.cjs.entry.js +3 -3
- package/dist/cjs/snk-form.cjs.entry.js +4 -4
- package/dist/cjs/snk-grid.cjs.entry.js +6 -6
- package/dist/cjs/{snk-guides-viewer-67605336.js → snk-guides-viewer-aafc3073.js} +12 -7
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +7 -7
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
- package/dist/cjs/snk-simple-crud.cjs.entry.js +11 -10
- package/dist/collection/components/snk-crud/snk-crud.js +57 -1
- package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +1 -2
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +22 -2
- package/dist/collection/components/snk-data-exporter/exporter-email-sender/options-step.js +1 -1
- package/dist/collection/components/snk-data-exporter/structure/ItemBuilder.js +2 -2
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +36 -8
- package/dist/collection/components/snk-form-config/SnkFormConfigManager.js +5 -7
- package/dist/collection/components/snk-form-config/snk-form-config.js +1 -1
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +21 -3
- package/dist/collection/lib/configs/ConfigStorage.js +1 -0
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +8 -3
- package/dist/collection/lib/message/resources/snk-data-unit.msg.js +1 -1
- package/dist/collection/lib/message/resources/snk-exporter.msg.js +1 -1
- package/dist/components/ConfigStorage.js +1 -0
- package/dist/components/DataFetcher.js +8 -3
- package/dist/components/SnkFormConfigManager.js +5 -7
- package/dist/components/SnkMessageBuilder.js +2 -2
- package/dist/components/snk-crud.js +8 -1
- package/dist/components/snk-data-exporter2.js +2 -2
- package/dist/components/snk-data-unit2.js +20 -8
- package/dist/components/snk-detail-view2.js +9 -4
- package/dist/components/snk-exporter-email-sender2.js +1 -1
- package/dist/components/snk-form-config2.js +1 -1
- package/dist/components/snk-simple-crud2.js +5 -3
- package/dist/esm/{ConfigStorage-86187da3.js → ConfigStorage-e476378d.js} +3 -2
- package/dist/esm/{DataFetcher-c1baf61d.js → DataFetcher-773a3e4b.js} +8 -3
- package/dist/esm/{IExporterProvider-63a188b6.js → IExporterProvider-d597f27d.js} +4 -4
- package/dist/esm/{SnkFormConfigManager-d4554df9.js → SnkFormConfigManager-298cd647.js} +7 -9
- package/dist/esm/{SnkMessageBuilder-89925609.js → SnkMessageBuilder-ae87b754.js} +2 -2
- package/dist/esm/{auth-fetcher-039abba3.js → auth-fetcher-a411f73c.js} +1 -1
- package/dist/esm/{dataunit-fetcher-264191b2.js → dataunit-fetcher-3d2ec959.js} +1 -1
- package/dist/esm/{form-config-fetcher-30fb808f.js → form-config-fetcher-e0382e5a.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{pesquisa-fetcher-03c8f919.js → pesquisa-fetcher-a87445a0.js} +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button_4.entry.js +5 -5
- package/dist/esm/snk-application.entry.js +7 -7
- package/dist/esm/snk-attach.entry.js +5 -5
- package/dist/esm/snk-crud.entry.js +11 -6
- package/dist/esm/snk-data-exporter.entry.js +8 -8
- package/dist/esm/{snk-data-unit-63f83504.js → snk-data-unit-1ef94aef.js} +21 -10
- package/dist/esm/snk-data-unit.entry.js +4 -4
- package/dist/esm/snk-detail-view.entry.js +9 -10
- package/dist/esm/snk-exporter-email-sender.entry.js +1 -1
- package/dist/esm/snk-filter-bar.entry.js +3 -3
- package/dist/esm/snk-filter-modal-item.entry.js +3 -3
- package/dist/esm/snk-form-config.entry.js +3 -3
- package/dist/esm/snk-form.entry.js +4 -4
- package/dist/esm/snk-grid.entry.js +6 -6
- package/dist/esm/{snk-guides-viewer-151f6091.js → snk-guides-viewer-62124f3d.js} +12 -7
- package/dist/esm/snk-guides-viewer.entry.js +7 -7
- package/dist/esm/snk-personalized-filter.entry.js +3 -3
- package/dist/esm/snk-simple-crud.entry.js +11 -10
- package/dist/sankhyablocks/{p-fe79f83a.js → p-091ce761.js} +1 -1
- package/dist/sankhyablocks/p-0c68f40f.entry.js +1 -0
- package/dist/sankhyablocks/{p-913a9979.js → p-0cd3c0a9.js} +1 -1
- package/dist/sankhyablocks/{p-82a0bfb0.entry.js → p-162b9a59.entry.js} +2 -2
- package/dist/sankhyablocks/p-16a1dd18.entry.js +1 -0
- package/dist/sankhyablocks/{p-df5451c7.js → p-181975f1.js} +1 -1
- package/dist/sankhyablocks/{p-af8efd95.js → p-25f1fc39.js} +1 -1
- package/dist/sankhyablocks/{p-8fc470e5.entry.js → p-2e9c764c.entry.js} +1 -1
- package/dist/sankhyablocks/{p-aff76a53.js → p-3287a6cc.js} +2 -2
- package/dist/sankhyablocks/{p-bad55caa.entry.js → p-421bec84.entry.js} +1 -1
- package/dist/sankhyablocks/{p-7505da04.entry.js → p-42f7b05d.entry.js} +1 -1
- package/dist/sankhyablocks/p-51999ab5.entry.js +1 -0
- package/dist/sankhyablocks/{p-19c18d06.entry.js → p-52a6a293.entry.js} +1 -1
- package/dist/sankhyablocks/p-594bc21d.js +1 -0
- package/dist/sankhyablocks/p-5f016aed.js +1 -0
- package/dist/sankhyablocks/{p-47b60deb.entry.js → p-62f34e6f.entry.js} +1 -1
- package/dist/sankhyablocks/p-684a2590.entry.js +1 -0
- package/dist/sankhyablocks/p-70001ac1.js +1 -0
- package/dist/sankhyablocks/p-74c665d5.entry.js +1 -0
- package/dist/sankhyablocks/{p-3a212712.js → p-76a65660.js} +1 -1
- package/dist/sankhyablocks/p-7c4aabe2.js +1 -0
- package/dist/sankhyablocks/{p-c5268346.entry.js → p-8c1ff936.entry.js} +1 -1
- package/dist/sankhyablocks/p-939e15d3.entry.js +1 -0
- package/dist/sankhyablocks/{p-a1d72395.entry.js → p-9dfda04a.entry.js} +1 -1
- package/dist/sankhyablocks/{p-eae7a817.entry.js → p-bd008859.entry.js} +1 -1
- package/dist/sankhyablocks/p-c273d6ee.js +1 -0
- package/dist/sankhyablocks/p-d65d98ed.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-crud/snk-crud.d.ts +9 -0
- package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +5 -0
- package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +6 -1
- package/dist/types/components/snk-form-config/SnkFormConfigManager.d.ts +2 -2
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +4 -0
- package/dist/types/components.d.ts +41 -0
- package/package.json +1 -1
- package/dist/sankhyablocks/p-14a08904.entry.js +0 -1
- package/dist/sankhyablocks/p-14b9f964.entry.js +0 -1
- package/dist/sankhyablocks/p-219f888d.entry.js +0 -1
- package/dist/sankhyablocks/p-75f83d1d.entry.js +0 -1
- package/dist/sankhyablocks/p-7a337364.js +0 -1
- package/dist/sankhyablocks/p-829d4045.js +0 -1
- package/dist/sankhyablocks/p-941bf3ef.entry.js +0 -1
- package/dist/sankhyablocks/p-b4b21558.entry.js +0 -1
- package/dist/sankhyablocks/p-c053256c.entry.js +0 -1
- package/dist/sankhyablocks/p-cefba299.js +0 -1
- package/dist/sankhyablocks/p-dc7c9047.js +0 -1
- package/dist/sankhyablocks/p-fcac4dfc.js +0 -1
|
@@ -27,6 +27,7 @@ export class SnkGuidesViewer {
|
|
|
27
27
|
this.resourceID = undefined;
|
|
28
28
|
this.detailTaskbarCustomContainerId = undefined;
|
|
29
29
|
this.formLegacyConfigName = undefined;
|
|
30
|
+
this.getCustomTitle = undefined;
|
|
30
31
|
this._hasToCreateFieldSearch = true;
|
|
31
32
|
this._breadcrumbItems = [];
|
|
32
33
|
this._guides = undefined;
|
|
@@ -113,7 +114,7 @@ export class SnkGuidesViewer {
|
|
|
113
114
|
}
|
|
114
115
|
onContentCardChanged(evt) {
|
|
115
116
|
SnkGuidesViewer.updateContentCard(evt.detail.formName, evt.detail.cardConfig, evt.detail.propertyChanged, this._configManager)
|
|
116
|
-
.then(() => this.masterFormConfig = this._configManager.getConfig(this.
|
|
117
|
+
.then(() => this.masterFormConfig = this._configManager.getConfig(this.dataUnit));
|
|
117
118
|
}
|
|
118
119
|
/**
|
|
119
120
|
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
|
@@ -464,6 +465,10 @@ export class SnkGuidesViewer {
|
|
|
464
465
|
}
|
|
465
466
|
return "";
|
|
466
467
|
}
|
|
468
|
+
getTitle() {
|
|
469
|
+
var _a, _b;
|
|
470
|
+
return (_b = (_a = this.getCustomTitle) === null || _a === void 0 ? void 0 : _a.call(this)) !== null && _b !== void 0 ? _b : this.getMessage("snkCrud.title");
|
|
471
|
+
}
|
|
467
472
|
componentDidLoad() {
|
|
468
473
|
this.dataUnit.subscribe(this.dataUnitActionHandler.bind(this));
|
|
469
474
|
}
|
|
@@ -477,7 +482,7 @@ export class SnkGuidesViewer {
|
|
|
477
482
|
}
|
|
478
483
|
this.loadTaskbarProcessor();
|
|
479
484
|
const showGuides = this._guides && (this._guides.length > 1);
|
|
480
|
-
return (h("section", { class: "snk-guides-viewer", ref: ref => this._container = ref, tabindex: -1 }, h("div", { class: "ez-row snk-guides-viewer__header" }, h("div", { class: "snk-guides-viewer__header-breadcrumb ez-flex--align-items-center ez-flex-item--align-center ez-padding-left--large", key: "header" }, h("ez-button", { onClick: () => this.exitViewer(), title: this.getMessage("snkCrud.goBackTitle"), mode: "icon", iconName: "arrow_back", class: "ez-padding-right--medium", size: "small" }), h("div", { class: "ez-flex ez-flex--column ez-flex-item--auto" }, h("h1", { class: "ez-title ez-title--primary ez-title--xlarge" }, this.
|
|
485
|
+
return (h("section", { class: "snk-guides-viewer", ref: ref => this._container = ref, tabindex: -1 }, h("div", { class: "ez-row snk-guides-viewer__header" }, h("div", { class: "snk-guides-viewer__header-breadcrumb ez-flex--align-items-center ez-flex-item--align-center ez-padding-left--large", key: "header" }, h("ez-button", { onClick: () => this.exitViewer(), title: this.getMessage("snkCrud.goBackTitle"), mode: "icon", iconName: "arrow_back", class: "ez-padding-right--medium", size: "small" }), h("div", { class: "ez-flex ez-flex--column ez-flex-item--auto" }, h("h1", { class: "ez-title ez-title--primary ez-title--xlarge" }, this.getTitle()), ((_a = this._breadcrumbItems) === null || _a === void 0 ? void 0 : _a.length) > 1 &&
|
|
481
486
|
h("div", { class: "ez-margin-top--extra-small" }, h("ez-breadcrumb", Object.assign({ items: this._breadcrumbItems, onSelectedItem: (evt) => this.onBreadcrumbClickHandler(evt === null || evt === void 0 ? void 0 : evt.detail) }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("breadcrumb")}` }))))), this.presentationMode != PresentationMode.SECONDARY && this.buildTaskBar()), h("div", { class: "snk-guides-viewer__container" }, showGuides ?
|
|
482
487
|
h("ez-guide-navigator", { ref: (ref) => this._guideNavigator = ref, class: "snk-guides-viewer__guide-navigator", items: this._guides, selectedId: this.selectedGuide ? this.selectedGuide.id : undefined, onEzSelectionChange: evt => this.updateSelectedGuideHandler(evt.detail) })
|
|
483
488
|
:
|
|
@@ -794,6 +799,21 @@ export class SnkGuidesViewer {
|
|
|
794
799
|
},
|
|
795
800
|
"attribute": "form-legacy-config-name",
|
|
796
801
|
"reflect": false
|
|
802
|
+
},
|
|
803
|
+
"getCustomTitle": {
|
|
804
|
+
"type": "unknown",
|
|
805
|
+
"mutable": false,
|
|
806
|
+
"complexType": {
|
|
807
|
+
"original": "() => string",
|
|
808
|
+
"resolved": "() => string",
|
|
809
|
+
"references": {}
|
|
810
|
+
},
|
|
811
|
+
"required": false,
|
|
812
|
+
"optional": false,
|
|
813
|
+
"docs": {
|
|
814
|
+
"tags": [],
|
|
815
|
+
"text": "Fornece uma fun\u00E7\u00E3o para obter um t\u00EDtulo customizado do formul\u00E1rio."
|
|
816
|
+
}
|
|
797
817
|
}
|
|
798
818
|
};
|
|
799
819
|
}
|
|
@@ -4,7 +4,7 @@ export const OptionsStep = ({ getMessage, changeInfo, data }) => {
|
|
|
4
4
|
const selectionCount = (data === null || data === void 0 ? void 0 : data.selectedRows) || 0;
|
|
5
5
|
const formatOptions = [
|
|
6
6
|
{ label: getMessage("snkExporter.emailSenderOptStep_formatPDF"), value: "pdf" },
|
|
7
|
-
{ label: getMessage("snkExporter.
|
|
7
|
+
{ label: getMessage("snkExporter.emailSenderOptStep_formatXLS"), value: "xls" }
|
|
8
8
|
];
|
|
9
9
|
const typeOptions = [
|
|
10
10
|
{ label: getMessage("snkExporter.emailSenderOptStep_allData"), value: "all" },
|
|
@@ -110,7 +110,7 @@ export class ItemBuilder {
|
|
|
110
110
|
getExportToXLS(groupName) {
|
|
111
111
|
return {
|
|
112
112
|
id: DataExporterOption.EXPORT_TO_XLS,
|
|
113
|
-
label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.
|
|
113
|
+
label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.xls)`,
|
|
114
114
|
group: groupName
|
|
115
115
|
};
|
|
116
116
|
}
|
|
@@ -153,7 +153,7 @@ export class ItemBuilder {
|
|
|
153
153
|
getExportPageToXLS() {
|
|
154
154
|
return {
|
|
155
155
|
id: DataExporterOption.EXPORT_PAGE_TO_XLS,
|
|
156
|
-
label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.
|
|
156
|
+
label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.xls)`
|
|
157
157
|
};
|
|
158
158
|
}
|
|
159
159
|
/**
|
|
@@ -54,6 +54,7 @@ export class SnkDataUnit {
|
|
|
54
54
|
this.ignoreSaveMessage = undefined;
|
|
55
55
|
this.configName = undefined;
|
|
56
56
|
this.resourceID = undefined;
|
|
57
|
+
this.domainMessagesBuilder = undefined;
|
|
57
58
|
}
|
|
58
59
|
observePageSize() {
|
|
59
60
|
if (this.dataUnit) {
|
|
@@ -470,7 +471,8 @@ export class SnkDataUnit {
|
|
|
470
471
|
if (this.ignoreSaveMessage) {
|
|
471
472
|
return;
|
|
472
473
|
}
|
|
473
|
-
const
|
|
474
|
+
const saveOperation = action.payload.changes[0]._operation.toLowerCase();
|
|
475
|
+
const msg = this.getMessage("snkDataUnit.saveInfo", action.payload.records[0], saveOperation);
|
|
474
476
|
if (msg != undefined) {
|
|
475
477
|
this.showSuccessMessage(msg);
|
|
476
478
|
}
|
|
@@ -501,10 +503,13 @@ export class SnkDataUnit {
|
|
|
501
503
|
* - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
|
|
502
504
|
* Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-data-unit.msg.ts"
|
|
503
505
|
*/
|
|
504
|
-
getMessage(key, params = undefined) {
|
|
506
|
+
getMessage(key, params = undefined, customOperation) {
|
|
505
507
|
if (!params) {
|
|
506
508
|
params = this.getMessageParams();
|
|
507
509
|
}
|
|
510
|
+
if (customOperation) {
|
|
511
|
+
this.messagesBuilder.currentOperation = customOperation;
|
|
512
|
+
}
|
|
508
513
|
return this.messagesBuilder.getMessage(key, params);
|
|
509
514
|
}
|
|
510
515
|
getMessageParams() {
|
|
@@ -535,7 +540,7 @@ export class SnkDataUnit {
|
|
|
535
540
|
return await this._application.getDataUnit(this.entityName, cacheName, null, this.configName, this.resourceID);
|
|
536
541
|
}
|
|
537
542
|
}
|
|
538
|
-
async loadDataUnit() {
|
|
543
|
+
async loadDataUnit(forceMetadataLoad = true) {
|
|
539
544
|
var _a;
|
|
540
545
|
if (this.dataUnit == null && this._application && this.entityName) {
|
|
541
546
|
this.dataUnit = await this.getDataUnitParentOrChild();
|
|
@@ -545,7 +550,8 @@ export class SnkDataUnit {
|
|
|
545
550
|
this.dataUnit.unsubscribe(this._dataUnitObserver);
|
|
546
551
|
this.dataUnit.addInterceptor(this);
|
|
547
552
|
this.dataUnit.subscribe(this._dataUnitObserver);
|
|
548
|
-
|
|
553
|
+
if (forceMetadataLoad || !this.dataUnit.metadata)
|
|
554
|
+
await this.dataUnit.loadMetadata();
|
|
549
555
|
if ((_a = this.dataUnit.records) === null || _a === void 0 ? void 0 : _a.length) {
|
|
550
556
|
this.getMetadataByRow(this.dataUnit);
|
|
551
557
|
}
|
|
@@ -611,6 +617,13 @@ export class SnkDataUnit {
|
|
|
611
617
|
parent = parent.parentElement;
|
|
612
618
|
}
|
|
613
619
|
}
|
|
620
|
+
instanceMessagesBuilder() {
|
|
621
|
+
var _a;
|
|
622
|
+
if (this.messagesBuilder) {
|
|
623
|
+
return;
|
|
624
|
+
}
|
|
625
|
+
this.messagesBuilder = new SnkMessageBuilder((_a = this.domainMessagesBuilder) !== null && _a !== void 0 ? _a : this.entityName);
|
|
626
|
+
}
|
|
614
627
|
//---------------------------------------------
|
|
615
628
|
// Lifecycle web component
|
|
616
629
|
//---------------------------------------------
|
|
@@ -618,9 +631,7 @@ export class SnkDataUnit {
|
|
|
618
631
|
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
619
632
|
this._application.getAllAccess(this.resourceID).then(access => this._permissions = access);
|
|
620
633
|
this._parentSnkDataUnit = this.getParentSnkDataUnit();
|
|
621
|
-
|
|
622
|
-
this.messagesBuilder = new SnkMessageBuilder(this.entityName);
|
|
623
|
-
}
|
|
634
|
+
this.instanceMessagesBuilder();
|
|
624
635
|
}
|
|
625
636
|
disconnectedCallback() {
|
|
626
637
|
if (this.dataUnit) {
|
|
@@ -628,7 +639,7 @@ export class SnkDataUnit {
|
|
|
628
639
|
}
|
|
629
640
|
}
|
|
630
641
|
async componentDidLoad() {
|
|
631
|
-
await this.loadDataUnit();
|
|
642
|
+
await this.loadDataUnit(false);
|
|
632
643
|
this.handlerLinkFields();
|
|
633
644
|
}
|
|
634
645
|
render() {
|
|
@@ -860,6 +871,23 @@ export class SnkDataUnit {
|
|
|
860
871
|
},
|
|
861
872
|
"attribute": "resource-i-d",
|
|
862
873
|
"reflect": false
|
|
874
|
+
},
|
|
875
|
+
"domainMessagesBuilder": {
|
|
876
|
+
"type": "string",
|
|
877
|
+
"mutable": false,
|
|
878
|
+
"complexType": {
|
|
879
|
+
"original": "string",
|
|
880
|
+
"resolved": "string",
|
|
881
|
+
"references": {}
|
|
882
|
+
},
|
|
883
|
+
"required": false,
|
|
884
|
+
"optional": false,
|
|
885
|
+
"docs": {
|
|
886
|
+
"tags": [],
|
|
887
|
+
"text": "Define a chave customizada para sobrescrever as mensagens (N\u00E3o pegando pela entidade)"
|
|
888
|
+
},
|
|
889
|
+
"attribute": "domain-messages-builder",
|
|
890
|
+
"reflect": false
|
|
863
891
|
}
|
|
864
892
|
};
|
|
865
893
|
}
|
|
@@ -73,10 +73,8 @@ export class SnkFormConfigManager {
|
|
|
73
73
|
if (fields != undefined && fields.length > 0) {
|
|
74
74
|
return fields.map(({ label, name, readOnly, visible, required }) => {
|
|
75
75
|
if (label == undefined) {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
visible,
|
|
79
|
-
required });
|
|
76
|
+
const currentField = dataUnit.getField(name);
|
|
77
|
+
return Object.assign(Object.assign({}, currentField), { name: name !== null && name !== void 0 ? name : currentField.name, readOnly: readOnly !== null && readOnly !== void 0 ? readOnly : currentField.readOnly, visible: visible !== null && visible !== void 0 ? visible : currentField.visible, required: required !== null && required !== void 0 ? required : currentField.required });
|
|
80
78
|
}
|
|
81
79
|
return { name, label, readOnly, visible, required };
|
|
82
80
|
})
|
|
@@ -100,7 +98,7 @@ export class SnkFormConfigManager {
|
|
|
100
98
|
const normalizedFilter = StringUtils.replaceAccentuatedCharsLower(descriptionFilter.toLocaleLowerCase());
|
|
101
99
|
return normalizedText.includes(normalizedFilter);
|
|
102
100
|
}
|
|
103
|
-
|
|
101
|
+
getFormConfig(dataUnit, ignoreReadOnlyFormFields) {
|
|
104
102
|
let fields = this.getFieldsList(dataUnit);
|
|
105
103
|
if (ignoreReadOnlyFormFields) {
|
|
106
104
|
fields = fields.filter(field => {
|
|
@@ -132,8 +130,8 @@ export class SnkFormConfigManager {
|
|
|
132
130
|
this._onConfigChange(Object.assign({}, this._config));
|
|
133
131
|
}
|
|
134
132
|
}
|
|
135
|
-
getConfig(
|
|
136
|
-
return
|
|
133
|
+
getConfig(dataUnit, ignoreReadOnlyFormFields) {
|
|
134
|
+
return this.getFormConfig(dataUnit, ignoreReadOnlyFormFields !== null && ignoreReadOnlyFormFields !== void 0 ? ignoreReadOnlyFormFields : true);
|
|
137
135
|
}
|
|
138
136
|
getFormConfigFetcher() {
|
|
139
137
|
if (this._formConfigFetcher == undefined) {
|
|
@@ -67,7 +67,7 @@ export class SnkFormConfig {
|
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
getConfig() {
|
|
70
|
-
let config = this.configManager.getConfig(
|
|
70
|
+
let config = this.configManager.getConfig(this.dataUnit);
|
|
71
71
|
if (config.fields && config.fields.length === 0) {
|
|
72
72
|
config = undefined;
|
|
73
73
|
}
|
|
@@ -56,6 +56,7 @@ export class SnkSimpleCrud {
|
|
|
56
56
|
this.formLegacyConfigName = undefined;
|
|
57
57
|
this.ignoreReadOnlyFormFields = false;
|
|
58
58
|
this.autoFocus = true;
|
|
59
|
+
this.domainMessagesBuilder = undefined;
|
|
59
60
|
this.autoLoad = undefined;
|
|
60
61
|
}
|
|
61
62
|
/**
|
|
@@ -672,8 +673,8 @@ export class SnkSimpleCrud {
|
|
|
672
673
|
return StringUtils.isEmpty(this.resourceID) ? this._resourceID : this.resourceID;
|
|
673
674
|
}
|
|
674
675
|
getFormConfig() {
|
|
675
|
-
var _a
|
|
676
|
-
const configFromManager = (_a = this._formConfigManager) === null || _a === void 0 ? void 0 : _a.getConfig(
|
|
676
|
+
var _a;
|
|
677
|
+
const configFromManager = (_a = this._formConfigManager) === null || _a === void 0 ? void 0 : _a.getConfig(this.dataUnit, this.ignoreReadOnlyFormFields);
|
|
677
678
|
if (!this.configName && !configFromManager) {
|
|
678
679
|
return this.formConfig;
|
|
679
680
|
}
|
|
@@ -693,7 +694,7 @@ export class SnkSimpleCrud {
|
|
|
693
694
|
if (this.dataUnit == undefined) {
|
|
694
695
|
return;
|
|
695
696
|
}
|
|
696
|
-
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.goToView(VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail, onDataUnitFieldsHidded: this.updateFormConfig.bind(this) }, h("header", null, h("slot", { name: "snkSimpleCrudHeader" })), h("section", { class: "ez-box ez-box--shadow simple-crud__container-section" }, h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, actionsList: this.getActionsList(), disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, "data-exporter-store-key": this.getDataExporterStoreKey(), slot: "leftButtons", presentationMode: PresentationMode.SECONDARY }, h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })), 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)
|
|
697
|
+
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.goToView(VIEW_MODE.FORM), 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 ez-box--shadow simple-crud__container-section" }, h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, actionsList: this.getActionsList(), disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, "data-exporter-store-key": this.getDataExporterStoreKey(), slot: "leftButtons", presentationMode: PresentationMode.SECONDARY }, h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })), 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)
|
|
697
698
|
? undefined
|
|
698
699
|
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab, autoFocus: this.autoFocus }, h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, h("ez-form", { ref: (ref) => this._form = ref, class: `ez-margin-top--large ${this.handleShowFormConfig() ? "simple-crud__form--hidden" : ""}`, dataUnit: this.dataUnit, config: this.getFormConfig(), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), this.handleShowFormConfig() && h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this.dataUnit, configManager: this._formConfigManager, onConfigClose: () => this.closeFormConfig() })), this.messagesBuilder && h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.goToView(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showConfiguratorButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this.resolveResourceID(), customContainerId: this._customContainerId })), h("div", { id: `${this._customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }))), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this.gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resolveResourceID() }))));
|
|
699
700
|
}
|
|
@@ -1086,6 +1087,23 @@ export class SnkSimpleCrud {
|
|
|
1086
1087
|
"reflect": false,
|
|
1087
1088
|
"defaultValue": "true"
|
|
1088
1089
|
},
|
|
1090
|
+
"domainMessagesBuilder": {
|
|
1091
|
+
"type": "string",
|
|
1092
|
+
"mutable": false,
|
|
1093
|
+
"complexType": {
|
|
1094
|
+
"original": "string",
|
|
1095
|
+
"resolved": "string",
|
|
1096
|
+
"references": {}
|
|
1097
|
+
},
|
|
1098
|
+
"required": false,
|
|
1099
|
+
"optional": false,
|
|
1100
|
+
"docs": {
|
|
1101
|
+
"tags": [],
|
|
1102
|
+
"text": "Define a chave customizada para sobrescrever as mensagens (N\u00E3o pegando pela entidade)"
|
|
1103
|
+
},
|
|
1104
|
+
"attribute": "domain-messages-builder",
|
|
1105
|
+
"reflect": false
|
|
1106
|
+
},
|
|
1089
1107
|
"autoLoad": {
|
|
1090
1108
|
"type": "boolean",
|
|
1091
1109
|
"mutable": false,
|
|
@@ -71,6 +71,7 @@ export class ConfigStorage {
|
|
|
71
71
|
if (config == undefined) {
|
|
72
72
|
return;
|
|
73
73
|
}
|
|
74
|
+
name = this.handleLegacyConfigAsString(name, CONFIG_SOURCE.grid);
|
|
74
75
|
await this.deleteGridConfigCache(name, resourceID);
|
|
75
76
|
return this.gridConfigFetcher.saveConfig(config, name, resourceID);
|
|
76
77
|
}
|
|
@@ -6,7 +6,7 @@ var __asyncValues = (this && this.__asyncValues) || function (o) {
|
|
|
6
6
|
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
7
7
|
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
8
8
|
};
|
|
9
|
-
import { ApplicationContext, ErrorException, ObjectUtils, StringUtils, WarningException } from '@sankhyalabs/core';
|
|
9
|
+
import { ApplicationContext, ErrorException, ServiceCanceledException, ObjectUtils, StringUtils, WarningException } from '@sankhyalabs/core';
|
|
10
10
|
import { batchRequests } from 'graphql-request';
|
|
11
11
|
import UrlUtils from "../../../lib/utils/urlutils";
|
|
12
12
|
import { PrintUtils } from '../../utils/PrintUtils';
|
|
@@ -372,9 +372,14 @@ export class DataFetcher {
|
|
|
372
372
|
resolve(false);
|
|
373
373
|
})
|
|
374
374
|
]).then((data) => {
|
|
375
|
-
var _a;
|
|
375
|
+
var _a, _b;
|
|
376
376
|
if (!hasClientEvent || data === false) {
|
|
377
|
-
(
|
|
377
|
+
if (Object.keys(errorResponse[0].extensions).includes("SERVICE_CANCELED") || Object.keys(extensions).includes("isServiceCancelled")) {
|
|
378
|
+
(((_a = watingRequestsById.get(val.request.variables[val.index].queryID)) === null || _a === void 0 ? void 0 : _a.reject) || Promise.reject)(new ServiceCanceledException("Service canceled", val.message));
|
|
379
|
+
}
|
|
380
|
+
else {
|
|
381
|
+
(((_b = watingRequestsById.get(val.request.variables[val.index].queryID)) === null || _b === void 0 ? void 0 : _b.reject) || Promise.reject)(new ErrorException("Falha detectada", val.message));
|
|
382
|
+
}
|
|
378
383
|
}
|
|
379
384
|
});
|
|
380
385
|
});
|
|
@@ -7,7 +7,7 @@ const snkExporterMessages = {
|
|
|
7
7
|
emailSenderOptStep_subtitle: "Primeiro, escolha o formato do arquivo",
|
|
8
8
|
emailSenderOptStep_lblFormat: "Formato:",
|
|
9
9
|
emailSenderOptStep_formatPDF: "PDF (.pdf)",
|
|
10
|
-
|
|
10
|
+
emailSenderOptStep_formatXLS: "Planilha (.xls)",
|
|
11
11
|
emailSenderOptStep_export: "Exportar:",
|
|
12
12
|
emailSenderOptStep_allData: "Toda a grade",
|
|
13
13
|
emailSenderOptStep_currentPage: "Somente a página atual",
|
|
@@ -423,6 +423,7 @@ class ConfigStorage {
|
|
|
423
423
|
if (config == undefined) {
|
|
424
424
|
return;
|
|
425
425
|
}
|
|
426
|
+
name = this.handleLegacyConfigAsString(name, CONFIG_SOURCE.grid);
|
|
426
427
|
await this.deleteGridConfigCache(name, resourceID);
|
|
427
428
|
return this.gridConfigFetcher.saveConfig(config, name, resourceID);
|
|
428
429
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DataType, ApplicationContext, StringUtils, ErrorException, WarningException, ObjectUtils } from '@sankhyalabs/core';
|
|
1
|
+
import { DataType, ApplicationContext, StringUtils, ErrorException, WarningException, ObjectUtils, ServiceCanceledException } from '@sankhyalabs/core';
|
|
2
2
|
import { P as PrintUtils } from './PrintUtils.js';
|
|
3
3
|
import { DataUnitTransient } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
|
4
4
|
|
|
@@ -6883,9 +6883,14 @@ class DataFetcher {
|
|
|
6883
6883
|
resolve(false);
|
|
6884
6884
|
})
|
|
6885
6885
|
]).then((data) => {
|
|
6886
|
-
var _a;
|
|
6886
|
+
var _a, _b;
|
|
6887
6887
|
if (!hasClientEvent || data === false) {
|
|
6888
|
-
(
|
|
6888
|
+
if (Object.keys(errorResponse[0].extensions).includes("SERVICE_CANCELED") || Object.keys(extensions).includes("isServiceCancelled")) {
|
|
6889
|
+
(((_a = watingRequestsById.get(val.request.variables[val.index].queryID)) === null || _a === void 0 ? void 0 : _a.reject) || Promise.reject)(new ServiceCanceledException("Service canceled", val.message));
|
|
6890
|
+
}
|
|
6891
|
+
else {
|
|
6892
|
+
(((_b = watingRequestsById.get(val.request.variables[val.index].queryID)) === null || _b === void 0 ? void 0 : _b.reject) || Promise.reject)(new ErrorException("Falha detectada", val.message));
|
|
6893
|
+
}
|
|
6889
6894
|
}
|
|
6890
6895
|
});
|
|
6891
6896
|
});
|
|
@@ -74,10 +74,8 @@ class SnkFormConfigManager {
|
|
|
74
74
|
if (fields != undefined && fields.length > 0) {
|
|
75
75
|
return fields.map(({ label, name, readOnly, visible, required }) => {
|
|
76
76
|
if (label == undefined) {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
visible,
|
|
80
|
-
required });
|
|
77
|
+
const currentField = dataUnit.getField(name);
|
|
78
|
+
return Object.assign(Object.assign({}, currentField), { name: name !== null && name !== void 0 ? name : currentField.name, readOnly: readOnly !== null && readOnly !== void 0 ? readOnly : currentField.readOnly, visible: visible !== null && visible !== void 0 ? visible : currentField.visible, required: required !== null && required !== void 0 ? required : currentField.required });
|
|
81
79
|
}
|
|
82
80
|
return { name, label, readOnly, visible, required };
|
|
83
81
|
})
|
|
@@ -101,7 +99,7 @@ class SnkFormConfigManager {
|
|
|
101
99
|
const normalizedFilter = StringUtils.replaceAccentuatedCharsLower(descriptionFilter.toLocaleLowerCase());
|
|
102
100
|
return normalizedText.includes(normalizedFilter);
|
|
103
101
|
}
|
|
104
|
-
|
|
102
|
+
getFormConfig(dataUnit, ignoreReadOnlyFormFields) {
|
|
105
103
|
let fields = this.getFieldsList(dataUnit);
|
|
106
104
|
if (ignoreReadOnlyFormFields) {
|
|
107
105
|
fields = fields.filter(field => {
|
|
@@ -133,8 +131,8 @@ class SnkFormConfigManager {
|
|
|
133
131
|
this._onConfigChange(Object.assign({}, this._config));
|
|
134
132
|
}
|
|
135
133
|
}
|
|
136
|
-
getConfig(
|
|
137
|
-
return
|
|
134
|
+
getConfig(dataUnit, ignoreReadOnlyFormFields) {
|
|
135
|
+
return this.getFormConfig(dataUnit, ignoreReadOnlyFormFields !== null && ignoreReadOnlyFormFields !== void 0 ? ignoreReadOnlyFormFields : true);
|
|
138
136
|
}
|
|
139
137
|
getFormConfigFetcher() {
|
|
140
138
|
if (this._formConfigFetcher == undefined) {
|
|
@@ -8,7 +8,7 @@ const snkDataUnitMessages = {
|
|
|
8
8
|
},
|
|
9
9
|
cancelInfo: {
|
|
10
10
|
clone: "Duplicação descartada!",
|
|
11
|
-
insert: "A inclusão descartada!",
|
|
11
|
+
insert: "A inclusão foi descartada!",
|
|
12
12
|
update: "A edição foi descartada!"
|
|
13
13
|
},
|
|
14
14
|
confirm: {
|
|
@@ -122,7 +122,7 @@ const snkExporterMessages = {
|
|
|
122
122
|
emailSenderOptStep_subtitle: "Primeiro, escolha o formato do arquivo",
|
|
123
123
|
emailSenderOptStep_lblFormat: "Formato:",
|
|
124
124
|
emailSenderOptStep_formatPDF: "PDF (.pdf)",
|
|
125
|
-
|
|
125
|
+
emailSenderOptStep_formatXLS: "Planilha (.xls)",
|
|
126
126
|
emailSenderOptStep_export: "Exportar:",
|
|
127
127
|
emailSenderOptStep_allData: "Toda a grade",
|
|
128
128
|
emailSenderOptStep_currentPage: "Somente a página atual",
|
|
@@ -51,6 +51,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
51
51
|
this.configuratorSave = createEvent(this, "configuratorSave", 7);
|
|
52
52
|
this.configuratorCancel = createEvent(this, "configuratorCancel", 7);
|
|
53
53
|
this.formItemsReady = createEvent(this, "formItemsReady", 7);
|
|
54
|
+
this.viewModeChanged = createEvent(this, "viewModeChanged", 7);
|
|
54
55
|
this._keyDownHandler = async (event) => this.keyDownListener(event);
|
|
55
56
|
this._viewHistory = [];
|
|
56
57
|
this._customEditors = new Map();
|
|
@@ -79,6 +80,8 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
79
80
|
this.disablePersonalizedFilter = undefined;
|
|
80
81
|
this.autoLoad = undefined;
|
|
81
82
|
this.autoFocus = true;
|
|
83
|
+
this.domainMessagesBuilder = undefined;
|
|
84
|
+
this.setCustomFormTitle = undefined;
|
|
82
85
|
this.customContainerId = `SNK-CRUD-CUSTOM-CONTAINER-${StringUtils.generateUUID()}`;
|
|
83
86
|
}
|
|
84
87
|
/**
|
|
@@ -187,6 +190,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
187
190
|
else if (viewMode === VIEW_MODE.FORM) {
|
|
188
191
|
this._guidesViewer.setFocus();
|
|
189
192
|
}
|
|
193
|
+
this.viewModeChanged.emit(viewMode);
|
|
190
194
|
}
|
|
191
195
|
openConfig(viewMode) {
|
|
192
196
|
this._snkConfigurator.close();
|
|
@@ -250,6 +254,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
250
254
|
this._snkDataUnit = parent;
|
|
251
255
|
this._snkDataUnit.addEventListener("insertionMode", () => this.insertionModeHandler());
|
|
252
256
|
this._snkDataUnit.addEventListener("cancelEdition", () => this.cancelHandler());
|
|
257
|
+
this._snkDataUnit.domainMessagesBuilder = this.domainMessagesBuilder;
|
|
253
258
|
this._dataUnit = this._snkDataUnit.dataUnit;
|
|
254
259
|
this._dataState = this._snkDataUnit.dataState;
|
|
255
260
|
if (!this._dataUnit) {
|
|
@@ -415,7 +420,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
415
420
|
return;
|
|
416
421
|
}
|
|
417
422
|
this._snkDataUnit.ignoreSaveMessage = this._currentViewMode === VIEW_MODE.GRID;
|
|
418
|
-
return (h(Host, null, 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, 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 }, 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 }, 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" }))));
|
|
423
|
+
return (h(Host, null, 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, 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 }, 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, getCustomTitle: this.setCustomFormTitle }, 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" }))));
|
|
419
424
|
}
|
|
420
425
|
get _element() { return this; }
|
|
421
426
|
static get watchers() { return {
|
|
@@ -441,6 +446,8 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
441
446
|
"disablePersonalizedFilter": [4, "disable-personalized-filter"],
|
|
442
447
|
"autoLoad": [4, "auto-load"],
|
|
443
448
|
"autoFocus": [4, "auto-focus"],
|
|
449
|
+
"domainMessagesBuilder": [1, "domain-messages-builder"],
|
|
450
|
+
"setCustomFormTitle": [16],
|
|
444
451
|
"_dataUnit": [32],
|
|
445
452
|
"_dataState": [32],
|
|
446
453
|
"attachmentRegisterKey": [32],
|
|
@@ -124,7 +124,7 @@ class ItemBuilder {
|
|
|
124
124
|
getExportToXLS(groupName) {
|
|
125
125
|
return {
|
|
126
126
|
id: DataExporterOption.EXPORT_TO_XLS,
|
|
127
|
-
label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.
|
|
127
|
+
label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.xls)`,
|
|
128
128
|
group: groupName
|
|
129
129
|
};
|
|
130
130
|
}
|
|
@@ -167,7 +167,7 @@ class ItemBuilder {
|
|
|
167
167
|
getExportPageToXLS() {
|
|
168
168
|
return {
|
|
169
169
|
id: DataExporterOption.EXPORT_PAGE_TO_XLS,
|
|
170
|
-
label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.
|
|
170
|
+
label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.xls)`
|
|
171
171
|
};
|
|
172
172
|
}
|
|
173
173
|
/**
|
|
@@ -97,6 +97,7 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
97
97
|
this.ignoreSaveMessage = undefined;
|
|
98
98
|
this.configName = undefined;
|
|
99
99
|
this.resourceID = undefined;
|
|
100
|
+
this.domainMessagesBuilder = undefined;
|
|
100
101
|
}
|
|
101
102
|
observePageSize() {
|
|
102
103
|
if (this.dataUnit) {
|
|
@@ -513,7 +514,8 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
513
514
|
if (this.ignoreSaveMessage) {
|
|
514
515
|
return;
|
|
515
516
|
}
|
|
516
|
-
const
|
|
517
|
+
const saveOperation = action.payload.changes[0]._operation.toLowerCase();
|
|
518
|
+
const msg = this.getMessage("snkDataUnit.saveInfo", action.payload.records[0], saveOperation);
|
|
517
519
|
if (msg != undefined) {
|
|
518
520
|
this.showSuccessMessage(msg);
|
|
519
521
|
}
|
|
@@ -544,10 +546,13 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
544
546
|
* - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
|
|
545
547
|
* Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-data-unit.msg.ts"
|
|
546
548
|
*/
|
|
547
|
-
getMessage(key, params = undefined) {
|
|
549
|
+
getMessage(key, params = undefined, customOperation) {
|
|
548
550
|
if (!params) {
|
|
549
551
|
params = this.getMessageParams();
|
|
550
552
|
}
|
|
553
|
+
if (customOperation) {
|
|
554
|
+
this.messagesBuilder.currentOperation = customOperation;
|
|
555
|
+
}
|
|
551
556
|
return this.messagesBuilder.getMessage(key, params);
|
|
552
557
|
}
|
|
553
558
|
getMessageParams() {
|
|
@@ -578,7 +583,7 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
578
583
|
return await this._application.getDataUnit(this.entityName, cacheName, null, this.configName, this.resourceID);
|
|
579
584
|
}
|
|
580
585
|
}
|
|
581
|
-
async loadDataUnit() {
|
|
586
|
+
async loadDataUnit(forceMetadataLoad = true) {
|
|
582
587
|
var _a;
|
|
583
588
|
if (this.dataUnit == null && this._application && this.entityName) {
|
|
584
589
|
this.dataUnit = await this.getDataUnitParentOrChild();
|
|
@@ -588,7 +593,8 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
588
593
|
this.dataUnit.unsubscribe(this._dataUnitObserver);
|
|
589
594
|
this.dataUnit.addInterceptor(this);
|
|
590
595
|
this.dataUnit.subscribe(this._dataUnitObserver);
|
|
591
|
-
|
|
596
|
+
if (forceMetadataLoad || !this.dataUnit.metadata)
|
|
597
|
+
await this.dataUnit.loadMetadata();
|
|
592
598
|
if ((_a = this.dataUnit.records) === null || _a === void 0 ? void 0 : _a.length) {
|
|
593
599
|
this.getMetadataByRow(this.dataUnit);
|
|
594
600
|
}
|
|
@@ -654,6 +660,13 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
654
660
|
parent = parent.parentElement;
|
|
655
661
|
}
|
|
656
662
|
}
|
|
663
|
+
instanceMessagesBuilder() {
|
|
664
|
+
var _a;
|
|
665
|
+
if (this.messagesBuilder) {
|
|
666
|
+
return;
|
|
667
|
+
}
|
|
668
|
+
this.messagesBuilder = new SnkMessageBuilder((_a = this.domainMessagesBuilder) !== null && _a !== void 0 ? _a : this.entityName);
|
|
669
|
+
}
|
|
657
670
|
//---------------------------------------------
|
|
658
671
|
// Lifecycle web component
|
|
659
672
|
//---------------------------------------------
|
|
@@ -661,9 +674,7 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
661
674
|
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
662
675
|
this._application.getAllAccess(this.resourceID).then(access => this._permissions = access);
|
|
663
676
|
this._parentSnkDataUnit = this.getParentSnkDataUnit();
|
|
664
|
-
|
|
665
|
-
this.messagesBuilder = new SnkMessageBuilder(this.entityName);
|
|
666
|
-
}
|
|
677
|
+
this.instanceMessagesBuilder();
|
|
667
678
|
}
|
|
668
679
|
disconnectedCallback() {
|
|
669
680
|
if (this.dataUnit) {
|
|
@@ -671,7 +682,7 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
671
682
|
}
|
|
672
683
|
}
|
|
673
684
|
async componentDidLoad() {
|
|
674
|
-
await this.loadDataUnit();
|
|
685
|
+
await this.loadDataUnit(false);
|
|
675
686
|
this.handlerLinkFields();
|
|
676
687
|
}
|
|
677
688
|
render() {
|
|
@@ -699,6 +710,7 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
699
710
|
"ignoreSaveMessage": [4, "ignore-save-message"],
|
|
700
711
|
"configName": [1, "config-name"],
|
|
701
712
|
"resourceID": [1, "resource-i-d"],
|
|
713
|
+
"domainMessagesBuilder": [1, "domain-messages-builder"],
|
|
702
714
|
"fieldsToLink": [32],
|
|
703
715
|
"getDataUnit": [64],
|
|
704
716
|
"getSelectedRecordsIDsInfo": [64],
|