@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-68936.0 → 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-a343e418.js → ConfigStorage-e49214c6.js} +2 -2
- package/dist/cjs/{DataFetcher-313debd8.js → DataFetcher-77729a93.js} +7 -2
- package/dist/cjs/{IExporterProvider-d2a04ee7.js → IExporterProvider-10b7fed5.js} +5 -5
- package/dist/cjs/{SnkFormConfigManager-166cbd1f.js → SnkFormConfigManager-beebf47a.js} +2 -2
- package/dist/cjs/{SnkMessageBuilder-28ceaaed.js → SnkMessageBuilder-cceebbae.js} +3 -7
- package/dist/cjs/{auth-fetcher-54f5ff9d.js → auth-fetcher-29bb791c.js} +1 -1
- package/dist/cjs/{dataunit-fetcher-75f89355.js → dataunit-fetcher-d4873076.js} +3 -10
- package/dist/cjs/{field-search-68e34bf4.js → field-search-f56aa7d6.js} +1 -5
- 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 -9
- package/dist/cjs/snk-data-exporter.cjs.entry.js +8 -8
- package/dist/cjs/{snk-data-unit-bf418767.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 -9
- 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 +2 -2
- package/dist/cjs/snk-form.cjs.entry.js +4 -4
- package/dist/cjs/snk-grid.cjs.entry.js +13 -38
- package/dist/cjs/{snk-guides-viewer-14c27834.js → snk-guides-viewer-aafc3073.js} +14 -13
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +8 -8
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
- package/dist/cjs/snk-simple-crud.cjs.entry.js +12 -29
- package/dist/collection/components/snk-crud/snk-crud.js +48 -13
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +15 -17
- 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-grid/snk-grid.css +2 -0
- package/dist/collection/components/snk-grid/snk-grid.js +6 -58
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +24 -41
- package/dist/collection/components/snk-taskbar/processor/taskbar-processor.js +1 -5
- package/dist/collection/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.js +1 -1
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +8 -3
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +2 -9
- 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/collection/lib/message/resources/snk-grid.msg.js +1 -5
- package/dist/components/DataFetcher.js +8 -3
- package/dist/components/IExporterProvider.js +2 -6
- package/dist/components/SnkMessageBuilder.js +3 -7
- package/dist/components/dataunit-fetcher.js +2 -9
- package/dist/components/snk-crud.js +8 -5
- 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 -8
- package/dist/components/snk-exporter-email-sender2.js +1 -1
- package/dist/components/snk-grid2.js +8 -34
- package/dist/components/snk-simple-crud2.js +5 -22
- package/dist/esm/{ConfigStorage-3806514e.js → ConfigStorage-e476378d.js} +2 -2
- package/dist/esm/{DataFetcher-c1baf61d.js → DataFetcher-773a3e4b.js} +8 -3
- package/dist/esm/{IExporterProvider-b2e244b3.js → IExporterProvider-d597f27d.js} +5 -5
- package/dist/esm/{SnkFormConfigManager-31b24066.js → SnkFormConfigManager-298cd647.js} +2 -2
- package/dist/esm/{SnkMessageBuilder-0485b99a.js → SnkMessageBuilder-ae87b754.js} +3 -7
- package/dist/esm/{auth-fetcher-039abba3.js → auth-fetcher-a411f73c.js} +1 -1
- package/dist/esm/{dataunit-fetcher-6463ac8d.js → dataunit-fetcher-3d2ec959.js} +3 -10
- package/dist/esm/{field-search-f8b1d91e.js → field-search-efbe307f.js} +1 -5
- 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 -9
- package/dist/esm/snk-data-exporter.entry.js +8 -8
- package/dist/esm/{snk-data-unit-20860cfc.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 -9
- 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 +2 -2
- package/dist/esm/snk-form.entry.js +4 -4
- package/dist/esm/snk-grid.entry.js +13 -38
- package/dist/esm/{snk-guides-viewer-b82ec79a.js → snk-guides-viewer-62124f3d.js} +14 -13
- package/dist/esm/snk-guides-viewer.entry.js +8 -8
- package/dist/esm/snk-personalized-filter.entry.js +3 -3
- package/dist/esm/snk-simple-crud.entry.js +12 -29
- package/dist/sankhyablocks/{p-b4d016a3.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-74fafa0d.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-62ba211a.entry.js → p-2e9c764c.entry.js} +1 -1
- package/dist/sankhyablocks/{p-52920496.js → p-3287a6cc.js} +1 -1
- package/dist/sankhyablocks/{p-d0bec13f.entry.js → p-421bec84.entry.js} +1 -1
- package/dist/sankhyablocks/{p-249adf8b.entry.js → p-42f7b05d.entry.js} +1 -1
- package/dist/sankhyablocks/p-51999ab5.entry.js +1 -0
- package/dist/sankhyablocks/p-52a6a293.entry.js +1 -0
- package/dist/sankhyablocks/p-594bc21d.js +1 -0
- package/dist/sankhyablocks/{p-2a408684.js → p-5f016aed.js} +1 -1
- package/dist/sankhyablocks/{p-d6e26ea8.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-4111c6ce.entry.js → p-74c665d5.entry.js} +1 -1
- package/dist/sankhyablocks/{p-0e85d9ba.js → p-76a65660.js} +1 -1
- package/dist/sankhyablocks/p-7c4aabe2.js +1 -0
- package/dist/sankhyablocks/{p-2f978e29.entry.js → p-8c1ff936.entry.js} +1 -1
- package/dist/sankhyablocks/{p-450c60e4.entry.js → p-939e15d3.entry.js} +1 -1
- package/dist/sankhyablocks/{p-47db7e88.entry.js → p-9dfda04a.entry.js} +1 -1
- package/dist/sankhyablocks/{p-2c68b3ae.entry.js → p-bd008859.entry.js} +1 -1
- package/dist/sankhyablocks/p-c2495304.js +1 -0
- 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 +7 -2
- package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +3 -3
- package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +6 -1
- package/dist/types/components/snk-grid/snk-grid.d.ts +0 -9
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +4 -7
- package/dist/types/components/snk-taskbar/processor/taskbar-processor.d.ts +0 -1
- package/dist/types/components.d.ts +33 -24
- package/package.json +2 -2
- package/dist/sankhyablocks/p-14c2056a.js +0 -1
- package/dist/sankhyablocks/p-219f888d.entry.js +0 -1
- package/dist/sankhyablocks/p-23736d75.js +0 -1
- package/dist/sankhyablocks/p-4238fcd4.entry.js +0 -1
- package/dist/sankhyablocks/p-6614c578.js +0 -1
- package/dist/sankhyablocks/p-6fede3d4.entry.js +0 -1
- package/dist/sankhyablocks/p-701442ef.entry.js +0 -1
- package/dist/sankhyablocks/p-950037cb.js +0 -1
- package/dist/sankhyablocks/p-95e44a9c.entry.js +0 -1
- package/dist/sankhyablocks/p-dc7c9047.js +0 -1
- package/dist/sankhyablocks/p-ebc4011a.entry.js +0 -1
|
@@ -7,19 +7,19 @@ const core = require('@sankhyalabs/core');
|
|
|
7
7
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
|
8
8
|
const constants = require('./constants-35ddd366.js');
|
|
9
9
|
const taskbarElements = require('./taskbar-elements-9ad1f9c0.js');
|
|
10
|
-
require('./DataFetcher-
|
|
11
|
-
require('./pesquisa-fetcher-
|
|
12
|
-
const IExporterProvider = require('./IExporterProvider-
|
|
10
|
+
require('./DataFetcher-77729a93.js');
|
|
11
|
+
require('./pesquisa-fetcher-a1d0353f.js');
|
|
12
|
+
const IExporterProvider = require('./IExporterProvider-10b7fed5.js');
|
|
13
13
|
const index = require('./index-1dfc7a6e.js');
|
|
14
14
|
require('./ISave-e91b70a7.js');
|
|
15
15
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
|
16
16
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
|
17
|
-
const dataunitFetcher = require('./dataunit-fetcher-
|
|
17
|
+
const dataunitFetcher = require('./dataunit-fetcher-d4873076.js');
|
|
18
18
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
|
19
|
-
const formConfigFetcher = require('./form-config-fetcher-
|
|
20
|
-
const fieldSearch = require('./field-search-
|
|
21
|
-
const ConfigStorage = require('./ConfigStorage-
|
|
22
|
-
const SnkFormConfigManager = require('./SnkFormConfigManager-
|
|
19
|
+
const formConfigFetcher = require('./form-config-fetcher-feb08214.js');
|
|
20
|
+
const fieldSearch = require('./field-search-f56aa7d6.js');
|
|
21
|
+
const ConfigStorage = require('./ConfigStorage-e49214c6.js');
|
|
22
|
+
const SnkFormConfigManager = require('./SnkFormConfigManager-beebf47a.js');
|
|
23
23
|
const RecordIDUtils = require('./RecordIDUtils-3735135c.js');
|
|
24
24
|
const index$2 = require('./index-102ba62d.js');
|
|
25
25
|
require('./PrintUtils-bcaeb82f.js');
|
|
@@ -107,7 +107,7 @@ const SnkSimpleCrud = class {
|
|
|
107
107
|
"snkSimpleCrudTaskbar.grid_regular": this.getButtons(false, [taskbarElements.TaskbarElement.DATA_EXPORTER, taskbarElements.TaskbarElement.FORM_MODE]),
|
|
108
108
|
"snkSimpleCrudTaskbar.form_selected": this.getButtons(true, [taskbarElements.TaskbarElement.GRID_MODE]),
|
|
109
109
|
"snkSimpleCrudTaskbar.grid_selected": this.getButtons(true, [taskbarElements.TaskbarElement.DATA_EXPORTER, taskbarElements.TaskbarElement.FORM_MODE]),
|
|
110
|
-
"snkSimpleCrudTaskbar.finish_edition":
|
|
110
|
+
"snkSimpleCrudTaskbar.finish_edition": ["CANCEL", "SAVE"]
|
|
111
111
|
});
|
|
112
112
|
this._showPopUpGridConfig = false;
|
|
113
113
|
this._showFormConfig = false;
|
|
@@ -127,7 +127,6 @@ const SnkSimpleCrud = class {
|
|
|
127
127
|
this.useCancelConfirm = true;
|
|
128
128
|
this.pageSize = 150;
|
|
129
129
|
this.resourceID = undefined;
|
|
130
|
-
this.enableGridInsert = false;
|
|
131
130
|
this.taskbarManager = undefined;
|
|
132
131
|
this.messagesBuilder = undefined;
|
|
133
132
|
this.useEnterLikeTab = false;
|
|
@@ -138,6 +137,7 @@ const SnkSimpleCrud = class {
|
|
|
138
137
|
this.formLegacyConfigName = undefined;
|
|
139
138
|
this.ignoreReadOnlyFormFields = false;
|
|
140
139
|
this.autoFocus = true;
|
|
140
|
+
this.domainMessagesBuilder = undefined;
|
|
141
141
|
this.autoLoad = undefined;
|
|
142
142
|
}
|
|
143
143
|
/**
|
|
@@ -196,13 +196,6 @@ const SnkSimpleCrud = class {
|
|
|
196
196
|
newCustomFieldProps.set(fieldName, Object.assign(Object.assign({}, currentProps), { [propName]: value }));
|
|
197
197
|
this._fieldsProps = newCustomFieldProps;
|
|
198
198
|
}
|
|
199
|
-
getFinishEditionButtonsCallback() {
|
|
200
|
-
const btns = ["CANCEL", "SAVE"];
|
|
201
|
-
if (this.enableGridInsert && this._currentViewMode !== constants.VIEW_MODE.ATTACHMENT) {
|
|
202
|
-
btns.push(this._currentViewMode === constants.VIEW_MODE.GRID ? taskbarElements.TaskbarElement.FORM_MODE : taskbarElements.TaskbarElement.GRID_MODE);
|
|
203
|
-
}
|
|
204
|
-
return btns;
|
|
205
|
-
}
|
|
206
199
|
getButtons(selected, extraButtons) {
|
|
207
200
|
return this.addConfigButton(this.resolveInMemoryBtns(selected ? REGULAR_SELECTED_BTNS : REGULAR_DEFAULT_BTNS)
|
|
208
201
|
.concat(extraButtons));
|
|
@@ -641,9 +634,6 @@ const SnkSimpleCrud = class {
|
|
|
641
634
|
const options = filteredFields.map(field => ({ value: field.name, label: field.label }));
|
|
642
635
|
return Promise.resolve(options);
|
|
643
636
|
}
|
|
644
|
-
isGridInsertActive() {
|
|
645
|
-
return this.enableGridInsert && this.dataUnit.hasNewRecord();
|
|
646
|
-
}
|
|
647
637
|
getActionsList() {
|
|
648
638
|
var _a, _b;
|
|
649
639
|
const hardList = [{
|
|
@@ -655,8 +645,6 @@ const SnkSimpleCrud = class {
|
|
|
655
645
|
? this.getColumnSearch(actionButton, item)
|
|
656
646
|
: this.getFieldSearch(actionButton, item)
|
|
657
647
|
}];
|
|
658
|
-
if (this.isGridInsertActive())
|
|
659
|
-
return hardList;
|
|
660
648
|
if (this.taskbarManager != undefined && this.taskbarManager.getMoreOptions != undefined) {
|
|
661
649
|
const taskbarID = this.getTopTaskBarId();
|
|
662
650
|
return hardList.concat(this.taskbarManager.getMoreOptions(taskbarID, this.configName, this.dataState, this.actionsList));
|
|
@@ -780,20 +768,15 @@ const SnkSimpleCrud = class {
|
|
|
780
768
|
}
|
|
781
769
|
this._formConfigManager.setConfig(this.formConfig);
|
|
782
770
|
}
|
|
783
|
-
handleDataUnitOnInsertionMode() {
|
|
784
|
-
if (this.enableGridInsert)
|
|
785
|
-
return;
|
|
786
|
-
this.goToView(constants.VIEW_MODE.FORM);
|
|
787
|
-
}
|
|
788
771
|
/* istanbul ignore next */
|
|
789
772
|
render() {
|
|
790
773
|
var _a;
|
|
791
774
|
if (this.dataUnit == undefined) {
|
|
792
775
|
return;
|
|
793
776
|
}
|
|
794
|
-
return (index$1.h("snk-data-unit", { ref: ref => this._snkDataUnit = ref, class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), pageSize: this.getPageSize(), onInsertionMode: this.
|
|
777
|
+
return (index$1.h("snk-data-unit", { ref: ref => this._snkDataUnit = ref, class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), pageSize: this.getPageSize(), onInsertionMode: () => this.goToView(constants.VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === constants.VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail, onDataUnitFieldsHidded: this.updateFormConfig.bind(this), domainMessagesBuilder: this.domainMessagesBuilder }, index$1.h("header", null, index$1.h("slot", { name: "snkSimpleCrudHeader" })), index$1.h("section", { class: "ez-box ez-box--shadow simple-crud__container-section" }, index$1.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: index.PresentationMode.SECONDARY }, index$1.h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })), index$1.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, index$1.h("stack-item", null, index$1.h("ez-grid", { class: "ez-margin-bottom--large", ref: ref => this._grid = ref, dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(constants.VIEW_MODE.FORM), onConfigChange: evt => this.gridConfigChangeHandler(evt), columnfilterDataSource: this.dataUnit.name && this.dataUnit.name.includes(dataunitFetcher.InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
|
|
795
778
|
? undefined
|
|
796
|
-
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab, autoFocus: this.autoFocus
|
|
779
|
+
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab, autoFocus: this.autoFocus }, index$1.h("div", { slot: "footer" }, index$1.h("slot", { name: "snkSimpleCrudFooter" })))), index$1.h("stack-item", null, index$1.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() && index$1.h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this.dataUnit, configManager: this._formConfigManager, onConfigClose: () => this.closeFormConfig() })), this.messagesBuilder && index$1.h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.goToView(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showConfiguratorButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this.resolveResourceID(), customContainerId: this._customContainerId })), index$1.h("div", { id: `${this._customContainerId}` }, index$1.h("slot", { name: "SnkConfigContainerSlot" }))), index$1.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index$1.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this.gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resolveResourceID() }))));
|
|
797
780
|
}
|
|
798
781
|
get _element() { return index$1.getElement(this); }
|
|
799
782
|
static get watchers() { return {
|
|
@@ -39,7 +39,8 @@ export class SnkCrud {
|
|
|
39
39
|
this.disablePersonalizedFilter = undefined;
|
|
40
40
|
this.autoLoad = undefined;
|
|
41
41
|
this.autoFocus = true;
|
|
42
|
-
this.
|
|
42
|
+
this.domainMessagesBuilder = undefined;
|
|
43
|
+
this.setCustomFormTitle = undefined;
|
|
43
44
|
this.customContainerId = `SNK-CRUD-CUSTOM-CONTAINER-${StringUtils.generateUUID()}`;
|
|
44
45
|
}
|
|
45
46
|
/**
|
|
@@ -148,6 +149,7 @@ export class SnkCrud {
|
|
|
148
149
|
else if (viewMode === VIEW_MODE.FORM) {
|
|
149
150
|
this._guidesViewer.setFocus();
|
|
150
151
|
}
|
|
152
|
+
this.viewModeChanged.emit(viewMode);
|
|
151
153
|
}
|
|
152
154
|
openConfig(viewMode) {
|
|
153
155
|
this._snkConfigurator.close();
|
|
@@ -163,8 +165,6 @@ export class SnkCrud {
|
|
|
163
165
|
ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
|
164
166
|
}
|
|
165
167
|
insertionModeHandler() {
|
|
166
|
-
if (this.enableGridInsert)
|
|
167
|
-
return;
|
|
168
168
|
this.gridToForm();
|
|
169
169
|
}
|
|
170
170
|
cancelHandler() {
|
|
@@ -213,6 +213,7 @@ export class SnkCrud {
|
|
|
213
213
|
this._snkDataUnit = parent;
|
|
214
214
|
this._snkDataUnit.addEventListener("insertionMode", () => this.insertionModeHandler());
|
|
215
215
|
this._snkDataUnit.addEventListener("cancelEdition", () => this.cancelHandler());
|
|
216
|
+
this._snkDataUnit.domainMessagesBuilder = this.domainMessagesBuilder;
|
|
216
217
|
this._dataUnit = this._snkDataUnit.dataUnit;
|
|
217
218
|
this._dataState = this._snkDataUnit.dataState;
|
|
218
219
|
if (!this._dataUnit) {
|
|
@@ -379,7 +380,7 @@ export class SnkCrud {
|
|
|
379
380
|
return;
|
|
380
381
|
}
|
|
381
382
|
this._snkDataUnit.ignoreSaveMessage = this._currentViewMode === VIEW_MODE.GRID;
|
|
382
|
-
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
|
|
383
|
+
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" }))));
|
|
383
384
|
}
|
|
384
385
|
static get is() { return "snk-crud"; }
|
|
385
386
|
static get encapsulation() { return "scoped"; }
|
|
@@ -736,23 +737,37 @@ export class SnkCrud {
|
|
|
736
737
|
"reflect": false,
|
|
737
738
|
"defaultValue": "true"
|
|
738
739
|
},
|
|
739
|
-
"
|
|
740
|
-
"type": "
|
|
740
|
+
"domainMessagesBuilder": {
|
|
741
|
+
"type": "string",
|
|
741
742
|
"mutable": false,
|
|
742
743
|
"complexType": {
|
|
743
|
-
"original": "
|
|
744
|
-
"resolved": "
|
|
744
|
+
"original": "string",
|
|
745
|
+
"resolved": "string",
|
|
745
746
|
"references": {}
|
|
746
747
|
},
|
|
747
748
|
"required": false,
|
|
748
|
-
"optional":
|
|
749
|
+
"optional": false,
|
|
749
750
|
"docs": {
|
|
750
751
|
"tags": [],
|
|
751
|
-
"text": "
|
|
752
|
+
"text": "Define a chave customizada para sobrescrever as mensagens (N\u00E3o pegando pela entidade)"
|
|
752
753
|
},
|
|
753
|
-
"attribute": "
|
|
754
|
-
"reflect": false
|
|
755
|
-
|
|
754
|
+
"attribute": "domain-messages-builder",
|
|
755
|
+
"reflect": false
|
|
756
|
+
},
|
|
757
|
+
"setCustomFormTitle": {
|
|
758
|
+
"type": "unknown",
|
|
759
|
+
"mutable": false,
|
|
760
|
+
"complexType": {
|
|
761
|
+
"original": "() => string",
|
|
762
|
+
"resolved": "() => string",
|
|
763
|
+
"references": {}
|
|
764
|
+
},
|
|
765
|
+
"required": false,
|
|
766
|
+
"optional": false,
|
|
767
|
+
"docs": {
|
|
768
|
+
"tags": [],
|
|
769
|
+
"text": "Define uma fun\u00E7\u00E3o para configurar um t\u00EDtulo cusotmizado no modo formul\u00E1rio."
|
|
770
|
+
}
|
|
756
771
|
}
|
|
757
772
|
};
|
|
758
773
|
}
|
|
@@ -835,6 +850,26 @@ export class SnkCrud {
|
|
|
835
850
|
}
|
|
836
851
|
}
|
|
837
852
|
}
|
|
853
|
+
}, {
|
|
854
|
+
"method": "viewModeChanged",
|
|
855
|
+
"name": "viewModeChanged",
|
|
856
|
+
"bubbles": true,
|
|
857
|
+
"cancelable": true,
|
|
858
|
+
"composed": true,
|
|
859
|
+
"docs": {
|
|
860
|
+
"tags": [],
|
|
861
|
+
"text": ""
|
|
862
|
+
},
|
|
863
|
+
"complexType": {
|
|
864
|
+
"original": "VIEW_MODE",
|
|
865
|
+
"resolved": "VIEW_MODE.ATTACHMENT | VIEW_MODE.FORM | VIEW_MODE.GRID",
|
|
866
|
+
"references": {
|
|
867
|
+
"VIEW_MODE": {
|
|
868
|
+
"location": "import",
|
|
869
|
+
"path": "../../lib/utils/constants"
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
}
|
|
838
873
|
}];
|
|
839
874
|
}
|
|
840
875
|
static get methods() {
|
|
@@ -27,7 +27,7 @@ export class SnkGuidesViewer {
|
|
|
27
27
|
this.resourceID = undefined;
|
|
28
28
|
this.detailTaskbarCustomContainerId = undefined;
|
|
29
29
|
this.formLegacyConfigName = undefined;
|
|
30
|
-
this.
|
|
30
|
+
this.getCustomTitle = undefined;
|
|
31
31
|
this._hasToCreateFieldSearch = true;
|
|
32
32
|
this._breadcrumbItems = [];
|
|
33
33
|
this._guides = undefined;
|
|
@@ -96,7 +96,7 @@ export class SnkGuidesViewer {
|
|
|
96
96
|
this._container.focus();
|
|
97
97
|
}
|
|
98
98
|
exitViewer() {
|
|
99
|
-
if (
|
|
99
|
+
if (this.dataUnit.isDirty()) {
|
|
100
100
|
this.dataUnit.cancelEdition({ after: () => this.exit.emit() });
|
|
101
101
|
}
|
|
102
102
|
else {
|
|
@@ -205,13 +205,10 @@ export class SnkGuidesViewer {
|
|
|
205
205
|
const invisibleButtons = this.getInvisibleButtons();
|
|
206
206
|
this._taskbarProcessor = new TaskbarProcessor({
|
|
207
207
|
"snkGuideViewer.regular": btnsRegularMode,
|
|
208
|
-
"snkGuideViewer.finish_edition": ["CANCEL", "SAVE"
|
|
208
|
+
"snkGuideViewer.finish_edition": ["CANCEL", "SAVE"],
|
|
209
209
|
});
|
|
210
210
|
this._taskbarProcessor.process(taskbarId, this.taskbarManager, this.dataState, disabledButtons, invisibleButtons);
|
|
211
211
|
}
|
|
212
|
-
handleAddGridMode() {
|
|
213
|
-
return this.enableGridInsert ? TaskbarElement.GRID_MODE : "";
|
|
214
|
-
}
|
|
215
212
|
getInvisibleButtons() {
|
|
216
213
|
const invisibleButtons = [];
|
|
217
214
|
if (this.dataState && this.dataState.selectionInfo.mode === SelectionMode.ALL_RECORDS)
|
|
@@ -468,6 +465,10 @@ export class SnkGuidesViewer {
|
|
|
468
465
|
}
|
|
469
466
|
return "";
|
|
470
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
|
+
}
|
|
471
472
|
componentDidLoad() {
|
|
472
473
|
this.dataUnit.subscribe(this.dataUnitActionHandler.bind(this));
|
|
473
474
|
}
|
|
@@ -481,7 +482,7 @@ export class SnkGuidesViewer {
|
|
|
481
482
|
}
|
|
482
483
|
this.loadTaskbarProcessor();
|
|
483
484
|
const showGuides = this._guides && (this._guides.length > 1);
|
|
484
|
-
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 &&
|
|
485
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 ?
|
|
486
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) })
|
|
487
488
|
:
|
|
@@ -799,23 +800,20 @@ export class SnkGuidesViewer {
|
|
|
799
800
|
"attribute": "form-legacy-config-name",
|
|
800
801
|
"reflect": false
|
|
801
802
|
},
|
|
802
|
-
"
|
|
803
|
-
"type": "
|
|
803
|
+
"getCustomTitle": {
|
|
804
|
+
"type": "unknown",
|
|
804
805
|
"mutable": false,
|
|
805
806
|
"complexType": {
|
|
806
|
-
"original": "
|
|
807
|
-
"resolved": "
|
|
807
|
+
"original": "() => string",
|
|
808
|
+
"resolved": "() => string",
|
|
808
809
|
"references": {}
|
|
809
810
|
},
|
|
810
811
|
"required": false,
|
|
811
|
-
"optional":
|
|
812
|
+
"optional": false,
|
|
812
813
|
"docs": {
|
|
813
814
|
"tags": [],
|
|
814
|
-
"text": "
|
|
815
|
-
}
|
|
816
|
-
"attribute": "enable-grid-insert",
|
|
817
|
-
"reflect": false,
|
|
818
|
-
"defaultValue": "false"
|
|
815
|
+
"text": "Fornece uma fun\u00E7\u00E3o para obter um t\u00EDtulo customizado do formul\u00E1rio."
|
|
816
|
+
}
|
|
819
817
|
}
|
|
820
818
|
};
|
|
821
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
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h, Fragment
|
|
1
|
+
import { h, Fragment } from '@stencil/core';
|
|
2
2
|
import { Action as DUAction, ApplicationContext, ElementIDUtils, StringUtils } from '@sankhyalabs/core';
|
|
3
3
|
import { TaskbarElement } from '../snk-taskbar/elements/taskbar-elements';
|
|
4
4
|
import { ConfigStorage } from '../../lib/configs/ConfigStorage';
|
|
@@ -19,7 +19,7 @@ export class SnkGrid {
|
|
|
19
19
|
"snkGridTopTaskbar.regular": ["FORM_MODE", "CONFIGURATOR", "INSERT"],
|
|
20
20
|
"snkGridTopTaskbar.regular.secondary": ["FORM_MODE", "CONFIGURATOR", "INSERT"],
|
|
21
21
|
"snkGridTopTaskbar.regular.singleTaskbar": [],
|
|
22
|
-
"snkGridTopTaskbar.finish_edition": ["CANCEL", "SAVE"
|
|
22
|
+
"snkGridTopTaskbar.finish_edition": ["CANCEL", "SAVE"],
|
|
23
23
|
"snkGridTopTaskbar.finish_edition.secondary": [],
|
|
24
24
|
"snkGridTopTaskbar.finish_edition.singleTaskbar": [],
|
|
25
25
|
});
|
|
@@ -32,7 +32,7 @@ export class SnkGrid {
|
|
|
32
32
|
"snkGridHeaderTaskbar.singleTaskbar.selected": ["UPDATE", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "ATTACH", "FORM_MODE", "CONFIGURATOR", "REFRESH", "DATA_EXPORTER", "ACTIONS_BUTTON"],
|
|
33
33
|
"snkGridHeaderTaskbar.singleTaskbar.detail.unselected": ["INSERT", "FORM_MODE", "CONFIGURATOR", "REFRESH", "MORE_OPTIONS"],
|
|
34
34
|
"snkGridHeaderTaskbar.singleTaskbar.detail.selected": ["UPDATE", "ATTACH", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "FORM_MODE", "CONFIGURATOR", "REFRESH"],
|
|
35
|
-
"snkGridHeaderTaskbar.singleTaskbar.finish_edition": ["CANCEL", "SAVE"
|
|
35
|
+
"snkGridHeaderTaskbar.singleTaskbar.finish_edition": ["CANCEL", "SAVE"]
|
|
36
36
|
});
|
|
37
37
|
this.dataUnitInterceptor = {
|
|
38
38
|
interceptAction: async (action) => {
|
|
@@ -70,7 +70,6 @@ export class SnkGrid {
|
|
|
70
70
|
this.filterBarLegacyConfigName = undefined;
|
|
71
71
|
this.autoLoad = undefined;
|
|
72
72
|
this.autoFocus = true;
|
|
73
|
-
this.enableGridInsert = false;
|
|
74
73
|
}
|
|
75
74
|
/**
|
|
76
75
|
* Exibe a janela de configurações da grade.
|
|
@@ -157,16 +156,6 @@ export class SnkGrid {
|
|
|
157
156
|
async setFocus() {
|
|
158
157
|
this._grid.setFocus();
|
|
159
158
|
}
|
|
160
|
-
async handleClick(event) {
|
|
161
|
-
if (this.hasToBlockEvent(event)) {
|
|
162
|
-
event.preventDefault();
|
|
163
|
-
event.stopPropagation();
|
|
164
|
-
await this._dataUnit.cancelEdition();
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
hasToBlockEvent(event) {
|
|
168
|
-
return this._snkFilterBar.contains(event.target) && this.enableGridInsert && this._dataUnit.hasNewRecord();
|
|
169
|
-
}
|
|
170
159
|
async handleGridLegacyConfigName(newLegacyConfig, oldLegacyConfig) {
|
|
171
160
|
if (!newLegacyConfig) {
|
|
172
161
|
return;
|
|
@@ -177,9 +166,6 @@ export class SnkGrid {
|
|
|
177
166
|
this.addGridLegacyConfigName();
|
|
178
167
|
this.loadConfig();
|
|
179
168
|
}
|
|
180
|
-
handleAddFormMode() {
|
|
181
|
-
return this.enableGridInsert ? TaskbarElement.FORM_MODE : "";
|
|
182
|
-
}
|
|
183
169
|
openGridConfig() {
|
|
184
170
|
this._grid.getColumnsState()
|
|
185
171
|
.then((gridColumns) => {
|
|
@@ -309,9 +295,8 @@ export class SnkGrid {
|
|
|
309
295
|
this.loadConfig();
|
|
310
296
|
}
|
|
311
297
|
componentDidRender() {
|
|
312
|
-
var _a, _b;
|
|
313
298
|
this._rmPrecisionCustomValueFormatter.setGrid(this._grid);
|
|
314
|
-
this.loadGridCustomFormatters(
|
|
299
|
+
this.loadGridCustomFormatters(this._dataUnit.metadata.fields);
|
|
315
300
|
this.setCustomRenders();
|
|
316
301
|
this.setCustomEditors();
|
|
317
302
|
}
|
|
@@ -409,8 +394,6 @@ export class SnkGrid {
|
|
|
409
394
|
eagerInitialize: true,
|
|
410
395
|
itemBuilder: (actionButton, item) => this.getColumnSearch(actionButton, item)
|
|
411
396
|
}];
|
|
412
|
-
if (this.isGridInsertActive())
|
|
413
|
-
return hardList;
|
|
414
397
|
if (this.taskbarManager != undefined && this.taskbarManager.getMoreOptions != undefined) {
|
|
415
398
|
const taskbarID = this.getTopTaskBarId();
|
|
416
399
|
return hardList.concat(this.taskbarManager.getMoreOptions(taskbarID, this.configName, this._dataState, this.actionsList));
|
|
@@ -428,20 +411,12 @@ export class SnkGrid {
|
|
|
428
411
|
}
|
|
429
412
|
this._showSnkFilterBar = true;
|
|
430
413
|
}
|
|
431
|
-
getGridHeaderButtons() {
|
|
432
|
-
if (this.isGridInsertActive())
|
|
433
|
-
return TaskbarElement.MORE_OPTIONS;
|
|
434
|
-
return this._headerTaskbarProcessor.buttons;
|
|
435
|
-
}
|
|
436
|
-
isGridInsertActive() {
|
|
437
|
-
return this.enableGridInsert && this._dataUnit.hasNewRecord();
|
|
438
|
-
}
|
|
439
414
|
render() {
|
|
440
415
|
if (!this._dataUnit) {
|
|
441
416
|
return undefined;
|
|
442
417
|
}
|
|
443
|
-
return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto
|
|
444
|
-
h(Fragment, null, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad }), h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId, overflowStrategy: 'none' }, h("slot", { name: this.topTaskbarCustomSlotId }))), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: (evt) => this.gridDoubleClick.emit(evt.detail), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit, autoFocus: this.autoFocus
|
|
418
|
+
return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto" }, h("div", { class: "snk-grid__header ez-margin-bottom--medium" }, this._showSnkFilterBar &&
|
|
419
|
+
h(Fragment, null, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad }), h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId, overflowStrategy: 'none' }, h("slot", { name: this.topTaskbarCustomSlotId }))), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: (evt) => this.gridDoubleClick.emit(evt.detail), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit, autoFocus: this.autoFocus }, h("snk-taskbar", { id: 'teste', dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, presentationMode: this.presentationMode, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.getActionsList(), primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.gridHeaderCustomSlotId }, h("slot", { name: this.gridHeaderCustomSlotId }))), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" })), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
|
|
445
420
|
}
|
|
446
421
|
static get is() { return "snk-grid"; }
|
|
447
422
|
static get encapsulation() { return "scoped"; }
|
|
@@ -887,24 +862,6 @@ export class SnkGrid {
|
|
|
887
862
|
"attribute": "auto-focus",
|
|
888
863
|
"reflect": false,
|
|
889
864
|
"defaultValue": "true"
|
|
890
|
-
},
|
|
891
|
-
"enableGridInsert": {
|
|
892
|
-
"type": "boolean",
|
|
893
|
-
"mutable": false,
|
|
894
|
-
"complexType": {
|
|
895
|
-
"original": "boolean",
|
|
896
|
-
"resolved": "boolean",
|
|
897
|
-
"references": {}
|
|
898
|
-
},
|
|
899
|
-
"required": false,
|
|
900
|
-
"optional": true,
|
|
901
|
-
"docs": {
|
|
902
|
-
"tags": [],
|
|
903
|
-
"text": "Ativa inser\u00E7\u00E3o de registros no modo grade."
|
|
904
|
-
},
|
|
905
|
-
"attribute": "enable-grid-insert",
|
|
906
|
-
"reflect": false,
|
|
907
|
-
"defaultValue": "false"
|
|
908
865
|
}
|
|
909
866
|
};
|
|
910
867
|
}
|
|
@@ -1186,13 +1143,4 @@ export class SnkGrid {
|
|
|
1186
1143
|
"methodName": "handleGridLegacyConfigName"
|
|
1187
1144
|
}];
|
|
1188
1145
|
}
|
|
1189
|
-
static get listeners() {
|
|
1190
|
-
return [{
|
|
1191
|
-
"name": "click",
|
|
1192
|
-
"method": "handleClick",
|
|
1193
|
-
"target": undefined,
|
|
1194
|
-
"capture": true,
|
|
1195
|
-
"passive": false
|
|
1196
|
-
}];
|
|
1197
|
-
}
|
|
1198
1146
|
}
|