@sankhyalabs/sankhyablocks 0.0.0-feat-dev-KB-8702.2 → 0.0.0-feat-dev-KB-14960.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.
Files changed (131) hide show
  1. package/dist/cjs/{ConfigStorage-fb53e5ef.js → ConfigStorage-2f4b9934.js} +2 -2
  2. package/dist/cjs/{DataFetcher-3f9e6ee2.js → DataFetcher-adb2beb4.js} +18 -8
  3. package/dist/cjs/{SnkFormConfigManager-eb7d2863.js → SnkFormConfigManager-2c711d00.js} +2 -2
  4. package/dist/cjs/{SnkMultiSelectionListDataSource-804ff4c7.js → SnkMultiSelectionListDataSource-8aae47a4.js} +11 -0
  5. package/dist/cjs/{auth-fetcher-8ba4a15e.js → auth-fetcher-e1d8c26b.js} +1 -1
  6. package/dist/cjs/dataunit-fetcher-70d1c070.js +846 -0
  7. package/dist/cjs/{form-config-fetcher-037d16de.js → form-config-fetcher-ad090dd1.js} +1 -1
  8. package/dist/cjs/{pesquisa-fetcher-b5b42098.js → pesquisa-fetcher-64473c9f.js} +1 -1
  9. package/dist/cjs/snk-actions-button.cjs.entry.js +4 -3
  10. package/dist/cjs/snk-application.cjs.entry.js +17 -8
  11. package/dist/cjs/snk-attach.cjs.entry.js +3 -2
  12. package/dist/cjs/snk-crud.cjs.entry.js +6 -4
  13. package/dist/cjs/snk-data-exporter.cjs.entry.js +1 -1
  14. package/dist/cjs/snk-detail-view.cjs.entry.js +8 -6
  15. package/dist/cjs/snk-filter-bar.cjs.entry.js +3 -3
  16. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
  17. package/dist/cjs/snk-form-config.cjs.entry.js +2 -2
  18. package/dist/cjs/snk-form.cjs.entry.js +4 -4
  19. package/dist/cjs/snk-grid-config.cjs.entry.js +3 -3
  20. package/dist/cjs/snk-grid.cjs.entry.js +8 -5
  21. package/dist/cjs/{snk-guides-viewer-d1ad91bc.js → snk-guides-viewer-20d219c5.js} +5 -4
  22. package/dist/cjs/snk-guides-viewer.cjs.entry.js +8 -6
  23. package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
  24. package/dist/cjs/snk-simple-crud.cjs.entry.js +6 -4
  25. package/dist/collection/collection-manifest.json +1 -1
  26. package/dist/collection/components/snk-application/snk-application.js +11 -3
  27. package/dist/collection/components/snk-attach/snk-attach.js +1 -1
  28. package/dist/collection/components/snk-grid/filtercolumn/SnkMultiSelectionListDataSource.js +11 -0
  29. package/dist/collection/components/snk-grid/snk-grid.js +1 -1
  30. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +18 -8
  31. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.js +119 -0
  32. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.js +59 -0
  33. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.js +169 -0
  34. package/dist/collection/lib/http/data-fetcher/fetchers/{dataunit-fetcher.js → data-unit/dataunit-fetcher.js} +48 -100
  35. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadDataResult.js +1 -0
  36. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadDataStrategy.js +1 -0
  37. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadingInfo.js +1 -0
  38. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRecordField.js +1 -0
  39. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IResponseRecord.js +1 -0
  40. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DataUnitStrategy.js +68 -0
  41. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +135 -0
  42. package/dist/collection/lib/index.js +1 -1
  43. package/dist/components/DataFetcher.js +18 -8
  44. package/dist/components/SnkMultiSelectionListDataSource.js +11 -0
  45. package/dist/components/dataunit-fetcher.js +750 -100
  46. package/dist/components/snk-actions-button2.js +1 -1
  47. package/dist/components/snk-application2.js +11 -4
  48. package/dist/components/snk-crud.js +1 -1
  49. package/dist/components/snk-detail-view2.js +1 -1
  50. package/dist/components/snk-grid2.js +1 -1
  51. package/dist/components/snk-simple-crud2.js +1 -1
  52. package/dist/esm/{ConfigStorage-2e1bc7e8.js → ConfigStorage-e6764b0c.js} +2 -2
  53. package/dist/esm/{DataFetcher-bc95bc22.js → DataFetcher-942f617d.js} +18 -8
  54. package/dist/esm/{SnkFormConfigManager-dfec39b7.js → SnkFormConfigManager-677b123e.js} +2 -2
  55. package/dist/esm/{SnkMultiSelectionListDataSource-892f37f9.js → SnkMultiSelectionListDataSource-1871aa5f.js} +11 -0
  56. package/dist/esm/{auth-fetcher-c76146d0.js → auth-fetcher-08a26786.js} +1 -1
  57. package/dist/esm/dataunit-fetcher-7d7726bb.js +843 -0
  58. package/dist/esm/{form-config-fetcher-5df96b19.js → form-config-fetcher-cfd32134.js} +1 -1
  59. package/dist/{components/pesquisa-fetcher.js → esm/pesquisa-fetcher-87ae964a.js} +1 -1
  60. package/dist/esm/snk-actions-button.entry.js +4 -3
  61. package/dist/esm/snk-application.entry.js +17 -8
  62. package/dist/esm/snk-attach.entry.js +3 -2
  63. package/dist/esm/snk-crud.entry.js +6 -4
  64. package/dist/esm/snk-data-exporter.entry.js +1 -1
  65. package/dist/esm/snk-detail-view.entry.js +8 -6
  66. package/dist/esm/snk-filter-bar.entry.js +3 -3
  67. package/dist/esm/snk-filter-modal-item.entry.js +3 -3
  68. package/dist/esm/snk-form-config.entry.js +2 -2
  69. package/dist/esm/snk-form.entry.js +4 -4
  70. package/dist/esm/snk-grid-config.entry.js +3 -3
  71. package/dist/esm/snk-grid.entry.js +8 -5
  72. package/dist/esm/{snk-guides-viewer-0ddda0e3.js → snk-guides-viewer-dcbfd2a6.js} +5 -4
  73. package/dist/esm/snk-guides-viewer.entry.js +8 -6
  74. package/dist/esm/snk-personalized-filter.entry.js +3 -3
  75. package/dist/esm/snk-simple-crud.entry.js +6 -4
  76. package/dist/sankhyablocks/{p-a28eb16d.js → p-0a8051a0.js} +1 -1
  77. package/dist/sankhyablocks/p-177fa5be.entry.js +1 -0
  78. package/dist/sankhyablocks/{p-35ae5f31.entry.js → p-1c44a9c9.entry.js} +1 -1
  79. package/dist/sankhyablocks/{p-af528a79.entry.js → p-21b7a2ad.entry.js} +1 -1
  80. package/dist/sankhyablocks/{p-1386c7f8.js → p-4da393be.js} +1 -1
  81. package/dist/sankhyablocks/p-505b29cb.entry.js +1 -0
  82. package/dist/sankhyablocks/p-6765e2a4.js +76 -0
  83. package/dist/sankhyablocks/{p-363917d8.entry.js → p-6982fb80.entry.js} +2 -2
  84. package/dist/sankhyablocks/{p-dcd8addc.entry.js → p-6eecdca7.entry.js} +1 -1
  85. package/dist/sankhyablocks/{p-c5cb4981.js → p-706bbc00.js} +2 -2
  86. package/dist/sankhyablocks/p-75df7885.entry.js +1 -0
  87. package/dist/sankhyablocks/{p-82fea73a.entry.js → p-7cf5a03a.entry.js} +1 -1
  88. package/dist/sankhyablocks/p-88ede1c0.js +1 -0
  89. package/dist/sankhyablocks/{p-2693e46d.entry.js → p-a6febf2b.entry.js} +1 -1
  90. package/dist/sankhyablocks/p-ac6768e8.js +1 -0
  91. package/dist/sankhyablocks/p-c70618a0.entry.js +1 -0
  92. package/dist/sankhyablocks/p-d61c6a82.js +1 -0
  93. package/dist/sankhyablocks/p-ddaf32de.entry.js +1 -0
  94. package/dist/sankhyablocks/{p-2299d7ab.entry.js → p-e15011a6.entry.js} +1 -1
  95. package/dist/sankhyablocks/p-e66e2631.entry.js +1 -0
  96. package/dist/sankhyablocks/p-e84fd2e5.js +1 -0
  97. package/dist/sankhyablocks/{p-5bff3564.js → p-ee43700b.js} +1 -1
  98. package/dist/sankhyablocks/{p-01997cbe.entry.js → p-fe5d2b2e.entry.js} +1 -1
  99. package/dist/sankhyablocks/p-ff712e39.entry.js +1 -0
  100. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  101. package/dist/types/components/snk-application/snk-application.d.ts +1 -1
  102. package/dist/types/components/snk-grid/filtercolumn/SnkMultiSelectionListDataSource.d.ts +1 -0
  103. package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +1 -1
  104. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.d.ts +14 -0
  105. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.d.ts +19 -0
  106. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.d.ts +23 -0
  107. package/dist/types/lib/http/data-fetcher/fetchers/{dataunit-fetcher.d.ts → data-unit/dataunit-fetcher.d.ts} +5 -3
  108. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadDataResult.d.ts +6 -0
  109. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadDataStrategy.d.ts +7 -0
  110. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadingInfo.d.ts +9 -0
  111. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRecordField.d.ts +4 -0
  112. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/IResponseRecord.d.ts +6 -0
  113. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DataUnitStrategy.d.ts +9 -0
  114. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.d.ts +15 -0
  115. package/dist/types/lib/index.d.ts +1 -1
  116. package/package.json +5 -5
  117. package/dist/cjs/dataunit-fetcher-f4023df4.js +0 -356
  118. package/dist/esm/dataunit-fetcher-b64f839d.js +0 -354
  119. package/dist/esm/pesquisa-fetcher-7e282f7e.js +0 -165
  120. package/dist/sankhyablocks/p-1d63beb6.js +0 -76
  121. package/dist/sankhyablocks/p-2f06d6b3.entry.js +0 -1
  122. package/dist/sankhyablocks/p-42ec116e.js +0 -1
  123. package/dist/sankhyablocks/p-5fc1c8c2.entry.js +0 -1
  124. package/dist/sankhyablocks/p-6020355f.entry.js +0 -1
  125. package/dist/sankhyablocks/p-60d44a52.js +0 -1
  126. package/dist/sankhyablocks/p-7554931d.entry.js +0 -1
  127. package/dist/sankhyablocks/p-a78a4c71.entry.js +0 -1
  128. package/dist/sankhyablocks/p-ccffe6f0.entry.js +0 -1
  129. package/dist/sankhyablocks/p-d567e5ce.js +0 -1
  130. package/dist/sankhyablocks/p-fa9d3f73.js +0 -1
  131. package/dist/sankhyablocks/p-fd2a9a9d.entry.js +0 -1
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- const formConfigFetcher = require('./form-config-fetcher-037d16de.js');
3
+ const formConfigFetcher = require('./form-config-fetcher-ad090dd1.js');
4
4
  const filterItemType_enum = require('./filter-item-type.enum-aa823a00.js');
5
- const DataFetcher = require('./DataFetcher-3f9e6ee2.js');
5
+ const DataFetcher = require('./DataFetcher-adb2beb4.js');
6
6
 
7
7
  class GridConfigFetcher extends formConfigFetcher.ResourceFetcher {
8
8
  constructor() {
@@ -6595,7 +6595,7 @@ class DataFetcher {
6595
6595
  }
6596
6596
  return new core.ErrorException(title, statusMessage, tsErrorCode);
6597
6597
  }
6598
- async callGraphQL(req) {
6598
+ async callGraphQL(req, quietMode = false) {
6599
6599
  var _a;
6600
6600
  if (this.ready) {
6601
6601
  this.pause();
@@ -6613,7 +6613,7 @@ class DataFetcher {
6613
6613
  if (this.ready) {
6614
6614
  return new Promise(async (resolve, reject) => {
6615
6615
  let query = this.getQueryTemplate(req);
6616
- const res = await this.fecthGrapql([{ document: query, variables: req.values }]);
6616
+ const res = await this.fecthGrapql([{ document: query, variables: req.values }], quietMode);
6617
6617
  if (res.errors.length > 0) {
6618
6618
  if (!this.proccesGraphQLClientEvents(res === null || res === void 0 ? void 0 : res.extensions, req, resolve, reject)) {
6619
6619
  const error = this.processGraphQlErrorInfo(res.errors);
@@ -6628,7 +6628,7 @@ class DataFetcher {
6628
6628
  }
6629
6629
  else {
6630
6630
  if (!this.watingRequestsById.has(reqKey)) {
6631
- this.watingRequestsById.set(reqKey, new WaitingRequest(req));
6631
+ this.watingRequestsById.set(reqKey, new WaitingRequest(req, quietMode));
6632
6632
  }
6633
6633
  return (_a = this.watingRequestsById.get(reqKey)) === null || _a === void 0 ? void 0 : _a.promise;
6634
6634
  }
@@ -6844,14 +6844,16 @@ class DataFetcher {
6844
6844
  }
6845
6845
  async executePendingRequest(watingRequestsById) {
6846
6846
  const requestsBatch = [];
6847
+ let quietMode = true;
6847
6848
  watingRequestsById.forEach(async (waitingReq) => {
6848
6849
  let query = this.getQueryTemplate(waitingReq.request);
6849
6850
  requestsBatch.push({ document: query, variables: Object.assign({}, waitingReq.request.values) });
6851
+ quietMode = quietMode && waitingReq.quietMode;
6850
6852
  });
6851
6853
  let res = undefined;
6852
6854
  let dataResponse = [];
6853
6855
  let errorsResponse = [];
6854
- res = await this.fecthGrapql(requestsBatch);
6856
+ res = await this.fecthGrapql(requestsBatch, quietMode);
6855
6857
  dataResponse = res.data;
6856
6858
  errorsResponse = res.errors;
6857
6859
  //Reject promises with errors from query
@@ -6869,14 +6871,18 @@ class DataFetcher {
6869
6871
  });
6870
6872
  });
6871
6873
  }
6872
- async fecthGrapql(request) {
6874
+ async fecthGrapql(request, quietMode) {
6873
6875
  let res = undefined;
6874
6876
  let dataResponse = [];
6875
6877
  let errorsResponse = [];
6876
6878
  let url = `${this.resolveURL() + this.GRAPHQL_PATH}`;
6877
6879
  const responseExtensions = [];
6878
- if (window['mgeSession']) {
6879
- url += `?mgeSession=${window['mgeSession']}`;
6880
+ const mgeSession = window["mgeSession"];
6881
+ if (mgeSession != undefined) {
6882
+ url += `?mgeSession=${mgeSession}`;
6883
+ }
6884
+ if (quietMode) {
6885
+ url += `${url.indexOf("?") > -1 ? "&" : "?"}quietMode=true`;
6880
6886
  }
6881
6887
  DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url: url, requestBody: request }));
6882
6888
  try {
@@ -6962,7 +6968,7 @@ DataFetcher.SERVICE_BROKER_STATUS = {
6962
6968
  };
6963
6969
  DataFetcher.clientEventsByID = new Map();
6964
6970
  class WaitingRequest {
6965
- constructor(req) {
6971
+ constructor(req, quietMode) {
6966
6972
  this._resolve = () => { };
6967
6973
  this._reject = () => { };
6968
6974
  this._request = undefined;
@@ -6971,6 +6977,7 @@ class WaitingRequest {
6971
6977
  this._resolve = resolve;
6972
6978
  this._reject = reject;
6973
6979
  });
6980
+ this._quietMode = quietMode;
6974
6981
  }
6975
6982
  get resolve() {
6976
6983
  return this._resolve;
@@ -6984,6 +6991,9 @@ class WaitingRequest {
6984
6991
  get request() {
6985
6992
  return this._request;
6986
6993
  }
6994
+ get quietMode() {
6995
+ return this._quietMode;
6996
+ }
6987
6997
  }
6988
6998
 
6989
6999
  exports.DataFetcher = DataFetcher;
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- const ConfigStorage = require('./ConfigStorage-fb53e5ef.js');
3
+ const ConfigStorage = require('./ConfigStorage-2f4b9934.js');
4
4
  const core = require('@sankhyalabs/core');
5
- const formConfigFetcher = require('./form-config-fetcher-037d16de.js');
5
+ const formConfigFetcher = require('./form-config-fetcher-ad090dd1.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-70d1c070.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-037d16de.js');
4
+ const formConfigFetcher = require('./form-config-fetcher-ad090dd1.js');
5
5
 
6
6
  class AuthFetcher extends formConfigFetcher.ResourceFetcher {
7
7
  getData(resourceID) {