@sankhyalabs/sankhyablocks 8.7.0 → 8.8.0-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-1097ff27.js → ConfigStorage-a97ca159.js} +2 -2
- package/dist/cjs/{DataFetcher-a00bc007.js → DataFetcher-2a99283c.js} +19 -10
- package/dist/cjs/{SnkFormConfigManager-a4b4d852.js → SnkFormConfigManager-f641f502.js} +2 -2
- package/dist/cjs/{SnkMultiSelectionListDataSource-804ff4c7.js → SnkMultiSelectionListDataSource-56db34ee.js} +11 -0
- package/dist/cjs/{auth-fetcher-92f3040b.js → auth-fetcher-78231356.js} +1 -1
- package/dist/cjs/dataunit-fetcher-4f7d4ee7.js +878 -0
- package/dist/cjs/{form-config-fetcher-60fbeb94.js → form-config-fetcher-a322a522.js} +1 -1
- package/dist/cjs/{pesquisa-fetcher-b2ed9767.js → pesquisa-fetcher-7ef61508.js} +1 -1
- package/dist/cjs/snk-actions-button.cjs.entry.js +4 -3
- package/dist/cjs/snk-application.cjs.entry.js +17 -8
- package/dist/cjs/snk-attach.cjs.entry.js +16 -3
- package/dist/cjs/snk-crud.cjs.entry.js +6 -4
- package/dist/cjs/snk-data-exporter.cjs.entry.js +1 -1
- package/dist/cjs/snk-detail-view.cjs.entry.js +8 -6
- package/dist/cjs/snk-filter-bar.cjs.entry.js +3 -3
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
- package/dist/cjs/snk-form-config.cjs.entry.js +2 -2
- package/dist/cjs/snk-form.cjs.entry.js +4 -4
- package/dist/cjs/snk-grid-config.cjs.entry.js +3 -3
- package/dist/cjs/snk-grid.cjs.entry.js +25 -14
- package/dist/cjs/{snk-guides-viewer-eab0ec84.js → snk-guides-viewer-aab80f66.js} +5 -4
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +8 -6
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +19 -9
- package/dist/cjs/snk-simple-crud.cjs.entry.js +8 -92
- package/dist/collection/components/snk-application/snk-application.js +11 -3
- package/dist/collection/components/snk-attach/snk-attach.js +14 -2
- package/dist/collection/components/snk-grid/filtercolumn/SnkMultiSelectionListDataSource.js +11 -0
- package/dist/collection/components/snk-grid/snk-grid.js +24 -14
- package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js +16 -6
- package/dist/collection/lib/dataUnit/InMemoryLoader.js +23 -2
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +19 -10
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.js +113 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.js +59 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.js +169 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/{dataunit-fetcher.js → data-unit/dataunit-fetcher.js} +48 -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 +131 -0
- package/dist/collection/lib/index.js +1 -1
- package/dist/components/DataFetcher.js +19 -10
- package/dist/components/SnkMultiSelectionListDataSource.js +11 -0
- package/dist/components/dataunit-fetcher.js +781 -100
- package/dist/components/snk-actions-button2.js +1 -1
- package/dist/components/snk-application2.js +11 -4
- package/dist/components/snk-attach2.js +13 -1
- package/dist/components/snk-crud.js +1 -1
- package/dist/components/snk-detail-view2.js +1 -1
- package/dist/components/snk-grid2.js +19 -11
- package/dist/components/snk-personalized-filter2.js +16 -6
- package/dist/components/snk-simple-crud2.js +2 -88
- package/dist/esm/{ConfigStorage-4d30a649.js → ConfigStorage-26f89143.js} +2 -2
- package/dist/esm/{DataFetcher-487d6aad.js → DataFetcher-90e91631.js} +19 -10
- package/dist/esm/{SnkFormConfigManager-da594f63.js → SnkFormConfigManager-18948123.js} +2 -2
- package/dist/esm/{SnkMultiSelectionListDataSource-892f37f9.js → SnkMultiSelectionListDataSource-b9410c72.js} +11 -0
- package/dist/esm/{auth-fetcher-5c3ae75b.js → auth-fetcher-a8c8ee7e.js} +1 -1
- package/dist/esm/dataunit-fetcher-1c2ccae2.js +874 -0
- package/dist/esm/{form-config-fetcher-cd3fa459.js → form-config-fetcher-7c3b6273.js} +1 -1
- package/dist/{components/pesquisa-fetcher.js → esm/pesquisa-fetcher-90d6853b.js} +1 -1
- package/dist/esm/snk-actions-button.entry.js +4 -3
- package/dist/esm/snk-application.entry.js +17 -8
- package/dist/esm/snk-attach.entry.js +16 -3
- package/dist/esm/snk-crud.entry.js +6 -4
- package/dist/esm/snk-data-exporter.entry.js +1 -1
- package/dist/esm/snk-detail-view.entry.js +8 -6
- package/dist/esm/snk-filter-bar.entry.js +3 -3
- package/dist/esm/snk-filter-modal-item.entry.js +3 -3
- package/dist/esm/snk-form-config.entry.js +2 -2
- package/dist/esm/snk-form.entry.js +4 -4
- package/dist/esm/snk-grid-config.entry.js +3 -3
- package/dist/esm/snk-grid.entry.js +26 -15
- package/dist/esm/{snk-guides-viewer-cff5e95d.js → snk-guides-viewer-62b0fa69.js} +5 -4
- package/dist/esm/snk-guides-viewer.entry.js +8 -6
- package/dist/esm/snk-personalized-filter.entry.js +19 -9
- package/dist/esm/snk-simple-crud.entry.js +7 -91
- package/dist/sankhyablocks/p-193971ad.js +1 -0
- package/dist/sankhyablocks/{p-54f01129.entry.js → p-19cbe6e2.entry.js} +3 -3
- package/dist/sankhyablocks/{p-ee57d9f5.js → p-240f5892.js} +1 -1
- package/dist/sankhyablocks/p-2c7c1323.entry.js +1 -0
- package/dist/sankhyablocks/p-3253e7f2.entry.js +1 -0
- package/dist/sankhyablocks/{p-c9fa27ce.entry.js → p-57550ddc.entry.js} +1 -1
- package/dist/sankhyablocks/{p-e2160bdd.js → p-5d51bff4.js} +1 -1
- package/dist/sankhyablocks/{p-ebd9f2b1.entry.js → p-5dd52ec5.entry.js} +1 -1
- package/dist/sankhyablocks/p-6541f0df.js +1 -0
- package/dist/sankhyablocks/p-68fbd480.entry.js +1 -0
- package/dist/sankhyablocks/{p-5e5816ed.entry.js → p-8652f90b.entry.js} +1 -1
- package/dist/sankhyablocks/{p-358e8f7b.js → p-910af03c.js} +1 -1
- package/dist/sankhyablocks/p-992a9d0f.js +1 -0
- package/dist/sankhyablocks/p-acb1374c.entry.js +1 -0
- package/dist/sankhyablocks/p-b36053da.entry.js +1 -0
- package/dist/sankhyablocks/p-b481e5ad.js +1 -0
- package/dist/sankhyablocks/p-d264da22.entry.js +1 -0
- package/dist/sankhyablocks/{p-33745612.js → p-d47bbee3.js} +1 -1
- package/dist/sankhyablocks/{p-86d00468.entry.js → p-d563e451.entry.js} +1 -1
- package/dist/sankhyablocks/p-d56b65e3.entry.js +1 -0
- package/dist/sankhyablocks/p-e473ca13.entry.js +1 -0
- package/dist/sankhyablocks/{p-6cd36947.entry.js → p-e74e2153.entry.js} +1 -1
- package/dist/sankhyablocks/p-e86d4a53.js +59 -0
- package/dist/sankhyablocks/{p-d109914d.entry.js → p-ebfa6460.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/snk-application.d.ts +1 -1
- package/dist/types/components/snk-attach/snk-attach.d.ts +1 -0
- package/dist/types/components/snk-grid/filtercolumn/SnkMultiSelectionListDataSource.d.ts +1 -0
- package/dist/types/components/snk-grid/snk-grid.d.ts +3 -4
- package/dist/types/components/snk-personalized-filter/snk-personalized-filter.d.ts +3 -1
- package/dist/types/components.d.ts +3 -2
- package/dist/types/lib/dataUnit/InMemoryLoader.d.ts +2 -1
- package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +1 -1
- 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 +25 -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 +8 -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/package.json +3 -3
- package/dist/cjs/dataunit-fetcher-32bb845f.js +0 -356
- package/dist/esm/dataunit-fetcher-d3033a06.js +0 -354
- package/dist/esm/pesquisa-fetcher-615da3ca.js +0 -165
- package/dist/sankhyablocks/p-0abc880c.entry.js +0 -1
- package/dist/sankhyablocks/p-1284f14a.entry.js +0 -1
- package/dist/sankhyablocks/p-162161ae.entry.js +0 -1
- package/dist/sankhyablocks/p-329f7520.entry.js +0 -1
- package/dist/sankhyablocks/p-401da0a5.entry.js +0 -1
- package/dist/sankhyablocks/p-5d62a74e.js +0 -1
- package/dist/sankhyablocks/p-5e63571e.entry.js +0 -1
- package/dist/sankhyablocks/p-6b2ee5b5.entry.js +0 -1
- package/dist/sankhyablocks/p-719c246f.js +0 -1
- package/dist/sankhyablocks/p-89b3df4c.js +0 -1
- package/dist/sankhyablocks/p-90946802.js +0 -76
- package/dist/sankhyablocks/p-b417c608.entry.js +0 -1
- package/dist/sankhyablocks/p-fa9d3f73.js +0 -1
@@ -1,9 +1,9 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
-
const formConfigFetcher = require('./form-config-fetcher-
|
3
|
+
const formConfigFetcher = require('./form-config-fetcher-a322a522.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-2a99283c.js');
|
7
7
|
|
8
8
|
class GridConfigFetcher extends formConfigFetcher.ResourceFetcher {
|
9
9
|
constructor() {
|
@@ -6543,11 +6543,10 @@ class DataFetcher {
|
|
6543
6543
|
}
|
6544
6544
|
}
|
6545
6545
|
this.instance.application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
6546
|
-
this.instance.graphqlPath = `/${this.instance.application.getModuleName()}/graphql`;
|
6547
6546
|
return this.instance;
|
6548
6547
|
}
|
6549
6548
|
static getGraphQLPath() {
|
6550
|
-
if (core.StringUtils.isEmpty(this.instance.graphqlPath)) {
|
6549
|
+
if (core.StringUtils.isEmpty(this.instance.graphqlPath) && this.instance.application != undefined) {
|
6551
6550
|
this.instance.graphqlPath = `/${this.instance.application.getModuleName()}/graphql`;
|
6552
6551
|
}
|
6553
6552
|
return this.instance.graphqlPath;
|
@@ -6601,7 +6600,7 @@ class DataFetcher {
|
|
6601
6600
|
}
|
6602
6601
|
return new core.ErrorException(title, statusMessage, tsErrorCode);
|
6603
6602
|
}
|
6604
|
-
async callGraphQL(req) {
|
6603
|
+
async callGraphQL(req, quietMode = false) {
|
6605
6604
|
var _a;
|
6606
6605
|
if (this.ready) {
|
6607
6606
|
this.pause();
|
@@ -6619,7 +6618,7 @@ class DataFetcher {
|
|
6619
6618
|
if (this.ready) {
|
6620
6619
|
return new Promise(async (resolve, reject) => {
|
6621
6620
|
let query = this.getQueryTemplate(req);
|
6622
|
-
const res = await this.fecthGrapql([{ document: query, variables: req.values }]);
|
6621
|
+
const res = await this.fecthGrapql([{ document: query, variables: req.values }], quietMode);
|
6623
6622
|
if (res.errors.length > 0) {
|
6624
6623
|
if (!this.proccesGraphQLClientEvents(res === null || res === void 0 ? void 0 : res.extensions, req, resolve, reject)) {
|
6625
6624
|
const error = this.processGraphQlErrorInfo(res.errors);
|
@@ -6634,7 +6633,7 @@ class DataFetcher {
|
|
6634
6633
|
}
|
6635
6634
|
else {
|
6636
6635
|
if (!this.watingRequestsById.has(reqKey)) {
|
6637
|
-
this.watingRequestsById.set(reqKey, new WaitingRequest(req));
|
6636
|
+
this.watingRequestsById.set(reqKey, new WaitingRequest(req, quietMode));
|
6638
6637
|
}
|
6639
6638
|
return (_a = this.watingRequestsById.get(reqKey)) === null || _a === void 0 ? void 0 : _a.promise;
|
6640
6639
|
}
|
@@ -6850,14 +6849,16 @@ class DataFetcher {
|
|
6850
6849
|
}
|
6851
6850
|
async executePendingRequest(watingRequestsById) {
|
6852
6851
|
const requestsBatch = [];
|
6852
|
+
let quietMode = true;
|
6853
6853
|
watingRequestsById.forEach(async (waitingReq) => {
|
6854
6854
|
let query = this.getQueryTemplate(waitingReq.request);
|
6855
6855
|
requestsBatch.push({ document: query, variables: Object.assign({}, waitingReq.request.values) });
|
6856
|
+
quietMode = quietMode && waitingReq.quietMode;
|
6856
6857
|
});
|
6857
6858
|
let res = undefined;
|
6858
6859
|
let dataResponse = [];
|
6859
6860
|
let errorsResponse = [];
|
6860
|
-
res = await this.fecthGrapql(requestsBatch);
|
6861
|
+
res = await this.fecthGrapql(requestsBatch, quietMode);
|
6861
6862
|
dataResponse = res.data;
|
6862
6863
|
errorsResponse = res.errors;
|
6863
6864
|
//Reject promises with errors from query
|
@@ -6875,14 +6876,18 @@ class DataFetcher {
|
|
6875
6876
|
});
|
6876
6877
|
});
|
6877
6878
|
}
|
6878
|
-
async fecthGrapql(request) {
|
6879
|
+
async fecthGrapql(request, quietMode) {
|
6879
6880
|
let res = undefined;
|
6880
6881
|
let dataResponse = [];
|
6881
6882
|
let errorsResponse = [];
|
6882
6883
|
let url = `${this.resolveURL() + DataFetcher.getGraphQLPath()}`;
|
6883
6884
|
const responseExtensions = [];
|
6884
|
-
|
6885
|
-
|
6885
|
+
const mgeSession = window["mgeSession"];
|
6886
|
+
if (mgeSession != undefined) {
|
6887
|
+
url += `?mgeSession=${mgeSession}`;
|
6888
|
+
}
|
6889
|
+
if (quietMode) {
|
6890
|
+
url += `${url.indexOf("?") > -1 ? "&" : "?"}quietMode=true`;
|
6886
6891
|
}
|
6887
6892
|
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url: url, requestBody: request }));
|
6888
6893
|
try {
|
@@ -6968,7 +6973,7 @@ DataFetcher.SERVICE_BROKER_STATUS = {
|
|
6968
6973
|
};
|
6969
6974
|
DataFetcher.clientEventsByID = new Map();
|
6970
6975
|
class WaitingRequest {
|
6971
|
-
constructor(req) {
|
6976
|
+
constructor(req, quietMode) {
|
6972
6977
|
this._resolve = () => { };
|
6973
6978
|
this._reject = () => { };
|
6974
6979
|
this._request = undefined;
|
@@ -6977,6 +6982,7 @@ class WaitingRequest {
|
|
6977
6982
|
this._resolve = resolve;
|
6978
6983
|
this._reject = reject;
|
6979
6984
|
});
|
6985
|
+
this._quietMode = quietMode;
|
6980
6986
|
}
|
6981
6987
|
get resolve() {
|
6982
6988
|
return this._resolve;
|
@@ -6990,6 +6996,9 @@ class WaitingRequest {
|
|
6990
6996
|
get request() {
|
6991
6997
|
return this._request;
|
6992
6998
|
}
|
6999
|
+
get quietMode() {
|
7000
|
+
return this._quietMode;
|
7001
|
+
}
|
6993
7002
|
}
|
6994
7003
|
|
6995
7004
|
exports.DataFetcher = DataFetcher;
|
@@ -1,8 +1,8 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
-
const ConfigStorage = require('./ConfigStorage-
|
3
|
+
const ConfigStorage = require('./ConfigStorage-a97ca159.js');
|
4
4
|
const core = require('@sankhyalabs/core');
|
5
|
-
const formConfigFetcher = require('./form-config-fetcher-
|
5
|
+
const formConfigFetcher = require('./form-config-fetcher-a322a522.js');
|
6
6
|
|
7
7
|
class SnkFormConfigManager {
|
8
8
|
constructor(configName, resourceID, onConfigChange) {
|
@@ -1,6 +1,7 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
3
|
const core = require('@sankhyalabs/core');
|
4
|
+
const dataunitFetcher = require('./dataunit-fetcher-4f7d4ee7.js');
|
4
5
|
|
5
6
|
class SnkMultiSelectionListDataSource {
|
6
7
|
setDataUnit(dataUnit) {
|
@@ -16,6 +17,16 @@ class SnkMultiSelectionListDataSource {
|
|
16
17
|
}
|
17
18
|
return String(this._dataUnit.getFormattedValue(fieldName, value));
|
18
19
|
}
|
20
|
+
async getStaticOptions(fieldName) {
|
21
|
+
if (fieldName == undefined) {
|
22
|
+
return Promise.resolve(undefined);
|
23
|
+
}
|
24
|
+
const result = await dataunitFetcher.PreloadManager.getDistinct(this._dataUnit, fieldName);
|
25
|
+
if (result == undefined) {
|
26
|
+
return Promise.resolve(undefined);
|
27
|
+
}
|
28
|
+
return Promise.resolve(Array.from(result.entries()).map(([label, value]) => ({ label: String(label), value, check: true })));
|
29
|
+
}
|
19
30
|
fetchData(filterTerm, fieldName) {
|
20
31
|
return new Promise(resolve => {
|
21
32
|
this._application.executeSelectDistinct(this._dataUnit, fieldName, filterTerm).then(result => {
|
@@ -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-a322a522.js');
|
5
5
|
|
6
6
|
class AuthFetcher extends formConfigFetcher.ResourceFetcher {
|
7
7
|
getData(resourceID) {
|