@sankhyalabs/sankhyablocks 0.0.0-feat-dev-KB-18468.2 → 0.0.0-feat-dev-25080.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-c26705cc.js → ConfigStorage-c15716fd.js} +5 -2
- package/dist/cjs/{DataFetcher-3f9e6ee2.js → DataFetcher-713f0749.js} +52 -37
- package/dist/cjs/PreloadManager-84466da6.js +224 -0
- package/dist/cjs/{SnkFormConfigManager-12cd719b.js → SnkFormConfigManager-29101e20.js} +2 -2
- package/dist/cjs/{SnkMessageBuilder-d0abb63d.js → SnkMessageBuilder-0202c090.js} +15 -3
- package/dist/cjs/{SnkMultiSelectionListDataSource-804ff4c7.js → SnkMultiSelectionListDataSource-ba5838c2.js} +15 -0
- package/dist/cjs/{auth-fetcher-8ba4a15e.js → auth-fetcher-555ff856.js} +1 -1
- package/dist/cjs/dataunit-fetcher-af1c655d.js +712 -0
- package/dist/cjs/{form-config-fetcher-037d16de.js → form-config-fetcher-17775a75.js} +1 -1
- package/dist/cjs/index-f9e81701.js +4 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{pesquisa-fetcher-b5b42098.js → pesquisa-fetcher-34922b83.js} +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button.cjs.entry.js +96 -88
- package/dist/cjs/snk-application.cjs.entry.js +121 -53
- package/dist/cjs/snk-attach.cjs.entry.js +18 -3
- package/dist/cjs/snk-configurator.cjs.entry.js +16 -1
- package/dist/cjs/snk-crud.cjs.entry.js +9 -5
- package/dist/cjs/snk-custom-slot-elements.cjs.entry.js +20 -0
- package/dist/cjs/snk-data-exporter.cjs.entry.js +9 -7
- package/dist/cjs/{snk-data-unit-b662d63d.js → snk-data-unit-bcfdd657.js} +14 -1
- package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
- package/dist/cjs/snk-detail-view.cjs.entry.js +26 -8
- package/dist/cjs/snk-filter-bar.cjs.entry.js +23 -5
- package/dist/cjs/snk-filter-item.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-list.cjs.entry.js +1 -1
- 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-config.cjs.entry.js +3 -3
- package/dist/cjs/snk-grid.cjs.entry.js +51 -20
- package/dist/cjs/{snk-guides-viewer-2c68848e.js → snk-guides-viewer-7d6ad1c8.js} +92 -8
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +10 -6
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +19 -9
- package/dist/cjs/snk-simple-crud.cjs.entry.js +11 -92
- package/dist/cjs/snk-taskbar.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/snk-actions-button/actions/executor/java.executor.js +2 -2
- package/dist/collection/components/snk-actions-button/actions/executor/javascript.executor.js +2 -2
- package/dist/collection/components/snk-actions-button/actions/executor/procedure.executor.js +2 -2
- package/dist/collection/components/snk-actions-button/clientEvent/index.js +81 -76
- package/dist/collection/components/snk-actions-button/snk-actions-button.css +4 -11
- package/dist/collection/components/snk-actions-button/snk-actions-button.js +2 -2
- package/dist/collection/components/snk-application/snk-application.js +134 -70
- package/dist/collection/components/snk-attach/snk-attach.js +14 -2
- package/dist/collection/components/snk-configurator/snk-configurator.js +33 -1
- package/dist/collection/components/snk-crud/snk-crud.js +1 -1
- package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +18 -1
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +94 -12
- package/dist/collection/components/snk-custom-slot-elements/snk-custom-slot-elements.css +3 -0
- package/dist/collection/components/{snk-taskbar/snk-taskbar-custom-elements.js → snk-custom-slot-elements/snk-custom-slot-elements.js} +10 -10
- package/dist/collection/components/snk-data-exporter/snk-data-exporter.css +1 -9
- package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +1 -1
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +14 -1
- package/dist/collection/components/snk-filter-bar/filter-item/dataunitfilter/data-unit-filter-builder.js +17 -2
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +1 -1
- package/dist/collection/components/snk-filter-bar/filter-list/snk-filter-list.js +1 -1
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +5 -6
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +25 -0
- package/dist/collection/components/snk-grid/filtercolumn/SnkMultiSelectionListDataSource.js +11 -0
- package/dist/collection/components/snk-grid/snk-grid.css +2 -1
- package/dist/collection/components/snk-grid/snk-grid.js +52 -21
- package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js +16 -6
- package/dist/collection/components/snk-taskbar/snk-taskbar.css +0 -4
- package/dist/collection/lib/dataUnit/InMemoryLoader.js +71 -15
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +53 -39
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.js +118 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.js +80 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.js +139 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/{dataunit-fetcher.js → data-unit/dataunit-fetcher.js} +49 -100
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadDataResult.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadDataStrategy.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadingInfo.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRecordField.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IResponseRecord.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DataUnitStrategy.js +68 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +152 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/index.js +3 -2
- package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/personalized-reports-fetcher.js +3 -2
- package/dist/collection/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.js +3 -0
- package/dist/collection/lib/index.js +1 -1
- package/dist/collection/lib/message/SnkMessageBuilder.js +7 -3
- package/dist/collection/lib/message/resources/snk-application.msg.js +9 -0
- package/dist/collection/lib/workspace/workspace.js +15 -0
- package/dist/components/ConfigStorage.js +3 -0
- package/dist/components/DataFetcher.js +53 -38
- package/dist/components/SnkMessageBuilder.js +15 -3
- package/dist/components/SnkMultiSelectionListDataSource.js +11 -0
- package/dist/components/dataunit-fetcher.js +833 -100
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/snk-actions-button2.js +91 -86
- package/dist/components/snk-application2.js +113 -49
- package/dist/components/snk-attach2.js +13 -1
- package/dist/components/snk-configurator2.js +18 -2
- package/dist/components/snk-crud.js +2 -2
- package/dist/components/snk-custom-slot-elements.d.ts +11 -0
- package/dist/components/snk-custom-slot-elements.js +35 -0
- package/dist/components/snk-data-exporter2.js +7 -5
- package/dist/components/snk-data-unit2.js +14 -1
- package/dist/components/snk-detail-view2.js +103 -7
- package/dist/components/snk-filter-bar2.js +22 -4
- package/dist/components/snk-filter-item2.js +1 -1
- package/dist/components/snk-filter-list.js +1 -1
- package/dist/components/snk-grid2.js +47 -18
- package/dist/components/snk-personalized-filter2.js +16 -6
- package/dist/components/snk-simple-crud2.js +2 -88
- package/dist/components/snk-taskbar2.js +1 -1
- package/dist/esm/{ConfigStorage-a4720a6a.js → ConfigStorage-79c81f36.js} +5 -2
- package/dist/esm/{DataFetcher-bc95bc22.js → DataFetcher-79f78222.js} +53 -38
- package/dist/esm/PreloadManager-c1c2f2b4.js +222 -0
- package/dist/esm/{SnkFormConfigManager-c470c66a.js → SnkFormConfigManager-7723f3ec.js} +2 -2
- package/dist/esm/{SnkMessageBuilder-68c1c25a.js → SnkMessageBuilder-ba5d04d3.js} +15 -3
- package/dist/esm/{SnkMultiSelectionListDataSource-892f37f9.js → SnkMultiSelectionListDataSource-44494b0e.js} +11 -0
- package/dist/esm/{auth-fetcher-c76146d0.js → auth-fetcher-e260d0cd.js} +1 -1
- package/dist/esm/dataunit-fetcher-d5e6cc8c.js +709 -0
- package/dist/esm/{form-config-fetcher-5df96b19.js → form-config-fetcher-e1603e66.js} +1 -1
- package/dist/esm/index-a7d3d3f1.js +4 -4
- package/dist/esm/loader.js +1 -1
- package/dist/{components/pesquisa-fetcher.js → esm/pesquisa-fetcher-8e922c9d.js} +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button.entry.js +96 -88
- package/dist/esm/snk-application.entry.js +121 -53
- package/dist/esm/snk-attach.entry.js +18 -3
- package/dist/esm/snk-configurator.entry.js +17 -2
- package/dist/esm/snk-crud.entry.js +9 -5
- package/dist/esm/snk-custom-slot-elements.entry.js +16 -0
- package/dist/esm/snk-data-exporter.entry.js +10 -8
- package/dist/esm/{snk-data-unit-2d34567d.js → snk-data-unit-ddd25458.js} +15 -2
- package/dist/esm/snk-data-unit.entry.js +2 -2
- package/dist/esm/snk-detail-view.entry.js +26 -8
- package/dist/esm/snk-filter-bar.entry.js +25 -7
- package/dist/esm/snk-filter-item.entry.js +1 -1
- package/dist/esm/snk-filter-list.entry.js +1 -1
- 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-config.entry.js +3 -3
- package/dist/esm/snk-grid.entry.js +53 -22
- package/dist/esm/{snk-guides-viewer-b2b75165.js → snk-guides-viewer-cd6f8ff7.js} +93 -9
- package/dist/esm/snk-guides-viewer.entry.js +10 -6
- package/dist/esm/snk-personalized-filter.entry.js +19 -9
- package/dist/esm/snk-simple-crud.entry.js +10 -91
- package/dist/esm/snk-taskbar.entry.js +1 -1
- package/dist/sankhyablocks/p-008680a6.entry.js +1 -0
- package/dist/sankhyablocks/p-056cb6c4.entry.js +1 -0
- package/dist/sankhyablocks/p-05f6c9dc.entry.js +1 -0
- package/dist/sankhyablocks/{p-2d31c988.entry.js → p-06e76ed2.entry.js} +1 -1
- package/dist/sankhyablocks/p-0814adec.entry.js +1 -0
- package/dist/sankhyablocks/p-094c30cb.js +1 -0
- package/dist/sankhyablocks/p-29176742.js +56 -0
- package/dist/sankhyablocks/{p-38faeb78.js → p-2e6f1666.js} +1 -1
- package/dist/sankhyablocks/{p-34674758.entry.js → p-3bf4df20.entry.js} +1 -1
- package/dist/sankhyablocks/p-3ca9120f.entry.js +1 -0
- package/dist/sankhyablocks/p-3cf09796.entry.js +1 -0
- package/dist/sankhyablocks/{p-c5cb4981.js → p-41d156dd.js} +1 -1
- package/dist/sankhyablocks/{p-5bff3564.js → p-4651b43f.js} +1 -1
- package/dist/sankhyablocks/{p-c203ce53.entry.js → p-47e4b6c9.entry.js} +1 -1
- package/dist/sankhyablocks/p-4f5b995d.entry.js +1 -0
- package/dist/sankhyablocks/p-5b1b2c33.js +1 -0
- package/dist/sankhyablocks/p-69754d94.entry.js +1 -0
- package/dist/sankhyablocks/p-73d3daa8.entry.js +1 -0
- package/dist/sankhyablocks/p-7a85dcd3.entry.js +1 -0
- package/dist/sankhyablocks/p-7f4435e2.js +60 -0
- package/dist/sankhyablocks/{p-35ae5f31.entry.js → p-80692cbd.entry.js} +1 -1
- package/dist/sankhyablocks/p-9531cb90.entry.js +1 -0
- package/dist/sankhyablocks/p-a675e706.entry.js +1 -0
- package/dist/sankhyablocks/{p-f9395c20.entry.js → p-b3dc25aa.entry.js} +1 -1
- package/dist/sankhyablocks/p-c22c1d8e.js +1 -0
- package/dist/sankhyablocks/p-c8f8391a.js +1 -0
- package/dist/sankhyablocks/p-c9399ce6.js +1 -0
- package/dist/sankhyablocks/p-cd2b2139.entry.js +11 -0
- package/dist/sankhyablocks/{p-d567e5ce.js → p-d0b36421.js} +1 -1
- package/dist/sankhyablocks/{p-a1e1b305.entry.js → p-d3f53df2.entry.js} +1 -1
- package/dist/sankhyablocks/{p-648a7c72.entry.js → p-d4fb9642.entry.js} +1 -1
- package/dist/sankhyablocks/p-deeba96a.js +1 -0
- package/dist/sankhyablocks/p-eac8b93f.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-actions-button/clientEvent/index.d.ts +1 -1
- package/dist/types/components/snk-application/snk-application.d.ts +24 -10
- package/dist/types/components/snk-attach/snk-attach.d.ts +1 -0
- package/dist/types/components/snk-configurator/snk-configurator.d.ts +6 -0
- package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +3 -0
- package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +24 -11
- package/dist/types/components/snk-custom-slot-elements/snk-custom-slot-elements.d.ts +7 -0
- package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +1 -0
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +2 -0
- package/dist/types/components/snk-grid/filtercolumn/SnkMultiSelectionListDataSource.d.ts +2 -0
- package/dist/types/components/snk-grid/snk-grid.d.ts +7 -5
- package/dist/types/components/snk-personalized-filter/snk-personalized-filter.d.ts +3 -1
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +1 -0
- package/dist/types/components.d.ts +43 -28
- package/dist/types/lib/dataUnit/InMemoryLoader.d.ts +5 -1
- package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +8 -4
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.d.ts +13 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.d.ts +19 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.d.ts +22 -0
- package/dist/types/lib/http/data-fetcher/fetchers/{dataunit-fetcher.d.ts → data-unit/dataunit-fetcher.d.ts} +5 -3
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadDataResult.d.ts +6 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadDataStrategy.d.ts +7 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadingInfo.d.ts +10 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRecordField.d.ts +4 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/IResponseRecord.d.ts +6 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DataUnitStrategy.d.ts +9 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.d.ts +15 -0
- package/dist/types/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.d.ts +1 -1
- package/dist/types/lib/index.d.ts +1 -1
- package/dist/types/lib/message/resources/snk-application.msg.d.ts +2 -0
- package/dist/types/lib/workspace/workspace.d.ts +3 -0
- package/package.json +3 -3
- package/react/components.d.ts +1 -1
- package/react/components.js +1 -1
- package/react/components.js.map +1 -1
- package/dist/cjs/dataunit-fetcher-f4023df4.js +0 -356
- package/dist/cjs/snk-taskbar-custom-elements.cjs.entry.js +0 -20
- package/dist/components/snk-taskbar-custom-elements.d.ts +0 -11
- package/dist/components/snk-taskbar-custom-elements.js +0 -35
- package/dist/esm/dataunit-fetcher-b64f839d.js +0 -354
- package/dist/esm/pesquisa-fetcher-7e282f7e.js +0 -165
- package/dist/esm/snk-taskbar-custom-elements.entry.js +0 -16
- package/dist/sankhyablocks/p-1386c7f8.js +0 -1
- package/dist/sankhyablocks/p-1d63beb6.js +0 -76
- package/dist/sankhyablocks/p-267e8015.entry.js +0 -1
- package/dist/sankhyablocks/p-309115f6.js +0 -1
- package/dist/sankhyablocks/p-34604220.entry.js +0 -1
- package/dist/sankhyablocks/p-376c885b.entry.js +0 -1
- package/dist/sankhyablocks/p-45547a32.entry.js +0 -1
- package/dist/sankhyablocks/p-5f0a3361.entry.js +0 -1
- package/dist/sankhyablocks/p-62e95771.entry.js +0 -1
- package/dist/sankhyablocks/p-761ccda4.js +0 -56
- package/dist/sankhyablocks/p-7b806346.entry.js +0 -1
- package/dist/sankhyablocks/p-9a270401.entry.js +0 -1
- package/dist/sankhyablocks/p-a78a4c71.entry.js +0 -1
- package/dist/sankhyablocks/p-ae6aff81.js +0 -1
- package/dist/sankhyablocks/p-b28f0ae0.js +0 -1
- package/dist/sankhyablocks/p-b9c3eef6.entry.js +0 -11
- package/dist/sankhyablocks/p-ccffe6f0.entry.js +0 -1
- package/dist/sankhyablocks/p-dff866ca.entry.js +0 -1
- package/dist/sankhyablocks/p-e0c68cfc.entry.js +0 -1
- package/dist/sankhyablocks/p-fa9d3f73.js +0 -1
- package/dist/sankhyablocks/p-ff7002d5.entry.js +0 -1
- package/dist/types/components/snk-taskbar/snk-taskbar-custom-elements.d.ts +0 -7
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const formConfigFetcher = require('./form-config-fetcher-
|
|
3
|
+
const formConfigFetcher = require('./form-config-fetcher-17775a75.js');
|
|
4
4
|
const filterItemType_enum = require('./filter-item-type.enum-aa823a00.js');
|
|
5
5
|
const core = require('@sankhyalabs/core');
|
|
6
|
-
const DataFetcher = require('./DataFetcher-
|
|
6
|
+
const DataFetcher = require('./DataFetcher-713f0749.js');
|
|
7
7
|
|
|
8
8
|
class GridConfigFetcher extends formConfigFetcher.ResourceFetcher {
|
|
9
9
|
constructor() {
|
|
@@ -273,6 +273,9 @@ class PersonalizedFilterFetcher {
|
|
|
273
273
|
});
|
|
274
274
|
}
|
|
275
275
|
async savePersonalizedFilter(personalizedFilter, resourceID, configName) {
|
|
276
|
+
if (!personalizedFilter || Object.keys(personalizedFilter).length == 0) {
|
|
277
|
+
return Promise.reject(new Error("personalizedFilter não pode ser vazio"));
|
|
278
|
+
}
|
|
276
279
|
let personalizedFilterParsed = JSON.parse(JSON.stringify(personalizedFilter));
|
|
277
280
|
personalizedFilterParsed.assistent = JSON.stringify(personalizedFilterParsed.assistent);
|
|
278
281
|
return new Promise((resolve, reject) => {
|
|
@@ -6524,7 +6524,6 @@ var __asyncValues = (undefined && undefined.__asyncValues) || function (o) {
|
|
|
6524
6524
|
};
|
|
6525
6525
|
class DataFetcher {
|
|
6526
6526
|
constructor() {
|
|
6527
|
-
this.GRAPHQL_PATH = `/${window.MGE_MODULE_NAME || 'mgefin-bff'}/graphql`;
|
|
6528
6527
|
this.ready = true;
|
|
6529
6528
|
this.watingRequestsById = new Map();
|
|
6530
6529
|
}
|
|
@@ -6546,6 +6545,12 @@ class DataFetcher {
|
|
|
6546
6545
|
this.instance.application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
6547
6546
|
return this.instance;
|
|
6548
6547
|
}
|
|
6548
|
+
static getGraphQLPath() {
|
|
6549
|
+
if (core.StringUtils.isEmpty(this.instance.graphqlPath) && this.instance.application != undefined) {
|
|
6550
|
+
this.instance.graphqlPath = `/${this.instance.application.getModuleName()}/graphql`;
|
|
6551
|
+
}
|
|
6552
|
+
return this.instance.graphqlPath;
|
|
6553
|
+
}
|
|
6549
6554
|
static addRequestListener(listener) {
|
|
6550
6555
|
const index = DataFetcher.requestListener.indexOf(listener);
|
|
6551
6556
|
if (index < 0) {
|
|
@@ -6595,7 +6600,7 @@ class DataFetcher {
|
|
|
6595
6600
|
}
|
|
6596
6601
|
return new core.ErrorException(title, statusMessage, tsErrorCode);
|
|
6597
6602
|
}
|
|
6598
|
-
async callGraphQL(req) {
|
|
6603
|
+
async callGraphQL(req, quietMode = false) {
|
|
6599
6604
|
var _a;
|
|
6600
6605
|
if (this.ready) {
|
|
6601
6606
|
this.pause();
|
|
@@ -6613,22 +6618,22 @@ class DataFetcher {
|
|
|
6613
6618
|
if (this.ready) {
|
|
6614
6619
|
return new Promise(async (resolve, reject) => {
|
|
6615
6620
|
let query = this.getQueryTemplate(req);
|
|
6616
|
-
const res = await this.
|
|
6621
|
+
const res = await this.fecthGraphQL([{ document: query, variables: req.values }], quietMode);
|
|
6617
6622
|
if (res.errors.length > 0) {
|
|
6618
|
-
if (!this.proccesGraphQLClientEvents(res === null || res === void 0 ? void 0 : res.extensions, req, resolve, reject)) {
|
|
6623
|
+
if (!(await this.proccesGraphQLClientEvents(res === null || res === void 0 ? void 0 : res.extensions, req, resolve, reject))) {
|
|
6619
6624
|
const error = this.processGraphQlErrorInfo(res.errors);
|
|
6620
6625
|
reject(error);
|
|
6621
6626
|
}
|
|
6622
6627
|
}
|
|
6623
6628
|
else {
|
|
6624
6629
|
resolve(res.data[0][reqKey]);
|
|
6625
|
-
this.proccesGraphQLClientEvents(res === null || res === void 0 ? void 0 : res.extensions, req, resolve, reject);
|
|
6630
|
+
await this.proccesGraphQLClientEvents(res === null || res === void 0 ? void 0 : res.extensions, req, resolve, reject);
|
|
6626
6631
|
}
|
|
6627
6632
|
});
|
|
6628
6633
|
}
|
|
6629
6634
|
else {
|
|
6630
6635
|
if (!this.watingRequestsById.has(reqKey)) {
|
|
6631
|
-
this.watingRequestsById.set(reqKey, new WaitingRequest(req));
|
|
6636
|
+
this.watingRequestsById.set(reqKey, new WaitingRequest(req, quietMode));
|
|
6632
6637
|
}
|
|
6633
6638
|
return (_a = this.watingRequestsById.get(reqKey)) === null || _a === void 0 ? void 0 : _a.promise;
|
|
6634
6639
|
}
|
|
@@ -6636,7 +6641,7 @@ class DataFetcher {
|
|
|
6636
6641
|
resolveURL() {
|
|
6637
6642
|
return UrlUtils.getUrlBase();
|
|
6638
6643
|
}
|
|
6639
|
-
proccesGraphQLClientEvents(extensions, originalRequest, resolve, reject) {
|
|
6644
|
+
async proccesGraphQLClientEvents(extensions, originalRequest, resolve, reject) {
|
|
6640
6645
|
if (extensions == undefined) {
|
|
6641
6646
|
return false;
|
|
6642
6647
|
}
|
|
@@ -6651,8 +6656,8 @@ class DataFetcher {
|
|
|
6651
6656
|
throw new core.WarningException("ClientEvent não registrado", `Ocorreu o client event ${id} porém não há client event registrado na aplicação.`);
|
|
6652
6657
|
}
|
|
6653
6658
|
const handlers = DataFetcher.clientEventsByID.get(id);
|
|
6654
|
-
handlers.forEach(handler => {
|
|
6655
|
-
handler({ id, content: JSON.parse(clientEvents[id]) }, new GraphQLRecaller(originalRequest, resolve, reject));
|
|
6659
|
+
handlers.forEach(async (handler) => {
|
|
6660
|
+
await handler({ id, content: JSON.parse(clientEvents[id]) }, new GraphQLRecaller(originalRequest, resolve, reject));
|
|
6656
6661
|
});
|
|
6657
6662
|
}
|
|
6658
6663
|
return Object.keys(clientEvents).length > 0;
|
|
@@ -6726,9 +6731,9 @@ class DataFetcher {
|
|
|
6726
6731
|
const urlParams = UrlUtils.getQueryParams(location.search);
|
|
6727
6732
|
return {
|
|
6728
6733
|
baseUrl: `${this.resolveURL()}/${module}/service.sbr`,
|
|
6729
|
-
appName: "SankhyaBlocks",
|
|
6734
|
+
appName: window['APPLICATION_NAME'] || "SankhyaBlocks",
|
|
6730
6735
|
mgeSession: `${window['mgeSession'] || urlParams.get("mgeSession")}`,
|
|
6731
|
-
globalID:
|
|
6736
|
+
globalID: window['GLOBALID'] || core.StringUtils.generateUUID(),
|
|
6732
6737
|
resourceID: (window["resourceID"] || ((_a = window["workspace"]) === null || _a === void 0 ? void 0 : _a.resourceID))
|
|
6733
6738
|
};
|
|
6734
6739
|
}
|
|
@@ -6844,16 +6849,14 @@ class DataFetcher {
|
|
|
6844
6849
|
}
|
|
6845
6850
|
async executePendingRequest(watingRequestsById) {
|
|
6846
6851
|
const requestsBatch = [];
|
|
6847
|
-
|
|
6848
|
-
|
|
6852
|
+
let quietMode = true;
|
|
6853
|
+
watingRequestsById.forEach((waitingReq) => {
|
|
6854
|
+
const query = this.getQueryTemplate(waitingReq.request);
|
|
6849
6855
|
requestsBatch.push({ document: query, variables: Object.assign({}, waitingReq.request.values) });
|
|
6856
|
+
quietMode = quietMode && waitingReq.quietMode;
|
|
6850
6857
|
});
|
|
6851
|
-
|
|
6852
|
-
|
|
6853
|
-
let errorsResponse = [];
|
|
6854
|
-
res = await this.fecthGrapql(requestsBatch);
|
|
6855
|
-
dataResponse = res.data;
|
|
6856
|
-
errorsResponse = res.errors;
|
|
6858
|
+
const response = await this.fecthGraphQL(requestsBatch, quietMode);
|
|
6859
|
+
const { data: dataResponse, errors: errorsResponse, extensions } = response;
|
|
6857
6860
|
//Reject promises with errors from query
|
|
6858
6861
|
errorsResponse.forEach((errorResponse) => {
|
|
6859
6862
|
Object.entries(errorResponse).forEach(([_key, val]) => {
|
|
@@ -6863,25 +6866,33 @@ class DataFetcher {
|
|
|
6863
6866
|
});
|
|
6864
6867
|
//Resolve promises with data from query
|
|
6865
6868
|
dataResponse.forEach((data) => {
|
|
6866
|
-
Object.entries(data).forEach(([key, val]) => {
|
|
6867
|
-
|
|
6868
|
-
|
|
6869
|
+
Object.entries(data).forEach(async ([key, val]) => {
|
|
6870
|
+
const waitingRequest = watingRequestsById.get(key);
|
|
6871
|
+
await this.proccesGraphQLClientEvents(extensions, waitingRequest.request, waitingRequest.resolve, waitingRequest.reject);
|
|
6872
|
+
((waitingRequest === null || waitingRequest === void 0 ? void 0 : waitingRequest.resolve) || Promise.resolve)(val);
|
|
6869
6873
|
});
|
|
6870
6874
|
});
|
|
6871
6875
|
}
|
|
6872
|
-
|
|
6873
|
-
|
|
6874
|
-
let
|
|
6875
|
-
|
|
6876
|
-
|
|
6877
|
-
|
|
6878
|
-
if (
|
|
6879
|
-
url +=
|
|
6876
|
+
buildGraphQlURL(quietMode) {
|
|
6877
|
+
const mgeSession = window["mgeSession"];
|
|
6878
|
+
let url = `${this.resolveURL() + DataFetcher.getGraphQLPath()}`;
|
|
6879
|
+
if (mgeSession) {
|
|
6880
|
+
url += `?mgeSession=${mgeSession}`;
|
|
6881
|
+
}
|
|
6882
|
+
if (quietMode) {
|
|
6883
|
+
url += `${url.indexOf("?") > -1 ? "&" : "?"}quietMode=true`;
|
|
6880
6884
|
}
|
|
6881
|
-
|
|
6885
|
+
return url;
|
|
6886
|
+
}
|
|
6887
|
+
async fecthGraphQL(request, quietMode) {
|
|
6888
|
+
const dataResponse = [];
|
|
6889
|
+
const errorsResponse = [];
|
|
6890
|
+
const responseExtensions = [];
|
|
6891
|
+
const url = this.buildGraphQlURL(quietMode);
|
|
6892
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url, requestBody: request }));
|
|
6882
6893
|
try {
|
|
6883
|
-
|
|
6884
|
-
|
|
6894
|
+
const response = await dist.batchRequests(url, request, { 'Content-Type': `application/json; charset=${window['SERVER_ENCODING'] || 'UTF-8'}` });
|
|
6895
|
+
response.forEach((resItem, index) => {
|
|
6885
6896
|
var _a;
|
|
6886
6897
|
if (((_a = resItem === null || resItem === void 0 ? void 0 : resItem.errors) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
6887
6898
|
errorsResponse.push(resItem.errors.map((item) => this.normalizeErrorResponse(item, request, index)));
|
|
@@ -6896,7 +6907,7 @@ class DataFetcher {
|
|
|
6896
6907
|
}
|
|
6897
6908
|
catch (err) {
|
|
6898
6909
|
if (!this.isHttpError(err)) {
|
|
6899
|
-
res = err.response;
|
|
6910
|
+
const res = err.response;
|
|
6900
6911
|
const req = err.request;
|
|
6901
6912
|
Object.entries(res).forEach(([key, val]) => {
|
|
6902
6913
|
if (val.errors) {
|
|
@@ -6912,11 +6923,11 @@ class DataFetcher {
|
|
|
6912
6923
|
});
|
|
6913
6924
|
}
|
|
6914
6925
|
else {
|
|
6915
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url
|
|
6926
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url, requestBody: request }));
|
|
6916
6927
|
throw new core.ErrorException("Falha de comunicação", err.message);
|
|
6917
6928
|
}
|
|
6918
6929
|
}
|
|
6919
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url
|
|
6930
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url, requestBody: request }));
|
|
6920
6931
|
return { data: dataResponse, errors: errorsResponse, extensions: responseExtensions };
|
|
6921
6932
|
}
|
|
6922
6933
|
isHttpError(err) {
|
|
@@ -6962,7 +6973,7 @@ DataFetcher.SERVICE_BROKER_STATUS = {
|
|
|
6962
6973
|
};
|
|
6963
6974
|
DataFetcher.clientEventsByID = new Map();
|
|
6964
6975
|
class WaitingRequest {
|
|
6965
|
-
constructor(req) {
|
|
6976
|
+
constructor(req, quietMode) {
|
|
6966
6977
|
this._resolve = () => { };
|
|
6967
6978
|
this._reject = () => { };
|
|
6968
6979
|
this._request = undefined;
|
|
@@ -6971,6 +6982,7 @@ class WaitingRequest {
|
|
|
6971
6982
|
this._resolve = resolve;
|
|
6972
6983
|
this._reject = reject;
|
|
6973
6984
|
});
|
|
6985
|
+
this._quietMode = quietMode;
|
|
6974
6986
|
}
|
|
6975
6987
|
get resolve() {
|
|
6976
6988
|
return this._resolve;
|
|
@@ -6984,6 +6996,9 @@ class WaitingRequest {
|
|
|
6984
6996
|
get request() {
|
|
6985
6997
|
return this._request;
|
|
6986
6998
|
}
|
|
6999
|
+
get quietMode() {
|
|
7000
|
+
return this._quietMode;
|
|
7001
|
+
}
|
|
6987
7002
|
}
|
|
6988
7003
|
|
|
6989
7004
|
exports.DataFetcher = DataFetcher;
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const core = require('@sankhyalabs/core');
|
|
4
|
+
const utils = require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
|
|
5
|
+
|
|
6
|
+
class ArrayRepository {
|
|
7
|
+
constructor(equalsFunction) {
|
|
8
|
+
this._list = [];
|
|
9
|
+
this._equalsFunction = equalsFunction;
|
|
10
|
+
}
|
|
11
|
+
async load(filterFunction, sortingFunction, offset, limit) {
|
|
12
|
+
let result = [].concat(this._list);
|
|
13
|
+
if (filterFunction != undefined) {
|
|
14
|
+
result = this._list.filter(item => filterFunction(item));
|
|
15
|
+
}
|
|
16
|
+
if (sortingFunction != undefined) {
|
|
17
|
+
result = result.sort(sortingFunction);
|
|
18
|
+
}
|
|
19
|
+
const count = result.length;
|
|
20
|
+
if (limit != undefined) {
|
|
21
|
+
const start = offset || 0;
|
|
22
|
+
const end = limit ? start + limit : result.length;
|
|
23
|
+
result = result.slice(start, end);
|
|
24
|
+
}
|
|
25
|
+
return Promise.resolve({ result, count });
|
|
26
|
+
}
|
|
27
|
+
async distict(itemProcessor) {
|
|
28
|
+
const processedItems = [];
|
|
29
|
+
let hasEmpty = false;
|
|
30
|
+
for (const item of this._list) {
|
|
31
|
+
const processedItem = itemProcessor(item);
|
|
32
|
+
if (processedItem == undefined) {
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
if (processedItem.value == undefined) {
|
|
36
|
+
hasEmpty = true;
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
processedItems.push(processedItem);
|
|
40
|
+
}
|
|
41
|
+
if (hasEmpty) {
|
|
42
|
+
processedItems.push({ key: "", value: null });
|
|
43
|
+
}
|
|
44
|
+
return Promise.resolve(new Map(processedItems.map(item => [item.key, item.value])));
|
|
45
|
+
}
|
|
46
|
+
async push(items) {
|
|
47
|
+
this._list.push(...items);
|
|
48
|
+
}
|
|
49
|
+
async clear() {
|
|
50
|
+
this._list = [];
|
|
51
|
+
}
|
|
52
|
+
async delete(items) {
|
|
53
|
+
this._list = this._list.filter(item => {
|
|
54
|
+
for (const removed of items) {
|
|
55
|
+
if (this._equalsFunction(item, removed)) {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return true;
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
async update(items) {
|
|
63
|
+
this._list = this._list.map(existingItem => {
|
|
64
|
+
const newItem = items.find(newItem => this._equalsFunction(existingItem, newItem));
|
|
65
|
+
return newItem == undefined ? existingItem : newItem;
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
async insert(itemReference, items) {
|
|
69
|
+
const itemPosition = this._list.indexOf(itemReference);
|
|
70
|
+
if (itemPosition == -1) {
|
|
71
|
+
this._list.push(...items);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
this._list = this._list.slice(0, itemPosition).concat(items).concat(this._list.slice(itemPosition));
|
|
75
|
+
}
|
|
76
|
+
isOperating() {
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
async isEmpty() {
|
|
80
|
+
return Promise.resolve(this._list.length === 0);
|
|
81
|
+
}
|
|
82
|
+
async count() {
|
|
83
|
+
return Promise.resolve(this._list.length);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
class PreloadManager {
|
|
88
|
+
static setLoadingStatus(dataUnit, loadingInProgress) {
|
|
89
|
+
this._loadingStatus.set(dataUnit.name, loadingInProgress);
|
|
90
|
+
}
|
|
91
|
+
static isCacheEnabled(_dataUnit) {
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
94
|
+
static cacheRecords(dataUnit, records, resetDatabase, loadingInProgress) {
|
|
95
|
+
PreloadManager.setLoadingStatus(dataUnit, loadingInProgress);
|
|
96
|
+
if (PreloadManager.isCacheEnabled(dataUnit)) {
|
|
97
|
+
this.getRepository(dataUnit).push(records);
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
if (resetDatabase) {
|
|
101
|
+
this._repositories.delete(dataUnit.name);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
static getSortingFunction(dataUnit, sorting) {
|
|
106
|
+
if (sorting == undefined || sorting.length == 0) {
|
|
107
|
+
return undefined;
|
|
108
|
+
}
|
|
109
|
+
return (recordA, recordB) => {
|
|
110
|
+
for (const sort of sorting) {
|
|
111
|
+
const result = core.FieldComparator.compare(dataUnit.getField(sort.field), recordA, recordB, sort.mode === core.SortMode.ASC);
|
|
112
|
+
if (result != 0) {
|
|
113
|
+
return result;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
static async getDistinct(dataUnit, fieldName) {
|
|
119
|
+
if (!PreloadManager.isCacheEnabled(dataUnit)) {
|
|
120
|
+
return Promise.resolve(utils.ColumnFilterManager.compileDistinct(fieldName, dataUnit));
|
|
121
|
+
}
|
|
122
|
+
let filterFunction;
|
|
123
|
+
const request = dataUnit.getLastLoadRequest();
|
|
124
|
+
if (request != undefined) {
|
|
125
|
+
const columnFilters = utils.ColumnFilterManager.getColumnFilters(request.filters, fieldName);
|
|
126
|
+
filterFunction = utils.ColumnFilterManager.getFilterFunction(dataUnit, Array.from(columnFilters.values()));
|
|
127
|
+
}
|
|
128
|
+
return new Promise((accept, reject) => {
|
|
129
|
+
PreloadManager.getRepository(dataUnit).distict(record => {
|
|
130
|
+
if (filterFunction != undefined && !filterFunction(record)) {
|
|
131
|
+
return undefined;
|
|
132
|
+
}
|
|
133
|
+
const fieldValue = record[fieldName];
|
|
134
|
+
if (fieldValue == undefined) {
|
|
135
|
+
return { key: null, value: null };
|
|
136
|
+
}
|
|
137
|
+
const value = fieldValue.value != undefined ? fieldValue.value : fieldValue;
|
|
138
|
+
return { key: dataUnit.getFormattedValue(fieldName, fieldValue), value };
|
|
139
|
+
})
|
|
140
|
+
.then(result => {
|
|
141
|
+
if (result == undefined) {
|
|
142
|
+
accept(undefined);
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
accept(Array.from(result.entries()).map(([label, value]) => ({ label, value, check: true })));
|
|
146
|
+
})
|
|
147
|
+
.catch(reason => reject(reason));
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
static async loadData(dataUnit, request, loadFromServer) {
|
|
151
|
+
try {
|
|
152
|
+
if (PreloadManager.isCacheEnabled(dataUnit)) {
|
|
153
|
+
let useCache = request.source === "EZ_GRID_LOADING_SOURCE" || request.source === core.DataUnit.CHANGING_PAGE_LOADING_SOURCE;
|
|
154
|
+
if (useCache) {
|
|
155
|
+
const isCacheEmpty = await PreloadManager.getRepository(dataUnit).isEmpty();
|
|
156
|
+
if (!isCacheEmpty) {
|
|
157
|
+
return PreloadManager.loadFromCache(dataUnit, request);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
//Como não vamos aproveitar o cache, ele precisa ser limpo.
|
|
161
|
+
PreloadManager.getRepository(dataUnit).clear().catch(() => { });
|
|
162
|
+
}
|
|
163
|
+
return loadFromServer(dataUnit, request);
|
|
164
|
+
}
|
|
165
|
+
catch (error) {
|
|
166
|
+
console.error(error);
|
|
167
|
+
return Promise.reject(error);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
static insertRecords(dataUnit, reference, records) {
|
|
171
|
+
if (PreloadManager.isCacheEnabled(dataUnit)) {
|
|
172
|
+
PreloadManager.getRepository(dataUnit).insert(reference, records);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
static updateRecords(dataUnit, records) {
|
|
176
|
+
if (PreloadManager.isCacheEnabled(dataUnit)) {
|
|
177
|
+
PreloadManager.getRepository(dataUnit).update(records);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
static removeRecords(dataUnit, records) {
|
|
181
|
+
if (PreloadManager.isCacheEnabled(dataUnit)) {
|
|
182
|
+
PreloadManager.getRepository(dataUnit).delete(records);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
static async countRecords(dataUnit) {
|
|
186
|
+
if (PreloadManager.isCacheEnabled(dataUnit)) {
|
|
187
|
+
return PreloadManager.getRepository(dataUnit).count();
|
|
188
|
+
}
|
|
189
|
+
return Promise.resolve(0);
|
|
190
|
+
}
|
|
191
|
+
static getRepository(dataUnit) {
|
|
192
|
+
const name = dataUnit.name;
|
|
193
|
+
if (!PreloadManager._repositories.has(name)) {
|
|
194
|
+
PreloadManager._repositories.set(name, new ArrayRepository((recordA, recordB) => recordA.__record__id__ === recordB.__record__id__));
|
|
195
|
+
}
|
|
196
|
+
return PreloadManager._repositories.get(name);
|
|
197
|
+
}
|
|
198
|
+
static async loadFromCache(dataUnit, request) {
|
|
199
|
+
return new Promise((accept, reject) => {
|
|
200
|
+
const columnFilters = utils.ColumnFilterManager.getColumnFilters(request.filters, "");
|
|
201
|
+
const { limit, offset, sort } = request;
|
|
202
|
+
PreloadManager.getRepository(dataUnit)
|
|
203
|
+
.load(utils.ColumnFilterManager.getFilterFunction(dataUnit, Array.from(columnFilters.values())), PreloadManager.getSortingFunction(dataUnit, sort), offset, limit)
|
|
204
|
+
.then(loadResult => {
|
|
205
|
+
const stillLoading = PreloadManager._loadingStatus.get(dataUnit.name);
|
|
206
|
+
const { count, result: records } = loadResult;
|
|
207
|
+
const firstRecord = count == 0 ? 0 : offset + 1;
|
|
208
|
+
const lastRecord = offset + Math.min(records.length, limit);
|
|
209
|
+
const currentPage = offset / limit;
|
|
210
|
+
const paginationInfo = {
|
|
211
|
+
count, currentPage, firstRecord, lastRecord,
|
|
212
|
+
hasMore: stillLoading || (lastRecord < count),
|
|
213
|
+
total: stillLoading ? undefined : count
|
|
214
|
+
};
|
|
215
|
+
accept({ records, paginationInfo });
|
|
216
|
+
})
|
|
217
|
+
.catch(reason => reject(reason));
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
PreloadManager._repositories = new Map();
|
|
222
|
+
PreloadManager._loadingStatus = new Map();
|
|
223
|
+
|
|
224
|
+
exports.PreloadManager = PreloadManager;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const ConfigStorage = require('./ConfigStorage-
|
|
3
|
+
const ConfigStorage = require('./ConfigStorage-c15716fd.js');
|
|
4
4
|
const core = require('@sankhyalabs/core');
|
|
5
|
-
const formConfigFetcher = require('./form-config-fetcher-
|
|
5
|
+
const formConfigFetcher = require('./form-config-fetcher-17775a75.js');
|
|
6
6
|
|
|
7
7
|
class SnkFormConfigManager {
|
|
8
8
|
constructor(configName, resourceID, onConfigChange) {
|
|
@@ -174,6 +174,15 @@ const fileViewerMessages = {
|
|
|
174
174
|
}
|
|
175
175
|
};
|
|
176
176
|
|
|
177
|
+
const snkAttachMessages$1 = {
|
|
178
|
+
newVersionPopup: {
|
|
179
|
+
title: "Boas vindas à nova interface da tela {{screenName}}",
|
|
180
|
+
info: "Com uma jornada mais moderna, simples e intuitiva, a performance aprimorada da nova interface impulsionará a sua produtividade.",
|
|
181
|
+
okButton: "Quero experimentar!",
|
|
182
|
+
cancelButton: "Voltar à interface anterior",
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
|
|
177
186
|
const snkConfigOptionsMessages = {
|
|
178
187
|
label: {
|
|
179
188
|
nameField: "Nome do Campo *",
|
|
@@ -507,6 +516,7 @@ const snkPrintSelectorMessages = {
|
|
|
507
516
|
class SnkMessageBuilder {
|
|
508
517
|
constructor(domainName) {
|
|
509
518
|
this._defaults = {
|
|
519
|
+
snkApplication: snkAttachMessages$1,
|
|
510
520
|
snkDataUnit: snkDataUnitMessages,
|
|
511
521
|
snkFormConfig: snkFormConfigMessages,
|
|
512
522
|
snkConfigOptions: snkConfigOptionsMessages,
|
|
@@ -529,7 +539,7 @@ class SnkMessageBuilder {
|
|
|
529
539
|
snkPersonalizedFilter: snkPersonalizedFilterMessages,
|
|
530
540
|
snkEntityList: snkEntityListMessages,
|
|
531
541
|
snkActionsButton: snkActionsButtonMessages,
|
|
532
|
-
snkPrintSelector: snkPrintSelectorMessages
|
|
542
|
+
snkPrintSelector: snkPrintSelectorMessages,
|
|
533
543
|
};
|
|
534
544
|
this._currentOperation = exports.OperationMap.CLEAN;
|
|
535
545
|
this._domainName = domainName;
|
|
@@ -576,10 +586,12 @@ class SnkMessageBuilder {
|
|
|
576
586
|
return this.postProcess(msg, params);
|
|
577
587
|
}
|
|
578
588
|
getDomainMessages() {
|
|
579
|
-
if (this.
|
|
589
|
+
if (!this._appMessages)
|
|
590
|
+
return undefined;
|
|
591
|
+
if (!this._domainName) {
|
|
580
592
|
return this._appMessages['Global'] || this._appMessages;
|
|
581
593
|
}
|
|
582
|
-
return
|
|
594
|
+
return this._appMessages[this._domainName];
|
|
583
595
|
}
|
|
584
596
|
resolveMessage(keys, object) {
|
|
585
597
|
if (object == undefined) {
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const core = require('@sankhyalabs/core');
|
|
4
|
+
const InMemoryFilterColumnDataSource = require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource');
|
|
5
|
+
const PreloadManager = require('./PreloadManager-84466da6.js');
|
|
6
|
+
|
|
7
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
+
|
|
9
|
+
const InMemoryFilterColumnDataSource__default = /*#__PURE__*/_interopDefaultLegacy(InMemoryFilterColumnDataSource);
|
|
4
10
|
|
|
5
11
|
class SnkMultiSelectionListDataSource {
|
|
6
12
|
setDataUnit(dataUnit) {
|
|
@@ -16,6 +22,12 @@ class SnkMultiSelectionListDataSource {
|
|
|
16
22
|
}
|
|
17
23
|
return String(this._dataUnit.getFormattedValue(fieldName, value));
|
|
18
24
|
}
|
|
25
|
+
async getStaticOptions(fieldName) {
|
|
26
|
+
if (fieldName == undefined) {
|
|
27
|
+
return Promise.resolve(undefined);
|
|
28
|
+
}
|
|
29
|
+
return Promise.resolve(await PreloadManager.PreloadManager.getDistinct(this._dataUnit, fieldName));
|
|
30
|
+
}
|
|
19
31
|
fetchData(filterTerm, fieldName) {
|
|
20
32
|
return new Promise(resolve => {
|
|
21
33
|
this._application.executeSelectDistinct(this._dataUnit, fieldName, filterTerm).then(result => {
|
|
@@ -29,6 +41,9 @@ class SnkMultiSelectionListDataSource {
|
|
|
29
41
|
});
|
|
30
42
|
});
|
|
31
43
|
}
|
|
44
|
+
sortItems(fieldName, items) {
|
|
45
|
+
return InMemoryFilterColumnDataSource__default['default'].defaultSorterMultSelectionOption(this._dataUnit, fieldName, items);
|
|
46
|
+
}
|
|
32
47
|
}
|
|
33
48
|
|
|
34
49
|
exports.SnkMultiSelectionListDataSource = SnkMultiSelectionListDataSource;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const core = require('@sankhyalabs/core');
|
|
4
|
-
const formConfigFetcher = require('./form-config-fetcher-
|
|
4
|
+
const formConfigFetcher = require('./form-config-fetcher-17775a75.js');
|
|
5
5
|
|
|
6
6
|
class AuthFetcher extends formConfigFetcher.ResourceFetcher {
|
|
7
7
|
getData(resourceID) {
|