@sankhyalabs/sankhyablocks 8.15.0-rc.9 → 8.15.1-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{ConfigStorage-d4c99a5e.js → ConfigStorage-942ce74b.js} +70 -7
- package/dist/cjs/{DataFetcher-99f0f6ed.js → DataFetcher-313debd8.js} +13 -5
- package/dist/cjs/{SnkFormConfigManager-3621bfc4.js → SnkFormConfigManager-f9dc0d28.js} +21 -13
- package/dist/cjs/{SnkMessageBuilder-141aa18d.js → SnkMessageBuilder-66aa2557.js} +4 -0
- package/dist/cjs/SnkMultiSelectionListDataSource-303e85d1.js +140 -0
- package/dist/cjs/{auth-fetcher-5161d082.js → auth-fetcher-54f5ff9d.js} +1 -1
- package/dist/cjs/{form-config-fetcher-9f1a13ca.js → form-config-fetcher-2dd00e5b.js} +13 -1
- package/dist/cjs/index-f9e81701.js +2 -10
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{pesquisa-fetcher-8bbee432.js → pesquisa-fetcher-213797ec.js} +273 -50
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/{snk-actions-button_2.cjs.entry.js → snk-actions-button_4.cjs.entry.js} +519 -4
- package/dist/cjs/snk-application.cjs.entry.js +19 -11
- package/dist/cjs/snk-attach.cjs.entry.js +66 -46
- package/dist/cjs/snk-configurator.cjs.entry.js +1 -1
- package/dist/cjs/snk-crud.cjs.entry.js +25 -17
- package/dist/cjs/snk-custom-slot-elements.cjs.entry.js +6 -2
- package/dist/cjs/snk-data-exporter.cjs.entry.js +5 -5
- package/dist/cjs/{snk-data-unit-6026a9f7.js → snk-data-unit-41c29713.js} +1 -1
- package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
- package/dist/cjs/snk-detail-view.cjs.entry.js +8 -9
- package/dist/cjs/snk-filter-bar.cjs.entry.js +31 -7
- package/dist/cjs/snk-filter-detail.cjs.entry.js +4 -1
- package/dist/cjs/snk-filter-item.cjs.entry.js +10 -6
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
- package/dist/cjs/snk-form-config.cjs.entry.js +8 -2
- package/dist/cjs/snk-form.cjs.entry.js +11 -4
- package/dist/cjs/snk-grid.cjs.entry.js +40 -21
- package/dist/cjs/{snk-guides-viewer-e87f01b9.js → snk-guides-viewer-4b6ecda8.js} +20 -11
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +6 -7
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
- package/dist/cjs/snk-simple-crud.cjs.entry.js +255 -21
- package/dist/cjs/snk-taskbar.cjs.entry.js +69 -8
- package/dist/collection/collection-manifest.json +6 -6
- package/dist/collection/components/snk-application/snk-application.js +55 -6
- package/dist/collection/components/snk-attach/snk-attach.js +39 -24
- package/dist/collection/components/snk-attach/structure/builder/attach-crud-config.builder.js +1 -1
- package/dist/collection/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.js +29 -22
- package/dist/collection/components/snk-configurator/snk-configurator.js +1 -1
- package/dist/collection/components/snk-crud/snk-crud.js +71 -11
- package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +2 -2
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +50 -7
- package/dist/collection/components/snk-custom-slot-elements/snk-custom-slot-elements.css +1 -1
- package/dist/collection/components/snk-custom-slot-elements/snk-custom-slot-elements.js +22 -1
- package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +2 -2
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +22 -1
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +28 -6
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +2 -1
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +44 -3
- package/dist/collection/components/snk-form/snk-form.js +25 -1
- package/dist/collection/components/{snk-form → snk-form-config}/SnkFormConfigManager.js +20 -12
- package/dist/collection/components/{snk-form/subcomponents/snk-form-config → snk-form-config}/snk-form-config.js +11 -5
- package/dist/collection/components/snk-grid/snk-grid.js +86 -16
- package/dist/collection/components/{snk-grid/subcomponents/snk-grid-config → snk-grid-config}/snk-grid-config.js +130 -123
- package/dist/collection/components/{snk-grid/subcomponents → snk-grid-config}/snk-select-box/snk-select-box.js +1 -1
- package/dist/collection/components/snk-simple-crud/regular-buttons.js +3 -0
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.css +10 -2
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +421 -17
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +86 -8
- package/dist/collection/lib/configs/ConfigStorage.js +63 -3
- package/dist/collection/lib/dataUnit/InMemoryLoader.js +9 -40
- package/dist/collection/lib/dataUnit/dataUnitInMemoryUtils.js +33 -0
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +13 -5
- package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js +12 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.js +6 -3
- package/dist/collection/lib/message/SnkMessageBuilder.js +20 -20
- package/dist/collection/lib/message/resources/snk-simple-crud.msg.js +4 -0
- package/dist/collection/lib/utils/CrudUtils.js +13 -1
- package/dist/components/ConfigStorage.js +68 -5
- package/dist/components/DataFetcher.js +13 -5
- package/dist/components/SnkFormConfigManager.js +19 -11
- package/dist/components/SnkMessageBuilder.js +4 -0
- package/dist/components/dataunit-fetcher.js +41 -39
- package/dist/components/field-search.js +93 -3
- package/dist/components/form-config-fetcher.js +12 -0
- package/dist/components/index.d.ts +6 -6
- package/dist/components/snk-application2.js +15 -4
- package/dist/components/snk-attach2.js +115 -52
- package/dist/components/snk-configurator2.js +1 -1
- package/dist/components/snk-crud.js +23 -11
- package/dist/components/snk-custom-slot-elements.js +7 -3
- package/dist/components/snk-data-exporter2.js +2 -2
- package/dist/components/snk-detail-view2.js +48 -11
- package/dist/components/snk-filter-bar2.js +29 -4
- package/dist/components/snk-filter-detail2.js +5 -1
- package/dist/components/snk-filter-item2.js +11 -6
- package/dist/components/snk-form-config2.js +7 -1
- package/dist/components/snk-form.js +8 -0
- package/dist/components/snk-grid-config2.js +128 -102
- package/dist/components/snk-grid2.js +42 -18
- package/dist/components/snk-simple-crud2.js +317 -29
- package/dist/components/snk-taskbar2.js +75 -11
- package/dist/esm/{ConfigStorage-39ed8aeb.js → ConfigStorage-86187da3.js} +70 -7
- package/dist/esm/{DataFetcher-a650ae58.js → DataFetcher-c1baf61d.js} +13 -5
- package/dist/esm/{SnkFormConfigManager-692e20c7.js → SnkFormConfigManager-f53f9f87.js} +21 -13
- package/dist/esm/{SnkMessageBuilder-9747ddd2.js → SnkMessageBuilder-0a4becdd.js} +4 -0
- package/dist/esm/SnkMultiSelectionListDataSource-36918dbf.js +133 -0
- package/dist/esm/{auth-fetcher-17dc5b5e.js → auth-fetcher-039abba3.js} +1 -1
- package/dist/esm/{form-config-fetcher-f121f880.js → form-config-fetcher-30fb808f.js} +13 -1
- package/dist/esm/index-a7d3d3f1.js +2 -10
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{pesquisa-fetcher-5a8cae10.js → pesquisa-fetcher-fe6f3826.js} +262 -43
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/{snk-actions-button_2.entry.js → snk-actions-button_4.entry.js} +518 -5
- package/dist/esm/snk-application.entry.js +19 -11
- package/dist/esm/snk-attach.entry.js +65 -45
- package/dist/esm/snk-configurator.entry.js +1 -1
- package/dist/esm/snk-crud.entry.js +25 -17
- package/dist/esm/snk-custom-slot-elements.entry.js +7 -3
- package/dist/esm/snk-data-exporter.entry.js +5 -5
- package/dist/esm/{snk-data-unit-4c343635.js → snk-data-unit-de1d140d.js} +1 -1
- package/dist/esm/snk-data-unit.entry.js +2 -2
- package/dist/esm/snk-detail-view.entry.js +8 -9
- package/dist/esm/snk-filter-bar.entry.js +31 -7
- package/dist/esm/snk-filter-detail.entry.js +4 -1
- package/dist/esm/snk-filter-item.entry.js +10 -6
- package/dist/esm/snk-filter-modal-item.entry.js +3 -3
- package/dist/esm/snk-form-config.entry.js +9 -3
- package/dist/esm/snk-form.entry.js +11 -4
- package/dist/esm/snk-grid.entry.js +41 -22
- package/dist/esm/{snk-guides-viewer-ba8ce538.js → snk-guides-viewer-113be3fd.js} +20 -11
- package/dist/esm/snk-guides-viewer.entry.js +6 -7
- package/dist/esm/snk-personalized-filter.entry.js +3 -3
- package/dist/esm/snk-simple-crud.entry.js +256 -22
- package/dist/esm/snk-taskbar.entry.js +70 -9
- package/dist/sankhyablocks/p-032fe52e.js +1 -0
- package/dist/sankhyablocks/p-07a61550.entry.js +1 -0
- package/dist/sankhyablocks/p-0899e0b5.entry.js +1 -0
- package/dist/sankhyablocks/p-14a08904.entry.js +1 -0
- package/dist/sankhyablocks/p-154a7f33.entry.js +1 -0
- package/dist/sankhyablocks/p-15802c59.entry.js +1 -0
- package/dist/sankhyablocks/p-164666b1.js +65 -0
- package/dist/sankhyablocks/p-21a81901.entry.js +1 -0
- package/dist/sankhyablocks/p-32556aa6.js +1 -0
- package/dist/sankhyablocks/p-328585d0.entry.js +1 -0
- package/dist/sankhyablocks/{p-9a5d1b39.js → p-52c8e589.js} +1 -1
- package/dist/sankhyablocks/p-54a5d52a.entry.js +1 -0
- package/dist/sankhyablocks/p-5cb07080.js +1 -0
- package/dist/sankhyablocks/p-74d349c3.entry.js +1 -0
- package/dist/sankhyablocks/p-7663f597.entry.js +1 -0
- package/dist/sankhyablocks/p-7fe120b8.entry.js +11 -0
- package/dist/sankhyablocks/{p-50783a8b.js → p-913a9979.js} +1 -1
- package/dist/sankhyablocks/{p-827e4b01.entry.js → p-a1d72395.entry.js} +1 -1
- package/dist/sankhyablocks/p-add17f6a.entry.js +1 -0
- package/dist/sankhyablocks/p-af1ac81f.entry.js +1 -0
- package/dist/sankhyablocks/p-aff76a53.js +56 -0
- package/dist/sankhyablocks/p-b4525fc0.entry.js +1 -0
- package/dist/sankhyablocks/p-cce0865d.js +1 -0
- package/dist/sankhyablocks/{p-be75153c.js → p-dc7c9047.js} +1 -1
- package/dist/sankhyablocks/p-dec65f6c.entry.js +1 -0
- package/dist/sankhyablocks/p-df5451c7.js +26 -0
- package/dist/sankhyablocks/p-e8763234.entry.js +1 -0
- package/dist/sankhyablocks/{p-9d608b62.entry.js → p-eae7a817.entry.js} +1 -1
- package/dist/sankhyablocks/{p-20b46647.entry.js → p-ee9536bc.entry.js} +1 -1
- package/dist/sankhyablocks/p-f13f7616.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/snk-application.d.ts +9 -1
- package/dist/types/components/snk-attach/snk-attach.d.ts +2 -1
- package/dist/types/components/snk-attach/structure/builder/attach-crud-config.builder.d.ts +10 -1
- package/dist/types/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.d.ts +5 -4
- package/dist/types/components/snk-crud/snk-crud.d.ts +12 -0
- package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +1 -1
- package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +11 -1
- package/dist/types/components/snk-custom-slot-elements/snk-custom-slot-elements.d.ts +6 -0
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +4 -0
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +6 -2
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +8 -0
- package/dist/types/components/snk-form/snk-form.d.ts +6 -1
- package/dist/types/components/{snk-form → snk-form-config}/SnkFormConfigManager.d.ts +2 -1
- package/dist/types/components/{snk-form/subcomponents/snk-form-config → snk-form-config}/snk-form-config.d.ts +4 -3
- package/dist/types/components/snk-grid/snk-grid.d.ts +14 -1
- package/dist/types/components/{snk-grid/subcomponents/snk-grid-config → snk-grid-config}/snk-grid-config.d.ts +11 -6
- package/dist/types/components/{snk-grid/subcomponents → snk-grid-config}/snk-select-box/snk-select-box.d.ts +1 -1
- package/dist/types/components/snk-simple-crud/regular-buttons.d.ts +3 -0
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +76 -3
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +11 -0
- package/dist/types/components.d.ts +172 -11
- package/dist/types/lib/configs/ConfigStorage.d.ts +21 -1
- package/dist/types/lib/dataUnit/InMemoryLoader.d.ts +0 -2
- package/dist/types/lib/dataUnit/dataUnitInMemoryUtils.d.ts +4 -0
- package/dist/types/lib/http/data-fetcher/fetchers/form-config-fetcher.d.ts +2 -0
- package/dist/types/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.d.ts +2 -1
- package/dist/types/lib/utils/CrudUtils.d.ts +3 -0
- package/package.json +1 -1
- package/dist/cjs/PreloadManager-84466da6.js +0 -224
- package/dist/cjs/SnkMultiSelectionListDataSource-ba5838c2.js +0 -49
- package/dist/cjs/snk-grid-config.cjs.entry.js +0 -483
- package/dist/cjs/snk-select-box.cjs.entry.js +0 -25
- package/dist/esm/PreloadManager-c1c2f2b4.js +0 -222
- package/dist/esm/SnkMultiSelectionListDataSource-44494b0e.js +0 -43
- package/dist/esm/snk-grid-config.entry.js +0 -479
- package/dist/esm/snk-select-box.entry.js +0 -21
- package/dist/sankhyablocks/p-094c30cb.js +0 -1
- package/dist/sankhyablocks/p-1c55becf.entry.js +0 -1
- package/dist/sankhyablocks/p-230f5148.entry.js +0 -1
- package/dist/sankhyablocks/p-2936303b.js +0 -1
- package/dist/sankhyablocks/p-2e4eb644.entry.js +0 -1
- package/dist/sankhyablocks/p-3e2e2424.entry.js +0 -1
- package/dist/sankhyablocks/p-3e91d5ea.entry.js +0 -1
- package/dist/sankhyablocks/p-43de1258.entry.js +0 -1
- package/dist/sankhyablocks/p-4ce6cb02.entry.js +0 -11
- package/dist/sankhyablocks/p-5e681b7b.js +0 -65
- package/dist/sankhyablocks/p-5f74c859.entry.js +0 -1
- package/dist/sankhyablocks/p-67aedbe0.js +0 -56
- package/dist/sankhyablocks/p-69754d94.entry.js +0 -1
- package/dist/sankhyablocks/p-725d04ba.js +0 -1
- package/dist/sankhyablocks/p-86801b08.entry.js +0 -1
- package/dist/sankhyablocks/p-8a3a2631.entry.js +0 -1
- package/dist/sankhyablocks/p-965b79a9.js +0 -1
- package/dist/sankhyablocks/p-98674137.entry.js +0 -1
- package/dist/sankhyablocks/p-a13ccb86.js +0 -26
- package/dist/sankhyablocks/p-aba0e87f.entry.js +0 -1
- package/dist/sankhyablocks/p-c22c1d8e.js +0 -1
- package/dist/sankhyablocks/p-d26e0a02.entry.js +0 -1
- package/dist/sankhyablocks/p-d6317851.entry.js +0 -1
- package/dist/sankhyablocks/p-d7d85fa9.entry.js +0 -1
- package/dist/sankhyablocks/p-e3bd000e.entry.js +0 -1
- package/dist/sankhyablocks/p-e7dbe53a.entry.js +0 -1
- package/dist/sankhyablocks/p-fcdcb0e2.entry.js +0 -1
- /package/dist/collection/components/{snk-form/subcomponents/snk-form-config → snk-form-config}/snk-form-config.css +0 -0
- /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-config-options/snk-config-options.css +0 -0
- /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-config-options/snk-config-options.js +0 -0
- /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-field-config/snk-field-config.css +0 -0
- /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-field-config/snk-field-config.js +0 -0
- /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-tab-config/snk-tab-config.css +0 -0
- /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-tab-config/snk-tab-config.js +0 -0
- /package/dist/collection/components/{snk-grid/subcomponents/snk-grid-config → snk-grid-config}/snk-grid-config.css +0 -0
- /package/dist/collection/components/{snk-grid/subcomponents → snk-grid-config}/snk-select-box/snk-select-box.css +0 -0
- /package/dist/types/components/{snk-form → snk-form-config}/subcomponents/snk-config-options/snk-config-options.d.ts +0 -0
- /package/dist/types/components/{snk-form → snk-form-config}/subcomponents/snk-field-config/snk-field-config.d.ts +0 -0
- /package/dist/types/components/{snk-form → snk-form-config}/subcomponents/snk-tab-config/snk-tab-config.d.ts +0 -0
@@ -3,6 +3,7 @@ import { h, Host } from '@stencil/core';
|
|
3
3
|
import { AuthorizationConfig } from '../snk-configurator/AuthorizationConfig';
|
4
4
|
import { AuthorizationElements, buildCustomButton, buildElem, TaskbarElement, VisibleWhenForbidden, } from './elements/taskbar-elements';
|
5
5
|
import { PresentationMode } from '../../lib/@types';
|
6
|
+
import { Action as DUAction } from '@sankhyalabs/core';
|
6
7
|
export class SnkTaskbar {
|
7
8
|
constructor() {
|
8
9
|
this.TASKBAR_ITEM_ID_PREFIX = 'TASKBAR_ITEM_';
|
@@ -25,12 +26,27 @@ export class SnkTaskbar {
|
|
25
26
|
[TaskbarElement.CONFIGURATOR]: "snkTaskbar.titleConfigurator",
|
26
27
|
[TaskbarElement.ATTACH]: "snkTaskbar.titleAttach",
|
27
28
|
};
|
29
|
+
this.onSaveEvent = (action) => {
|
30
|
+
switch (action.type) {
|
31
|
+
case DUAction.FIELD_INVALIDATED:
|
32
|
+
case DUAction.DATA_SAVED:
|
33
|
+
case DUAction.SAVING_ERROR:
|
34
|
+
this._isWaitingForSave = false;
|
35
|
+
break;
|
36
|
+
case DUAction.SAVING_DATA:
|
37
|
+
this._isWaitingForSave = true;
|
38
|
+
break;
|
39
|
+
}
|
40
|
+
};
|
28
41
|
this._permissions = undefined;
|
29
42
|
this._overFlowedElements = [];
|
30
43
|
this._customElements = undefined;
|
31
44
|
this._customElementsId = undefined;
|
32
45
|
this._slotContainer = undefined;
|
33
46
|
this._hiddenActionsList = [];
|
47
|
+
this._lastWidth = undefined;
|
48
|
+
this._hasToUpdateOverFlow = false;
|
49
|
+
this._isWaitingForSave = false;
|
34
50
|
this.alignRigth = false;
|
35
51
|
this.customSlotId = "TASKBAR_CUSTOM_ELEMENTS";
|
36
52
|
this.customContainerId = undefined;
|
@@ -46,12 +62,29 @@ export class SnkTaskbar {
|
|
46
62
|
this.presentationMode = PresentationMode.PRIMARY;
|
47
63
|
this.messagesBuilder = undefined;
|
48
64
|
}
|
65
|
+
handleCustomSlotElementsLoaded(event) {
|
66
|
+
if (this.hasToSearchCustomElements(event)) {
|
67
|
+
this.getCustomElements(true);
|
68
|
+
}
|
69
|
+
}
|
70
|
+
hasToSearchCustomElements(event) {
|
71
|
+
return this.customSlotId === event.detail && !this._slotContainer;
|
72
|
+
}
|
49
73
|
observeButtons() {
|
50
74
|
this._definitions = undefined;
|
51
75
|
requestAnimationFrame(() => {
|
52
76
|
requestAnimationFrame(() => { var _a; return (_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.forceUpdate(); });
|
53
77
|
});
|
54
78
|
}
|
79
|
+
observeDisabledButtons() {
|
80
|
+
var _a;
|
81
|
+
(_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.forceUpdate();
|
82
|
+
}
|
83
|
+
observeLastWidth(newValue, oldValue) {
|
84
|
+
if (oldValue === 0 && newValue !== 0) {
|
85
|
+
this._hasToUpdateOverFlow = true;
|
86
|
+
}
|
87
|
+
}
|
55
88
|
// Internal methods
|
56
89
|
elementsFromString(strButtons) {
|
57
90
|
const elements = [];
|
@@ -120,7 +153,13 @@ export class SnkTaskbar {
|
|
120
153
|
this.dataUnit.cancelEdition();
|
121
154
|
break;
|
122
155
|
case TaskbarElement.SAVE:
|
123
|
-
this.
|
156
|
+
if (!this._isWaitingForSave) {
|
157
|
+
this._isWaitingForSave = true;
|
158
|
+
this.dataUnit.saveData()
|
159
|
+
.finally(() => {
|
160
|
+
this._isWaitingForSave = false;
|
161
|
+
});
|
162
|
+
}
|
124
163
|
break;
|
125
164
|
}
|
126
165
|
}
|
@@ -207,22 +246,28 @@ export class SnkTaskbar {
|
|
207
246
|
}
|
208
247
|
return h("span", { class: "ez-padding-left--medium", key: elementId, id: elementId });
|
209
248
|
}
|
210
|
-
getCustomElements() {
|
249
|
+
getCustomElements(searchOnDocument) {
|
211
250
|
var _a, _b;
|
212
251
|
this._customElementsId = [];
|
213
252
|
this._customElements = new Map();
|
214
|
-
this._slotContainer = this.buildSlotContainer();
|
253
|
+
this._slotContainer = this.buildSlotContainer(searchOnDocument);
|
215
254
|
const customElementsArray = Array.from((_b = (_a = this._slotContainer) === null || _a === void 0 ? void 0 : _a.children) !== null && _b !== void 0 ? _b : []);
|
216
255
|
customElementsArray.forEach(item => this._customElements.set(item.id, item));
|
217
256
|
}
|
218
|
-
buildSlotContainer() {
|
257
|
+
buildSlotContainer(searchOnDocument) {
|
258
|
+
let slotContainer;
|
219
259
|
if (this.customContainerId) {
|
220
260
|
const container = document.querySelector(`#${this.customContainerId}`);
|
221
|
-
|
261
|
+
slotContainer = container === null || container === void 0 ? void 0 : container.querySelector(`#${this.customSlotId}`);
|
222
262
|
}
|
223
263
|
else {
|
224
|
-
|
264
|
+
slotContainer = this._element.querySelector(`#${this.customSlotId}`);
|
225
265
|
}
|
266
|
+
// Caso nõa encontre o slot container dentro do próprio elemento, tenta buscar na DOM do document.
|
267
|
+
if (searchOnDocument && !slotContainer) {
|
268
|
+
slotContainer = document.querySelector(`#${this.customSlotId}`);
|
269
|
+
}
|
270
|
+
return slotContainer;
|
226
271
|
}
|
227
272
|
componentWillLoad() {
|
228
273
|
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
@@ -235,10 +280,20 @@ export class SnkTaskbar {
|
|
235
280
|
this.getCustomElements();
|
236
281
|
}
|
237
282
|
componentWillRender() {
|
283
|
+
this.handleDefinitions();
|
284
|
+
this.validatePresentationMode();
|
285
|
+
this.updateOverFlowIfNeeded();
|
286
|
+
}
|
287
|
+
handleDefinitions() {
|
238
288
|
if (this._definitions == undefined && this._permissions) {
|
239
289
|
this._definitions = this.elementsFromString(this.buttons);
|
240
290
|
}
|
241
|
-
|
291
|
+
}
|
292
|
+
updateOverFlowIfNeeded() {
|
293
|
+
if (this._hasToUpdateOverFlow) {
|
294
|
+
requestAnimationFrame(() => { var _a; return (_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.forceUpdate(); });
|
295
|
+
this._hasToUpdateOverFlow = false;
|
296
|
+
}
|
242
297
|
}
|
243
298
|
handleOverFlow(overFlowingElements) {
|
244
299
|
const elementsToHandle = overFlowingElements.filter(element => !this.hasToIgnoreOverFlow(element));
|
@@ -302,9 +357,14 @@ export class SnkTaskbar {
|
|
302
357
|
const dataInfo = { dataUnit: this.dataUnit };
|
303
358
|
ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
304
359
|
this.handleOverFlowStrategy();
|
360
|
+
this.dataUnit.subscribe(this.onSaveEvent);
|
305
361
|
}
|
306
362
|
componentDidRender() {
|
307
363
|
this.appendCustomElementsInTaskbar();
|
364
|
+
this.updateLastWidth();
|
365
|
+
}
|
366
|
+
updateLastWidth() {
|
367
|
+
this._lastWidth = this._element.getBoundingClientRect().width;
|
308
368
|
}
|
309
369
|
disconnectedCallback() {
|
310
370
|
var _a;
|
@@ -636,7 +696,10 @@ export class SnkTaskbar {
|
|
636
696
|
"_customElements": {},
|
637
697
|
"_customElementsId": {},
|
638
698
|
"_slotContainer": {},
|
639
|
-
"_hiddenActionsList": {}
|
699
|
+
"_hiddenActionsList": {},
|
700
|
+
"_lastWidth": {},
|
701
|
+
"_hasToUpdateOverFlow": {},
|
702
|
+
"_isWaitingForSave": {}
|
640
703
|
};
|
641
704
|
}
|
642
705
|
static get events() {
|
@@ -662,6 +725,21 @@ export class SnkTaskbar {
|
|
662
725
|
return [{
|
663
726
|
"propName": "buttons",
|
664
727
|
"methodName": "observeButtons"
|
728
|
+
}, {
|
729
|
+
"propName": "disabledButtons",
|
730
|
+
"methodName": "observeDisabledButtons"
|
731
|
+
}, {
|
732
|
+
"propName": "_lastWidth",
|
733
|
+
"methodName": "observeLastWidth"
|
734
|
+
}];
|
735
|
+
}
|
736
|
+
static get listeners() {
|
737
|
+
return [{
|
738
|
+
"name": "snkCustomSlotElementsLoaded",
|
739
|
+
"method": "handleCustomSlotElementsLoaded",
|
740
|
+
"target": "window",
|
741
|
+
"capture": false,
|
742
|
+
"passive": false
|
665
743
|
}];
|
666
744
|
}
|
667
745
|
}
|
@@ -2,18 +2,37 @@ import { FormConfigFetcher } from "../http/data-fetcher/fetchers/form-config-fet
|
|
2
2
|
import GridConfigFetcher from "../http/data-fetcher/fetchers/grid-config-fetcher";
|
3
3
|
import FilterBarConfigFetcher from "../http/data-fetcher/fetchers/filter-bar-config-fetcher";
|
4
4
|
import PersonalizedFilterFetcher from "../http/data-fetcher/fetchers/personalized-filter-fetcher";
|
5
|
-
var CONFIG_SOURCE;
|
5
|
+
export var CONFIG_SOURCE;
|
6
6
|
(function (CONFIG_SOURCE) {
|
7
7
|
CONFIG_SOURCE["form"] = "form";
|
8
8
|
CONFIG_SOURCE["grid"] = "grid";
|
9
9
|
CONFIG_SOURCE["filterBar"] = "filterBar";
|
10
10
|
})(CONFIG_SOURCE || (CONFIG_SOURCE = {}));
|
11
11
|
export class ConfigStorage {
|
12
|
-
static
|
12
|
+
static addFilterBarLegacyConfig(configName, legacyConfigName) {
|
13
|
+
this.validateConfigName(configName, legacyConfigName);
|
14
|
+
this.filterBarLegacyConfig.set(configName, legacyConfigName);
|
15
|
+
}
|
16
|
+
static addFormLegacyConfig(configName, legacyConfigName) {
|
17
|
+
this.validateConfigName(configName, legacyConfigName);
|
18
|
+
this.formLegacyConfig.set(configName, legacyConfigName);
|
19
|
+
}
|
20
|
+
static addGridLegacyConfig(configName, legacyConfigName) {
|
21
|
+
this.validateConfigName(configName, legacyConfigName);
|
22
|
+
this.gridLegacyConfig.set(configName, legacyConfigName);
|
23
|
+
}
|
24
|
+
static preload(resourceID, configName, legacyConfigs) {
|
25
|
+
if (configName && (legacyConfigs === null || legacyConfigs === void 0 ? void 0 : legacyConfigs.gridLegacyConfig)) {
|
26
|
+
ConfigStorage.addGridLegacyConfig(configName, legacyConfigs.gridLegacyConfig);
|
27
|
+
}
|
28
|
+
if (configName && (legacyConfigs === null || legacyConfigs === void 0 ? void 0 : legacyConfigs.formLegacyConfig)) {
|
29
|
+
ConfigStorage.addFormLegacyConfig(configName, legacyConfigs.formLegacyConfig);
|
30
|
+
}
|
13
31
|
ConfigStorage.loadFormConfig(configName, resourceID);
|
14
32
|
ConfigStorage.loadGridConfig(configName, resourceID);
|
15
33
|
}
|
16
34
|
static async loadFilterBarConfig(name, resourceID, urlParams) {
|
35
|
+
urlParams = this.handleLegacyConfig(name, CONFIG_SOURCE.filterBar, urlParams);
|
17
36
|
const cacheID = ConfigStorage.buildCacheID(name, CONFIG_SOURCE.filterBar, resourceID);
|
18
37
|
if (!ConfigStorage.configById.has(cacheID)) {
|
19
38
|
ConfigStorage.configById.set(cacheID, ConfigStorage.filterBarConfigFetcher.getConfig(resourceID, name, urlParams));
|
@@ -21,6 +40,7 @@ export class ConfigStorage {
|
|
21
40
|
return ConfigStorage.configById.get(cacheID);
|
22
41
|
}
|
23
42
|
static async loadFormConfig(name, resourceID) {
|
43
|
+
name = this.handleLegacyConfigAsString(name, CONFIG_SOURCE.form);
|
24
44
|
const cacheID = ConfigStorage.buildCacheID(name, CONFIG_SOURCE.form, resourceID);
|
25
45
|
if (!ConfigStorage.configById.has(cacheID)) {
|
26
46
|
ConfigStorage.configById.set(cacheID, ConfigStorage.formConfigFetcher.loadFormConfig(name, resourceID));
|
@@ -28,6 +48,7 @@ export class ConfigStorage {
|
|
28
48
|
return ConfigStorage.configById.get(cacheID);
|
29
49
|
}
|
30
50
|
static async loadGridConfig(name, resourceID) {
|
51
|
+
name = this.handleLegacyConfigAsString(name, CONFIG_SOURCE.grid);
|
31
52
|
const cacheID = ConfigStorage.buildCacheID(name, CONFIG_SOURCE.grid, resourceID);
|
32
53
|
if (!ConfigStorage.configById.has(cacheID)) {
|
33
54
|
ConfigStorage.configById.set(cacheID, ConfigStorage.gridConfigFetcher.getConfig(name, resourceID));
|
@@ -39,6 +60,7 @@ export class ConfigStorage {
|
|
39
60
|
return this.filterBarConfigFetcher.saveConfig(config, resourceID, name);
|
40
61
|
}
|
41
62
|
static async saveFormConfig(config, name, resourceID) {
|
63
|
+
name = this.handleLegacyConfigAsString(name, CONFIG_SOURCE.form);
|
42
64
|
await this.deleteFormConfigCache(name, resourceID);
|
43
65
|
return this.formConfigFetcher.saveConfig(config, name, resourceID);
|
44
66
|
}
|
@@ -53,7 +75,8 @@ export class ConfigStorage {
|
|
53
75
|
return this.gridConfigFetcher.saveConfig(config, name, resourceID);
|
54
76
|
}
|
55
77
|
static async loadPersonalizedFilter(filterId, resourceID, configName) {
|
56
|
-
|
78
|
+
const legacyConfigName = this.filterBarLegacyConfig.get(configName);
|
79
|
+
return this.personalizedFilterFetcher.loadPersonalizedFilter(resourceID, filterId, configName, legacyConfigName);
|
57
80
|
}
|
58
81
|
static async savePersonalizedFilter(personalizedFilter, resourceID, configName) {
|
59
82
|
//Ao criar ou alterar um filtro personalizado,
|
@@ -76,6 +99,38 @@ export class ConfigStorage {
|
|
76
99
|
static async deleteFilterBarConfigCache(name, resourceID) {
|
77
100
|
await this.deleteConfigCache(name, resourceID, CONFIG_SOURCE.filterBar);
|
78
101
|
}
|
102
|
+
static validateConfigName(configName, legacyConfigName) {
|
103
|
+
if (!configName)
|
104
|
+
throw Error(this.CONFIG_NAME_ERROR_MESSAGE);
|
105
|
+
if (!legacyConfigName)
|
106
|
+
throw Error(this.LEGACY_CONFIG_NAME_ERROR_MESSAGE);
|
107
|
+
}
|
108
|
+
static handleLegacyConfig(configName, configSource, urlParams) {
|
109
|
+
let legacyConfigName;
|
110
|
+
switch (configSource) {
|
111
|
+
case CONFIG_SOURCE.filterBar:
|
112
|
+
legacyConfigName = this.filterBarLegacyConfig.get(configName);
|
113
|
+
break;
|
114
|
+
case CONFIG_SOURCE.grid:
|
115
|
+
legacyConfigName = this.gridLegacyConfig.get(configName);
|
116
|
+
break;
|
117
|
+
case CONFIG_SOURCE.form:
|
118
|
+
legacyConfigName = this.formLegacyConfig.get(configName);
|
119
|
+
}
|
120
|
+
const params = urlParams ? Object.assign({}, urlParams) : {};
|
121
|
+
if (legacyConfigName) {
|
122
|
+
params['legacyResourceID'] = legacyConfigName;
|
123
|
+
}
|
124
|
+
return params;
|
125
|
+
}
|
126
|
+
static handleLegacyConfigAsString(name, source) {
|
127
|
+
const params = this.handleLegacyConfig(name, source);
|
128
|
+
const legacyResourceID = params['legacyResourceID'];
|
129
|
+
if (legacyResourceID) {
|
130
|
+
name = name + `?legacyResourceID=${legacyResourceID}`;
|
131
|
+
}
|
132
|
+
return name;
|
133
|
+
}
|
79
134
|
static async deleteConfigCache(name, resourceID, source) {
|
80
135
|
const cacheID = ConfigStorage.buildCacheID(name, source, resourceID);
|
81
136
|
this.configById.delete(cacheID);
|
@@ -87,6 +142,11 @@ export class ConfigStorage {
|
|
87
142
|
return `req_${source}_${name}_${resourceID}`;
|
88
143
|
}
|
89
144
|
}
|
145
|
+
ConfigStorage.CONFIG_NAME_ERROR_MESSAGE = "ConfigName precisa ser informado.";
|
146
|
+
ConfigStorage.LEGACY_CONFIG_NAME_ERROR_MESSAGE = "LegacyConfigName precisa ser informado.";
|
147
|
+
ConfigStorage.filterBarLegacyConfig = new Map();
|
148
|
+
ConfigStorage.formLegacyConfig = new Map();
|
149
|
+
ConfigStorage.gridLegacyConfig = new Map();
|
90
150
|
ConfigStorage.configById = new Map();
|
91
151
|
ConfigStorage.filterBarConfigFetcher = new FilterBarConfigFetcher();
|
92
152
|
ConfigStorage.formConfigFetcher = new FormConfigFetcher();
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import { ChangeOperation, DataType, DataUnit, DateUtils, StringUtils, } from '@sankhyalabs/core';
|
2
|
-
import {
|
3
|
-
import PreloadManager from '../http/data-fetcher/fetchers/data-unit/cache/PreloadManager';
|
2
|
+
import { applyFilter, applySorting, buildPaginationInfo } from './dataUnitInMemoryUtils';
|
4
3
|
export default class InMemoryLoader {
|
5
4
|
constructor(metadata, records) {
|
6
5
|
this.metadata = metadata;
|
@@ -13,9 +12,13 @@ export default class InMemoryLoader {
|
|
13
12
|
this.dataUnit.loadMetadata().then(() => this.dataUnit.loadData());
|
14
13
|
}
|
15
14
|
getRecordsToLoad() {
|
16
|
-
if (this._initialRecords == undefined
|
15
|
+
if (this._initialRecords == undefined && this.dataUnit.records.length > 0) {
|
17
16
|
this._initialRecords = this.dataUnit.records;
|
18
17
|
}
|
18
|
+
const addedRecords = this.dataUnit.getAddedRecords();
|
19
|
+
if (addedRecords) {
|
20
|
+
return [...this._initialRecords, ...addedRecords];
|
21
|
+
}
|
19
22
|
return this._initialRecords;
|
20
23
|
}
|
21
24
|
get dataUnit() {
|
@@ -74,30 +77,9 @@ export default class InMemoryLoader {
|
|
74
77
|
return StringUtils.generateUUID();
|
75
78
|
}
|
76
79
|
inMemoryLoader(dataUnit, request, recordsIn) {
|
77
|
-
let records =
|
78
|
-
records =
|
79
|
-
return Promise.resolve({ records, paginationInfo: buildPaginationInfo(request,
|
80
|
-
}
|
81
|
-
applyFilter(records, dataUnit, filters) {
|
82
|
-
const columnFilters = ColumnFilterManager.getColumnFilters(filters, "");
|
83
|
-
if (columnFilters == undefined || columnFilters.size == 0) {
|
84
|
-
return records;
|
85
|
-
}
|
86
|
-
const filterFunciton = ColumnFilterManager.getFilterFunction(dataUnit, Array.from(columnFilters.values()));
|
87
|
-
if (filterFunciton == undefined) {
|
88
|
-
return records;
|
89
|
-
}
|
90
|
-
return records.filter(filterFunciton);
|
91
|
-
}
|
92
|
-
applySorting(records, dataUnit, sorting) {
|
93
|
-
if (sorting == undefined || sorting.length == 0) {
|
94
|
-
return records;
|
95
|
-
}
|
96
|
-
const sortingFunction = PreloadManager.getSortingFunction(dataUnit, sorting);
|
97
|
-
if (sortingFunction == undefined) {
|
98
|
-
return records;
|
99
|
-
}
|
100
|
-
return records.sort(sortingFunction);
|
80
|
+
let records = applyFilter(recordsIn, dataUnit, request.filters);
|
81
|
+
records = applySorting(records, dataUnit, request.sort);
|
82
|
+
return Promise.resolve({ records, paginationInfo: buildPaginationInfo(records, request.offset, request.limit) });
|
101
83
|
}
|
102
84
|
metadaLoader() {
|
103
85
|
return Promise.resolve(this._metadata);
|
@@ -130,16 +112,3 @@ export default class InMemoryLoader {
|
|
130
112
|
}
|
131
113
|
}
|
132
114
|
InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME = "InMemoryDataUnit";
|
133
|
-
function buildPaginationInfo({ offset, limit }, records) {
|
134
|
-
if (offset === undefined || limit === undefined) {
|
135
|
-
return undefined;
|
136
|
-
}
|
137
|
-
const lastRecord = Math.min(offset + limit, records.length);
|
138
|
-
return {
|
139
|
-
currentPage: Math.ceil(offset / limit),
|
140
|
-
firstRecord: offset,
|
141
|
-
lastRecord: lastRecord,
|
142
|
-
total: records.length,
|
143
|
-
hasMore: !!(records.length - lastRecord),
|
144
|
-
};
|
145
|
-
}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
import { ColumnFilterManager } from '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
|
2
|
+
import PreloadManager from '../http/data-fetcher/fetchers/data-unit/cache/PreloadManager';
|
3
|
+
export function applyFilter(records, dataUnit, filters) {
|
4
|
+
const columnFilters = ColumnFilterManager.getColumnFilters(filters, "");
|
5
|
+
if (!(columnFilters === null || columnFilters === void 0 ? void 0 : columnFilters.size)) {
|
6
|
+
return records;
|
7
|
+
}
|
8
|
+
const filterFunction = ColumnFilterManager.getFilterFunction(dataUnit, Array.from(columnFilters.values()));
|
9
|
+
if (filterFunction == undefined) {
|
10
|
+
return records;
|
11
|
+
}
|
12
|
+
return records.filter(filterFunction);
|
13
|
+
}
|
14
|
+
export function applySorting(records, dataUnit, sorting) {
|
15
|
+
if (sorting == undefined || sorting.length == 0) {
|
16
|
+
return records;
|
17
|
+
}
|
18
|
+
const sortingFunction = PreloadManager.getSortingFunction(dataUnit, sorting);
|
19
|
+
if (sortingFunction == undefined) {
|
20
|
+
return records;
|
21
|
+
}
|
22
|
+
return records.sort(sortingFunction);
|
23
|
+
}
|
24
|
+
export function buildPaginationInfo(records, offset = 0, limit = 0) {
|
25
|
+
const lastRecord = Math.min(offset + limit, records === null || records === void 0 ? void 0 : records.length);
|
26
|
+
return {
|
27
|
+
currentPage: limit === 0 ? 0 : Math.ceil(offset / limit),
|
28
|
+
firstRecord: offset,
|
29
|
+
lastRecord: lastRecord,
|
30
|
+
total: records === null || records === void 0 ? void 0 : records.length,
|
31
|
+
hasMore: !!((records === null || records === void 0 ? void 0 : records.length) - lastRecord),
|
32
|
+
};
|
33
|
+
}
|
@@ -364,12 +364,19 @@ export class DataFetcher {
|
|
364
364
|
//Reject promises with errors from query
|
365
365
|
errorsResponse.forEach((errorResponse) => {
|
366
366
|
Object.entries(errorResponse).forEach(async ([key, val]) => {
|
367
|
-
var _a;
|
368
367
|
const waitingRequest = watingRequestsById.get(val.request.variables[val.index].queryID);
|
369
368
|
const hasClientEvent = await this.proccesGraphQLClientEvents(extensions, waitingRequest.request, waitingRequest.resolve, waitingRequest.reject);
|
370
|
-
|
371
|
-
|
372
|
-
|
369
|
+
Promise.race([
|
370
|
+
waitingRequest.promise,
|
371
|
+
new Promise((resolve) => {
|
372
|
+
resolve(false);
|
373
|
+
})
|
374
|
+
]).then((data) => {
|
375
|
+
var _a;
|
376
|
+
if (!hasClientEvent || data === false) {
|
377
|
+
(((_a = watingRequestsById.get(val.request.variables[val.index].queryID)) === null || _a === void 0 ? void 0 : _a.reject) || Promise.reject)(new ErrorException("Falha detectada", val.message));
|
378
|
+
}
|
379
|
+
});
|
373
380
|
});
|
374
381
|
});
|
375
382
|
//Resolve promises with data from query
|
@@ -382,7 +389,8 @@ export class DataFetcher {
|
|
382
389
|
});
|
383
390
|
}
|
384
391
|
buildGraphQlURL(quietMode) {
|
385
|
-
const
|
392
|
+
const urlParams = UrlUtils.getQueryParams(location.search);
|
393
|
+
const mgeSession = `${window['mgeSession'] || urlParams.get("mgeSession")}`;
|
386
394
|
let url = `${this.resolveURL() + DataFetcher.getGraphQLPath()}`;
|
387
395
|
if (mgeSession) {
|
388
396
|
url += `?mgeSession=${mgeSession}`;
|
@@ -168,6 +168,18 @@ export class FormConfigFetcher extends ResourceFetcher {
|
|
168
168
|
}
|
169
169
|
return `cfg://${authority}/${resourceID}`;
|
170
170
|
}
|
171
|
+
async fetchLegacyConfigurableForm(configName) {
|
172
|
+
const payload = { 'requestBody': { 'config': { 'chave': configName, 'tipo': 'T' } } };
|
173
|
+
const response = await DataFetcher.get().callServiceBroker('SystemUtilsSP.getConf', JSON.stringify(payload));
|
174
|
+
if (ObjectUtils.isEmpty(response))
|
175
|
+
return undefined;
|
176
|
+
return this.buildLegacyConfigurableForm(response);
|
177
|
+
}
|
178
|
+
buildLegacyConfigurableForm(config) {
|
179
|
+
var _a, _b, _c;
|
180
|
+
const rawFields = (_c = (_b = (_a = config === null || config === void 0 ? void 0 : config.formConfig) === null || _a === void 0 ? void 0 : _a.layout) === null || _b === void 0 ? void 0 : _b.field) !== null && _c !== void 0 ? _c : [];
|
181
|
+
return { emptyConfig: false, fields: Array.isArray(rawFields) ? rawFields : [rawFields] };
|
182
|
+
}
|
171
183
|
}
|
172
184
|
export var UserConfigType;
|
173
185
|
(function (UserConfigType) {
|
@@ -52,7 +52,7 @@ export default class PersonalizedFilterFetcher {
|
|
52
52
|
assistent
|
53
53
|
}
|
54
54
|
}`);
|
55
|
-
this.templateByQuery.set("savePersonalizedFilter", gql `
|
55
|
+
this.templateByQuery.set("savePersonalizedFilter", gql `
|
56
56
|
mutation($name: String!, $filterAssistent: InputFilterAssistent!) {
|
57
57
|
$queryAlias$: savePersonalizedFilter(name: $name, filterAssistent: $filterAssistent) {
|
58
58
|
id
|
@@ -74,11 +74,11 @@ export default class PersonalizedFilterFetcher {
|
|
74
74
|
}
|
75
75
|
}`);
|
76
76
|
}
|
77
|
-
async loadPersonalizedFilter(resourceID, filterID, configName) {
|
77
|
+
async loadPersonalizedFilter(resourceID, filterID, configName, legacyConfigName) {
|
78
78
|
return new Promise((resolve, reject) => {
|
79
79
|
DataFetcher.get()
|
80
80
|
.callGraphQL({
|
81
|
-
values: { name: this.resolveURI(resourceID, configName) + "/" + filterID },
|
81
|
+
values: { name: this.resolveURI(resourceID, configName) + "/" + filterID + this.resolveLegacyConfigName(legacyConfigName) },
|
82
82
|
query: this.templateByQuery.get("fetchFilterAssistent"),
|
83
83
|
})
|
84
84
|
.then((resp) => {
|
@@ -90,6 +90,9 @@ export default class PersonalizedFilterFetcher {
|
|
90
90
|
});
|
91
91
|
});
|
92
92
|
}
|
93
|
+
resolveLegacyConfigName(legacyConfigName) {
|
94
|
+
return legacyConfigName ? `?legacyResourceID=${legacyConfigName}` : '';
|
95
|
+
}
|
93
96
|
async savePersonalizedFilter(personalizedFilter, resourceID, configName) {
|
94
97
|
if (!personalizedFilter || Object.keys(personalizedFilter).length == 0) {
|
95
98
|
return Promise.reject(new Error("personalizedFilter não pode ser vazio"));
|
@@ -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) {
|
@@ -1,4 +1,8 @@
|
|
1
1
|
export const snkSimpleCrudMessages = {
|
2
2
|
findColumn: "Busca de colunas",
|
3
|
+
formConfigUnavaliable: {
|
4
|
+
title: "Aviso",
|
5
|
+
message: 'A opção "Configurar formulário" será disponibilizada em breve. Enquanto isso, acesse a configuração do fomulário através dos layouts anteriores, HTML5 ou Flex.'
|
6
|
+
}
|
3
7
|
};
|
4
8
|
export default snkSimpleCrudMessages;
|
@@ -1,6 +1,18 @@
|
|
1
1
|
import { DataFetcher } from '../';
|
2
|
-
import { ApplicationContext } from '@sankhyalabs/core';
|
2
|
+
import { ApplicationContext, SortMode } from '@sankhyalabs/core';
|
3
3
|
export class CrudUtils {
|
4
|
+
static assertDefaultSorting(gridConfig, dataUnit) {
|
5
|
+
if (gridConfig && dataUnit) {
|
6
|
+
dataUnit.defaultSorting = gridConfig
|
7
|
+
.columns
|
8
|
+
.filter(col => col.ascending != undefined)
|
9
|
+
.sort((colA, colB) => colA.orderIndex - colB.orderIndex)
|
10
|
+
.map(({ name: field, ascending }) => {
|
11
|
+
const { dataType } = dataUnit.getField(field);
|
12
|
+
return { field, dataType, mode: ascending ? SortMode.ASC : SortMode.DESC };
|
13
|
+
});
|
14
|
+
}
|
15
|
+
}
|
4
16
|
static find(entityName, fields, criteria, onlyFirst = true, criteriaExpression, orderBy) {
|
5
17
|
const SERVICE_CRUD_FIND = "mge@crud.find";
|
6
18
|
let parsedFields = [];
|