@sankhyalabs/sankhyablocks 8.6.0 → 8.8.0-dev.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.
Files changed (142) hide show
  1. package/dist/cjs/{ConfigStorage-bbffce76.js → ConfigStorage-a97ca159.js} +2 -2
  2. package/dist/cjs/{DataFetcher-0cc561bc.js → DataFetcher-2a99283c.js} +25 -10
  3. package/dist/cjs/{SnkFormConfigManager-c49af777.js → SnkFormConfigManager-f641f502.js} +2 -2
  4. package/dist/cjs/{SnkMultiSelectionListDataSource-804ff4c7.js → SnkMultiSelectionListDataSource-56db34ee.js} +11 -0
  5. package/dist/cjs/{auth-fetcher-fff2319e.js → auth-fetcher-78231356.js} +1 -1
  6. package/dist/cjs/dataunit-fetcher-4f7d4ee7.js +878 -0
  7. package/dist/cjs/{form-config-fetcher-35752aad.js → form-config-fetcher-a322a522.js} +1 -1
  8. package/dist/cjs/{pesquisa-fetcher-415eab63.js → pesquisa-fetcher-7ef61508.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 +16 -3
  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 +25 -14
  21. package/dist/cjs/{snk-guides-viewer-36b39c9c.js → snk-guides-viewer-aab80f66.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 +19 -9
  24. package/dist/cjs/snk-simple-crud.cjs.entry.js +8 -92
  25. package/dist/collection/components/snk-application/snk-application.js +11 -3
  26. package/dist/collection/components/snk-attach/snk-attach.js +14 -2
  27. package/dist/collection/components/snk-grid/filtercolumn/SnkMultiSelectionListDataSource.js +11 -0
  28. package/dist/collection/components/snk-grid/snk-grid.js +24 -14
  29. package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js +16 -6
  30. package/dist/collection/lib/dataUnit/InMemoryLoader.js +23 -2
  31. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +25 -10
  32. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.js +113 -0
  33. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.js +59 -0
  34. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.js +169 -0
  35. package/dist/collection/lib/http/data-fetcher/fetchers/{dataunit-fetcher.js → data-unit/dataunit-fetcher.js} +48 -100
  36. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadDataResult.js +1 -0
  37. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadDataStrategy.js +1 -0
  38. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadingInfo.js +1 -0
  39. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRecordField.js +1 -0
  40. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IResponseRecord.js +1 -0
  41. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DataUnitStrategy.js +68 -0
  42. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +131 -0
  43. package/dist/collection/lib/index.js +1 -1
  44. package/dist/components/DataFetcher.js +26 -11
  45. package/dist/components/SnkMultiSelectionListDataSource.js +11 -0
  46. package/dist/components/dataunit-fetcher.js +781 -100
  47. package/dist/components/snk-actions-button2.js +1 -1
  48. package/dist/components/snk-application2.js +11 -4
  49. package/dist/components/snk-attach2.js +13 -1
  50. package/dist/components/snk-crud.js +1 -1
  51. package/dist/components/snk-detail-view2.js +1 -1
  52. package/dist/components/snk-grid2.js +19 -11
  53. package/dist/components/snk-personalized-filter2.js +16 -6
  54. package/dist/components/snk-simple-crud2.js +2 -88
  55. package/dist/esm/{ConfigStorage-80ca14d5.js → ConfigStorage-26f89143.js} +2 -2
  56. package/dist/esm/{DataFetcher-044e3988.js → DataFetcher-90e91631.js} +26 -11
  57. package/dist/esm/{SnkFormConfigManager-1a8b3a44.js → SnkFormConfigManager-18948123.js} +2 -2
  58. package/dist/esm/{SnkMultiSelectionListDataSource-892f37f9.js → SnkMultiSelectionListDataSource-b9410c72.js} +11 -0
  59. package/dist/esm/{auth-fetcher-1b378f8e.js → auth-fetcher-a8c8ee7e.js} +1 -1
  60. package/dist/esm/dataunit-fetcher-1c2ccae2.js +874 -0
  61. package/dist/esm/{form-config-fetcher-c702e9e3.js → form-config-fetcher-7c3b6273.js} +1 -1
  62. package/dist/{components/pesquisa-fetcher.js → esm/pesquisa-fetcher-90d6853b.js} +1 -1
  63. package/dist/esm/snk-actions-button.entry.js +4 -3
  64. package/dist/esm/snk-application.entry.js +17 -8
  65. package/dist/esm/snk-attach.entry.js +16 -3
  66. package/dist/esm/snk-crud.entry.js +6 -4
  67. package/dist/esm/snk-data-exporter.entry.js +1 -1
  68. package/dist/esm/snk-detail-view.entry.js +8 -6
  69. package/dist/esm/snk-filter-bar.entry.js +3 -3
  70. package/dist/esm/snk-filter-modal-item.entry.js +3 -3
  71. package/dist/esm/snk-form-config.entry.js +2 -2
  72. package/dist/esm/snk-form.entry.js +4 -4
  73. package/dist/esm/snk-grid-config.entry.js +3 -3
  74. package/dist/esm/snk-grid.entry.js +26 -15
  75. package/dist/esm/{snk-guides-viewer-767ad354.js → snk-guides-viewer-62b0fa69.js} +5 -4
  76. package/dist/esm/snk-guides-viewer.entry.js +8 -6
  77. package/dist/esm/snk-personalized-filter.entry.js +19 -9
  78. package/dist/esm/snk-simple-crud.entry.js +7 -91
  79. package/dist/sankhyablocks/p-193971ad.js +1 -0
  80. package/dist/sankhyablocks/{p-dacb4c4c.entry.js → p-19cbe6e2.entry.js} +3 -3
  81. package/dist/sankhyablocks/{p-76926391.js → p-240f5892.js} +2 -2
  82. package/dist/sankhyablocks/p-2c7c1323.entry.js +1 -0
  83. package/dist/sankhyablocks/p-3253e7f2.entry.js +1 -0
  84. package/dist/sankhyablocks/{p-d1cc9007.entry.js → p-57550ddc.entry.js} +1 -1
  85. package/dist/sankhyablocks/p-5d51bff4.js +1 -0
  86. package/dist/sankhyablocks/{p-727b8cbe.entry.js → p-5dd52ec5.entry.js} +1 -1
  87. package/dist/sankhyablocks/p-6541f0df.js +1 -0
  88. package/dist/sankhyablocks/p-68fbd480.entry.js +1 -0
  89. package/dist/sankhyablocks/{p-845c7480.entry.js → p-8652f90b.entry.js} +1 -1
  90. package/dist/sankhyablocks/{p-a2c7c45f.js → p-910af03c.js} +1 -1
  91. package/dist/sankhyablocks/p-992a9d0f.js +1 -0
  92. package/dist/sankhyablocks/p-acb1374c.entry.js +1 -0
  93. package/dist/sankhyablocks/p-b36053da.entry.js +1 -0
  94. package/dist/sankhyablocks/p-b481e5ad.js +1 -0
  95. package/dist/sankhyablocks/p-d264da22.entry.js +1 -0
  96. package/dist/sankhyablocks/{p-af86752b.js → p-d47bbee3.js} +1 -1
  97. package/dist/sankhyablocks/{p-e46dd27b.entry.js → p-d563e451.entry.js} +1 -1
  98. package/dist/sankhyablocks/p-d56b65e3.entry.js +1 -0
  99. package/dist/sankhyablocks/p-e473ca13.entry.js +1 -0
  100. package/dist/sankhyablocks/{p-3ef37b31.entry.js → p-e74e2153.entry.js} +1 -1
  101. package/dist/sankhyablocks/p-e86d4a53.js +59 -0
  102. package/dist/sankhyablocks/{p-90c07587.entry.js → p-ebfa6460.entry.js} +1 -1
  103. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  104. package/dist/types/components/snk-application/snk-application.d.ts +1 -1
  105. package/dist/types/components/snk-attach/snk-attach.d.ts +1 -0
  106. package/dist/types/components/snk-grid/filtercolumn/SnkMultiSelectionListDataSource.d.ts +1 -0
  107. package/dist/types/components/snk-grid/snk-grid.d.ts +3 -4
  108. package/dist/types/components/snk-personalized-filter/snk-personalized-filter.d.ts +3 -1
  109. package/dist/types/components.d.ts +3 -2
  110. package/dist/types/lib/dataUnit/InMemoryLoader.d.ts +2 -1
  111. package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +2 -1
  112. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.d.ts +13 -0
  113. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.d.ts +19 -0
  114. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.d.ts +25 -0
  115. package/dist/types/lib/http/data-fetcher/fetchers/{dataunit-fetcher.d.ts → data-unit/dataunit-fetcher.d.ts} +5 -3
  116. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadDataResult.d.ts +6 -0
  117. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadDataStrategy.d.ts +7 -0
  118. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadingInfo.d.ts +8 -0
  119. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRecordField.d.ts +4 -0
  120. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/IResponseRecord.d.ts +6 -0
  121. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DataUnitStrategy.d.ts +9 -0
  122. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.d.ts +15 -0
  123. package/dist/types/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.d.ts +1 -1
  124. package/dist/types/lib/index.d.ts +1 -1
  125. package/package.json +3 -3
  126. package/dist/cjs/dataunit-fetcher-16b32d96.js +0 -356
  127. package/dist/esm/dataunit-fetcher-e0361781.js +0 -354
  128. package/dist/esm/pesquisa-fetcher-d1b4e5a2.js +0 -165
  129. package/dist/sankhyablocks/p-15578509.entry.js +0 -1
  130. package/dist/sankhyablocks/p-1f32ad9c.entry.js +0 -1
  131. package/dist/sankhyablocks/p-2043a64f.js +0 -1
  132. package/dist/sankhyablocks/p-251985c1.entry.js +0 -1
  133. package/dist/sankhyablocks/p-3c1759ba.entry.js +0 -1
  134. package/dist/sankhyablocks/p-473c7df4.js +0 -1
  135. package/dist/sankhyablocks/p-77aebc26.js +0 -1
  136. package/dist/sankhyablocks/p-867e9b79.js +0 -1
  137. package/dist/sankhyablocks/p-8d1602f2.entry.js +0 -1
  138. package/dist/sankhyablocks/p-98ae8ddc.entry.js +0 -1
  139. package/dist/sankhyablocks/p-9de24cf3.entry.js +0 -1
  140. package/dist/sankhyablocks/p-b6d54b6c.entry.js +0 -1
  141. package/dist/sankhyablocks/p-d5b11196.js +0 -76
  142. package/dist/sankhyablocks/p-fa9d3f73.js +0 -1
@@ -1,4 +1,4 @@
1
- import { DataType, ApplicationContext, ErrorException, WarningException, ObjectUtils, StringUtils } from '@sankhyalabs/core';
1
+ import { DataType, ApplicationContext, StringUtils, ErrorException, WarningException, ObjectUtils } from '@sankhyalabs/core';
2
2
  import { c as createCommonjsModule, a as commonjsGlobal } from './_commonjsHelpers.js';
3
3
  import { DataUnitTransient } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
4
4
  import { P as PrintUtils } from './PrintUtils.js';
@@ -6541,9 +6541,14 @@ class DataFetcher {
6541
6541
  }
6542
6542
  }
6543
6543
  this.instance.application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
6544
- this.instance.graphqlPath = `/${this.instance.application.getModuleName()}/graphql`;
6545
6544
  return this.instance;
6546
6545
  }
6546
+ static getGraphQLPath() {
6547
+ if (StringUtils.isEmpty(this.instance.graphqlPath) && this.instance.application != undefined) {
6548
+ this.instance.graphqlPath = `/${this.instance.application.getModuleName()}/graphql`;
6549
+ }
6550
+ return this.instance.graphqlPath;
6551
+ }
6547
6552
  static addRequestListener(listener) {
6548
6553
  const index = DataFetcher.requestListener.indexOf(listener);
6549
6554
  if (index < 0) {
@@ -6593,7 +6598,7 @@ class DataFetcher {
6593
6598
  }
6594
6599
  return new ErrorException(title, statusMessage, tsErrorCode);
6595
6600
  }
6596
- async callGraphQL(req) {
6601
+ async callGraphQL(req, quietMode = false) {
6597
6602
  var _a;
6598
6603
  if (this.ready) {
6599
6604
  this.pause();
@@ -6611,7 +6616,7 @@ class DataFetcher {
6611
6616
  if (this.ready) {
6612
6617
  return new Promise(async (resolve, reject) => {
6613
6618
  let query = this.getQueryTemplate(req);
6614
- const res = await this.fecthGrapql([{ document: query, variables: req.values }]);
6619
+ const res = await this.fecthGrapql([{ document: query, variables: req.values }], quietMode);
6615
6620
  if (res.errors.length > 0) {
6616
6621
  if (!this.proccesGraphQLClientEvents(res === null || res === void 0 ? void 0 : res.extensions, req, resolve, reject)) {
6617
6622
  const error = this.processGraphQlErrorInfo(res.errors);
@@ -6626,7 +6631,7 @@ class DataFetcher {
6626
6631
  }
6627
6632
  else {
6628
6633
  if (!this.watingRequestsById.has(reqKey)) {
6629
- this.watingRequestsById.set(reqKey, new WaitingRequest(req));
6634
+ this.watingRequestsById.set(reqKey, new WaitingRequest(req, quietMode));
6630
6635
  }
6631
6636
  return (_a = this.watingRequestsById.get(reqKey)) === null || _a === void 0 ? void 0 : _a.promise;
6632
6637
  }
@@ -6842,14 +6847,16 @@ class DataFetcher {
6842
6847
  }
6843
6848
  async executePendingRequest(watingRequestsById) {
6844
6849
  const requestsBatch = [];
6850
+ let quietMode = true;
6845
6851
  watingRequestsById.forEach(async (waitingReq) => {
6846
6852
  let query = this.getQueryTemplate(waitingReq.request);
6847
6853
  requestsBatch.push({ document: query, variables: Object.assign({}, waitingReq.request.values) });
6854
+ quietMode = quietMode && waitingReq.quietMode;
6848
6855
  });
6849
6856
  let res = undefined;
6850
6857
  let dataResponse = [];
6851
6858
  let errorsResponse = [];
6852
- res = await this.fecthGrapql(requestsBatch);
6859
+ res = await this.fecthGrapql(requestsBatch, quietMode);
6853
6860
  dataResponse = res.data;
6854
6861
  errorsResponse = res.errors;
6855
6862
  //Reject promises with errors from query
@@ -6867,14 +6874,18 @@ class DataFetcher {
6867
6874
  });
6868
6875
  });
6869
6876
  }
6870
- async fecthGrapql(request) {
6877
+ async fecthGrapql(request, quietMode) {
6871
6878
  let res = undefined;
6872
6879
  let dataResponse = [];
6873
6880
  let errorsResponse = [];
6874
- let url = `${this.resolveURL() + this.graphqlPath}`;
6881
+ let url = `${this.resolveURL() + DataFetcher.getGraphQLPath()}`;
6875
6882
  const responseExtensions = [];
6876
- if (window['mgeSession']) {
6877
- url += `?mgeSession=${window['mgeSession']}`;
6883
+ const mgeSession = window["mgeSession"];
6884
+ if (mgeSession != undefined) {
6885
+ url += `?mgeSession=${mgeSession}`;
6886
+ }
6887
+ if (quietMode) {
6888
+ url += `${url.indexOf("?") > -1 ? "&" : "?"}quietMode=true`;
6878
6889
  }
6879
6890
  DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url: url, requestBody: request }));
6880
6891
  try {
@@ -6960,7 +6971,7 @@ DataFetcher.SERVICE_BROKER_STATUS = {
6960
6971
  };
6961
6972
  DataFetcher.clientEventsByID = new Map();
6962
6973
  class WaitingRequest {
6963
- constructor(req) {
6974
+ constructor(req, quietMode) {
6964
6975
  this._resolve = () => { };
6965
6976
  this._reject = () => { };
6966
6977
  this._request = undefined;
@@ -6969,6 +6980,7 @@ class WaitingRequest {
6969
6980
  this._resolve = resolve;
6970
6981
  this._reject = reject;
6971
6982
  });
6983
+ this._quietMode = quietMode;
6972
6984
  }
6973
6985
  get resolve() {
6974
6986
  return this._resolve;
@@ -6982,6 +6994,9 @@ class WaitingRequest {
6982
6994
  get request() {
6983
6995
  return this._request;
6984
6996
  }
6997
+ get quietMode() {
6998
+ return this._quietMode;
6999
+ }
6985
7000
  }
6986
7001
 
6987
7002
  export { DataFetcher as D, UrlUtils as U, dist as d };
@@ -1,4 +1,5 @@
1
1
  import { UserInterface, DateUtils } from '@sankhyalabs/core';
2
+ import { a as PreloadManager } from './dataunit-fetcher.js';
2
3
 
3
4
  class TaskbarProcessor {
4
5
  constructor(defaultButtons) {
@@ -60,6 +61,16 @@ class SnkMultiSelectionListDataSource {
60
61
  }
61
62
  return String(this._dataUnit.getFormattedValue(fieldName, value));
62
63
  }
64
+ async getStaticOptions(fieldName) {
65
+ if (fieldName == undefined) {
66
+ return Promise.resolve(undefined);
67
+ }
68
+ const result = await PreloadManager.getDistinct(this._dataUnit, fieldName);
69
+ if (result == undefined) {
70
+ return Promise.resolve(undefined);
71
+ }
72
+ return Promise.resolve(Array.from(result.entries()).map(([label, value]) => ({ label: String(label), value, check: true })));
73
+ }
63
74
  fetchData(filterTerm, fieldName) {
64
75
  return new Promise(resolve => {
65
76
  this._application.executeSelectDistinct(this._dataUnit, fieldName, filterTerm).then(result => {