@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-55392.0 → 0.0.0-bugfix-dev-KB-55400.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/{IExporterProvider-91e8acd9.js → IExporterProvider-8687eea9.js} +1 -1
- package/dist/cjs/{SnkFormConfigManager-4259edbe.js → SnkFormConfigManager-df34d678.js} +2 -2
- package/dist/cjs/{SnkMessageBuilder-66aa2557.js → SnkMessageBuilder-9b3c2a2d.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{pesquisa-fetcher-d15951b1.js → pesquisa-fetcher-610c2d29.js} +6 -11
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button_4.cjs.entry.js +2 -1
- package/dist/cjs/snk-application.cjs.entry.js +3 -2
- package/dist/cjs/snk-attach.cjs.entry.js +3 -2
- package/dist/cjs/snk-crud.cjs.entry.js +2 -1
- package/dist/cjs/snk-data-exporter.cjs.entry.js +4 -3
- package/dist/cjs/{snk-data-unit-abd2113f.js → snk-data-unit-63589ae8.js} +81 -22
- package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
- package/dist/cjs/snk-detail-view.cjs.entry.js +5 -4
- package/dist/cjs/snk-form.cjs.entry.js +1 -1
- package/dist/cjs/snk-grid.cjs.entry.js +3 -2
- package/dist/cjs/{snk-guides-viewer-eee0b978.js → snk-guides-viewer-bef9ca55.js} +2 -2
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +4 -3
- package/dist/cjs/snk-simple-crud.cjs.entry.js +13 -4
- package/dist/collection/components/snk-attach/snk-attach.js +1 -1
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +100 -22
- package/dist/collection/components/snk-form-config/SnkFormConfigManager.js +2 -2
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +9 -1
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.js +3 -12
- package/dist/collection/lib/message/SnkMessageBuilder.js +21 -21
- package/dist/components/SnkFormConfigManager.js +2 -2
- package/dist/components/SnkMessageBuilder.js +1 -1
- package/dist/components/dataunit-fetcher.js +3 -12
- package/dist/components/snk-attach2.js +1 -1
- package/dist/components/snk-data-unit2.js +82 -22
- package/dist/components/snk-simple-crud2.js +9 -1
- package/dist/esm/{IExporterProvider-c3bd60f3.js → IExporterProvider-0af5ebd3.js} +1 -1
- package/dist/esm/{SnkFormConfigManager-a87ade7a.js → SnkFormConfigManager-02e9bdcd.js} +2 -2
- package/dist/esm/{SnkMessageBuilder-0a4becdd.js → SnkMessageBuilder-a26aa279.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{pesquisa-fetcher-9e18940f.js → pesquisa-fetcher-253715e4.js} +3 -12
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button_4.entry.js +2 -1
- package/dist/esm/snk-application.entry.js +3 -2
- package/dist/esm/snk-attach.entry.js +3 -2
- package/dist/esm/snk-crud.entry.js +2 -1
- package/dist/esm/snk-data-exporter.entry.js +4 -3
- package/dist/esm/{snk-data-unit-29eba11a.js → snk-data-unit-0252289c.js} +82 -23
- package/dist/esm/snk-data-unit.entry.js +2 -2
- package/dist/esm/snk-detail-view.entry.js +5 -4
- package/dist/esm/snk-form.entry.js +1 -1
- package/dist/esm/snk-grid.entry.js +3 -2
- package/dist/esm/{snk-guides-viewer-4fd4e25a.js → snk-guides-viewer-96253964.js} +2 -2
- package/dist/esm/snk-guides-viewer.entry.js +4 -3
- package/dist/esm/snk-simple-crud.entry.js +13 -4
- package/dist/sankhyablocks/p-41c05011.js +1 -0
- package/dist/sankhyablocks/{p-65b6dba3.entry.js → p-4a16dc22.entry.js} +1 -1
- package/dist/sankhyablocks/p-4d10e705.entry.js +1 -0
- package/dist/sankhyablocks/p-5447a6a6.entry.js +1 -0
- package/dist/sankhyablocks/p-5e7fa584.entry.js +1 -0
- package/dist/sankhyablocks/p-674e142a.js +1 -0
- package/dist/sankhyablocks/p-69bf12f9.js +65 -0
- package/dist/sankhyablocks/p-74eed0fd.entry.js +1 -0
- package/dist/sankhyablocks/p-79bae662.entry.js +1 -0
- package/dist/sankhyablocks/p-89b544c9.entry.js +1 -0
- package/dist/sankhyablocks/{p-9b94aaa9.js → p-93b9da9b.js} +1 -1
- package/dist/sankhyablocks/{p-52ec26b8.entry.js → p-accfaecf.entry.js} +3 -3
- package/dist/sankhyablocks/p-ad73e9d7.entry.js +1 -0
- package/dist/sankhyablocks/{p-32556aa6.js → p-bc51e7ca.js} +1 -1
- package/dist/sankhyablocks/{p-e0649a17.js → p-e8bbd578.js} +1 -1
- package/dist/sankhyablocks/{p-388d00f5.entry.js → p-ea89c934.entry.js} +1 -1
- package/dist/sankhyablocks/p-ecfa87e8.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +16 -1
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +1 -0
- package/dist/types/components.d.ts +4 -0
- package/package.json +1 -1
- package/dist/sankhyablocks/p-07825198.js +0 -1
- package/dist/sankhyablocks/p-07d324ba.entry.js +0 -1
- package/dist/sankhyablocks/p-0e8702f0.js +0 -1
- package/dist/sankhyablocks/p-3de247d1.entry.js +0 -1
- package/dist/sankhyablocks/p-56f95797.entry.js +0 -1
- package/dist/sankhyablocks/p-595e7068.entry.js +0 -1
- package/dist/sankhyablocks/p-5c0a8a13.entry.js +0 -1
- package/dist/sankhyablocks/p-775253f7.entry.js +0 -1
- package/dist/sankhyablocks/p-81abd586.entry.js +0 -1
- package/dist/sankhyablocks/p-f678bffa.js +0 -65
- package/dist/sankhyablocks/p-fa84e72f.entry.js +0 -1
|
@@ -4,10 +4,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
|
-
const SnkFormConfigManager = require('./SnkFormConfigManager-
|
|
7
|
+
const SnkFormConfigManager = require('./SnkFormConfigManager-df34d678.js');
|
|
8
8
|
const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
|
|
9
9
|
require('./form-config-fetcher-3c4daeb5.js');
|
|
10
|
-
require('./pesquisa-fetcher-
|
|
10
|
+
require('./pesquisa-fetcher-610c2d29.js');
|
|
11
11
|
const index$1 = require('./index-0922807b.js');
|
|
12
12
|
require('./ISave-e91b70a7.js');
|
|
13
13
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
|
@@ -15,11 +15,12 @@ require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
|
|
15
15
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
|
16
16
|
const taskbarElements = require('./taskbar-elements-d9392685.js');
|
|
17
17
|
const constants = require('./constants-35ddd366.js');
|
|
18
|
-
const snkGuidesViewer = require('./snk-guides-viewer-
|
|
19
|
-
const SnkMessageBuilder = require('./SnkMessageBuilder-
|
|
18
|
+
const snkGuidesViewer = require('./snk-guides-viewer-bef9ca55.js');
|
|
19
|
+
const SnkMessageBuilder = require('./SnkMessageBuilder-9b3c2a2d.js');
|
|
20
20
|
require('./ConfigStorage-7df9d3bb.js');
|
|
21
21
|
require('./PrintUtils-bcaeb82f.js');
|
|
22
22
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
|
|
23
|
+
require('@sankhyalabs/core/dist/utils/SortingUtils');
|
|
23
24
|
require('./ResourceIDUtils-5ff86aa7.js');
|
|
24
25
|
require('./index-102ba62d.js');
|
|
25
26
|
require('./field-search-f56aa7d6.js');
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
|
-
const SnkFormConfigManager = require('./SnkFormConfigManager-
|
|
7
|
+
const SnkFormConfigManager = require('./SnkFormConfigManager-df34d678.js');
|
|
8
8
|
const ResourceIDUtils = require('./ResourceIDUtils-5ff86aa7.js');
|
|
9
9
|
require('./ConfigStorage-7df9d3bb.js');
|
|
10
10
|
require('./form-config-fetcher-3c4daeb5.js');
|
|
@@ -9,10 +9,10 @@ const ConfigStorage = require('./ConfigStorage-7df9d3bb.js');
|
|
|
9
9
|
const index$1 = require('./index-0922807b.js');
|
|
10
10
|
const fieldSearch = require('./field-search-f56aa7d6.js');
|
|
11
11
|
const index$2 = require('./index-102ba62d.js');
|
|
12
|
-
const IExporterProvider = require('./IExporterProvider-
|
|
12
|
+
const IExporterProvider = require('./IExporterProvider-8687eea9.js');
|
|
13
13
|
const DataUnit = require('@sankhyalabs/core/dist/dataunit/DataUnit');
|
|
14
14
|
require('./form-config-fetcher-3c4daeb5.js');
|
|
15
|
-
require('./pesquisa-fetcher-
|
|
15
|
+
require('./pesquisa-fetcher-610c2d29.js');
|
|
16
16
|
require('./ISave-e91b70a7.js');
|
|
17
17
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
|
18
18
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
|
@@ -21,6 +21,7 @@ const RecordIDUtils = require('./RecordIDUtils-3735135c.js');
|
|
|
21
21
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource');
|
|
22
22
|
require('./PrintUtils-bcaeb82f.js');
|
|
23
23
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
|
|
24
|
+
require('@sankhyalabs/core/dist/utils/SortingUtils');
|
|
24
25
|
require('./ResourceIDUtils-5ff86aa7.js');
|
|
25
26
|
|
|
26
27
|
class ServerSideExporterProvider extends IExporterProvider.CommonsExporter {
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
const index = require('./index-f9e81701.js');
|
|
4
4
|
const core = require('@sankhyalabs/core');
|
|
5
|
-
const SnkFormConfigManager = require('./SnkFormConfigManager-
|
|
5
|
+
const SnkFormConfigManager = require('./SnkFormConfigManager-df34d678.js');
|
|
6
6
|
const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
|
|
7
7
|
const fieldSearch = require('./field-search-f56aa7d6.js');
|
|
8
8
|
const taskbarElements = require('./taskbar-elements-d9392685.js');
|
|
9
9
|
const constants = require('./constants-35ddd366.js');
|
|
10
10
|
require('./form-config-fetcher-3c4daeb5.js');
|
|
11
|
-
require('./pesquisa-fetcher-
|
|
11
|
+
require('./pesquisa-fetcher-610c2d29.js');
|
|
12
12
|
const index$1 = require('./index-0922807b.js');
|
|
13
13
|
require('./ISave-e91b70a7.js');
|
|
14
14
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const snkGuidesViewer = require('./snk-guides-viewer-
|
|
5
|
+
const snkGuidesViewer = require('./snk-guides-viewer-bef9ca55.js');
|
|
6
6
|
require('./index-f9e81701.js');
|
|
7
7
|
require('@sankhyalabs/core');
|
|
8
|
-
require('./SnkFormConfigManager-
|
|
8
|
+
require('./SnkFormConfigManager-df34d678.js');
|
|
9
9
|
require('./ConfigStorage-7df9d3bb.js');
|
|
10
10
|
require('./form-config-fetcher-3c4daeb5.js');
|
|
11
11
|
require('./PrintUtils-bcaeb82f.js');
|
|
@@ -17,9 +17,10 @@ require('./taskbar-elements-d9392685.js');
|
|
|
17
17
|
require('./index-0922807b.js');
|
|
18
18
|
require('./index-102ba62d.js');
|
|
19
19
|
require('./constants-35ddd366.js');
|
|
20
|
-
require('./pesquisa-fetcher-
|
|
20
|
+
require('./pesquisa-fetcher-610c2d29.js');
|
|
21
21
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
|
22
22
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
|
|
23
|
+
require('@sankhyalabs/core/dist/utils/SortingUtils');
|
|
23
24
|
require('./ResourceIDUtils-5ff86aa7.js');
|
|
24
25
|
require('./ISave-e91b70a7.js');
|
|
25
26
|
require('@sankhyalabs/core/dist/dataunit/DataUnit');
|
|
@@ -8,8 +8,8 @@ const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
|
|
8
8
|
const constants = require('./constants-35ddd366.js');
|
|
9
9
|
const taskbarElements = require('./taskbar-elements-d9392685.js');
|
|
10
10
|
const formConfigFetcher = require('./form-config-fetcher-3c4daeb5.js');
|
|
11
|
-
const pesquisaFetcher = require('./pesquisa-fetcher-
|
|
12
|
-
const IExporterProvider = require('./IExporterProvider-
|
|
11
|
+
const pesquisaFetcher = require('./pesquisa-fetcher-610c2d29.js');
|
|
12
|
+
const IExporterProvider = require('./IExporterProvider-8687eea9.js');
|
|
13
13
|
const index = require('./index-0922807b.js');
|
|
14
14
|
require('./ISave-e91b70a7.js');
|
|
15
15
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
|
@@ -17,11 +17,12 @@ require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
|
|
17
17
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
|
18
18
|
const fieldSearch = require('./field-search-f56aa7d6.js');
|
|
19
19
|
const ConfigStorage = require('./ConfigStorage-7df9d3bb.js');
|
|
20
|
-
const SnkFormConfigManager = require('./SnkFormConfigManager-
|
|
20
|
+
const SnkFormConfigManager = require('./SnkFormConfigManager-df34d678.js');
|
|
21
21
|
const RecordIDUtils = require('./RecordIDUtils-3735135c.js');
|
|
22
22
|
const index$2 = require('./index-102ba62d.js');
|
|
23
23
|
require('./PrintUtils-bcaeb82f.js');
|
|
24
24
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
|
|
25
|
+
require('@sankhyalabs/core/dist/utils/SortingUtils');
|
|
25
26
|
require('./ResourceIDUtils-5ff86aa7.js');
|
|
26
27
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource');
|
|
27
28
|
|
|
@@ -623,13 +624,21 @@ const SnkSimpleCrud = class {
|
|
|
623
624
|
}
|
|
624
625
|
return configFromManager;
|
|
625
626
|
}
|
|
627
|
+
updateFormConfig() {
|
|
628
|
+
const newConfig = Object.assign(Object.assign({}, this.formConfig), { fields: this.dataUnit.metadata.fields });
|
|
629
|
+
this.setFormConfig(newConfig, true);
|
|
630
|
+
if (this._formConfigManager == undefined) {
|
|
631
|
+
this._formConfigManager = new SnkFormConfigManager.SnkFormConfigManager(this.configName, this.resolveResourceID());
|
|
632
|
+
}
|
|
633
|
+
this._formConfigManager.setConfig(this.formConfig);
|
|
634
|
+
}
|
|
626
635
|
/* istanbul ignore next */
|
|
627
636
|
render() {
|
|
628
637
|
var _a;
|
|
629
638
|
if (this.dataUnit == undefined) {
|
|
630
639
|
return;
|
|
631
640
|
}
|
|
632
|
-
return (index$1.h("snk-data-unit", { 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 }, 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(pesquisaFetcher.InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
|
|
641
|
+
return (index$1.h("snk-data-unit", { 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) }, 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(pesquisaFetcher.InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
|
|
633
642
|
? undefined
|
|
634
643
|
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab }, index$1.h("div", { slot: "footer" }, index$1.h("slot", { name: "snkSimpleCrudFooter" })))), index$1.h("stack-item", null, index$1.h("ez-form", { 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() }))));
|
|
635
644
|
}
|
|
@@ -162,8 +162,8 @@ export class SnkAttach {
|
|
|
162
162
|
(_b = this._currentDataUnitBuilder) === null || _b === void 0 ? void 0 : _b.initLoaders(this._currentDataUnit, this._currentFetcher, this.returnToGridMode.bind(this));
|
|
163
163
|
}
|
|
164
164
|
if (this.fetcherType === "Attach") {
|
|
165
|
-
this._currentDataUnitBuilder = new AttachFetcherDataUnitFactory(this.getMessage.bind(this));
|
|
166
165
|
this._currentFetcher = new AttachFetcher();
|
|
166
|
+
this._currentDataUnitBuilder = new AttachFetcherDataUnitFactory(this.getMessage.bind(this));
|
|
167
167
|
(_c = this._currentDataUnitBuilder) === null || _c === void 0 ? void 0 : _c.initLoaders(this._currentDataUnit, this._currentFetcher, async () => {
|
|
168
168
|
this.returnToGridMode();
|
|
169
169
|
await this._currentDataUnit.loadData(undefined, undefined, true, this.registerKey);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Host, h } from '@stencil/core';
|
|
2
|
-
import { Action, ApplicationContext, DataUnitAction, ObjectUtils } from '@sankhyalabs/core';
|
|
2
|
+
import { Action, ApplicationContext, DataUnitAction, ObjectUtils, StringUtils } from '@sankhyalabs/core';
|
|
3
3
|
import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
4
4
|
import { OperationMap, SnkMessageBuilder } from '../../lib/message/SnkMessageBuilder';
|
|
5
5
|
import { getSelectedIDs } from '../snk-data-exporter/utils/RecordIDUtils';
|
|
@@ -7,6 +7,7 @@ export class SnkDataUnit {
|
|
|
7
7
|
constructor() {
|
|
8
8
|
this._onDataUnitResolve = [];
|
|
9
9
|
this._openedAlert = false;
|
|
10
|
+
this.REGEX_DATAUNIT_NAME = /dd:\/\/(.+?)\//;
|
|
10
11
|
this._dataUnitObserver = (action) => {
|
|
11
12
|
var _a, _b;
|
|
12
13
|
const duState = this.buildDataState();
|
|
@@ -51,6 +52,7 @@ export class SnkDataUnit {
|
|
|
51
52
|
}
|
|
52
53
|
this.messagesBuilder.currentOperation = this.getMessageOperation();
|
|
53
54
|
};
|
|
55
|
+
this.fieldsToLink = [];
|
|
54
56
|
this.dataState = undefined;
|
|
55
57
|
this.messagesBuilder = undefined;
|
|
56
58
|
this.dataUnitName = undefined;
|
|
@@ -130,7 +132,7 @@ export class SnkDataUnit {
|
|
|
130
132
|
switch (action.type) {
|
|
131
133
|
case Action.RECORDS_ADDED:
|
|
132
134
|
if (this.isAllowed("INSERT")) {
|
|
133
|
-
resolve(action);
|
|
135
|
+
resolve(new DataUnitAction(Action.RECORDS_ADDED, this.handleLinksWithParent(action.payload)));
|
|
134
136
|
}
|
|
135
137
|
else {
|
|
136
138
|
ApplicationUtils.info(this.getMessage("snkDataUnit.forbiddenInsert"));
|
|
@@ -138,21 +140,15 @@ export class SnkDataUnit {
|
|
|
138
140
|
break;
|
|
139
141
|
case Action.RECORDS_COPIED:
|
|
140
142
|
if (this.isAllowed("CLONE")) {
|
|
141
|
-
|
|
142
|
-
if (cleanFields.length > 0) {
|
|
143
|
-
const records = action.payload;
|
|
144
|
-
action = new DataUnitAction(Action.RECORDS_COPIED, records.map(record => {
|
|
145
|
-
const newRecord = Object.assign({}, record);
|
|
146
|
-
cleanFields.forEach(fieldName => delete newRecord[fieldName]);
|
|
147
|
-
return newRecord;
|
|
148
|
-
}));
|
|
149
|
-
}
|
|
150
|
-
resolve(action);
|
|
143
|
+
resolve(new DataUnitAction(Action.RECORDS_COPIED, this.handleRecordsCopied(action.payload)));
|
|
151
144
|
}
|
|
152
145
|
else {
|
|
153
146
|
ApplicationUtils.info(this.getMessage("snkDataUnit.forbiddenClone"));
|
|
154
147
|
}
|
|
155
148
|
break;
|
|
149
|
+
case Action.METADATA_LOADED:
|
|
150
|
+
resolve(new DataUnitAction(Action.METADATA_LOADED, this.handleMetadataLoaded(action.payload)));
|
|
151
|
+
break;
|
|
156
152
|
case Action.DATA_CHANGED:
|
|
157
153
|
case Action.CHANGING_DATA:
|
|
158
154
|
if (this.isAllowed("UPDATE"))
|
|
@@ -246,6 +242,47 @@ export class SnkDataUnit {
|
|
|
246
242
|
}
|
|
247
243
|
});
|
|
248
244
|
}
|
|
245
|
+
handleMetadataLoaded(payload) {
|
|
246
|
+
const metadata = Object.assign({}, payload);
|
|
247
|
+
this.processLinks(metadata);
|
|
248
|
+
return metadata;
|
|
249
|
+
}
|
|
250
|
+
handleRecordsCopied(initialRecords) {
|
|
251
|
+
let records = [...initialRecords];
|
|
252
|
+
records = this.handleCleanOnCopy(records);
|
|
253
|
+
return this.handleLinksWithParent(records);
|
|
254
|
+
}
|
|
255
|
+
handleLinksWithParent(records) {
|
|
256
|
+
var _a, _b;
|
|
257
|
+
const parentDataUnit = (_a = this._parentDataUnit) !== null && _a !== void 0 ? _a : (_b = this.dataUnit) === null || _b === void 0 ? void 0 : _b.getParentDataUnit();
|
|
258
|
+
if (!parentDataUnit)
|
|
259
|
+
return records;
|
|
260
|
+
const parentSelectedRecord = parentDataUnit.getSelectedRecord();
|
|
261
|
+
const selfInfo = parentDataUnit === null || parentDataUnit === void 0 ? void 0 : parentDataUnit.getChildInfo(this.getCleanDataUnitName());
|
|
262
|
+
const { links } = selfInfo;
|
|
263
|
+
if (!links || links.length === 0)
|
|
264
|
+
return records;
|
|
265
|
+
return records.map(record => {
|
|
266
|
+
return this.buildRecordWithLinkedFields(record, links, parentSelectedRecord);
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
buildRecordWithLinkedFields(record, links, parentSelectedRecord) {
|
|
270
|
+
const newRecord = Object.assign({}, record);
|
|
271
|
+
links.forEach(link => newRecord[link.target] = parentSelectedRecord[link.source]);
|
|
272
|
+
return newRecord;
|
|
273
|
+
}
|
|
274
|
+
handleCleanOnCopy(records) {
|
|
275
|
+
const cleanFields = this.getCleanOnCopyFields();
|
|
276
|
+
if (cleanFields.length > 0) {
|
|
277
|
+
records = records.map(record => this.buildCopyWithCleanedFields(record, cleanFields));
|
|
278
|
+
}
|
|
279
|
+
return records;
|
|
280
|
+
}
|
|
281
|
+
buildCopyWithCleanedFields(record, cleanFields) {
|
|
282
|
+
const newRecord = Object.assign({}, record);
|
|
283
|
+
cleanFields.forEach(fieldName => delete newRecord[fieldName]);
|
|
284
|
+
return newRecord;
|
|
285
|
+
}
|
|
249
286
|
showSuccessMessage(message) {
|
|
250
287
|
ApplicationUtils.info(message, { iconName: "check" });
|
|
251
288
|
}
|
|
@@ -336,20 +373,40 @@ export class SnkDataUnit {
|
|
|
336
373
|
return;
|
|
337
374
|
}
|
|
338
375
|
handlerLinkFields() {
|
|
339
|
-
var _a, _b;
|
|
340
|
-
const
|
|
341
|
-
if (!
|
|
376
|
+
var _a, _b, _c, _d;
|
|
377
|
+
const parentDU = (_a = this._parentDataUnit) !== null && _a !== void 0 ? _a : (_b = this.dataUnit) === null || _b === void 0 ? void 0 : _b.getParentDataUnit();
|
|
378
|
+
if (!parentDU)
|
|
342
379
|
return;
|
|
343
|
-
const
|
|
380
|
+
const childName = (_c = this.entityName) !== null && _c !== void 0 ? _c : this.getCleanDataUnitName();
|
|
381
|
+
const child = parentDU.getChildInfo(childName);
|
|
344
382
|
if (!child)
|
|
345
383
|
return;
|
|
346
|
-
const
|
|
347
|
-
(
|
|
348
|
-
|
|
384
|
+
const links = (_d = child === null || child === void 0 ? void 0 : child.links) === null || _d === void 0 ? void 0 : _d.map(link => link.target);
|
|
385
|
+
this.handleDUWithLinks(links);
|
|
386
|
+
}
|
|
387
|
+
handleDUWithLinks(fieldsToLink) {
|
|
388
|
+
this.fieldsToLink = fieldsToLink;
|
|
389
|
+
const metadata = Object.assign({}, this.dataUnit.metadata);
|
|
390
|
+
this.processLinks(metadata);
|
|
391
|
+
this.dataUnit.metadata = metadata;
|
|
392
|
+
this.dataUnitFieldsHidded.emit();
|
|
393
|
+
}
|
|
394
|
+
processLinks(metadata) {
|
|
395
|
+
var _a;
|
|
396
|
+
(_a = metadata === null || metadata === void 0 ? void 0 : metadata.fields) === null || _a === void 0 ? void 0 : _a.forEach(field => {
|
|
397
|
+
var _a;
|
|
398
|
+
if ((_a = this.fieldsToLink) === null || _a === void 0 ? void 0 : _a.includes(field.name)) {
|
|
349
399
|
field.visible = false;
|
|
350
400
|
}
|
|
351
401
|
});
|
|
352
|
-
|
|
402
|
+
}
|
|
403
|
+
getCleanDataUnitName() {
|
|
404
|
+
var _a;
|
|
405
|
+
const uri = this.dataUnit.name;
|
|
406
|
+
if (StringUtils.isEmpty(uri))
|
|
407
|
+
return uri;
|
|
408
|
+
const matcher = this.REGEX_DATAUNIT_NAME.exec(uri);
|
|
409
|
+
return (_a = matcher === null || matcher === void 0 ? void 0 : matcher[1]) !== null && _a !== void 0 ? _a : uri;
|
|
353
410
|
}
|
|
354
411
|
static getNearestInstance(element) {
|
|
355
412
|
let parent = element.parentElement;
|
|
@@ -376,8 +433,9 @@ export class SnkDataUnit {
|
|
|
376
433
|
this.dataUnit.releaseCallbacks();
|
|
377
434
|
}
|
|
378
435
|
}
|
|
379
|
-
componentDidLoad() {
|
|
380
|
-
this.loadDataUnit();
|
|
436
|
+
async componentDidLoad() {
|
|
437
|
+
await this.loadDataUnit();
|
|
438
|
+
this.handlerLinkFields();
|
|
381
439
|
}
|
|
382
440
|
render() {
|
|
383
441
|
return (h(Host, null));
|
|
@@ -611,6 +669,11 @@ export class SnkDataUnit {
|
|
|
611
669
|
}
|
|
612
670
|
};
|
|
613
671
|
}
|
|
672
|
+
static get states() {
|
|
673
|
+
return {
|
|
674
|
+
"fieldsToLink": {}
|
|
675
|
+
};
|
|
676
|
+
}
|
|
614
677
|
static get events() {
|
|
615
678
|
return [{
|
|
616
679
|
"method": "dataStateChange",
|
|
@@ -671,6 +734,21 @@ export class SnkDataUnit {
|
|
|
671
734
|
}
|
|
672
735
|
}
|
|
673
736
|
}
|
|
737
|
+
}, {
|
|
738
|
+
"method": "dataUnitFieldsHidded",
|
|
739
|
+
"name": "dataUnitFieldsHidded",
|
|
740
|
+
"bubbles": true,
|
|
741
|
+
"cancelable": true,
|
|
742
|
+
"composed": true,
|
|
743
|
+
"docs": {
|
|
744
|
+
"tags": [],
|
|
745
|
+
"text": "Emitido quando h\u00E1 campos no DataUnit que devem ser ocultados."
|
|
746
|
+
},
|
|
747
|
+
"complexType": {
|
|
748
|
+
"original": "void",
|
|
749
|
+
"resolved": "void",
|
|
750
|
+
"references": {}
|
|
751
|
+
}
|
|
674
752
|
}, {
|
|
675
753
|
"method": "insertionMode",
|
|
676
754
|
"name": "insertionMode",
|
|
@@ -71,11 +71,11 @@ export class SnkFormConfigManager {
|
|
|
71
71
|
var _a;
|
|
72
72
|
const fields = (_a = this._config) === null || _a === void 0 ? void 0 : _a.fields;
|
|
73
73
|
if (fields != undefined && fields.length > 0) {
|
|
74
|
-
return fields.map(({ label, name, readOnly }) => {
|
|
74
|
+
return fields.map(({ label, name, readOnly, visible }) => {
|
|
75
75
|
if (label == undefined) {
|
|
76
76
|
return dataUnit.getField(name);
|
|
77
77
|
}
|
|
78
|
-
return { name, label, readOnly };
|
|
78
|
+
return { name, label, readOnly, visible };
|
|
79
79
|
})
|
|
80
80
|
.filter(field => this.isFieldVisible(field, descriptionFilter));
|
|
81
81
|
}
|
|
@@ -549,13 +549,21 @@ export class SnkSimpleCrud {
|
|
|
549
549
|
}
|
|
550
550
|
return configFromManager;
|
|
551
551
|
}
|
|
552
|
+
updateFormConfig() {
|
|
553
|
+
const newConfig = Object.assign(Object.assign({}, this.formConfig), { fields: this.dataUnit.metadata.fields });
|
|
554
|
+
this.setFormConfig(newConfig, true);
|
|
555
|
+
if (this._formConfigManager == undefined) {
|
|
556
|
+
this._formConfigManager = new SnkFormConfigManager(this.configName, this.resolveResourceID());
|
|
557
|
+
}
|
|
558
|
+
this._formConfigManager.setConfig(this.formConfig);
|
|
559
|
+
}
|
|
552
560
|
/* istanbul ignore next */
|
|
553
561
|
render() {
|
|
554
562
|
var _a;
|
|
555
563
|
if (this.dataUnit == undefined) {
|
|
556
564
|
return;
|
|
557
565
|
}
|
|
558
|
-
return (h("snk-data-unit", { class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), 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 }, 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)
|
|
566
|
+
return (h("snk-data-unit", { class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), 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)
|
|
559
567
|
? undefined
|
|
560
568
|
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab }, h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, h("ez-form", { 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() }))));
|
|
561
569
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { DataUnit
|
|
1
|
+
import { DataUnit } from "@sankhyalabs/core";
|
|
2
2
|
import { ArrayRepository } from "./ArrayRepository";
|
|
3
3
|
import { ColumnFilterManager } from "@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";
|
|
4
|
+
import SortingUtils from "@sankhyalabs/core/dist/utils/SortingUtils";
|
|
4
5
|
export default class PreloadManager {
|
|
5
6
|
static setLoadingStatus(dataUnit, loadingInProgress) {
|
|
6
7
|
this._loadingStatus.set(dataUnit.name, loadingInProgress);
|
|
@@ -20,17 +21,7 @@ export default class PreloadManager {
|
|
|
20
21
|
}
|
|
21
22
|
}
|
|
22
23
|
static getSortingFunction(dataUnit, sorting) {
|
|
23
|
-
|
|
24
|
-
return undefined;
|
|
25
|
-
}
|
|
26
|
-
return (recordA, recordB) => {
|
|
27
|
-
for (const sort of sorting) {
|
|
28
|
-
const result = FieldComparator.compare(dataUnit.getField(sort.field), recordA, recordB, sort.mode === SortMode.ASC);
|
|
29
|
-
if (result != 0) {
|
|
30
|
-
return result;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
};
|
|
24
|
+
return SortingUtils.getSortingFunction(dataUnit, sorting);
|
|
34
25
|
}
|
|
35
26
|
static async getDistinct(dataUnit, fieldName) {
|
|
36
27
|
if (!PreloadManager.isCacheEnabled(dataUnit)) {
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import snkDataUnitMessages from "./resources/snk-data-unit.msg
|
|
2
|
-
import snkFilterBarMessages from "./resources/snk-filter-bar.msg
|
|
3
|
-
import snkTaskbarMessages from "./resources/snk-taskbar.msg
|
|
4
|
-
import crudUtilsMessages from "./resources/crud-utils.msg
|
|
5
|
-
import snkExporterMessages from "./resources/snk-exporter.msg
|
|
6
|
-
import snkCrudMessages from "./resources/snk-crud.msg
|
|
7
|
-
import snkSimpleCrudMessages from "./resources/snk-simple-crud.msg
|
|
8
|
-
import fileViewerMessages from "./resources/file-viewer.msg
|
|
9
|
-
import snkApplicationMessages from "./resources/snk-application.msg
|
|
10
|
-
import { snkFormConfigMessages, snkConfigOptionsMessages, snkFieldConfigMessages, snkTabConfigMessages } from "./resources/snk-form.msg
|
|
11
|
-
import { snkConfiguratorMessages } from "./resources/snk-configurator.msg
|
|
12
|
-
import { snkGridMessages, snkGridConfigMessages } from "./resources/snk-grid.msg
|
|
13
|
-
import { snkDataExporterMessages } from "./resources/snk-data-exporter.msg
|
|
14
|
-
import { snkFilterParamConfigMessages } from "./resources/snk-filter-param-config.msg
|
|
15
|
-
import { snkFilterFieldSearchMessages } from "./resources/snk-filter-field-search.msg
|
|
16
|
-
import { snkSimpleBarMessages } from './resources/snk-simple-bar.msg
|
|
1
|
+
import snkDataUnitMessages from "./resources/snk-data-unit.msg";
|
|
2
|
+
import snkFilterBarMessages from "./resources/snk-filter-bar.msg";
|
|
3
|
+
import snkTaskbarMessages from "./resources/snk-taskbar.msg";
|
|
4
|
+
import crudUtilsMessages from "./resources/crud-utils.msg";
|
|
5
|
+
import snkExporterMessages from "./resources/snk-exporter.msg";
|
|
6
|
+
import snkCrudMessages from "./resources/snk-crud.msg";
|
|
7
|
+
import snkSimpleCrudMessages from "./resources/snk-simple-crud.msg";
|
|
8
|
+
import fileViewerMessages from "./resources/file-viewer.msg";
|
|
9
|
+
import snkApplicationMessages from "./resources/snk-application.msg";
|
|
10
|
+
import { snkFormConfigMessages, snkConfigOptionsMessages, snkFieldConfigMessages, snkTabConfigMessages } from "./resources/snk-form.msg";
|
|
11
|
+
import { snkConfiguratorMessages } from "./resources/snk-configurator.msg";
|
|
12
|
+
import { snkGridMessages, snkGridConfigMessages } from "./resources/snk-grid.msg";
|
|
13
|
+
import { snkDataExporterMessages } from "./resources/snk-data-exporter.msg";
|
|
14
|
+
import { snkFilterParamConfigMessages } from "./resources/snk-filter-param-config.msg";
|
|
15
|
+
import { snkFilterFieldSearchMessages } from "./resources/snk-filter-field-search.msg";
|
|
16
|
+
import { snkSimpleBarMessages } from './resources/snk-simple-bar.msg';
|
|
17
17
|
import { snkAttachMessages } from "./resources/snk-attach.msg";
|
|
18
|
-
import { snkPersonalizedFilterMessages } from "./resources/snk-personalized-filter.msg
|
|
19
|
-
import { snkEntityListMessages } from "./resources/snk-entity-list.msg
|
|
20
|
-
import { snkActionsButtonMessages } from "./resources/snk-actions-button.msg
|
|
21
|
-
import { snkPrintSelectorMessages } from "./resources/snk-print-selector.msg
|
|
18
|
+
import { snkPersonalizedFilterMessages } from "./resources/snk-personalized-filter.msg";
|
|
19
|
+
import { snkEntityListMessages } from "./resources/snk-entity-list.msg";
|
|
20
|
+
import { snkActionsButtonMessages } from "./resources/snk-actions-button.msg";
|
|
21
|
+
import { snkPrintSelectorMessages } from "./resources/snk-print-selector.msg";
|
|
22
22
|
import { ApplicationContext } from "@sankhyalabs/core";
|
|
23
23
|
export class SnkMessageBuilder {
|
|
24
24
|
constructor(domainName) {
|
|
@@ -55,7 +55,7 @@ export class SnkMessageBuilder {
|
|
|
55
55
|
this.loadAppMessages().then((msgs) => {
|
|
56
56
|
this._appMessages = msgs;
|
|
57
57
|
}, error => {
|
|
58
|
-
console.info('O arquivo de mensagens personalizadas não foi encontrado no caminho /messages/appmessages
|
|
58
|
+
console.info('O arquivo de mensagens personalizadas não foi encontrado no caminho /messages/appmessages', error);
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
/**
|
|
@@ -72,11 +72,11 @@ class SnkFormConfigManager {
|
|
|
72
72
|
var _a;
|
|
73
73
|
const fields = (_a = this._config) === null || _a === void 0 ? void 0 : _a.fields;
|
|
74
74
|
if (fields != undefined && fields.length > 0) {
|
|
75
|
-
return fields.map(({ label, name, readOnly }) => {
|
|
75
|
+
return fields.map(({ label, name, readOnly, visible }) => {
|
|
76
76
|
if (label == undefined) {
|
|
77
77
|
return dataUnit.getField(name);
|
|
78
78
|
}
|
|
79
|
-
return { name, label, readOnly };
|
|
79
|
+
return { name, label, readOnly, visible };
|
|
80
80
|
})
|
|
81
81
|
.filter(field => this.isFieldVisible(field, descriptionFilter));
|
|
82
82
|
}
|
|
@@ -552,7 +552,7 @@ class SnkMessageBuilder {
|
|
|
552
552
|
this.loadAppMessages().then((msgs) => {
|
|
553
553
|
this._appMessages = msgs;
|
|
554
554
|
}, error => {
|
|
555
|
-
console.info('O arquivo de mensagens personalizadas não foi encontrado no caminho /messages/appmessages
|
|
555
|
+
console.info('O arquivo de mensagens personalizadas não foi encontrado no caminho /messages/appmessages', error);
|
|
556
556
|
});
|
|
557
557
|
}
|
|
558
558
|
/**
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { DataType, ApplicationContext, ObjectUtils,
|
|
1
|
+
import { DataType, ApplicationContext, ObjectUtils, DataUnit, DateUtils, StringUtils, ChangeOperation, UserInterface, DataUnitStorage } from '@sankhyalabs/core';
|
|
2
2
|
import { d as dist, D as DataFetcher } from './form-config-fetcher.js';
|
|
3
3
|
import { DISTINCT_FILTER_NAME_PREFIX } from '@sankhyalabs/ezui/dist/collection/utils/constants';
|
|
4
4
|
import { DataUnitTransient } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
|
5
5
|
import { ColumnFilterManager } from '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
|
|
6
|
+
import SortingUtils from '@sankhyalabs/core/dist/utils/SortingUtils';
|
|
6
7
|
import { R as ResourceIDUtils } from './ResourceIDUtils.js';
|
|
7
8
|
|
|
8
9
|
class PesquisaFetcher {
|
|
@@ -268,17 +269,7 @@ class PreloadManager {
|
|
|
268
269
|
}
|
|
269
270
|
}
|
|
270
271
|
static getSortingFunction(dataUnit, sorting) {
|
|
271
|
-
|
|
272
|
-
return undefined;
|
|
273
|
-
}
|
|
274
|
-
return (recordA, recordB) => {
|
|
275
|
-
for (const sort of sorting) {
|
|
276
|
-
const result = FieldComparator.compare(dataUnit.getField(sort.field), recordA, recordB, sort.mode === SortMode.ASC);
|
|
277
|
-
if (result != 0) {
|
|
278
|
-
return result;
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
};
|
|
272
|
+
return SortingUtils.getSortingFunction(dataUnit, sorting);
|
|
282
273
|
}
|
|
283
274
|
static async getDistinct(dataUnit, fieldName) {
|
|
284
275
|
if (!PreloadManager.isCacheEnabled(dataUnit)) {
|
|
@@ -777,8 +777,8 @@ const SnkAttach = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
777
777
|
(_b = this._currentDataUnitBuilder) === null || _b === void 0 ? void 0 : _b.initLoaders(this._currentDataUnit, this._currentFetcher, this.returnToGridMode.bind(this));
|
|
778
778
|
}
|
|
779
779
|
if (this.fetcherType === "Attach") {
|
|
780
|
-
this._currentDataUnitBuilder = new AttachFetcherDataUnitFactory(this.getMessage.bind(this));
|
|
781
780
|
this._currentFetcher = new AttachFetcher();
|
|
781
|
+
this._currentDataUnitBuilder = new AttachFetcherDataUnitFactory(this.getMessage.bind(this));
|
|
782
782
|
(_c = this._currentDataUnitBuilder) === null || _c === void 0 ? void 0 : _c.initLoaders(this._currentDataUnit, this._currentFetcher, async () => {
|
|
783
783
|
this.returnToGridMode();
|
|
784
784
|
await this._currentDataUnit.loadData(undefined, undefined, true, this.registerKey);
|